← Index
CDSSC · Repaso · Step 05

Bode, margins and root locus

Three tools for one question: how does the loop behave, and how close is it to oscillating by itself? Example plant: the DC motor from the first practical exam, , with a gain K in front.

5.1

A sine in, a sine out respuesta en frecuencia

Takeaway
Shake a linear system with a sine of frequency ω. After the start-up dies out, the output is a sine of the same ω, only bigger or smaller (|G(jω)|) and late (∠G(jω)). The Bode plot is just those two numbers for every ω.
Why s = jω
A sine neither grows nor dies, so its s has no real part: σ = 0, s = jω. Put that s into G(s) and you get one complex number: its length is the amplitude ratio, its angle is the delay.
Example
A weight on a rubber band, (ωn = 1, ζ = 0.2). Move ω and watch the output sine and the dot on the Bode plot.
input frequency ω
|G(jω)|
in dB
phase ∠G

input sin(ωt)output after start-up

magnitude |G| [dB]

phase ∠G [°]

Decibels
dB = 20·log₁₀|G|. ×1 = 0 dB, ×10 = +20 dB, ×2 ≈ +6 dB, ×0.1 = −20 dB. Multiplying blocks in series = adding their dB.

FR-02 · Franklin ch. 6

5.2

Root locus lugar de las raíces

Takeaway
The path the closed-loop poles take as K goes from 0 to ∞. Every point solves 1 + K·G(s) = 0. Start at the open-loop poles × (K = 0).
Motor
Poles start at 0 and −500, meet at −250 for K = 125, then go straight up and down along Re = −250. Above K = 125: more K = faster wiggle, same decay rate, more overshoot.
gain K
poles
damping ζ
overshoot Mp

s-plane: locus and closed-loop poles

step response for this K

s = tf('s'); G = 500/(s*(s+500)); pole(G) % open-loop poles: the × marks rlocus(G) % the locus (click a point: Gain, Pole, Damping, Overshoot) p = rlocus(G, 50) % exact closed-loop poles for K = 50 T = feedback(50*G, 1); damp(T), stepinfo(T, 'SettlingTimeThreshold', 0.05)
Quick check

Where are the poles for K = 500? Size of the imaginary part:

DC-01 (lugar de las raíces) · examen práctico 1, apartado 1.1

5.3

Reading the margins, step by step márgenes de fase y ganancia

Edge
A sine that comes back after one loop trip the same size (0 dB) and flipped (−180°) feeds itself: the loop oscillates on its own, like a microphone squealing. Margins measure how far you are from that.
Phase margin
Start at the TOP where |L| crosses 0 dB, go down, measure how far the phase is from −180°.
Gain margin
Start at the BOTTOM where the phase crosses −180°, go up, measure how far |L| is below 0 dB. That many times you can still raise K.
Three rulers
MG (stretch), MF (rotate) and the peak Ms of |S| (shortest distance to −1) measure the same distance to the edge in different directions. They agree.

Guide: exactly where to look to read PM and GM

The motor from the practical exam (L = K·500/(s(s+500))) and the oven from FR-03 p. 7. Green = phase margin MF (margen de fase), red = gain margin MG (margen de ganancia). Under the Bode plot a small step response shows what the numbers mean in time.

Plant
K

Top: |L| (magnitud). Bottom: ∠L (fase). Thick blue = selected K, thin grey = the other K values (the phase is the same for every K).

Wcp (|L| = 0 dB)
MF = Pm
Wcg (phase = −180°)
MG = Gm
K max

Link: closed-loop step response for this K

Small MF = big overshoot. MG < 0 = the curve leaves the plot. Dashed = final value.

Special cases (click “Show”)

What you seeWhat it means
The magnitude never crosses 0 dBWcp does not exist → MF = ∞
The phase never crosses −180°Wcg does not exist → MG = ∞, stable for every K
At −180° the magnitude is exactly 0 dBMG = 0 dB, MF = 0° → the edge
At −180° the magnitude is ABOVE 0 dBMG < 0 dB → unstable

MATLAB: margin(L) draws the same, with Gm and Pm in the title. [Gm,Pm,Wcg,Wcp] = margin(L) gives the numbers (Gm as a ratio, mag2db(Gm) in dB). Several K at once: bode(50*G,125*G,1000*G).

Quick check

Motor: which K gives exactly MF = 60°?

FR-02 p. 4–7 · FR-03 p. 7 (oven), p. 9–11 (MG, MF, Ms) · examen práctico 1, apartado 1.3