From 7083879700800710c624c0bf08220215ba5f4a83 Mon Sep 17 00:00:00 2001 From: Dennis Marttinen <38858901+twelho@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:41:09 +0000 Subject: 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 --- klippy/kinematics/polar.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'klippy/kinematics/polar.py') diff --git a/klippy/kinematics/polar.py b/klippy/kinematics/polar.py index deed26d0..fdd428a6 100644 --- a/klippy/kinematics/polar.py +++ b/klippy/kinematics/polar.py @@ -51,9 +51,12 @@ class PolarKinematics: self.limit_z = self.rails[1].get_range() if 0 in homing_axes and 1 in homing_axes: self.limit_xy2 = self.rails[0].get_range()[1]**2 - def note_z_not_homed(self): - # Helper for Safe Z Home - self.limit_z = (1.0, -1.0) + def clear_homing_state(self, axes): + if 0 in axes or 1 in axes: + # X and Y cannot be cleared separately + self.limit_xy2 = -1. + if 2 in axes: + self.limit_z = (1.0, -1.0) def _home_axis(self, homing_state, axis, rail): # Determine movement position_min, position_max = rail.get_range() @@ -86,8 +89,7 @@ class PolarKinematics: if home_z: self._home_axis(homing_state, 2, self.rails[1]) def _motor_off(self, print_time): - self.limit_z = (1.0, -1.0) - self.limit_xy2 = -1. + self.clear_homing_state((0, 1, 2)) def check_move(self, move): end_pos = move.end_pos xy2 = end_pos[0]**2 + end_pos[1]**2 -- cgit v1.2.3-70-g09d2