Controllability and Observability
Control design via pole placement
Controllability and Observability
In 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
If you are interested in running an animation of this example based on the control techniques used in the state-space tutorial please go to the Pitch Controller Animation page after completing this tutorial.
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 for both matrices must be 3. The MATLAB command rank can give you the ranks of both matrices. Create a new m-file and enter the following commands:
A = [-0.313 56.7 0; -0.0139 -0.426 0; 0 56.7 0]; B = [0.232; 0.0203; 0]; C = [0 0 1]; D = ; pitch = ss(A,B,C,D); co = ctrb(pitch); ob = obsv(pitch); Controllability = rank(co) Observability = rank(ob)If you run this m-file in the MATLAB command window, you should see
Controllability = 3 Observability = 3This proves that our system is both completely state controllable and completely state observable.
Recall from the State-Space Tutorial page, the "pole placement" technique can be used to find the control matrix (K). Since the determinant of [sI-(A-BK)] matrix is a third-order polynomial, there are three poles we can place.
- K=Control matrix
- x=State matrix (alpha, q, theta)
In the State-Space Tutorial, the dominant second-order pole placement method was introduced. However for this example, we will use another method called Linear Quadratic Regulator (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 C' x C. The weighting factor (p) will be varied as we see the step response. To see the structure of the Q matrix, type in the following commands to an m-file and run it in the MATLAB command window (or you can simply type them directly into the command window).
C = [0 0 1]; Q = C'*CYou should see the following Q matrix in the command window:
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) equal 50. Enter the following commands to a new m-file and run it in the MATLAB command window.
t = 0:0.1:10; de = 0.2*ones(size(t)); yo = [0 0 0]; A = [-0.313 56.7 0; -0.0139 -0.426 0; 0 56.7 0]; B = [0.232; 0.0203; 0]; C = [0 0 1]; D = ; p = 50; Q = [0 0 0; 0 0 0; 0 0 p]; [K] = lqr(A,B,Q,1) sys_cl=ss(A-B*K,B,C,D); lsim(sys_cl,de,t,yo)After you run this m-file, you should see the step response similar to the one shown below:
The rise time, overshoot, and settling time look satisfactory. However, there is a large steady-state error. This can be easily corrected by introducing the feedforwarding scaling factor (Nbar).
We can easily find Nbar from the MATLAB function rscale. Since this rscale is a user-defined function, you need to copy and save the rscale m-file to your directory. For further assistance in using user-defined functions, refer to the function page. After you have saved the rscale m-file to your directory, enter the following commands to a new m-file and run it in the MATLAB command window. You should see the response shown below:
t = 0:0.1:10; de = 0.2*ones(size(t)); yo = [0 0 0]; A = [-0.313 56.7 0; -0.0139 -0.426 0; 0 56.7 0]; B = [0.232; 0.0203; 0]; C = [0 0 1]; D = ; pitch = ss(A,B,C,D); x = 50; Q = [0 0 0; 0 0 0; 0 0 x]; [K] = lqr(A,B,Q,1) Nbar = rscale(pitch,K) sys_cl = ss(A-B*K,B*Nbar,C,D); lsim (sys_cl,de,t,yo)
Now the steady-state error has been eliminated and all design requirements are satisfied.
If you are interested in running an animation of the pitch controller example based on the control techniques used in this tutorial please go to the Pitch Controller Animation page.