The goals
Any feedback loop is judged by three questions. Stable: does it settle down? Fast: how quickly does it get there? Accurate: how close to the goal does it end up? Our loop keeps a room at 20 °C.
The thermometer hangs far from the heater, so warm air takes 8 minutes to reach it. Every reading the controller gets is 8 minutes old. A delay like this is called dead time, and almost every real loop has some.
A gentle gain
The rule is proportional: power = K × error, kept between 0 and 3 kW. K, the gain, says how hard to push per °C of error. With a gentle K = 0.1, the room warms smoothly and levels off.
Stable means that after a push, the output settles to one steady value instead of swinging or running away. This loop is stable: by about 74 minutes it has settled for good.
It settles at 14.3 °C, not 20. The gap left once everything has settled is the steady-state error: 5.7 °C here. A proportional rule needs an error to make any heat, so a gentle K leaves a big gap.
Speed is measured by the rise time: how long the output takes to go from 10% to 90% of the way to its final value. Here it takes 41 minutes. Stable, but slow and inaccurate.
More gain
Four times the gain pushes harder on the same error. The rise time drops to 13 minutes and the room ends at 17.5 °C, only 2.5 °C short. More gain: faster and more accurate.
But the room now overshoots: it climbs to 18.2 °C, past where it ends up, then falls back. The old readings still said too cold, so the heater kept pushing. Overshoot warns that the loop is getting closer to instability.
At K = 1.5 the room never settles. It swings between 17.9 and 21.0 °C for ever, while the heater keeps hitting off and full power. This loop is unstable: it fails the first goal.
By the time a reading says too cold, the room is already warm, and a strong rule still blasts heat. Then it overshoots the other way. Above K = 1.13, each late correction is bigger than the error it chases.
More gain bought speed and accuracy but cost stability. With a proportional rule you cannot have all three. Choosing the balance is control design. Later lessons in this course add parts that get all three.
What is happening
# step 1/11 · three-goals
# about: Stable?, Fast?, Accurate?
stable does the output settle, or swing
for ever?
fast how quickly does it get close?
accurate how far from the goal does it
end up?
The example: a room, a heater (0 to 3 kW),
a thermometer and a proportional rule.
Goal 20 °C, outside 10 °C.
The room is a simple model with illustrative numbers: it heads towards the outside temperature plus 7.5 °C for every kW of heat, with a 40-minute time constant, and the thermometer's reading is 8 minutes old. Every curve and number in the figure is computed from that model. The Python on each step is plain Python 3 with the math module. It updates the controller every 0.1 minutes with a reading 80 updates (8 minutes) old and moves the room forward with the exact solution of its equation between updates, just as the figure does.