Open loop versus closed loop
About this lesson
Fill a tank with exactly 100 litres, two ways. An open-loop controller works out a timer in advance from the label on the valve; a closed-loop controller watches a level gauge and acts on the error. On a low-pressure day the timer stops 20 litres short, while feedback still reaches 100. Then weigh what each one costs.
Fill a tank to 100 litres
A controller can decide what to do in two ways: from the goal alone, or from the goal plus a measurement of the result. We compare both on one job: fill an empty tank with exactly 100 litres.
goal (setpoint) 100 L
tank right now 0 L
Two ways to decide:
open loop from the goal alone
closed loop from the goal AND a
measurement of the resultRead the lesson step by step
Fill a tank to 100 litres
A controller can decide what to do in two ways: from the goal alone, or from the goal plus a measurement of the result. We compare both on one job: fill an empty tank with exactly 100 litres.
goal (setpoint) 100 L tank right now 0 L Two ways to decide: open loop from the goal alone closed loop from the goal AND a measurement of the resultThe valve is our handle
The tank is the plant and the volume of water is its output. The valve is the actuator, fed by the water supply. The label on the valve says that, wide open, it passes 10 litres per minute.
plant the tank output volume of water (L) actuator the valve input flow through the valve (L/min) label on the valve: 10 L/min wide open The tank only fills: no outlet, no leak. (These words are introduced in the lesson "What a control system is".)Open loop: plan in advance
The open-loop controller does the sum before it starts: 100 L ÷ 10 L/min = 10 minutes. It opens the valve, runs a timer and shuts the valve at 10 minutes. It uses the goal and the label, and nothing else.
t_stop = 100 / 10 → 10 min The plan rests on a model of the plant: "the valve gives 10 L/min". open loop: the action is worked out from the goal alone, before anything happens.When the model is right
On a normal day the valve really does pass 10 L/min. After 10 minutes the timer shuts it with 100.0 litres in the tank. Open loop is simple, cheap and exact, as long as its model is right.
# open loop: a timer, decided in advance flow, dt = 10.0, 0.05 # L/min, min t_stop = 100 / 10 vol = 0.0 for n in range(360): # 18 min t = n * dt if t < t_stop - 1e-9: vol += flow * dt print(round(vol, 1)) # 100.0When the model is wrong
Today the water pressure is low and the open valve only passes 8 L/min. The timer still shuts it at 10 minutes: 80.0 litres, 20.0 L short. Nothing tells the controller, because it never reads the tank.
supply today 8 L/min (label says 10) timer still 10 min tank at 18 80.0 L, 20.0 L short Open loop cannot correct what it does not measure. A toaster is the same: it heats for a set time and never looks at the colour of the toast.Measure the result
Start again with an empty tank, and add a level gauge: the sensor. It reads how much water is in the tank and sends that back to the controller. That return path is feedback, and it closes the loop.
sensor level gauge on the tank reading 0.0 L → controller feedback the output is measured and sent back to the controller closed loop goal → controller → valve → tank → gauge → controllerDecide from the error
The controller works out the error: goal minus reading, 100 − 0 = 100 litres missing. It asks for 1 L/min for every litre missing. 100 L/min is more than the valve can give, so it opens wide.
error = 100 - level # 100 - 0 = 100 L ask = 1.0 * error # 100 L/min valve gives min(ask, 10) # → 10 L/min lots missing → valve wide open little missing → valve nearly shut nothing missing → valve shutSlow down near the top
Measure, compare, act, every three seconds. Below 90 litres the valve stays wide open. After that the error is small, so the valve eases shut. The tank holds 99 litres at 11.3 minutes and ends at 100.0 litres.
# closed loop: decide again every 0.05 min goal, max_flow, dt = 100.0, 10.0, 0.05 vol = 0.0 for n in range(360): # 18 min error = goal - vol # compare ask = max(1.0 * error, 0) vol += min(ask, max_flow) * dt print(round(vol, 1)) # 100.0Low pressure again
Same low-pressure day, 8 L/min. The valve stays open longer because the gauge still shows litres missing. The tank holds 99 litres at 13.6 minutes instead of 11.3, and still ends at 100.0 litres.
# same loop, weaker supply goal, max_flow, dt = 100.0, 8.0, 0.05 vol = 0.0 for n in range(360): ask = max(1.0 * (goal - vol), 0) vol += min(ask, max_flow) * dt print(round(vol, 1)) # 100.0Which one to use
Open loop needs no sensor, so it is simpler and cheaper: fine for a toaster or a washing-machine timer. Closed loop costs a sensor and a rule, but it ended at 100.0 litres on the bad day; open loop stopped at 80.0.
open loop closed loop decides from goal only goal − measured needs a good model a sensor low pressure 80.0 L 100.0 L cost lower higher The cistern of a flush toilet is closed loop: a float valve shuts the inflow as the water rises.
5 quick questions
Choose one answer per question. You can change your choices before checking them.
01What does the open-loop tank controller use to decide how long to open the valve?
It divides the goal by the label's flow: 100 ÷ 10 = 10 minutes. After that it only counts time; it never measures the tank.
02On the low-pressure day the valve passes 8 L/min instead of 10. How much water does the open-loop timer leave in the tank?
The timer still runs for 10 minutes: 8 × 10 = 80.0 litres. Its model of the plant was wrong, and nothing in the loop could tell it.
03The tank holds 70 litres and the goal is 100 litres. With the rule ask = 1.0 × error (L/min), what does the closed-loop controller ask for?
error = 100 − 70 = 30 litres, so it asks for 30 L/min. The valve can only give 10 L/min, so it stays wide open until the error drops below 10 litres.
04Which of these is a closed-loop system?
The float measures the water level and that measurement shuts the valve: the output is fed back. The others run on time alone and never measure the result.
05Why would an engineer ever choose open loop?
Nise (ch. 1) puts the trade-off this way: closed loop gives accuracy and copes with change at a higher cost; open loop is simple and inexpensive.
Glossary
- Open-loop control
- The controller decides what to do from the goal alone, usually using a model of the plant worked out in advance. It never measures the output.
- Closed-loop control
- The controller measures the output, compares it with the goal and acts on the difference. Also called feedback control.
- Feedback path
- The return path that carries the measured output back to the controller. It is what closes the loop.
- Error
- Goal minus measured output. Here, the litres still missing from the tank.
- Model
- What the controller assumes about the plant, here: the valve passes 10 L/min when wide open. Open loop is only as good as this assumption.
- Actuator
- The part that acts on the plant, here the valve. The controller can only ask; the actuator has limits, such as a maximum flow.
- Plant
- The thing being controlled, here the tank. Its output is the volume of water.
Notes and sources
- The tank is a simple model with illustrative numbers: the volume grows by exactly the flow through the valve, and the valve passes at most 10 L/min (normal) or 8 L/min (low pressure). Every curve and number in the figure is computed from that model.
- Nise (Control Systems Engineering, ch. 1) uses the toaster as the standard open-loop example: it heats for a set time and does not measure the colour of the toast. The same chapter traces liquid-level feedback back to Ktesibios' water clock, around 300 BC, whose float valve worked like the one in a toilet cistern today.
- Nise (ch. 1) sums up the trade-off: closed-loop systems are more accurate and less sensitive to disturbances and changes in the environment; open-loop systems are simpler and less expensive. Ogata (Modern Control Engineering, §1-3) compares the two the same way.
- The closed loop is slower than the timer near the top because it asks for less flow as the error shrinks: 1 L/min for each litre missing. A later lesson on design goals weighs speed against accuracy.
- The Python on each step is plain Python 3. It updates the controller every 0.05 minutes and adds the flow times the time step to the volume, exactly as the figure does.
- N. S. Nise, Control Systems Engineering, 8th ed., Wiley (ch. 1, 'Open-loop systems' and 'Closed-loop (feedback control) systems'; chapter 1 excerpt)
- N. S. Nise, Control Systems Engineering, 8th ed., Wiley (book page)
- K. Ogata, Modern Control Engineering, 5th ed., Pearson (§1-3 closed-loop versus open-loop control; §4-2 liquid-level systems)
- G. F. Franklin, J. D. Powell, A. Emami-Naeini, Feedback Control of Dynamic Systems, 8th ed., Pearson (ch. 1)
- MIT OpenCourseWare 16.06 Principles of Automatic Control (S. Hall)
- MIT OpenCourseWare 6.302 Feedback Systems (Roberge, Dawson, Lundberg)
- Python Control Systems Library (python-control) documentation
Quiz Unlocks after the last step.