DEV Community

Cover image for The Nyquist Stability Criterion: Knowing a Loop Is Stable Before You Close It
NovaSolver
NovaSolver

Posted on • Originally published at novasolver.jp

The Nyquist Stability Criterion: Knowing a Loop Is Stable Before You Close It

Anyone who has held a microphone too close to its own speaker knows the sound: a quiet hum that swells into a piercing howl within a second. Nothing about the room changed in that second. What changed is that a signal found a path back to its own input with enough strength and the wrong timing, and the loop fed on itself. That runaway is instability, and the unsettling part is that it was latent the whole time — the system looked fine until it suddenly was not.

The Nyquist stability criterion exists to remove that surprise. It lets you take the open-loop behaviour of a system — the loop measured or modelled with the feedback path broken — and decide, before ever closing the loop, whether the closed loop will be stable. This article explains the idea, shows how to read the stability margins it produces, and works a concrete example.

Why this calculation matters

Feedback is everywhere a system has to hold a target: cruise control, a voltage regulator, a drone holding altitude, a furnace holding temperature. Feedback is also what makes those systems capable of instability. Close a loop carelessly and you do not get a slightly worse response — you can get sustained oscillation or a divergent one.

The deep convenience of the Nyquist criterion is that it answers a closed-loop question using open-loop data. The open-loop response is the easy thing to obtain: you can compute it from the plant and controller models, or measure it directly by injecting a signal and breaking the loop. From that one curve, Nyquist tells you the fate of the closed loop. Just as important, it does not give a bare pass or fail — it tells you how close to instability you are, through the gain and phase margins. Those margins are what separate a robust design that tolerates real-world variation from a fragile one that was only ever stable on paper.

The core method

The Nyquist plot is the open-loop frequency response drawn as a single curve in the complex plane. As frequency omega sweeps from zero upward, the open-loop transfer function L(j*omega) traces a path; its distance and angle from the origin are the loop gain and phase at each frequency. The criterion compares how that curve relates to one special location — the point at -1 on the real axis, which represents a gain of exactly 1 with a phase of exactly -180 degrees. That is the condition for a signal to return to the input unchanged and self-sustaining.

For the common case of a stable open-loop system, the rule reduces to something simple: the closed loop is stable if the Nyquist curve does not encircle the -1 point. How far the curve stays from -1 is the margin, and we read that margin at two specific frequencies.

The phase margin is measured at the gain crossover frequency — the frequency where the open-loop gain passes through 1, or 0 dB. It is the extra phase lag the loop could absorb at that frequency before the phase reaches -180 degrees:

phase margin = 180 + (open-loop phase at gain crossover)
Enter fullscreen mode Exit fullscreen mode

The gain margin is measured at the phase crossover frequency — the frequency where the open-loop phase passes through -180 degrees. It is how much the gain could rise before it reaches 0 dB:

gain margin (dB) = 0 - (open-loop gain in dB at phase crossover)
Enter fullscreen mode Exit fullscreen mode

In words: phase margin is your buffer against extra delay, and gain margin is your buffer against extra gain. A healthy loop has both.

A worked example

Suppose you have measured the open-loop frequency response of a feedback loop and want to read its stability margins.

Step 1 — find the gain crossover and read the phase margin. Locate the frequency where the open-loop gain is 0 dB. Read the phase at that frequency: it is -135 degrees. The phase margin is the gap to -180 degrees:

phase margin = 180 - 135 = 45 degrees
Enter fullscreen mode Exit fullscreen mode

The loop could tolerate an additional 45 degrees of phase lag — perhaps from an unmodelled delay — before the phase at gain crossover hits -180 degrees.

Step 2 — find the phase crossover and read the gain margin. Locate the frequency where the open-loop phase is -180 degrees. Read the gain there: it is -8 dB. The gain margin is how far that sits below 0 dB:

gain margin = 0 - (-8) = 8 dB
Enter fullscreen mode Exit fullscreen mode

The loop gain could rise by 8 dB — a factor of about 2.5 — before the gain at phase crossover reaches unity.

Step 3 — judge the result. A phase margin near 45 degrees and a gain margin in the 6 to 10 dB band are the textbook signature of a well-damped, robustly stable loop. This design has 45 degrees and 8 dB, so it sits comfortably in that target zone. It will settle quickly without ringing excessively, and it has real headroom against the gain drift and extra lag that any physical system eventually develops.

Common mistakes

Reading margins off the closed-loop response. Gain and phase margins are defined on the open-loop curve. Computing them from the closed-loop frequency response confuses two different functions and gives numbers that mean nothing.

Assuming a stable open-loop system makes the simple rule always apply. The "no encirclement of -1" shortcut holds when the open-loop transfer function has no poles in the right half-plane. If the plant is itself unstable, the full criterion counts encirclements against those poles, and the closed loop may actually need a specific number of encirclements to be stable.

Trusting one margin alone. A loop can show a generous gain margin and a poor phase margin, or the reverse. Conditionally stable systems can even cross 0 dB more than once. Always read both margins, and on a tricky plot check the whole curve, not just the two crossover points.

Treating a large phase margin as always better. Very high phase margin often means a sluggish, overdamped response. Margins around 45 to 60 degrees usually balance speed against robustness; chasing 80 degrees can cost you bandwidth you wanted.

Forgetting pure time delay. A delay adds phase lag that grows without limit as frequency rises, while leaving the gain untouched. It can erase a comfortable phase margin entirely, and it never shows up if you only look at a gain plot.

Try the interactive NovaSolver calculator

Sweeping a curve through the -1 point in your head is hard; watching it move is not. The Nyquist Diagram & Stability Margin Calculator on NovaSolver lets you choose an open-loop transfer function and adjust the gain K while the Nyquist plot redraws in real time, and it computes the gain margin, phase margin, and crossover frequencies automatically — with a stability verdict and a Bode plot comparison — so you can see exactly how raising the gain pushes the curve toward the critical point.

Related calculators

  • Bode plot generator — read the same margins from stacked gain and phase curves, which is often the easier view for loop shaping.
  • Root locus plotter — track where the closed-loop poles travel as gain rises, and see instability as a pole crossing into the right half-plane.
  • PID tuning calculator — once the margins tell you what the loop needs, tune the controller that delivers it.

You can browse the full set in the controls and frequency response tools hub.

Closing note

The Nyquist criterion is one of the most quietly powerful ideas in control engineering: it converts a closed-loop stability question into a geometry problem about one curve and one point. Stay clear of -1 and the loop is stable; the distance you keep is your margin. Aim for a phase margin near 45 degrees and a gain margin of 6 to 10 dB, read both numbers rather than one, and respect time delay as the silent margin-eater. Get the open-loop curve right and you will know how the closed loop behaves long before you commit to closing it.

Top comments (0)