aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-12-07 17:35:19 -0500
committerKevin O'Connor <kevin@koconnor.net>2017-12-07 17:35:19 -0500
commit3ffab763c0aa4b8d43ba447ced3e2c265c86606d (patch)
treed281cb2978ddd5cadfbe1f2af5387dd0fdb0e588
parentef09ac5a7fdc1de4529aefca21498fcf0d144c9d (diff)
downloadkutter-3ffab763c0aa4b8d43ba447ced3e2c265c86606d.tar.gz
kutter-3ffab763c0aa4b8d43ba447ced3e2c265c86606d.tar.xz
kutter-3ffab763c0aa4b8d43ba447ced3e2c265c86606d.zip
stepper: Only align the stepper motor to a full step when requested
Add a new config option 'homing_endstop_align_zero' to enable the alignment of the endstop to a stepper full step. It's possible one may wish to specify a homing_endstop_phase while not aligning the endstop. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--config/example.cfg6
-rw-r--r--klippy/stepper.py3
2 files changed, 8 insertions, 1 deletions
diff --git a/config/example.cfg b/config/example.cfg
index 96bddafb..74ec1224 100644
--- a/config/example.cfg
+++ b/config/example.cfg
@@ -77,6 +77,12 @@ position_max: 200
# reset. If this is not set, but homing_stepper_phases is set, then
# the stepper phase will be detected on the first home and that
# phase will be used on all subsequent homes.
+#homing_endstop_align_zero: False
+# If homing_endstop_phase is set and this field is true then the
+# code will arrange for the zero position on the axis to occur at a
+# full step on the stepper motor. (If used on the Z axis and the
+# print layer height is a multiple of a full step distance then
+# every layer will occur on a full step.) The default is False.
# The stepper_y section is used to describe the stepper controlling
# the Y axis in a cartesian robot. It has the same settings as the
diff --git a/klippy/stepper.py b/klippy/stepper.py
index 28fdb226..07798a1d 100644
--- a/klippy/stepper.py
+++ b/klippy/stepper.py
@@ -87,7 +87,8 @@ class PrinterHomingStepper(PrinterStepper):
self.homing_endstop_phase = config.getint(
'homing_endstop_phase', None, minval=0
, maxval=self.homing_stepper_phases-1)
- if self.homing_endstop_phase is not None:
+ if (self.homing_endstop_phase is not None
+ and config.getboolean('homing_endstop_align_zero', False)):
# Adjust the endstop position so 0.0 is always at a full step
micro_steps = self.homing_stepper_phases // 4
phase_offset = (