step+−K = 41/(s+1)³|L| — ∠L —×1.00 ∠0°
0.20.5125-40-20020ω (rad/s)dBBODE MAGNITUDE |L(jω)|0.20.5125-270-180-900ω (rad/s)degBODE PHASE ∠L(jω)-2-101-10ReImNYQUIST L(jω), ω ≥ 005101520012t (s)CLOSED-LOOP STEP RESPONSE y(t)K = 8K = 4K = 2
Lit wire with moving dashes: a signal is flowing along itBlocks: test signal, summing junction, gain K (dial), plant G(s) and the loop meterThe pill on the return path is the sine coming back: its size |L| and shift ∠LPlots: Bode magnitude and phase, Nyquist and step responses, all computed from the modelA unity-feedback loop, gain K and plant G(s) = 1/(s+1)³. Cut at the junction, a test sine goes round once and the loop meter reads how much bigger or smaller, and how far shifted, it comes back. The plots are computed from the model as the steps play: the open-loop Bode magnitude and phase with both margins drawn as bars, the Nyquist plot with the unit circle and −1, and the closed-loop step responses. Margins read at a single crossover can mislead when a Bode plot crosses 0 dB or −180° more than once, or when the open loop is itself unstable. Then go back to the full Nyquist plot.

The question

  1. This is the loop from the Nyquist lesson: a gain K = 4, the plant G(s) = 1/(s+1)³ and negative feedback. Nyquist said it is stable. Now we ask how stable: how far is it from the edge?

Gain margin

Phase margin

Using the margins

What is happening

# step 1/10 · loop
# about: Junction Σ, Gain K, Plant G(s)

open loop    L(s) = K·G(s) = 4/(s+1)³
closed loop  y/r = L/(1 + L)

Nyquist: no encirclement of −1, so
the closed loop is stable.

A yes/no answer is not enough: a part
wears, a gain drifts. How much change can
the loop take before it goes unstable?

The loop is L(s) = K/(s+1)³ with unity negative feedback. Every curve is computed from that formula; the step responses are simulated from the closed-loop equation y''' + 3y'' + 3y' + (1 + K)y = Kr. The Python on the margin steps is plain Python 3 (math only): a bisection finds each crossover, then one line reads the margin. python-control's control.margin returns the same four numbers.