[Pot]
- remove HeatDiffusion - use delay line for heat propagation modeling [Temp Controller] - remove Kalman
This commit is contained in:
@@ -1,25 +1,18 @@
|
||||
from components.pid import Kalman
|
||||
from components.pid.temp_controller_base import TempControllerBase
|
||||
|
||||
|
||||
class TempController(TempControllerBase):
|
||||
def __init__(self, dt, params):
|
||||
TempControllerBase.__init__(self, dt, params)
|
||||
self.kalman = Kalman(dt, params['Kalman'])
|
||||
|
||||
def init_kalman(self, value):
|
||||
self.kalman.initial((value, 0))
|
||||
|
||||
self.dt = dt
|
||||
self.last_theta_ist = 20
|
||||
self.heatrate_ist = 0
|
||||
def process(self):
|
||||
# Process Kalman
|
||||
if self.use_kalman:
|
||||
Z = self.kalman.process_measurement((self.theta_ist_set, 0), 0.0)
|
||||
xp = self.kalman.process(Z)
|
||||
self.theta_ist = xp[0, 0]
|
||||
self.heatrate_ist = xp[1, 0] * 60
|
||||
else:
|
||||
self.theta_ist = self.theta_ist_set
|
||||
self.heatrate_ist = self.heatrate_ist_set
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user