aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/delta.py
Commit message (Collapse)AuthorAgeFilesLines
* toolhead: Move kinematic modules to new kinematics/ directoryKevin O'Connor2018-07-121-200/+0
| | | | | | | | 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>
* delta: Minor comment updatesKevin O'Connor2018-07-091-1/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Don't peak into PrinterRail class from get_calibrate_params()Kevin O'Connor2018-06-221-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mathutil: Move trilateration code from delta.py to mathutil.pyKevin O'Connor2018-06-221-57/+7
| | | | | | | Move the trilateration algorithm to mathutil.py. It may be useful outside of delta kinematics, and it complicates the delta code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Remove the unnecessary StepList constantKevin O'Connor2018-06-221-5/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Support setting the stepper position via a cartesian coordinateKevin O'Connor2018-06-221-7/+2
| | | | | | | | | Add support for an itersolve_set_position() function that sets a stepper position from a cartesian coordinate. This eliminates the need for both the python and C code to be able to translate from a cartesian coordinate to a stepper position. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Rename get_position() to calc_position()Kevin O'Connor2018-06-221-1/+1
| | | | | | | | Calculating the cartesian position from the stepper positions can be complex and cpu intensive, so rename it to calc_position() to be more descriptive. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Replace PrinterHomingStepper with PrinterRailKevin O'Connor2018-06-221-32/+34
| | | | | | | | Update the code to use the term "rail" when dealing with a motor controlled "axis". A rail has a series of steppers and endstops that control that motor controlled "axis". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add a get_homing_info() method to PrinterHomingStepperKevin O'Connor2018-06-221-9/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Don't peak into PrinterStepper membersKevin O'Connor2018-06-221-4/+3
| | | | | | | Add additional wrapper functions so that no outside callers need to peak into the member variables of PrinterStepper. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Don't store step_dist in PrinterStepperKevin O'Connor2018-06-221-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: No need to pass printer reference to kinematic/stepper constructorsKevin O'Connor2018-06-221-4/+4
| | | | | | The config reference already stores a reference to the printer object. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Convert delta kinematics to use iterative solverKevin O'Connor2018-06-201-53/+17
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Raise an error if position_endstop is not in min/max rangeKevin O'Connor2018-05-181-5/+6
| | | | | | | | Raise an error during config parsing if the position_endstop is not between the position_min and position_max. This avoids a confusing error message during homing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing_override: Allow moves prior to homing an axisKevin O'Connor2018-01-281-3/+4
| | | | | | | Add support for disabling homing checks via the homing_override mechanism. This may be useful to move an axis prior to homing it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta_calibrate: Add initial support for a DELTA_CALIBRATE commandKevin O'Connor2018-01-281-30/+62
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Initial support for Z-Probe hardwareKevin O'Connor2018-01-281-1/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Allow the user to specify a minimum z positionKevin O'Connor2018-01-281-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Handle speed rounding when homing speed greater than max_velocityKevin O'Connor2017-12-201-1/+1
| | | | | | | | | | Commit 002dc0df added rounding to the homing speed, but it did not work if the configured homing speed was less than the printer's maximum velocity. Move the speed rounding from stepper.py to homing.py and make sure the rounded speed is less than the maximum speed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Default stepper_b/c position_endstop to stepper_a'sKevin O'Connor2017-12-081-2/+8
| | | | | | | If the position_endstop is not set for stepper_b or stepper_c then use the value from stepper_a. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Support different arm lengths for each towerKevin O'Connor2017-12-081-23/+25
| | | | | | | Change the config file so that the delta arm length is specified per-tower. This makes it possible to support advanced calibration. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Rework actuator_to_cartesian() using trilaterationKevin O'Connor2017-12-081-26/+23
| | | | | | | | | Use the formulas for trilateration (instead of the circumcenter formulas) when calculating the position of the nozzle from the position of the carriages. The trilateration formula is more general and it allows each tower to have a different arm length. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Directly interact with the kinematic class on query_endstops()Kevin O'Connor2017-12-061-2/+2
| | | | | | Move the query_endstop logic out of toolhead.py and into homing.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Pass list of endstops (not steppers) to the homing codeKevin O'Connor2017-12-061-4/+5
| | | | | | | The homing code wants the list of endstops to enable during a homing operation - it's confusing to pass the steppers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add get_endstops() / set_position wrappersKevin O'Connor2017-11-181-1/+1
| | | | | | | Add wrappers around mcu_endstop and mcu_stepper so that the kinematic classes do not need to directly access these low-level classes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Store pointers to step_const and step_delta in PrinterStepperKevin O'Connor2017-11-181-10/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Calculate the stepper name directly from the config sectionKevin O'Connor2017-11-181-1/+1
| | | | | | | There is no need to pass the name to the PrinterStepper class as it can determine the name itself. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cartesian: Fix min_stop_interval calculation errorKevin O'Connor2017-10-121-2/+2
| | | | | | | | It is possible to have an acceleration greater than max_z_accel on XY+Z moves. That needs to be taken into account when calculating the min_stop_interval. This prevents spurious "No next step" MCU errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Report the raw MCU position from the M114 commandKevin O'Connor2017-10-031-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Move query_endstop() code from kinematic classes to homing.pyKevin O'Connor2017-09-191-3/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Pass print_time directly to MCU callsKevin O'Connor2017-09-191-12/+12
| | | | | | | | | Now that the print_time is always synchronized with the mcu_time, there is no longer a need to track mcu_time as a separate quantity. Eliminate references to mcu_time from the code and pass print_time directly in its place. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Eliminate set_max_jerk() from kinematic classesKevin O'Connor2017-09-031-11/+9
| | | | | | | | Allow the kinematic classes to query the max velocity, max accel, and max halt velocity from the toolhead class instead of having the toolhead class call into the kinematic classes with those values. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Adjust homing_speed so that it's an even number of ticks per stepKevin O'Connor2017-08-291-3/+4
| | | | | | | | | | | Adjust the configured homing speed so that it always results in a speed that is an even number of mcu ticks per step. This ensures that the code can always get good step compression during homing, which is important as the entire homing operation must be able to fit within the mcu's move queue. This fixes some "move queue empty" mcu shutdown errors that could occur when the Z step distance was an unusual size. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Separate out homing code to its own PrinterHomingStepper classKevin O'Connor2017-07-241-1/+1
| | | | | | | Keep the homing code separate from the main stepper class. This makes it easier to verify the correct config parameters are provided. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Fix support for different endstop_position settings on each stepperKevin O'Connor2017-06-111-4/+6
| | | | | | | The endstop_position is intended to support different values for each stepper so that the individual tower heights can be configured. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Add support for specifying the angle each tower is atKevin O'Connor2017-06-051-6/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Support minimum/maximum value checks on configuration variablesKevin O'Connor2017-04-111-3/+4
| | | | | | | Verify that numeric parameters are in a sane range when reading the config. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Do reverse direction checking in C codeKevin O'Connor2017-04-071-64/+22
| | | | | | | | Calculate where a tower must reverse direction during a move in the C code instead of the delta.py kinematic code. This simplifies the python code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Make it clear that a "virtual tower" is createdKevin O'Connor2017-04-071-20/+28
| | | | | | | | | | | The delta code calculates a "virtual tower" along the line of movement. Rework the variable names and comments to make it clear that this is occurring. It is not necessary to pass the start_pos variable to the C code as it is simple to update the start_pos at the start of each movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Merge stepcompress_delta_const and stepcompress_delta_accelKevin O'Connor2017-04-071-8/+8
| | | | | | | | It's not necessary to have separate C delta kinematic functions for constant acceleration and constant velocity as constant velocity can be obtained by using a constant acceleration of zero. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Change mcu_stepper.set_position() to take a location in millimetersKevin O'Connor2017-04-071-6/+4
| | | | | | | | | | Update the set_position() method to convert from millimeters to absolute step position. Also, update PrinterStepper.get_homed_offset() and mcu_stepper.get_commanded_position() to return millimeters. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Don't export the commanded_position variable from mcu_stepperKevin O'Connor2017-04-071-1/+1
| | | | | | | | | | Now that the kinematic classes call the mcu_stepper with millimeters and seconds it is no longer necessary for them to directly access the stepper's position in absolute steps. Rename mcu_stepper.commanded_position to mcu_stepper._commanded_pos to make clear it is not a variable intended to be externally accessed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Pass delta velocity and acceleration directly to mcu_stepperKevin O'Connor2017-04-071-40/+22
| | | | | | | | Rework the parameters of step_delta_const() and step_delta_accel() so that they take velocity and acceleration directly in millimeters and seconds. This simplifies the delta.py kinematic code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Eliminate high-level build_config phaseKevin O'Connor2017-03-131-4/+1
| | | | | | | | | | Now that the mcu objects can be created prior to connecting to the mcu, it is no longer necessary to separate the init and build_config phases in the high-level code. Move the mcu objection creation from the build_config phase to the init phase and eliminate the build_config phase. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Simplify maximum stepper velocity and accel checksKevin O'Connor2017-02-211-15/+18
| | | | | | | | | Simplify the mechanism for limiting stepper speed (introduced in commit bdfdf7ef) - split the extreme end of the build envelope into two zones and use the same speeds for all moves that traverse any part of one of those zones. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Use position_endstop for position_maxKevin O'Connor2017-02-191-3/+3
| | | | | | | There's no reason for the user to specify position_max - it can be inferred on deltas from the endstop positions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Cap maximum stepper velocity and accelerationKevin O'Connor2017-02-131-3/+37
| | | | | | | | | Some XY moves at the extreme end of the build envelope could cause excessive axis stepper movement. Check for any moves that could possibly result in a stepper movement of more than 3 times the XY movement and cap the move's acceleration and speed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Rework boundary checksKevin O'Connor2017-02-131-10/+16
| | | | | | | | Calculate and store the maximum xy2 value for the given z level each time the head moves to a new z level. This simplifies the boundary check for common XY moves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Calculate sane defaults for extrude only velocity and accelKevin O'Connor2017-01-031-2/+1
| | | | | | | | Instead of requiring the user enter velocity and accel parameters for extrude only moves, calculate sane defaults from the printer's maximum velocity and accel. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Don't call into kinematic class on extrude only movesKevin O'Connor2016-12-281-2/+0
| | | | | | | | Add a is_kinematic_move flag to the Move class and clear it on extrude only moves. Don't call the kinematic check_move() or move() methods for extrude only moves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>