aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/stepper.py
Commit message (Collapse)AuthorAgeFilesLines
* force_move: Rename stepper_buzz.py to force_move.pyKevin O'Connor2018-07-261-2/+2
| | | | | | This is in preparation for extending the ability to make manual moves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Minor whitespace changesKevin O'Connor2018-07-261-17/+19
| | | | | | Wrap lines at 80 columns. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Explicitly pass can_invert and can_pullup to lookup_pin()Kevin O'Connor2018-07-261-3/+5
| | | | | | | | | | | | Don't pass pin_type to lookup_pin() - instead, if a pin can be inverted or can have a pullup, then the caller must explicitly specify that when calling lookup_pin(). This simplifies the code for the cases where it is not valid to invert or pullup. Explicitly pass the pin_type to setup_pin() and have ppins.setup_pin() apply default pullup and invert flags. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Support calculating a stepper position from a cartesian coordinateKevin O'Connor2018-07-181-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* query_endstops: Move QUERY_ENDSTOP command to it own extras/ moduleKevin O'Connor2018-07-161-3/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Enhance itersolve stepper kinematics allocationKevin O'Connor2018-07-131-6/+4
| | | | | | | Allocate the stepper_kinematics directly in mcu.py - that way the kinematic classes don't have to interact with the chelper code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* itersolve: Support setting the stepper position via a cartesian coordinateKevin O'Connor2018-06-221-2/+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>
* stepper: Replace PrinterHomingStepper with PrinterRailKevin O'Connor2018-06-221-75/+83
| | | | | | | | 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-1/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add a get_range() method to PrinterHomingStepperKevin O'Connor2018-06-221-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Don't peak into PrinterStepper membersKevin O'Connor2018-06-221-4/+8
| | | | | | | 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: Add a is_stepper_enabled() method to PrinterStepperKevin O'Connor2018-06-221-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Don't store step_dist in PrinterStepperKevin O'Connor2018-06-221-11/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add a get_name() method to PrinterStepperKevin O'Connor2018-06-221-9/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: No need to pass printer reference to kinematic/stepper constructorsKevin O'Connor2018-06-221-12/+12
| | | | | | The config reference already stores a reference to the printer object. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kin_cartesian: Remove stepcompress_push_const()Kevin O'Connor2018-06-201-8/+0
| | | | | | | All the kinematic code now uses the iterative solver to generate steps. Remove the old stepcompress_push_const() mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* corexy: Convert corexy to use the iterative solverKevin O'Connor2018-06-201-1/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Convert delta kinematics to use iterative solverKevin O'Connor2018-06-201-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper_buzz: Move STEPPER_BUZZ command from stepper.py to new fileKevin O'Connor2018-06-201-28/+2
| | | | | | | Add a klippy/extras/stepper_buzz.py file to handle the STEPPER_BUZZ command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add STEPPER_BUZZ commandKevin O'Connor2018-05-241-0/+30
| | | | | | Add a new command that can help diagnose stepper motor connectivity. 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-6/+16
| | | | | | | | 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>
* stepper: Fix typo in error report - name should be self.nameKevin O'Connor2018-05-141-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Remove module level get_printer_pins() and setup_pin() functionsKevin O'Connor2018-04-041-12/+11
| | | | | | | | Most callers did a lookup of the pins module via printer.lookup_object("pins"). Use that as the standard method and remove these less frequently used methods. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: allow to disable homing retractcruwaller2018-03-061-1/+1
| | | | | | Homing retract can be disabled by setting homing_retract_dist to 0. Signed-off-by: Petri Honkala <cruwaller@gmail.com>
* docs: Add tips for porting to new kinematics to Code_Overview.mdKevin O'Connor2018-02-171-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Add access methods and avoid peeking into the printer classesKevin O'Connor2018-01-281-5/+5
| | | | | | | | | Add get_reactor(), lookup_object(), lookup_module_objects(), and set_rollover_info() to the main Printer class so that callers do not need to peek into the class' members. Similarly, add get_printer() and get_name() methods to the ConfigWrapper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Automatically detect and handle shared stepper enable linesKevin O'Connor2018-01-101-10/+31
| | | | | | | | | | | It's common for multiple steppers to use the same stepper enable line. Detect this and only create a single digital_out oid on the micro-controller. Also, prohibit any other pin from being used multiple times in the config file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Rename parse_pin_desc() to lookup_pin()Kevin O'Connor2018-01-101-2/+2
| | | | | | | Always set the pin_params['type'] field on a pin lookup. Rename parse_pin_desc() to lookup_pin() to make the change more clear. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Handle speed rounding when homing speed greater than max_velocityKevin O'Connor2017-12-201-7/+0
| | | | | | | | | | 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/+6
| | | | | | | 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>
* stepper: Only align the stepper motor to a full step when requestedKevin O'Connor2017-12-071-1/+2
| | | | | | | | | Add a new config option 'homing_endstop_align_zero' to enable the alignment of the endstop to a stepper full step. It's possible one may wish to specify a homing_endstop_phase while not aligning the endstop. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Remove unneeded MCU_digital_out.get_last_setting() methodKevin O'Connor2017-12-061-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Reset the stepper step clock on init - not after each motor onKevin O'Connor2017-12-061-2/+0
| | | | | | | Reset the last step clock during the init phase and after each home - this simplifies the runtime code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Pass list of endstops (not steppers) to the homing codeKevin O'Connor2017-12-061-3/+2
| | | | | | | 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: get_homed_offset() should return a floatKevin O'Connor2017-12-031-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support for multiple steppers controlling a single axisKevin O'Connor2017-11-181-0/+46
| | | | | | | Allow multiple steppers to be defined for a single cartesian axis. This adds support for dual-z setups. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add get_endstops() / set_position wrappersKevin O'Connor2017-11-181-0/+4
| | | | | | | 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-4/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Remove unused variables from PrinterStepper classKevin O'Connor2017-11-181-4/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Additional code commentsKevin O'Connor2017-11-181-5/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Calculate the stepper name directly from the config sectionKevin O'Connor2017-11-181-4/+6
| | | | | | | 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>
* endstop: Eliminate end_stop_set_oversample commandKevin O'Connor2017-10-121-5/+0
| | | | | | | | | | 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>
* stepper: If homing_endstop_phase is configured, make 0.0 be at a full stepKevin O'Connor2017-10-031-0/+14
| | | | | | | | | If the stepper phases are known then it is possible to arrange for the 0.0 position to occur at a full step. On cartesian style printer, this makes it possible for the Z levels to occur at full steps (which may help reduce "Z ribbing"). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* endstop: Support oversampling of the endstopKevin O'Connor2017-10-011-0/+5
| | | | | | | | Some printers can show occasional noise on the endstop pin. Support sampling the endstop pin multiple times to attempt to filter out this noise. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Avoid using '%' syntax when calling logging moduleKevin O'Connor2017-09-271-2/+2
| | | | | | | The logging module can build strings directly from printf syntax - no need to build the string first. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Move print_time to clock conversion code to clocksync.pyKevin O'Connor2017-09-191-1/+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-6/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Pass print_time directly to MCU callsKevin O'Connor2017-09-191-10/+6
| | | | | | | | | 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>
* mcu: Use is_fileoutput() externallyKevin O'Connor2017-09-191-1/+1
| | | | | | | Use mcu.is_fileoutput() instead of looking up the "debugoutput" flag in the start args. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Fix bug causing 'enable_pin' to be requiredKevin O'Connor2017-09-191-0/+1
| | | | | | | Make sure to initialize mcu_enable to None so that it is initialized if no 'enable_pin' config value is provided. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>