From 3b5b895a10a186ef126c6fbcb50835827b6a6471 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 8 Nov 2016 09:22:43 -0500 Subject: [PATCH] heater: Do not require target temperature be above min_extrude_temp Only disable the extruder if the last measured temperature is below the minimum extrude temperature setting. Verifying the target temperature is not necessary, and it can incorrectly prevent some valid moves. It's not uncommon for scripts to retract filament immiedietly after setting the extruder temperature to zero. Signed-off-by: Kevin O'Connor --- klippy/heater.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/klippy/heater.py b/klippy/heater.py index bef1f48c..06bc0cd1 100644 --- a/klippy/heater.py +++ b/klippy/heater.py @@ -29,7 +29,7 @@ class PrinterHeater: self.thermistor_c = Thermistors.get(config.get('thermistor_type')) self.pullup_r = config.getfloat('pullup_resistor', 4700.) self.min_extrude_temp = config.getfloat('min_extrude_temp', 170.) - self.can_extrude = self.min_extrude_temp <= 0. + self.can_extrude = (self.min_extrude_temp <= 0.) self.lock = threading.Lock() self.last_temp = 0. self.last_temp_time = 0. @@ -91,16 +91,13 @@ class PrinterHeater: with self.lock: self.last_temp = temp self.last_temp_time = read_time - self.can_extrude = (self.last_temp >= self.min_extrude_temp - and self.target_temp >= self.min_extrude_temp) + self.can_extrude = (temp >= self.min_extrude_temp) self.control.adc_callback(read_time, temp) #logging.debug("temp: %.3f %f = %f" % (read_time, read_value, temp)) # External commands def set_temp(self, print_time, degrees): with self.lock: self.target_temp = degrees - if self.target_temp < self.min_extrude_temp: - self.can_extrude = False def get_temp(self): with self.lock: return self.last_temp, self.target_temp