---
title: Feedback and what it does
heading: Open and closed loops, loop gain, sensitivity to plant changes, rejecting disturbances, steady-state error under proportional control, and the price feedback charges in noise and stability
eyebrow: S9 · Lesson 1 · Feedback and what it does
xp: 50
---

::: hook
The open-loop gain of an op amp can vary by a factor of three from one part to the next and drift with temperature, yet a non-inverting amplifier built around it holds its gain to a tenth of a percent, set by two resistors. A car's cruise control holds 100 km/h up a hill without knowing the hill's slope. Both work the same way: measure the output, compare it with what you want, and act on the difference. This course is about designing that loop so it's accurate, fast and stable, and this first lesson shows what feedback buys and what it costs.
:::

::: play
- The closed-loop gain of an amplifier with open-loop gain A and feedback fraction β, $G = A/(1 + A\beta)$, against A on a log axis.
- Once $A\beta \gg 1$, the gain flattens out at $1/\beta$: a factor of ten change in A barely moves it.
- Raise β and the flat region starts sooner, at a lower gain. Feedback trades gain for precision.
:::

```sim plot
view: graph
x: A = 10..1M log
y: G = 0..120
slider: b = 0.005..0.1 = 0.01 log
plot: A/(1 + A*b) | samples: 400 | label: closed-loop gain
plot: 1/b + 0*A | dashed | color: ch3 | label: 1/β
readout: loop gain Aβ for A of 100,000 = 1e5*b
readout: gain for A of 100,000 = 1e5/(1 + 1e5*b) | digits: 5
readout: gain for A of 50,000 = 5e4/(1 + 5e4*b) | digits: 5
```

::: predict
## An amplifier has A = 100,000 and β = 0.01. If A halves to 50,000, how much does the closed-loop gain change?

- [ ] It halves, to about 50
- [ ] It falls about 10%
- [x] It falls about 0.1%
- [ ] Not at all

::: reveal
$G$ goes from 100,000/1001 = 99.90 to 50,000/501 = 99.80, a 0.1% drop for a 50% drop in A. The loop gain $A\beta$ = 1000 divides the effect of the change by about 1000.
:::
:::

::: nameit
## The loop

A **plant** P (the thing being controlled) is driven by a **controller** C acting on the **error** e = r − y between the **reference** r and the measured output y. Around the loop the signal is multiplied by the **loop gain** $L = PC$ (times the sensor's gain, if it isn't 1). Solving $y = PC(r - y)$:

$$T = \frac{y}{r} = \frac{L}{1 + L}$$

## Sensitivity

A fractional change in the plant changes T by the fractional change times the **sensitivity function**

$$S = \frac{1}{1 + L}, \qquad \frac{dT}{T} = S\,\frac{dP}{P}$$

## Disturbances

A disturbance d added at the plant's output reaches y multiplied by S: a loop gain of 20 shrinks it 21 times.

## Steady-state error

With proportional control $C = K_p$ and a plant of DC gain $P(0)$, a step reference leaves an error of $1/(1 + K_pP(0))$ of the step. Integral action (lesson 10) removes it.

## The price

The sensor sits inside the loop, so its errors and noise reach the output almost unreduced: y follows what the sensor says, with T ≈ 1 passing sensor noise straight through. And high loop gain combined with delays in the plant can make the loop oscillate. Most of this course is about getting the benefits without that instability.
:::

::: example
## A proportional temperature controller with $K_p$ = 10 drives a heater whose DC gain is 2 °C per unit of drive. The setpoint is 50 °C above ambient. Where does it settle?

::: solution
1. **Loop gain.** The controller's gain times the heater's:
   $$\begin{aligned} L &= 10 \times 2 \\ &= 20 \end{aligned}$$
2. **Closed-loop gain.**
   $$\begin{aligned} T &= \frac{L}{1 + L} \\ &= \frac{20}{21} \end{aligned}$$
3. **Settled temperature.**
   $$\begin{aligned} \Delta T &= 50 \times \frac{20}{21} \\ &= 47.6\ \text{°C} \end{aligned}$$
   above ambient, 2.4 °C short.
4. **What removes the error.** Raising $K_p$ shrinks the error but never removes it; an integrator does (lesson 10).

**Answer:** it settles 47.6 °C above ambient, 2.4 °C short of the setpoint.
:::
:::

::: example
## A hill would slow a car by 10 km/h with the throttle fixed. Its cruise control has a loop gain of 20 at the frequencies of a hill. How much does the car slow?

::: solution
1. **Feedback divides the disturbance.** It's divided by
   $$1 + L = 21$$
2. **Remaining slowdown.**
   $$\begin{aligned} \Delta v &= \frac{10\ \text{km/h}}{21} \\ &= 0.48\ \text{km/h} \end{aligned}$$
3. **How it did it.** The controller found the extra throttle without knowing anything about the hill, only that the speed had dropped.

**Answer:** the car slows by only 0.48 km/h.
:::
:::

::: example
## A positioning stage's loop gain is 50 at 1 Hz. A 1 Hz floor vibration would move it 1 mm, and its position sensor has 0.01 mm of noise at 1 Hz. What motion remains?

::: solution
1. **The vibration.** It's a disturbance, reduced by $S = 1/51$:
   $$1\ \text{mm} \times \tfrac{1}{51} = 0.0196\ \text{mm}$$
2. **The sensor noise.** It passes through $T = 50/51$ almost unchanged:
   $$0.01\ \text{mm} \times \tfrac{50}{51} = 0.0098\ \text{mm}$$
3. **Combine them.** Uncorrelated, they combine to
   $$\begin{aligned} \Delta x &= \sqrt{0.0196^2 + 0.0098^2} \\ &= 0.022\ \text{mm} \end{aligned}$$
4. **What more gain can do.** More loop gain would shrink the first term but never the second: below about 0.01 mm, only a better sensor helps.

**Answer:** about 0.022 mm of motion remains: 0.0196 mm from the vibration and 0.0098 mm from the sensor noise.
:::
:::

::: check
given: A = 200 | 1000 | 5000; b = 0.01 | 0.05
answer: A/(1 + A*b)
tolerance: 0.1%

## An amplifier has open-loop gain {A} and feedback fraction β = {b}. What's its closed-loop gain?

::: right
Right. $A/(1 + A\beta)$ = {answer}, just under $1/\beta$.
:::

::: misses
- [1/b] That's the ideal gain for infinite A. With finite A it falls a little short.
- [A/(A*b)] Add one to the loop gain in the denominator.
- [any] Not yet. $G = A/(1 + A\beta)$.
:::
:::

::: check
given: A = 1000 | 10000 | 100000; b = 0.01 | 0.1; p = 20 | 50
answer: 100*(1 - (1 - p/100)*(1 + A*b)/(1 + A*(1 - p/100)*b))
unit: %
tolerance: 1%

## An amplifier's open-loop gain falls {p}% from {A}, with β = {b}. By what percentage does the closed-loop gain fall?

::: right
Right. {answer}%: the loop gain divides the change by roughly $1 + A\beta$.
:::

::: misses
- [p] That's the open-loop change. Feedback divides it by about $1 + A\beta$.
- [any] Not yet. Compute $A/(1 + A\beta)$ before and after.
:::
:::

::: check
given: d = 5 | 12 | 40; L = 4 | 9 | 49
answer: d/(1 + L)
unit: rpm
tolerance: 0.5%

## A load step would slow a motor by {d} rpm without control. With a loop gain of {L}, how much does it slow?

::: right
Right. {d}/(1 + {L}) = {answer} rpm.
:::

::: misses
- [d/L] Divide by $1 + L$.
- [d] That's the open-loop drop.
- [any] Not yet. Disturbances are divided by $1 + L$.
:::
:::

::: check
given: K = 2 | 5 | 20; P = 0.4 | 2 | 4
answer: 100/(1 + K*P)
unit: %
tolerance: 0.5%

## A proportional controller with $K_p$ = {K} drives a plant with DC gain {P}. What percentage of a step reference is left as steady error?

::: right
Right. $1/(1 + K_pP(0))$ = {answer}%.
:::

::: misses
- [100/(K*P)] Add one to the loop gain.
- [100*K*P/(1 + K*P)] That's the fraction the output reaches; the error is the rest.
- [any] Not yet. $e_{ss} = 1/(1 + K_pP(0))$.
:::
:::

::: check
given: e = 1 | 2 | 5
answer: 100*(1 - 1/(1 + e/100))
unit: %
tolerance: 0.5%

## A loop has very high gain, but its sensor reads {e}% high. By what percentage does the output end up low?

::: right
Right. The output settles where the sensor reads the reference: $y = r/(1 + \given{e}\%)$, {answer}% low. Feedback can't correct its own sensor.
:::

::: misses
- [0] High loop gain can't fix a sensor error: the loop trusts the sensor.
- [any] Not yet. The loop drives the sensor reading to r.
:::
:::

::: check
given: e = 0.1 | 0.5 | 1; b = 0.01 | 0.1
answer: (100/e - 1)/b
tolerance: 0.5%

## An amplifier must have a closed-loop gain within {e}% of $1/\beta$ with β = {b}. What's the least open-loop gain A that does it?

::: right
Right. The shortfall is $1/(1 + A\beta)$, so $A\beta \ge 100/\given{e} - 1$ and $A \ge$ {answer}.
:::

::: misses
- [any] Not yet. Set $1/(1 + A\beta)$ equal to the allowed fraction.
:::
:::

::: check
kind: parts
given: L = 10 | 50 | 200; d = 0.5 | 2; n = 0.005 | 0.02

## A loop gain of {L} acts on a disturbance that would move the output {d} mm, and on {n} mm of sensor noise at the same frequency.

::: part
answer: d/(1 + L)
unit: mm
tolerance: 0.5%

### How much of the disturbance remains?

::: misses
- [d/L] Exactly, it's $d/(1 + L)$.
- [any] Multiply by S = 1/(1 + L).
:::
:::

::: part
answer: n*L/(1 + L)
unit: mm
tolerance: 0.5%

### How much sensor noise reaches the output?

::: misses
- [n/(1 + L)] Sensor noise passes through T, not S.
- [any] Multiply by T = L/(1 + L).
:::
:::
:::

::: check
kind: derivation
vars: L = 0.1..10000, p = -0.5..0.5

## A loop has gain L, and the plant's gain changes by a fraction p.

::: step
answer: L/(1 + L)

### What is the closed-loop gain T?
:::

::: step
answer: 1/(1 + L)

### What is the sensitivity S?
:::

::: step
answer: p/(1 + L)

### By about what fraction does T change?
:::

::: right
Right. Feedback divides plant variations by 1 + L, and a sensor's errors aren't divided at all.
:::
:::

::: explain
## Why does feedback make a system less sensitive to changes in its own parts?

::: model
The loop drives the error between the reference and the measured output toward zero, and with high loop gain only a tiny error is needed to produce whatever drive the plant requires. If the plant gets weaker, the output starts to fall, the error grows a little, and the controller pushes harder until the output is back where it was. The output ends up set by the reference and the sensor, which are chosen to be precise, while the plant's gain only affects how big the leftover error is. That's why the change in closed-loop behavior is the plant's change divided by one plus the loop gain.
:::
:::

::: practice

::: check
given: A = 500 | 20000; b = 0.02 | 0.2
answer: A/(1 + A*b)
tolerance: 0.1%

## Closed-loop gain with A = {A}, β = {b}?

::: misses
- [any] $A/(1 + A\beta)$.
:::
:::

::: check
given: d = 8 | 30; L = 3 | 19 | 99
answer: d/(1 + L)
unit: °C
tolerance: 0.5%

## A disturbance of {d} °C open loop, loop gain {L}: what's left?

::: misses
- [any] Divide by $1 + L$.
:::
:::

::: check
given: K = 3 | 8 | 50; P = 0.2 | 1.5
answer: 100/(1 + K*P)
unit: %
tolerance: 0.5%

## Steady error under $K_p$ = {K} with plant DC gain {P}?

::: misses
- [any] $1/(1 + K_pP(0))$.
:::
:::
:::
