---
title: Bode plots of the loop gain
heading: Reading a loop's behavior from the Bode plot of L(jω), asymptotes and corner frequencies, the crossover frequency, Bode's gain–phase relation for minimum-phase loops, the phase cost of time delay, and how crossover sets closed-loop bandwidth
eyebrow: S9 · Lesson 23 · Bode plots of the loop gain
xp: 50
---

::: hook
The root locus works with poles and zeros, which you need a model to know. The frequency response can be measured: inject a sine into a running loop, see what comes back around, and sweep. Its Bode plot shows the loop gain at every frequency, and two numbers read from it, the frequency where the gain crosses 1 and the phase there, tell you nearly everything about the closed loop's speed and damping. This lesson sets up that view; the next two turn it into a stability test and a design method.
:::

::: play
- The Bode plot of $L = K/(s(\tau s + 1))$, a motor position loop.
- The gain falls at 20 dB per decade below the corner $1/\tau$ and 40 above it; the phase falls from −90° to −180°.
- The marker is the **crossover** $\omega_c$, where $|L| = 1$ (0 dB). Raising K slides the magnitude curve up and the crossover right, toward the region where the phase approaches −180°.
:::

```sim plot
view: bode
x: w = 0.1..1000 rad/s log
slider: K = 1..200 = 10 log
slider: T = 0.01..1 = 0.1 s log
H: K/((j*w)*(1 + j*w*T))
marker: x = sqrt((-1 + sqrt(1 + 4*K^2*T^2))/(2*T^2)) | label: crossover
readout: crossover, rad/s = sqrt((-1 + sqrt(1 + 4*K^2*T^2))/(2*T^2)) | digits: 4
readout: phase at crossover, ° = -90 - atan(T*sqrt((-1 + sqrt(1 + 4*K^2*T^2))/(2*T^2)))*180/pi | digits: 4
```

::: predict
## For $L = 10/(s(0.1s + 1))$, the low-frequency asymptote 10/ω reaches 1 at ω = 10, right at the corner. Where's the true crossover?

- [ ] Exactly 10 rad/s
- [x] About 7.9 rad/s, a little lower
- [ ] About 14 rad/s
- [ ] 100 rad/s

::: reveal
At the corner the real gain is 3 dB below the asymptote, so the curve crosses 0 dB before reaching it. Solving $\omega\sqrt{1 + 0.01\omega^2} = 10$ gives $\omega^2$ = 61.8, $\omega_c$ = 7.86 rad/s, where the phase is −90° − tan⁻¹ 0.786 = −128.2°.
:::
:::

::: nameit
## Asymptotes

Write L as a product of factors. Each pole contributes a corner where the slope steepens by 20 dB/decade and the phase falls by 90° (45° at the corner); each zero does the reverse. An integrator adds a constant −20 dB/decade and −90°. Above all corners the slope is $-20(n - m)$ dB/decade.

## Crossover and bandwidth

The **gain crossover** $\omega_c$ is where $|L(j\omega_c)| = 1$. Below it, $|L| \gg 1$ and $T \approx 1$: the loop follows the reference. Above it, $|L| \ll 1$ and $T \approx L$: the loop has given up. So the closed-loop bandwidth is close to $\omega_c$, usually between $\omega_c$ and twice it, and the rise time is roughly $1.5/\omega_c$ to $2/\omega_c$.

## Bode's gain–phase relation

For a **minimum-phase** loop (no right-half-plane poles or zeros, no delay), the phase is fixed by the magnitude: a slope of −20N dB/decade held over a wide band means a phase near −90N°. A loop crossing at −20 dB/decade has about 90° of phase to spare from −180°; one crossing at −40 dB/decade has almost none. That's the rule loop shaping works from (lesson 26).

## Delay

A time delay T multiplies L by $e^{-j\omega T}$: magnitude 1, phase $-\omega T$ radians, which grows without bound and is invisible on the magnitude plot. A 10 ms delay costs 28.6° at 50 rad/s.

## Phase margin and damping

For the loop $L = \omega_n^2/(s(s + 2\zeta\omega_n))$ the distance of the phase at crossover from −180°, the **phase margin**, is exactly $\tan^{-1}\frac{2\zeta}{\sqrt{\sqrt{1 + 4\zeta^4} - 2\zeta^2}}$, close to 100ζ degrees for ζ below 0.7.
:::

::: example
## Find the crossover and phase margin of $L = 10/(s(0.1s + 1))$, and compare with its closed loop.

::: solution
1. **Crossover.**
   $$\omega_c = 7.86\ \text{rad/s}$$
   where the phase is −128.2°.
2. **Phase margin.**
   $$\begin{aligned} \text{PM} &= 180° - 128.2° \\ &= 51.8° \end{aligned}$$
3. **Closed loop.**
   $$T = \frac{100}{s^2 + 10s + 100}$$
   with $\omega_n$ = 10 and ζ = 0.5 (16% overshoot). The formula above with ζ = 0.5 gives exactly 51.8°.
4. **Bandwidth.** Its −3 dB bandwidth is 12.7 rad/s, 1.6 times the crossover.

**Answer:** it crosses over at 7.86 rad/s with a 51.8° phase margin; the closed loop has $\omega_n$ = 10, ζ = 0.5 and a bandwidth of 12.7 rad/s.
:::
:::

::: example
## The loop above gets a 10 ms delay from a slow sensor. What happens to its phase margin?

::: solution
1. **Phase cost at crossover.**
   $$\begin{aligned} \omega_c\theta &= 7.86 \times 0.01\ \text{rad} \\ &= 4.5° \end{aligned}$$
2. **New margin.**
   $$\begin{aligned} \text{PM} &= 51.8° - 4.5° \\ &= 47.3° \end{aligned}$$
3. **Faster loops.** Delay hurts more the faster the loop: at a 50 rad/s crossover the same delay would cost 28.6°.

**Answer:** the phase margin falls from 51.8° to 47.3°.
:::
:::

::: example
## A type-2 loop $L = 10(s + 1)/(s^2(0.1s + 1))$ follows ramps with no error. Where does it cross over, and what phase margin does it have?

::: solution
1. **Why the zero matters.** Without it the double integrator would sit at −180°.
2. **Crossover.** Solving $|L(j\omega)| = 1$ numerically gives
   $$\omega_c = 7.91\ \text{rad/s}$$
3. **Phase there.**
   $$\begin{aligned} \angle L &= -180° + \tan^{-1}7.91 \\ &\quad - \tan^{-1}0.791 \\ &= -180° + 82.8° - 38.3° \end{aligned}$$
4. **Phase margin.**
   $$\begin{aligned} \text{PM} &= 82.8° - 38.3° \\ &= 44.5° \end{aligned}$$
5. **Where the phase comes from.** The zero at 1 rad/s, a decade below crossover, supplies the phase, and the pole at 10 rad/s, just above crossover, takes some of it back.

**Answer:** it crosses over at 7.91 rad/s with a 44.5° phase margin.
:::
:::

::: check
given: K = 10 | 20 | 100; t = 0.05 | 0.2
answer: sqrt((-1 + sqrt(1 + 4*K^2*t^2))/(2*t^2))
unit: rad/s
tolerance: 0.5%

## Where does $L = \given{K}/(s(\given{t}s + 1))$ cross 0 dB?

::: right
Right. Solve $\omega\sqrt{1 + \omega^2\tau^2} = K$: $\omega_c$ = {answer} rad/s.
:::

::: misses
- [K] That's where the low-frequency asymptote crosses; the pole lowers the gain before then.
- [any] Not yet. Set $|L(j\omega)| = 1$ and solve the quadratic in $\omega^2$.
:::
:::

::: check
given: K = 10 | 20 | 100; t = 0.05 | 0.2
answer: 90 - atan(t*sqrt((-1 + sqrt(1 + 4*K^2*t^2))/(2*t^2)))*180/pi
unit: °
tolerance: 0.5%

## What's the phase margin of $L = \given{K}/(s(\given{t}s + 1))$?

::: right
Right. The phase at crossover is $-90° - \tan^{-1}\omega_c\tau$, leaving {answer}° to −180°.
:::

::: misses
- [-90 - atan(t*sqrt((-1 + sqrt(1 + 4*K^2*t^2))/(2*t^2)))*180/pi] That's the phase itself; the margin is its distance above −180°.
- [any] Not yet. Find $\omega_c$, then 180° + ∠L there.
:::
:::

::: check
given: K = 5 | 50; t = 0.05 | 0.2; w = 5 | 30
answer: 20*log(K/(w*sqrt(1 + w^2*t^2)))
unit: dB
tolerance: 0.05

## What's the gain of $L = \given{K}/(s(\given{t}s + 1))$ at {w} rad/s, in decibels?

::: right
Right. $20\log(K/(\omega\sqrt{1 + \omega^2\tau^2}))$ = {answer} dB.
:::

::: misses
- [20*log(K/w)] Include the pole's factor $\sqrt{1 + \omega^2\tau^2}$.
- [any] Not yet. $|L| = K/(\omega\sqrt{1 + \omega^2\tau^2})$.
:::
:::

::: check
given: n = 3 | 4 | 6; m = 1 | 2
answer: -20*(n - m)
unit: dB/dec
tolerance: 0

## A loop gain has {n} poles and {m} zeros. What's its magnitude slope far above every corner?

::: right
Right. {answer}: every pole beyond the number of zeros takes another 20 dB per decade off the slope.
:::

::: misses
- [-20*n] Each zero adds +20 dB per decade back.
- [any] Not yet. −20 per pole, +20 per zero.
:::
:::

::: check
given: w = 10 | 100 | 1000; T = 0.5 | 2 | 10
answer: w*T/1000*180/pi
unit: °
tolerance: 0.5%

## A loop contains a {T} ms delay. How much phase does it lose at {w} rad/s?

::: right
Right. $\omega T$ = {answer}°.
:::

::: misses
- [w*T/1000] That's in radians.
- [any] Not yet. $e^{-j\omega T}$ has phase $-\omega T$.
:::
:::

::: check
given: a = 1 | 5; b = 20 | 50; w = 3 | 10
answer: -90 - atan(w/a)*180/pi - atan(w/b)*180/pi
unit: °
tolerance: 0.5%

## What's the phase of $L = K/(s(s/\given{a} + 1)(s/\given{b} + 1))$ at {w} rad/s?

::: right
Right. −90° for the integrator, minus $\tan^{-1}(\omega/a)$ and $\tan^{-1}(\omega/b)$: {answer}°.
:::

::: misses
- [-atan(w/a)*180/pi - atan(w/b)*180/pi] The integrator adds −90° at every frequency.
- [any] Not yet. Add the phase of each factor.
:::
:::

::: check
kind: parts
given: K = 20 | 50 | 100; t = 0.05 | 0.1; T = 5 | 10 | 30

## A loop $L = \given{K}/(s(\given{t}s + 1))$ picks up a {T} ms delay.

::: part
answer: sqrt((-1 + sqrt(1 + 4*K^2*t^2))/(2*t^2))
unit: rad/s
tolerance: 0.5%

### Where does it cross over (the delay doesn't change that)?

::: misses
- [K] That's the asymptote; solve $\omega^2(1 + \tau^2\omega^2) = K^2$ exactly.
- [any] Solve $|L(j\omega)| = 1$.
:::
:::

::: part
answer: 90 - atan(t*sqrt((-1 + sqrt(1 + 4*K^2*t^2))/(2*t^2)))*180/pi - sqrt((-1 + sqrt(1 + 4*K^2*t^2))/(2*t^2))*T*1e-3*180/pi
unit: °
tolerance: 0.5%

### What phase margin remains with the delay?

::: misses
- [90 - atan(t*sqrt((-1 + sqrt(1 + 4*K^2*t^2))/(2*t^2)))*180/pi] That's without the delay; subtract $\omega_cT$.
- [any] $90° - \tan^{-1}(\tau\omega_c) - \omega_cT$.
:::
:::
:::

::: check
kind: derivation
vars: K = 0.1..1000, t = 0.001..10, w = 0.01..1000

## The loop $L = K/(s(ts + 1))$ at frequency w.

::: step
answer: 20*log(K/(w*sqrt(1 + t^2*w^2)))

### What is |L| in decibels?
:::

::: step
answer: -90 - atan(t*w)*180/pi

### What is its phase in degrees?
:::

::: right
Right. The integrator gives a constant −90°, and the pole adds up to another 90° above its corner.
:::
:::

::: explain
## Why is the closed-loop bandwidth close to the loop's crossover frequency?

::: model
The closed loop is $T = L/(1 + L)$. At frequencies well below crossover the loop gain is large, so T is very close to 1 and the output follows the reference. Well above crossover the loop gain is small, so T is close to L itself, which is falling away. The transition between following and not following happens where $|L|$ passes through 1, which is the crossover. Exactly where T is 3 dB down depends on the phase there: with a good phase margin it's somewhat above $\omega_c$, and with a poor margin T peaks near $\omega_c$ before falling.
:::
:::

::: practice

::: check
given: K = 4 | 40; t = 0.05 | 0.5
answer: sqrt((-1 + sqrt(1 + 4*K^2*t^2))/(2*t^2))
unit: rad/s
tolerance: 0.5%

## Crossover of $\given{K}/(s(\given{t}s + 1))$?

::: misses
- [any] Solve $\omega\sqrt{1 + \omega^2\tau^2} = K$.
:::
:::

::: check
given: w = 20 | 300; T = 1 | 5
answer: w*T/1000*180/pi
unit: °
tolerance: 0.5%

## Phase lost to a {T} ms delay at {w} rad/s?

::: misses
- [any] $\omega T$ in degrees.
:::
:::

::: check
given: K = 3 | 30; t = 0.03 | 0.3
answer: 90 - atan(t*sqrt((-1 + sqrt(1 + 4*K^2*t^2))/(2*t^2)))*180/pi
unit: °
tolerance: 0.5%

## Phase margin of $\given{K}/(s(\given{t}s + 1))$?

::: misses
- [any] 90° − $\tan^{-1}\omega_c\tau$.
:::
:::
:::
