Open loop and closed loop
Why measuring the result changes everything: the parts of a feedback loop and the simplest controller of all, on–off control.
25 min · Self-paced · Free
Two ways to make toast
Imagine two toasters. The first has a timer: you set it to three minutes and it heats for three minutes, no matter what. The second has a sensor that watches the colour of the bread and stops when it reaches the shade you chose.
The first toaster works well when everything is as expected. But if the bread is frozen, it comes out pale; if the bread is thin, it burns. The timer has no way of knowing. The second toaster does not care whether the bread is frozen or thin — it keeps heating until the result is right.
These are the two fundamental approaches to control:
- Open-loop control decides what to do in advance and does it, without measuring the result. The timer toaster, a basic microwave, and a sprinkler on a timer are all open-loop.
- Closed-loop control, also called feedback control, measures the result and uses that measurement to adjust what it does. The colour-sensing toaster, a home thermostat and your own hand reaching for a glass are all closed-loop.
The parts of a feedback loop
Every feedback loop has the same ingredients, whatever it controls. Using a home heating system as the example:
- Set point (or reference): the value you want. Say, 20 °C.
- Measurement: what a sensor says the value actually is. A thermometer reads 17 °C.
- Error: the set point minus the measurement. Here, 20 − 17 = +3 °C. A positive error means "too low"; a negative error means "too high".
- Controller: the rule that turns the error into an action.
- Actuator: the device that carries out the action — the boiler or heater.
- Plant (or process): the thing being controlled. Here, the room and the air in it.
- Disturbances: outside influences you do not control — an open window, a sunny afternoon, people coming in.
The loop runs continuously: measure, compute the error, act, let the room respond, measure again. The great strength of feedback is that the controller does not need to know why the room is cold. An open window and a cold morning look the same to it: both produce an error, and it responds to the error.
Why not just plan carefully?
You might wonder why we do not simply build a very accurate model of the room and calculate exactly how long to run the heater, open-loop. Sometimes that works, and good engineers use models wherever they help. But open-loop control has two weaknesses that feedback addresses:
- Models are never perfect. The room's insulation, the heater's power and the outside temperature are all known only approximately.
- Disturbances are unpredictable. Nobody can model in advance when a door will be left open.
Feedback copes with both, because it reacts to what is actually happening. This is the same reason a robot keeps sensing even after it has made a plan, as discussed in the introduction to robotics.
The simplest controller: on–off
The most basic controller has only two outputs: fully on or fully off. Older thermostats work this way. The rule is:
- If the temperature is below the set point, turn the heater on.
- If it is above, turn it off.
This is called on–off control or bang–bang control. It is cheap and robust, but it has a problem. Heating systems take time to respond — the heater warms up, the warm air spreads, the thermometer catches up. By the time the thermometer reads 20 °C and the heater switches off, there is still heat on its way, so the temperature continues rising past 20. Then it falls below 20, the heater switches on, and the lag carries it too low. The temperature ends up oscillating around the set point instead of settling on it.
Worse, if the measurement is very close to the set point, sensor noise can make the heater switch on and off many times per second. That wears out switches and motors. The usual fix is hysteresis: use a small band around the set point. For example, switch on below 19.5 °C and off above 20.5 °C. The temperature still wanders within the band, but the switching becomes calm and predictable.
Feedback in robots
A robot joint is a feedback problem too. The set point is the angle you want, a sensor such as an encoder measures the actual angle, and the motor is the actuator. If the controller is on–off — full power one way or the other — the joint overshoots, reverses and overshoots again, a jittery motion you may have seen in hobby projects. To get smooth, accurate motion, a controller needs to act more gently when the error is small. That is exactly what proportional control, the subject of the next lesson, provides.
Knowledge check
Check your understanding
Sign in to track your progress. Reading is free without an account.