From 002dc0dfaf42feae0e7955c035ef0bbd19cf0a19 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 29 Aug 2017 17:37:14 -0400 Subject: stepper: Adjust homing_speed so that it's an even number of ticks per step Adjust the configured homing speed so that it always results in a speed that is an even number of mcu ticks per step. This ensures that the code can always get good step compression during homing, which is important as the entire homing operation must be able to fit within the mcu's move queue. This fixes some "move queue empty" mcu shutdown errors that could occur when the Z step distance was an unusual size. Signed-off-by: Kevin O'Connor --- klippy/corexy.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'klippy/corexy.py') diff --git a/klippy/corexy.py b/klippy/corexy.py index 1fdfa817..2069d16b 100644 --- a/klippy/corexy.py +++ b/klippy/corexy.py @@ -46,18 +46,19 @@ class CoreXYKinematics: rpos = s.position_endstop + s.homing_retract_dist r2pos = rpos + s.homing_retract_dist # Initial homing + homing_speed = s.get_homing_speed() homepos = [None, None, None, None] homepos[axis] = s.position_endstop coord = [None, None, None, None] coord[axis] = pos - homing_state.home(list(coord), homepos, [s], s.homing_speed) + homing_state.home(list(coord), homepos, [s], homing_speed) # Retract coord[axis] = rpos - homing_state.retract(list(coord), s.homing_speed) + homing_state.retract(list(coord), homing_speed) # Home again coord[axis] = r2pos homing_state.home( - list(coord), homepos, [s], s.homing_speed/2.0, second_home=True) + list(coord), homepos, [s], homing_speed/2.0, second_home=True) if axis == 2: # Support endstop phase detection on Z axis coord[axis] = s.position_endstop + s.get_homed_offset() -- cgit v1.2.3-70-g09d2