Skip to content

preview and DROs: G52 offsets and the tilted work plane - #4841

Open
grandixximo wants to merge 2 commits into
LinuxCNC:masterfrom
grandixximo:preview-g52-plane
Open

grandixximo wants to merge 2 commits into
LinuxCNC:masterfrom
grandixximo:preview-g52-plane

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

Three bugs Sigma1912 found:

  • The preview ignored a G52 set in MDI. The preview's preamble runs the startup code, which often clears the G92 offsets with G92.1, and nothing put them back. The preamble now restates them by value with G52.
  • Reloading a program with G68.2 active failed with "Cannot change G92 offsets while a tilted work plane (G68.2) is active". The preamble restated the "G92 applied" mode as G92.3 after the plane, which refuses it. The G52 now comes ahead of the plane, and the G92.3 is gone.
  • The gmoccapy, qtvcp and gladevcp DROs left out the tilted work plane. After G68.2 Z30 and G0 X0 Y0 Z0 they showed Z30. hal_glib's get_position() and the gladevcp DRO widget now take the plane off after G92, as AXIS does.

tests/workplane-preview gets two cases, a G52 alone and a G52 under a plane. On master the first ends 7 mm off and the second is refused; with the fix both end where the machine does. The DRO code needs a display, so I checked it on a sim under xvfb rather than in a test.

The preview started from the startup code, which often clears the G92 offsets with G92.1, and then restated the "G92 applied" mode as G92.3, which reads them back from the preview's copy of the parameters. A G52 set in MDI was lost, so the program was drawn without it, and with a tilted work plane active the G92.3 came after the plane, which refuses a change to the G92 offsets: the preview stopped at line 0 with "Cannot change G92 offsets while a tilted work plane (G68.2) is active".

The preview now restates the offsets with G52 and the machine's values, ahead of the plane, which sits inside them. tests/workplane-preview checks a G52 alone and under a plane: both ended 7 mm off or refused before, the same end as the machine now.

Reported by Sigma1912.
hal_glib's get_position(), which gmoccapy's and qtvcp's DROs read, and the gladevcp DRO widget left out the tilted work plane, which AXIS takes off after G92: after G68.2 Z30 and G0 X0 Y0 Z0 they showed Z30. Both now take the plane off as AXIS does.

Reported by Sigma1912.
grandixximo added a commit to grandixximo/linuxcnc that referenced this pull request Nov 14, 2026
Under the machine frame kinematics the plane is cut through the machine's second feature coordinate system, which comes after the whole offset chain; AXIS takes it off first. hal_glib's get_position() and the gladevcp DRO widget left it out: in a plane under G13.1, G0 X1 Y2 Z3 showed X-4.1 Y-88.7 Z27.1. Both now take it off as AXIS does.

To fold into the lane that taught AXIS the same, once LinuxCNC#4841 has merged.
grandixximo added a commit to grandixximo/linuxcnc that referenced this pull request Nov 14, 2026
Under the machine frame kinematics the plane is cut through the machine's second feature coordinate system, which comes after the whole offset chain; AXIS takes it off first. hal_glib's get_position() and the gladevcp DRO widget left it out: in a plane under G13.1, G0 X1 Y2 Z3 showed X-4.1 Y-88.7 Z27.1. Both now take it off as AXIS does.

To fold into the lane that taught AXIS the same, once LinuxCNC#4841 has merged.
grandixximo added a commit to grandixximo/linuxcnc that referenced this pull request Nov 14, 2026
Under the machine frame kinematics the plane is cut through the machine's second feature coordinate system, which comes after the whole offset chain; AXIS takes it off first. hal_glib's get_position() and the gladevcp DRO widget left it out: in a plane under G13.1, G0 X1 Y2 Z3 showed X-4.1 Y-88.7 Z27.1. Both now take it off as AXIS does.

To fold into the lane that taught AXIS the same, once LinuxCNC#4841 has merged.
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