- remove HeatDiffusion - use delay line for heat propagation modeling [Temp Controller] - remove Kalman
28 lines
900 B
Python
28 lines
900 B
Python
from components.pid.temp_controller_base import TempControllerBase
|
|
|
|
|
|
class TempController(TempControllerBase):
|
|
def __init__(self, dt, params):
|
|
TempControllerBase.__init__(self, dt, params)
|
|
self.dt = dt
|
|
self.last_theta_ist = 20
|
|
self.heatrate_ist = 0
|
|
def process(self):
|
|
# Process Kalman
|
|
self.theta_ist = self.theta_ist_set
|
|
heatrate = (self.theta_ist - self.last_theta_ist)/self.dt*60
|
|
self.heatrate_ist = heatrate
|
|
self.last_theta_ist = self.theta_ist
|
|
|
|
# Compensate for max heat rate to reduce overshoot
|
|
if self.heatrate_soll_set > 0:
|
|
self.pid_hold.scale(1.0/self.heatrate_soll_set)
|
|
|
|
self.heatrate_soll = self.heatrate_soll_set * self.pid_hold.get_y()
|
|
theta_err = self.theta_soll_set - self.theta_ist
|
|
heatrate_err = self.heatrate_soll - self.heatrate_ist
|
|
|
|
diff = self.theta_soll_set - self.theta_ist
|
|
self.process_fsm(diff)
|
|
self.process_pid(theta_err, heatrate_err)
|