Archived
569 lines
25 KiB
HTML
569 lines
25 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Workflow: NC Optimization | HiAPI-C# 2025 </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="title" content="Workflow: NC Optimization | 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 "{query}"">
|
|
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
|
<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="Workflow-NcOptimization">
|
|
<h1 id="workflow-nc-optimization">Workflow: NC Optimization</h1>
|
|
|
|
<p>This workflow describes how to generate optimized NC files from a physics-based simulation. The optimizer adjusts feed rates to keep physical quantities (spindle power, torque, thermal stress, cutting force) within specified safety limits while maximizing machining efficiency.</p>
|
|
<pre><code class="lang-mermaid">flowchart TD
|
|
Prereq["Prerequisites<br>(simulation with physics,<br>cutting parameters)"]
|
|
Config["Configure optimization options"]
|
|
Simulate["Run simulation"]
|
|
Output["Generate optimized NC files"]
|
|
Verify["Verify optimization results"]
|
|
|
|
Prereq --> Config --> Simulate --> Output --> Verify
|
|
</code></pre>
|
|
<h2 id="1-prerequisites">1. Prerequisites</h2>
|
|
<p>NC optimization requires a simulation environment with <strong>physics enabled</strong> and valid <strong>cutting parameters</strong>:</p>
|
|
<pre><code class="lang-csharp">EnablePhysics = true;
|
|
LoadCuttingParaByFile("Material.mp");
|
|
</code></pre>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Prerequisite</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Physics enabled</td>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_EnablePhysics">EnablePhysics</a> must be <code>true</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Cutting parameters</td>
|
|
<td>Workpiece must have loaded milling coefficients (see <a class="xref" href="force-training.html">Workflow: Milling Force Parameter Training</a>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Valid tool definitions</td>
|
|
<td>Tool geometry, flute count, and material properties configured</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="NOTE">
|
|
<h5>Note</h5>
|
|
<p>Optimization is based on an ideal geometric model. If the workpiece is a casting or has installation errors, configure a conservatively larger workpiece geometry to prevent misidentification of cutting vs. non-cutting regions.</p>
|
|
</div>
|
|
<hr>
|
|
<h2 id="2-configure-optimization-options">2. Configure Optimization Options</h2>
|
|
<h3 id="feed-rate-control">Feed Rate Control</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Property</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptEnableFeedrate">OptEnableFeedrate</a></td>
|
|
<td>Enable sequential feed rate optimization</td>
|
|
<td><code>true</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptEnableInterpolation">OptEnableInterpolation</a></td>
|
|
<td>Re-interpolation for smoother acceleration/deceleration</td>
|
|
<td>—</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptRapidFeed_mmdmin">OptRapidFeed_mmdmin</a></td>
|
|
<td>Feed rate for non-cutting regions (mm/min)</td>
|
|
<td>—</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptMinFeedrate_mmdmin">OptMinFeedrate_mmdmin</a></td>
|
|
<td>Minimum cutting-region feed rate (mm/min)</td>
|
|
<td>—</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptMaxFeedrate_mmdmin">OptMaxFeedrate_mmdmin</a></td>
|
|
<td>Maximum cutting-region feed rate (mm/min)</td>
|
|
<td>—</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptMaxAcceleration_mmds2">OptMaxAcceleration_mmds2</a></td>
|
|
<td>Acceleration/deceleration limit (mm/s²)</td>
|
|
<td>—</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptFeedrateAssignmentRatio">OptFeedrateAssignmentRatio</a></td>
|
|
<td>Re-interpolation trigger threshold</td>
|
|
<td>—</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="extended-distance">Extended Distance</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Property</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptExtendedPreDistance_mm">OptExtendedPreDistance_mm</a></td>
|
|
<td>Pre-distance for equivalent calculation of cutting regions (mm)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptExtendedPostDistance_mm">OptExtendedPostDistance_mm</a></td>
|
|
<td>Post-distance for equivalent calculation of cutting regions (mm)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="safety-factors-physics-based-constraints">Safety Factors (Physics-Based Constraints)</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Property</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptSpindlePowerSafetyFactor">OptSpindlePowerSafetyFactor</a></td>
|
|
<td>Spindle power safety factor (0 = ignore)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptSpindleTorqueSafetyFactor">OptSpindleTorqueSafetyFactor</a></td>
|
|
<td>Spindle torque safety factor (0 = ignore)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptThermalYieldSafetyFactor">OptThermalYieldSafetyFactor</a></td>
|
|
<td>Thermal yield safety factor (0 = ignore)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptPreferedForce_N">OptPreferedForce_N</a></td>
|
|
<td>Target cutting force (N)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="NOTE">
|
|
<h5>Note</h5>
|
|
<p><strong>Target value</strong> = 100% / Safety factor. For example, a safety factor of 1.5 means the physical quantity targets ~67% of the limit.</p>
|
|
</div>
|
|
<h3 id="constraint-priority">Constraint Priority</h3>
|
|
<p>In cutting regions, constraints are applied in this order:</p>
|
|
<ol>
|
|
<li><strong>Direct feed rate constraints</strong> (min/max feed rate, min/max feed per tooth from tool settings)</li>
|
|
<li><strong>Acceleration/deceleration constraints</strong> (<code>OptMaxAcceleration_mmds2</code>)</li>
|
|
<li><strong>Physics-based constraints</strong> (spindle power, torque, thermal yield, preferred force)</li>
|
|
</ol>
|
|
<p>When constraints at the same priority conflict, the lowest feed rate is used.</p>
|
|
<p>A floor above the ceiling neither fails nor lowers the feed: where the composed minimum feed per tooth exceeds the composed maximum — a minimum feed rate, a minimum feed per tooth or the cutter's minimum uncut chip thickness sitting above the maximum — the boundary collapses onto the <strong>minimum</strong>, and the step is solved there.</p>
|
|
<h3 id="script-command-example">Script Command Example</h3>
|
|
<pre><code class="lang-csharp">OptEnableFeedrate = true;
|
|
OptEnableInterpolation = true;
|
|
OptRapidFeed_mmdmin = 4000;
|
|
OptMinFeedrate_mmdmin = 100;
|
|
OptMaxFeedrate_mmdmin = 4000;
|
|
OptMaxAcceleration_mmds2 = 10;
|
|
OptExtendedPreDistance_mm = 3;
|
|
OptExtendedPostDistance_mm = 2;
|
|
OptSpindlePowerSafetyFactor = 1.5;
|
|
OptSpindleTorqueSafetyFactor = 1.5;
|
|
OptThermalYieldSafetyFactor = 0;
|
|
OptPreferedForce_N = double.PositiveInfinity;
|
|
</code></pre>
|
|
<h3 id="xml-configuration-nc-code-inline">XML Configuration (NC Code Inline)</h3>
|
|
<p>Optimization settings can be embedded in NC code comments:</p>
|
|
<pre><code class="lang-nc">N0110 X-3.064 Y6.378 (;@OptMaxAcceleration_mmds2=10;)
|
|
N0150 G01 X-3.068 Y40.776 (;@OptMaxAcceleration_mmds2=100; OptMaxFeedrate_mmdmin=12000;)
|
|
</code></pre>
|
|
<hr>
|
|
<h2 id="3-run-simulation">3. Run Simulation</h2>
|
|
<p>Configuration can be interleaved between NC files. Settings apply to the files that follow:</p>
|
|
<pre><code class="lang-csharp">OptRapidFeed_mmdmin = 4000;
|
|
PlayNcFile("NC/file1.nc");
|
|
|
|
OptRapidFeed_mmdmin = 8000;
|
|
PlayNcFile("NC/file2.nc");
|
|
</code></pre>
|
|
<h3 id="excluding-lines-from-optimization">Excluding Lines from Optimization</h3>
|
|
<p>To preserve specific NC lines unchanged:</p>
|
|
<pre><code class="lang-nc">N0140 G03 X-2.66 Y38.193 I-103.796 J7.172 (;@Preserve();)
|
|
</code></pre>
|
|
<p>To exclude a range:</p>
|
|
<pre><code class="lang-nc">N0140 G03 X-2.66 Y38.193 (;@BeginPreserve();)
|
|
N0150 G01 X-3.068 Y40.776
|
|
N0160 X-3.555 Y43.338 (;@EndPreserve();)
|
|
</code></pre>
|
|
<div class="WARNING">
|
|
<h5>Warning</h5>
|
|
<p>Do not combine <a class="xref" href="../api/Hi.MachiningSteps.MachiningStep.html#Hi_MachiningSteps_MachiningStep_UpdateNcOptOption_">UpdateNcOptOption</a> inside the <a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_SessionStepBuilt">SessionStepBuilt</a> event with NC-embedded optimization commands. This may cause undefined behavior due to parallel computation.</p>
|
|
</div>
|
|
<hr>
|
|
<h2 id="4-generate-optimized-nc-files">4. Generate Optimized NC Files</h2>
|
|
<p><a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_OptimizeToFiles_">OptimizeToFiles</a> writes the optimized NC programs:</p>
|
|
<pre><code class="lang-csharp">OptimizeToFiles("Cache/Opt-[NcName]");
|
|
</code></pre>
|
|
<p>The <code>[NcName]</code> template is replaced with each input NC file name.</p>
|
|
<h3 id="what-the-run-reports">What the Run Reports</h3>
|
|
<p>An optimization reports itself to the <strong>Shell</strong> tab of the Session Messages panel, as a fixed
|
|
sequence of rows:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Row</th>
|
|
<th>Stage</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>Start NC optimization.</code></td>
|
|
<td>the pass opens</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Computing Optimized Feed by indivisual step..</code></td>
|
|
<td>the per-step feed solve</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Optimization Feedrate built.</code></td>
|
|
<td>the feed solve closed</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Constrain feedrate By expaneded segment..</code></td>
|
|
<td>the extended-distance constraint</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Constrain Feedrate By Acceleration..</code></td>
|
|
<td>the acceleration constraint</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Build Compensation..</code></td>
|
|
<td>the compensation build</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Regenerate NC commands..</code></td>
|
|
<td>the NC text is rewritten</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>File optimized: <path></code></td>
|
|
<td>one row per written file</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Total N files optimized.</code></td>
|
|
<td>the pass is over</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>optimization cache cleared.</code></td>
|
|
<td>the step cache is released</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Two of those stages tick while they work, and they are the only instrument for telling a slow
|
|
optimization from a stopped one. The feed solve adds <code>Computing Optimized Feed by indivisual step.. FileNo:<n>, LineNo:<m></code> every thousand steps solved — <code>StepIndex:<i></code> instead, for a step that
|
|
carries no source line — and the writer adds <code>Now optimizing to: FileNo.<n>, LineNo.<m></code> every
|
|
thousand lines written. Each names the source file and line the run has reached, so a ladder whose
|
|
last row keeps advancing is a run still moving through the program, and one that has gone quiet
|
|
without reaching <code>Total N files optimized.</code> is not. A stage with fewer than a thousand steps or
|
|
lines to get through announces its start and then says nothing until it ends, so a short program
|
|
crosses the whole ladder in near-silence.</p>
|
|
<p><strong>Stop reaches inside an optimization.</strong> The transport's Stop is tested between every pair of
|
|
stages, inside the per-step feed solve, and once per destination piece while files are written, so a
|
|
stopped optimization halts at the next step or piece boundary rather than running to the end. The
|
|
Shell ladder says so twice: the feed solve closes with <code>Optimization Feed Process canceled.</code> in
|
|
place of <code>Optimization Feedrate built.</code>, and an <code>optimization canceled.</code> row is added before the
|
|
pass ends.</p>
|
|
<div class="IMPORTANT">
|
|
<h5>Important</h5>
|
|
<p>A stopped optimization still ends on the green <code>Total N files optimized.</code> row a completed one ends
|
|
on. That row is not a statement that the optimization finished — read the row above it. <code>N</code> counts
|
|
the files the run had begun writing, so a Stop during the feed solve ends on
|
|
<code>Total 0 files optimized.</code>, and a Stop during writing counts the file it was in the middle of,
|
|
which is left short.</p>
|
|
</div>
|
|
<hr>
|
|
<h2 id="5-verify-optimization-results">5. Verify Optimization Results</h2>
|
|
<h3 id="optimization-logs">Optimization Logs</h3>
|
|
<p>The per-step log is written by default. Every optimization drops one <code>.IndependentStepAdjustment.log</code>
|
|
beside each optimized NC file that had steps to solve, named after that optimized file, and it
|
|
records which constraint limited each step.
|
|
<a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_EnableIndividualStepAdjustmentLog">EnableIndividualStepAdjustmentLog</a> is the switch that stops it
|
|
being written:</p>
|
|
<pre><code class="lang-csharp">EnableIndividualStepAdjustmentLog = false;
|
|
</code></pre>
|
|
<p>A stopped or failed optimization leaves that file short. Its buffered tail is written out only when
|
|
the feed solve runs to completion; when the pass is cut off, the lines still in the buffer are
|
|
dropped, and so is any step line held back in the ordering window waiting for a lower step index
|
|
that never arrived. Batches reach the file at most once a second, so the missing tail can cover the
|
|
last second of solving as well as the steps that were never reached. Read the log as a complete
|
|
record only for a run whose feed solve closed with <code>Optimization Feedrate built.</code></p>
|
|
<p>Each row of the <code>.IndependentStepAdjustment.log</code> file opens with the source NC file and line, the step index and the cutter location, then lists the feed per tooth every active criterion allowed:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Criterion</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>FrtByPreferedForce_mm</code></td>
|
|
<td>target cutting force</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>FrtByYieldingStressRatio_mm</code></td>
|
|
<td>yielding stress</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>FrtBySpindleTorqueRatio_mm</code></td>
|
|
<td>spindle torque</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>FrtBySpindlePowerRatio_mm</code></td>
|
|
<td>spindle power</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>FrtByThermalYieldingRatio_mm</code></td>
|
|
<td>thermal yield</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>FrtByCustom_mm(n)</code></td>
|
|
<td>the n-th custom criterion the script registered</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>FrtByReliefAngle_mm</code></td>
|
|
<td>relief-face contact — see <a class="xref" href="../technique/milling-physics/relief-face-avoidance.html">Relief Face Avoidance</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>The step's feed per tooth is the <strong>lowest</strong> of the first six; the relief-angle pass then runs on that value, so its row is the last word rather than one vote among the others.</p>
|
|
<p>Every row carries the solver's status for that criterion in brackets: <code>Solved</code> when the binary solve converged, <code>Singular</code> / <code>OverIteration</code> / <code>Iterating</code> when it did not, and — on the relief-angle row only — <code>Acceptable</code>, which means the relief face was clear at the feed already chosen, so that row states the feed instead of a limit on it. A criterion with no row at all was switched off (its safety factor is <code>0</code>) or was not evaluable for that tool.</p>
|
|
<p>Three rows replace that list rather than joining it:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Meaning</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>FrtByUnTouched: inf</code></td>
|
|
<td>the step cuts nothing, so no physical criterion applies</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>FeedrateByNoData_mmdmin: <feed></code></td>
|
|
<td>no tool or no milling coefficients on the step; it keeps its feed</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>StepFailed: <exception></code></td>
|
|
<td>the solve threw; the step keeps its simulated feed and is reported as an error — see <a href="../technique/nc-optimization/nc-optimization-principles.html#when-a-step-cannot-be-solved">When a Step Cannot Be Solved</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="embedded-log-comments">Embedded Log Comments</h3>
|
|
<p>Control embedded log verbosity with <a class="xref" href="../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_EmbeddedLogMode_">EmbeddedLogMode</a>:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Mode</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>None</code></td>
|
|
<td>No log comments</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>SimpleLog</code></td>
|
|
<td><code>StepIndex</code> on re-interpolated lines; <code>LineNo</code> on last interpolated line per original line</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>FullLog</code></td>
|
|
<td><code>StepIndex</code> and <code>LineNo</code> on all lines</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="IMPORTANT">
|
|
<h5>Important</h5>
|
|
<p>The mode is read by the legacy optimization path. While
|
|
<a class="xref" href="../api/Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_EnableSoftNcRunner">EnableSoftNcRunner</a> is on and the session holds played
|
|
NC — the default — the optimizer writes the <code>SimpleLog</code> shape whatever the mode says: every
|
|
re-interpolated fragment carries its <code>StepIndex</code>, the last fragment of each source line adds that
|
|
line's <code>LineNo</code>, and a line the optimizer did not split carries no note.</p>
|
|
</div>
|
|
<p>The note is written in the controller's comment grammar, so the optimized file stays legal for the
|
|
control that reads it. On the Fanuc family it is parenthesized:</p>
|
|
<pre><code>G01 X10.0 Y20.0 F500 (src(LineNo: 140, StepIndex: 256))
|
|
</code></pre>
|
|
<p>On Heidenhain it is a <code>;</code> comment, because a TNC reads parentheses as code:</p>
|
|
<pre><code>120 L X+35 Y-11.7 R0 F500 ;src(LineNo: 140, StepIndex: 256)
|
|
</code></pre>
|
|
<p>On a Heidenhain project a feed word the optimizer has to insert is also placed in the element order
|
|
a TNC enforces — after the coordinate words, after the rotation direction <code>DR+</code> / <code>DR-</code>, and after
|
|
the radius compensation <code>RL</code> / <code>RR</code> / <code>R0</code>. A block that read <code>L X+10 Y+20 RL</code> comes back as
|
|
<code>L X+10 Y+20 RL F500</code>.</p>
|
|
<h3 id="tracking-individual-step-constraints">Tracking Individual Step Constraints</h3>
|
|
<p>To isolate which physical quantity limits each step, disable smoothing:</p>
|
|
<pre><code class="lang-csharp">OptMaxAcceleration_mmds2 = double.PositiveInfinity;
|
|
OptFeedrateAssignmentRatio = 0;
|
|
OptExtendedPreDistance_mm = 0;
|
|
OptExtendedPostDistance_mm = 0;
|
|
</code></pre>
|
|
<p>The four smoothing settings are what this block changes. The per-step log is already on, and
|
|
<code>EmbeddedLogMode</code> does not reach the pipeline that runs by default — see above.</p>
|
|
<h3 id="post-optimization-simulation-differences">Post-Optimization Simulation Differences</h3>
|
|
<p>Optimized feed rates produce different interpolation points, causing:</p>
|
|
<ul>
|
|
<li>Different simulation mesh errors</li>
|
|
<li>Surface morphology changes at the surface roughness level (more pronounced at corners)</li>
|
|
</ul>
|
|
<p>Simulated physical quantities after optimization may be slightly above target values due to these differences.</p>
|
|
<div class="TIP">
|
|
<h5>Tip</h5>
|
|
<p>For abnormally low optimized feed rates at corners, refer to <a class="xref" href="../technique/nc-optimization/corner-behavior.html">Corner Feed Rate Optimization</a>.</p>
|
|
</div>
|
|
<hr>
|
|
<h2 id="tool-breakage-solutions">Tool Breakage Solutions</h2>
|
|
<p>If the simulation shows yielding stress ratio, max spindle torque ratio, or max spindle power ratio above 100%, consider:</p>
|
|
<ol>
|
|
<li>Modify the toolpath to reduce cutting width/depth</li>
|
|
<li>Use HiNC optimization to adjust feed rates, bringing these ratios below 100%</li>
|
|
</ol>
|
|
<p>For thermal edge chipping, reduce the spindle speed to allow heat dissipation.</p>
|
|
<hr>
|
|
<h2 id="complete-script-example">Complete Script Example</h2>
|
|
<pre><code class="lang-csharp">EnablePhysics = true;
|
|
LoadCuttingParaByFile("Material.mp");
|
|
|
|
OptEnableFeedrate = true;
|
|
OptEnableInterpolation = true;
|
|
OptRapidFeed_mmdmin = 4000;
|
|
OptMinFeedrate_mmdmin = 100;
|
|
OptMaxFeedrate_mmdmin = 4000;
|
|
OptMaxAcceleration_mmds2 = 10;
|
|
OptExtendedPreDistance_mm = 3;
|
|
OptExtendedPostDistance_mm = 2;
|
|
OptSpindlePowerSafetyFactor = 1.5;
|
|
OptSpindleTorqueSafetyFactor = 1.5;
|
|
OptThermalYieldSafetyFactor = 0;
|
|
OptPreferedForce_N = double.PositiveInfinity;
|
|
|
|
PlayNcFile("NC/file1.nc");
|
|
|
|
OptimizeToFiles("Cache/Opt-[NcName]");
|
|
WriteStepFiles("Output/[NcName].step.csv");
|
|
</code></pre>
|
|
<h2 id="see-also">See Also</h2>
|
|
<ul>
|
|
<li><a class="xref" href="../technique/nc-optimization/nc-optimization-principles.html">NC Optimization (Concepts)</a> — theory and objectives</li>
|
|
<li><a class="xref" href="../technique/nc-optimization/corner-behavior.html">Corner Feed Rate Optimization</a></li>
|
|
<li><a class="xref" href="force-training.html">Workflow: Milling Force Parameter Training</a> — prerequisite: training cutting parameters</li>
|
|
<li><a class="xref" href="basic-simulation.html">Workflow: Basic Machining Simulation</a> — basic simulation setup</li>
|
|
<li><a class="xref" href="../technique/scripting/session-shell.html">SessionShell</a> — SessionShell quick-reference</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>
|