diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-10-08 20:50:45 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-10-10 14:30:09 -0400 |
commit | 770b92863f391df5af45909070bc2e87609c5d45 (patch) | |
tree | 65ebb0956e80dd3687366d75c9c8c07d4948cdc1 /klippy/stepper.py | |
parent | 459e5219910cb57888768f0096355d9be1389024 (diff) | |
download | kutter-770b92863f391df5af45909070bc2e87609c5d45.tar.gz kutter-770b92863f391df5af45909070bc2e87609c5d45.tar.xz kutter-770b92863f391df5af45909070bc2e87609c5d45.zip |
mcu: Add a set_commanded_position() method to MCU_stepper
Add the ability to directly set the "commanded" stepper position.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/stepper.py')
-rw-r--r-- | klippy/stepper.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/klippy/stepper.py b/klippy/stepper.py index ce262006..dcbc9484 100644 --- a/klippy/stepper.py +++ b/klippy/stepper.py @@ -69,8 +69,9 @@ class PrinterStepper: self.set_ignore_move = mcu_stepper.set_ignore_move self.calc_position_from_coord = mcu_stepper.calc_position_from_coord self.set_position = mcu_stepper.set_position - self.get_mcu_position = mcu_stepper.get_mcu_position self.get_commanded_position = mcu_stepper.get_commanded_position + self.set_commanded_position = mcu_stepper.set_commanded_position + self.get_mcu_position = mcu_stepper.get_mcu_position self.get_step_dist = mcu_stepper.get_step_dist def get_name(self, short=False): if short and self.name.startswith('stepper_'): @@ -259,9 +260,12 @@ class PrinterRail: def set_max_jerk(self, max_halt_velocity, max_accel): for stepper in self.steppers: stepper.set_max_jerk(max_halt_velocity, max_accel) - def set_position(self, newpos): + def set_commanded_position(self, pos): + for stepper in self.steppers: + stepper.set_commanded_position(pos) + def set_position(self, coord): for stepper in self.steppers: - stepper.set_position(newpos) + stepper.set_position(coord) def motor_enable(self, print_time, enable=0): for stepper in self.steppers: stepper.motor_enable(print_time, enable) |