diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-08-29 17:37:14 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-08-29 18:00:17 -0400 |
commit | 002dc0dfaf42feae0e7955c035ef0bbd19cf0a19 (patch) | |
tree | 37a66798f739d415325232502d56609775309618 /klippy/cartesian.py | |
parent | 68d6788413ea8408d3c0290f4e6aa9974733a324 (diff) | |
download | kutter-002dc0dfaf42feae0e7955c035ef0bbd19cf0a19.tar.gz kutter-002dc0dfaf42feae0e7955c035ef0bbd19cf0a19.tar.xz kutter-002dc0dfaf42feae0e7955c035ef0bbd19cf0a19.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/cartesian.py')
-rw-r--r-- | klippy/cartesian.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/klippy/cartesian.py b/klippy/cartesian.py index d1747e6e..ee27f7b3 100644 --- a/klippy/cartesian.py +++ b/klippy/cartesian.py @@ -43,18 +43,19 @@ class CartKinematics: 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) # Set final homed position coord[axis] = s.position_endstop + s.get_homed_offset() homing_state.set_homed_position(coord) |