Skip to content

Resume-at-line treats non-modal G53 as the active work coordinate system #665

Description

@righteousgambit

Summary

Resume-at-line currently considers G53 alongside G54 through G59.3 when it reconstructs the active work coordinate system. It then replays whichever command appeared most recently.

G53 is a non-modal qualifier for a machine-coordinate move, not a persistent work-coordinate-system selection. Replaying a bare G53 therefore does not restore the interrupted program's active WCS.

The behavior is present on develop at 2ea66c10e96d88013a04441134d3d4f8e8c88510: WCS recovery logic. LinuxCNC documents G53 as non-modal and G54 through G59.3 as WCS selectors: coordinate-system documentation. The Community Firmware likewise consumes G53 as a machine-coordinate flag for the associated movement: firmware implementation.

Minimal reproduction

G55
G53 G0 Z-2
G1 X10 F100
G1 X20

Preview a resume at line 4.

Expected:

  • The recovery command sequence contains buffer G55.
  • The controller's intentional safe-Z command remains buffer G53 G0 Z-2.

Actual:

  • The sequence contains a bare buffer G53 instead of restoring G55.
  • The separate safe-Z command is also present.

Impact

If the machine still retains G55, this may not change the resulting position. If the retained WCS differs after a reset, reconnect, or manual WCS change, however, resume positioning can occur in the wrong coordinate frame. Resume should reconstruct the file's modal WCS deterministically rather than depend on retained machine state.

Acceptance criteria

  • Only G54 through G59.3 participate in modal WCS recovery.
  • The intentional safe-Z move still uses G53 G0 Z-2.
  • A regression test proves that a later G53 move does not replace an earlier active WCS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions