Skip to content

bug(interp): G52,G92 is not reset on M2,M30 regardless of DISABLE_G92_PERSISTENCE setting #4096

@Sigma1912

Description

@Sigma1912

'Coordinate Systems' documentation states:
https://linuxcnc.org/docs/html/gcode/coordinates.html

Programmers that wish for Fanuc behavior, where G92 offsets are cleared at machine start and after a reset or program end, may disable G92 persistence by setting DISABLE_G92_PERSISTENCE = 1 in the [RS274NGC] section of the INI file.

However, testing with [RS274NGC] DISABLE_G92_PERSISTENCE = 1 in axis.ini shows different behavior:

  1. Start axis.ini -> Dro X and 'G92 X' are '0.000'
  2. MDI: (debug, #5210) -> shows '0.000'
  3. MDI: G92 x1 -> Dro X changes to '1.000', 'G92 X' changes to '-1.000'
  4. MDI: (debug, #5210) -> now shows '1.000'
  5. MDI: m2
  6. MDI: (debug, #5210) -> shows '0.000', Dro X and G92 X SHOULD change to '-1.000' and '0.000' respectively but remain unchanged
  7. MDI: g0 x0 -> tool moves to the offset position and confirms that the offset is indeed still applied instead of having been cleared on m2

Note that the 'INI' documentation seems to have only ever mentioned ' config start up':
https://linuxcnc.org/docs/html/config/ini-config.html#sub:ini:sec:rs274ngc

DISABLE_G92_PERSISTENCE = 0 Default 0 Allow to clear the G92 offset automatically when config start-up.

Meanwhile 'interp_convert.cc' comments for 'convert_stop:

10. G52/G92 is cleared if DISABLE_G92_PERSISTENCE is set in the .ini file

and runs this on M2,M30,M99 if 'DISABLE_G92_PERSISTENCE = 1'
/*10*/
if (settings->disable_g92_persistence)
// Clear G92/G52 offset
for (index=5210; index<=5219; index++)
settings->parameters[index] = 0;

Which seems to indicate that g92/g52 offsets were indeed intended to be reset to zero.

Tested on 2.9 and 2.10pre (current master)
This is a bug first discovered while investigating issue #2908 but I think it should have it's own issue since I have just run into it again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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