diff --git a/brewpi.py b/brewpi.py index bfcad9d..13bc6ca 100755 --- a/brewpi.py +++ b/brewpi.py @@ -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) diff --git a/components/pid/temp_controller.py b/components/pid/temp_controller.py index 78f2fe7..8a18af7 100644 --- a/components/pid/temp_controller.py +++ b/components/pid/temp_controller.py @@ -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: diff --git a/config.json.templ b/config.json.templ index ca783a9..4f2ff80 100644 --- a/config.json.templ +++ b/config.json.templ @@ -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,