aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/delta.py
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* gcode: Rework homing to use greenletsKevin O'Connor2016-12-091-11/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Rework endstop query to use greenletsKevin O'Connor2016-12-091-2/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Make it clear which methods of DeltaKinematics are internalKevin O'Connor2016-12-081-8/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Rework delta math to avoid using inv_movexy_rKevin O'Connor2016-12-051-92/+41
| | | | | | | | | | | | | | | Taking the inverse of the XY move distance can lead to extremely large values when the XY distance is very small. This can lead to saturation of the double precision variables and incorrect results. Rework the delta kinematic math to avoid using this inverse. Pass the closestxy_d value directly to the C functions so that the C code can calculate its intermediate constants. After this change the move_z special case is no longer necessary as the regular delta functions now work with movexy_r=0 and movez_r=1. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Make sure homing distance is large enough to hit the endstopKevin O'Connor2016-12-051-1/+1
| | | | | | | | | The head may be far away from an axis at the start of a home, and that axis must then traverse more than just the distance from zero height to the endstop position. Add in additional distance to account for this. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Support limiting the maximum velocity of z movesKevin O'Connor2016-12-011-0/+3
| | | | | | | | | On a delta printer, z moves require the mcu to support the greatest number of steps per second. However, z moves are rare, so it makes sense to limit the velocity of z moves separately from the velocity of normal xy moves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Specify maximum acceleration and velocity in toolhead classKevin O'Connor2016-12-011-7/+4
| | | | | | | | | | Change the config file so the maximum accel and velocity are specified in the "printer" section instead of the individual "stepper" sections. The underlying code limits the velocity and accel of the toolhead relative to the print object, so it makes sense to configure the system that was as well. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Fix delta kinematics startupKevin O'Connor2016-11-301-1/+1
| | | | | | | | Commit 1e1364c3 moved the storage of the stepper position to the mcu_stepper class. The initializing of that position needs to be pushed back until after the mcu_stepper class is instantiated. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Check homing distance to verify endstop trigger after retractKevin O'Connor2016-11-281-2/+2
| | | | | | | | | Instead of checking the endstop trigger directly after a retract move, verify some distance is traveled during the following homing operation. This reduces the amount of synchronization between mcu and host during homing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Store the stepper position in the mcu_stepper classKevin O'Connor2016-11-191-22/+12
| | | | | | | Move the storage of the stepper location from the kinematic classes to the low-level mcu_stepper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Verify the endstops are no longer triggered after retract moveKevin O'Connor2016-11-181-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Add EndstopMoveError wrapper around EndstopErrorKevin O'Connor2016-11-181-3/+3
| | | | | | | | Allow an EndstopError to be raised without a destination position. Introduce EndstopMoveError wrapper so that current callers can continue to pass in a move destination. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Direct stepper phase detection from kinematic classesKevin O'Connor2016-11-181-1/+2
| | | | | | | | Change the scheduling of the final homed position (which takes into account the stepper phases) so that it is scheduled from the kinematic classes instead of from the toolhead class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Create Homing class from gcodeKevin O'Connor2016-11-181-3/+2
| | | | | | | | Create the Homing class in the gcode handler instead of in the kinematic classes. This will make it easier to pass error messages back to the user. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>