The unconditional p_loss/theta_amb/temp prints (left over from the heat-loss-units fix) ran every tick, spamming stdout in both the server and every demo script. Drop them and check off the matching TODO.md item. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.5 KiB
components/plant design backlog
Findings from reviewing pot.py's water-bath model against real-plant
behavior (sim/real control mismatch reported by user), refreshed against
the current delay-line rewrite of Pot.
-
Heat-loss term has wrong units. Fixed by the
Potrewrite:process()now computesp_loss = self.L * self.M * (self.temp - self.theta_amb)in Watts and applies `self.temp += (self.delay.get()- p_loss) / (self.M * self.C) * self.dt
— the same/(M*C)normalization for both the gain and loss terms, instead of the old mismatchedleak = 1/self.M * self.L * (...)/ self.theta_amb`.
- p_loss) / (self.M * self.C) * self.dt
-
Thermal lag modeled as single-pole lag, not transport delay. Fixed:
Potno longer usesHeatDiffusion'salpha=dt/Tdexponential smoothing (that module was deleted). It now delays the input power throughplant/delay.py'sDelay(true dead time) before integrating it, matching what this item recommended. -
knis loaded but never applied. Resolved differently than originally proposed:knwas removed fromPotentirely rather than wired up as plant-side measurement noise. Sensor noise is now modeled one layer up, inTempSensorSim(temp_offset/variance, wired frombrewpi.py'sTempSensorFactory.create(..., temp_offset= -0.15, variance=0.01)), not in the plant model. Note:config.json.templandconfig.json.simstill carry staleModel.kn/Plant.knkeys that nothing reads anymore — harmless but worth deleting (seecomponents/pid/TODO.md's config-validation item). -
theta_ambis hardcoded, not configured. Still true —brewpi.py:pot = Pot(DT, pot_params, 20)passes a literal20instead of reading it from config or a live ambient sensor. Real ambient temperature drifts and is never modeled as a disturbance, so the controller's robustness to it is untested. -
No actuator/process realism. Partially improved:
process()now clampsself.temptomin(100, ...)(won't simulate past boiling), but there's still no heater power saturation enforced insidePotitself (handled ad hoc in demo harnesses), no evaporation/lid heat loss, and no varying thermal massMas volume changes (e.g. boil-off, adding water/grain) —Mis a fixed constant for the whole simulation. -
Debug
print()s left inPot.process(). Fixed: the unconditionalp_loss/theta_amb/tempprints (leftover from the heat-loss-units fix) were removed.