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
Recall from your control textbook that the frequency response design method is most effective for systems with stable open-loop. To check the open-loop stability of our system, create a new m-file, and enter the following commands. Running this m-file in the MATLAB command window should give you the step response shown below:
de = 0.2; num = [1.151 0.1774]; den = [1 0.739 0.921 0]; pitch = tf(num,den); step(de*pitch)
Unfortunately, our system is unstable in open-loop; however, we can still design the feedback system via frequency response method (even though this might not be the easiest way). First, let's generate the open-loop Bode plot and see what it looks like. Change the m-file to the following and re-run it in the MATLAB command window. You should see a Bode plot similar to the one shown below:
num = [1.151 0.1774]; den = [1 0.739 0.921 0]; pitch = tf(num,den); bode(pitch)
From our design requirements, 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 (please refer to the Pitch Controller: Root-Locus method for details). Using two equations shown below, we see that the bandwidth frequency and the phase margin must be greater than 0.9 and 52 degrees, respectively.
Currently, we have a bandwidth frequency of 1 rad/sec and a phase margin of 80 degrees. These values are within our desired region. Let's plot the closed-loop step response and see what it looks like. Delete the bode command from the above m-file and add the following commands. Running this new m-file should give you the following closed-loop step response:
Tr = Rise time Wn = Natural frequency BW = Bandwidth frequency zeta = Damping ratio PM = Phase margin
sys_cl = feedback(pitch,1); de = 0.2; t = 0:0.01:10; step(de*sys_cl,t)
As you can see, the transient response is worse, there is a long settling time. We will implement a lead compensator to improve the system response.
The transfer function of a typical first-order lead compensator is
We need to find alead, Tlead and Klead. First, the phase margin requirement and the following equation can be used to find alead
Since we are required to have the phase margin of greater than 52 degrees, the alead must be greater than 8.43. Using this alead, the bandwidth frequency requirement of greater than 0.9 and the following equation leads us to have the Tlead of smaller than 0.382.
Let the Klead equal 0.1, alead equal 10, and Tlead equal 0.3 for now and enter the following commands to an new m-file.
num = [1 151 0.1774]; den = [1 0.739 0.921 0]; pitch = tf(num,den); alead = 10; Tlead = 0.3; k = 0.1; lead = tf(k*[alead*Tlead 1],[Tlead 1]); bode(lead*pitch) sys_cl = feedback(lead*pitch,1); de = 0.2; t = 0:0.01:10; figure step (de*sys_cl,t)
Running this m-file in the MATLAB command window gives you the following Bode and step response plots.
Although both the bandwidth frequency and phase margin have increased, the response still does not satisfy the design requirements. Let's increase alead and decrease Tlead. After several trial and error runs, an alead of 200, Tlead of 0.0025, and Klead of 0.05 , were found which gave the following lead compensator,
num = [1 151 0.1774]; den = [1 0.739 0.921 0]; pitch = tf(num,den); alead = 200; Tlead = 0.0025; k = 0.1; lead = tf(k*[alead*Tlead 1],[Tlead 1]); bode(lead*pitch) sys_cl = feedback(lead*pitch,1); de = 0.2; t = 0:0.01:10; figure step (de*sys_cl,t)
If you compare the above Bode plot to the original Bode plot, you see both the phase margin and the bandwidth frequency have increased. Increasing both of them improves the rise time, the overshoot, and the settling time, as seen in the above step response plot. To improve the steady-state error, we will add a lag compensator to the system.
The steady-state error will be reduced by a factor of alag. From the above step response, we see that the steady-state error is roughly 10%. Thus, alag needs to be approximately 0.1. The Tlag should be greater than alag*Tlag because this compensator must not greatly change the transient response.
After several trial and error runs, an alag of 0.1, Tlag of 20, and Klag of 1.5, were found which gave the following lag compensator,
num = [1 151 0.1774]; den = [1 0.739 0.921 0]; pitch = tf(num,den); alead = 200; Tlead = 0.0025; k = 0.05; lead = tf(k*[alead*Tlead 1],[Tlead 1]); Tlag = 20; alag = 0.1; at = alag*Tlag; k2 = 1.5; numlag = k2/alag*[at 1]; denlag = [Tlag 1]; lag = tf(numlag,denlag); bode(lag*lead*pitch) sys_cl = feedback(lag*lead*pitch,1); figure t = 0:0.01:10; step(0.2*sys_cl,t)
If you see the Bode plot, the low frequency gain has increased while keeping the bandwidth frequency the same. This tells us that steady-state error has reduced while keeping the same rise time. The above step response shows that the steady-state error is acceptable. Now all design requirements are satisfied.