aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/kinematics/cartesian.py
Commit message (Collapse)AuthorAgeFilesLines
* idex_modes: Bugfix for kinematic position calculation.Frans-willem Hardijzer2024-05-161-5/+12
| | | | | | | | | | | | | | | 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>
* 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: COPY and MIRROR mode implementation (#6297)Dmitry Butyugin2023-08-011-50/+33
| | | | | | | | | | | 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>
* kinematics: Convert to Python3 string encodingKevin O'Connor2021-10-011-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Remove set_tag_position() codeKevin O'Connor2021-05-291-2/+2
| | | | | | Have callers store the stepper positions in a dict. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Do not set min_stop_interval in micro-controllerKevin O'Connor2021-04-301-7/+0
| | | | | | | | The min_stop_interval safety check is fragile and leads to a notable amount of complexity. Avoid these issues by not programming this safety check. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kinematics: Calculate axis_minimum/axis_maximum in advanceKevin O'Connor2021-01-081-14/+13
| | | | | | | | Calculate the get_status() axis_minimum and axis_maximum fields in advance so that they don't need to be calculated on each get_status() call. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kinematics: report all axis limits (min/max)Janar Sööt2020-12-281-2/+10
| | | | Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* homing: Remove EndstopErrorKevin O'Connor2020-09-041-1/+1
| | | | | | | There's no reason to distinguish between an EndstopError and a CommandError, so just use CommandError. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Add a move.move_error() helperKevin O'Connor2020-09-031-3/+2
| | | | | | | Move the EndstopMoveError() code from homing.py to a new method in the toolhead Move class. 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>
* cartesian: Use new GCodeCommand wrappersKevin O'Connor2020-05-051-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* safe_z_home: Support note_z_not_homed() in kinematics (#2500)David Smith2020-03-011-0/+3
| | | Signed-off-by: David Smith <davidosmith@gmail.com>
* kinematics: Remove support for identifying Z steppersKevin O'Connor2020-01-231-3/+1
| | | | | | | | | The caller can now determine which steppers are connected to cartesian Z movement via the new stepper.is_active_axis() method. It is therefore no longer necessary for the kinematic code to identify these steppers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Report which axes are homed via get_status()Kevin O'Connor2019-11-241-4/+3
| | | | 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/+1
| | | | | | | 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>
* cartesian: Report dual_carriage_rails from get_steppers()Kevin O'Connor2019-11-151-3/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add get/set_tag_position() and convert calc_position()Kevin O'Connor2019-11-131-4/+5
| | | | | | | | | Rename calc_position() to calc_tag_position() and have it calculate the value of the position from the last stepper set_tag_position() call. This enables the calc_tag_position() code to be more flexible as it can be run with arbitrary positions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper_enable: Move motor_off() logic to stepper_enable.pyKevin O'Connor2019-11-121-6/+3
| | | | | | | | Directly disable all the stepper motors on a global motor_off() from the StepperEnable() class in stepper_enable.py. This simplifies the toolhead and kinematic classes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Rename register_move_handler() to register_step_generator()Kevin O'Connor2019-11-071-2/+2
| | | | | | | Rename the function so it is more clear what the step generation code path is. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Remove kinematic move() callKevin O'Connor2019-11-061-2/+0
| | | | | | | Now that all kinematics use the trapq system, there is no need to call into the kinematics on each g-code move. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cartesian: Convert step generation to use trapq systemKevin O'Connor2019-11-061-16/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kinematics: Add get_status() method to kinematicsFlorian Heilmann2019-08-091-0/+4
| | | | Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* homing: Remove no longer needed homing time delay codeKevin O'Connor2019-07-101-4/+1
| | | | | | | | Now that homing is implemented via "drip moves", it is no longer necessary to round the homing speed and it is no longer necessary to add a delay for cpu processing time. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Move homing offset adjustment logic to generic homing codeKevin O'Connor2018-10-101-3/+0
| | | | | | | Move the "stepper phase" adjustment logic from the kinematic classes to the generic homing.py code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Implement second home from homing.pyKevin O'Connor2018-10-101-26/+12
| | | | | | | Move the logic for performing the second home from the kinematics classes to the generic homing code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cartesian: Use homing_speed for homing retract speedKevin O'Connor2018-10-091-1/+1
| | | | | | | | Commit b0d859f2 introduced a second_homing_speed parameter, and it also changed the retract speed. Revert the retract speed change (use homing_speed when the head retracts). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cartesian: Make sure to constrain second_homing_speed to max_z_velocityKevin O'Connor2018-10-081-0/+1
| | | | | | | Commit b0d859f2 introduced a second_homing_speed parameter; that parameter needs to also be constrained to the max_z_velocity. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Adding support for a second_homing_speed parameter (#677)Chris Whiteford2018-10-041-2/+3
| | | Signed-off-by: Chris Whiteford <chris@chrisandtennille.com>
* kinematics: Convert get_rails() method to get_steppers()Kevin O'Connor2018-07-161-3/+3
| | | | | | | All callers of get_rails() actually just want the steppers, so return them directly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Enhance itersolve stepper kinematics allocationKevin O'Connor2018-07-131-6/+6
| | | | | | | Allocate the stepper_kinematics directly in mcu.py - that way the kinematic classes don't have to interact with the chelper code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Fill cmove in toolhead instead of in each kinematic classKevin O'Connor2018-07-131-9/+1
| | | | | | This simplifies the kinematic classes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Move kinematic modules to new kinematics/ directoryKevin O'Connor2018-07-121-0/+173
Move extruder.py, cartesian.py, corexy.py, and delta.py to a new kinematics/ sub-directory. This is intended to make adding new kinematics a little easier. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>