From d9cd524aec5c9d88de35e0c4b33de2fbd10a12a8 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 17 Dec 2019 02:01:54 -0500 Subject: [PATCH] extruder: No need to track extrude_pos locally Signed-off-by: Kevin O'Connor --- klippy/kinematics/extruder.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/klippy/kinematics/extruder.py b/klippy/kinematics/extruder.py index e3c0b699..692255d6 100644 --- a/klippy/kinematics/extruder.py +++ b/klippy/kinematics/extruder.py @@ -45,7 +45,6 @@ class PrinterExtruder: pressure_advance = config.getfloat('pressure_advance', 0., minval=0.) smooth_time = config.getfloat('pressure_advance_smooth_time', 0.040, above=0., maxval=.200) - self.extrude_pos = 0. # Setup iterative solver ffi_main, ffi_lib = chelper.get_ffi() self.trapq = ffi_main.gc(ffi_lib.trapq_alloc(), ffi_lib.trapq_free) @@ -61,7 +60,7 @@ class PrinterExtruder: # Register commands gcode = self.printer.lookup_object('gcode') if self.name == 'extruder': - toolhead.set_extruder(self, self.extrude_pos) + toolhead.set_extruder(self, 0.) gcode.register_command("M104", self.cmd_M104) gcode.register_command("M109", self.cmd_M109) gcode.register_mux_command("SET_PRESSURE_ADVANCE", "EXTRUDER", None, @@ -144,7 +143,6 @@ class PrinterExtruder: move.start_pos[3], 0., 0., 1., pressure_advance, 0., start_v, cruise_v, accel) - self.extrude_pos = move.end_pos[3] def cmd_M104(self, params, wait=False): # Set Extruder Temperature toolhead = self.printer.lookup_object('toolhead') @@ -196,7 +194,7 @@ class PrinterExtruder: return gcode.respond_info("Activating extruder %s" % (self.name)) toolhead.flush_step_generation() - toolhead.set_extruder(self, self.extrude_pos) + toolhead.set_extruder(self, self.stepper.get_commanded_position()) self.printer.send_event("extruder:activate_extruder") # Dummy extruder class used when a printer has no extruder at all