diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-09-12 12:24:44 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-09-19 17:25:38 -0400 |
commit | 5dfe4e1eb977dada5ae29fa03fc0f17964d7c2dc (patch) | |
tree | eff9638f0ab34b9951b0705d61dd9090179ec4c9 /klippy/fan.py | |
parent | b9586bad18971c41bcd0d8b8d8c84e366fa08e51 (diff) | |
download | kutter-5dfe4e1eb977dada5ae29fa03fc0f17964d7c2dc.tar.gz kutter-5dfe4e1eb977dada5ae29fa03fc0f17964d7c2dc.tar.xz kutter-5dfe4e1eb977dada5ae29fa03fc0f17964d7c2dc.zip |
toolhead: Synchronize print_time to main mcu's time
Instead of starting the print_time at zero, start it at the estimated
time of the main mcu's clock. This simplifies the code and it ensures
that print_time never goes backwards.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/fan.py')
-rw-r--r-- | klippy/fan.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/klippy/fan.py b/klippy/fan.py index cd5c14c1..8fa253bc 100644 --- a/klippy/fan.py +++ b/klippy/fan.py @@ -39,6 +39,7 @@ class PrinterFan: class PrinterHeaterFan: def __init__(self, printer, config): self.fan = PrinterFan(printer, config) + self.mcu = printer.objects['mcu'] heater = config.get("heater", "extruder0") self.heater = extruder.get_printer_heater(printer, heater) self.heater_temp = config.getfloat("heater_temp", 50.0) @@ -51,9 +52,8 @@ class PrinterHeaterFan: power = 0. if target_temp or current_temp > self.heater_temp: power = 1. - mcu_time = self.fan.mcu_fan.get_mcu().system_to_mcu_time( - eventtime + FAN_MIN_TIME) - self.fan.set_pwm(mcu_time, power) + print_time = self.mcu.estimated_print_time(eventtime) + FAN_MIN_TIME + self.fan.set_speed(print_time, power) return eventtime + 1. def add_printer_objects(printer, config): |