position sync when hardware endstops are hit#28388
Open
DerAndere1 wants to merge 1 commit into
Open
Conversation
73cd014 to
caeb152
Compare
caeb152 to
bd76b60
Compare
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.
Description
Position was corrupted after trying to move beyond enabled hardware endstops. Repeated move commands beyond the hardware endstop were still stopped, but position stayed corrupted. When later move commands continued motion within axis limits. that caused wrong toolhead positions in real life. If one axis end had no endstops, this could lead to a crash.
Steps to reproduce:
With this fix: When moving into a hardware endstop, motion.position is set to the axis limit (e.g. Z_MIN_POS or Z_MAX_POS) to keep position synchronized with actual nozzle position. I still prefer the alternative solution to call kill() when hitting any endstop (hardware or software) because such an event means that positions are wrong, either due to user error or due to a firmware bug.
Requirements
none. The bug could happen with any config, but occurance is propably higher / more obvious with one or more of these:
Benefits
less risk of wrong positions and crashes
Configurations
https://github.com/DerAndere1/Marlin2ForPipetBot/tree/Marlin2ForPipetBot/config/examples/DerAndere/bugfix_test
Related Issues
Possibly some of the reported issues dealing with wrong "z-offset", and problems with bed leveling compensation.