Skip to content

interp: take the G52/G92 offset from status on abort - #4967

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:abort-g92-offset
Open

grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:abort-g92-offset

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

The interpreter reads ahead of the machine. When a program is aborted after the read ahead has passed a G52 or G92 the machine never reached, the interpreter keeps that offset while status, and so the DRO, still has the old one. The next move goes to the read ahead's offset. Example from #2908: G52 X100 then (abort, ...); the DRO shows no offset, and G0 X0 from MDI drives to X100.

DISABLE_G92_PERSISTENCE did not clear the offset on an abort either, only at startup and at M2/M30.

On abort the interpreter now takes the offset the machine has from status, as it does the coordinate system, and tells canon, so status and interpreter agree. With DISABLE_G92_PERSISTENCE it clears the offset, as M2 does. A new canon call, GET_EXTERNAL_G92_OFFSET, reads it; sai and the preview have no machine and keep the interpreter's offset.

tests/statbuffer-g5x-abort sets G52 X7 from MDI, aborts a program whose read ahead has passed a G52 X3, and checks the DRO, #5211 and where G0 X0 goes. It runs again with DISABLE_G92_PERSISTENCE = 1 and expects 0. Without the fix it ends at 3 in both runs. Its fixed sleeps are now waits on status, and test.sh uses set -e, since runtests runs it with bash -x and the -e on the first line was ignored.

The docs say the offset follows an abort, and overview.adoc no longer has the persistence of #5211-#5219 backwards.

Fixes #2908. Part of #4953.

The interpreter reads ahead of the machine. When a program was aborted
after the read ahead had passed a G52 or G92 the machine never reached,
the interpreter kept that offset while status, and so the DRO, still had
the old one, and the next move went to the read ahead's offset (LinuxCNC#2908).
DISABLE_G92_PERSISTENCE did not clear the offset on an abort either,
only at startup and at M2/M30.

On abort the interpreter now takes the offset the machine has from
status, as it does the coordinate system, and tells canon so status and
interpreter agree. With DISABLE_G92_PERSISTENCE it clears the offset, as
M2 does. A new canon call, GET_EXTERNAL_G92_OFFSET, reads it.

tests/statbuffer-g5x-abort sets G52 X7 from MDI, aborts a program whose
read ahead has passed a G52 X3, and checks the DRO, #5211 and where G0
X0 goes; it runs again with DISABLE_G92_PERSISTENCE = 1 and expects 0.
Its fixed sleeps are now waits on status. Without the fix it ends at 3
in both runs.

The docs say the offset follows an abort, and overview.adoc no longer
has the persistence of #5211-#5219 backwards.
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.

Program abort hides active G52/G92 from DRO

1 participant