refactor: move pot hardware params and pid_type out of per-brew docs

Pot hardware constants (mass, material, L, Td) moved from sude/*.json
to config.json's Pot section; Sud/SudForecastEstimator accept pot_config
as baseline, per-brew pot sections may still override. Controller key
removed; pid_type moved into TempCtrl.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 19:41:04 +02:00
co-authored by Claude Sonnet 4.6
parent 0495e177c4
commit 5142fcbf3d
6 changed files with 41 additions and 26 deletions
+4 -4
View File
@@ -81,7 +81,7 @@ if __name__ == '__main__':
# Mash schedule - starts out empty; a client loads one of sude/*.json's
# several schedules onto it later (see components/sud.py's Sud).
sud = Sud()
sud = Sud(config.get('Pot', {}))
# Heater/Pot/Sensor - built together as one consistent rig; each
# component's type comes from its own config section. Heater.type==sim
@@ -113,7 +113,7 @@ if __name__ == '__main__':
# temp_controller_smith.py.), and Smith's model plant params are -
# like the real Pot's above - deliberately left unset here, only
# ever coming from a Sud's own doc.
tc = PidFactory.create(config['Controller']['pid_type'], DT)
tc = PidFactory.create(config['TempCtrl']['pid_type'], DT)
tc.set_params(config['TempCtrl'])
tc.set_ambient_temperature(theta_amb)
tc_task = TcTask(tc, DT_TASK, dispatcher.msgio_get("TempCtrl"))
@@ -128,8 +128,8 @@ if __name__ == '__main__':
# it with the same kind of plant/controller (and params) as above -
# see components/sud_forecast.py.
forecast_estimator = SudForecastEstimator(
DT, theta_amb, config['Controller']['pid_type'], config['TempCtrl'],
heater.get_powers(), args.sim_warp_factor)
DT, theta_amb, config['TempCtrl']['pid_type'], config['TempCtrl'],
heater.get_powers(), args.sim_warp_factor, config.get('Pot', {}))
sud_task = SudTask(sud, tc, stirrer, pot, DT, DT_TASK, dispatcher.msgio_get("Sud"), forecast_estimator)
taskmgr.add(sud_task)
# Records every Sud run's measured data and forecast to their own