You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(rs274ngc): MAX_UNWIND_TURNS auto rotary G0 rebase via G92
Add [AXIS_<L>] MAX_UNWIND_TURNS = N. On a G0 absolute move with the
rotary word, if the programmed (work-frame) delta exceeds N full turns,
fold the whole turns into the axis (G92) offset so the motor takes the
shortest path (within +/- 180 deg) to the target's angular position
while the work-frame position still reaches the commanded target. The
motion-side accumulated position is unchanged, so stepgens, encoders and
PID see no discontinuity.
Riding the existing G92 plumbing means the DRO, #<_a> and #5423 all
report the programmed value with no special-casing; the accumulated
turns appear as a G92 offset (#5214-#5216).
On re-home or estop reset the interpreter resynchronizes and detects the
frame re-anchor (a >180 deg work-frame jump on a managed axis with a
live offset); it collapses the stale offset back into the work frame and
re-emits the G92 so canon agrees, so a fresh home starts clean.
Gated to trivkins 1:1 axis-to-joint mapping; coupled kinematics (5-axis
TCP, gantry rotary) unsupported. Mutually exclusive with WRAPPED_ROTARY
(startup warning if both set on the same axis). Default 0 (disabled).
Copy file name to clipboardExpand all lines: docs/src/config/ini-config.adoc
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1017,6 +1017,30 @@ The _<letter>_ specifies one of: X Y Z A B C U V W
1017
1017
For a rotary axis (A,B,C typ) with unlimited rotation having no `MAX_LIMIT` for that axis in the `[AXIS_`<letter>`]` section a value of 1e99 is used.
1018
1018
* `WRAPPED_ROTARY = 1` - (bool) When this is set to 1 for an ANGULAR axis the axis will move 0-359.999 degrees.
1019
1019
Positive Numbers will move the axis in a positive direction and negative numbers will move the axis in the negative direction.
1020
+
* `MAX_UNWIND_TURNS = 10` - (real) When set to a positive value for a rotary axis (A, B, or C), enables automatic
1021
+
unwind avoidance on G0 absolute moves. When a G0 with the rotary word would otherwise unwind more than
1022
+
this many full turns from the current programmed position, the interpreter folds the whole turns into the
1023
+
axis (G92) offset so the motor takes the shortest path (within +/- 180 degrees) to the target's angular
1024
+
position while the programmed (work-frame) position still reaches the commanded target. Subsequent
1025
+
G1/G0 absolute moves use the rebased frame. The motion-side traj.position remains accumulated, so
1026
+
stepgens, encoders, and PID see no discontinuity.
1027
+
+
1028
+
This is intended for rotational-cutting workflows (helical winding, spiral carving) where a G1 must
1029
+
honor literal multi-turn absolute targets but a terminal G0 should not unwind. CAM output and existing
1030
+
G-code do not need to change.
1031
+
+
1032
+
Because the unwind rides the G92 offset, the DRO, `#5423`/`#5424`/`#5425` and `_a`/`_b`/`_c` named
1033
+
parameters all report the programmed value with no special handling, and the accumulated turns show up
1034
+
as a G92 offset (`#5214`/`#5215`/`#5216`). Consequences: the feature reserves G92 on a managed axis, so
1035
+
do not set G92 manually on an axis that has `MAX_UNWIND_TURNS` (use it freely on other axes); a `G92.1`
1036
+
in the program clears the accumulated unwind, after which the next qualifying G0 simply rebases again; and
1037
+
the offset is cleared automatically when the axis is re-homed or estop-reset, so a fresh home starts clean.
1038
+
+
1039
+
The feature is gated to trivkins-style 1:1 axis-to-joint mapping; behavior in coupled kinematics
1040
+
(5-axis TCP, gantry rotary) is undefined and not supported. Mutually exclusive with `WRAPPED_ROTARY`;
1041
+
if both are set on the same axis, `MAX_UNWIND_TURNS` is ignored with a startup warning.
1042
+
+
1043
+
Default: 0 (feature disabled).
1020
1044
* `LOCKING_INDEXER_JOINT = 4` - (int) This value selects a joint to use for a locking indexer for the specified axis _<letter>_.
1021
1045
In this example, the joint is 4 which would correspond to the B axis for a XYZAB system with trivkins (identity) kinematics.
1022
1046
When set, a G0 move for this axis will initiate an unlock with the `joint.4.unlock pin` then wait for the `joint.4.is-unlocked` pin then move the joint at the rapid rate for that joint.
0 commit comments