aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/toolhead.py
Commit message (Collapse)AuthorAgeFilesLines
...
* toolhead: Don't call into kinematic class on extrude only movesKevin O'Connor2016-12-281-4/+6
| | | | | | | | 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 toolhead stalling to use greenletsKevin O'Connor2016-12-091-8/+21
| | | | 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>
* toolhead: Specify maximum acceleration and velocity in toolhead classKevin O'Connor2016-12-011-1/+3
| | | | | | | | | | 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>
* gcode: Support parsing of "extended" gcode commandsKevin O'Connor2016-11-301-1/+1
| | | | | | | | | | Support human readable commands (eg, "help"). Add a "help" command to list these extended commands. Also, add support for declaring command aliases, command help, and command availability next to the handlers themselves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Add ConfigWrapper.getchoice methodKevin O'Connor2016-11-301-2/+1
| | | | | | | | Add helper function that ensures a config option is one of several choices. This helps ensure that a proper error is raised if an invalid choice is made. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Direct stepper phase detection from kinematic classesKevin O'Connor2016-11-181-7/+0
| | | | | | | | 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-6/+5
| | | | | | | | 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-3/+2
| | | | | | | | | | | 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>
* delta: Initial support for linear delta kinematicsKevin O'Connor2016-11-141-2/+5
| | | | | | This adds support for delta based robots. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Support calculation of cornering minimum and maximumKevin O'Connor2016-11-051-21/+25
| | | | | | | | | | | | | | Calculate the next "cornering" minimum and maximum for each move. The "cornering minimum" is the lowest speed the head will reach immediately after this move (with no interleaving acceleration or cruising). The "cornering maximum" is the maximum speed the head will reach after the cornering minimum (with no interleaving deceleration or cruising). These cornering calculations will be helpful in the extruder "pressure advance" code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Simplify calculation of junction_cruiseKevin O'Connor2016-11-051-6/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Calculate maximum junction start when adding movesKevin O'Connor2016-11-051-12/+9
| | | | | | | Take into account the maximum possible start speed of a move when calculating junction_start_max. This simplifies the lookahead logic. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Store both the start and end position in the Move classKevin O'Connor2016-10-251-10/+12
| | | | | | | | Store the start position (in addition to the existing end position) in the Move class. The start position can be useful to the kinematic classes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Allow kinematics class to verify the move prior to queuing itKevin O'Connor2016-09-301-31/+28
| | | | | | | | | | | | Introduce a check_move() method in the extruder and cartesian kinematic classes. This allows the lower level classes to verify the contents of the move prior to queing that move. The speed and acceleration handling for special Z and extrude only moves are also moved from the generic toolhead class to the low-level classes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Support querying the current status of endstopsKevin O'Connor2016-09-221-0/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Force a firmware shutdown on an unhandled exceptionKevin O'Connor2016-09-221-19/+29
| | | | | | | Check for unhandled exceptions and force the MCU to shutdown in that case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support stepper phase adjustments when homingKevin O'Connor2016-07-281-1/+9
| | | | | | | Add support for enhancing the precision of endstop switches by also inspecting the phase of the stepper motor when the endstop triggers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Move low-level coordinate manipulation to kinematic classKevin O'Connor2016-07-251-2/+2
| | | | | | | Rework the code so that the kinematic class (currently just cartesian.py) has more control over the homing process. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Limit lookahead optimization to moves with similar extrude ratiosKevin O'Connor2016-07-221-3/+12
| | | | | | | | Only skip acceleration between moves if both moves perform a similar amount of extrusion. This ensures the extruder has sufficient time to accelerate to and from each extrude move. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Add some comments to acceleration codeKevin O'Connor2016-07-161-6/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Create a new class and python file to track the printer extruderKevin O'Connor2016-07-101-1/+5
| | | | | | | | | Create a new python file (extruder.py) to control the extruder heater and stepper motors. This separates the extruder control logic from the cartesian robot code - making it easier to customize both the kinematic control of the robot as well as the extruder. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Avoid using a dummy_move for an empty move_queueKevin O'Connor2016-07-101-11/+3
| | | | | | | | | Explicitly check for when the move_queue is empty and only call move.calc_junction() when there is a previous move. This avoids the need to create a dummy "sentinal" move object and it simplifies the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Merge lookahead.py into toolhead.pyKevin O'Connor2016-07-101-3/+53
| | | | | | | | Remove the lookahead.py file and move its code directly into toolhead.py. The MoveQueue() class is small and tightly coupled to the toolhead code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Split toolhead code from cartesian.py to new file toolhead.pyKevin O'Connor2016-07-101-0/+200
Separate out the toolhead logic to its own python file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>