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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user