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>
This commit is contained in:
Dennis Marttinen
2025-01-10 15:41:09 +00:00
committed by GitHub
parent 9ca71d8608
commit 7083879700
16 changed files with 77 additions and 46 deletions

View File

@@ -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