Skip to content

Backport #3996: make #5401-#5409 the applied tool length offset (2.9)#4164

Merged
andypugh merged 3 commits into
LinuxCNC:2.9from
grandixximo:backport/3996-tool-offset-params-2.9
Jun 14, 2026
Merged

Backport #3996: make #5401-#5409 the applied tool length offset (2.9)#4164
andypugh merged 3 commits into
LinuxCNC:2.9from
grandixximo:backport/3996-tool-offset-params-2.9

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

Backport of #3996 (plus the new G38 documentation from #4163) to 2.9.

#3996 makes parameters #5401-#5409 reflect the tool length offset actually applied to motion (G43 family, zeroed by G49), instead of being rewritten from the loaded tool's stored offsets on M6 / G10 / startup while G43Hn (n != loaded tool), G43.1 and G43.2 never updated them. This matches the long-standing documentation and the Fanuc #5081-#5088 / Haas #5081-#5086 semantics.

This came up again in #4159, where the lack of a reliable "is a TLO applied" readout forces G30.1 / G53 hacks to get machine coordinates out of a probe. With the applied offset in #5403, that falls out of the parameters directly, so backporting it to 2.9 removes the need for those workarounds on the stable branch.

Contents:

  • interp commit cherry-picked clean from master (267094a).
  • docs commit (the G38 machine-coordinate conversion section, same as docs: G38 probe to machine-coordinate conversion via #5401-#5409 #4163).
  • tests commit: the eight affected tests, with expected outputs regenerated on 2.9. The t0 / toolno-pocket-differ gcode-output came out byte-identical to master; the g10 canon-format expected files were regenerated locally because 2.9 emits CHANGE_TOOL(n) / START_CHANGE() where master emits CHANGE_TOOL() / USE_TOOL_LENGTH_OFFSET. All eight pass after a clean rebuild.

@andypugh This is a behavior change to parameter semantics on the stable branch, so I would like your sign-off before merge. If you would rather this stay master-only, I am happy to close it.

Parameters #5401-#5409 now reflect the tool length offset actually
applied to motion, matching the long-standing documentation ("Set by
G43") and the equivalent Fanuc #5081-#5088 / Haas #5081-#5086
semantics.

Previously they were rewritten on M6, G10 L1/L10/L11, and startup
from the loaded tool's stored offsets, while G43Hn (n != loaded tool),
G43.1, and G43.2 never updated them. Reading #5401-#5409 therefore
did not tell the program what offset was in effect.

Now:
  - convert_tool_length_offset writes the applied tool_offset for
    G43, G43Hn (any n), G43.1, G43.2, and G49 (zeroed).
  - set_tool_parameters / default_tool_parameters / init_tool_parameters
    no longer touch #5401-#5409. M6 changes the loaded tool but
    does not by itself apply its offset.
  - convert_setup_tool (G10 L1/L10/L11) no longer touches them either.
  - #5400 (toolno) and #5410-#5413 (diameter, angles, orientation)
    still update on M6 / G10 / startup as before.

Doc note in overview.adoc updated to match.

Fixes LinuxCNC#2994
Document the official way to recover the absolute machine coordinate of
a probe from #5061-#5069. Since LinuxCNC#3996, #5401-#5409 report the applied
tool length offset, so the conversion works with or without an active
tool offset and does not require cancelling it with G49 first.

Refs LinuxCNC#4159
Eight tests in tests/interp/g10/, tests/t0/ and tests/toolchanger/
asserted the old behavior of #5401-#5409 (rewritten by M6 / G10 /
init from the loaded tool's stored offsets). Under the new applied
semantics they need to check the offset only after G43 (or check
that #5401-#5409 are unchanged when only M6 / G10 has run).

Expected outputs regenerated on the 2.9 tree.

(cherry picked from commit 49ddfe6)
@grandixximo grandixximo force-pushed the backport/3996-tool-offset-params-2.9 branch from fcd80fe to c52992c Compare June 14, 2026 02:59
@andypugh andypugh merged commit 030a849 into LinuxCNC:2.9 Jun 14, 2026
17 checks passed
@grandixximo grandixximo deleted the backport/3996-tool-offset-params-2.9 branch June 15, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants