Thermostats, PI and heating limits
A heater makes three ideas tangible: a system stores energy, holding a target requires continued input, and an actuator cannot do everything a controller asks.
First, picture it
A cup warms slowly because its temperature changes only after energy enters. At 60 °C in a 20 °C room, heat still leaves the cup. Reaching the target does not mean the heater can stay off forever.
What the model says
The lab treats the body as one uniform temperature T with heat capacity C and heat-loss coefficient H. Applied heater power u is restricted to 0…Pmax. Energy balance gives C·dT/dt = u − H(T−Ta). This is a first-order plant; relay switching and PI feedback add behavior beyond that plant equation.
C·dT/dt = u − H(T−Ta); τ = C/H; 0 ≤ u ≤ PmaxC: J/K; H: W/K; u: W. Temperature differences have the same numerical value in kelvin and degrees Celsius. Absolute temperatures remain labeled °C in this lab.
Start with energy, not a tuning knob
Over a short interval, input energy minus heat lost to the room equals C times the temperature change. Dividing by the interval gives the differential equation. If the heater supplies 400 W while loss is 100 W, net heating is 300 W. With C = 1000 J/K the instantaneous warming rate is 0.3 K/s. As the temperature rises, loss rises and the warming rate slows even with unchanged input.
For constant ambient and constant applied power, T(t) = Ta + u/H + (T0−Ta−u/H) exp(−t/τ). After one τ, 63.2% of the distance from the initial temperature to equilibrium has been covered. Larger C slows both heating and cooling. Larger H speeds the passive time scale but lowers the maximum warm equilibrium at the same heater power. Faster is not automatically better.
A thermostat remembers whether it was on
With an ON-OFF actuator, the available commands are 0 and Pmax. A hysteresis band of total width b turns heating on when T ≤ r−b/2 and off when T ≥ r+b/2. Between the thresholds it retains its previous state. That memory distinguishes hysteresis from merely comparing temperature to a single threshold. This lab starts OFF if the initial temperature is inside the band.
Under the thermostat preset, zero power cools near the target while full power heats, so switching repeats. Widening the band trades temperature variation for fewer transitions. It cannot guarantee that every temperature stays inside the band: sampled decisions occur every 1 s, and the body moves between them. Delay, noise and heater residual heat would change the result in real hardware, but are deliberately absent here. Transition counts refer to this fixed sampling period and finite run.
PI supplies a steady power even when P disappears
The lab uses urequest = Kp(r−T) + I and accumulates I from Ki(r−T) at 1 s intervals. There is no feedforward bias. At a settled reachable target, P can approach zero while I approaches H(r−Ta). Integral action is therefore not just a way to make startup faster; it builds the output needed to cancel a sustained loss. With Ki = 0 and no clipping at equilibrium, Kp(r−T) = H(T−Ta), so T = (Kp·r + H·Ta)/(Kp + H). For r = 60, Ta = 20, Kp = 20, H = 5 this gives 52 °C.
Compare P-only and PI with identical C, H, initial temperature and events. Then compare PI with the thermostat. The ideal PI actuator can apply an intermediate 200 W directly; a physical relay cannot. Its implementation may need time-proportioning, a power electronic driver and switching constraints. A smooth simulated PI trace does not prove that a real relay can reproduce it.
Check reachability before increasing gains
Steady temperature requires u = H(r−Ta). With 0 ≤ u ≤ Pmax, maintainable equilibria span Ta to Ta + Pmax/H. The endpoints are approached asymptotically from a different initial temperature; they are not necessarily reached in finite time. A target above the upper limit needs more heater power or less heat loss. A target below ambient needs a cooling mechanism. No PI setting removes these physical restrictions.
In the windup preset, 100 °C is impossible with a 200 W heater and H = 5 at Ta = 20. At 300 s the target becomes 40 °C. Without anti-windup, I has accumulated the impossible demand and may keep applied power high after the step down. Compare the I trace and requested versus applied power, not temperature alone. Conditional integration blocks increments that worsen clipping while allowing I to unwind; it is not an instant reset or a new actuator.
Cooling, ambient steps and fair comparisons
With u = 0 and constant ambient, temperature approaches Ta with τ = C/H. Raising Kp cannot improve the initial passive cooling while the output is already at its lower limit. The Passive cooling preset demonstrates this. An ambient step is a persistent environmental change: the new Ta is used from the event time until the end. Unlike an impulse, it changes both heat flow and the set of maintainable temperatures.
Pin one baseline, change one parameter and use the same replay time. Keep duration matched when comparing whole-run energy, time within ±1 °C and switching counts. A warmer final state contains more stored energy, so lower electricity use alone does not establish better control or efficiency. The energy plot separates supplied energy, net ambient loss and stored change; C(T−T0) = supplied − net loss.
Make it concrete
C = 1000 J/K and H = 5 W/K give τ = 200 s. Holding 60 °C at Ta = 20 °C needs 200 W. A 400 W heater can do this; a 150 W heater cannot, regardless of PI gains.
Compare thermostat and PI controlMake a prediction before moving a control.
- PREDICTAfter an impossible 100 °C demand, will the heater turn off immediately when the target becomes 40 °C?
- CHANGE ONE THINGOpen A target beyond heater power. Pin anti-windup ON, then change only that switch to OFF and pin again.
- OBSERVESeek to 300 s and compare integral contribution, requested/applied power and subsequent temperature. Keep initial state and event matched.
- EXPLAINCalculate the maintainable range first, then explain stored integral demand and why cooling is limited even when heating stops.
Turning a heater off removes positive input; it does not create negative input. Thermal inertia is not the same as transport delay, and this ideal body has neither sensor lag nor residual heat stored in a separate heater.
Check your understanding+
At zero temperature error, why may a PI heater still need nonzero power?
The body still loses H(T−Ta) watts. P is zero at zero error, but I can retain the power needed to balance that loss, if the target is maintainable and the loop has converged.