diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2024-10-20 22:11:25 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-10-26 22:11:02 -0400 |
commit | 31fe50ffa387ed4a45950c1043a3b214a9d554dd (patch) | |
tree | e2bb642099945667e31af047bb04395fa83d1e0e /klippy/stepper.py | |
parent | b381f509d11f022022536f41343fcc868484a396 (diff) | |
download | kutter-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.py | 6 |
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) |