_LINEAR_EXIT restore_z to z0 Fix - #46
Open
3DPrintDemon wants to merge 1 commit into
Open
Conversation
codur-design
approved these changes
Aug 23, 2026
| {% set tp = printer["gcode_macro TOOL_POSITIONS"] %} | ||
| {% set c = printer["gcode_macro _INDX_CONSTANTS"] %} | ||
| {% set restore_z = params.RESTORE_Z|default("")|string %} | ||
| {% set restore_z = params.RESTORE_Z|default(0)|float %} |
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.
If you press T(n) from an un-homed state with a homing override macro that uses
SET_KINEMATIC_POSITION Z=0in any way to lift the toolhead before G28 homing, line 352 of the current index-tc-macros.cfg can potentially set therestore_zposition to 0.000 when theCHANGE_TOOLmacro evaluates. See photo.add
M118 restore_z saw {restore_z}mmafter line 352 to test.This will then proceed to lower the nozzle to the bed (Z0) after the
_LINEAR_EXITmacro completes. As the current line 239 sees 0.00 as not "" so passes that command ofG0 Z0.000to the_TC_G0macro for execution - but can't tell if it's potentially destructive or not.This way if
restore_zis passed as 0.000 it is simply not actioned as this outcome is obviously undesirable.