brewpi.py had a dead -m/--model CLI arg and sude/*.json schedules were pure data with no code to drive them, despite the README documenting them as if they were already wired up. Add components/sud.py's Sud, which loads a sude/*.json schedule and steps through its Rasten (ramp -> hold -> optional wait-for-user -> next rest), and tasks/sud.py's SudTask, which drives the temperature controller's theta_soll/heatrate_soll from the current rest and switches the stirrer between continuous (ramping) and intermittent (holding, via stirrSpeedRast/stirrDutyRast/stirrCycleTime) operation. Exposes progress on a new "Sud" WebSocket channel and accepts Start/Confirm commands. Enabled via a new optional top-level "sud" config key (see config.json.templ/.sim). "Reached target" is detected via abs(theta_ist - theta_soll_set) < tolerance rather than tc.state == HOLD, since the latter can still read HOLD left over from the previous rest for one tick after a new target is pushed (tc.state only updates on the controller's own, independently-scheduled process() tick). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
67 lines
957 B
Templ
67 lines
957 B
Templ
{
|
|
"ambient_temperature": 20,
|
|
"sud": "sude/sud_0010.json",
|
|
"Controller" : {
|
|
"dt": 1,
|
|
"sim_warp_factor": 10.0,
|
|
"stirrer_name": "sim",
|
|
"heater_name": "sim",
|
|
"sensor_name": "sim",
|
|
"plant_name": "sim",
|
|
"pid_type": "Smith"
|
|
},
|
|
"TempCtrl": {
|
|
"Kalman": {
|
|
"var_P" : 1.0,
|
|
"var_Q" : 0.0001,
|
|
"var_R" : 1.0
|
|
},
|
|
"Hold": {
|
|
"kp": 0.4,
|
|
"ki": 0.0,
|
|
"kd": 0.0,
|
|
"kt": 0.0
|
|
},
|
|
"Heat": {
|
|
"kp": 0.05,
|
|
"ki": 0.01,
|
|
"kd": 0.0,
|
|
"kt": 1.5
|
|
},
|
|
"Thresholds": {
|
|
"HoldIdle": 0.1,
|
|
"HoldHeat": 1.0,
|
|
"IdleHeat": 1.0,
|
|
"IdleHold": 0.1,
|
|
"HeatHold": 1.0,
|
|
"HeatIdle": 1.0
|
|
}
|
|
},
|
|
"Model": {
|
|
"theta": 20,
|
|
"C": 4190,
|
|
"M": 25,
|
|
"L": 0.05,
|
|
"Td": 15,
|
|
"kn": 0.2,
|
|
"gain" : 0.8
|
|
},
|
|
"Plant": {
|
|
"theta": 20,
|
|
"C": 4190,
|
|
"M": 25,
|
|
"L": 0.05,
|
|
"Td": 15,
|
|
"kn": 0.2,
|
|
"gain" : 0.8
|
|
},
|
|
"Heater": {
|
|
"port": "/dev/ttyUSB0",
|
|
"speed": "115200"
|
|
},
|
|
"Stirrer": {
|
|
"port": "/dev/ttyACM0",
|
|
"speed": "115200"
|
|
}
|
|
}
|