# Intuitively, why does gain margin and phase margin infer instability in feedback system?

On MATLAB https://www.mathworks.com/help/control/ref/margin.html, gain margin and phase margin are additional gain in the system and additional delay in the phase of the system such that the system will be unstable.

Can someone explain with an example as to:

1. why increasing the "gain" of your system will cause instability,
2. why delaying a signal will cause instability? This doesn't seem to be very intuitive at all. Because if I delay my sine by 2π I get back my sine again.
3. How does gain and delay translate into physical components inside of a feedback system (say a circuit). Intuitively, a gain is an op amp, what about a delay?

Also, what does instability here refer to? Are we talking about the circuit going into oscillation or blow up behavior?

why increasing the "gain" of your system will cause instability

If you have a servo control mechanism and you set a demand, the servo should rotate (or move) to the position demanded and all is good. However, if you have too much gain, the servo rapidly moves off in the direction needed but overshoots the target due to the momentum built up in the rapid acceleration. This may eventually settle down or it may just continue to oscillate (unstable).

why delaying a signal will cause instability? This doesn't seem to be very intuitive at all. Because if I delay my sine by 2π I get back my sine again.

You've basically described the reason why sustained oscillations might occur - basically you don't want a delay because a delay is likely to cause problems as you have described i.e. sustained oscillations.

How does gain and delay translate into physical components inside of a feedback system (say a circuit). Intuitively, a gain is an op amp, what about a delay?

Gain might be from an op-amp or, you might have a totally digital control with ADCs and DACs. An op-amp might be used as an integrator rather than strictly speaking a gain stage AND, if you apply gain, integration and differentiation (maybe three op-amp circuits) you get a PID controller: - Pretty picture taken from here (a public domain image).

If you study the above you will see it moves through three phases.

• Purely applying gain until there is potentially too much overshoot but there is still a basic control inaccuracy
• Then applying an integration term to improve the basic control accuracy but it risks creating too much overshoot
• Applying a differential term to the above to restore sensible operation by dramatically reducing overshoot.

Also, what does instability here refer to? Are we talking about the circuit going into oscillation or blow up behavior?

I think I've covered this.

The key of these stability questions is Nyquist´s stability criterion (which - in this case - can be expressed also with Barkhausens`s oscillation condition): LOOP GAIN OF UNITY.

That means: A circuit with feedback will become unstable (oscillation or transistion to saturation) if at a certain frequency

• the total phase shift of the loop gain function reaches -360 deg (identical to 0 deg) and (at the same time)

• the loop gain magnitude is larger than (or equal to) 0 dB (unity).

1.) That means, in turn, if at a phase shift of -360 deg the loop gain magnitude is already a dB below below unity (0 dB), we have a gain margin of a dB. If we would increase the loop gain by a dB the system would reach the mentioned stability limit.

2.) On the other hand, if the loop gain is 0 dB and the phase has not yet reached the critical value of -360deg (for example: -300 deg), we have a phase margin of 60deg because the stability limit would be reached if we would introduce another -60deg within the feedback loop (or a corresponding delay which causes at the critical frequency this additional phase shift).

Comment: In many practical cases, it is not a delay (phase shift in deg.=delay time * frequency) that causes an additional (unwanted) phase shift but parasitic (or neglected) capacitive influences. For example, it is common practice to use IDEAL opamp models during calculation (non-inverting gain: 1+R2/R1). However, in reality, each opamp has a FINITE and frequency-dependent gain (instead of infinite) and introduces a frequency-dependent phase shift within the feedback loop. Both properties are often neglected during design of amplifier stages. However, both - gain and phase margin - will be smaller than expected based on the assumed idealized parameters.

My example is a control system with a negative feedback loop. You observe an error at the output of the plant. Your controller changes the input to the plant after some delay and that again changes the output.

Now think of an error that is not DC. The error will change periodically. If you are unlucky, it has changed sign during the delay, so the correction adds to the error instead of canceling it. This effect is strongest if the delay equals half your errors period, in other words, phase shift 180° (for negative feedback loops. For positive feedback, it is 360°). It does of course also depend on feedback gain.

Filters, the most common circuits in feedback loops, shift phase (and of course have gain) depending on frequency. Fancier circuits like integrators or differentiators (found in PID-controllers) usually shift phase by +/-90°. The plant itself may have frequency dependent behavior. Time-discrete (digital) systems often have delays of several clocks (samples) because of registered stages (flip-flops).

To analyze, you simulate the open loop (including plant) and create a Bode-plot. This shows phase and gain, depending on frequency. Two easy criteria help you to optimize the system: Your gain at 180° should be less than 0dB (<-6dB to minimize ringing) and your phase at 0dB gain should deviate at least by 50° from 180°.

• Andreas, resulting from earlier discussions, I know that beginners do not know if the critical phase is -180deg or -360deg. Therefore, I like to clarify: -180deg do NOT contain the inverting mode at the summing junction (in case of negative feedback) and the mentioning of -360deg concerns the real LOOP GAIN (of the complete loop) - including the minus sign at the summoing junction. – LvW Nov 24 '16 at 10:17
• @LvW I agree with your remark and with your answer. I hesitated to use a different convention in my answer, but I usually find the negative more intuitive. After all, changing sign and shifting by 180° are not the same for non-periodic signals. What is an input step shifted by 360°? The negative convention fits these cases better. – Andreas Nov 24 '16 at 10:31
• Andreas, I know what you mean - however, at first, stability margins and gain quantities (like loop gain) apply to sinusoidal waveforms only (not for non-periodic or periodic non-sinusoidal forms) and secondly, there are negative feedback systems with signal inversion WITHIN the loop (and NOT at the summing junction). In this case, you MUST use the 360deg criterion. Therefore, I strongly do recommend the universal real loop gain criterion (with the 360deg limit) – LvW Nov 24 '16 at 12:08

Barkhausen, in researching microwave oscillators, developed two requirements for an oscillator: (1) loop gain greater than 1 (2) exactly N*360 degrees feedback (N can be 0,1,2,3,4...) at a frequency where loop gain is greater than 1

Some oscillators include transformers or PI resonators, so I've added a (3): the loop needs net power gain.