Example: Root-Locus Design method for the Pitch Controller

In the Pitch Controller Modeling page, the transfer function was derived as

The input (elevator deflection angle, delta e) will be 0.2 rad (11 degrees), and the output is the pitch angle (theta).

The design requirements are

• Overshoot: Less than 10%
• Rise time: Less than 2 seconds
• Settling time: Less than 10 seconds
• Steady-state error: Less than 2%
To see the original problem setup, please refer to the Pitch Controller Modeling page.

## Original root-locus plot

Recall from the Root-Locus Tutorial page, a root-locus plot shows all possible closed-loop pole locations for a pure proportional controller. Since not all poles are acceptable, the MATLAB function called sgrid should be used to find an acceptable region of the locus. This sgrid function requires two arguments: Natural frequency (Wn) and damping ratio (zeta). These two arguments can be determined from the rise time, the settling time, and the overshoot requirements and three equations shown below.

where,

Wn=Natural frequency
zeta=Damping ratio
Ts=Settling time
Tr=Rise time
Mp=Maximum overshoot

From these three equations, we can determine that the natural frequency (Wn) must be greater than 0.9 and the damping ratio (zeta) must be greater than 0.52.

Let's generate a root-locus plot and use the sgrid to find the acceptable region of the locus. Create a new m-file and enter the following commands:

```
num=[1.151 0.1774];
den=[1 0.739 0.921 0];
plant=tf(num,den);
Wn=0.9;
zeta=0.52;

rlocus (plant)
sgrid (zeta,Wn)
axis ([-1 0 -2.5 2.5])
```
Run this m-file in the MATLAB command window. You should see the root-locus plot similar to the one shown below:

The two dotted lines in an angle indicate the locations of constant damping ratio, and the damping ratio is greater than 0.52 in between these lines. The dotted semi-ellipse indicates the locations of constant natural frequency, and the natural frequency is greater than 0.9 outside the semi-ellipse (this would be a semi-circle if the axes were uniformly scaled). As you may have noticed, there is no root-locus plotted in our desired region. We need to bring the root-locus in between two dotted lines and outside the semi-ellipse by modifying the controller.

We need to shift the root-locus more toward the left to get it inside our desired region. If you refer to the Designing Lead and Lag Compensators page, you will notice that the lead compensator can move the root locus to the left. The transfer function of a typical lead compensator is:

• Zo=zero
• Po=pole
• Zo < Po

In general, the zero is placed in the neighborhood of the natural frequency criterion, and the pole is placed at a distance 3 to 20 times the value of the zero location. Let's place the zero (Zo) at 0.9 and the pole (Zo) at 20.

Let the MATLAB functions conv and feedback determine the closed-loop transfer function with the lead compensator. Enter the following commands to an new m-file and run it in the MATLAB command window. You should obtain the following root-locus plot:

```num=[1.151 0.1774];
den=[1 0.739 0.921 0];
plant=tf(num,den);

Zo=0.9;
Po=20;
contr=tf([1 Zo],[1 Po]);

Wn=0.9;  zeta=0.52;
rlocus (contr*plant)
axis ([-3 0 -2 2])
sgrid (zeta,Wn)
```

The root-locus has been generated in our desired region. Now, we are ready to pick a gain (K) and generate the step response corresponding to that gain. Add the following commands to the m-file shown above and run it in the command window. You should see a prompt asking you to pick a point on the root-locus plot. Pick a point close to the zero on the natural frequency criterion, say around -1 on real axis. This point should give you a gain around 200. You should see a step response similar to the one shown below.

```[K, poles]=rlocfind (contr*plant)

de=0.2;
sys_cl=feedback (K*contr*plant,1);
step(sys_cl)
```

This response satisfies all the design requirements.

## How to solve a problem using Root-Locus method: Quick Summary

1. Obtain a root-locus plot with the sgrid using the original plant transfer function.
2. Add a lead (or lag) compensator to bring the root-locus to the desired region, if necessary.
3. Pick a point on the root-locus and obtain the corresponding gain (K).
4. Generate the step response with the chosen gain (K).
5. Determine what needs to be changed from the step response.