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>
This commit is contained in:
Kevin O'Connor 2024-10-20 22:11:25 -04:00
parent b381f509d1
commit 31fe50ffa3
2 changed files with 16 additions and 4 deletions

View file

@ -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)