aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/cartesian.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-11-08 10:39:32 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-11-08 10:39:32 -0500
commitafecf7ce36d4d712413d8c90ac055baa51cb26bd (patch)
treec4e19f68b397932ad608bb862ced3ba1412ecf97 /klippy/cartesian.py
parent5e6127869ab767dcc39642af09e08c79efc84888 (diff)
downloadkutter-afecf7ce36d4d712413d8c90ac055baa51cb26bd.tar.gz
kutter-afecf7ce36d4d712413d8c90ac055baa51cb26bd.tar.xz
kutter-afecf7ce36d4d712413d8c90ac055baa51cb26bd.zip
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>
Diffstat (limited to 'klippy/cartesian.py')
-rw-r--r--klippy/cartesian.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/cartesian.py b/klippy/cartesian.py
index 16db25d2..0a5f7961 100644
--- a/klippy/cartesian.py
+++ b/klippy/cartesian.py
@@ -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)