aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/heater.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-09-30 19:04:24 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-09-30 21:36:51 -0400
commit9faa0fbd25b948fc5fd7144a68ad03803d61784e (patch)
treea3e87c8a861420eb547eea4c185c8c084c322e8b /klippy/heater.py
parent3167e8ddbe338a58311fd94f044e8499ca9c9787 (diff)
downloadkutter-9faa0fbd25b948fc5fd7144a68ad03803d61784e.tar.gz
kutter-9faa0fbd25b948fc5fd7144a68ad03803d61784e.tar.xz
kutter-9faa0fbd25b948fc5fd7144a68ad03803d61784e.zip
extruder: Support a minimum extrude temperature
Allow the config file to specify the minimum temperature for the extruder and check for that temperature prior to moving the extruder motor. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/heater.py')
-rw-r--r--klippy/heater.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/klippy/heater.py b/klippy/heater.py
index c66b251e..3797b917 100644
--- a/klippy/heater.py
+++ b/klippy/heater.py
@@ -28,6 +28,8 @@ class PrinterHeater:
self.mcu_pwm = self.mcu_adc = None
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 = False
self.lock = threading.Lock()
self.last_temp = 0.
self.last_temp_time = 0.
@@ -49,6 +51,8 @@ class PrinterHeater:
control_algo = self.config.get('control', 'watermark')
algos = {'watermark': ControlBangBang, 'pid': ControlPID}
self.control = algos[control_algo](self, self.config)
+ if self.printer.mcu.output_file_mode:
+ self.can_extrude = True
def run(self):
self.mcu_adc.query_analog_in(REPORT_TIME)
def set_pwm(self, read_time, value):
@@ -87,12 +91,16 @@ 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.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