commit stale changes

This commit is contained in:
2026-07-26 21:37:07 +02:00
parent 92b9bdc1ba
commit 7bf475f257
3 changed files with 209 additions and 11 deletions
+13 -11
View File
@@ -32,17 +32,19 @@ git history for `temp_controller.py`/`temp_controller_smith.py`).
hold_scale)` — the overshoot-compensation scheduling logic now lives
entirely in the temp controller, not the generic `Pid` block.
- [ ] **No automated tests for the heat-rate filtering or Smith
correction specifically.** An earlier `tests/components/pid/` suite
(stdlib `unittest`, no pytest) covering FSM transitions, anti-windup
clamping, and Kalman convergence was removed before the Kalman-filter
removal/Smith rewrite. A new `tests/components/pid/` suite was added
alongside the HOLD-windup fix below (`test_pid.py`,
`test_temp_controller_closed_loop.py`) covering the `yi_max` clamp and
closed-loop disturbance/ramp/transition behavior, but
`_compute_heatrate()`'s backward-difference + low-pass filtering and
the two-model Smith correction itself still have no dedicated
coverage. This drives a physical heater — worth extending.
- [x] **No automated tests for the heat-rate filtering or Smith
correction specifically.** Fixed: `tests/components/pid/test_heatrate_filter.py`
covers `_compute_heatrate()` - a first-tick-reads-zero regression test
(verified it would catch the old hardcoded `last_theta_ist = 20` bug),
convergence to the true rate on a steady ramp (heating and cooling),
and the `beta` pre-filter measurably suppressing noise amplification vs.
raw differentiation. `tests/components/pid/test_temp_controller_smith_correction.py`
covers the two-model correction in `temp_controller_smith.py`: with a
matched internal model, `theta_ist` stays close to the fast (zero-delay)
model's own prediction (contrasted against a deliberately mismatched
model, which diverges 10x+ further); and the corrected estimate visibly
rises before the real transport delay (`Td`) has elapsed, while the raw
plant reading is still flat.
- [x] **`set_model_power` isn't defined on every controller, but
`brewpi.py` wires it unconditionally.** Fixed: `TempControllerBase`