- implemented APid

- choose Tempcontroller impl. from config
This commit is contained in:
jens
2021-10-02 12:24:42 +02:00
parent f7745f9814
commit 2e143ee03f
3 changed files with 21 additions and 2 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ if __name__ == '__main__':
# Temperature Controller
tc_params = config['TempCtrl']
tc = PidFactory.create('Normal', DT, tc_params)
tc = PidFactory.create(config['Controller']['pid_type'], DT, tc_params)
tc.set_on_changed("y", heater_task.actor)
tc_task = TcTask(tc, DT_TASK, dispatcher.msgio_get("TempCtrl"))
taskmgr.add(tc_task)
+18
View File
@@ -36,15 +36,33 @@ class TempController(APid):
def set_theta_ist(self, value):
self.theta_ist_set = value
def get_theta_ist(self):
return self.theta_ist
def set_heatrate_ist(self, value):
self.heatrate_ist_set = value
def get_heatrate_ist(self):
return self.heatrate_ist
def set_theta_soll(self, value):
self.theta_soll_set = value
def get_theta_soll(self):
return self.theta_soll
def get_theta_soll_set(self):
return self.theta_soll_set
def set_heatrate_soll(self, value):
self.heatrate_soll_set = value
def get_heatrate_soll(self):
return self.heatrate_soll
def get_heatrate_soll_set(self):
return self.heatrate_soll_set
def process(self):
# Process Kalman
if self.use_kalman:
+2 -1
View File
@@ -4,7 +4,8 @@
"stirrer_name": "sim",
"heater_name": "sim",
"sensor_name": "sim",
"plant_name": "sim"
"plant_name": "sim",
"pid_type": "Normal"
},
"TempCtrl": {
"dt": 1.0,