aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/stepper.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2024-10-20 22:11:25 -0400
committerKevin O'Connor <kevin@koconnor.net>2024-10-26 22:11:02 -0400
commit31fe50ffa387ed4a45950c1043a3b214a9d554dd (patch)
treee2bb642099945667e31af047bb04395fa83d1e0e /klippy/stepper.py
parentb381f509d11f022022536f41343fcc868484a396 (diff)
downloadkutter-31fe50ffa387ed4a45950c1043a3b214a9d554dd.tar.gz
kutter-31fe50ffa387ed4a45950c1043a3b214a9d554dd.tar.xz
kutter-31fe50ffa387ed4a45950c1043a3b214a9d554dd.zip
homing: Log a warning if probe alters stepper kinematic positions
After a probe attempt the toolhead position needs to be recalculated to the position that the toolhead ultimately halted at. Check that the position setting wouldn't actually change the internal view of the stepper motor and log a warning if any skew is detected. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/stepper.py')
-rw-r--r--klippy/stepper.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/klippy/stepper.py b/klippy/stepper.py
index 9b692904..05e56cca 100644
--- a/klippy/stepper.py
+++ b/klippy/stepper.py
@@ -138,8 +138,10 @@ class MCU_stepper:
def get_commanded_position(self):
ffi_main, ffi_lib = chelper.get_ffi()
return ffi_lib.itersolve_get_commanded_pos(self._stepper_kinematics)
- def get_mcu_position(self):
- mcu_pos_dist = self.get_commanded_position() + self._mcu_position_offset
+ def get_mcu_position(self, cmd_pos=None):
+ if cmd_pos is None:
+ cmd_pos = self.get_commanded_position()
+ mcu_pos_dist = cmd_pos + self._mcu_position_offset
mcu_pos = mcu_pos_dist / self._step_dist
if mcu_pos >= 0.:
return int(mcu_pos + 0.5)