From 20b0363e262c70dd49ee4564704a0276bda426be Mon Sep 17 00:00:00 2001 From: jens Date: Mon, 11 Oct 2021 19:04:32 +0200 Subject: [PATCH] - reset kalman on change to HEAT state --- components/pid/temp_controller_smith.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/pid/temp_controller_smith.py b/components/pid/temp_controller_smith.py index d5096c5..724413a 100755 --- a/components/pid/temp_controller_smith.py +++ b/components/pid/temp_controller_smith.py @@ -144,6 +144,9 @@ class TempController(APid): if state_next != self.state: self.state = state_next print("New state = {}".format(state_next)) + if state_next == States.HEAT: + self.kalman_plant.initial((self.theta_ist, 0)) + self.kalman_model.initial((self.theta_ist, 0)) def process_pid(self, theta_err, heatrate_err): self.pid_hold.process(theta_err, -self.theta_ist)