From c5a9d7914ba0437069306217a6f653975427ba7b Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 26 Feb 2021 20:11:39 -0500 Subject: [PATCH] extruder: Make sure to flush steps during sync_stepper() The stepper positions will only be in sync after the step generation code has been flushed. This fixes an "internal error in stepcompress" error during a SYNC_STEPPER_TO_EXTRUDER command. Signed-off-by: Kevin O'Connor --- klippy/kinematics/extruder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/klippy/kinematics/extruder.py b/klippy/kinematics/extruder.py index a931c896..591a0531 100644 --- a/klippy/kinematics/extruder.py +++ b/klippy/kinematics/extruder.py @@ -99,6 +99,8 @@ class PrinterExtruder: def get_heater(self): return self.heater def sync_stepper(self, stepper): + toolhead = self.printer.lookup_object('toolhead') + toolhead.flush_step_generation() epos = self.stepper.get_commanded_position() stepper.set_position([epos, 0., 0.]) stepper.set_trapq(self.trapq)