Bode Plot Lab (2D)

The same loop as the 3D Bode lab seen as a Nyquist diagram with phase and gain margins, plus Bode curves, closed-loop poles and the step response.

Switch to 3D

Presets

Playback

Loop gain

Open loop L(s) = K (1 + s/z) / ( s (1 + s/p1)(1 + s/p2) ), the zero only when switched on.

Poles and zero

Frequencies as log10 of rad/s (so 0.301 means 2 rad/s). Zero switch: 0 off, 1 on.

Layers

Model checks

The science

Open loop and the Bode plot

The open-loop frequency response is L(jω) = K (1 + jω/z) / ( jω (1 + jω/p1)(1 + jω/p2) ). Its magnitude in decibels, 20 log10|L|, and phase are the two Bode curves: each pole bends the magnitude down by 20 dB per decade and adds up to −90° of phase; the optional zero does the opposite. The integrator (1/s) gives −90° at low frequency and a final value of exactly 1 for a unit step.

Margins and the Nyquist diagram

The gain crossover ωc is where |L| = 1; the phase margin is 180° + arg L(jωc). The phase crossover ω180 is where arg L = −180°; the gain margin is −20 log10|L(jω180)|. On the Nyquist plot they measure how far the curve passes from the critical point −1, in angle and in gain. A unity-feedback closed loop around this minimum-phase L is stable when both margins are positive.

Poles, root locus and step response

The closed-loop poles are the roots of s3/(p1p2) + s2(1/p1 + 1/p2) + s(1 + K/z) + K = 0 (the K/z term only with the zero). Routh-Hurwitz says it is stable when all coefficients are positive and a2a1 > a3a0; without the zero this gives K < p1 + p2. The page finds the roots numerically and integrates the closed-loop step response.

Honest simplifications

The loop is the fixed third-order structure of the 3D page: no time delay, no saturation and unity feedback. A pure integrator makes the diagram's real part tend to a constant at low frequency, so the Nyquist contour has no closing arc around the origin. Phase margin below 30 degrees or gain margin below 6 dB is flagged "Marginal", as on the 3D page; real designs usually keep about 45 degrees and 6 to 10 dB.

What to try
  • Start with the default: phase margin about 27 degrees, gain margin 12.9 dB and a ringing step response with large overshoot.
  • Raise K to 22 (p1 + p2): the gain margin hits 0 dB, the poles sit on the imaginary axis and the Nyquist curve touches -1.
  • Pick Unstable: the curve now crosses to the left of -1 and the step response grows.
  • Switch on the zero at 50 rad/s: it adds phase lead and raises both margins, and the Lead zero preset rescues the K = 30 loop.
Bode magnitude (dB)
Bode phase (deg)
Closed-loop unit step response
Root locus (poles versus K)