interp: don't restore spindle speed on abort state restore - #4473
Open
grandixximo wants to merge 1 commit into
Open
interp: don't restore spindle speed on abort state restore#4473grandixximo wants to merge 1 commit into
grandixximo wants to merge 1 commit into
Conversation
On abort, restore_from_tag() executes a G-code string built from the difference between the motion state tag and the interpreter readahead state. gen_settings() unconditionally appends the saved S word, so after an early abort the restore queued EMC_SPINDLE_SPEED onto the interp_list and it was issued after the abort's spindle stop, turning the spindle back on. Late aborts were unaffected because tag and readahead state agree by then and no restore command is generated. Exclude the spindle speed from the abort restore, as is already done for M codes. The M72 restore_settings() path keeps restoring it, since there the S word must take effect mid-program.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #4467 to the 2.9 branch.
On abort,
emcTaskStateRestore()runsrestore_from_tag(), which builds a G-code restore string from the difference between the motion state tag and the interpreter readahead state.gen_settings()unconditionally appends the saved S word, so after an early abort the restore queuedEMC_SPINDLE_SPEEDafter the abort's spindle stop, turning the spindle back on. Aborting late in a program was unaffected because tag and readahead agree by then.Fix: exclude the spindle speed setting from the abort restore, as is already done for M codes. The M72
restore_settings()path keeps restoring it, since there the S word must take effect mid-program.Verified headless on a 2.9 sim with the program from the issue's forum thread: abort near the start restarted the spindle to 3000 rpm before the fix and stays off after.