homing: Handle speed rounding when homing speed greater than max_velocity

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>
This commit is contained in:
Kevin O'Connor 2017-12-20 14:11:38 -05:00
parent 1b07505973
commit 1d21bf66c6
5 changed files with 18 additions and 11 deletions

View file

@ -122,13 +122,6 @@ class PrinterHomingStepper(PrinterStepper):
self.homing_endstop_accuracy = self.homing_stepper_phases
def get_endstops(self):
return [(self.mcu_endstop, self.name)]
def get_homing_speed(self):
# Round the configured homing speed so that it is an even
# number of ticks per step.
adjusted_freq = self.mcu_stepper.get_mcu().get_adjusted_freq()
dist_ticks = adjusted_freq * self.step_dist
ticks_per_step = round(dist_ticks / self.homing_speed)
return dist_ticks / ticks_per_step
def get_homed_offset(self):
if not self.homing_stepper_phases or self.need_motor_enable:
return 0.