Formula & Calculator

Gain Margin

Gain margin tells you how much you can increase the gain of a feedback control system before it becomes unstable and starts oscillating out of control. It is calculated at the frequency where the phase shift is exactly 180 degrees. If the gain margin is large, the system is very stable. If it is close to one, the system is on the edge of instability. Engineers use it to design safe and robust controllers.

Control Systems Stability
CONTROL SYSTEMS · STABILITY MARGINS

Gain Margin Calculator

Find how much extra loop gain a feedback system can take before it goes unstable — convert between the magnitude at the phase crossover, the gain margin in × and dB, and optionally derive everything from a type-1 open-loop transfer function.

GM = 1 / |G(jωpc)| · GMdB = −20·log₁₀ |G(jωpc)|
Solve for
Magnitude at Phase Crossover |G(jωpc)| The open-loop gain magnitude at the frequency where the phase reaches −180°. Read it off a Bode plot, in × or dB.
Enter a valid magnitude (above 0 in × units).
Gain Margin (GM) How much the loop gain can increase before the closed loop reaches instability. GM = 1 / |G(jωpc)|.
Enter a valid margin (above 0 in × units).
G(s) = K / [ s·(τ₁s + 1)(τ₂s + 1) ]
Enter K, τ₁ and τ₂ greater than 0 to derive the magnitude.
K is also used for the critical-gain stat when you are not deriving from G(s).
GAIN MARGIN
2× ADEQUATE
GM = 2 × = 6.0206 dB
GM = 1 / |G(jωpc)|
Gain margin GM
—
Magnitude |G(jωpc)|
—
Stability at this margin
—
Gain headroom
—
Critical gain Kc = GM·K
—
Phase crossover ωpc
—
Step-by-step solution
Sensitivity (+1% change)
Gain margin vs. loop-gain scaling

Scales the loop gain by a multiplier k and plots the remaining margin in dB. Every doubling of gain costs 6.02 dB, and the line crosses 0 dB at k = GM, which is exactly where the closed loop becomes marginally stable. The dashed 6 dB line is the common minimum design target.

Bode plot of your G(s) with the phase crossover marked

Magnitude (teal, left axis) and phase (amber, right axis) of G(s) = K / [s(τ₁s+1)(τ₂s+1)]. The red markers sit at the phase crossover ωpc where phase = −180°. The gap between the magnitude curve and the 0 dB line at that frequency is the gain margin.

Gain margin on a Bode plot and a Nyquist plot
Magnitude (dB) Phase (°) 0 dB ωgc GM −180° −90° ωpc ω (log)
Re Im −1 −1/GM G(jω) crossing at |G| = 0.5 → GM = 2 (6 dB)

Left: the gain margin is the vertical distance from the 0 dB line down to the magnitude curve, measured at the phase crossover ωpc. Right: on the Nyquist plot the curve crosses the negative real axis at −1/GM. The closer that crossing sits to the critical point −1, the smaller the margin.

Reference & conversions
Ratio ↔ decibel conversion
GM (×)GM (dB)|G(jωpc)|
1.000 dB1.000
1.413.01 dB0.707
2.006.02 dB0.500
3.1610.0 dB0.316
5.0013.98 dB0.200
10.020.0 dB0.100
Rule-of-thumb gain margin guide
GMReading
< 0 dB (GM < 1)Unstable closed loop
0 dB (GM = 1)Marginally stable, sustained oscillation
0 – 6 dBLow margin, fragile to gain changes
6 – 12 dBTypical design target
> 12 dBConservative, very robust to gain error

Conversions: GM(dB) = 20·log₁₀(GM), and |G(jωpc)|(dB) = −GM(dB). Gain margin is usually paired with a phase margin of 30° to 60°.

What changes the gain margin

Loop gain K ↑

Raising K scales |G| up everywhere, so GM falls in proportion. Doubling K removes 6.02 dB of margin.

More lag or delay

Extra lag, delay or slower poles pull the phase crossover to a lower frequency where the gain is higher, shrinking the margin.

Lead compensation

A lead network adds phase near crossover, which pushes the phase crossover out to higher frequency and improves the margin.

What Is Gain Margin?

Gain margin is a stability measure for a feedback loop. It tells you by what factor the open-loop gain could increase before the closed loop becomes unstable. A gain margin of 2 (6 dB) means you could double the loop gain and still sit on the edge of stability. It guards against gain errors, component tolerances and modelling uncertainty.

The Gain Margin Formula

GM = 1 / |G(jωpc)|   ·   GMdB = −20·log₁₀ |G(jωpc)|

Here ωpc is the phase crossover frequency, the frequency where the open-loop phase equals −180°. At that frequency a loop gain of exactly 1 would feed back in perfect opposition and sustain an oscillation, so the margin is how far |G| sits below 1 there. If |G(jωpc)| is 0.5, GM is 2. The result is valid for a loop that is stable in open loop with a single phase crossover.

How to Calculate Gain Margin

Read |G(jωpc)| from a Bode plot at the frequency where the phase crosses −180°, enter it in × or dB, and the calculator returns the margin in both forms. You can also enter a known gain margin to get the magnitude back.

Solve forFormula
GMGM = 1 / |G(jωpc)|
|G(jωpc)||G(jωpc)| = 1 / GM
GM in dBGMdB = 20·log₁₀(GM) = −|G(jωpc)|dB
Critical gain KcKc = GM · K (the gain at which the loop turns marginally stable)

Gain Margin Formula Variables

SymbolMeaning
GMGain margin, as a ratio (×) or in decibels
G(jω)Open-loop frequency response of the loop
ωpcPhase crossover frequency, where ∠G(jω) = −180°
|G(jωpc)|Open-loop magnitude at the phase crossover
K, KcCurrent loop gain and the critical gain at which GM = 1
τ₁, τ₂Time constants of the example plant used for the derive option

Deriving the Margin from G(s)

For the common type-1 loop G(s) = K / [s(τ₁s+1)(τ₂s+1)], the phase is −90° − arctan(ωτ₁) − arctan(ωτ₂). Setting that to −180° gives ωpc = 1/√(τ₁τ₂). Substituting back, |G(jωpc)| = K·τ₁τ₂/(τ₁+τ₂), so GM = (τ₁+τ₂)/(K·τ₁τ₂) and the critical gain is Kc = 1/τ₁ + 1/τ₂. Turn on the derive option in Advanced mode to compute these and see the Bode plot.

Gain Margin vs. Phase Margin

The two margins check stability from different angles. Gain margin asks how much gain error the loop tolerates at the phase crossover, while phase margin asks how much extra phase lag it tolerates at the gain crossover, where |G| = 1. A robust design checks both, since a loop can have a healthy gain margin and a thin phase margin, or the reverse.

Gain Margin Calculation Example

Given: G(s) = 2 / [ s(s + 1)(0.5s + 1) ], so K = 2, τ₁ = 1 s, τ₂ = 0.5 s
ωpc = 1/√(1 × 0.5) = 1.414 rad/s
|G(jωpc)| = 2 × 1 × 0.5 / 1.5 = 0.667 → GM = 1.5 × = 3.52 dB
Kc = 1/1 + 1/0.5 = 3, so the loop gain can rise from 2 to 3 before instability (a 50% increase)

Frequently Asked Questions

A positive GM in dB means |G(jωpc)| is below 1, so the loop gain is too small to sustain oscillation at the phase crossover. Negative dB means |G| exceeds 1 there and the closed loop is unstable. This holds for typical loops that are stable in open loop.

Then there is no phase crossover and the gain margin is infinite, as with a first- or second-order loop whose phase stays above −180°. Gain alone cannot destabilise it, though real delays and unmodelled dynamics usually add lag at high frequency.

Six dB (a factor of 2) is a widely used rule of thumb, often quoted alongside a phase margin of about 45°. The right target depends on how uncertain your plant model is and how costly instability would be, so safety-critical loops often demand more.

Yes, for conditionally stable systems that are stable only within a band of gains, where reducing the gain causes instability. For those, the simple GM = 1/|G(jωpc)| rule does not tell the whole story and you should inspect the Nyquist plot.

Only for the type-1 example G(s) = K / [s(τ₁s+1)(τ₂s+1)] in derive mode. For any other loop, find ωpc on a Bode plot or with software, read |G(jωpc)|, and enter it directly in basic mode.

Calculating Gain Margin...

What it means

Gain margin (GM) is the amount by which the gain of a control system can be increased before it becomes unstable. It is defined as GM = 1 / |G(jω_pc)|, where ω_pc is the phase crossover frequency (where the phase is −180°). A positive gain margin (in dB) indicates stability. A gain margin of 6 dB is typically considered acceptable. Gain margin is measured from the Bode plot. Example: If at the phase crossover frequency, the magnitude is 0.5 (i.e., −6 dB), then GM = 1/0.5 = 2 (or 6 dB). This means the gain can be doubled before the system becomes unstable. A higher gain margin provides more robustness.

Worked example

Gain Margin – Practical Example

Real‑World
Scenario: At the phase crossover frequency, the magnitude of the open‑loop transfer function is |G(jω)| = 0.5. Find the gain margin.
ParameterValue
|G(jωpc)|0.5
FormulaGM = 1 / |G(jωpc)|
1GM = 1 / 0.5 = 2
2In dB: GMdB = 20·log₁₀(2) ≈ 6 dB
Final Design GM = 2 (6 dB) ✓ Stable
Why: Gain margin tells how much gain can be increased before instability – positive dB means stable.

Common mistakes

Watch unit consistency and the assumptions behind the formula; misapplying it outside its valid conditions is the most frequent error.

Applications

Gain margin GM = 1/|G(jω_pc)| is the amount of gain increase before instability, based on the phase crossover frequency. It is used in frequency‑domain stability analysis, along with phase margin. Engineers use it to ensure robust stability in the presence of uncertainties. This is a key metric in control system design.

  • Control system stability and robustness assessment
  • Loop gain design and compensation
  • Frequency response analysis (Bode, Nyquist)
  • System performance and tolerance analysis
  • Educational understanding of gain margin

Suggest an improvement

Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.

Page details

1,140

Views
  • Published July 10, 2026
  • Last updated September 16, 2026