aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/force_move.py
Commit message (Collapse)AuthorAgeFilesLines
* force_move: Support a SET_HOMED parameter to SET_KINEMATIC_POSITIONKevin O'Connor2025-04-081-6/+13
| | | | | | | | | | | | | | | Commit 70838797 added support for clearing the homing state in SET_KINEMATIC_POSITION commands. However, it can be difficult to use that support as the default for SET_KINEMATIC_POSITION is to set all axes as homed. Add a new SET_HOMED parameter to allow one to explicitly request which axes to consider in a homed state. Also introduce a CLEAR_HOMED parameter and prefer that to the existing CLEAR parameter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Use strings for axes to clear in clear_homing_state()Kevin O'Connor2025-01-211-4/+3
| | | | | | | Pass a string such as "xyz" to kin.clear_homing_state(). This makes the parameter a little less cryptic. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Pass set_position() homing_axes parameter as a stringKevin O'Connor2025-01-211-1/+1
| | | | | | | | Use strings such as "xyz" to specify which axes are to be considered homing during a set_position() call. This makes the parameter a little less cryptic. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Implement CLEAR for SET_KINEMATIC_POSITION (#6262)Dennis Marttinen2025-01-101-1/+6
| | | | | | | | `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>
* toolhead: Rename note_kinematic_activity() to note_mcu_movequeue_activity()Kevin O'Connor2024-01-181-1/+1
| | | | | | Rename this function to make it more clear why it is called. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Fix missing call to note_kinematic_activity()Kevin O'Connor2024-01-181-0/+1
| | | | | | | | | Commit 3d3b87f9 incorrectly removed the call to note_kinematic_activity(). A call to toolhead.dwell() is not sufficient to wake up the mcu move queue flushing. The call to note_kinematic_activity() is needed for that. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Ensure full kin_flush_delay after flush_step_generation()Kevin O'Connor2024-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | Commit b7b13588 made it possible that the kinematic code could be restarted after a flush_step_generation() call without a sufficient delay. Rename last_sg_flush_time to min_restart_time and use that to ensure _calc_print_time() always pauses kin_flush_delay time since the last flush_step_generation() call. Also, update force_move to invoke flush_step_generation() after any movements. This is needed to ensure there is a sufficient delay should force_move be called on a stepper motor that is part of the toolhead kinematics and is using a step generation "scan time". This fixes possible "internal error in stepcompress" reports when using FORCE_MOVE. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Keep stepcompress move history relative to current time (#6439)Francois Chagnon2023-12-301-1/+2
| | | | | Expire history relative to current time rather than last move in history queue Signed-off-by: Francois Chagnon <fc@francoischagnon.net>
* kinematics: Convert to Python3 string encodingKevin O'Connor2021-10-011-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Simplify helper module registration of stepper motorsKevin O'Connor2021-07-291-3/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Rename trapq_free_moves() to trapq_finalize_moves()Kevin O'Connor2021-07-291-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Note force_enable() and restore_enable() are internal functionsKevin O'Connor2021-07-291-5/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Automatically call reset_last_position() on a toolhead set_position()Kevin O'Connor2020-08-201-2/+0
| | | | | | | | Generate a "toolhead:set_position" event on a call to toolhead.set_position() and use that event to automatically call gcode.reset_last_position(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Make sure to reload trapq in set_stepper_kinematics()Kevin O'Connor2020-06-301-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Use new GCodeCommand wrappersKevin O'Connor2020-05-051-23/+24
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Query the stepper step_distance from the stepper objectKevin O'Connor2020-02-011-0/+4
| | | | | | | Don't obtain the step_distance from the config, instead obtain step_distance from the instantiated stepper object. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Track if using units of radians instead of millimetersKevin O'Connor2020-01-061-3/+9
| | | | | | | | The STEPPER_BUZZ command needs to know if the axis is using radians instead of millimeters so that it can move a more appropriate distance. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Make sure to flush step generation queue after each moveKevin O'Connor2019-11-241-2/+3
| | | | | | | Add toolhead.note_kinematic_activity() call and use it to force the step generation to be flushed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Rename _full_flush() to flush_step_generation() and use globallyKevin O'Connor2019-11-211-1/+2
| | | | | | | Update code that modifies the low-level kinematics handlers to first call toolhead.flush_step_generation(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Move MCU_stepper from mcu.py to stepper.pyKevin O'Connor2019-11-121-3/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper_enable: Move enable tracking from stepper.py to stepper_enable.pyKevin O'Connor2019-11-121-3/+5
| | | | | | | Move the enable line tracking out of the main stepper.py code. This simplifies the main kinematic code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Calculate and store axes_r in move classKevin O'Connor2019-11-061-5/+8
| | | | | | | | Calculate the ratio of axis distance to total move distance (axis_d / move_d) and store in a new member variable axes_r. This avoids needing to recalculate the value in other code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trapq: Remove move_fill()Kevin O'Connor2019-11-061-6/+3
| | | | | | | Now that all callers use the trapq system to queue moves, it is no longer necessary to individually allocate and fill a 'struct move'. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Remove set_ignore_move()Kevin O'Connor2019-11-061-8/+5
| | | | | | | Update callers of set_ignore_move() to use the trapq system to set a stepper to ignore moves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Convert step generation to use trapq systemKevin O'Connor2019-11-061-2/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Avoid divide by zero in move time calculationKevin O'Connor2019-03-311-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* manual_stepper: Add support for moves with accelerationKevin O'Connor2019-03-031-9/+23
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Provide defaults for SET_KINEMATIC_POSITION parametersKevin O'Connor2018-08-021-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Add support for FORCE_MOVE commandKevin O'Connor2018-07-261-5/+34
| | | | | | | Add initial support for commands that will forcibly move a stepper (without updating the kinematic classes with the new position). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Simplify STEPPER_BUZZ codeKevin O'Connor2018-07-261-26/+35
| | | | | | | Separate the setup and movement parts of cmd_STEPPER_BUZZ() into their own functions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Rename stepper_buzz.py to force_move.pyKevin O'Connor2018-07-261-0/+65
This is in preparation for extending the ability to make manual moves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>