aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/delta.py
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* homing: Create QueryEndstops class from gcodeKevin O'Connor2016-11-181-5/+5
| | | | | | | | | | | Create the QueryEndstops in the gcode handler instead of in the kinematic classes. This simplifies the gcode handler as it can directly register its response callback. Also, store the stepper name in the stepper class. Also, propagate the print_time of the query request to the mcu_endstop class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Check if the motor needs to be enabled in the kinematic classesKevin O'Connor2016-11-141-11/+23
| | | | | | | Check for motor enable in the kinematic classes so it doesn't need to be checked on every move. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Initial support for linear delta kinematicsKevin O'Connor2016-11-141-0/+310
This adds support for delta based robots. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>