mirror of
git://soft.sys114.com/klipper
synced 2026-02-10 23:48:06 +09:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user