diff --git a/docs/FAQ.md b/docs/FAQ.md index 8a67dcf2..b9c1cd23 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -157,9 +157,11 @@ the desired movement to the "custom g-code" section of your slicer. If the printer requires some additional movement as part of the homing process itself (or fundamentally does not have a homing process) then -consider using a homing_override section in the config file - see -[example-extras.cfg](../config/example-extras.cfg) for further -details. +consider using a homing_override section in the config file. If you +need to move a stepper for diagnostic or debugging purposes then +consider adding a force_move section to the config file. See +[example-extras.cfg](../config/example-extras.cfg) for further details +on these options. ### Why is the Z position_endstop set to 0.5 in the default configs? diff --git a/docs/G-Codes.md b/docs/G-Codes.md index c97e77df..8ca4440c 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -195,10 +195,12 @@ section is enabled: low-level kinematics in an incorrect state; issue a G28 afterwards to reset the kinematics. This command is intended for low-level diagnostics and debugging. -- `SET_KINEMATIC_POSITION X= Y= Z=`: Force the - low-level kinematic code to believe the toolhead is at the given - position. This is a diagnostic and debugging command; use - SET_GCODE_OFFSET and/or G92 for regular axis transformations. - Setting an incorrect or invalid position may lead to internal - software errors. This command may invalidate future boundary checks; - issue a G28 afterwards to reset the kinematics. +- `SET_KINEMATIC_POSITION [X=] [Y=] [Z=]`: Force + the low-level kinematic code to believe the toolhead is at the given + cartesian position. This is a diagnostic and debugging command; use + SET_GCODE_OFFSET and/or G92 for regular axis transformations. If an + axis is not specified then it will default to the position that the + head was last commanded to. Setting an incorrect or invalid position + may lead to internal software errors. This command may invalidate + future boundary checks; issue a G28 afterwards to reset the + kinematics. diff --git a/klippy/extras/force_move.py b/klippy/extras/force_move.py index d7d357b7..a6d7adc2 100644 --- a/klippy/extras/force_move.py +++ b/klippy/extras/force_move.py @@ -89,13 +89,13 @@ class ForceMove: self.restore_enable(stepper, True, was_ignore) cmd_SET_KINEMATIC_POSITION_help = "Force a low-level kinematic position" def cmd_SET_KINEMATIC_POSITION(self, params): - x = self.gcode.get_float('X', params) - y = self.gcode.get_float('Y', params) - z = self.gcode.get_float('Z', params) - logging.info("SET_KINEMATIC_POSITION pos=%.3f,%.3f,%.3f", x, y, z) toolhead = self.printer.lookup_object('toolhead') toolhead.get_last_move_time() curpos = toolhead.get_position() + x = self.gcode.get_float('X', params, curpos[0]) + y = self.gcode.get_float('Y', params, curpos[1]) + z = self.gcode.get_float('Z', params, curpos[2]) + logging.info("SET_KINEMATIC_POSITION pos=%.3f,%.3f,%.3f", x, y, z) toolhead.set_position([x, y, z, curpos[3]], homing_axes=(0, 1, 2)) self.gcode.reset_last_position()