TL;DR
A feedback controller measures the output of a system, subtracts it from the value you want, and uses that difference to set the input. If the output is too low, the input rises, and if it is too high, the input falls. This loop lets a system hold a target even when it is disturbed or when its parameters are only roughly known.
Builds on: Ordinary Differential Equation, Linear Dynamical System · Leads to: PD Control, Transfer Function, Lyapunov Stability
This lesson explains a mathematical idea from engineering. It is not advice for building or operating any equipment.
Where it's used
Cruise control in a car. The car's speed is measured by a sensor and compared with the speed the driver set. The engine's throttle is adjusted in proportion to the difference, so a hill slows the car, the error grows, and the throttle opens further until the speed is back near the setting.
Room heating. A thermostat compares the room temperature with the setpoint and switches the heater on or off, or scales its power, according to the difference. The room stays near the setpoint through open windows and cold nights, which are disturbances the designer never modelled exactly.
Aircraft and rockets. Autopilots and flight-control computers read the attitude from gyroscopes and correct the control surfaces many times per second. Without that loop, a small gust would grow into a large deviation before a human could react.
How it works
Take one tiny instance: a tank of water that you want to hold at a level. The level is the output , and the valve opening is the input . Use a simple model in which the level responds to the valve with a time constant of 1 second.
- Set the target. Pick the wanted level (in some units). The error is , the difference between the wanted value and the measured one. Check: if the level is 4, the error is , which says the level is too low by 6.
- Choose the rule for the valve. Use with gain . The valve opens in proportion to the error, four times as much as the error. Check: with error 6, the valve opens by units.
- Let the tank respond. The level changes at a rate that is the valve input minus a loss that is proportional to the level, so . Check: if is steady at 24 and , then , so the level rises quickly.
- Close the loop. Substitute the rule from step 2 into the model from step 3. The error turns the valve input into , which gives . Check: when , the rate is 40, and when , the rate is zero.
- Find where it settles. The level stops changing at , where . The final error is , which is not zero. Check: a proportional controller always leaves some error, and this one leaves 20 percent of the target.
The loop itself is the core picture. The structure is always the same: the controller compares, the system responds, and the output is fed back.
flowchart LR R["Setpoint r"] --> E["Error e = r minus y"] E --> C["Controller u = K e"] C --> P["System dy/dt = -y + u"] P --> Y["Output y"] Y -.-> E
The plot below shows the level rising from 0 toward the setpoint of 10. It settles at 8, the value found in step 5, and the dashed line marks the target.
- level y(t), K = 4
- setpoint r = 10
The math
For a system whose output should follow a setpoint , a proportional feedback law is , where is the gain. The sign is negative: when the output is below the setpoint, the input is pushed up.
Step 1 in symbols: the plant
The system being controlled is called the plant. Here it is a first-order linear differential equation, the kind studied in ordinary differential equations and linear dynamical systems:
Without feedback, if the input is held at a constant , the output settles at . The number 1 in front of is the rate at which the output leaks back toward zero, so the time constant is 1 second.
Step 2 in symbols: the control law
Substituting the feedback law into the plant gives
The coefficient is the rate at which the closed loop returns to equilibrium, and the term is the push toward the setpoint.
Step 3 in symbols: where it settles
Setting gives the steady state
As grows, the steady error shrinks, but it never reaches zero for a proportional controller. With and , .
Step 4 in symbols: the full response
The solution of that starts at is
The exponential term decays to zero because . The closed-loop equation is stable for any , so a positive gain always settles for this plant. The closed-loop pole is , the root of the characteristic equation , and it sets the rate of decay.
Worked examples
The plant is , the setpoint is , the gain is , and the level starts at .
- Closed loop: .
- Steady state: .
- Check the rate at the start: at , , so the level rises quickly.
- Check the rate at the steady state: at , . The level has stopped.
- Final error: , which is half the setpoint.
Interpretation: with a gain of 1, the controller only pushes as hard as the error, and the tank settles at half the target. Raising the gain is the first step toward a smaller error.
The same plant, with , and .
- Closed loop: .
- Steady state: .
- Final error: , which is 20 percent of the setpoint.
- Time constant: the decay rate is per second, so the time constant is s.
- Full solution: .
- Check at : , which matches the start.
- Value at s: , so .
- Check the rate at s: , which is positive, as expected while the level still rises.
Interpretation: the level reaches 5.06 after 0.2 seconds, about 63 percent of the way from 0 to its final value of 8, which is the usual meaning of a time constant. The tank still stops 2 units short of the setpoint.
A car of mass kg has a speed . Air and road drag give a force with N s/m. The engine supplies a force , with gain N per m/s, and the set speed is m/s (about 90 km/h).
- Newton's second law: .
- Rearrange: . Here and N.
- Steady speed: m/s.
- Speed error: m/s, which is about 4.8 percent of the set speed.
- Time constant: s.
- Check the force at steady state: the engine pushes with N, and the drag is N. The two match, so the car has stopped accelerating.
Interpretation: the car reaches about 23.8 m/s and holds there, 1.2 m/s below the setting, because the engine must produce a force that balances the drag. A larger gain closes the gap, and the speed responds with a time constant of about one second. Real cruise controls usually add an integral term, which sums the error over time and removes this gap.
Try it: The same car, but with gain N per m/s. Find the steady speed and its error. Answer: m/s, and the error is m/s.
Common mistakes and tradeoffs
It is tempting to think that more gain always means a better controller. In fact a higher gain shrinks the steady error and speeds the response, but in a real system with delays or extra lags, a high gain can make the output overshoot and oscillate, and eventually go unstable. The model used here has no delays, so it cannot show that failure, but it is the usual limit in practice.
It is tempting to think that feedback always makes a system stable. In fact feedback can destabilise a system when the loop gain is too high or the signal arrives late. The sign of the feedback matters too: negative feedback, as used here, pushes against the error, while positive feedback amplifies it.
It is tempting to think that a proportional controller removes all error. In fact it leaves a steady error whenever a constant load or disturbance is present, as the examples show. Removing that error needs an integral term, which adds up the past error over time.
It is tempting to think that the controller needs an exact model of the plant. In fact feedback is valuable because it corrects for mismatch and disturbances that the model does not capture. The plant model is needed to choose the gain well, not to make the loop work at all.
When to use it. Use feedback when the output must hold a target despite disturbances you cannot predict, or when the plant's behaviour is only roughly known. Simple proportional control suits systems where a small error is acceptable.
When not to use it. Feedback needs a sensor that measures the output in time. Where the output cannot be measured, or where the measurement arrives too late to act on, a feedforward design, which acts on the expected disturbance before it arrives, can be the better choice.
| Approach | Needs a measurement | Handles unknown disturbances | Typical use |
|---|---|---|---|
| Open loop | no | no | a fixed timer or a fixed valve setting |
| Proportional feedback | yes | partly, with steady error | simple heaters and tanks |
| Proportional-integral-derivative | yes | yes, the error goes to zero | most industrial loops |
History
James Watt's centrifugal governor, used on steam engines from the 1780s, is an early feedback device. Two weighted arms spin with the engine and rise when it runs fast, closing a valve to slow it down, and fall when it runs slow.
In 1868 James Clerk Maxwell published "On Governors", which analysed the stability of such devices with differential equations. He showed that a governor could start to oscillate when its gain was too high, which is the failure described in the tradeoffs section.
In 1922 Nicolas Minorsky wrote about automatic ship steering and described a control law with proportional, integral and derivative terms, which became the PID controller used in industry. In 1927 Harold Black at Bell Labs introduced negative feedback for electronic amplifiers, which made stable, distortion-free amplification possible over long telephone lines. Feedback then spread from engines and ships to nearly every field where systems must hold a target.
Recap
- A feedback loop measures the output, compares it with the setpoint, and feeds the error back as the input.
- The proportional law turns the plant into .
- The loop settles at , so a proportional controller leaves an error of .
- The response decays with the rate , so a larger gain is faster but is limited by delays and lags in real systems.
- Adding an integral term, which sums the error over time, removes the steady error. It is the I in the full PID design, while PD control adds a derivative term instead.
Next, read Transfer Function to see the same loop in the frequency domain, and Lyapunov Stability for a general test of whether a feedback loop settles.
Check yourself
QuestionRecall: what does the negative sign in the control law u = K(r - y) do?Show answer
It makes the input rise when the output is below the setpoint and fall when the output is above it. The loop therefore pushes the output back toward the target. With the sign reversed, , the output would be pushed further from the target.
QuestionComputation: a plant has , setpoint and gain . What is the steady output?Show answer
. The steady error is .
QuestionWhy: why does a proportional controller leave a steady error, even with a high gain?Show answer
At steady state the output has stopped changing, so the plant's balance requires . The control law gives , and balancing these needs , so a nonzero error is required. The error can only shrink to zero if is infinite, so a finite gain always leaves some error.
QuestionApplied: a room heater is modelled as , with a setpoint of 20 and gain . What is the room temperature at steady state, and how big is the error?Show answer
. The error is , so the room settles well below the setpoint. A higher gain would reduce this, but a proportional controller cannot remove it completely.