aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/kinematics
Commit message (Collapse)AuthorAgeFilesLines
* Isort all klippy codeTomasz Kramkowski2025-08-1514-16/+54
|
* Remove logfile supportTomasz Kramkowski2025-08-151-1/+0
|
* Run black on all first party python codeTomasz Kramkowski2025-08-0615-750/+1289
|
* input_shaper: Track kinematics updates by dual_carriageDmitry Butyugin2025-06-041-12/+8
| | | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* dual_carriage: Fixed input shaper stepper kinematics initializationDmitry Butyugin2025-05-221-3/+9
| | | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* gcode_move: Support additional toolhead axesKevin O'Connor2025-05-121-0/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Initial support for adding extra axes to toolhead movesKevin O'Connor2025-05-121-13/+14
| | | | | | | | Add a new add_extra_axes() to support adding additional axes. Once called, toolhead.get_position() will return a list object with more than 4 items, and toolhead.move() requires the same size list. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Remove update_move_time() callKevin O'Connor2025-05-121-6/+2
| | | | | | | The toolhead can obtain the underlying extruder trapq via extruder.get_trapq(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Rename extruder.move() to extruder.process_move()Kevin O'Connor2025-05-121-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Fix broken manual_stepper rail naming (#6929)Dmitry Butyugin2025-05-102-3/+3
| | | | | The naming got broken during refactoring for generic_cartesian. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* dual_carriage: Fixed broken safe_distance parameterDmitry Butyugin2025-05-073-3/+6
| | | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* kinematics: Generic Cartesian kinematics implementation (#6815)Dmitry Butyugin2025-05-069-149/+664
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests: Added a regression test for generic_cartesian kinematics * kinematics: An intial implementation of generic_cartesian kinematics * generic_cartesian: Refactored kinematics configuration API * generic_cartesian: Use stepper instead of kinematic_stepper in configs * generic_cartesian: Added SET_STEPPER_KINEMATICS command * generic_cartesian: Fixed parsing of section names * docs: Generic Caretsian kinematics documentation and config samples * generic_cartesian: Implemented multi-mcu homing validation * generic_cartesian: Fixed typos in docs, minor fixes * generic_cartesian: Renamed `kinematics` option to `carriages` * generic_cartesian: Moved kinematic_stepper.py file * idex_modes: Internal refactoring of handling dual carriages * stepper: Refactored the code to not store a reference to config object * config: Updated example-generic-cartesian config * generic_cartesian: Restricted SET_STEPPER_CARRIAGES and exported status * idex_modes: Fixed handling stepper kinematics with input shaper enabled * config: Updated configs and tests for SET_DUAL_CARRIAGE new params * generic_cartesian: Avoid inheritance in the added classes Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* force_move: Use strings for axes to clear in clear_homing_state()Kevin O'Connor2025-01-2111-33/+33
| | | | | | | 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-2110-15/+19
| | | | | | | | 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>
* stepper_enable: Directly call clear_homing_state() on motor off eventKevin O'Connor2025-01-219-36/+0
| | | | | | | | Call clear_homing_state() on each motor off event. This simplifies the kinematic classes as they no longer need to register and handle the motor_off event. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* force_move: Implement CLEAR for SET_KINEMATIC_POSITION (#6262)Dennis Marttinen2025-01-1011-29/+53
| | | | | | | | `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>
* idex_modes: Improved restoring position in RESTORE_DUAL_CARRIAGE_STATEDmitry Butyugin2024-08-031-6/+28
| | | | | | | | Previous implementation could crash the idex carriages into each other. The new code moves the idex carriages together, eliminating this risk and decreasing the time needed to restore the carriages positions. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* extruder: Allow dynamic adjustment of pressure advance (#6635)Dmitry Butyugin2024-07-111-4/+7
| | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* configfile: Allow getchoice() to take a listKevin O'Connor2024-06-173-3/+3
| | | | | | If a list is passed to getchoice(), seamlessly convert it to a dict. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* idex_modes: Bugfix for kinematic position calculation.Frans-willem Hardijzer2024-05-164-22/+34
| | | | | | | | | | | | | | | idex_mode would swap the X and dual-carriage rail in some cases (homing), but not in others. As such, the position calculation was correct while homing, but incorrect for the second carriage during normal moves. This commit fixes homing to work without swapped rails, removes the swapping of rails while homing, and removes the ability to swap rails (as it is now no longer used). Fix has been tested in a Hybrid_CoreXY IDEX printer (Voron Double Dragon). Hybrid_CoreXZ has identical changes and is similar enough that I am confident it will work as intended. Changes to cartesion seem simple enough, but would benefit from someone running a couple of tests. Signed-off-by: Frans-Willem Hardijzer <fw@hardijzer.nl>
* klippy: remove a few unused variable assignments (#6504)Kamil Domański2024-04-052-2/+0
| | | Signed-off-by: Kamil Domański <kamil@domanski.co>
* extruder: Remove deprecated commands and configKevin O'Connor2024-02-151-30/+1
| | | | | | | | Remove the deprecated SET_EXTRUDER_STEP_DISTANCE and SYNC_STEPPER_TO_EXTRUDER commands. Remove the deprecated shared_heater config option. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Keep stepcompress move history relative to current time (#6439)Francois Chagnon2023-12-301-3/+3
| | | | | Expire history relative to current time rather than last move in history queue Signed-off-by: Francois Chagnon <fc@francoischagnon.net>
* Revert "toolhead: Use dict for step generation flush times. (#6303)"Kevin O'Connor2023-10-211-1/+5
| | | | | | | | | | This reverts commit 6749985302fe002a9cb5672dab9badb11e4e3c36. A defect was found in the above commit (the input shaper code calls note_step_generateion_scan_time() for many steppers, so the input_shaper class can't be used as the index). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Use dict for step generation flush times. (#6303)Viesturs Zariņš2023-10-191-5/+1
| | | | | Makes the API to extruder and input shaper more robust, avoiding the need to track the old delay. Signed-off-by: Viesturs Zariņš <viesturz@gmail.com>
* idex_modes: Fixed the case when carriages home in the same direction (#6310)Dmitry Butyugin2023-09-291-8/+45
| | | | | | | | | | | | | | | | | | | | | Previous version of the code assumed that dual carriages home away from each other, which is not true on some machines, which have the second dual carriage homing on the first carriage. The new code correctly identifies the relative order of the carriages now. This fixes discrepancies between the documentation and the actual implementation of the carriages kinematic ranges calculation. Notes about dual_carriage homing and proximity checks changes Fixed clearing of homing state after homing in certain modes In case of multi-MCU homing it is possible that the carriage position will end up outside of the allowed motion range due to latencies in data transmission between MCUs. Selecting certain modes after homing could result in home state clearing instead of blocking the motion of the active carriage. This commit fixes this undesired behavior. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* cartesian: fix x-axis being hardcoded for dual_carriage (#6313)D4SK2023-08-111-1/+2
| | | Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
* idex_modes: A small fix for MOVE_SPEED paramDmitry Butyugin2023-08-011-1/+1
| | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* idex_modes: COPY and MIRROR mode implementation (#6297)Dmitry Butyugin2023-08-014-179/+237
| | | | | | | | | | | COPY and MIRROR mode implementation Correctly apply input shaper params to new dual_carriage Added SAVE_/RESTORE_IDEX_STATE commands Documentation updates for the new IDEX modes Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* idex_modes: Native input shaping support with dual carriagesDmitry Butyugin2023-06-061-16/+41
| | | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* hybrid_corexy: Fix changing dual-carriage carriage will inadvertently set ↵Frans-Willem Hardijzer2023-05-252-2/+10
| | | | | | | | | axis to homed, even if it wasn't. (#6183) In hybrid_corexy and hybrid_corexz, the update_limits function is (only) called by the DualCarriage implementation, whenever the carriage changes. Unfortunately, these limits also keep track of homing status, when they're unhomed they are set to 1 to -1 (invalid range). As a fix, if the limit was set to "unhomed", we keep it that way, and only update it with the new rail limits if it was already properly homed before. Signed-off-by: Frans-willem Hardijzer <fw@hardijzer.nl>
* extruder: store currently sync'ed motion queue namePedro Lamas2023-02-091-1/+5
| | | | Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
* extruder: Add extruder name to extruder_stepper respond message (#6020)CODeRUS2023-02-031-2/+4
| | | Signed-off-by: Andrei Kozhevnikov <coderusinbox@gmail.com>
* delta: Better delta build volume constraint checkjanherich2022-12-301-1/+7
| | | | | | | | | | Existing code uses very restrictive build volume constraint checking with just narrow cone on top of fully cylinder for delta printers. Code here implements more permissive and still safe build volume constraint checks. Signed-off-by: Jan Herich <jan.herich@gmail.com>
* corexz: Multiple steppers per axis on CoreXZNeko-vecter2022-12-021-7/+6
| | | | | | Allowing multiple steppers per axis. Signed-off-by: Vecter Fang <vecterfang@icloud.com>
* kinematics: Add deltesian printers (#5743)Tircown2022-09-011-0/+184
| | | | | Initial push of the working deltesian kinematics after some successful tests. Signed-off-by: Fabrice GALLET <tircown@gmail.com>
* extruder_stepper: Support configuring pressure advance from configDmitry Butyugin2022-09-011-4/+4
| | | | | | | Also added status report for extruder_stepper objects with the current pressure advance parameters values. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* delta: Added the possibility to get where the "cone shape" of the build ↵Nitram2022-08-191-0/+1
| | | | | | | volume starts from Macros (#5662) Added the possibility to get where the "cone shape" of the build volume starts from Macros Signed-off-by: Martin Malmqvist <Volcomosq@gmx.com>
* extruder: Verify trapq is unmodified on default SET_PRESSURE_ADVANCEKevin O'Connor2022-03-041-0/+3
| | | | | | | | | Check that a SET_PRESSURE_ADVANCE without an explicit EXTRUDER parameter isn't done after the user disables or reassociates the extruder stepper motor (via SYNC_EXTRUDER_MOTION). Otherwise, it could lead to very confusing results. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Allow an extruder object to be created without a stepperKevin O'Connor2022-03-041-7/+16
| | | | | | | This may be useful for dual hotend printers that have only one stepper. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Multiple steppers on delta tower (#5217)Andrei Ignat2022-02-281-3/+3
| | | | | Updated tower rail setup to support multiple steppers per tower. Signed-off-by: Andrei Ignat <andrei@ignat.se>
* corexy: Multiple steppers per axis on CoreXY (#4886)Andrei Ignat2022-02-281-7/+6
| | | | | Allowing multiple steppers per axis. Signed-off-by: Andrei Ignat <andrei@ignat.se>
* extruder: Deprecate old extruder commands and shared_heater config optionKevin O'Connor2022-02-101-0/+1
| | | | | | | | | | | Deprecate SET_EXTRUDER_STEP_DISTANCE and SYNC_STEPPER_TO_EXTRUDER. Recommend using SET_EXTRUDER_ROTATION_DISTANCE and SYNC_EXTRUDER_MOTION. Deprecate the extruder "shared_heater" option and reocmmend using extruder_stepper config sections to obtain the same functionality. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add new SYNC_EXTRUDER_MOTION commandKevin O'Connor2022-02-101-0/+8
| | | | | | | This command is a rename of SYNC_STEPPER_TO_EXTRUDER. This change is in preparation for the removal of SYNC_STEPPER_TO_EXTRUDER. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add support for reversing the direction of extruder stepper movementKevin O'Connor2022-02-101-1/+12
| | | | | | | Extend SET_EXTRUDER_ROTATION_DISTANCE to support reversing the direction of extruder movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add a SET_EXTRUDER_ROTATION_DISTANCE commandKevin O'Connor2022-02-101-9/+22
| | | | | | | | Support altering the extruder distance using the higher-level rotation_distance. This is in preparation for removal of the SET_EXTRUDER_STEP_DISTANCE command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Support disassociating a stepper from all extrudersKevin O'Connor2022-01-161-2/+5
| | | | | | | Support SYNC_STEPPER_TO_EXTRUDER commands with an EXTRUDER parameter set to an empty string. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Support SYNC_STEPPER_TO_EXTRUDER on extruder objectsKevin O'Connor2022-01-161-8/+23
| | | | | | | | | | Refactor the extruder_stepper support so that it uses the ExtruderStepper class defined in extruder.py. Support the SYNC_STEPPER_TO_EXTRUDER command on steppers defined in either extruder_stepper or extruder config sections. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Separate extruder stepper tracking to new ExtruderStepper classKevin O'Connor2022-01-161-75/+97
| | | | | | | Move the stepper handling (including pressure advance handling) to a new class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Don't store pressure_advance value in trapq movesKevin O'Connor2022-01-161-6/+7
| | | | | | | | | Store the pressure_advance value in "struct extruder_stepper" instead of in the trapq's "struct move". This makes it possible for multiple stepper motors to have different pressure advance values while still using the same trapq. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>