This repository has been archived on 2026-10-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
HiNC-2025-win-desktop-Deploy/App/wwwroot/HiAPI-docsite/manual/setup/machine-tool.html
T
2026-09-09 17:35:23 +08:00

294 lines
19 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building Virtual Machine Tools | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Building Virtual Machine Tools | HiAPI-C# 2025 ">
<link rel="icon" href="../../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../../public/docfx.min.css">
<link rel="stylesheet" href="../../public/main.css">
<meta name="docfx:navrel" content="../../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../../index.html">
<img id="logo" class="svg" src="../../img/HiAPI.logo.png" alt="">
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="">
<h1 id="building-virtual-machine-tools">Building Virtual Machine Tools</h1>
<p>A project's machine tool is the kinematic chain between the machine table and the tool spindle: the
anchors that stand for the machine's components, and the branches that carry the motion between
them. A chain is authored once and saved as a file; attaching that file to a project is a separate
step, and one chain serves every project that runs on that machine.</p>
<h2 id="where-it-is">Where it is</h2>
<p>The General Setup page, at <code>/general-setup</code>, reached from the menu bar's <strong>Page</strong> dropdown. Select
the <strong>Machine Tool</strong> branch of the Control Tree (<code>/general-setup?tree=equipment/machine-tool</code>), the
first of the equipment items. The branch is a leaf: the structure of a chain belongs to the
<a href="../utilities/mech-builder.html">Mechanism Builder</a>, so this panel carries no editors for it —
only the identity of whichever chain is attached.</p>
<p>The branch selected on a demo project, at <code>/general-setup?tree=equipment/machine-tool</code>. The panel
under the tree is the whole of it: the <strong>Object Management</strong> (<code>⋮</code>) button, a type badge reading
<code>GeneralXyzabcMachineTool</code>, and the <strong>Name:</strong> and <strong>File:</strong> lines naming the chain in force and the
file it came from. The middle column reads <em>The selected item has no expanded content.</em> — this
branch brings nothing to it — and the canvas is drawing the stock on its fixture.</p>
<p><img src="machine-tool-img/machine-tool-branch.en.png" alt="The Machine Tool branch of the Control Tree selected on the General Setup page, its panel showing the Object Management button, a GeneralXyzabcMachineTool type badge, the chain's name and its project-relative file, the middle column carrying only a caption saying the selected item has no expanded content, and the canvas drawing the workpiece on the fixture"></p>
<div class="NOTE">
<h5>Note</h5>
<p><strong>The equipment canvas does not draw the machine until you ask it to.</strong> The <strong>Scene</strong> dropdown
above the canvas carries a <strong>Solid</strong> group whose <strong>Machine</strong> checkbox starts cleared, so a chain
that loaded perfectly still leaves that canvas showing only the fixture and the workpiece. Tick it
to bring the machine into the same scene — or open the <code>/machine-tool</code> route below, whose canvas
draws the chain on its own.</p>
</div>
<h2 id="attaching-a-chain-to-a-project">Attaching a chain to a project</h2>
<p>A chain file is not a project's machine until it is loaded onto one. The branch root's <strong>Object
Management</strong> (<code>⋮</code>) menu is where a chain arrives and leaves:</p>
<table>
<thead>
<tr>
<th>Entry</th>
<th>What it does</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Load</strong></td>
<td>Picks a <code>.MachineTool</code> or <code>.mt</code> file from the project or the administrator directory and installs it as the project's chain</td>
</tr>
<tr>
<td><strong>New ClMillingDevice</strong></td>
<td>Attaches a CL-driven blank device instead — the one chain type that needs no file, because it has nothing to configure</td>
</tr>
<tr>
<td><strong>Save As</strong></td>
<td>Writes the attached chain back out as a file</td>
</tr>
<tr>
<td><strong>Copy</strong> / <strong>Paste</strong></td>
<td>Carry the chain between projects as XML</td>
</tr>
<tr>
<td><strong>XML</strong></td>
<td>Shows the attached chain as XML and installs the result of an edit</td>
</tr>
</tbody>
</table>
<p>Every chain type other than the CL-driven device arrives by Load, Paste or XML. Installing one
re-attaches the fixture and workpiece buckles and rebuilds the branch, so the rest of the equipment
follows the new machine without being touched.</p>
<div class="TIP">
<h5>Tip</h5>
<p><strong>The shipped machines are one folder deeper than this picker opens.</strong> This menu's picker offers
the project folder and the administrator directory as its two roots, and the shipped resource
library is the <code>Resource</code> folder inside that administrator directory — so a shipped chain is
reached by opening <code>Resource</code>, then <code>MachineTool</code>. The <code>/machine-tool</code> route's own picker lists
that library as a root of its own and opens straight into it, which is the shorter way to the same
files; its Load installs onto the project exactly as this one does.</p>
</div>
<p><strong>A Load from a file also re-points what the project saves.</strong> A chain picked from inside the project
folder is remembered as a path relative to that folder, and one picked from the shipped resource
library relative to the resource root — which is what keeps a project save from writing over a
shared resource file. <strong>New ClMillingDevice</strong> clears that reference instead, so the fresh chain is
saved inside the project rather than over the file the previous one came from. Paste and an XML
apply leave the reference exactly as it was.</p>
<h2 id="checking-what-is-attached">Checking what is attached</h2>
<p>The <code>/machine-tool</code> route is a screen of its own for the same chain: the identity beside a canvas
that draws it. It carries no <strong>Page</strong>-menu entry and is reached by typing the URL. Its fields show
the chain rather than edit it — the name and the note are read-only there — but the folder button
beside them is a working Load, greyed out only until a project is open.</p>
<p>The route on the same demo project, at <code>/machine-tool</code>. The header names the file the chain came
from and repeats its name; the <strong>Identity</strong> card below carries the read-only name, the empty note
and the type chip; the <strong>GUI</strong> / <strong>XML</strong> toggle at the right swaps that card for the chain's XML;
and the <strong>Display</strong> panel draws the five-axis chain the file describes.</p>
<p><img src="machine-tool-img/machine-tool-route.en.png" alt="The Machine Tool route showing the loaded chain's file path and name in the header, an Identity card with a read-only name, an empty note and a GeneralXyzabcMachineTool type chip, and a Display panel drawing a five-axis machine with a rotary table"></p>
<h2 id="building-the-chain">Building the chain</h2>
<p>Structure is assembled in the <a href="../utilities/mech-builder.html">Mechanism Builder</a> and saved with
its <strong>Save As Machine Tool</strong> entry. That save checks none of this: a mechanism whose end anchors are
mis-cased or missing is written out without a word, and the mistake surfaces only later, on the
screen where the file is loaded onto a project. What that page cannot tell you is what to <em>call</em>
things: the chain reads its own topology by keyword, so the names below are not labels but the
mechanism by which the machine works at all.</p>
<ol>
<li><strong>Name the motion axes on the branches.</strong> A linear axis is a branch named <code>X</code>, <code>Y</code> or <code>Z</code>; a
rotary axis is a branch named <code>A</code>, <code>B</code> or <code>C</code>. Use each keyword at most once — a machine without
a given axis simply has no branch carrying that keyword.</li>
<li><strong>Give each axis branch a matching transformer.</strong> A branch named <code>X</code>, <code>Y</code> or <code>Z</code> must carry a
<strong>Dynamic Translation</strong>, and one named <code>A</code>, <code>B</code> or <code>C</code> a <strong>Dynamic Rotation</strong>. The keyword and
the transformer kind are read together: a branch correctly named but left on a static transformer
contributes no axis, and the machine ends up with one fewer than it looks like it has.</li>
<li><strong>Name the anchors that hold the chain together.</strong> <code>O</code> is the ground anchor, <code>base</code> the machine
base, <code>t</code> the tool-end anchor that tools connect to, and <code>w</code> the worktable-end anchor that
fixtures and workpieces connect to. The machine needs exactly one <code>t</code> and one <code>w</code>. The two are
checked one at a time and the worktable end goes first, so a chain missing both is refused
naming only <code>w</code>; <code>t</code> is named on the next attempt, once <code>w</code> is in place. A second refusal after
a rename is the next keyword, not a new fault.</li>
<li><strong>Give the anchors shapes.</strong> Optional, and driven from the builder's Geometry card.</li>
<li><strong>Save the topology as a machine tool file</strong>, then attach it to a project as above.</li>
</ol>
<div class="IMPORTANT">
<h5>Important</h5>
<p><strong>Every keyword is matched exactly as written.</strong> The motion axes are upper-case <code>X</code>, <code>Y</code>, <code>Z</code>,
<code>A</code>, <code>B</code>, <code>C</code>; the ground anchor is upper-case <code>O</code>; and the base and the two end anchors are
lower-case <code>base</code>, <code>t</code> and <code>w</code>. A name differing only in letter case names nothing at all. A
mis-cased axis is silent — that axis is simply absent — while an end anchor that is missing or
mis-cased stops the file loading, with a message naming the keyword it wanted:
<em>This kinematic chain has no worktable-end anchor named &lsquo;w&rsquo;.</em> When the mechanism carries that
same letter in the other case, the message adds the rename — <em>The mechanism carries &lsquo;W&rsquo;, which
differs only in letter case; the keyword is matched exactly, so rename it to &lsquo;w&rsquo;.</em> — and when the
anchor is simply absent, or named something else entirely, the first sentence stands alone.</p>
</div>
<p>Branch direction is free: the motion, the axis keywords and the default collision pairs all read a
branch the same way round. Pointing every branch <strong>away from the ground anchor</strong> is a readability
convention — it makes the structure read outwards, ground → base → motion axes → the <code>t</code> and <code>w</code> end
anchors.</p>
<p><strong>The names also decide what can collide with what.</strong> A machine file asking for its collision pairs
to be generated is answered by walking the chain twice, from <code>O</code> to <code>t</code> and from <code>O</code> to <code>w</code>. That
walk is also where the two end anchors are checked, so such a file — the form <strong>Save As Machine
Tool</strong> writes — is refused by the Load itself. A file that lists its collision pairs explicitly
instead is read without the check and arrives intact; it is refused one step further on, when the
chain is installed onto the project and its kinematics are rebuilt, with the same message reported
against the install rather than the load.
Everything named on the way becomes a collidable component; the four structural keywords are dropped
from both walks, the tool holder, cutter shank and cutter flute are added to the tool side and the
fixture and workpiece to the table side, and every pair across the two sides is generated except
workpiece against cutter flute — that one is the cut, not a collision.</p>
<h2 id="where-the-numbers-come-from">Where the numbers come from</h2>
<p>The most convenient approach is to assemble the machine in CAD, position the moving elements at the
machine origin — the position at which every machine coordinate reads zero, generally the home
position — and then:</p>
<ul>
<li>Export the main components as individual STL files <strong>from that one coordinate system</strong>, and set
each into its anchor.</li>
<li>Measure, in the same CAD coordinate system, the tool-end anchor, the worktable-end anchor and a
point on each rotary axis' pivot, and enter those coordinates into the topology.</li>
<li>Expect the axis directions from the base to the worktable end to come out negative. That is
relative motion rather than a mistake: moving the table one way moves the tool the other way
through the chain.</li>
</ul>
<p>Keep the meshes coarse. A machine carrying too much mesh is slower to open and slower to check for
collisions, so export the components at the resolution a picture of the machine needs rather than at
the resolution CAD produced them at.</p>
<h2 id="example-a-small-five-axis-vertical-milling-machine">Example: a small five-axis vertical milling machine</h2>
<p>A worked example, complete with its STLs: <a href="machine-tool-img/B1.zip">B1.zip</a>.</p>
<p>The machine it describes:</p>
<p><img src="machine-tool-img/B1_anchors.png" alt="The B1 example machine, drawn with each of its anchors marked and named"></p>
<p>And the topology those anchors and branches form:</p>
<p><img src="machine-tool-img/B1-topo.en.png" alt="The B1 example's topology: the ground anchor, the base, the five axis branches and the two end anchors"></p>
<h2 id="laying-a-machine-on-its-side">Laying a machine on its side</h2>
<p>A horizontal machine is built exactly like a vertical one and then laid down:</p>
<ol>
<li>Create the topology from the machine's own axis coordinates.</li>
<li>On the branch between the ground anchor and the machine base, set a rotation of 180 degrees about
a normalized axis direction of (0, 1, 1).</li>
</ol>
<p>A machine tool file can also carry this same connectivity as a short bracket notation for
hand-editing the XML — the grammar is <a class="xref" href="../../technique/mechanism/chain-code.html">Machine Chain Code</a>.</p>
<h2 id="see-also">See Also</h2>
<ul>
<li><a href="../utilities/mech-builder.html">Mechanism Builder</a> — how to drive the editor the steps above are performed in</li>
<li><a class="xref" href="../../workflows/project-data-checklist.html">Project Data Checklist</a> — what to collect from the machine owner before building this</li>
<li><a href="anchor.html">Anchor</a> — placing the fixture, workpiece and tool onto the chain built here</li>
<li><a class="xref" href="../../technique/mechanism/chain-code.html">Machine Chain Code</a> — the bracket notation for the structure built here, and what it cannot express</li>
<li><a href="fixture.html">Fixture</a> — what the table buckle built here then carries</li>
<li><a href="spindle-capability.html">Spindle Capability</a> — what this machine's spindle delivers, which the chain itself does not describe</li>
<li><a href="controller.html">Controller</a> — the brand whose per-axis rows this chain's axes fill</li>
<li><a href="index.html">Setup</a> — the rest of the pre-simulation configuration</li>
</ul>
</article>
<div class="contribution d-print-none">
</div>
<div class="next-article d-print-none border-top" id="nextArticle"></div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
</div>
</div>
</footer>
</body>
</html>