Open Loop and Closed Loop: Why Feedback Works
The heater block from the introduction reaches above the room with a fixed , because its thermal resistance is . Then someone switches on a desk fan beside it. The thermal resistance drops to about and the block settles lower, and nothing in an open-loop controller notices. An open-loop controller is only as good as the model it was calibrated with. A closed-loop controller measures what actually happened and corrects it. This lesson puts numbers on that difference, and on what feedback costs.
Two ways to command a plant
Open loop: the controller computes from the reference alone, , usually an inverse of the plant's DC gain. A toaster timer, a stepper motor driven without an encoder, a washing-machine programme and a fixed-duty PWM fan are open loop. They are cheap, cannot become unstable on their own and need no sensor, but every model error and every disturbance goes straight to the output.
Closed loop: the controller acts on the error between the reference and the measured output. The figure shows the loop used in the whole course, with a load disturbance entering at the plant input and measurement noise entering at the sensor.
Writing the loop equations with (the sensor's own dynamics are folded into here):
Three facts follow directly.
| Effect | Open loop | Closed loop |
|---|---|---|
| output change for a plant change | the full | about , with |
| disturbance reaching the output | : divided by | |
| sensor noise reaching the output | none (no sensor) | : passed where is large |
The sensitivity measures how much the closed loop cares about the plant: differentiate to get
So where the loop gain is large, the closed loop follows the reference, ignores plant variations and rejects disturbances. The identity is the catch: at frequencies where the loop also faithfully reproduces sensor noise as if it were real. A loop cannot reject noise and follow the reference in the same frequency band, so loops are designed with high gain at low frequencies (where references and disturbances live) and low gain at high frequencies (where noise lives). That trade-off returns in loop shaping.
What feedback costs:
- A sensor, and the closed loop can be no better than it: an offset in the sensor becomes an offset in the output.
- Stability. Open-loop-stable plants can be made unstable by too much gain, which the Routh–Hurwitz lesson makes precise.
- Actuator effort. A fast loop asks for large at the start of a step; real actuators saturate.
Worked example: the heater and the desk fan
Given: heater block , nominal , fan on ; target rise . Open loop: fixed . Closed loop: proportional, (the value from the intro's practice question), with the reference scaled so the nominal loop lands on .
Find: the final temperature rise in both cases with the fan on, and the effect of a extra heat loss (a draught) on each.
Solve:
- Open loop, fan on: , a drop, exactly the plant change.
- Closed loop: . Nominal ; fan on . With the reference scaled by , the output drops by , from to . The prediction is close; the difference is because is not a small change.
- Draught: a loss is a disturbance at the plant input. Open loop it lowers the block by ; closed loop by .
Check: the program below repeats the calculation and simulates the draught arriving at .
import numpy as np
import control as ct
Kp, tau = 12.25, 300.0
for Rth in (4.0, 3.0):
G = ct.tf([Rth], [tau, 1])
T = ct.feedback(Kp * G, 1)
r_scale = 1 / 0.98 # calibrated on the nominal plant
print(f"Rth = {Rth:.0f} K/W: open loop {Rth * 6.25:6.2f} K, closed loop {25 * r_scale * ct.dcgain(T):6.2f} K")
G = ct.tf([4.0], [tau, 1])
GS = ct.feedback(G, Kp) # from d (W at the plant input) to y
t = np.linspace(0, 1200, 12001)
d = np.where(t >= 600, -2.0, 0.0)
y_ol = ct.forced_response(G, t, d).outputs
y_cl = ct.forced_response(GS, t, d).outputs
print(f"draught of 2 W: open loop drop {-y_ol[-1]:.2f} K after 600 s (final 8 K), closed loop drop {-y_cl[-1]:.3f} K")
print(f"closed-loop time constant {tau / (1 + 4 * Kp):.1f} s, S(0) = {1 / (1 + 4 * Kp):.3f}")Rth = 4 K/W: open loop 25.00 K, closed loop 25.00 K
Rth = 3 K/W: open loop 18.75 K, closed loop 24.83 K
draught of 2 W: open loop drop 6.92 K after 600 s (final 8 K), closed loop drop 0.160 K
closed-loop time constant 6.0 s, S(0) = 0.020
The open-loop block has not even finished losing its after ten minutes (it has a time constant), while the closed loop has settled low within a few of its time constants. Feedback also made the loop 50 times faster, which is the same factor .
In the lab: a plant whose gain halves
Use the PID lab as a plain proportional loop around a first-order plant: , , , . The readouts give a final value of (), rise time and settling . Now halve the plant gain to : the final value only falls to (), lower, although the plant changed by . Set with and the loop is slow (settling ) and the final value is only : feedback with little gain buys little.
Guided lab: open loop against closed loop on a heater
Hand calculation. With the heater block's model, open loop gives ; a fan that lowers to gives . A proportional loop with holds the block within of the same change, but only within the heater's , so for large steps it runs at full power at first.
Simulation. Change Rth and Kp in the program and compare open- and closed-loop drops; then in the lab, compare the final value for and at several .
What you would measure. A , aluminium-clad resistor bolted to a small aluminium block, an NTC thermistor or a DS18B20-type digital sensor in a drilled hole with thermal paste, a logic-level MOSFET switched by PWM from a microcontroller, a bench supply with its current limit at . Open loop at PWM duty ( of full power: with PWM the average power is proportional to the duty) the block should settle about above the room after 20 minutes, but expect : the real depends on mounting and air movement. Switch on a fan and log the drop. Repeat with the P loop: the fan should now change the temperature by a few tenths of a kelvin, close to the sensor's resolution. Log at and plot.
Hazards and safe setup. The resistor and block reach and can go higher if the software fails: add a software limit (heater off above ), a thermal fuse or bimetal cut-out in series, keep the block on a non-flammable surface, never leave it powered unattended. Supply DC, current-limited; the MOSFET needs a heatsink only if it is not fully switched.
Pitfalls
- Thinking feedback fixes a bad sensor: the loop drives the measured value to the reference.
- Raising gain to reduce error without checking the actuator: the linear model's may be far beyond the hardware.
- Forgetting : high loop gain at high frequency feeds sensor noise to the actuator.
- Calling a loop "closed" when the measurement is only displayed and a person adjusts the knob occasionally: that is manual control, with a slow and unreliable controller.
Practice
- A plant has DC gain 20 with a P controller . By how many percent does the closed-loop DC gain change if the plant gain drops by ?
- A disturbance would move an open-loop output by . The loop gain at DC is 99. How far does it move the closed-loop output?
- Why is a high loop gain at undesirable for a temperature loop?
Answer
- , ; with , : a change of (the estimate ).
- .
- Nothing real happens to the temperature at ; only sensor noise and interference live there, and would pass them to the heater command.
Test yourself
With loop gain , the sensitivity of the closed-loop transfer function to plant changes is
- 1
A load disturbance at the plant input reaches the output of a closed loop through
- it cannot reach the output
Why can a loop not reject sensor noise and track the reference at the same frequency?
- because
- because the sensor is too slow
- because of the integrator
- because the plant is nonlinear
In the PID lab, a proportional loop with around has final value at . At it is