- reset kalman on change to HEAT state

This commit is contained in:
jens
2021-10-11 19:04:32 +02:00
parent 9b20276012
commit 20b0363e26
+3
View File
@@ -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)