Backport #3996: make #5401-#5409 the applied tool length offset (2.9)#4164
Merged
andypugh merged 3 commits intoJun 14, 2026
Merged
Conversation
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)
fcd80fe to
c52992c
Compare
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.
Backport of #3996 (plus the new G38 documentation from #4163) to 2.9.
#3996 makes parameters
#5401-#5409reflect 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-#5086semantics.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:
expectedfiles were regenerated locally because 2.9 emitsCHANGE_TOOL(n)/START_CHANGE()where master emitsCHANGE_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.