stepper: Default to a high direction pin meaning positive direction

Invert the default meaning of the stepper direction pin.  Instead of
treating a low value as position motion, treat a high value as
positive motion.  This matches what other firmwares do, and it matches
what common stepper motor drivers document.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2016-11-08 10:39:32 -05:00
parent 5e6127869a
commit afecf7ce36
5 changed files with 14 additions and 14 deletions

View File

@@ -105,9 +105,9 @@ class CartKinematics:
self.stepper_pos[i] = new_step_pos
steps = move.axes_d[i] * inv_step_dist
step_offset = step_pos - move.start_pos[i] * inv_step_dist + 0.5
sdir = 0
sdir = 1
if steps < 0:
sdir = 1
sdir = 0
steps = -steps
step_offset = 1. - step_offset
mcu_time, so = self.steppers[i].prep_move(move_time, sdir)