diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2025-07-19 11:24:59 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2025-07-19 11:24:59 -0400 |
commit | 46912431794c02e468d4bcb2ccd3b41ab6911ba7 (patch) | |
tree | e830b95e56a98ca0bde2f5a0128ad951e815f9d2 | |
parent | 4e4a5c633652978c2ea6e1cabac2a2f5568e5366 (diff) | |
download | kutter-46912431794c02e468d4bcb2ccd3b41ab6911ba7.tar.gz kutter-46912431794c02e468d4bcb2ccd3b41ab6911ba7.tar.xz kutter-46912431794c02e468d4bcb2ccd3b41ab6911ba7.zip |
heaters: Increase time before clearing the temperature of an inactive heater
The get_temp() code will stop reporting the last temperature of the
heater if there hasn't been any recent temperature updates. However,
on a full mcu communication loss this can cause the verify_heater code
to report a heating error prior to the mcu code reporting the
communication failure. Increase the heater timeout from 5 to 7
seconds to make it more likely the mcu failure is reported first.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | klippy/extras/heaters.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/klippy/extras/heaters.py b/klippy/extras/heaters.py index 5cbc27e4..fce3c49a 100644 --- a/klippy/extras/heaters.py +++ b/klippy/extras/heaters.py @@ -15,6 +15,7 @@ MAX_HEAT_TIME = 3.0 AMBIENT_TEMP = 25. PID_PARAM_BASE = 255. MAX_MAINTHREAD_TIME = 5.0 +QUELL_STALE_TIME = 7.0 class Heater: def __init__(self, config, sensor): @@ -110,9 +111,10 @@ class Heater: with self.lock: self.target_temp = degrees def get_temp(self, eventtime): - print_time = self.mcu_pwm.get_mcu().estimated_print_time(eventtime) - 5. + est_print_time = self.mcu_pwm.get_mcu().estimated_print_time(eventtime) + quell_time = est_print_time - QUELL_STALE_TIME with self.lock: - if self.last_temp_time < print_time: + if self.last_temp_time < quell_time: return 0., self.target_temp return self.smoothed_temp, self.target_temp def check_busy(self, eventtime): |