Skip to content

interp: add new ini setting disabling auto reset to G54 on M2,M30#4093

Merged
andypugh merged 1 commit into
LinuxCNC:masterfrom
Sigma1912:feature_g54_on_program_stop
Jun 2, 2026
Merged

interp: add new ini setting disabling auto reset to G54 on M2,M30#4093
andypugh merged 1 commit into
LinuxCNC:masterfrom
Sigma1912:feature_g54_on_program_stop

Conversation

@Sigma1912
Copy link
Copy Markdown
Contributor

@Sigma1912 Sigma1912 commented May 31, 2026

As requested here:
https://forum.linuxcnc.org/38-general-linuxcnc-questions/58821-how-to-remove-automatic-g54-after-m2-m30#346816

Adds a new ini file setting to disable the automatic resetting of the current WCS to G54 on M2 and M30.

Setting defaults to '0' so this modification is opt-in and default behavior is unchanged.

Comment thread src/emc/rs274ngc/interp_internal.hh Outdated
Comment thread docs/src/config/ini-config.adoc Outdated
@zz912
Copy link
Copy Markdown
Contributor

zz912 commented May 31, 2026

Can I ask you add it in to pncconf?

here:


add:

        print("# When DISABLE_AUTO_G54_ON_PROGSTOP = 1'", file=file)
        print("# M2,M30 and M99 will no longer'", file=file)
        print("# automatically reset the active WCS to 'G54'", file=file)
        print("DISABLE_AUTO_G54_ON_PROGSTOP = 0", file=file)

@zz912
Copy link
Copy Markdown
Contributor

zz912 commented May 31, 2026

I tested main functionality of this PR in Gmoccapy. It works.

@Sigma1912 Sigma1912 force-pushed the feature_g54_on_program_stop branch 4 times, most recently from 42c29ac to 93791ad Compare June 1, 2026 00:01
@Sigma1912
Copy link
Copy Markdown
Contributor Author

@zz912
Added as requested (I made the comment a bit more compact)

@Sigma1912 Sigma1912 changed the title add new ini setting 'DISABLE_AUTO_G54_ON_PROGSTOP' interp: add new ini setting 'DISABLE_AUTO_G54_ON_PROGSTOP' Jun 1, 2026
Comment thread src/emc/usr_intf/pncconf/build_INI.py Outdated
@Sigma1912
Copy link
Copy Markdown
Contributor Author

@zz912 could you please clarify whether your requested addition to pncconf was for gmoccapy only or for all guis

@zz912
Copy link
Copy Markdown
Contributor

zz912 commented Jun 1, 2026

I want it for all GUIs. I made wrong numbers of spaces.
Thank you for check.

@Sigma1912 Sigma1912 force-pushed the feature_g54_on_program_stop branch from 93791ad to 854baf5 Compare June 1, 2026 12:37
@andypugh
Copy link
Copy Markdown
Collaborator

andypugh commented Jun 2, 2026

I don't like "PROGSTOP".
Can you make it "DISABLE_AUTO_G54_ON_M2_M30 ?
(This makes it more explicit that a g-code file wrapped in "%" won't trigger the behaviour.)

@zz912
Copy link
Copy Markdown
Contributor

zz912 commented Jun 2, 2026

I prefer "DISABLE_AUTO_G54".

@Sigma1912
Copy link
Copy Markdown
Contributor Author

I don't like "PROGSTOP".
Can you make it "DISABLE_AUTO_G54_ON_M2_M30 ?
(This makes it more explicit that a g-code file wrapped in "%" won't trigger the behaviour.)

Yes, 'progstop' might indeed be a bit misleading. Note though that for a g-code file wrapped in "%" the WCS is not (and has never been) automatically switched to G54 so there isn't really much cause for confusion.

In this sense it might indeed be better to just make it "DISABLE_AUTO_G54" and leave the details to the documentation. Opinions?

@Sigma1912 Sigma1912 force-pushed the feature_g54_on_program_stop branch 2 times, most recently from d871b20 to e0b14be Compare June 2, 2026 14:11
@Sigma1912 Sigma1912 changed the title interp: add new ini setting 'DISABLE_AUTO_G54_ON_PROGSTOP' interp: add new ini setting disabling auto reset to G54 on M2,M30 Jun 2, 2026
… current WCS to G54 on M2 and M30:

[RS274NGC]
DISABLE_AUTO_G54 = 1

Note:
This new setting defaults to '0' so this modification is opt-in and default behavior is unchanged.
@Sigma1912 Sigma1912 force-pushed the feature_g54_on_program_stop branch from e0b14be to 3dd4239 Compare June 2, 2026 14:15
@Sigma1912
Copy link
Copy Markdown
Contributor Author

Changed to "DISABLE_AUTO_G54" for now. Happy to change again if preferred.
Also dropped the misleading reference to M99 as that does only apply to preview (ie outside of task).

PR topic and comment have also been updated.

@andypugh andypugh merged commit 86ca25a into LinuxCNC:master Jun 2, 2026
15 checks passed
@Sigma1912 Sigma1912 deleted the feature_g54_on_program_stop branch June 2, 2026 15:43
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.

4 participants