aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/homing.py
Commit message (Collapse)AuthorAgeFilesLines
* homing: Handle speed rounding when homing speed greater than max_velocityKevin O'Connor2017-12-201-1/+11
| | | | | | | | | | 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>
* homing: Directly interact with the kinematic class on query_endstops()Kevin O'Connor2017-12-061-5/+7
| | | | | | Move the query_endstop logic out of toolhead.py and into homing.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Directly interact with the kinematic class when homingKevin O'Connor2017-12-061-2/+9
| | | | | | | Move the homing logic out of toolhead.py and into homing.py. This simplifies the toolhead logic and centralizes the homing code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Make sure to clean up homing state even if homing failsKevin O'Connor2017-12-061-27/+35
| | | | | | | | | | | Make sure to always call MCU_endstop.home_wait() if MCU_endstop.home_start() is invoked. Rename MCU_stepper.note_homing_triggered() to note_homing_end() and make sure it is always called if MCU_stepper.note_homing_start() is invoked. With these changes, MCU_endstop.home_finalize() is no longer needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Pass list of endstops (not steppers) to the homing codeKevin O'Connor2017-12-061-24/+23
| | | | | | | 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>
* homing: Base homing cpu delay on estimated number of steps neededKevin O'Connor2017-11-291-2/+8
| | | | | | | | | Instead of adding 250ms to each homing operation add a time relative to the number of estimated steps that are to be generated. This scales the delay to really large axes without adding a delay for normal users. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add get_endstops() / set_position wrappersKevin O'Connor2017-11-181-18/+24
| | | | | | | 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>
* endstop: Eliminate end_stop_set_oversample commandKevin O'Connor2017-10-121-1/+4
| | | | | | | | | | Pass the sample_ticks and sample_count parameters directly in the end_stop_home command instead. This simplifies the code. Also, simplify calculation of next wakeup time in end_stop_oversample_event(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Report the raw MCU position from the M114 commandKevin O'Connor2017-10-031-1/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Make sure reset_print_time() doesn't go backwards in timeKevin O'Connor2017-09-271-1/+1
| | | | | | | | Update the homing code to pass in the start of the homing operation to toolhead.reset_print_time(). This prevents an error when batch processing gcode files that contain multiple homing operations. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Move query_endstop() code from kinematic classes to homing.pyKevin O'Connor2017-09-191-7/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Pass print_time directly to MCU callsKevin O'Connor2017-09-191-1/+1
| | | | | | | | | 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>
* homing: Add a small delay before each homing operationKevin O'Connor2017-08-291-1/+5
| | | | | | | | | | | The homing operation can be cpu intensive for the host software. Add a small (250ms) delay before homing so that the host has additional time to process the command before it is due on the mcu. This is intended to work around some reports of "timer too close" errors during Z homing on RPi2 hosts and printers with high precision Z positioning. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Add get_mcu() call to the mcu oid objectsKevin O'Connor2017-08-291-1/+1
| | | | | | | | | Allow external code to obtain the mcu object that controls a pin setup with setup_pin(). Also, don't bother defining print_to_mcu_time() and system_to_mcu_time() on each pin object as they can be obtained via the new get_mcu() method. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Use newer "except XYZError as e" python syntaxKevin O'Connor2017-06-101-1/+1
| | | | | | Use the newer syntax for python exceptions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Rework homing to use greenletsKevin O'Connor2016-12-091-56/+19
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Rework endstop query to use greenletsKevin O'Connor2016-12-091-34/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: No need to define __str__ and __init__ methods on exception classesKevin O'Connor2016-11-291-6/+3
| | | | | | The base Exception class already defines these methods. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Check homing distance to verify endstop trigger after retractKevin O'Connor2016-11-281-26/+15
| | | | | | | | | 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>
* homing: Verify the endstops are no longer triggered after retract moveKevin O'Connor2016-11-181-6/+26
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Check for timeout during homing operationKevin O'Connor2016-11-181-12/+24
| | | | | | | | Should a homing move complete without hitting the endstop, then disable motors, disable the endstop checking, and report the error to the user. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Add EndstopMoveError wrapper around EndstopErrorKevin O'Connor2016-11-181-5/+7
| | | | | | | | 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-5/+8
| | | | | | | | 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-1/+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-7/+12
| | | | | | | | | | | 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>
* cartesian: Enforce endstop min and max boundariesKevin O'Connor2016-09-301-0/+8
| | | | | | | Verify that each move command is within range of the configured minimum and maximum for each axis. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Support querying the current status of endstopsKevin O'Connor2016-09-221-1/+29
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: convert stepper, endstop, and digital_out to take mcu_timeKevin O'Connor2016-08-241-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Move low-level coordinate manipulation to kinematic classKevin O'Connor2016-07-251-46/+29
| | | | | | | 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>
* cartesian: Rename CartKinematics class to ToolHeadKevin O'Connor2016-07-101-9/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Initial commit of source code.Kevin O'Connor2016-05-251-0/+82
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>