post: HSC tolerance bump + retract spindle lookahead#24
Open
CyberCraftLab wants to merge 3 commits into
Open
Conversation
The KUKA CNC ISG #HSC BSPLINE smoothing tolerances were emitted at 0.1 mm for both path and track deviation, which keeps the toolpath very tight to the programmed points but allows little smoothing. Bumping both to 0.5 mm gives the controller more latitude to round corners during high-speed contouring — appropriate for clay extrusion where the bead naturally smooths over sub-millimetre path detail and the sharp corners of dense toolpath sampling can otherwise show as accel spikes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…r plunge When a MoveJ arrives while the extruder is still on, treat it as the lift-off of a retract: back the S1 command up by RETRACT_LOOKAHEAD_POINTS (default 10) waypoints so clay flow has stopped before the nozzle leaves the print, and stash the active S value. The next MoveL after the retract re-issues that S value so the extruder is flowing again by the time the plunge lands at the first print point. This lets source G-code leave the spindle on continuously with a single M3 S<n> at program start — the post inserts the needed S1 / S<n> transitions around each retract automatically. Tracks the active extruder S value in RunCode (whenever S>1 is emitted) so the resume value reflects the most recent setpoint rather than a hardcoded constant. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
RoboDK's CNC machining import collapses G0 rapids into MoveL with a faster feed rate — it never invokes MoveJ for inner retracts. The previous lookahead implementation triggered on MoveJ and so silently did nothing on real CNC-imported curves. New trigger: a MoveL whose speed is more than RETRACT_SPEED_RATIO (default 1.3) × the previous MoveL's speed marks a retract entry; a MoveL whose speed has dropped back below the previous MoveL's speed by the same ratio marks the first print point after the plunge. The MoveJ-based trigger is kept as a defensive fallback for stations that do emit MoveJ for retracts. The N-back fallback in _inject_extruder_off_n_points_back was also hardened: when the buffered print pass is shorter than the lookahead (short contour), emit S1 inline rather than at the very start of the pass — turning the extruder off for the entire short contour would lose more than it saves. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related improvements to the KUKA CNC ISG post processor for clay extrusion.
1. HSC BSPLINE tolerances bumped 0.1 → 0.5 mm
`PostProcessor/KUKA_CNC_2_1_ISG_CCL_3DP_WIP_MS_S_INT_HSC_WAIT_S_DELAY.py:275`
At 0.1 mm the BSPLINE smoother had very little latitude to round corners between programmed waypoints. Fine for milling, overkill for clay extrusion where the bead naturally smooths over sub-millimetre detail and dense toolpath sampling produces many close-spaced corners. 0.5 mm gives the smoother more room while staying inside the bead's own footprint.
2. Retract spindle lookahead
New mechanism: when a `MoveJ` (rapid) arrives while the extruder is still on, treat it as the lift-off of a retract and:
Lets source G-code leave the spindle on continuously with one `M3 S` at program start; the post inserts the needed S transitions around every retract automatically. Reuses the same MoveL segment buffer the existing `EXTRUDER_OFF_DELAY_S` lead compensation already maintains.
Active S value is tracked in `RunCode` so the resume reflects the most recent setpoint, not a hardcoded constant.
Test plan
🤖 Generated with Claude Code