Feedback and Control
Loops, thermostats, proportional control, time constants, damping, poles and PID, honestly tuned
Eight chapters on making machines behave. Close the loop, switch a heater on and off without chattering, push in proportion to the error and discover why it always falls a little short. Then model how systems respond in time, read overshoot and settling from a step, decide stability from the poles, and design PID controllers that meet a written spec, survive saturation and win a fair comparison.
Compiled and written by the Tactiverge team with AI assistance, from Tactiverge School lessons that were themselves written with AI assistance.
1. Open and closed loop
A toaster runs for a set time whether the bread is pale or burnt: that is open loop. A thermostat measures the room and acts on the difference between what it wants and what it gets: that is closed loop. The difference, the error, is the heart of feedback. Closed loops correct for disturbances nobody predicted, but they depend completely on the sensor telling the truth.
Figure 1.1. Measure, compare, correct (described in words)
A feedback loop: a setpoint of 22 °C enters a summing junction, the measured 19 °C is subtracted, and the error of 3 °C drives a controller, which drives the room, whose temperature is measured and fed back.
Explanation
1.1 Sense, decide, act
A toaster burns frozen bread and undercooks warm bread. A smart greenhouse never lets its plants freeze. What does the greenhouse know that the toaster doesn't?
Information is an input too
A thermometer reading, a button press, a camera image: these carry information into a system. Information doesn't push anything, but it can change what the system decides to do.
Sense → decide → act
Sense: a sensor measures something (temperature). Decide: a controller compares it with a target, called the setpoint (20 °C), using a rule. Act: an actuator changes the world (the heater switches on). A rule can be as simple as: IF temperature < 20 °C THEN heater ON, ELSE heater OFF.
Open loop or closed loop?
Open loop: the system acts without checking the result, like a timer toaster or a garden sprinkler on a clock. Closed loop: it measures the result and adjusts, like a thermostat. Closed loops cope with surprises (a cold night, frozen bread) but need a sensor and a good rule. The measuring-and-adjusting is called feedback.
Common mix-ups
Smart machines think like people.
✓ Most 'smart' machines follow simple rules: measure, compare with a target, switch something on or off.Open loop is always worse.
✓ Open loop is cheap and fine when conditions don't change much. A toaster timer is good enough for most bread.
1.2 Open loop or closed loop?
A robot was told to roll exactly 40 wheel-turns to a door. On a polished floor it stopped a hand's width short. What was it missing?
Open loop: act from a plan
Open-loop control decides what to do in advance and never checks the result. A toaster on a timer, a robot told 'drive 40 wheel turns'. Simple and cheap, but if the world isn't exactly as expected, the result is wrong and nobody notices.
Closed loop: measure and correct
Closed-loop control measures the result and uses it to decide what to do next. The measurement is fed back, which is why it's called feedback. It's a sense–think–act loop aimed at a target.
The gap drives everything
The thinking step usually starts with one subtraction:
gap = target − measured value
Big gap: push hard. Zero gap: you've arrived. Negative gap: you've gone too far, so push back. The controller doesn't need to know why it's off, just how far.
Common mix-ups
Closed loop means the machine is switched off.
✓ It means information goes round in a circle: act, measure, feed back, act again.Feedback needs to know what caused the error.
✓ It only needs the gap. Slip, slope or a push all show up the same way.
1.3 Open loop or closed loop?
A toaster with a timer and an oven with a thermostat both heat things up. Only one of them knows whether it worked. Which?
Open loop: act and hope
In open-loop control the command is decided in advance: run the toaster for 2 minutes, run the motor at 60%. It is simple and cheap, and fine when conditions never change. But it cannot notice a disturbance (thicker bread, a heavier cart) or its own mistakes.
Closed loop: measure and correct
In closed-loop (feedback) control a sensor measures the result, the controller compares it with the setpoint (the target) to get the error = setpoint − measurement, and adjusts the actuator to shrink the error. Then it measures again, every loop pass. A thermostat, cruise control and a self-balancing robot all do this.
What feedback buys, and costs
Feedback rejects disturbances and copes with machines that are not quite what you expected. The cost is a sensor, more design, and new risks: a badly tuned loop can overshoot, oscillate or, with a broken sensor, act on nonsense. That is why the noise and calibration work earlier this term matters.
Common mix-ups
Closed-loop control is always better.
✓ Open loop is cheaper and perfectly good when conditions are steady. Feedback adds sensors, tuning and new failure modes.A machine with a sensor is closed loop.
✓ Only if the sensor's reading changes the command. A sensor that only displays a value leaves the loop open.
Examples to try
Worked solutions are in the interactive chapter online.
Sense, decide, act: example 1
Write a sense–decide–act rule for a night light.
Open loop or closed loop?: example 1
A robot wants to be 200 cm along a corridor. Its encoder says it's at 165 cm. What's the gap, and what should it do?
Open loop or closed loop?: example 1
Classify: (a) a washing machine filling for exactly 90 s, (b) a washing machine filling until a level sensor trips, (c) a sprinkler on a timer.
Laboratory (online)
These run in a browser on the full site. Simulations are simplified educational models.
- BUILD: Smart greenhouse, level 1 (BUILD level)
Map the greenhouse loop: name the setpoint, sensor, controller, actuator and one disturbance.
Open online - Playground: Feedback control (Playground lab)
Run the system with the feedback path removed, then restored, and describe what the sensor adds.
Open online
Practice questions
Questions only. Each one is answered in its Lite lesson online, where it is checked on our server.
1. Which is a closed-loop system?
- A sprinkler that runs at 6 a.m. every day, rain or shine
- A heater that switches off when the room reaches 21 °C
- A toaster with only a timer
Check it in “Sense, decide, act”
2. Why would you choose closed loop over open loop?
- It is always cheaper
- It adjusts when conditions change, like a sudden cold night
- It needs no sensor
Check it in “Sense, decide, act”
3. Which of these is closed-loop?
- A washing machine that always fills for 90 seconds
- A washing machine that fills until a level sensor says full
- A fan that runs for 10 minutes
Check it in “Open loop or closed loop?”
4. A robot's target is 80 cm. It measures 86 cm. What is the gap, in cm? (It can be negative.)
Answer: cm
Check it in “Open loop or closed loop?”
5. A closed-loop robot is pushed back 10 cm by a friend. What happens?
- It doesn't notice
- The gap grows, so it drives forward again
- It stops working
Check it in “Open loop or closed loop?”
6. In a greenhouse heater loop, what is the 'error'?
- The heater's power
- Setpoint minus measured temperature
- The thermometer
Check it in “Open loop or closed loop?”
7. The setpoint is 18 °C and the thermometer reads 15.5 °C. What is the error, in °C?
Answer: °C
Check it in “Open loop or closed loop?”
8. A closed-loop heater's thermometer falls off the wall and reads 0 °C. What does the controller do?
- Switches off safely
- Heats flat out, because it thinks it is freezing
- Nothing
Check it in “Open loop or closed loop?”
Engineering applications
Cruise control
A car's cruise control measures speed and adjusts the throttle to hold the setpoint. On a hill the speed falls, the error grows and the throttle opens, with no map of the hill needed.
A lying sensor
If a thermostat's sensor sits next to a warm lamp, the loop faithfully holds the wrong temperature. Feedback corrects for disturbances, not for a sensor that measures the wrong thing.
Summary
- Open loop acts without measuring the result; closed loop measures and corrects.
- Error = setpoint − measurement; its sign says which way to push.
- Closed loops reject disturbances nobody planned for.
- A loop is only as good as its sensor: a broken or misplaced sensor breaks the loop.
Glossary
- Open-loop control
- Open-loop control sends commands without measuring the result: 'run the motor at 60 % for 2 seconds' and hope it went far enough.
- Closed-loop (feedback) control
- Closed-loop control measures the output, compares it with the target and adjusts the command to shrink the difference, over and over.
- Setpoint and error
- The setpoint (or reference) is the value you want; the error is the setpoint minus the measured value. Controllers act on the error.
- Sense–think–act loop
- Most robots run a repeating cycle: read sensors, decide what to do, command actuators, then repeat, usually at a fixed rate.
Project: Loops in the wild
Find three control systems in your home or school, such as a fridge, a toilet cistern or an automatic door. For each, say whether it is open or closed loop, draw its block diagram, name its setpoint and sensor, and describe what happens if the sensor fails.
Deliverables
- Three block diagrams with every block labelled
- A classification with reasons
- The failure behaviour of each sensor
References
- Karl Johan Åström and Richard M. Murray (2008). Feedback Systems: An Introduction for Scientists and Engineers. Princeton University Press.
- James Clerk Maxwell (1868). "On Governors". Proceedings of the Royal Society of London 16, 270–283.
2. On/off control and hysteresis
The simplest controller has two moves: full on or full off. A thermostat switches the heater on when the room is cold and off when it is warm. With one threshold, noise near the setpoint makes the relay chatter; with two thresholds, a hysteresis band, the controller keeps its last decision inside the band. A wider band means fewer switches and bigger swings; choosing it is a trade-off, not a fix.
Figure 2.1. Two thresholds stop the chatter (described in words)
A hysteresis loop for a heater: on below 19 °C and off above 21 °C. Between them lies a band 2 °C wide, shaded, in which the heater keeps whatever state it was last in.
Explanation
2.1 On/off control: the bang-bang thermostat
Your heating clicks on, then off, then on again all evening. Is it broken, or is that the plan?
Full on or full off
A bang-bang controller has only two actions. Below the target: heater fully on. Above it: heater fully off. It's a single IF–THEN–ELSE rule inside a forever loop.
Why it wobbles
The heater can't be 'a bit on', so the temperature overshoots while it's on and drops while it's off. It never settles exactly on the target; it oscillates in a band around it.
The gap (hysteresis)
Switching at exactly one temperature makes the heater chatter on and off. So thermostats use two thresholds, a switch-on and a higher switch-off. The space between is called hysteresis. A small gap gives steadier temperature but more switching; a big gap gives fewer switches but bigger swings.
Common mix-ups
A thermostat that clicks on and off a lot is broken.
✓ Switching on and off is how bang-bang control works. Only very rapid switching suggests the gap is too small.On/off control is too crude to be useful.
✓ It's cheap, robust and good enough for fridges, ovens and heating everywhere.
2.2 On/off control and hysteresis
A heater with a single switch-point clicks on and off dozens of times a minute when the temperature hovers near it. How do real thermostats stop that?
Bang-bang control
On/off control has two outputs: full power or none. If too cold, heater on; if warm enough, heater off. The temperature therefore rises and falls around the setpoint in a sawtooth. It is cheap and robust, and the swing is often acceptable for rooms, fridges and greenhouses.
Two thresholds, not one
Hysteresis uses separate thresholds: switch on below the lower one and off above the upper one; between them, keep doing whatever you were doing. In code:
if temp < ON_BELOW:
heater = True
elif temp > OFF_ABOVE:
heater = False
# otherwise: no changeNotice it is a two-state machine: the heater's current state decides what happens in the band.
Choosing the band
A wider band means fewer switchings (less wear on relays and compressors) but a bigger temperature swing. A narrower band holds the temperature tighter but chatters with noise. A good rule: make the band clearly wider than the sensor noise, and place it so the swing stays inside the comfort range, remembering the temperature overshoots a little after each switch.
Common mix-ups
Hysteresis makes the controller less accurate, so avoid it.
✓ It deliberately allows a small swing to stop chattering. Without it, noise wears out relays and can cause rapid cycling.The temperature stays inside the band.
✓ Thermal lag makes it overshoot both thresholds a little. Leave room for that.
Examples to try
Worked solutions are in the interactive chapter online.
On/off control: the bang-bang thermostat: example 1
A thermostat is set to 20 °C with a 2 °C gap. When does the heater switch on, and when off?
On/off control and hysteresis: example 1
Seedlings must stay between 16 and 24 °C. The thermometer jitters by about ±0.3 °C, and the air overshoots by about 0.5 °C after each switch. Suggest thresholds.
Interactive figures, in words
Figure 2.2 from “On/off control: the bang-bang thermostat”
With 'On/off', try a gap of 0.2 °C, then 1 °C, then 4 °C. For each, note how much the temperature swings and how many times the heater switched.
The thermostat plot can be replaced by these results from the same simulated room, target 18 °C. On/off with a 0.2 °C gap: swings about 0.5 °C, about 37 switches in 2 hours. 1 °C gap: swings about 1.2 °C, about 13 switches. 2 °C gap: swings about 2.4 °C, about 7 switches. In every case it takes about 34 minutes to warm up from 10 °C.
Laboratory (online)
These run in a browser on the full site. Simulations are simplified educational models.
- Simulation OS: Greenhouse through a cold night (Simulation OS experiment)
Keep the seedlings between 16 and 24 °C with an on/off heater and count how often it switches.
Open online - BUILD: Smart greenhouse, level 3 (BUILD level)
Choose a hysteresis band that survives the open vent without the heater chattering.
Open online
Practice questions
Questions only. Each one is answered in its Lite lesson online, where it is checked on our server.
1. Why does a bang-bang thermostat never hold the temperature exactly on target?
- The thermometer is broken
- The heater can only be fully on or fully off, so it overshoots and undershoots
- The target is set wrong
Check it in “On/off control: the bang-bang thermostat”
2. An engineer shrinks the gap from 2 °C to 0.2 °C. What happens?
- Smaller swings, more switching
- Bigger swings, less switching
- Smaller swings, less switching
Check it in “On/off control: the bang-bang thermostat”
3. Gap set: on below 17 °C, off above 19 °C. The heater is ON and the room reaches 18 °C. What does it do?
- Switches off
- Stays on
- Switches on
Check it in “On/off control: the bang-bang thermostat”
4. A thermostat uses a setpoint of 20 °C and a total hysteresis band of 3 °C, centred on the setpoint. Below what temperature does the heater switch on, in °C?
Answer: °C
Check it in “On/off control and hysteresis”
5. With 'on below 17, off above 19', the heater is ON and the temperature is 18.2 °C. What does the controller do?
- Switch off
- Keep the heater on
- Switch on
Check it in “On/off control and hysteresis”
6. What do you trade when you widen the hysteresis band?
- Fewer switchings for a bigger temperature swing
- More switchings for a steadier temperature
- Nothing changes
Check it in “On/off control and hysteresis”
7. Your thermometer jitters by ±0.4 °C. Which band is most likely to chatter?
- 0.2 °C
- 1.5 °C
- 2.5 °C
Check it in “On/off control and hysteresis”
Engineering applications
Fridges and boilers
Fridges, kettles and many boilers are on/off controllers with hysteresis. The band is chosen so the compressor or burner is not switched too often, which would wear it out and waste energy.
Schmitt triggers
Digital inputs often include hysteresis in hardware, a Schmitt trigger, so a slowly changing or noisy voltage produces one clean transition instead of a burst of false edges.
Summary
- On/off control applies full effort or none, so the output always oscillates around the setpoint.
- A single threshold chatters when noise crosses it repeatedly.
- Hysteresis uses separate on and off thresholds; inside the band the last state is kept.
- A wider band means fewer switches but larger swings.
Glossary
- On–off control with hysteresis
- On–off control switches the actuator fully on or off; hysteresis uses two thresholds, one to switch on and a different one to switch off, so the output does not chatter around a single value.
- Setpoint and error
- The setpoint (or reference) is the value you want; the error is the setpoint minus the measured value. Controllers act on the error.
- Closed-loop (feedback) control
- Closed-loop control measures the output, compares it with the target and adjusts the command to shrink the difference, over and over.
Project: Design a thermostat band
A heater warms a small room by 1 °C per minute and the room cools by 0.5 °C per minute when it is off. For bands of 0.5, 1 and 2 °C around 20 °C, estimate the switching period and the temperature swing, and recommend a band for comfort and for relay life.
Deliverables
- Switching period and swing for each band
- A sketch of temperature against time for one band
- A recommendation with its trade-off
References
- Karl Johan Åström and Richard M. Murray (2008). Feedback Systems: An Introduction for Scientists and Engineers. Princeton University Press.
- Gene F. Franklin et al. (2015). Feedback Control of Dynamic Systems, 7th edition. Pearson.
3. Proportional control
Instead of on or off, push in proportion to the error: far away, push hard; close, push gently. The gain sets how hard. Proportional control is smooth and simple, but it has a built-in flaw: to keep pushing against a load it needs some error left over, so it settles a little short of the setpoint. Raise the gain and the shortfall shrinks, but the actuator saturates and, in real systems, overshoot creeps in.
Figure 3.1. P control always falls a little short (described in words)
Three bars showing where proportional control settles: with loop gain K·G = 4 it stops 20% short, with K·G = 9 it stops 10% short, and with K·G = 99 it stops 1% short. The error is 1 / (1 + K·G).
Explanation
3.1 Correct in proportion
When you park a bike next to a friend, you slow down as you get close. What rule is your brain using?
Push in proportion to the gap
A proportional controller makes its correction a fixed fraction of the gap:
correction = k × gap
Far away, big gap, big push. Close by, small gap, gentle push. The number k is called the gain.
Too little, just right, too much
With k below 1, each step closes part of the gap: a smooth glide in. k = 1 jumps straight there (in a perfect world). k between 1 and 2 overshoots and wobbles, then settles. k = 2 bounces for ever. k above 2 wobbles bigger and bigger: unstable.
Settling a little short
A proportional heater only heats when the room is too cold. Near the target the gap is small, so the heat is small, and it can only balance the heat leaking out if the room stays a little below target. Higher gain shrinks this offset; later levels add a trick (integral action) to remove it.
Common mix-ups
A bigger gain is always better: it gets there faster.
✓ Too much gain overshoots, wobbles or goes unstable.Proportional control always reaches the exact target.
✓ When something keeps pulling it away (like heat leaking out), it settles a little short.
3.2 Proportional control: push harder when further away
On/off heaters are either flat out or off. What if the heater could push gently when you are nearly there?
The proportional rule
effort = Kp × error. Big error, big effort; small error, small effort; no error, no effort. With PWM, 'effort' can be a duty cycle. Two practical limits: a heater cannot cool, so negative effort is clipped to 0, and it cannot exceed full power, so large efforts are clipped to 100%. When clipped, the controller is saturated and behaves like on/off.
The leftover error
On a cold night the heater must keep supplying heat. A proportional controller only supplies heat when there is an error, so it settles where the error is just big enough: the steady-state error. More gain means less error is needed, so it settles closer. Removing the error completely needs another idea, integral action, which you meet in Level 3.
Too much gain
Real systems have delays: the heater warms up, air takes time to mix, the sensor responds slowly, and firmware samples at intervals. With a very high gain, the controller overreacts to each change and can overshoot or oscillate. Engineers raise the gain until the error is small enough and stop well before the response turns twitchy.
Derivation: Where a proportional heater settles
Controller: heater power P = Kp × (r − T), limited to 0–3,000 W. (r = setpoint, T = temperature, Kp in W per °C.)
Greenhouse: heat leaks out at UA × (T − T_out) watts, with UA = 100 W per °C in the model.
Steady means heat in = heat out: Kp × (r − T) = UA × (T − T_out).
Expand and collect the T terms: Kp·r + UA·T_out = (UA + Kp) × T.
So T = (UA·T_out + Kp·r) ÷ (UA + Kp). With UA = 100, T_out = 5 °C, Kp = 400, r = 18 °C: T = (500 + 7,200) ÷ 500 = 15.4 °C, 2.6 °C short.
Kp = 1,500 gives (500 + 27,000) ÷ 1,600 ≈ 17.2 °C: closer. The error shrinks as Kp grows but only reaches zero if Kp were infinite.
Common mix-ups
A proportional controller reaches the setpoint exactly, given time.
✓ Against a steady heat loss it settles short of the setpoint. That offset is built into the rule.Turn the gain up as high as possible.
✓ Delays in real systems make very high gains overshoot or oscillate.
3.3 Why P control always falls short
Turn the proportional gain up from 1 to 9 and the error shrinks from half the setpoint to a tenth. Why does it never reach zero?
The error is doing a job
A P controller's output is proportional to the error. To hold a motor at speed, the motor needs a steady push; the only way P can provide one is to keep some error. That leftover is the steady-state error, e = r/(1 + K·Kp).
Designing to a spec
If the error must be within 2 % of r, set r/(1 + K·Kp) ≤ 0.02·r, so K·Kp ≥ 49. For a unit plant, Kp ≥ 49. That is a large gain, which leads to the next problem.
Why not just crank Kp?
High gain amplifies sensor noise into the motor command, can push the actuator into saturation, and on plants with more dynamics (a springy joint, a delay) causes overshoot and oscillation or even instability. Integral action removes steady-state error without needing enormous gain.
Derivation: Steady-state error of P control
Controller: u = Kp·e, where e = r − y (setpoint minus output).
Plant at steady state: once nothing is changing, the output is just its static gain times its input, y = K·u.
Combine: y = K·Kp·e. Substitute into e = r − y to get e = r − K·Kp·e.
Collect the e terms: e·(1 + K·Kp) = r.
So e = r / (1 + K·Kp). For a unit plant (K = 1) and unit setpoint, e = 1/(1 + Kp).
e is zero only if Kp is infinite. Any finite gain leaves an error, because the controller needs a non-zero error to produce the non-zero push that holds the output up.
Common mix-ups
Steady-state error means the controller is badly tuned.
✓ With P only, some error is built in: e = r/(1 + K·Kp). Tuning trades its size against noise and overshoot.Doubling Kp halves the error.
✓ The error goes as 1/(1 + K·Kp), so doubling Kp from 1 to 2 takes it from 1/2 to 1/3, not 1/4.
Examples to try
Worked solutions are in the interactive chapter online.
Correct in proportion: example 1
A robot is at 20 cm, target 100 cm, k = 0.25. Where is it after one step? After two?
Proportional control: push harder when further away: example 1
Kp = 25% per °C, setpoint 20 °C. Efforts at 19 °C, 16 °C and 21 °C?
Why P control always falls short: example 1
K = 2, Kp = 4, r = 10. Find the steady-state error and final output.
Why P control always falls short: example 2
A unit plant must settle within 5 % of its setpoint. What Kp is needed?
Interactive figures, in words
Figure 3.2 from “Correct in proportion”
Step through with k = 0.5. Then try k = 1, k = 1.5, k = 2 and k = 2.2. Describe what each one does in a few words.
The gap-closer can be replaced by this table, starting at 0 cm with target 60 cm. k = 0.5: 30, 45, 52.5, 56.3 cm (glides in). k = 1: 60 (straight there). k = 1.5: 90, 45, 67.5, 56.3 (overshoots, settles). k = 2: 120, 0, 120, 0 (bounces for ever). k = 2.2: 132, −26.4, 163.7 (grows: unstable).
Figure 3.3 from “Proportional control: push harder when further away”
Choose Proportional. With the setpoint at 18 °C and outside at 5 °C, try a gain of 400 W per °C and read where it settles. Raise the gain to 1,500 and 3,000. Then switch to On/off and compare the energy and switching.
The thermostat diagram plots 300 minutes of greenhouse temperature from a 12 °C start, with the setpoint, a ±1 °C band and the heater power underneath. In proportional mode the power is gain × error, limited to 0–3,000 W; the temperature settles below the setpoint at (100 × outside + gain × setpoint) ÷ (100 + gain), and the readout states that value. In on/off mode the heater is full on below the band and off above it, and the readout counts switchings.
Laboratory (online)
These run in a browser on the full site. Simulations are simplified educational models.
- Playground: Feedback control (Playground lab)
Increase the proportional gain step by step and record the steady-state error at each setting.
Open online - Simulation OS: PID step response (Simulation OS experiment)
With only P active, find the gain that halves the steady-state error, and note what happens to overshoot.
Open online
Practice questions
Questions only. Each one is answered in its Lite lesson online, where it is checked on our server.
1. A robot is at 0 cm and wants to stop at 80 cm. Each step it moves 0.5 of the remaining gap. Where is it after one step, in cm?
Answer: cm
Check it in “Correct in proportion”
2. Which value of k makes the robot overshoot the target and then settle?
- 0.3
- 1.5
- 2.5
Check it in “Correct in proportion”
3. A proportional heater targets 18 °C but the room settles at 16.6 °C. Why?
- The heater is broken
- Near the target the gap is small, so the heat is small: it only balances the losses below target
- The thermometer reads 1.4 °C too low
Check it in “Correct in proportion”
4. A proportional heater controller uses effort = gain × error, where error = setpoint − temperature. The gain is 40% per °C and the effort is limited to the range 0 to 100%. The setpoint is 18 °C and the temperature is 16 °C. What heater effort does it command, in %?
Answer: %
Check it in “Proportional control: push harder when further away”
5. At dusk the greenhouse is 8 °C below the setpoint and Kp × error is 300% of full power. What does the heater actually do?
- 300% power
- 100% power: the effort is saturated
- 0% power
Check it in “Proportional control: push harder when further away”
6. A plant with static gain K = 1 is under proportional control with Kp = 5. The setpoint steps to r = 5. What is the steady-state error e = r − y once it settles?
Answer:
Check it in “Why P control always falls short”
7. A plant with static gain K = 2 must settle within 5 % of a setpoint r = 2 using proportional control only. What is the smallest Kp that achieves this?
Answer:
Check it in “Why P control always falls short”
8. Why can a P controller never remove the steady-state error completely?
- Because the sensor is noisy
- Because its output is zero when the error is zero, but holding the setpoint needs a non-zero push
- Because the plant is too slow
Check it in “Why P control always falls short”
Engineering applications
Steering
A line-following robot that steers in proportion to how far it is off the line runs smoothly where an on/off steerer would zigzag. Too much gain and it weaves; too little and it drifts wide on curves.
Droop
In power grids, generators deliberately use proportional control of frequency, called droop, so many machines share a change in load. The small steady error is accepted by design.
Summary
- Proportional control: effort = Kp × error, limited by what the actuator can give.
- With a plant of steady-state gain G, P control settles with error 1 / (1 + Kp·G) of the setpoint.
- Higher gain shrinks the steady error but saturates sooner and, with dynamics, overshoots more.
- The leftover error is the price of pushing against a load with P alone.
Glossary
- Proportional control
- A proportional controller sets the command to a gain times the error: u = Kp × e. Bigger errors get bigger corrections.
- Steady-state error
- Steady-state error is the error that remains after the response has settled and stopped changing.
- Setpoint and error
- The setpoint (or reference) is the value you want; the error is the setpoint minus the measured value. Controllers act on the error.
- Overshoot
- Overshoot is how far a response goes past its final value, usually given as a percentage of the step size.
Project: How much gain?
A heater with steady-state gain 2 °C per unit of effort warms a tank that must stay within 0.5 °C of 40 °C. Find the minimum proportional gain that meets the spec at steady state, check the effort needed against an actuator limit of 30 units, and say what you would do if they conflict.
Deliverables
- The gain calculation from 1 / (1 + K·G)
- The effort check against the limit
- A plan for the conflicting case
References
- Karl Johan Åström and Richard M. Murray (2008). Feedback Systems: An Introduction for Scientists and Engineers. Princeton University Press.
- Gene F. Franklin et al. (2015). Feedback Control of Dynamic Systems, 7th edition. Pearson.
- Katsuhiko Ogata (2010). Modern Control Engineering, 5th edition. Prentice Hall.
4. Systems with memory: first-order response
Switch on a heater and the room does not jump to its final temperature; it creeps towards it, quickly at first, then slowly. Systems with stored energy have memory, and the simplest kind, first order, is described by two numbers: a gain and a time constant τ. After one τ the response is 63% of the way there, after about four τ it is essentially done. Read τ from a step test and you have a model to control.
Figure 4.1. 63 % in one time constant (described in words)
The first-order step response y = 1 − e^(−t/τ) with points marked at 63.2% at 1τ, 86.5% at 2τ, 95% at 3τ and 98.2% at 4τ.
Explanation
4.1 Systems with memory
Flick a light switch and the room is bright at once. Turn on an oven and you wait ten minutes. What does the oven have that the bulb does not?
Static versus dynamic
A static system's output depends only on the input right now: a resistor's current follows its voltage instantly, a lever's output force follows the push. A dynamic system's output depends on what happened before: a cup of tea's temperature now depends on how hot it was a minute ago. Dynamic systems have memory.
Memory is stored stuff
Physically, memory is something stored that cannot change instantly: kinetic energy in a spinning rotor, heat in an oven's walls, charge on a capacitor, water in a tank. Changing the stored amount takes a finite flow over a finite time, which is why outputs lag inputs.
Describe the rate, not the value
Because the output cannot jump, we describe a dynamic system by how fast it changes: dT/dt = (heater power − losses)/heat capacity. Solve or simulate that rate equation and you get the value at every time. That is the language of this whole term.
Common mix-ups
If the output is slow, the sensor must be slow.
✓ Sensors can lag, but the physical quantity itself also changes gradually when something is being stored. Separate the two before blaming the sensor.Static and dynamic are fixed properties of a device.
✓ They depend on the timescale you care about. A thermometer is dynamic over seconds and static over hours.
4.2 Inputs, outputs, states and parameters
A greenhouse model has a heater, a thermometer, a temperature and a wall thickness. Which of those is the model's memory?
Five kinds of quantity
Inputs are what you choose (heater power, motor voltage). Disturbances are inputs you don't choose (wind, a passenger stepping in). States are what the system remembers (temperature, speed). Outputs are what you measure, often a state seen through a sensor. Parameters are fixed numbers in the equations (mass, time constant, gain).
Parameters stay put, states move
In a single run the parameters are constants; the states change from step to step. Changing a parameter means simulating a different system. That is why a fair test changes one parameter at a time across runs.
Block diagrams
Engineers draw a model as boxes joined by arrows. Each arrow is a signal (a quantity that varies in time) and each box transforms signals. Parameters live inside the boxes. A feedback loop is an arrow that carries the output back to the input side.
Common mix-ups
Anything with a number in the model is a parameter.
✓ Numbers that evolve during a run are states; only numbers fixed for the run are parameters.
4.3 The time constant: 63 % and counting
Why do engineers quote 63 % rather than half when they say how fast something heats up?
Two numbers describe it all
In τ·dy/dt + y = K·u, the static gain K is how much the output changes per unit of input once everything settles. The time constant τ (seconds) is how quickly it gets there. Change K and the curve stretches up; change τ and it stretches sideways; the shape never changes.
Landmarks to sketch with
After 1τ: 63 % of the change. 2τ: 86 %. 3τ: 95 %. 4τ: 98 %. 5τ: 99.3 %. The slope at the start is (y∞ − y₀)/τ: if it kept that rate, it would arrive in exactly one τ. Those numbers let you sketch any first-order response in seconds.
Time constants are physical
τ is a storage size divided by a flow rate. For an RC circuit τ = R·C. For a heated object τ = (thermal mass)/(heat-loss coefficient). Bigger storage or slower leakage means a longer τ. That is why a thick pot takes longer to boil than a thin one.
Derivation: Solving the first-order step response
Model: τ·dy/dt + y = K·u, with a constant input u applied from t = 0 and y(0) = y₀.
At equilibrium dy/dt = 0, so the final value is y∞ = K·u. Define the remaining error e = y − y∞.
Since y∞ is constant, de/dt = dy/dt, and the model becomes τ·de/dt = −e.
Separate variables: de/e = −dt/τ. Integrate: ln|e| = −t/τ + const, so e(t) = e(0)·e^(−t/τ).
Therefore y(t) = y∞ + (y₀ − y∞)·e^(−t/τ). From rest (y₀ = 0): y(t) = K·u·(1 − e^(−t/τ)).
At t = τ the remaining error is e^(−1) ≈ 0.368, so 63.2 % of the change is done. At 4τ only e^(−4) ≈ 1.8 % is left: the usual 2 % settling estimate (exactly 3.91τ).
Common mix-ups
The time constant is the time to reach the final value.
✓ It is the time to cover 63 % of the change. Getting within 2 % takes about four time constants.A bigger gain makes a first-order system respond faster.
✓ On its own, K changes only the size of the response. (Feedback changes the speed, as you'll see in week 16.)
4.4 Read the plant from its step response
You're handed a heater you've never seen. One five-minute test is enough to model it. Which test, and what do you read off?
The step test
Hold the system steady, then change the input by a known Δu and log the output until it settles. K = Δy∞/Δu, the change in final output per unit input. τ is the time to cover 63 % of Δy∞. If the response has an initial delay before it starts moving, measure τ from when it starts.
Any point will do, some are better
From one reading y at time t: τ = −t / ln(1 − y/y∞). Readings near the start (small y/y∞) and near the end (y/y∞ close to 1) are sensitive to noise, because a small error in y makes a big change in the logarithm. Points between 30 % and 80 % give the most reliable τ.
Use all the data
Better still, fit the whole curve: plot ln(1 − y/y∞) against t. For a true first-order system it is a straight line with slope −1/τ. If it curves, the plant isn't first-order: a second store, a delay or a nonlinearity is showing.
Common mix-ups
You can stop the step test once the output looks nearly flat.
✓ If you underestimate y∞, every τ estimate is biased. Log for at least four or five time constants.
4.5 A greenhouse is a first-order system
Open the greenhouse door on a cold morning and the air cools in minutes. Shut it and the heater takes far longer to win it back. Why the asymmetry?
An energy balance is a first-order model
One energy store (the air and contents), one way in (the heater), one way out (the walls): C·dT/dt = P − G·(T − T_out). Rearranged, it is exactly τ·dy/dt + y = K·u with y = T − T_out, τ = C/G and K = 1/G.
Why cooling can be faster than heating
Opening the door makes G much larger, so τ = C/G becomes much smaller and the air rushes towards T_out. Shut the door and G drops back; now the heater fights the slow τ. The model is the same equation with a different parameter, which is why the asymmetry isn't mysterious.
The model's honest limits
One lumped temperature assumes the air is well mixed. Real greenhouses have warm ceilings and cold floors, soil that stores heat with its own slow τ, and sunshine that varies. A first-order model is a good start for control design; it isn't a full thermal simulation.
Derivation: From an energy balance to τ and K
Energy stored in the air and plants: C·T, with C the heat capacity (J/K). Its rate of change = heat in − heat out.
Heat in: heater power P. Heat out through the walls: G·(T − T_out), with G the loss coefficient (W/K).
So C·dT/dt = P − G·(T − T_out). Divide by G: (C/G)·dT/dt + (T − T_out) = P/G.
Compare with τ·dy/dt + y = K·u, where y = T − T_out and u = P: τ = C/G and K = 1/G.
Better insulation (smaller G) raises both τ and K: slower to respond, but each watt buys more temperature.
Common mix-ups
Better insulation makes a building heat up faster.
✓ It raises the final temperature for the same heater but also raises τ, so the approach is slower.
Examples to try
Worked solutions are in the interactive chapter online.
Systems with memory: example 1
Classify: (a) a phone charger's output voltage versus mains input, (b) a water tank's level versus inflow, (c) an LED's brightness versus current.
Inputs, outputs, states and parameters: example 1
A model of a phone battery: dQ/dt = −I(t), V = V₀(Q) − I·R. Label Q, I, V, R and V₀.
The time constant: 63 % and counting: example 1
K = 3, step u = 2, τ = 4 s, starting at rest. Find y at t = 4 s and at t = 8 s.
The time constant: 63 % and counting: example 2
A probe starting at 20 °C is plunged into 80 °C water. τ = 5 s. What does it read after 10 s?
Read the plant from its step response: example 1
A 10 % step in fan power changes a room's temperature by 1.8 °C once settled; it reached 1.0 °C after 12 minutes. Find K and τ.
A greenhouse is a first-order system: example 1
A greenhouse settles 8 °C above outside with its heater on, and τ = 15 min. Starting at outside temperature, how far above outside is it after 30 min?
Interactive figures, in words
Figure 4.2 from “The time constant: 63 % and counting”
In Explore mode, set K = 2, τ = 1.5 s, u = 1. Check the curve crosses the 63 % line at τ. Then double τ, then double K: describe in one sentence each what changes and what doesn't.
The step responder draws a curve rising from zero towards K times u. A dashed line at 63 % of the final value meets the curve at t = τ, and a second marker at 4τ shows it within 2 % of the final value. Doubling τ stretches the curve horizontally; doubling K stretches it vertically.
Laboratory (online)
These run in a browser on the full site. Simulations are simplified educational models.
- Simulation OS: RC charging and discharging (Simulation OS experiment)
Read the time at which the capacitor reaches 63% and compare it with R × C.
Open online - Equation Lab: First-order systems (Equation Lab exploration)
Change τ and the gain separately and describe what each does to the step response.
Open online - BUILD: Smart greenhouse, level 2 (BUILD level)
Estimate the greenhouse's time constant from its warm-up data.
Open online
Practice questions
Questions only. Each one is answered in its Lite lesson online, where it is checked on our server.
1. Which of these is best modelled as a dynamic system for a 1-minute experiment?
- A potentiometer's output voltage versus knob angle
- A kettle's water temperature versus heater power
- A light-dependent resistor's resistance versus light level
- A gear train's output angle versus input angle
Check it in “Systems with memory”
2. Physically, why can't an oven's temperature jump when you switch it on?
- The thermostat is slow to read
- Heat must flow into the walls and air, and a finite power takes time to deliver a finite energy
- Electricity takes time to reach the heater
- Ovens are designed to be slow on purpose
Check it in “Systems with memory”
3. A drone hovering in wind: which is a disturbance?
- Motor thrust command
- Gust of wind
- Drone altitude
- Propeller diameter
Check it in “Inputs, outputs, states and parameters”
4. K = 4, step u = 5 from rest, τ = 3 s. What is y at t = 3 s?
Answer:
Check it in “The time constant: 63 % and counting”
5. A first-order system has time constant τ = 0.75 s. How long after a step does it take to get within band = 5 % of its final value?
Answer: s
Check it in “The time constant: 63 % and counting”
6. A step test settles 40 units above where it started. It is 25.3 units above the start at t = 6 s. What is τ, in seconds?
Answer: s
Check it in “Read the plant from its step response”
7. Raising a heater's power by 200 W raises its settled temperature by 30 °C. What is the static gain K in °C per watt?
Answer: °C/W
Check it in “Read the plant from its step response”
8. A greenhouse has heat capacity C = 900 kJ/K and loss coefficient G = 500 W/K. What is τ, in minutes?
Answer: min
Check it in “A greenhouse is a first-order system”
Engineering applications
Step tests
Process engineers identify a plant by giving it a small step and logging the response. The final change gives the gain; the time to 63% gives τ. Those two numbers are often enough to tune a first controller.
Thermal mass
A stone building has a long thermal time constant, so it stays cool through a hot afternoon. Designers choose materials partly for that slowness.
Summary
- Systems that store energy respond with lag; their output depends on history, not just the present input.
- A first-order system is set by a gain K and a time constant τ: y = K(1 − e^(−t/τ)) for a unit step.
- At t = τ the response is 63.2% complete; it is within 2% after about 4τ.
- Identify a plant from a step test: gain from the final change, τ from the 63% time.
Glossary
- First-order system and time constant
- A first-order system responds to a step by approaching its new value exponentially; its time constant τ is the time to cover 63.2 % of the change.
- Exponential growth and decay
- A quantity decays exponentially when its rate of decrease is proportional to how much is left, giving y = y0 × e^(−t/τ).
- RC time constant
- When a capacitor charges or discharges through a resistor, the voltage changes exponentially with time constant τ = R × C.
- Settling time and rise time
- Settling time is how long a response takes to enter and stay within a band, often 2 %, of its final value. Rise time is how long it takes to go from 10 % to 90 % of the step.
Project: Identify a plant
Run a step test on a simulated or real first-order system, such as an RC circuit or a mug of warm water. Estimate its gain and time constant from the data in two ways (the 63% point and a log plot), compare them, and check the fitted model against a second step.
Deliverables
- The step data plotted with the 63% point marked
- Gain and τ from both methods
- A validation against the second step
References
- Karl Johan Åström and Richard M. Murray (2008). Feedback Systems: An Introduction for Scientists and Engineers. Princeton University Press.
- Katsuhiko Ogata (2010). Modern Control Engineering, 5th edition. Prentice Hall.
- Norman S. Nise (2015). Control Systems Engineering, 7th edition. Wiley.
5. Second-order response and damping
Add a spring to a mass and the system can overshoot and ring. Its behaviour is set by two numbers: the natural frequency ωn, how fast it wants to oscillate, and the damping ratio ζ, how quickly the oscillation dies. Below ζ = 1 it overshoots, at 1 it is critically damped, above 1 it creeps. Engineers read overshoot, rise time and settling time from a step response and translate them into ζ and ωn.
Figure 5.1. Less damping, more overshoot (described in words)
Step responses of a second-order system with ωn = 1 for three damping ratios: ζ = 0.2 overshoots 52.7%, ζ = 0.5 overshoots 16.3% and ζ = 0.7 overshoots 4.6%. Overshoot = e^(−ζπ/√(1−ζ²)).
Explanation
5.1 Mass, spring, damper: ωn and ζ
A car suspension, a seismometer and a robot joint held by a stiff controller all obey the same equation. Which two numbers describe how each one moves?
Three forces, one equation
The spring pulls back in proportion to stretch (k·x). The damper resists in proportion to speed (c·ẋ). Whatever is left accelerates the mass (m·ẍ). So m·ẍ + c·ẋ + k·x = F. Electrical RLC circuits, pendulums at small angles and many closed control loops share this form.
Natural frequency ωn
ωn = √(k/m) rad/s is how fast it would oscillate with no damping. Stiffer spring: faster. Heavier mass: slower. Divide by 2π for hertz. ωn sets the timescale: double it and every time in the response halves.
Damping ratio ζ
ζ = c/(2√(km)) compares the actual damping with the critical value c_crit = 2√(km). ζ < 1 is underdamped (overshoots and rings), ζ = 1 is critically damped (fastest with no overshoot), ζ > 1 is overdamped (sluggish). ζ sets the shape.
Derivation: Standard form: where ωn and ζ come from
Newton's law on the mass: m·ẍ + c·ẋ + k·x = F.
Divide by m: ẍ + (c/m)·ẋ + (k/m)·x = F/m.
Define ωn² = k/m and 2ζωn = c/m. Then ẍ + 2ζωn·ẋ + ωn²·x = ωn²·(F/k).
Solving 2ζωn = c/m for ζ: ζ = c/(2m·ωn) = c/(2√(km)).
The characteristic roots are s = −ζωn ± ωn√(ζ² − 1). Complex (oscillation) for ζ < 1, repeated for ζ = 1, real and distinct for ζ > 1.
Common mix-ups
More damping always makes a system settle faster.
✓ Beyond ζ = 1, more damping makes it slower. The fastest settling without big overshoot is around ζ ≈ 0.7.Overshoot depends on how heavy the mass is.
✓ Percent overshoot depends only on ζ. Mass changes ζ, but if ζ is held fixed, mass only changes the timing.
5.2 Under, critical, over
A door closer that slams, one that creeps for ten seconds, and one that shuts perfectly. Same spring. What's different?
Underdamped (ζ < 1)
The response overshoots, then oscillates with frequency ωd = ωn√(1 − ζ²) inside an exponentially shrinking envelope e^(−ζωn t). Small ζ: big overshoot, long ringing. It rises fastest, which is why lightly damped systems feel 'snappy'.
Critically damped (ζ = 1)
The response x(t) = 1 − (1 + ωn t)·e^(−ωn t) rises without any overshoot and is the fastest response that never crosses the final value. It is the boundary between oscillating and not.
Overdamped (ζ > 1)
Two real time constants. The slower one dominates, and it gets slower as ζ grows: for large ζ it is roughly 2ζ/ωn. No overshoot, but sluggish. A door closer that takes ten seconds is badly overdamped.
Choosing ζ
If overshoot is dangerous (a robot gripper closing on an egg, a lift levelling at a floor), choose ζ close to 1. If a little overshoot is fine and speed matters, ζ ≈ 0.5–0.7 is common: 0.7 gives about 4.6 % overshoot and close to the shortest 2 % settling time.
Common mix-ups
Critically damped means 'damped just enough to stop it breaking'.
✓ It is a precise mathematical boundary, ζ = 1, between oscillating and non-oscillating responses.
5.3 Reading a step response like an engineer
Two controllers both reach the set point. One is twice as good. Which four numbers would prove it?
The five numbers
Rise time: from 10 % to 90 % of the final value. Peak time tp: when the first maximum occurs. Percent overshoot: (peak − final)/final × 100. Settling time ts: after this, the response stays within ±2 % (sometimes 5 %) of final. Steady-state error: set point minus final value.
Conventions are part of the number
'Settling time 3 s' means nothing without the band: 2 % and 5 % can differ by a factor of 1.3. Rise time may be 0–100 % or 10–90 %. Good reports state the convention once, then use it everywhere.
Metrics pull against each other
Faster rise usually means more overshoot. Less overshoot often means slower settling. Removing steady-state error with integral action can add overshoot. A specification lists limits on several metrics at once, so a design is judged on the whole set.
Common mix-ups
Overshoot is measured relative to the set point.
✓ Standard practice measures it relative to the final value. If the two differ (steady-state error), say which you used.
5.4 From overshoot to ζ and back
A spec says 'no more than 5 % overshoot'. What damping ratio does that demand, before you touch a single gain?
Overshoot depends only on ζ
%OS = 100·exp(−ζπ/√(1 − ζ²)). Landmarks: ζ = 0.2 → 53 %, 0.4 → 25 %, 0.5 → 16 %, 0.6 → 9.5 %, 0.7 → 4.6 %, 0.8 → 1.5 %. Memorise ζ = 0.5 → 16 % and ζ = 0.7 → 5 % and you can sanity-check most designs.
Timing depends on ωn too
Peak time tp = π/(ωn√(1 − ζ²)). The 2 % settling estimate ts ≈ 4/(ζωn) comes from the envelope e^(−ζωn t) dropping to e^(−4) ≈ 1.8 %. It is rough: good to roughly 10–20 % for light damping, poor near ζ = 1 and meaningless above it.
Spec to parameters
A spec 'OS ≤ 10 %, ts ≤ 2 s' becomes: ζ ≥ 0.59 (from the inverse formula) and ζωn ≥ 2 s⁻¹. Pick ζ = 0.6, then ωn ≥ 3.3 rad/s. Now you know what the closed loop must look like before you choose gains.
Derivation: Using the overshoot formula in both directions
For an underdamped second-order step response, the first peak is at tp = π/ωd with ωd = ωn√(1 − ζ²).
Substituting tp into x(t) = 1 − e^(−ζωn t)·(cos ωd t + (ζωn/ωd)·sin ωd t): cos(π) = −1 and sin(π) = 0, so x(tp) = 1 + e^(−ζωn·π/ωd).
So the fractional overshoot is OS = exp(−ζπ/√(1 − ζ²)). It depends only on ζ.
To invert, take logs: ln OS = −ζπ/√(1 − ζ²). Square and rearrange: ζ = −ln OS / √(π² + (ln OS)²).
Example: OS = 0.05 gives ln OS = −3.00 and ζ = 3.00/√(9.87 + 8.97) = 0.69. A '≤ 5 %' spec needs ζ ≥ 0.69.
Common mix-ups
Overshoot falls linearly with ζ.
✓ It is strongly nonlinear: from ζ = 0.2 to 0.4 overshoot halves; from 0.6 to 0.8 it falls by a factor of six.
Examples to try
Worked solutions are in the interactive chapter online.
Mass, spring, damper: ωn and ζ: example 1
A 0.5 kg mass on a 50 N/m spring. What c gives critical damping?
Under, critical, over: example 1
A gripper must close on an egg and never overshoot the target position. Should you choose ζ = 0.5 or ζ = 1.1?
Reading a step response like an engineer: example 1
A log shows: final value 1.00, first peak 1.12 at t = 0.8 s, inside 0.98–1.02 for good from t = 2.4 s, crossing 0.1 at 0.15 s and 0.9 at 0.45 s. Give the metrics.
From overshoot to ζ and back: example 1
A spec requires OS ≤ 20 % and peak time ≤ 0.5 s. Find the minimum ζ and the minimum ωn.
From overshoot to ζ and back: example 2
ζ = 0.5 and ωn = 4 rad/s. Predict overshoot, peak time and 2 % settling.
Interactive figures, in words
Figure 5.2 from “Mass, spring, damper: ωn and ζ”
Set ζ = 0.3. Now change m and k widely and watch the overshoot column: what stays fixed and what changes? Then hold m and k and change ζ.
The mass–spring–damper diagram has sliders for mass, stiffness and damping ratio and plots the step response with a table comparing formula predictions (natural frequency, overshoot, peak time, settling time) with the simulation. At ζ = 0.3 the overshoot stays at about 37 % whatever the mass and stiffness, while the peak time changes.
Laboratory (online)
These run in a browser on the full site. Simulations are simplified educational models.
- Equation Lab: Oscillator (Equation Lab exploration)
Find the damping that gives about 5% overshoot and compare it with the formula.
Open online - Simulation OS: Washing-machine spin cycle (Simulation OS experiment)
Pass through the drum's resonance with two damping settings and compare the peak shaking.
Open online
Practice questions
Questions only. Each one is answered in its Lite lesson online, where it is checked on our server.
1. m = 2 kg, k = 200 N/m. What is ωn in rad/s?
Answer: rad/s
Check it in “Mass, spring, damper: ωn and ζ”
2. Same system with c = 8 N·s/m. What is ζ?
Answer:
Check it in “Mass, spring, damper: ωn and ζ”
3. m = 1 kg, k = 16 N/m, c = 8 N·s/m. Which regime?
- Underdamped
- Critically damped
- Overdamped
- Undamped
Check it in “Under, critical, over”
4. Which damping ratio gives the fastest step response that never overshoots?
- ζ = 0.5
- ζ = 1
- ζ = 2
- ζ = 0
Check it in “Under, critical, over”
5. A step response settles at 4.0 and peaks at 4.6. What is the percent overshoot?
Answer: %
Check it in “Reading a step response like an engineer”
6. A response settles at 0.95 when the set point is 1.0. What does that tell you?
- It has 5 % overshoot
- It has a steady-state error of 0.05
- It hasn't settled yet
- Its rise time is 0.95 s
Check it in “Reading a step response like an engineer”
7. What is the percent overshoot for ζ = 0.5?
Answer: %
Check it in “From overshoot to ζ and back”
8. A step response peaks os = 8 % above its final value. Assuming a standard second-order system, what is its damping ratio ζ?
Answer:
Check it in “From overshoot to ζ and back”
Engineering applications
Car suspension
Car suspension is tuned to be underdamped but not by much: soft enough to absorb bumps, damped enough that the car does not bounce. Worn dampers let ζ fall and the car keeps bouncing after each bump.
Measuring instruments
Needle gauges and scales are designed close to critical damping so the reading arrives quickly without swinging past the true value.
Summary
- A mass–spring–damper has ωn = √(k/m) and ζ = c / (2√(km)).
- ζ < 1 underdamped (overshoot), ζ = 1 critically damped, ζ > 1 overdamped.
- Percentage overshoot depends only on ζ: 100·e^(−ζπ/√(1−ζ²)).
- Read overshoot, rise time, settling time and steady-state error from every step response.
Glossary
- Damping ratio
- The damping ratio ζ describes how quickly oscillations die out in a second-order system: below 1 it oscillates, exactly 1 is critically damped, above 1 it creeps to the target without overshoot.
- Overshoot
- Overshoot is how far a response goes past its final value, usually given as a percentage of the step size.
- Settling time and rise time
- Settling time is how long a response takes to enter and stay within a band, often 2 %, of its final value. Rise time is how long it takes to go from 10 % to 90 % of the step.
- Hooke's law (springs)
- For a spring within its elastic limit, the force needed to stretch or compress it is proportional to the change in length: F = k × x.
Project: A gripper that does not bounce
A robot gripper finger behaves like a mass on a spring with adjustable damping. Choose a damping ratio that closes it as fast as possible with no more than 2% overshoot, compute the damping coefficient for given mass and stiffness, and predict the settling time.
Deliverables
- The chosen ζ with the overshoot formula
- The damping coefficient calculation
- A predicted step response sketch with settling time
References
- Katsuhiko Ogata (2010). Modern Control Engineering, 5th edition. Prentice Hall.
- Norman S. Nise (2015). Control Systems Engineering, 7th edition. Wiley.
- Gene F. Franklin et al. (2015). Feedback Control of Dynamic Systems, 7th edition. Pearson.
6. Stability and poles
A stable system, nudged, settles back; an unstable one runs away. For linear systems the verdict is written in the poles, the eigenvalues of the state matrix. Poles in the left half of the complex plane decay, poles in the right half grow, and an imaginary part means oscillation. The slowest pole dominates how long settling takes. And a computer sampling too slowly can turn a stable loop unstable.
Figure 6.1. Where the poles sit decides the fate (described in words)
Poles on the complex plane with the stable left half shaded: a pole at -2 decays with time constant 0.5 s; a pair at -0.5 ± 2j rings while decaying with time constant 2 s; a pole at +0.3 grows, doubling every 2.31 s.
Explanation
6.1 Stable means bounded
A pencil balanced on its tip and a pencil lying flat both sit still. Only one of them is stable. What test tells them apart?
BIBO stability
A system is BIBO stable if every bounded input produces a bounded output. For linear systems this is the same as every natural mode decaying. A response that grows without limit after a small push, however slowly, is unstable.
Poles tell you
Each pole p of a linear system contributes e^(pt) to the response. Write p = σ + jω. If σ < 0 the mode decays, if σ > 0 it grows, and ω ≠ 0 makes it oscillate. So the test is simple: every pole in the left half-plane means stable.
Marginal cases
A pole exactly on the imaginary axis (σ = 0) neither grows nor decays: an undamped spring oscillates forever; a pure integrator holds its value. These are marginally stable: a bounded input at the right frequency can still make the output grow, so engineers treat them as not good enough.
Common mix-ups
If a system sits still, it is stable.
✓ Stability is about what happens after a disturbance. An inverted pencil can sit still and still be unstable.A slowly growing oscillation is 'nearly stable'.
✓ Any positive real part eventually dominates. Unstable is unstable.
6.2 Eigenvalues: stability from the A matrix
You have the A matrix of a robot joint but no time to simulate it. Can two numbers tell you whether it will settle?
Eigenvalues of a 2×2
For A = [[a, b], [c, d]] the eigenvalues solve λ² − (trace)·λ + det = 0, with trace = a + d and det = ad − bc. So λ = trace/2 ± √(trace²/4 − det). Complex when det > trace²/4.
Reading the result
Real part negative: that mode decays like e^(Re λ·t). Positive: grows. Imaginary part ω: oscillation at ω rad/s. For a 2×2 system, both real parts are negative exactly when trace < 0 and det > 0: a two-second stability check.
Linking back to ζ and ωn
For a mass–spring–damper, det = k/m = ωn² and trace = −c/m = −2ζωn. So the eigenvalues are −ζωn ± ωn√(ζ² − 1): the same poles as before. State-space and second-order thinking are one idea seen two ways.
Common mix-ups
If most eigenvalues are negative, the system is mostly stable.
✓ One eigenvalue with positive real part makes the whole system unstable.
6.3 When a computer makes a stable loop unstable
Proportional control of a heater can't go unstable on paper, however high the gain. Run it on a microcontroller and it oscillates wildly. Who is right?
Sample, compute, hold
A digital controller reads the sensor, computes a command and holds it until the next sample. Between samples the plant evolves open-loop. For a first-order plant this gives an exact recurrence: y[n+1] = a·y[n] + (1 − a)·K·u[n] with a = e^(−T/τ).
Overcorrection
With high gain, the held command pushes so hard that by the next sample the output has shot past the set point. The controller then pushes hard the other way. If each correction overshoots by more than the last error, the loop diverges. That is p = a − (1 − a)KKp < −1.
What helps
Sample faster (a → 1 and the limit grows), reduce the gain, or reduce delay. A common rule: sample 10–20 times per closed-loop time constant. The same mechanism explains why an Euler simulation with too big a step blows up (week 11).
Derivation: The gain limit of a sampled P loop
Plant τ·dy/dt + y = K·u. The controller samples y[n] every T seconds and holds u[n] = Kp·(r − y[n]) until the next sample.
With u constant over a period, the first-order solution gives exactly y[n+1] = a·y[n] + (1 − a)·K·u[n], with a = e^(−T/τ).
Substitute u[n]: y[n+1] = (a − (1 − a)·K·Kp)·y[n] + (1 − a)·K·Kp·r. The error is multiplied by p = a − (1 − a)·K·Kp each sample.
Stability needs |p| < 1. p < 1 always holds; p > −1 needs K·Kp < (1 + a)/(1 − a).
Example: τ = 1 s, T = 0.5 s, K = 1: a = 0.607, so Kp < 1.607/0.393 = 4.08. Halve T to 0.25 s: a = 0.779, Kp < 8.05.
Common mix-ups
If the continuous-time analysis says stable, the digital controller will be too.
✓ Sampling and delay can destabilise a loop the continuous model says is safe. Check the discrete model.More gain always means a faster, better response.
✓ In a sampled loop more gain eventually means overcorrection and instability.
6.4 From one second-order equation to two first-order ones
Computers can only take small steps forward. How do you step forward an equation that talks about acceleration?
Any order, first-order steps
An nth-order equation needs n initial conditions, so it has n states. Define x₁ = y, x₂ = ẏ, …, xₙ = y⁽ⁿ⁻¹⁾. Each state's derivative is the next state, except the last, which comes from the original equation.
The A and B matrices
For linear systems the right-hand sides are weighted sums, so they fit in matrices: dx/dt = A·x + B·u. A says how the states push on each other; B says how the input pushes on each state. The same code steps any system once you supply A and B.
Eigenvalues preview
Each eigenvalue λ of A gives a mode that behaves like e^(λt). Negative real part: decays. Positive: grows. Imaginary part: oscillates. You will use this in week 15; for now, notice that the phase-plane readout's eigenvalues change exactly when the picture changes shape.
Derivation: Mass–spring–damper in state-space form
Start from Newton's second law for a mass on a spring with a damper: m·ẍ = F − c·ẋ − k·x.
Choose states x₁ = x (position) and x₂ = ẋ (velocity). Then ẋ₁ = x₂ by definition.
Divide Newton's law by m: ẋ₂ = ẍ = −(k/m)·x₁ − (c/m)·x₂ + F/m.
Stack them: d/dt [x₁; x₂] = [[0, 1], [−k/m, −c/m]]·[x₁; x₂] + [0; 1/m]·F. That is dx/dt = A·x + B·u with u = F.
The eigenvalues of A solve λ² + (c/m)·λ + k/m = 0, the same characteristic equation as the original ODE: λ = −ζωn ± ωn√(ζ² − 1).
Common mix-ups
State-space form is a different model from the differential equation.
✓ It is the same model written differently. The characteristic polynomial, and so the behaviour, is identical.
Examples to try
Worked solutions are in the interactive chapter online.
Stable means bounded: example 1
Poles at −2, −0.5 ± 4j. Stable? Which mode lasts longest?
Eigenvalues: stability from the A matrix: example 1
m = 1, c = 2, k = 5. Find the eigenvalues, ζ and ωn.
When a computer makes a stable loop unstable: example 1
A heater has τ = 120 s and K = 0.5 °C per %. The controller runs every 10 s. What is the largest stable Kp?
From one second-order equation to two first-order ones: example 1
Write L·di/dt + R·i + q/C = V(t) with q the capacitor charge (i = dq/dt) in state-space form.
Interactive figures, in words
Figure 6.2 from “Stable means bounded”
Move σ from −3 to +1 with ω = 3. Note the σ where the response stops dying away. Then set ω = 0 and repeat. Describe in one sentence what σ controls and what ω controls.
The pole locator shows an s-plane with the right half shaded as unstable and a plot of e^(σt)·cos(ωt). With σ negative the oscillation dies away; at σ = 0 it keeps a constant size; with σ positive it grows. Raising ω makes the oscillation faster without changing whether it grows.
Figure 6.3 from “Eigenvalues: stability from the A matrix”
Use the eigenvalue readout. Set k = 5 and c = 2 and confirm −1 ± 2j. Then find settings that give two different negative real eigenvalues, and settings that give a pure imaginary pair. Sketch the phase-plane shape for each.
The phase-plane sketcher shows the eigenvalues of the mass–spring–damper. With k = 5 and c = 2 they read −1 ± 2j and the path spirals inwards. With heavy damping both are negative real numbers and the path slides in without circling. With c = 0 they are purely imaginary and the path is a closed loop.
Figure 6.4 from “When a computer makes a stable loop unstable”
With T = 0.5 s, raise Kp until the samples start to grow, and compare with the readout's limit. Then halve T and find the new limit. What is the limit as T gets very small?
The sampled-loop diagram plots the output only at sample times. With a modest gain the samples rise to a level just below the set point. Past the computed gain limit they alternate above and below with growing size. Shortening the sample period raises the limit.
Laboratory (online)
These run in a browser on the full site. Simulations are simplified educational models.
- Simulation OS: One robot joint (Simulation OS experiment)
Raise the gain until the joint oscillates without settling, and record that marginal gain.
Open online - Equation Lab: Matrices (Equation Lab exploration)
Find the eigenvalues of a 2 × 2 state matrix and predict whether the system decays, rings or grows.
Open online
Practice questions
Questions only. Each one is answered in its Lite lesson online, where it is checked on our server.
1. Which set of poles gives a stable system?
- −1, +0.5
- −2 ± 3j
- 0 ± 2j
- +1 ± j
Check it in “Stable means bounded”
2. Poles at −10 and −0.2. Which dominates the long-term response?
- −10, because it is bigger
- −0.2, because it decays more slowly
- Both equally
- Neither
Check it in “Stable means bounded”
3. An undamped mass on a spring is pushed at exactly its natural frequency. What happens?
- It settles
- The amplitude grows steadily: a bounded input gave an unbounded output
- Nothing
- It stops
Check it in “Stable means bounded”
4. A has trace −3 and determinant 2. Stable?
- Yes
- No
- Marginal
- Can't tell
Check it in “Eigenvalues: stability from the A matrix”
5. A = [[0, 1], [−10, −2]]. What is the size of the imaginary part of its eigenvalues (rad/s)?
Answer: rad/s
Check it in “Eigenvalues: stability from the A matrix”
6. τ = 1 s, K = 1, sampling period T = 0.5 s. What is the largest stable Kp? (Two decimal places.)
Answer:
Check it in “When a computer makes a stable loop unstable”
7. Your digital P loop oscillates. Which change is most likely to fix it without slowing the response?
- Sample faster
- Use a slower processor
- Add more sensor noise
- Increase the gain
Check it in “When a computer makes a stable loop unstable”
8. In A = [[0, 1], [−k/m, −c/m]], what does the entry −c/m in the bottom-right mean?
- How position affects velocity's rate
- How velocity affects its own rate of change: damping
- The input gain
- The spring stiffness
Check it in “From one second-order equation to two first-order ones”
Engineering applications
Self-balancing robots
An upright two-wheeled robot is unstable on its own: it has a pole in the right half-plane. Feedback moves that pole into the left half, which is why the robot falls the instant its controller stops.
Digital controllers
Every microcontroller loop adds delay. If the sample period is too long compared with the plant's dynamics, the loop that was stable on paper oscillates in hardware. Sampling well above the loop's bandwidth avoids this.
Summary
- Stable means a bounded input gives a bounded response and disturbances die away.
- Linear systems are stable when every pole has a negative real part.
- The real part sets the decay rate (τ = 1 / |Re|); the imaginary part sets the ringing frequency.
- Sampling adds delay, and too slow a sample rate can destabilise a loop.
Glossary
- Damping ratio
- The damping ratio ζ describes how quickly oscillations die out in a second-order system: below 1 it oscillates, exactly 1 is critically damped, above 1 it creeps to the target without overshoot.
- First-order system and time constant
- A first-order system responds to a step by approaching its new value exponentially; its time constant τ is the time to cover 63.2 % of the change.
- Matrix multiplication
- Multiplying matrices combines rows of the first with columns of the second: each entry of the result is a dot product of a row and a column.
Project: A stability map
For a mass–spring–damper written in state-space form, sweep the damping coefficient from negative to large positive values. Compute the eigenvalues at each step, plot them on the complex plane, and mark where the system changes from growing to ringing to creeping.
Deliverables
- The state matrix and eigenvalue code
- A plot of the pole paths
- The damping values at each change, explained
References
- Karl Johan Åström and Richard M. Murray (2008). Feedback Systems: An Introduction for Scientists and Engineers. Princeton University Press.
- Gene F. Franklin et al. (2015). Feedback Control of Dynamic Systems, 7th edition. Pearson.
- James Clerk Maxwell (1868). "On Governors". Proceedings of the Royal Society of London 16, 270–283.
7. PID control
Feedback with gain does two things to a first-order plant: it shrinks the steady error and it speeds the response, dividing the time constant by one plus the loop gain. On plants with more dynamics, though, gain also strips away damping. Integral action keeps pushing until the error is truly zero; derivative action looks at how fast the error changes and adds damping, while amplifying noise. Together they make PID.
Figure 7.1. τcl = τ / (1 + K·G) (described in words)
Two step responses: the open-loop plant with time constant 10 s, dashed, and the closed loop with K·G = 4, which responds with time constant 10 / (1 + 4) = 2 s and settles at 80% of the setpoint.
Explanation
7.1 Why P control never quite arrives
A cruise control set to 100 km/h settles at 96 km/h on a hill and stays there. Is it broken?
Error is the fuel
A P controller's command is proportional to the error. To hold a heater on, or a motor pushing uphill, it needs a steady command, so it needs a steady error. The loop settles at the point where the error is just big enough to produce the command that balances the plant.
The formula
For a plant with static gain K: e∞ = r/(1 + K·Kp). Loop gain KKp = 9 leaves 10 % error; 99 leaves 1 %. Raising the gain helps, but in real systems high gain amplifies noise, saturates actuators and, with any delay, threatens stability.
Disturbances too
A constant load (a hill, a heavier passenger, a draught) acts like an extra input. P control fights it but only by holding an error: the load's effect is divided by 1 + KKp, not removed. That is the lift's levelling error with a full cabin under P control.
Derivation: Steady-state error of P control
Plant τ·dy/dt + y = K·u. Controller u = Kp·e with e = r − y.
At steady state nothing changes, so dy/dt = 0 and y∞ = K·u∞ = K·Kp·(r − y∞).
Solve for y∞: y∞·(1 + K·Kp) = K·Kp·r, so y∞ = r·K·Kp/(1 + K·Kp).
Error e∞ = r − y∞ = r/(1 + K·Kp). It shrinks as K·Kp grows but is never zero for finite gain.
With a constant input disturbance d (u + d enters the plant), y∞ = (K·Kp·r + K·d)/(1 + K·Kp): the disturbance also leaves an error of −K·d/(1 + K·Kp).
Common mix-ups
A steady-state error means the controller is badly tuned.
✓ It is a structural property of P control on a plant without an integrator. Only very high gain shrinks it; integral action removes it.
7.2 Feedback makes it faster
The heater is slow: τ = 10 minutes. A P controller makes the room reach its (slightly low) target in 1 minute. Where did the speed come from?
Same shape, faster clock
A P loop around a first-order plant is first-order again, but with τcl = τ/(1 + KKp). Loop gain 9 makes it ten times faster. The shape is the same exponential; only the timescale and the final value change.
Speed is bought with effort
At the instant of a step, the error is the whole step, so u(0) = Kp·r. Making the loop ten times faster means asking for roughly ten times the steady effort at the start. Real heaters, motors and valves have limits.
When the actuator saturates
If Kp·r exceeds the actuator's limit, the command is clipped and the plant just runs flat out: the response is set by the limit, not by τcl. The formula only applies while the loop stays linear. Check u(0) against the limit before trusting it.
Derivation: Closed-loop time constant with P control
Plant τ·dy/dt + y = K·u with u = Kp·(r − y).
Substitute: τ·dy/dt + y = K·Kp·r − K·Kp·y.
Collect y: τ·dy/dt + (1 + K·Kp)·y = K·Kp·r.
Divide by (1 + K·Kp): (τ/(1 + KKp))·dy/dt + y = (KKp/(1 + KKp))·r.
This is first-order again, with τcl = τ/(1 + K·Kp) and gain KKp/(1 + KKp) (giving the steady error from the last lesson).
Effort at t = 0: u(0) = Kp·r. Ten times faster with KKp = 9 needs an initial command Kp·r, roughly ten times the final effort. If the actuator saturates, the formula no longer holds.
Common mix-ups
Feedback can make any plant arbitrarily fast.
✓ Only up to the actuator's limits, the sensor's noise and the loop's delays. Past those, the formula fails.
7.3 More gain, less damping
On a first-order plant, cranking up P gain only helps. On a robot joint with inertia, it makes it shake. What's different?
The algebra
Plant τ²ÿ + 2ζτẏ + y = K·u with u = Kp·(r − y) gives τ²ÿ + 2ζτẏ + (1 + KKp)·y = KKp·r. Matching to the standard form: ωn,cl = √(1 + KKp)/τ and ζcl = ζ/√(1 + KKp). The stiffness went up; the damping didn't.
What it feels like
Raising Kp is like fitting a stiffer spring to the joint: it springs back faster and harder, so it overshoots. The steady error still falls as 1/(1 + KKp). You trade accuracy against wobble.
Derivative action is extra damping
A D term adds a force proportional to velocity: exactly what a physical damper does. With u = Kp·e − Kd·ẏ, the ẏ coefficient grows from 2ζτ to 2ζτ + K·Kd, raising ζcl back up. That's why motion controllers are almost always PD or PID.
Common mix-ups
If P control overshoots, the gain is too high, full stop.
✓ Lowering gain is one fix; adding damping (D) keeps the speed and accuracy while removing the overshoot.
7.4 I removes the error, D adds the damping
P gets you close. Which two extra terms get you exactly there, smoothly, and what does each cost?
Integral: memory of past error
u = Kp·e + Ki·∫e dt. The integral keeps adding up error, so the command keeps changing until e = 0. At steady state the integral alone supplies the command the plant needs. That is why PI removes steady-state error for steps and constant loads.
Derivative: brakes before the target
Kd·de/dt reacts to how fast the error is shrinking. As the output races towards the set point, D pushes back, like a damper. Many implementations differentiate the measurement, not the error, to avoid a 'kick' when the set point jumps.
The costs
Too much I: slow wobbles and overshoot, and windup when the actuator saturates (next lesson). Too much D: it amplifies sensor noise, because noise changes fast. Real D terms include a low-pass filter. P sets the basic stiffness; I and D trim accuracy and damping.
Common mix-ups
PID always needs all three terms.
✓ Many loops work best as PI (noisy, slow processes) or PD (when a plant already integrates, like position from velocity).
7.5 What I and D buy, and what they cost
Integral action wipes out the lift's levelling error. So why do engineers sometimes switch it off while the lift is moving?
Integral: memory of past error
The integral term adds up error over time. As long as any error remains, it keeps growing and keeps pushing, so it can supply the steady push P needed error for. Result: zero steady-state error to a step or a constant load. Cost: stored push takes time to unwind, so it tends to add overshoot and slow oscillation.
Derivative: a brake on fast change
The derivative term reacts to how fast the output is changing and pushes against rapid movement, like a shock absorber. It adds damping, reducing overshoot and ringing. Cost: differentiating a noisy signal amplifies the noise, so real controllers filter the derivative and often take it from the measurement rather than the error.
Windup
When the actuator saturates (full power), the error stays large and an unprotected integral grows far beyond anything useful. On arrival it overshoots badly. Anti-windup (for example, stopping integration while saturated) prevents this. Always check integral control with realistic actuator limits.
Common mix-ups
PID is always better than P.
✓ Each extra term adds tuning effort and risks (overshoot, noise, windup). P is fine when its steady-state error is within spec.
Examples to try
Worked solutions are in the interactive chapter online.
Why P control never quite arrives: example 1
A heater loop has K = 0.5 °C per % power and Kp = 18 %/°C. Set point 60 °C above ambient. Steady error?
Feedback makes it faster: example 1
τ = 20 s, K = 2. Required τcl = 2 s. What Kp, and what initial command for a step of r = 5 if the actuator limit is ±40?
More gain, less damping: example 1
Plant ζ = 0.8, K = 1. Which Kp gives ζcl = 0.4?
I removes the error, D adds the damping: example 1
PI controller, Kp = 2, Ki = 1, plant K = 1. At steady state with set point 1, what is the integral value?
What I and D buy, and what they cost: example 1
A P-only lift stops 12 mm short at 450 kg. With PI it reaches the floor but overshoots by 6 mm before settling. Which term caused each behaviour?
Interactive figures, in words
Figure 7.2 from “Why P control never quite arrives”
Set K = 1 and Kp = 3, then read the steady-state error. Increase Kp to 9, then 29. Write e∞ each time and check it against r/(1 + KKp). What would it take to make the error zero?
The P-control explorer shows the closed-loop response settling below the set point. With loop gain 3 it settles at 0.75 (25 % error); with 9 at 0.9; with 29 at about 0.97. The error shrinks with gain but never reaches zero.
Figure 7.3 from “More gain, less damping”
Choose P, actuator limit None. Raise Kp from 1 to 15 and note the overshoot. The plant has ζ = 0.7 and K = 1: predict each overshoot from ζ/√(1 + Kp) before reading it.
In the PID tuner with P control and no actuator limit, Kp = 1 gives a small overshoot. As Kp rises to 15, the response rises faster, settles closer to the set point and overshoots more, with visible ringing.
Laboratory (online)
These run in a browser on the full site. Simulations are simplified educational models.
- Simulation OS: PID step response (Simulation OS experiment)
Add integral action to a P controller and show the steady-state error disappear; then add derivative action and measure the overshoot.
Open online - Simulation OS: One robot joint (Simulation OS experiment)
Compare P, PD and PID on the same joint step and tabulate overshoot and settling time.
Open online
Practice questions
Questions only. Each one is answered in its Lite lesson online, where it is checked on our server.
1. K = 2, Kp = 4, r = 10. What is the steady-state error?
Answer:
Check it in “Why P control never quite arrives”
2. K = 1. What is the smallest Kp that keeps the P-only steady-state error at or below 1 % of the set point?
Answer:
Check it in “Why P control never quite arrives”
3. τ = 6 s, K = 0.5, Kp = 10. What is τcl in seconds?
Answer: s
Check it in “Feedback makes it faster”
4. τ = 12 s, K = 1. What Kp gives τcl = 1.5 s?
Answer:
Check it in “Feedback makes it faster”
5. A second-order plant has ζ = 0.9 and K = 1. With Kp = 8, what is ζcl?
Answer:
Check it in “More gain, less damping”
6. What does integral action remove that P alone cannot?
- Overshoot
- Steady-state error to a step or constant load
- Sensor noise
- Saturation
Check it in “I removes the error, D adds the damping”
7. Why do many PID implementations differentiate the measurement instead of the error?
- It's cheaper
- A step in set point makes de/dt huge for one sample, giving a 'derivative kick'; the measurement doesn't jump
- The error can't be differentiated
- Tradition
Check it in “I removes the error, D adds the damping”
8. Why is derivative action often filtered?
- It is too slow
- Differentiating noise produces large, jumpy commands
- It removes steady-state error too well
Check it in “What I and D buy, and what they cost”
Engineering applications
Drones
A quadcopter's attitude loops are PID controllers running hundreds of times a second. Derivative action damps the wobble, and integral action trims out an off-centre battery or a steady breeze.
Derivative on measurement
Taking the derivative of the error makes the controller kick violently when the setpoint jumps. Taking the derivative of the measurement instead gives the same damping without the kick.
Summary
- P control on a first-order plant gives τcl = τ / (1 + K·G) and steady error 1 / (1 + K·G).
- On second-order plants more gain lowers damping, so overshoot grows.
- Integral action drives the steady error to zero; derivative action adds damping but amplifies noise.
- Use derivative on the measurement to avoid kicks when the setpoint changes.
Glossary
- PID controller
- A PID controller adds proportional, integral and derivative actions: present error, accumulated past error and predicted future error.
- Integral action
- Integral action adds a term proportional to the error accumulated over time, so any persistent error keeps growing the command until the error is gone.
- Derivative action
- Derivative action adds a term proportional to how fast the error (or measurement) is changing, braking the response before it overshoots.
- Proportional control
- A proportional controller sets the command to a gain times the error: u = Kp × e. Bigger errors get bigger corrections.
- Steady-state error
- Steady-state error is the error that remains after the response has settled and stopped changing.
Project: P, PI, PID on one plant
Simulate a first-order plant with τ = 10 s and a small delay. Design a P, a PI and a PID controller, run the same step and the same load disturbance for each, and tabulate steady error, overshoot and settling time. Explain each difference using the ideas in this chapter.
Deliverables
- The simulation with all three controllers
- A table of metrics for step and disturbance
- An explanation of every trade-off you observed
References
- Karl Johan Åström and Tore Hägglund (2006). Advanced PID Control. ISA – The Instrumentation, Systems, and Automation Society.
- Karl Johan Åström and Richard M. Murray (2008). Feedback Systems: An Introduction for Scientists and Engineers. Princeton University Press.
- J. G. Ziegler and N. B. Nichols (1942). "Optimum Settings for Automatic Controllers". Transactions of the American Society of Mechanical Engineers 64, 759–768.
8. Tuning, saturation and fair evidence
Real controllers meet real limits. Motors max out, valves open only so far, and while an actuator is saturated the integral keeps accumulating error it cannot act on, then releases it as a big overshoot: windup. Tuning means writing the spec first, adjusting one thing at a time and logging every run. And claiming that one controller is better means a fair comparison: same tests, same loads, a baseline, and every trade-off reported.
Figure 8.1. Saturation lets the integral run away (described in words)
Integrator windup: while the actuator is at its limit for 4 s with an error of 5, the integral climbs to 20. With Ki = 0.5 that is 10 units of stored push that must unwind before the controller recovers.
Explanation
8.1 Tuning to a written spec
Two engineers tune the same motor. One takes 10 minutes, one takes an afternoon. Both meet the spec. What did the first one do differently?
A procedure
- I and D off. Raise Kp until the response is quick with modest overshoot. 2. Add Kd until overshoot meets the spec. 3. Add Ki until steady-state error is gone within the settling limit. 4. Re-check every line of the spec, because each change affects the others.
A tuning log
One row per test: gains, conditions (set point, load, noise), and every metric in the spec. Change one gain at a time. A log lets a teammate reproduce your result, shows why you stopped, and catches the moment something got worse.
When the spec can't be met
Sometimes no gains meet everything: the actuator can't push hard enough, noise rules out much D, or delay limits the gain. Then the honest result is 'not achievable with this hardware', with the evidence, and a proposal: faster sensor, bigger motor, or a relaxed spec.
Common mix-ups
Once it passes the spec once, tuning is done.
✓ Check it again under other conditions (load, noise, set points) the spec covers. One passing run is not a design.
8.2 Hitting the wall: saturation and windup
A robot arm is held still for two seconds, then released. It flies past its target. The controller was perfect in simulation. What did the simulation forget?
Saturation opens the loop
A motor driver can't exceed its supply voltage; a heater can't exceed full power. When the controller asks for more, the actuator delivers its maximum. While saturated, changing the command changes nothing: the loop is effectively open, and the plant just runs flat out.
Windup
The integral doesn't know the actuator is saturated, so it keeps adding error. By the time the output reaches the set point the integral is far too large, and it takes a long period of negative error (overshoot) to unwind it. Bigger Ki and longer saturation mean worse windup.
Anti-windup
Conditional integration: stop integrating while the actuator is saturated and the error would push it further. Back-calculation: bleed the integral back in proportion to the difference between requested and actual command. Clamping: cap the integral. All three keep I useful without the overshoot.
Common mix-ups
If it works without limits in simulation, it will work on hardware.
✓ Simulate with the real actuator limits. Windup only appears when saturation is modelled.
8.3 A fair fight between controllers
A report says 'PID beat PI by 40 %'. Before you believe it, what three questions should you ask?
Decide before you test
Write the specification (metrics, limits, conventions) and the protocol (set point, loads, noise, number of runs, duration) before the first run. Otherwise it is too easy to pick the metric that makes your favourite look good.
Match everything except the controller
Same plant parameters, same actuator limits, same disturbance at the same time, same noise seed or the same set of seeds, same simulation step. P is the natural baseline: it shows how much I and D actually add.
Tune each fairly, too
Comparing a carefully tuned PID with a carelessly tuned PI tests your effort, not the controller. Give each the same tuning method and budget, and report how you tuned. The scoreboard's gains came from one coarse grid search per controller, stated in its note.
Common mix-ups
The controller with the best single number is the best controller.
✓ Judge against the whole pre-written spec under matched conditions. A controller can win one metric and fail the spec.
8.4 Writing up the trade-offs
Your PID passes every check. Your teammate's PI is 1 s slower but uses half the peak motor current. Who wins, and how would you write it?
Structure
Question → specification and protocol (written before testing) → results table (every controller, every load, every metric) → explanation → limitations → recommendation. Keep the table complete even where your preferred option loses.
Explain with the models
Link each observation to this term's theory: 'P leaves 29 mm at 600 kg, as e = Δm·g/Kp predicts'; 'PID overshoots less because D raises ζ'; 'PI is slower because, held to the overshoot limit, its ζ forces a low ωn'. A result you can explain is far more convincing than one you can only show.
Trade-offs and honest limits
When no option wins everything, say what each costs: speed, effort, sensitivity to noise, complexity. State the model's simplifications and that results are simulated. Recommend for a stated priority: 'if motor current is the constraint, choose PI'.
Common mix-ups
A recommendation should always name one winner.
✓ Often the honest recommendation depends on a stated priority: 'choose X if speed matters most, Y if energy does'.
Examples to try
Worked solutions are in the interactive chapter online.
Tuning to a written spec: example 1
Log excerpt: Kp 2 → OS 0 %, ts 2.1 s; Kp 5 → OS 18 %, ts 1.6 s; Kp 5, Kd 0.2 → OS 6 %, ts 0.9 s; but e∞ = 0.04. Next step?
Hitting the wall: saturation and windup: example 1
A heater is at full power for 60 s while the error averages 10 °C, and Ki = 0.05 %/(°C·s). How much has the integral term added to the command?
A fair fight between controllers: example 1
Three runs of PI give settling times 2.1, 2.4, 2.7 s; three of PID give 1.9, 2.0, 2.4 s, with different noise seeds per run. Is PID faster?
Writing up the trade-offs: example 1
Rewrite 'PID was way better' as a reportable result.
Interactive figures, in words
Figure 8.2 from “Hitting the wall: saturation and windup”
Choose PI, Kp = 4, Ki = 6, actuator limit ±1.5, anti-windup off. Note the overshoot and settling. Tick anti-windup and compare. Then try limit None: which run is the fair 'ideal' reference?
With a PI controller and an actuator limit of plus or minus 1.5, the effort plot sits on the limit at the start. Without anti-windup, the output overshoots by about 40 % and settles slowly. With anti-windup on, the same gains overshoot by only a few per cent.
Figure 8.3 from “A fair fight between controllers”
Investigation: with 'Matched' conditions, record which controllers pass and why each failure happens. Then switch to 'Unfair' and record how PID's row changes. Write one sentence on what a reader of the unfair table would wrongly conclude.
The scoreboard table lists overshoot, settling time, final error, peak effort and pass or fail for P, PI and PID on the same plant. Under matched conditions P fails on final error, PI fails on settling time and PID passes. Under the unfair setting, PID is tested with no load or noise and its row looks better for reasons unrelated to the controller.
Laboratory (online)
These run in a browser on the full site. Simulations are simplified educational models.
- Simulation OS: Lift trip and levelling (Simulation OS experiment)
Tune the drive so the cabin stops level with the floor for an empty and a full cabin.
Open online - BUILD: Elevator, level 4 (BUILD level)
Test your controller with every load and report the worst-case levelling error.
Open online - Nexus: Computer-Controlled Machine (Nexus project)
Compare two controller settings on the same tests and report the trade-offs honestly.
Open online
Practice questions
Questions only. Each one is answered in its Lite lesson online, where it is checked on our server.
1. You've set Kp. Overshoot is 18 % and the spec is 10 %. What next in the procedure?
- Add Ki
- Add Kd
- Lower Kp to zero
- Change the plant
Check it in “Tuning to a written spec”
2. You can't get settling under 1 s without the motor hitting its current limit. What is the right report?
- Hide the limit and report the best run
- State the spec is not achievable with this actuator, show the evidence, and propose options
- Raise the gains until it passes in simulation without limits
- Change the spec quietly
Check it in “Tuning to a written spec”
3. What causes integrator windup?
- Too much derivative gain
- The integral accumulating error while the actuator is saturated and can't respond
- Sensor noise
- Sampling too fast
Check it in “Hitting the wall: saturation and windup”
4. Which change directly prevents windup?
- Raise Ki
- Stop integrating while saturated (conditional integration)
- Remove the actuator limit in simulation
- Add more D
Check it in “Hitting the wall: saturation and windup”
5. An actuator is saturated for 4 s while the error is constant at 0.5. With Ki = 3, by how much does the integral term Ki·∫e grow?
Answer:
Check it in “Hitting the wall: saturation and windup”
6. Which is a matched condition for a controller comparison?
- Each controller gets its own random noise
- All controllers face the same load step at the same time with the same noise seed
- The best controller gets the hardest test
- Each is tested on a different day's plant model
Check it in “A fair fight between controllers”
7. Why include a P-only controller in the comparison?
- Because it usually wins
- As a baseline: it shows how much the I and D terms actually add
- It is required by law
- To make the table longer
Check it in “A fair fight between controllers”
8. Which is a genuine limitation of a simulation-only controller comparison?
- The tables are long
- Real hardware adds friction, delay, noise and nonlinearities the model omits, so rankings may change
- Simulations are always wrong
- There were three controllers
Check it in “Writing up the trade-offs”
Engineering applications
Anti-windup in industry
Industrial PID controllers stop integrating while the output is saturated, or bleed the integral back when it is. Without that, a heater that hits full power during start-up overshoots badly once it catches up.
Honest comparisons
A controller tuned on one test can look brilliant and fail on the next. Engineers test every controller on the same set of loads and disturbances, and report where each one loses as well as where it wins.
Summary
- Write the spec (overshoot, settling time, steady error) before tuning, then adjust one gain at a time.
- Saturation plus integral action causes windup; clamp or pause the integrator while saturated.
- Some specs are impossible together; say so rather than hide a failure.
- Compare controllers on matched tests against a baseline, and report every trade-off.
Glossary
- Integrator windup
- Windup happens when the actuator is saturated but the integral term keeps growing; once the error reverses, the oversized integral causes a large overshoot while it unwinds.
- PID controller
- A PID controller adds proportional, integral and derivative actions: present error, accumulated past error and predicted future error.
- Overshoot
- Overshoot is how far a response goes past its final value, usually given as a percentage of the step size.
- Settling time and rise time
- Settling time is how long a response takes to enter and stay within a band, often 2 %, of its final value. Rise time is how long it takes to go from 10 % to 90 % of the step.
- Baselines and control conditions
- A baseline is the reference condition a new idea is compared with, such as the existing design or a simple method, tested in the same way.
Project: A fair controller shoot-out
Choose a simulated plant with a saturating actuator. Write a spec, tune a PID controller with and without anti-windup, and compare them with a simple P baseline across at least three loads and a setpoint change. Report a full results table and one honest limitation.
Deliverables
- The written spec
- A results table for every controller, load and test
- A conclusion that names a trade-off and a limitation
References
- Karl Johan Åström and Tore Hägglund (2006). Advanced PID Control. ISA – The Instrumentation, Systems, and Automation Society.
- Gene F. Franklin et al. (2015). Feedback Control of Dynamic Systems, 7th edition. Pearson.
- J. G. Ziegler and N. B. Nichols (1942). "Optimum Settings for Automatic Controllers". Transactions of the American Society of Mechanical Engineers 64, 759–768.
Known limitations
- Not yet tested by a person using a screen reader; only automated structure checks have run.
- Some interactive lesson diagrams need a pointer or keyboard and a recent browser; their text alternatives carry the same idea without the interaction.
- Mathematics is written as plain text (for example x^2 and sqrt(x)), like the School lessons, not typeset notation.