420 lines
14 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Glossary: Machining Step | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Glossary: Machining Step | 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="Glossary-MachiningStep">
<h1 id="glossary-machining-step">Glossary: Machining Step</h1>
<h2 id="what-is-a-machining-step">What Is a Machining Step?</h2>
<p>A <strong>MachiningStep</strong> (<a class="xref" href="../../api/Hi.MachiningSteps.MachiningStep.html">MachiningStep</a>) is a single computation unit in the HiNC simulation. By default, one step corresponds to one spindle revolution, but this interval is configurable via the <a href="../../workflows/basic-simulation.html">Basic Simulation</a> workflow.</p>
<p>Each step contains data for the <strong>time interval</strong> between two consecutive steps (from the previous step to the current step). Since this represents a period rather than an instant, many fields are simplified representations using prefixes like Average (Avg), Extremes (Min, Max), Range (Delta), and Maximum Absolute Value (MaxAbs).</p>
<hr>
<h2 id="key-properties">Key Properties</h2>
<p>The table below summarizes the primary step output fields. For the complete reference, see <a class="xref" href="../../api/Hi.MachiningSteps.MachiningStep.html">MachiningStep</a>.</p>
<h3 id="basic-source-information">Basic Source Information</h3>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>FileNo</code> / <code>LineNo</code> / <code>FilePath</code> / <code>LineText</code></td>
<td>Source NC file and line information</td>
</tr>
<tr>
<td><code>StepIndex</code></td>
<td>Step sequence index</td>
</tr>
<tr>
<td><code>ToolId</code></td>
<td>Active tool ID</td>
</tr>
<tr>
<td><code>FlagsText</code></td>
<td>Active G-code modal flags</td>
</tr>
</tbody>
</table>
<h3 id="time-and-motion">Time and Motion</h3>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>AccumulatedTime</code></td>
<td>Accumulated simulation time</td>
</tr>
<tr>
<td><code>StepDuration</code></td>
<td>Duration of this step</td>
</tr>
<tr>
<td><code>BeginSpindleAngle_deg</code></td>
<td>Spindle angle at step start</td>
</tr>
<tr>
<td><code>Cl</code> (X, Y, Z, I, J, K)</td>
<td>Cutter location point and tool axis vector</td>
</tr>
<tr>
<td><code>MC</code> (X, Y, Z, A, B, C)</td>
<td>Machine coordinates</td>
</tr>
<tr>
<td><code>Feedrate_mmdmin</code></td>
<td>Feed rate (mm/min)</td>
</tr>
<tr>
<td><code>SpindleSpeed_rpm</code></td>
<td>Spindle speed (RPM)</td>
</tr>
<tr>
<td><code>FeedPerTooth_mm</code> / <code>FeedPerCycle_mm</code></td>
<td>Feed per tooth / per cycle</td>
</tr>
<tr>
<td><code>MovingLength_mm</code></td>
<td>Displacement length</td>
</tr>
</tbody>
</table>
<h3 id="cutting-engagement">Cutting Engagement</h3>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>IsTouched</code></td>
<td>Whether cutting engagement occurred</td>
</tr>
<tr>
<td><code>CuttingWidth_mm</code> (ae)</td>
<td>Cutting width</td>
</tr>
<tr>
<td><code>CuttingDepth_mm</code> (ap)</td>
<td>Cutting depth</td>
</tr>
<tr>
<td><code>Mrr_mm3ds</code></td>
<td>Material removal rate</td>
</tr>
<tr>
<td><code>ChipThickness_mm</code></td>
<td>Chip thickness</td>
</tr>
<tr>
<td><code>ChipVolume_mm3</code></td>
<td>Chip volume</td>
</tr>
</tbody>
</table>
<h3 id="force-and-torque">Force and Torque</h3>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>AvgForceToToolOnToolRunningCoordinate_N</code></td>
<td>Average force on tool (X, Y, Z)</td>
</tr>
<tr>
<td><code>MaxAbsForce_N</code></td>
<td>Maximum absolute force</td>
</tr>
<tr>
<td><code>AvgAbsTorque_Nm</code></td>
<td>Average absolute torque</td>
</tr>
</tbody>
</table>
<h3 id="power-and-energy">Power and Energy</h3>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>SpindleInputPower_W</code></td>
<td>Spindle input power</td>
</tr>
<tr>
<td><code>SpindleOutputPower_W</code></td>
<td>Spindle output power (after efficiency losses)</td>
</tr>
<tr>
<td><code>MaxSpindlePowerRatio</code></td>
<td>Input power / max spindle power capability</td>
</tr>
<tr>
<td><code>AccumulatedSpindleEnergyConsumption_kWh</code></td>
<td>Accumulated energy consumption</td>
</tr>
</tbody>
</table>
<h3 id="thermal">Thermal</h3>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>CutterDermisTemperature_C</code></td>
<td>Cutter surface temperature</td>
</tr>
<tr>
<td><code>WorkpieceDermisTemperature_C</code></td>
<td>Workpiece surface temperature</td>
</tr>
<tr>
<td><code>ChipTemperature_C</code></td>
<td>Chip temperature</td>
</tr>
<tr>
<td><code>ThermalStress_MPa</code> / <code>ThermalYieldRatio</code></td>
<td>Thermal stress and yield ratio</td>
</tr>
</tbody>
</table>
<h3 id="wear-and-deflection">Wear and Deflection</h3>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>AccumulatedCraterWear_um</code></td>
<td>Accumulated crater wear</td>
</tr>
<tr>
<td><code>AccumulatedFlankWearDepth_um</code> / <code>Width_um</code></td>
<td>Accumulated flank wear</td>
</tr>
<tr>
<td><code>ReCutDepth_um</code></td>
<td>Re-cut depth from tool deflection</td>
</tr>
</tbody>
</table>
<hr>
<h2 id="registering-custom-step-variables">Registering Custom Step Variables</h2>
<p>Beyond default properties, you can register custom step variables using <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_RegisterStepVariable_">RegisterStepVariable</a>:</p>
<pre><code class="lang-csharp">RegisterStepVariable(
&quot;ChipVolume&quot;, // key
&quot;Chip Volume&quot;, // display name
&quot;mm3&quot;, // unit
&quot;F2&quot;, // format string
(step) =&gt; step.ChipVolume_mm3 // value function
);
PlayNcFile(&quot;NC/file1.nc&quot;);
</code></pre>
<p>Parameters:</p>
<ul>
<li><strong>key</strong>: Unique identifier</li>
<li><strong>name</strong>: Display name (shown in UI)</li>
<li><strong>unit</strong>: Physical unit (can be null)</li>
<li><strong>formatString</strong>: .NET numeric format string (can be null)</li>
<li><strong>variableFunction</strong>: Lambda that computes the value from a step (can be null)</li>
</ul>
<p>Registered variables appear in the UI and in output files from <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_WriteStepFiles_">WriteStepFiles</a>.</p>
<h3 id="indexer-access">Indexer Access</h3>
<p>Use the <a class="xref" href="../../api/Hi.MachiningSteps.MachiningStep.html#Hi_MachiningSteps_MachiningStep_Item_System_String_">this[string]</a> indexer to read/write custom data on a step:</p>
<pre><code class="lang-csharp">SessionStepBuilt += (preStep, curStep) =&gt; {
if (curStep != null)
curStep[&quot;MyCustomField&quot;] = someCalculation();
};
</code></pre>
<hr>
<h2 id="accessing-step-data">Accessing Step Data</h2>
<h3 id="getmillingstep">GetMillingStep</h3>
<p><a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_GetMillingStep_">GetMillingStep</a> retrieves a step by index:</p>
<pre><code class="lang-csharp">var step = GetMillingStep(100);
if (step != null)
{
Message($&quot;ToolId={step.ToolId}, Force={step.MaxAbsForce_N} N&quot;);
}
</code></pre>
<h3 id="stepcount">StepCount</h3>
<p><a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_StepCount">StepCount</a> returns the total number of steps:</p>
<pre><code class="lang-csharp">Message($&quot;Total steps: {StepCount}&quot;);
</code></pre>
<h3 id="iterating-all-steps">Iterating All Steps</h3>
<pre><code class="lang-csharp">for (int i = 0; i &lt; StepCount; i++)
{
var step = GetMillingStep(i);
// process step...
}
</code></pre>
<hr>
<h2 id="step-output-files">Step Output Files</h2>
<p>Steps can be exported to CSV using <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_WriteStepFiles_">WriteStepFiles</a>:</p>
<pre><code class="lang-csharp">WriteStepFiles(&quot;Output/[NcName].step.csv&quot;);
</code></pre>
<p>The CSV contains all default properties plus any registered custom variables. The file can be read back with <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_PlayCsvFile_">PlayCsvFile</a>.</p>
<p>For waveform-level data (sub-step time resolution), use <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_WriteShotFiles_">WriteShotFiles</a>:</p>
<pre><code class="lang-csharp">WriteShotFiles(&quot;Output/[NcName].shot.csv&quot;, 1); // 1 ms time resolution
</code></pre>
<hr>
<h2 id="dynamically-registered-variables-training">Dynamically Registered Variables (Training)</h2>
<p>After executing <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_TrainMillingPara_">TrainMillingPara</a> or <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_ReTrainMillingPara_">ReTrainMillingPara</a>, two additional step variables are automatically registered for steps within the training region:</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>TrainingErrRatio</code></td>
<td>Error metric between simulation and measurement for each step</td>
</tr>
<tr>
<td><code>AngleOffset</code></td>
<td>Cutter rotation phase difference between measured and simulated data</td>
</tr>
</tbody>
</table>
<hr>
<h2 id="see-also">See Also</h2>
<ul>
<li><a href="step-intro.html">Simulation Step</a> — concept definition</li>
<li><a href="step-output.html">Simulation Step Output</a> — complete field reference</li>
<li><a class="xref" href="runtime-api.html">Glossary: RuntimeApi Quick-Reference</a> — RuntimeApi quick-reference</li>
<li><a class="xref" href="../../workflows/basic-simulation.html">Workflow: Basic Machining Simulation</a> — simulation workflow producing steps</li>
<li><a class="xref" href="../../workflows/force-training.html">Workflow: Milling Force Parameter Training</a> — training workflow that adds step variables</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>