Testing the windup-fix rework live against sude/sud_0030.json surfaced a
distinct bug: a HOLD overshoot from grain-fill-in cooling never decayed -
process_pid()'s pid_outer_y floor clamped to exactly 0.0, so pid_inner
fought the pot's own ambient loss to hold the overshot temperature flat
instead of declining back to setpoint (see docs/overshoot2.png).
Replace the hardcoded 0.0 floor with a configurable Outer.y_hold_min
(default 0.0, backward compatible), set to -0.1 in config.json, both
.tpl templates, and the demo scripts - small enough to avoid
reintroducing the bb5af3c limit cycle while letting HOLD request a
gentle decline matching passive ambient cooling.
Adds TestHoldOvershootRecoversToSetpoint and documents the finding in
docs/overshoot_hold_windup.md's Follow-up section and
components/pid/TODO.md. Confirmed against a live sud_0030 re-run, not
just the unit test.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2ierBoxW3v7nUbDw3M2pE
67 lines
993 B
Smarty
67 lines
993 B
Smarty
{
|
|
"ambient_temperature": 20,
|
|
"log_interval": 300,
|
|
"TempCtrl": {
|
|
"pid_type": "Smith",
|
|
"beta": 0.05,
|
|
"Outer": {
|
|
"kp": 0.4,
|
|
"ki": 0.0,
|
|
"kd": 0.0,
|
|
"kt": 0.0,
|
|
"y_hold_min": -0.1
|
|
},
|
|
"Inner": {
|
|
"Heat": {
|
|
"kp": 0.08,
|
|
"ki": 0.02,
|
|
"kd": 0.0,
|
|
"kt": 1.5
|
|
},
|
|
"Hold": {
|
|
"kp": 0.08,
|
|
"ki": 0.02,
|
|
"kd": 0.0,
|
|
"kt": 1.5,
|
|
"yi_max": 0.3
|
|
},
|
|
"Cool": {
|
|
"kp": 0.08,
|
|
"ki": 0.02,
|
|
"kd": 0.0,
|
|
"kt": 1.5
|
|
}
|
|
},
|
|
"Thresholds": {
|
|
"HoldHeat": 1.0,
|
|
"HoldCool": 1.0,
|
|
"HeatHold": 1.0,
|
|
"HeatCool": 1.0,
|
|
"CoolHold": 1.0,
|
|
"CoolHeat": 1.0
|
|
}
|
|
},
|
|
"Heater": {
|
|
"type": "hendi",
|
|
"port": "/dev/ttyUSB0",
|
|
"speed": "115200"
|
|
},
|
|
"Stirrer": {
|
|
"type": "pololu1376",
|
|
"port": "/dev/ttyACM0",
|
|
"speed": "115200"
|
|
},
|
|
"TempSensor": {
|
|
"type": "max31865",
|
|
"temp_offset": -0.15
|
|
},
|
|
"Pot": {
|
|
"mass": 5.96,
|
|
"material": "Edelstahl 18/10",
|
|
"L": 0.2,
|
|
"Td": 17,
|
|
"water_mass": 22,
|
|
"volumen": 30
|
|
}
|
|
}
|