---
title: Frequency response and stability margins
url: https://doc.liz6.com/en/theory/02-control-theory/06-frequency-response-and-margins
locale: en
area: theory
tags:
- Control theory
- Theory
date: 2026-09-10
modified: 2026-09-10
description: A system may follow slow changes while attenuating and lagging fast ones. Frequency response organizes that behavior by frequency and reveals how much feedback margin remains. Begin with Transfer functions and poles.
---

# Frequency response and stability margins

A system may follow slow changes while attenuating and lagging fast ones. Frequency response organizes that behavior by frequency and reveals how much feedback margin remains. Begin with [Transfer functions and poles](05-transfer-functions-and-poles.md).

## Probe with a sinusoid

For a stable LTI plant and $u(t)=A\sin\omega t$, after initial transients decay,

$$y(t)=A|P(j\omega)|\sin[\omega t+\arg P(j\omega)].$$

Magnitude is the amplitude ratio; phase is the shift within a cycle. Angular frequency is in rad/s, with $f=\omega/(2\pi)$ in Hz. For $P=50/(100s+1)$,

$$|P(j\omega)|=\frac{50}{\sqrt{1+(100\omega)^2}},\qquad \arg P(j\omega)=-\arctan(100\omega).$$

At $\omega=0.01$, the ratio is 35.36 and phase −45°. This does not imply a fixed delay for every signal: different frequencies can have different phase relationships.

## Analyze the loop, not only the plant

The closed-loop denominator is $1+L$, where $L=PC$. Use a normalized example

$$L(s)=\frac2{s+1}e^{-\tau_ds}.$$

Its plant time constant is 1 s, unlike the earlier thermal model. Without delay, the closed-loop pole is −3. Pure delay has response $e^{-j\omega\tau_d}$, unit magnitude and phase $-\omega\tau_d$ radians.

Gain crossover satisfies $|L(j\omega_c)|=1$, giving $\omega_c=\sqrt3\approx1.732$ rad/s. The delay-free phase there is −60°, hence phase margin 120°. With delay,

$$\mathrm{PM}=120^\circ-\omega_c\tau_d\frac{180^\circ}{\pi}.$$

At 0.5 s the margin is approximately 70.4°. Its first zero occurs at delay 1.209 s. For this open-loop-stable, single-gain-crossover example, that is the first instability boundary. It is not a universal formula for every loop.

**Frequency response and stability margins · Experiment**

Loop L(s)=2e^(−τs)/(s+1). Vertical markers locate gain crossover √3 rad/s. Pure delay preserves magnitude and reduces phase. Sinusoids show the loop response, not a closed-loop step.


Change delay: magnitude remains fixed while phase falls. Vertical markers locate gain crossover. Change probe frequency to inspect sinusoidal steady-state gain and phase. Phase curves are unwrapped rather than folded back after −180°.

## Bode, gain margin and Nyquist

A Bode diagram plots $20\log_{10}|L|$ and phase against logarithmic frequency. 0 dB is magnitude 1; −6.02 dB is approximately 0.5. Loop gain is dimensionless. Dimensional plant plots need a stated normalization or unit reference.

At phase crossover $\omega_\pi$, phase is −180°. Gain margin is $1/|L(j\omega_\pi)|$, or $-20\log_{10}|L(j\omega_\pi)|$ dB. No finite phase crossover may yield infinite gain margin, but that does not imply tolerance of unlimited unmodeled delay.

The full Nyquist criterion follows the image of a contour enclosing the right half-plane. Encirclements of −1 together with open-loop unstable poles determine closed-loop unstable poles through the argument principle for $1+L$. Specify contour direction and how imaginary-axis poles are bypassed. Open-loop instability, multiple crossovers and hidden internal modes require more than a single positive phase-margin number.

## Bandwidth is a tradeoff

Higher crossover often speeds response, but a fixed delay costs more phase at higher frequency. Noise and unmodeled high-frequency modes also become more relevant. Plant bandwidth, loop crossover and closed-loop threshold bandwidth are distinct quantities.

Do not maximize phase margin in isolation. Compare speed, disturbance rejection, action limits and robustness. [Constraints and robustness](08-constraints-and-robustness.md) identifies the individual signal paths using sensitivity functions.

## Check your understanding

Does adding 0.5 s pure delay to $2/(s+1)$ change gain crossover?

<details><summary>Reasoning</summary>

No: delay has unit magnitude, so crossover stays $\sqrt3$. Phase margin nevertheless falls from 120° to about 70.4°.

</details>

If a tool returns `gm=2`, does it mean 2 dB?

<details><summary>Reasoning</summary>

A linear gain factor of 2 is about 6.02 dB. Check units and which crossover each returned frequency describes.

</details>

## Further reading

The [python-control `margin` documentation](https://python-control.readthedocs.io/en/stable/generated/control.margin.html) defines gain margin, phase margin in degrees, and both crossover frequencies. Inspect complete behavior when multiple crossovers exist.
