From d839e082e6e65a1be2a0a4fba5ce31116cf915b4 Mon Sep 17 00:00:00 2001 From: jbruce12000 Date: Sun, 1 May 2022 17:52:37 -0400 Subject: [PATCH] increased freq of pid logging. zero out integral component if kiln_must_catch_up is True and outside of kiln_must_catch_up_max_error window --- lib/oven.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/oven.py b/lib/oven.py index 2240126..e495bce 100644 --- a/lib/oven.py +++ b/lib/oven.py @@ -218,10 +218,12 @@ class Oven(threading.Thread): if self.target - temp > config.kiln_must_catch_up_max_error: log.info("kiln must catch up, too cold, shifting schedule") self.start_time = datetime.datetime.now() - datetime.timedelta(milliseconds = self.runtime * 1000) + self.pid.iterm = 0 # kiln too hot, wait for it to cool down if temp - self.target > config.kiln_must_catch_up_max_error: log.info("kiln must catch up, too hot, shifting schedule") self.start_time = datetime.datetime.now() - datetime.timedelta(milliseconds = self.runtime * 1000) + self.pid.iterm = 0 def update_runtime(self): runtime_delta = datetime.datetime.now() - self.start_time @@ -517,14 +519,14 @@ class PID(): 'out': output, } - if out4logs > 0: +# if out4logs > 0: # log.info("pid percents pid=%0.2f p=%0.2f i=%0.2f d=%0.2f" % (out4logs, # ((self.kp * error)/out4logs)*100, # (self.iterm/out4logs)*100, # ((self.kd * dErr)/out4logs)*100)) - log.info("pid actuals pid=%0.2f p=%0.2f i=%0.2f d=%0.2f" % (out4logs, - self.kp * error, - self.iterm, - self.kd * dErr)) + log.info("pid actuals pid=%0.2f p=%0.2f i=%0.2f d=%0.2f" % (out4logs, + self.kp * error, + self.iterm, + self.kd * dErr)) return output