Skip to content

interp: expose absolute machine position as #5021-#5029#4167

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:feature/machine-coord-params
Open

interp: expose absolute machine position as #5021-#5029#4167
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:feature/machine-coord-params

Conversation

@grandixximo

@grandixximo grandixximo commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Adds a machine-coordinate current-position parameter set, #5021-#5029, for X Y Z A B C U V W.

These report the current absolute machine position (G53 frame), with no coordinate system, G92/G52 or tool length offset applied, in the current program units. They are read-only and volatile, filled each line alongside #5420-#5428 and not persisted to the var file.

This is the same value already exposed by the #<_abs_*> named parameters, which existed only for X Y Z A B C; this also adds the missing #<_abs_u>, #<_abs_v>, #<_abs_w> so both sets cover all nine axes. The shared computation is factored into get_abs_position().

Until now the machine position had no numbered parameter; getting it required summing the individual offset registers by formula or the G30.1 trick (which writes the absolute position into #5181-#5186). With this set:

  • absolute machine position is available directly,
  • the active offset per axis is #5021 - #5420,
  • a probe point in machine coordinates is #5061 + #5021 - #5420 (no coordinate rotation).

The G38 documentation is updated to use this instead of the offset-summing formula. Includes a new interp test verifying the machine position tracks the commanded G53 location across coordinate system, G92, rotation and tool length offset, and that the numbered set agrees with the named set.

Follow-up to the #4159 #4163 discussion. @cmorley does this match what you had in mind?
@rene-dev this extends your global parameters, looks ok?

Add a machine-coordinate current-position parameter set, matching the
layout used by other controllers. Reading machine coordinates
previously required either summing the individual offset registers by
formula or the G30.1 trick (which writes the absolute position into
#5181-#5186).

#5021-#5029 hold the current absolute machine position (G53 frame) for
X Y Z A B C U V W, in the current program units, with no coordinate
system, G92/G52 or tool length offset applied. They are read-only and
volatile, filled each line alongside #5420-#5428 and not persisted to
the var file.

This is the same value already available as the #<_abs_*> named
parameters, which until now existed only for X Y Z A B C; the U V W
named parameters (#<_abs_u>, #<_abs_v>, #<_abs_w>) are added to match.

The shared computation is factored into get_abs_position().
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.

1 participant