Control and systems: feedback, stability and how machines are made to behave: Stability, delay and hunting: how a loop goes wrong
All courses / Understanding Engineering / Module 11: Control and systems: feedback, stability and how machines are made to behave Part 4 of 5Stability, delay and hunting: how a loop goes wrong
Every driver has seen it: a cruise control that surges, a shower that swings from scalding to freezing, a lamp that pulses on a weak supply. The cause is rarely a broken part. It is a loop whose corrections arrive too strongly or too late. This part explains why, works two cases with real delays, a shower pipe and a national grid, and ends with the trick of acting before the error appears.
4.1 A loop turns unstable when its correction is too strong or too late, and then it hunts
A loop is stable if, after a disturbance, the variable settles back to its target. It is unstable if the swings grow. Overshoot is passing the target before returning, and oscillation is swinging several times. Hunting is oscillation that does not die out.
Think of each correction as an echo of the error that caused it. If the echo is smaller than the error and opposes it, errors shrink step by step. If the echo is as big as the error, the swing repeats forever. If it is bigger, each swing exceeds the last until the actuator hits a limit. The strength of the echo is the loop gain: how much correction the controller applies per unit of error, multiplied by how strongly the process responds to that correction.
Delay is what turns a helpful correction into a harmful one. If the echo arrives half a swing late, it pushes in the same direction as the error and feeds it. So the safe gain falls as delay grows. The table counts this out for a loop in which each correction is based on the measurement from one step earlier. In it, a gain of 0.25 settles smoothly. A gain of 1 swings for ever with the size it began with. A gain of 1.5 grows without limit.
Engineers do not run a loop at the edge. A common rule of thumb is to keep the gain at about half the value that would just sustain an oscillation, which leaves a gain margin of two. This costs speed, and that is the trade-off: fast response against a margin for drift and the unexpected. A loop tuned to the edge on a test day will hunt on a hot day, when the process responds more strongly.
| Gain | Error at steps 0, 1, 2... 8 | Behaviour |
|---|---|---|
| 0.25 | 10, 10, 7.5, 5.0, 3.1, 1.9, 1.1, 0.6, 0.35 | settles smoothly |
| 1.0 | 10, 10, 0, -10, -10, 0, 10, 10, 0 | swings for ever, six steps per cycle |
| 1.5 | 10, 10, -5, -20, -12.5, 17.5, 36, 10, -44 | swings grow |
Rule used: new error = old error - gain x error one step earlier. Every value is calculated. Redo it on paper with a gain of 0.5 and 0.9 to see the swings grow longer-lived as the gain approaches 1.
- Vincenti, What Engineers Know and How They Know It (Johns Hopkins University Press, 1990) · ch. 3, 'Establishment of Design Requirements: Flying-Quality Specifications for American Aircraft, 1918-1943', static and dynamic stability
- Åström and Murray, Feedback Systems: An Introduction for Scientists and Engineers (Princeton University Press, 2008) · ch. 10, 'PID Control', https://www.cds.caltech.edu/~murray/amwiki/PID_Control.html, Ziegler-Nichols tuning from the gain at which a loop just oscillates
- Bloomfield, How Things Work (Wiley, 2015) · ch. 9, 'Resonance and Mechanical Waves', section 9.1, 'Clocks', harmonic oscillators
- Feynman, Leighton and Sands, The Feynman Lectures on Physics, vol. I (Caltech online edition) · further reading: ch. 24, 'Transients', https://www.feynmanlectures.caltech.edu/I_24.html
- Feynman, Leighton and Sands, The Feynman Lectures on Physics, vol. I (Caltech online edition) · further reading: ch. 23, 'Resonance', https://www.feynmanlectures.caltech.edu/I_23.html
4.2 Delay is what makes loops hard: a shower at the end of a long pipe is a loop with a built-in wait
You turn the hot tap, nothing changes, so you turn it more. A few seconds later the water scalds, you turn it back, and then it runs cold. You are the controller: skin is the sensor, comfort the set point, wrist the actuator. The water you feel now was set by the tap many seconds ago, so you cannot see the effect of what you have already done, and you keep correcting.
The delay is just the time water needs to travel from the mixing point to the shower head. It is a transport delay, also called dead time, and it equals pipe volume divided by flow. The table puts numbers on it.
Inside a delayed loop, correct in small steps and wait at least one delay before judging. A person who keeps turning the tap for as long as the water feels wrong is acting like the integral controller of Part 3, and such a loop, pushed too hard, swings with a period of about four times the delay, which is why the swings in the table last over a minute. The fixes are the ones plant engineers use: shorten the delay by putting sensor and mixing point near the head, as a thermostatic mixer valve does; lower the gain; or predict with a model of the delay. The vessels in Matter at the atomic scale: bonds, reactions and process engineering are full of such delays, so process loops are tuned slowly and carefully. Delay also hides in a controller's scan, a heater's warm-up and a signal crossing a network. Cutting delay is often worth more than any clever tuning.
| Case | Working | Result |
|---|---|---|
| Pipe volume, 15 m of half-inch pipe (12.7 mm inside) | pi/4 x (0.0127 m)2 x 15 m = 0.0019 m3 | 1.9 L |
| Delay at a weak 6 L/min flow | 1.9 L / (0.1 L/s) | 19 s |
| Delay at 12 L/min | 1.9 L / (0.2 L/s) | 9.5 s |
| Hunting period for a user who keeps turning until it feels right | about 4 x 19 s | about 76 s |
| Thermostatic mixer 1 m from the head | 0.127 L / (0.1 L/s) | 1.3 s |
The 12.7 mm bore is an assumed nominal half-inch pipe; every result is calculated. Check: the usual feeling that a hot-water pipe takes ten to thirty seconds to run through is the right order.
Source: Bloomfield, How Things Work (Wiley, 2015), ch. 5, 'Fluids', section 5.2, 'Water Distribution', steady-state flow- Bloomfield, How Things Work (Wiley, 2015) · ch. 5, 'Fluids', section 5.2, 'Water Distribution', steady-state flow
- Åström and Murray, Feedback Systems: An Introduction for Scientists and Engineers (Princeton University Press, 2008) · ch. 10, 'PID Control', https://www.cds.caltech.edu/~murray/amwiki/PID_Control.html
4.3 Grid frequency is a loop with a whole country inside it, and the spinning machines are the first line of defence
Alternating-current power from Electricity and magnetism: circuits, motors, generators and grids is made by generators that all spin in step. If a country produces more than it uses, the surplus energy speeds those machines up and the frequency rises. If it produces less, they slow down and the frequency falls. Frequency is therefore the grid's level gauge, like the level in the tank, and holding it at 50 Hz is the job of nested loops with different speeds.
The first defence is physical. Heavy rotors store energy as spin, so a shortfall is covered at once by slowing slightly. The rate of fall equals the frequency times the lost power, divided by twice the stored energy. The table works it for a power station tripping.
On a falling frequency, the second defence is governors. Each generating unit with a governor raises its output by a share set by its droop. This is the droop of Part 1 used on purpose, so that hundreds of units can share a disturbance without a referee. Thermal units respond over several seconds to tens of seconds, because they must draw on steam held in the boiler; India's grid code sets their droop at 3 to 6 per cent and asks for the full primary response within 45 seconds. Hydro units can respond faster, though the water column in the pipe first pushes the wrong way, and a gate that opens can briefly cut output. Next comes secondary control by computers and operators over minutes, then reserves and, increasingly, batteries, Pumped hydro storage and Demand response and vehicle-to-grid.
The trade-off of the transition: solar and wind plants connect through electronics and spin no heavy rotor, so a grid with more of them has less inertia in the hours they dominate. It falls faster, and the fast defences must act sooner. Grid operators now buy fast frequency response as a service for this reason.
| Quantity | Working | Result |
|---|---|---|
| Demand and connected spinning machines | record demand was 270.82 GW in May 2026, but part of a daytime peak comes from solar and wind, which spin no heavy rotor; assume 250 GW of synchronised machines | S = 250 GW (assumed) |
| Energy stored in rotation, inertia constant 5 s | 5 s x 250 GW | 1,250 GJ (GW s) |
| Loss of 1.5 GW (one large station section) | assumed trip | 0.6 per cent of S |
| Initial rate of frequency fall | 50 Hz x 1.5 GW / (2 x 5 s x 250 GW) | 0.03 Hz per second |
| Time to fall from 50.00 to the 49.90 Hz band edge, with no response | 0.10 / 0.03 | about 3 s |
| Same event with a low-inertia hour (inertia constant 2.5 s) | 50 x 1.5 / (2 x 2.5 x 250) | 0.06 Hz per second; band edge reached in under 2 s |
| Settled drop if units with 5 per cent droop (the code allows 3 to 6 per cent) all share the loss | 50 Hz x 0.05 x 0.006 | 0.015 Hz; about four times that if only a quarter respond |
Assumed: 250 GW of synchronised machines, an inertia constant of 5 s (Grid-India's measurements from 2014 to 2021 put the all-India value between 5 and 9 s), and the share of units with responsive governors. Every result is calculated. Check: Grid-India reports an event in which 780 MW was lost and frequency at first fell at about 0.017 Hz per second, which implies about 50 x 0.78 / (2 x 0.0167) = 1,170 GJ stored (calculated), close to the 1,250 GJ used here.
Source: Grid Controller of India (Grid-India), inertia and frequency response in the Indian grid, NASPI Work Group Meeting (April 2023), https://www.naspi.org/sites/default/files/2023-04/D2_S12_02_reddy_india_20230405.pdf; Ministry of Power, as reported by All India Radio News: record peak demand of 270.82 GW (22 May 2026), https://newsonair.gov.in/government-says-indias-electricity-demand-hits-record-270-82-gigawatts-amid-soaring-temperatures/- Bloomfield, How Things Work (Wiley, 2015) · ch. 11, 'Magnetism and Electrodynamics', section 11.2, 'Electric Power Distribution', AC generators
- Central Electricity Regulatory Commission, CERC (Indian Electricity Grid Code) Regulations, 2023 (notified 29 May 2023) · Regulation 30(1) reference frequency and band; 30(9) minimum inertia; 30(10) droop and primary response, https://www.cercind.gov.in/Regulations/180-Regulations.pdf
- Central Electricity Regulatory Commission, Order in Suo Motu Petition No. 2/SM/2025 (29 March 2025), citing Grid-India's report of 17 September 2024 on high-frequency operation · web
- Grid Controller of India (Grid-India), inertia and frequency response in the Indian grid, NASPI Work Group Meeting (April 2023) · web
- Ministry of Power, as reported by All India Radio News: record peak demand of 270.82 GW (22 May 2026) · web
4.4 Feedforward acts on the disturbance before it shows in the result, and feedback cleans up what is left
Feedback must wait for an error to appear. If you can measure the disturbance itself, you can act before any error arrives. This is feedforward: a rule that says, when this input changes, adjust the output by that amount at once. It does not wait for the result and does not go round a loop, so it cannot make the system unstable by itself.
An instant electric geyser shows it. The heater must deliver power equal to the flow of water times its specific heat times the temperature rise. At 6 L/min (0.1 kg/s) raised from 25 to 40 degrees C, that is 0.1 x 4,186 x 15, or 6.3 kW. If the flow doubles, the need doubles to 12.6 kW. A feedback-only unit would wait for cold water to reach the outlet sensor, then correct, and the user would feel a cold surge. A unit with a flow sensor sets the power from the flow immediately, and a feedback trim from the outlet thermometer fixes whatever the rule missed, such as colder inlet water or a worn element.
The pairing is the common pattern. A car's engine computer sets fuel from airflow and pedal at once, and an oxygen sensor in the exhaust trims it, which keeps the Catalytic converter in its narrow working window. A boiler adds feed water the moment steam demand rises, not after the drum level has fallen.
The trade-off is knowledge against robustness. Feedforward is fast, but it depends on a good model of how the disturbance acts, and it cannot correct what is not measured. Feedback needs no model of the disturbance and fixes anything that shows in the result, but it is late. Using both gives speed from the first and accuracy from the second.
- Kosky et al., Exploring Engineering (Academic Press, 2013) · ch. 8, 'Computer Engineering', section 8.8, fuel set from measured airflow
- Bloomfield, How Things Work (Wiley, 2015) · ch. 7, 'Heat and Phase Transitions', section 7.1, 'Woodstoves', heat capacity and specific heat
See it in the table
H₂O WaterO2 OxygenPHS Pumped hydro storageV2G Demand response and vehicle-to-gridEl ElectricityCheck your understanding
Why does a shower at the end of a long pipe tempt you to over-correct?
The delay hides the result of your last move. A controller that keeps acting before the result can be seen adds corrections that arrive together and cause swings.A grid loses 1.5 GW. What does a smaller inertia constant do to the initial rate of frequency fall?
The rate of fall is proportional to the lost power divided by the stored rotating energy. Less stored energy means a faster fall for the same loss.What is the main advantage of adding feedforward to a feedback loop?
Feedforward uses a measurement of the disturbance to act early, while feedback corrects what remains. It needs a model, so it is combined with feedback rather than used alone.