diff --git a/brewpi/brewpi.py b/brewpi/brewpi.py index d9d528c..533c028 100755 --- a/brewpi/brewpi.py +++ b/brewpi/brewpi.py @@ -14,6 +14,15 @@ from tracer import Tracer import argparse as ap +# Default lumped thermal params, shared by both the real Pot plant and the +# temperature controller's internal Smith-predictor model. +DEFAULT_PLANT_PARAMS = { + "C": 4190, + "M": 25, + "L": 0.2, + "Td": 30 +} + if __name__ == '__main__': parser = ap.ArgumentParser() parser.add_argument("-d", "--debug", action="store_true") @@ -38,8 +47,7 @@ if __name__ == '__main__': taskmgr.add(sensor_task) # Plant - pot_params = config['Plant'] - pot = Pot(DT, pot_params, theta_amb) + pot = Pot(DT, DEFAULT_PLANT_PARAMS, theta_amb) taskmgr.add(PotTask(pot, DT_TASK, dispatcher.msgio_get("Pot"))) # Heater @@ -49,7 +57,7 @@ if __name__ == '__main__': taskmgr.add(heater_task) # Temperature Controller - tc = PidFactory.create(config['Controller']['pid_type'], DT, config['TempCtrl'], config['Model'], theta_amb=theta_amb) + tc = PidFactory.create(config['Controller']['pid_type'], DT, config['TempCtrl'], DEFAULT_PLANT_PARAMS, theta_amb=theta_amb) tc_task = TcTask(tc, DT_TASK, dispatcher.msgio_get("TempCtrl")) taskmgr.add(tc_task) diff --git a/config.json.sim b/config.json.sim index 09e15cd..6ce925d 100755 --- a/config.json.sim +++ b/config.json.sim @@ -24,20 +24,6 @@ "kt": 1.5 } }, - "Model": { - "C": 4190, - "M": 25, - "L": 0.05, - "Td": 80, - "gain": 0.8 - }, - "Plant": { - "C": 4190, - "M": 22, - "L": 0.05, - "Td": 80, - "gain": 0.8 - }, "Heater": { "port": "/dev/ttyUSB0", "speed": "115200" diff --git a/config.json.templ b/config.json.templ index 64a5e31..41fb478 100644 --- a/config.json.templ +++ b/config.json.templ @@ -32,18 +32,6 @@ "HeatIdle": 1.0 } }, - "Model": { - "C": 4190, - "M": 25, - "L": 0.05, - "Td": 15 - }, - "Plant": { - "C": 4190, - "M": 25, - "L": 0.05, - "Td": 15 - }, "Heater": { "port": "/dev/ttyUSB0", "speed": "115200"