Gain and phase margins: distance from instability
A Bode plot shows magnitude and phase shift of a system's response across frequency. Stability can be determined by checking how close the system comes to the point where magnitude is 1 (0 dB) and phase is -180 degrees. Gain margin is the amount by which magnitude can increase before reaching 0 dB at the frequency where phase is -180 degrees. Phase margin is how much phase lag can be added before reaching -180 degrees at the frequency where magnitude is 0 dB. Higher margins mean the system is farther from the instability boundary.
Practical margins in feedback control design
For a stable, well-behaved system, engineers target gain margin at least 2 (or 6 dB) and phase margin at least 30 to 60 degrees. Narrower margins make the system oscillatory and sensitive to parameter changes. A phase margin below 20 degrees creates overshoot and sluggish response; below 10 degrees, the system rings and may oscillate badly. Designers adjust controller gains or add filters (changing the Bode plot shape) to push the system away from the critical points while keeping bandwidth and settling time acceptable.