Discrete state-space
Controllability and observability
Control design via pole placement
Reference input
In this digital control version of the pitch controller problem, we are going to use the state-space method to design the digital controller. If you refer to the Pitch Controller: Modeling page, the state-space model 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
From the closed-loop Bode plot, the bandwidth frequency was determined to be approximately 2 rad/sec (see this yourself) . Thus, to be sure we have small enough sampling time, we are going to use the sampling time of 1/100 sec/sample. Now we are ready to use the function c2dm. Enter the following commands to an m-file.
Running this m-file in the Matlab command window gives you the following four matrices.
Now we have obtained the discrete state-space model of the form
must have the rank of n. The rank of the matrix is the number of independent rows (or columns). In the same token, for the system to be completely state observable, the observability matrix
must also have the rank of n. Since our controllability matrix and observability matrix are 3x3, the rank of both matrices must be 3. The Matlab function rank can give you the rank of each matrices. In an new m-file, enter the following commands and run it.
In the command window, you should see
This proves that our discrete system is both completely state controllable and completely state observable.
where
- K=Control matrix
- x=State matrix (alpha, q, theta)
- de=-Kx=input
- R=Reference
In the continuous Pitch Controller: State-Space page, the Linear Quadratic Regulator (LQR) method was used to find the control matrix (K). In this digital version, we will use the same LQR method. This method allows you to find the optimal control matrix that results in some balance between system errors and control effort. Please consult your control textbook for details. To use this LQR method, we need to find three parameters: Performance index matrix (R), state-cost matrix (Q), and weighting factor (p). For simplicity, we will choose the performance index matrix equals 1 (R=1), and the state-cost matrix (Q) equals to H' x H. The weighting factor (p) will be chosen by trial and errors. The state-cost matrix (Q) has the following structure
Q = 0 0 0 0 0 0 0 0 1
Now we are ready to find the control matrix (K) and see the response of the system. First, let the weighting factor (p) equals 50. Enter the following commands to a new m-file and run it in the Matlab command window.
After you run this m-file, you should see the control matrix (K) in the command window and the step response similar to the one shown below.
The rise time, the overshoot, and the settling time look satisfactory. However, there is a large steady-state error. This can be easily corrected by introducing the feedforwarding scaling factor (Nbar).
Unfortunately, we can not use our user-defined function rscale to find Nbar. But certainly we can find it from trial and errors. After several trials, the Nbar equals to 6.95 provided the satisfactory response. Try the following m-file and obtain the stairstep response shown below.
From this plot, we see that the Nbar eliminated the steady-state error. Now all design requirements are satisfied.