17 Stability and Robustness Margins

17.1 Theory

17.1.1 Phase and Gain Margins

To achieve the objectives discussed in Chapter 19, the closed-loop system must be stable. Recall that tracking performance and disturbance rejection characteristics are determined by the loop shape at low frequencies when \(\left|P(j\omega)C(j\omega)\right|\gg 1\). Similarly, noise attenuation properties are determined by the loop shape at high frequencies when \(\left|P(j\omega)C(j\omega)\right|\ll 1\). In both cases we ignored the phase of \(P(j\omega)C(j\omega)\). It turns out that stability of the closed-loop system is determined by the phase of \(P(j\omega)C(j\omega)\) when \(P(j\omega)C(j\omega)=1\), as depicted in Fig. 17.1.

The shape of the magnitude plot primarily determines the tracking and disturbance rejection characteristics at low frequencies and the noise attenuation at high frequencies. Stability is primarily determined by the phase at the crossover frequency.

Define the crossover frequency \(\omega_{co}\) to be the frequency where \[\left|P(j\omega_{co})C(j\omega_{co})\right|=1,\] or equivalently where \[20\log_{10}\left|P(j\omega_{co})C(j\omega_{co})\right| = 0\text{~dB}.\] The phase \(\angle P(j\omega_{co})C(j\omega_{co})\) at the crossover frequency plays a critical role in determining the stability of the system. To better understand why this is the case, consider the transfer functions from \(R\), \(D_{in}\), \(D_{out}\), and \(N\), to \(E\) in Equation 16.3. The denominator in each transfer function is \(1+P(s)C(s)\). Therefore, the closed-loop poles are given by the closed-loop characteristic equation \[1+P(s)C(s) = 0,\] or equivalently where \[P(s)C(s) = -1.\]

Recall that for any \(s\), \(P(s)C(s)\) is a complex number with magnitude and phase. Therefore, given any \(s_0\) we can draw \(1+P(s_0)C(s_0)\) in the complex plane as shown in Fig. 17.2.

The plot of 1+P(s_0)C(s_0) in the complex plane, is the sum of the complex number 1+j0 and P(s_0)C(s_0).

Since the physical response of the system is determined by \(P(s)C(s)\) evaluated on the \(j\omega\)-axis, there are stability problems if there exists an \(\omega_0\) such that \(P(j\omega_0)C(j\omega_0)=-1\), or in other words when \[\left|P(j\omega_0)C(j\omega_0)\right|=1 \qquad\text{and}\qquad \angle P(j\omega_0)C(j\omega_0) = -180^\circ,\] as shown in Fig. 17.3.

The plot of 1+P(j\omega_0)C(j\omega_0) in the complex plane when P(j\omega_0)C(j\omega_0)=-1.

Since the magnitude of the loop gain is equal to one at the crossover frequency \(\omega_{co}\), it turns out that the quality of stability is determined by the phase of the loop gain at the crossover frequency. Define the phase margin \(PM\) as \[PM = \angle P(j\omega_{co})C(j\omega_{co}) - (-180)^\circ.\] Fig. 17.4 depicts the phase margin on the Bode plot.

The phase margin PM is the difference between the phase of P(j\omega)C(j\omega) and -180 degrees at the crossover frequency \omega_{co}. The gain margin GM is the magnitude of P(j\omega)C(j\omega) when the phase crosses -180 degrees.

Chapter 17 interactive figure

Measure gain and phase margins on a Bode plot

Move the loop gain and added phase lag. The same loop shape is used in the gain and phase plots, so the crossover markers and margin measurements update together.

Increasing gain usually moves the gain crossover. Adding phase lag directly reduces the phase margin and can reduce the gain margin.

Figure 1.9. Interactive Figure 17.I1. Phase margin is read at gain crossover; gain margin is read at phase crossover.

Gain crossover

Phase crossover

Phase margin

Gain margin

Robustness note

Another way to understand the phase margin is shown in Fig. 17.5. The phase margin indicates the angular distance that \(P(j\omega_{co})C(j\omega_{co})\) is from \(-1\).

Alternative graphical view of the phase margin PM.

A related quantity is the Gain Margin \(GM\), which measures how far the magnitude \(\left|P(j\omega)C(j\omega)\right|\) is from unity when the phase \(\angle P(j\omega)C(j\omega) = -180\) degrees. The gain margin is depicted on the Bode plot in Fig. 17.4. An alternative view is shown in Fig. 17.6.

Alternative graphical view of the gain margin GM.

A good control design will have large phase and gain margins. A phase margin of \(PM=60\) degrees is considered to be very good and is optimal for many applications. A gain margin of \(GM=10\) dB would be considered very good for most applications.

17.1.2 Open and Closed Loop Frequency Response

From Equation 16.1, the transfer function from the reference \(R(s)\) to the output \(Y(s)\) is \[Y(s) = \frac{P(s)C(s)}{1+P(s)C(s)}R(s)\] Note that

When \(\left|P(j\omega)C(j\omega)\right|=1\), i.e., when \(\omega=\omega_{co}\), then \(\left|\frac{P(j\omega_{co})C(j\omega_{co})}{1+P(j\omega_{co})C(j\omega_{co})}\right|\) is a complex number divided by a complex number, and the magnitude will depend on the phase of the \(P(j\omega_{co})C(j\omega_{co})\), or in other words the phase margin \(PM\). As shown in Figure 17.5, \(PM\) will determine the magnitude of \(1+P(j\omega_{co})C(j\omega_{co})\). When \(PM\) is small, \(\left|1+P(j\omega_{co})C(j\omega_{co})\right|\) will be small and \(\left|\frac{P(j\omega_{co})C(j\omega_{co})}{1+P(j\omega_{co})C(j\omega_{co})}\right|\) will be larger than one. When \(PM\) is larger than \(90\) degrees, \(\left|1+P(j\omega_{co})C(j\omega_{co})\right|\) will be larger than \(\left|P(j\omega_{co})C(j\omega_{co})\right|\) and \(\left|\frac{P(j\omega_{co})C(j\omega_{co})}{1+P(j\omega_{co})C(j\omega_{co})}\right|\) will be less than one.

Fig. 17.7 shows the closed-loop Bode plot superimposed on the open-loop Bode plot for different values of the phase margin. Note that when the phase margin is \(PM=60\) degrees, the closed-loop frequency response looks very similar to the closed-loop frequency response for a second-order system when \(\zeta=0.707\), as shown in Fig. 15.9. Phase margins smaller than \(60\) degrees have a peaking response similar to a second-order system with \(\zeta<0.707\). Note also that the bandwidth of the closed-loop system is approximately the crossover frequency of the open-loop system. In general, the crossover frequency \(\omega_{co}\) plays a similar role for general systems that the natural frequency \(\omega_n\) plays for second-order systems.

Closed-loop Bode plot superimposed on the open-loop Bode plot, together with the closed-loop step response, for different phase margins.

Chapter 17 interactive figure

Phase margin, closed-loop peaking, and ringing

Predict what will happen before moving the slider: if the phase margin decreases, should the closed-loop frequency-response peak and the step-response overshoot increase or decrease? The plots use a second-order approximation to show the trend described in the text.

Figure 1.10. Interactive Figure 17.I3. Smaller phase margin increases the closed-loop resonant peak and step-response overshoot. Faint curves show reference cases at 45, 60, and 80 degrees.

Damping proxy

Closed-loop peak

Step overshoot

Design interpretation

Approximation used

Fig. 17.7 also shows the corresponding step response for the closed-loop system. The step response looks similar to the step response for second-order systems shown in Fig. 8.3, where again, the step response for \(PM=60\) degrees in Fig. 17.7 is roughly equivalent to the step response for \(\zeta=0.707\) in Fig. 8.4.

For a given reference signal, the size of the control signal \(u(t)\) is determined by the crossover frequency. A large crossover frequency will result in a larger control signal \(u(t)\). Fig. 17.8 shows the open and closed-loop transfer functions for a plant equal to \(P(s) = \frac{1}{s(s+1)}\) and for three different controllers that are tuned for equivalent phase margins but with crossover frequency at \(2\), \(20\), and \(200\) respectively. The corresponding control signal when the reference is a unit step is also shown in Fig. 17.8. Note that as \(\omega_{co}\) increases, the magnitude of the control signal increases and the speed of the response also increases. In fact, the integral of the control signals will be the same for each \(\omega_{co}\). Therefore, saturation constraints on \(u(t)\) will necessarily limit the size of the crossover frequency \(\omega_{co}\).

Closed-loop Bode plot superimposed on the open-loop Bode plot, together with the corresponding control signal, for different crossover frequencies.

Chapter 17 interactive figure

Crossover frequency and control effort

Move the crossover frequency while holding a similar phase-margin trend. The response gets faster as ωco increases, but the required control signal grows.

Figure 1.11. Interactive Figure 17.I4. Larger crossover frequency makes the response faster, but actuator effort increases.

Settling-time proxy

Peak control effort

Design warning

17.1.3 Bode Phase Gain Relationship

In Bode’s original work, he proved the following theorem that relates the slope of the magnitude plot to the phase.

. For any stable, minimum phase (i.e., zeros in the LHP), linear time-invariant system \(G(s)\), the phase of \(G(j\omega)\) is uniquely related to \(20\log_{10}\left|G(j\omega)\right|\) by \[\tag{17.1} \angle G(j\omega_0) = \frac{1}{\pi}\int_{-\infty}^{\infty} \left(\frac{dM}{du}\right)W(u)\,du,\] where \[\begin{aligned} M &= 20\log_{10}\left|G(j\omega)\right|, \\ u &= \log_{10}\left|\frac{\omega}{\omega_0}\right|, \\ W(u) &= \log_{10}\left(\coth \frac{\left|u\right|}{2}\right). \end{aligned}\]

The term \(\frac{dM}{du}\) in Equation 17.1 is the slope of the magnitude of \(G(j\omega)\) on the Bode plot. A plot of \(W(u)\) is shown in Fig. 17.9, where it can be seen that \(W(u)\) heavily weights the slope of the Bode magnitude around \(\omega_0\), but also includes bleed-over from the slope for roughly a decade before and after \(\omega_0\). This implies that the phase of \(P(j\omega)C(j\omega)\) at \(\omega=\omega_0\) is determined by the slope of the Bode magnitude plot in a region about \(\omega_0\).

The weighting function W(u) in the Bode gain-phase relationship heavily weights the slope around \omega_0.

Recall that the phase for an integrator \(1/s\) is \(-90\) degrees and that the phase for a differentiator is \(90\) degrees. Also, recall that the phase for a constant is \(0\) degrees. Therefore, we can approximate Equation 17.1 as follows:

Of course, these values are approximate and require that the slope around \(\omega_0\) persist for approximately a decade before and after \(\omega_0\).

While we do not directly use Equation 17.1 in practice, it has clear implications for feedback design. In particular, the takeaway message is that to have a good phase margin, the slope of the Bode magnitude plot at the crossover frequency \(\omega_{co}\) cannot be too steep, and that it needs to be reasonably shallow for roughly a decade before and after crossover. As a rule of thumb, a phase margin of \(PM=60\) degrees requires that the slope at crossover is between \(-20\) dB/dec and \(-40\) dB/dec. In other words, the ideal loop shape will need to look something like Fig. 17.10. It is also important to understand that the Bode phase-gain theorem requires that there is adequate frequency separation between the frequency content of signals that we are tracking or rejecting and the frequency content of the sensor noise that is to be attenuated.

The ideal loop shape is large at low frequencies to achieve good tracking and disturbance rejection, is small at high frequencies to attenuate sensor noise, has a shallow slope at the crossover frequency to achieve a good phase margin, and has a small enough crossover frequency to satisfy the input saturation constraints.

Chapter 17 interactive figure

Ideal loop-shape checklist

Adjust the loop-shape parameters and use the checklist to connect the ideal Bode picture in Figure 17.10 to the design requirement it represents.

Figure 1.12. Interactive Figure 17.I5. Adjust the loop shape and select checklist items to explain the ideal requirements in Figure 17.10.

Low-frequency gainDesign goal: make the loop gain large at low frequency.

Why it mattersLarge low-frequency loop gain makes the sensitivity function small where commands and disturbances usually have most of their energy.

How to check or fix itCheck that |PC| is well above 0 dB at low frequency. Increase low-frequency gain with integral action or lag, but watch the crossover frequency.

Current checklist status

Self-check Which design action best supports this region?

17.2.1 image Example Problem 3.1.20

For the single-link robot arm, use the bode and margin commands (from Python or MATLAB) to find the phase and gain margin for the closed-loop system under PID control. On the same graph, plot the open-loop Bode plot and the closed-loop Bode plot. What is the bandwidth of the closed-loop system, and how does this relate to the crossover frequency? Use the gains found in HW 3.1.13.

Design Study A guided exercise

Measure stability margins

Use the open-loop Bode plot to identify crossover, gain margin, phase margin, and bandwidth.

Bode
plots of open-loop and closed-loop PID-controlled arm responses.

Use this plot to identify gain crossover, phase margin, gain margin, and closed-loop bandwidth.

Step 1. Gain crossover definition

Step 2. Phase margin reference

Step 3. Bandwidth relationship

Pseudocode

The complete solution includes margin-plot code. Before opening it, outline how you would compute the open-loop and closed-loop transfer functions, measure margins, and annotate the Bode plot.

This prompt is ungraded. It is intended to connect the margin measurements to the implementation code in the complete solution.

17.3 Design Study B. Inverted Pendulum

17.3.1 image Example Problem 3.2.20

For this problem, use the gains found in HW 3.2.13.

Design Study B guided exercise

Measure pendulum stability margins

Compare inner-loop and outer-loop margins and bandwidths.

Inner-loop pendulum margins plot.

Use margin plots to compare crossover, phase margin, gain margin, and bandwidth.

Step 1. Inner-loop bandwidth

Step 2. Outer-loop bandwidth

Step 3. Bandwidth separation

Pseudocode

The complete solution computes separate inner-loop and outer-loop margin plots. Before opening it, outline each component separately.

These prompts are ungraded. They are intended to connect the derivation to the implementation code in the complete solution.

17.4 Design Study C. Satellite Attitude Control

17.4.1 image Example Problem 3.3.20

For this problem, use the gains found in HW 3.3.13.

Design Study C guided exercise

Measure satellite stability margins

Compare the inner and outer loop crossover frequencies, phase margins, bandwidths, and bandwidth separation.

Step 1. Inner-loop margin context

Step 2. Outer-loop margin context

Step 3. Successive-loop closure judgment

17.5 Coding Lab: Stability Margins

Objective: estimate gain crossover, phase margin, phase crossover, and gain margin from sampled Bode data.

Evaluation criteria: the lab checks interpolation at crossover points and compares the computed margins to a reference result.

Figure 17.1 (Interactive). Stability-margin coding lab with crossover annotations.

17.6 Knowledge Check

Q1. Phase margin location

Phase margin is measured at:

Q2. Gain margin location

Gain margin is measured relative to:

Q3. Phase margin calculation

If the phase at gain crossover is -135 degrees, enter the phase margin in degrees.

Show solution

Answer: 45 degrees because the phase is 45 degrees above -180 degrees.

Q4. Gain margin calculation

At phase crossover, the magnitude is -8 dB. Enter the gain margin in dB.

Show solution

Answer: 8 dB because the gain could increase by 8 dB before reaching 0 dB at phase crossover.

Q5. Missing crossover

If the Bode plot has no gain crossover, what should you say about phase margin?

Show solution

Answer: It is undefined or does not exist because there is no gain-crossover frequency where it can be measured.

Q6. Phase margin readout

At the gain-crossover frequency, the phase is -140 degrees. What is the phase margin?

Q7. Gain margin readout

At phase crossover, the magnitude is -12 dB. What is the gain margin?

Q8. Gain increase consequence

What commonly happens when loop gain is increased in a system whose phase becomes more negative at higher frequency?

Q9. Missing phase crossover

If the Bode plot does not show a phase crossover in the plotted frequency range, what should you conclude about gain margin from that plot alone?

17.7 Notes and References