aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-02-28 13:40:57 -0500
committerKevinOConnor <kevin@koconnor.net>2019-03-08 10:55:46 -0500
commit893bb32d01aa0db85be2da72b087eeb0c3ca011d (patch)
treec814a7cf3657d08c76e8e03fc36f5e3fd479ddd2
parent8e8063a9d93eccb5ca16d807962d8c288832f916 (diff)
downloadkutter-893bb32d01aa0db85be2da72b087eeb0c3ca011d.tar.gz
kutter-893bb32d01aa0db85be2da72b087eeb0c3ca011d.tar.xz
kutter-893bb32d01aa0db85be2da72b087eeb0c3ca011d.zip
verify_heater: Only reset the error count if within the hysteresis range
Don't reset the error counter if the reported temperature is significantly above the target temperature. This may help catch cases where the temperature sensor reports random values. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/extras/verify_heater.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/klippy/extras/verify_heater.py b/klippy/extras/verify_heater.py
index 507ee33b..c449e3cb 100644
--- a/klippy/extras/verify_heater.py
+++ b/klippy/extras/verify_heater.py
@@ -52,7 +52,8 @@ class HeaterCheck:
logging.info("Heater %s within range of %.3f",
self.heater_name, target)
self.met_target = True
- self.error = 0.
+ if temp <= target + self.hysteresis:
+ self.error = 0.
elif self.met_target:
self.error += (target - self.hysteresis) - temp
if target != self.last_target: