NC Optimization
Also refer to the script commands section Workflow: NC Optimization.
Optimization Objective
Optimization aims to make the physical quantities during machining as close to the target values as possible.
Since the optimization uses a conservative feed rate strategy, the physical quantities in the optimized NC code will be as close to equal to or less than the target values as possible.
Factors Determining the Optimized Feed Rate
The optimized feed rate is determined by:
- Physical quantity constraints of individual steps: Feed rate limits calculated for each step based on target force, yielding stress, spindle torque, etc. For detailed descriptions of indicators such as yielding stress ratio and spindle torque ratio, refer to "Evaluating Process Machinability".
- Inter-step smoothing: Interactions such as acceleration/deceleration limits and extended distances.
Differences in Simulation Results After Optimization
Simulation with modified feed rates produces different interpolation points than before, resulting in:
- Different simulation mesh errors
- Surface morphology changes at the surface roughness level
Therefore, the simulated physical quantities after optimization may not always be equal to or below the target values — they may also be slightly above.
The influence of interpolation point density on surface morphology is greater at rounded corners than on straight lines, so this effect may be more pronounced at corners.
Tip
For abnormally low optimized feed rates at corners, refer to Corner Feed Rate Optimization.
Velocity Smoothing
The smoothing range terminates at macro commands or line commands with unresolvable paths.
Velocity smoothing applies acceleration/deceleration limits based on the path length traversed by the current line command. Therefore, velocity smoothing is effective for re-interpolatable regions; however, for non-re-interpolatable regions, although acceleration/deceleration limits still apply, the excessively long path length of a single line may render them impractical in actual use.
Impact of Geometric Errors
Current NC optimization is based on an ideal geometric model. If the workpiece is a casting or has installation errors, a conservatively larger workpiece geometry should be configured in the system to prevent the system from misidentifying cutting regions as non-cutting regions, which could cause tool crashes.
Tool Breakage Solutions
Modify the toolpath to reduce cutting width/depth, or use HiNC's optimization feature to adjust feed rates, bringing the yielding stress ratio, max spindle torque ratio, and max spindle power ratio below 100%.
For detailed descriptions of these indicators and tool breakage criteria, refer to "Evaluating Process Machinability".
Tuning Peak Tolerance
Optimization defaults treat the 100 % line on every ratio as a hard ceiling. In practice some metrics tolerate routine excursions and others don't. The per-metric Opt*UtilizationFactor levers let the optimizer accept higher peaks where physically safe.
| Metric | Factor (API) | When to raise |
|---|---|---|
| Yielding stress | OptYieldingUtilizationFactor | Per-instant. Safe to raise. If 150 % is routinely tolerated without breakage, set 1.5. Controller corner smoothing and spindle inertia absorb a single-revolution overshoot. |
| Spindle torque | OptSpindleTorqueUtilizationFactor | Cumulative. Keep at 1. Sustained excursions stall the spindle: feed continues, rpm drops, feed-per-tooth grows, forces spike further. |
| Spindle power | OptSpindlePowerUtilizationFactor | Cumulative. Keep at 1. Same reason as torque. |
| Thermal yield | OptThermalYieldUtilizationFactor | Long-term. Can be raised modestly if the calibrated tool material is more thermally tolerant than the conservative defaults — see Thermal Plastic Deformation of Cutting Edge. |
Rule of thumb: relax per-instant per-step metrics based on observed stable extremes; never relax cumulative metrics.
For a complementary feed-rate floor lever — useful when the NC cannot be modified to remove single-revolution peaks — see MinFeedPerTooth_mm (API) and When the NC Cannot Be Modified.
Thermal Edge Chipping Solutions
After addressing tool breakage issues, reduce the spindle speed to allow sufficient time for the cutting edge to dissipate heat.
Note that whether the coolant is properly directed at the cutting edge has a significant impact.
Tracking Physical Quantity Constraints of Individual Steps
To determine which physical quantity limits the feed rate for an individual step, first disable smoothing-related settings, then enable logging:
OptMaxAcceleration_mmds2 = double.PositiveInfinity;
OptFeedrateAssignmentRatio = 0;
OptExtendedPreDistance_mm = 0;
OptExtendedPostDistance_mm = 0;
EnableIndividualStepAdjustmentLog = true;
EmbeddedLogMode = NcOptimizationEmbeddedLogMode.FullLog;
After running the optimization, inspect the .IndependentStepAdjustment.log file to view the independent optimization calculation results for each step and identify which physical quantity limited the feed rate.
For detailed field descriptions of the log file, refer to the Optimization Logs section in the Workflow: NC Optimization workflow.