diff options
author | Dennis Marttinen <38858901+twelho@users.noreply.github.com> | 2025-01-10 15:41:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-10 10:41:09 -0500 |
commit | 7083879700800710c624c0bf08220215ba5f4a83 (patch) | |
tree | 03595e28aca8238f9f8e727ba6e1d43aed52b2e6 /klippy/extras/force_move.py | |
parent | 9ca71d8608f4a6013c3453ffa9e75c3739078712 (diff) | |
download | kutter-7083879700800710c624c0bf08220215ba5f4a83.tar.gz kutter-7083879700800710c624c0bf08220215ba5f4a83.tar.xz kutter-7083879700800710c624c0bf08220215ba5f4a83.zip |
force_move: Implement CLEAR for SET_KINEMATIC_POSITION (#6262)
`CLEAR` clears the homing status (resets the axis limits) without turning off
the motors. This is particularly useful when implementing safe Z homing in
`[homing_override]` on printers with multiple independent Z steppers (where
`FORCE_MOVE` can't be used).
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
Diffstat (limited to 'klippy/extras/force_move.py')
-rw-r--r-- | klippy/extras/force_move.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/klippy/extras/force_move.py b/klippy/extras/force_move.py index 50b80141..598783a4 100644 --- a/klippy/extras/force_move.py +++ b/klippy/extras/force_move.py @@ -131,8 +131,13 @@ class ForceMove: x = gcmd.get_float('X', curpos[0]) y = gcmd.get_float('Y', curpos[1]) z = gcmd.get_float('Z', curpos[2]) - logging.info("SET_KINEMATIC_POSITION pos=%.3f,%.3f,%.3f", x, y, z) + clear = gcmd.get('CLEAR', '').upper() + axes = ['X', 'Y', 'Z'] + clear_axes = [axes.index(a) for a in axes if a in clear] + logging.info("SET_KINEMATIC_POSITION pos=%.3f,%.3f,%.3f clear=%s", + x, y, z, ','.join((axes[i] for i in clear_axes))) toolhead.set_position([x, y, z, curpos[3]], homing_axes=(0, 1, 2)) + toolhead.get_kinematics().clear_homing_state(clear_axes) def load_config(config): return ForceMove(config) |