- refactored

This commit is contained in:
jens
2021-10-09 10:52:35 +02:00
parent b83ec71346
commit f6394e9e7a
2 changed files with 18 additions and 12 deletions
+5 -3
View File
@@ -144,12 +144,14 @@ class TempController(APid):
self.pid_hold.process(theta_err, -self.theta_ist)
self.pid_rate.process(heatrate_err, -self.heatrate_ist)
self.y = self.pid_rate.get_y()
if self.state == States.IDLE:
self.y = 0
else:
self.y = self.pid_rate.get_y()
self.model.set_power(max(0, 250 + 3500 * self.y))
self.model.set_power(max(0, 250 + 3500 * self.y))
self.model.process()
def get_power(self):
return self.y