May 12, 2024

Control System Tutorial: Definition of Phase Margin and Intuitive Understanding with MATLAB Examples


In this control engineering and control theory tutorial, we introduce the concept of phase margin. We explain how to identify the phase margin from Nyquist and Bode plots. The YouTube video accompanying this post is given below.

Definition of the Phase Margin and Crossover Frequency

Consider an open loop transfer function G(s). Figure 1 below shows the Nyquist plot of the G(j\omega), where j=\sqrt{-1} and \omega is the frequency. The point -1 is a critical stability point.

Figure 1: Open-loop frequency response (Nyquist plot) of the open-loop transfer function G(j\omega) illustrating phase margin and crossover frequency.

Definition of the crossover frequency: The crossover frequency \omega_{c} is the frequency at which the Nyquist plot intersects the circle with radius 1. That is, the crossover frequency is the frequency \omega_{c} at which |G(j\omega_{c})|=1 (gain is equal to 1), where G(j\omega) is the open-loop transfer function in the frequency domain s=j\omega.

Definition of the phase margin: Phase margin is the angle measured in degrees by which the phase of G(j\omega) exceeds -180 degrees at \omega_{c}. Equivalently, phase margin is an angle in degrees for which the Nyquist plot of G(j\omega) needs to be rotated such that the point (\omega_{c},G(j\omega_{c})) passes through the point (-1,0).

From mathematical point of view, we have the following relation for the phase margin, that is usually denoted by “PM”:

(1)   \begin{align*}PM=180 + \measuredangle G(j\omega_{c})\end{align*}

where \measuredangle G(j\omega_{c}) is the phase of G(j\omega) at the crossover frequency \omega_{c}.

Intuitive understanding of the phase margin, crossover frequency, and recommendations

Roughly speaking, smaller the phase margin is, more unstable the closed-loop system is. This is because the phase margin is the angle distance from the critical stability point (-1,0). Control engineers ususally specify the desired closed-loop system stability and performance in the form of the phase margin specification. Usually, the lowest acceptable value of the phase margin is PM=30 degrees.

Also, as we will show in the follow-up tutorial, the phase margin is directly related to the damping ratio of the closed-loop system. Higher the phase margin, higher the damping ratio of the closed-loop system. In some sense, the phase margin can be seen as a measure of the robustness of the system. Namely, often in practice, we do not know accurately coefficients of the transfer function. That is, we do not know accurately the system model. By designing systems with sufficiently large phase margins for assumed transfer function parameters, we would ensure that the system remains stable if the actual parameters are different from the assumed parameters that are used to model the system.

The cross-over frequency is the measure of the speed of response of the system.

Let us now illustrate graphically how the phase margin influences the transient response and the stability of the system.

We consider three open-loop systems

(2)   \begin{align*}W_{1}= \frac{1}{0.01 s^2 + 0.01 s}, \;\; PM=5.72\\W_{2}=\frac{1}{0.1 s^2 + 0.1 s},\;\; PM=18 \\W_{3}= \frac{1}{s^2+s},\;\; PM=51.8\end{align*}

We determine the Nyquist plot and closed-loop step response of these systems by using these MATLAB code lines

W1=tf(1,1*[1 1 0])
nyquist(W1)
W2=feedback(W1,1)

step(W2)

The Nyquist plots of open-loop transfer functions with phase margins together with the corresponding closed-loop step responses of these three systems are shown in the figures below.

Fig 2: Nyquist plot and closed-loop step response of system W_{1} defined in (2).
Fig 3: Nyquist plot and closed-loop step response of system W_{2} defined in (2).
Fig 4: Nyquist plot and closed-loop step response of system W_{3} defined in (2).

Phase Margin from Bode Plot

So far, we learned how to identify the phase margin from the Nyquist plot. Let us now learn how to identify the phase margin from the Bode plot. Consider the following example

(3)   \begin{align*}W(s)=\frac{1}{s^2+2s}\end{align*}

Let us generate the Bode plot. We use the following MATLAB code lines to generate the Bode plot.

w=tf(1,[1 2 0])
bode(w)

The Bode plot is given in the figure below.

Fig 5: Bode plot of system W defined in (3).

Next, we explain how to identify the phase margin from this plot.

The first step is to draw a horizontal line from the 0 dB and to identify an intersection with the magnitude plot. This is because the phase margin is defined for the point at which |G(j\omega)|=1. Since the Bode magnitude plot is defined by 20\log_{10}(|G(j\omega)|), we can see that on the Bode plot, the point |G(j\omega)|=1 corresponds to the point at which the magnitude plot crosses the 0 dB point. Then, the next step is to draw a vertical line from this intersection until the -180 horizontal line on the phase plot. The intersection between the vertical line and the phase plot, defines an angle measured from the -180 horizontal line. The angle is positive if the phase plot is above -180, and the angle is negative if the phase plot is below -180. This angle defines the phase margin. This procedure is illustrated in Fig. below.

Explanation how to determine the phase margin.

For the particular example, the phase margin is 76.3 degrees.