Add option to set the offsets via a custom macro - #167
Open
irrenhaus wants to merge 1 commit into
Open
Conversation
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.
This PR adds a new config variable
offset_macro.When set to the name of a
gcode_macro, instead of setting the calculated Z offset viaSET_GCODE_OFFSETthe configured macro is called with a parameterZbeing set to the calculated offset value.The reasoning behind this lies in toolchanging systems, in my case specifically Lineux: https://github.com/Bikin-Creative/Lineux-Toolchanger
For compensating any differences of the different tools in XYZ, all tools are measured against a common reference tool, most often T0.
Upon a toolchange to a different tool then
SET_GCODE_OFFSETis used to adjust the motion system to the different nozzle position of the tool.This in turn invalidates any changes made by klipper_z_calibration.
This PR now allows to:
CALIBRATE_Zfor T0 calling a custom macro that lets the toolchanging code know about the new offsetExample macro for Lineux:
Lineux then runs
SET_GCODE_OFFSET Z_ADJUST={printer["gcode_macro _btc_Variables"].gcode_offset_z_adjust} MOVE=1on each toolchange.