Fundamentals / Mechanical engineering / Control engineering

The period and duty cycle of a thermostat with hysteresis

A two-position thermostat can have a stable, repeatable temperature oscillation even though neither operating state has an equilibrium inside the chosen control band. Use event times to calculate the cycle and test its heat balance.

Couple a thermal balance to a discrete memory state

Let a uniform thermal mass have heat capacity C, conductance G to ambient at \(T_a\), and heater power P when the switch state \(s=1\). With heater off \(s=0\). The continuous state obeys \(C\dot T=-G(T-T_a)+Ps\). The relay turns on when cooling reaches \(T_-\), and turns off when heating reaches \(T_+>T_-\). Between thresholds it retains the most recent switch state. Thus specifying a temperature inside the band without the binary state does not fully specify the future.

\[\tau=C/G,\]
\[T_{\rm on}=T_a+P/G,\]
\[T_{\rm off}=T_a,\]
\[T(t)=T_{\rm eq}+[T(0)-T_{\rm eq}]e^{-t/\tau}.\]

Both thresholds must be reachable in their respective modes for periodic cycling: \(T_a<T_-<T_+<T_{\rm on}\). If \(T_{\rm on}=T_+\) the threshold is approached only asymptotically in this ideal model. A temperature outside the band initially can lead to a transient before the repeating orbit begins.

Solve the crossing conditions exactly

Start at \(T_-\) with the heater on. Solve the exponential trajectory for the time to \(T_+\). Switch state, set that endpoint as the cooling initial condition and solve for the return time. Each logarithm compares distances from the relevant equilibrium:

\[t_{\rm on}=\tau\ln{T_{\rm on}-T_-\over T_{\rm on}-T_+},\]
\[t_{\rm off}=\tau\ln{T_+-T_a\over T_--T_a},\]
\[D={t_{\rm on}\over t_{\rm on}+t_{\rm off}}.\]

Integrate the energy equation over one complete period. Net stored energy change is zero, so \(PD=G(\bar T-T_a)\). This gives the actual time-average temperature directly from the duty ratio. The arithmetic midpoint of the thresholds need not be the time average, because heating and cooling speeds vary across the swing.

Choose band width and estimate switching frequency

Let \(C=2000\) J/K, \(G=10\) W/K, \(P=200\) W and \(T_a=15^\circ\)C. The time constant is 200 s and the heating equilibrium is 35 °C. For thresholds 20 and 22 °C the on-time is \(200\ln(15/13)=28.62\) s and the off-time \(200\ln(7/5)=67.29\) s. Period is 95.9 s and duty 29.84%. Mean power is 59.7 W and the implied mean temperature 20.97 °C. The shorter heating interval reflects the larger temperature distance from the heated equilibrium.

Narrow the band to 20.5 and 21.5 °C at the same midpoint. The on-time falls to 14.29 s and off-time to 33.41 s. Switching frequency roughly doubles while duty remains close to 30%. In a real relay, sensor lag can permit overshoot beyond thresholds. A narrow hysteresis band then ceases to predict the observed extrema. Increasing numerical resolution in a continuous integrator only helps if its logic also detects the threshold crossing at the proper time.

Narrow the switching band by half while keeping its midpoint fixed. Predict the switching frequency and mean heating power, then read both event times. Raise heater power and identify which branch of the thermal trajectory should remain unchanged.

Tutorial · infer the thermal capacitance from one cycle

Suppose the wider band gives a measured cooling time of 80.0 s with ambient at 15 °C and the same conductance. Infer C and predict heating time if heater power remains 200 W. If the observed heating time disagrees but the cooling curve fits, identify one additional independent measurement.

Infer the time constant then check the energized mode

The cooling expression gives

\[\tau=80/\ln(7/5)=237.8\,\mathrm{s},\]
\[C=G\tau=2378\,\mathrm{J/K}.\]

Predicted heating time is

\[237.8\ln(15/13)=34.0\,\mathrm{s}.\]

Measuring electrical heating power or the long-time temperature reached under a continuous on command tests \(P/G\). The cooling branch alone identifies the ratio C/G and does not determine that energized equilibrium.

Further reading · UC Berkeley Ptolemy Project · thermostat as a continuous plant controlled by a finite-state machine