control//frequency response//stability margins//phase margin

The phase margin is the number of degrees of extra phase lag a feedback loop could take at its crossover frequency, where the loop gain equals one, before the total lag reaches 180 degrees and the loop oscillates; it is the most quoted single figure of a loop's robustness, with a usual target of 45 to 60 degrees (MATLAB's `pidtune` aims at 60 by default). It is the margin that filters, sampling, computation and slow actuators eat, because each of them adds lag and leaves the gain almost as it was.


The phase margin is the number of degrees of extra phase lag a feedback loop could take at its crossover frequency, where the loop gain equals one, before the total lag reaches 180 degrees and the loop oscillates; it is the most quoted single figure of a loop's robustness, with a usual target of 45 to 60 degrees (MATLAB's pidtune aims at 60 by default). It is the margin that filters, sampling, computation and slow actuators eat, because each of them adds lag and leaves the gain almost as it was.

The conversion from time to degrees is what makes it practical. A total delay τ\tauτ removes, at the crossover frequency fcf_cfc​ in hertz,

Δφ=360∘⋅fc⋅τ\Delta\varphi=360^\circ\cdot f_c\cdot\tauΔφ=360∘⋅fc​⋅τ

of phase margin. A drone's rate loop crossing at 15 Hz carries a typical chain: 2 ms from the IMU's filtering, 1 ms of sampling (half a period at 500 Hz), 1 ms for computation and writing to the motors. The 4 ms cost about 22 degrees of a margin that started between 45 and 60. That is why the inner loop runs fast and its filters are designed with care: in that loop each millisecond is worth five or six degrees.

It predicts how the loop rings. For a loop dominated by two poles, the damping ratio is roughly the phase margin in degrees divided by 100, so 60 degrees behaves like ζ≈0.6\zeta\approx0.6ζ≈0.6 with about 10 % overshoot, and 30 degrees like a loop that overshoots by a third and rings (second-order system). The rule is approximate and fails for loops with other dominant dynamics.

Every filter is a withdrawal from it. A first-order low-pass at fc′f_c'fc′​ lags by about arctan⁡(f/fc′)\arctan(f/f_c')arctan(f/fc′​) at frequency fff, so a filter placed one octave above crossover already takes over 25 degrees; filtering a noisy loop to make it look cleaner can be what tips it over (loop delay).

Converted into seconds, the same margin is the delay margin; read on the plot, it is the gap between the phase curve and −180∘-180^\circ−180∘ at crossover on the Bode plot; it is one of the stability margins, blind, like the others, to gain and phase degrading together.