Fixup position adjustment on toolchange #4010
Merged
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.
Background: When changing tools,
gcode_T
ascertains the position, in coordinate-space, of the new nozzle. The offsets are specified in physical space, so when leveling is active some additional adjustments are needed to get the position in the adjusted coordinate space.Meanwhile, when tools share the same carriage, tool change works like
G92
in coordinate space w/r/t the carriage. So the software endstops need to be adjusted in XY to provide proper movement limits for the active tool. This adjustment must be made in linear space, with no leveling adjustment, in all cases where tools share the same carriage.This PR makes the following changes:
Note that Z software endstops are not changed because only the configured offsets apply, and the only tool with a Z adjustment (switching extruder #3994) manages that earlier, and transparently.
Subscribing: @epatel @Roxy-3DPrintBoard