aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
diff options
context:
space:
mode:
authorDennis Marttinen <38858901+twelho@users.noreply.github.com>2025-01-10 15:41:09 +0000
committerGitHub <noreply@github.com>2025-01-10 10:41:09 -0500
commit7083879700800710c624c0bf08220215ba5f4a83 (patch)
tree03595e28aca8238f9f8e727ba6e1d43aed52b2e6 /klippy/extras
parent9ca71d8608f4a6013c3453ffa9e75c3739078712 (diff)
downloadkutter-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')
-rw-r--r--klippy/extras/force_move.py7
-rw-r--r--klippy/extras/safe_z_home.py3
2 files changed, 7 insertions, 3 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)
diff --git a/klippy/extras/safe_z_home.py b/klippy/extras/safe_z_home.py
index ca9b8eb5..ca0756cf 100644
--- a/klippy/extras/safe_z_home.py
+++ b/klippy/extras/safe_z_home.py
@@ -40,8 +40,7 @@ class SafeZHoming:
toolhead.set_position(pos, homing_axes=[2])
toolhead.manual_move([None, None, self.z_hop],
self.z_hop_speed)
- if hasattr(toolhead.get_kinematics(), "note_z_not_homed"):
- toolhead.get_kinematics().note_z_not_homed()
+ toolhead.get_kinematics().clear_homing_state((2,))
elif pos[2] < self.z_hop:
# If the Z axis is homed, and below z_hop, lift it to z_hop
toolhead.manual_move([None, None, self.z_hop],