- implemented APid
- choose Tempcontroller impl. from config
This commit is contained in:
@@ -38,7 +38,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# Temperature Controller
|
# Temperature Controller
|
||||||
tc_params = config['TempCtrl']
|
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.set_on_changed("y", heater_task.actor)
|
||||||
tc_task = TcTask(tc, DT_TASK, dispatcher.msgio_get("TempCtrl"))
|
tc_task = TcTask(tc, DT_TASK, dispatcher.msgio_get("TempCtrl"))
|
||||||
taskmgr.add(tc_task)
|
taskmgr.add(tc_task)
|
||||||
|
|||||||
@@ -36,15 +36,33 @@ class TempController(APid):
|
|||||||
def set_theta_ist(self, value):
|
def set_theta_ist(self, value):
|
||||||
self.theta_ist_set = value
|
self.theta_ist_set = value
|
||||||
|
|
||||||
|
def get_theta_ist(self):
|
||||||
|
return self.theta_ist
|
||||||
|
|
||||||
def set_heatrate_ist(self, value):
|
def set_heatrate_ist(self, value):
|
||||||
self.heatrate_ist_set = value
|
self.heatrate_ist_set = value
|
||||||
|
|
||||||
|
def get_heatrate_ist(self):
|
||||||
|
return self.heatrate_ist
|
||||||
|
|
||||||
def set_theta_soll(self, value):
|
def set_theta_soll(self, value):
|
||||||
self.theta_soll_set = 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):
|
def set_heatrate_soll(self, value):
|
||||||
self.heatrate_soll_set = 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):
|
def process(self):
|
||||||
# Process Kalman
|
# Process Kalman
|
||||||
if self.use_kalman:
|
if self.use_kalman:
|
||||||
|
|||||||
+2
-1
@@ -4,7 +4,8 @@
|
|||||||
"stirrer_name": "sim",
|
"stirrer_name": "sim",
|
||||||
"heater_name": "sim",
|
"heater_name": "sim",
|
||||||
"sensor_name": "sim",
|
"sensor_name": "sim",
|
||||||
"plant_name": "sim"
|
"plant_name": "sim",
|
||||||
|
"pid_type": "Normal"
|
||||||
},
|
},
|
||||||
"TempCtrl": {
|
"TempCtrl": {
|
||||||
"dt": 1.0,
|
"dt": 1.0,
|
||||||
|
|||||||
Reference in New Issue
Block a user