Search

Search papers and lessons

Feedback Control

Level 2 · 13 min read

Feedback control measures a system's output, compares it with the wanted value, and feeds the difference back as the input, so the system corrects itself.

On this page

  • Colour = topic mix
  • Probability
  • Linear algebra
  • Discrete math
  • Calculus
  • Control systems
  • ReadReady to readNot yet

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 yy, and the valve opening is the input uu. Use a simple model in which the level responds to the valve with a time constant of 1 second.

  1. Set the target. Pick the wanted level r=10r = 10 (in some units). The error is e=r−ye = r - y, the difference between the wanted value and the measured one. Check: if the level is 4, the error is 10−4=610 - 4 = 6, which says the level is too low by 6.
  2. Choose the rule for the valve. Use u=Keu = K e with gain K=4K = 4. The valve opens in proportion to the error, four times as much as the error. Check: with error 6, the valve opens by 4×6=244 \times 6 = 24 units.
  3. 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 dydt=−y+u\frac{dy}{dt} = -y + u. Check: if uu is steady at 24 and y=4y = 4, then dydt=−4+24=20\frac{dy}{dt} = -4 + 24 = 20, so the level rises quickly.
  4. Close the loop. Substitute the rule from step 2 into the model from step 3. The error e=r−ye = r - y turns the valve input into u=4(10−y)u = 4(10 - y), which gives dydt=−y+40−4y=−5y+40\frac{dy}{dt} = -y + 40 - 4y = -5y + 40. Check: when y=0y = 0, the rate is 40, and when y=8y = 8, the rate is zero.
  5. Find where it settles. The level stops changing at y=8y = 8, where −5⋅8+40=0-5 \cdot 8 + 40 = 0. The final error is 10−8=210 - 8 = 2, 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.

00.20.40.60.810246810time t (s)level y
  • level y(t), K = 4
  • setpoint r = 10
The level approaches 8, not 10. The point at t = 0.2 s is 5.06, the value worked out in the standard example.

The math

Definition: Feedback control law

For a system whose output yy should follow a setpoint rr, a proportional feedback law is u=K(r−y)u = K(r - y), where K>0K > 0 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:

dydt=−y+u.\frac{dy}{dt} = -y + u.

Without feedback, if the input is held at a constant uu, the output settles at y=uy = u. The number 1 in front of yy 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 u=K(r−y)u = K(r - y) into the plant gives

dydt=−y+K(r−y)=−(1+K) y+Kr.\frac{dy}{dt} = -y + K(r - y) = -(1 + K)\,y + K r.

The coefficient 1+K1 + K is the rate at which the closed loop returns to equilibrium, and the term KrKr is the push toward the setpoint.

Step 3 in symbols: where it settles

Setting dydt=0\frac{dy}{dt} = 0 gives the steady state

yss=Kr1+K,ess=r−yss=r1+K.y_{\text{ss}} = \frac{K r}{1 + K}, \qquad e_{\text{ss}} = r - y_{\text{ss}} = \frac{r}{1 + K}.

As KK grows, the steady error shrinks, but it never reaches zero for a proportional controller. With r=10r = 10 and K=4K = 4, yss=40/5=8y_{\text{ss}} = 40/5 = 8.

Step 4 in symbols: the full response

The solution of dydt=−(1+K)y+Kr\frac{dy}{dt} = -(1+K)y + Kr that starts at y(0)=y0y(0) = y_0 is

y(t)=yss+(y0−yss) e−(1+K)t.y(t) = y_{\text{ss}} + (y_0 - y_{\text{ss}})\, e^{-(1+K)t}.

The exponential term decays to zero because 1+K>01 + K > 0. The closed-loop equation is stable for any K>−1K > -1, so a positive gain always settles for this plant. The closed-loop pole is s=−(1+K)s = -(1+K), the root of the characteristic equation s+(1+K)=0s + (1+K) = 0, and it sets the rate of decay.

Worked examples

Example
1. A low gain (tiny)

The plant is dydt=−y+u\frac{dy}{dt} = -y + u, the setpoint is r=10r = 10, the gain is K=1K = 1, and the level starts at y(0)=0y(0) = 0.

  1. Closed loop: dydt=−(1+1)y+1⋅10=−2y+10\frac{dy}{dt} = -(1 + 1)y + 1 \cdot 10 = -2y + 10.
  2. Steady state: yss=Kr1+K=102=5y_{\text{ss}} = \frac{Kr}{1+K} = \frac{10}{2} = 5.
  3. Check the rate at the start: at y=0y = 0, dydt=10\frac{dy}{dt} = 10, so the level rises quickly.
  4. Check the rate at the steady state: at y=5y = 5, dydt=−10+10=0\frac{dy}{dt} = -10 + 10 = 0. The level has stopped.
  5. Final error: 10−5=510 - 5 = 5, 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.

Example
2. The standard case (gain 4)

The same plant, with r=10r = 10, K=4K = 4 and y(0)=0y(0) = 0.

  1. Closed loop: dydt=−5y+40\frac{dy}{dt} = -5y + 40.
  2. Steady state: yss=405=8y_{\text{ss}} = \frac{40}{5} = 8.
  3. Final error: 10−8=210 - 8 = 2, which is 20 percent of the setpoint.
  4. Time constant: the decay rate is 1+K=51 + K = 5 per second, so the time constant is 15=0.2\frac{1}{5} = 0.2 s.
  5. Full solution: y(t)=8+(0−8)e−5t=8−8e−5ty(t) = 8 + (0 - 8)e^{-5t} = 8 - 8e^{-5t}.
  6. Check at t=0t = 0: 8−8=08 - 8 = 0, which matches the start.
  7. Value at t=0.2t = 0.2 s: e−1≈0.368e^{-1} \approx 0.368, so y=8−8×0.368=8−2.94=5.06y = 8 - 8 \times 0.368 = 8 - 2.94 = 5.06.
  8. Check the rate at t=0.2t = 0.2 s: dydt=−5(5.06)+40=14.7\frac{dy}{dt} = -5(5.06) + 40 = 14.7, 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.

Example
3. A car on cruise control (realistic)

A car of mass m=1000m = 1000 kg has a speed vv. Air and road drag give a force bvb v with b=50b = 50 N s/m. The engine supplies a force F=K(vset−v)F = K(v_{\text{set}} - v), with gain K=1000K = 1000 N per m/s, and the set speed is vset=25v_{\text{set}} = 25 m/s (about 90 km/h).

  1. Newton's second law: mdvdt=F−bv=K(vset−v)−bvm\frac{dv}{dt} = F - bv = K(v_{\text{set}} - v) - bv.
  2. Rearrange: mdvdt=−(b+K)v+Kvsetm\frac{dv}{dt} = -(b + K)v + K v_{\text{set}}. Here b+K=1050b + K = 1050 and Kvset=1000×25=25000K v_{\text{set}} = 1000 \times 25 = 25000 N.
  3. Steady speed: vss=Kvsetb+K=250001050≈23.81v_{\text{ss}} = \frac{K v_{\text{set}}}{b + K} = \frac{25000}{1050} \approx 23.81 m/s.
  4. Speed error: 25−23.81=1.1925 - 23.81 = 1.19 m/s, which is about 4.8 percent of the set speed.
  5. Time constant: τ=mb+K=10001050≈0.95\tau = \frac{m}{b + K} = \frac{1000}{1050} \approx 0.95 s.
  6. Check the force at steady state: the engine pushes with K×1.19≈1190K \times 1.19 \approx 1190 N, and the drag is bvss=50×23.81≈1190b v_{\text{ss}} = 50 \times 23.81 \approx 1190 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 K=4000K = 4000 N per m/s. Find the steady speed and its error. Answer: vss=4000×254050≈24.69v_{\text{ss}} = \frac{4000 \times 25}{4050} \approx 24.69 m/s, and the error is 25−24.69=0.3125 - 24.69 = 0.31 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.

ApproachNeeds a measurementHandles unknown disturbancesTypical use
Open loopnonoa fixed timer or a fixed valve setting
Proportional feedbackyespartly, with steady errorsimple heaters and tanks
Proportional-integral-derivativeyesyes, the error goes to zeromost 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 u=K(r−y)u = K(r - y) turns the plant dydt=−y+u\frac{dy}{dt} = -y + u into dydt=−(1+K)y+Kr\frac{dy}{dt} = -(1+K)y + Kr.
  • The loop settles at yss=Kr1+Ky_{\text{ss}} = \frac{Kr}{1+K}, so a proportional controller leaves an error of r1+K\frac{r}{1+K}.
  • The response decays with the rate 1+K1 + K, 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, u=K(r+y)u = K(r + y), the output would be pushed further from the target.

QuestionComputation: a plant has dydt=−y+u\frac{dy}{dt} = -y + u, setpoint r=9r = 9 and gain K=2K = 2. What is the steady output?Show answer

yss=Kr1+K=2×93=6y_{\text{ss}} = \frac{Kr}{1+K} = \frac{2 \times 9}{3} = 6. The steady error is 9−6=39 - 6 = 3.

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 u=yu = y. The control law gives u=K(r−y)u = K(r - y), and balancing these needs K(r−y)=yK(r - y) = y, so a nonzero error r−y=y/Kr - y = y/K is required. The error can only shrink to zero if KK is infinite, so a finite gain always leaves some error.

QuestionApplied: a room heater is modelled as dTdt=−T+u\frac{dT}{dt} = -T + u, with a setpoint of 20 and gain K=2K = 2. What is the room temperature at steady state, and how big is the error?Show answer

Tss=2×201+2=403≈13.3T_{\text{ss}} = \frac{2 \times 20}{1 + 2} = \frac{40}{3} \approx 13.3. The error is 20−13.3≈6.720 - 13.3 \approx 6.7, so the room settles well below the setpoint. A higher gain would reduce this, but a proportional controller cannot remove it completely.

Sources