All articles
Stability July 2, 2026 2 min read

Gain margin and phase margin: how robust is your loop?

A plain-language introduction to the two frequency-domain numbers that tell you how close a control loop is to instability.

A controller can look perfect in a simulation and still fail in the field, because the real process never matches the model exactly. Gain and phase margin quantify how much error the loop can absorb before it becomes unstable. PID Solver 360 computes both from the open loop L(jω) = C(jω)·G(jω) after every simulation.

Phase margin

Phase margin (PM) is the extra phase lag the loop can tolerate at the frequency where the open-loop gain is 1 — the gain-crossover frequency ωgc. Unmodelled dead time, a coarse sample period, or an extra sensor filter all add lag. A phase margin of 30–60° is the usual target for process loops; below 30° the step response tends to ring; below 15° it is often unusable in production.

Gain margin

Gain margin (GM) is how much the loop gain can increase — for example if the process gain K drifts high — before instability, measured at the frequency where phase first reaches −180°. Report GM in decibels: GM (dB) = −20 log10 |L(jωpc)| where ωpc is the phase-crossover frequency. Aim for more than 6 dB (a factor of two in gain).

Typical step overshoot vs phase margin

Rule-of-thumb for FOPDT temperature and flow loops — not a guarantee for every plant.

Using them together

  • Both margins comfortably positive → a robust loop that tolerates model error and valve nonlinearity.
  • Small margins → a fast but fragile loop, close to sustained oscillation after a disturbance.
  • Either margin negative → the linearised loop is unstable; do not commission.

Time-domain metrics (overshoot, settling time) tell you how the loop looks. Margins tell you how much the plant can change before it breaks. Use both: simulate a setpoint step and read the Bode plot in the solver.

Quick tuning checklist

  1. Run a closed-loop step with your candidate gains.
  2. Check PM ≥ 30° and GM ≥ 6 dB.
  3. If margins are low but the response looks good, the model may be optimistic — add dead time in simulation and retest.
  4. If margins are high but the loop is sluggish, increase Kp slightly or reduce Ti, then recheck margins.

See also Bode and Nyquist plots for PID loops and how to reduce overshoot.

Try it in the solver

Put this into practice — model your process, auto-tune it and check the stability margins.

Launch PID Solver 360