University of Toronto Department of Electrical and Computer Engineering ECE41F Control Systems Problem Set #3 Solutions 1. The observability matrix is Q o C CA 5 6 3 34. Since det(q o ), the matrix is full rank, so the system is observable.. We compute the controllability and observability matrices: Q c B AB mg l mg. Q o C CA l 1 1 Clearly both are full rank so the pendulum system is both controllable and observable. 3. For this system, we know that (A, B) is stabilizable iff rank A λi B 3 for every A λi eigenvalue λ of A with Reλ ; (C, A) is detectable iff rank 3 for every C eigenvalue λ of A with Reλ. The unstable eigenvalues of A are {λ 1 1, λ 3}. Therefore, we can readily check that rank A λ 1 I B 1 rank 1 8 1 1 3 7 5 7 1 1 rank A λ I A λ1 I rank C A λ I rank C B rank rank. 1 1 1 1 1 7 5 5 1 1 rank 1 1 8 1 7 5 7 4 4 4 1 1 1 7 5 5 4 4 4 3 3 3
Hence, this system is stabilizable and detectable. Now we can get the modal representation of this system as 3. 1.414 x x +. u 1 1.414 y.8944 1.414 1.414. The foregoing shows that x is uncontrollable and can be dropped. The corresponding minimal realization of this system can be expressed as x à x + Bu, y C x, i.e., 3. 1.414 x x + u 1 1.414 1.414 y x 1.414. Of course, you can use the Matlab command minreal to get the minimal realization directly. x 4. We design the observer (or state estimator) of the form ˆx Èx + Bu + L(y C ˆx), or ˆx (à L C)ˆx + Bu + Ly, Our goal is to design the eigenvalues of (à L C) so that det(si à + L C) s + s + 1. First let s write L in terms of four parameters: l1 l L l 3 l 4. Then We get A LC 3 l l 1 l 4 1 l 3., det(si à + L C) s + ( 4 + l + l 3 )s + ( 3 + l )( 1 + l 3 ) l 1 l 4. This gives two constraints l + l 3 3 ( 3 + l )( 1 + l 3 ) l 1 l 4 1. Let s pick l l 3 15. Then we get l 1 l 4 5.
Let s pick l 1 l 4 5. Another way you can design the observer is to use the multi-input pole placement procedure. That is, we want to design a feedback gain L T for the system (A T, C T ) or 3 ẇ w + 1 u. The controller should be of the form u K 1 w + e 1 v, where v F w is a scalar input. First we design K 1. We compute the controllability matrix: 1.414 44.641 Q c. 1.414 141.414 This matrix has rank so the system is completely controllable. Next we construct the matrix Q using the linearly independent columns of Q c. We obtain: 1.414 Q, Q 1 1 1.414 1 S, K 1 1 SQ 1 1 Now we can write our new single input system: ẇ (A + BK 1 )w + b 1 v 3 1 w + 1 Let v F w, where F f 1 f. Now it seems easiest to use a brute force approach to find F. The characteristic polynomial of (A + BK 1 + b 1 F ) is The desired characteristic polynomial is v. s + ( 4 + f )s + 3 3 f + f 1. s + s + 1. Comparing coefficients, we get two constraints: 4 + f 3 3 f + f 1 1. This yields The overall controller is F L T K 1 + e 1 F 16 6. 16 6 1 3
5. The dynamics for the height of tank 1, x 1, is described by Similarly, the dynamics for x is given by dx 1 dt 1 A (f 1 f ). dx dt 1 A (f f 3 ), with the flow rate between the two tanks f given by f g(x 1 x ). The state space model for the nonlinear system is ẋ1 k x1 x 1 ẋ k + A x 1 x 1 A f1 f 3, where k g A.6. Suppose the equilibrium condition is x 1 x : H. Fix x 1 x 1. Then at equilibrium x x 1 H. Let u be the value of the control at this equilibrium. In this case f 1 gh. gh Letting x x x, ũ u u, we obtain the linear model x 1 k k H H x1 x x f 3 k k H H 1 + A 1 A ( k Let K denote. It is easy to check that rankb AB rank H, i.e., this system is controllable. 1 A f1 f 3. (1) 1 K K 1 K K ) In order to stabilize the height of the tanks at x 1 x 1, we must examine the dynamics of x 1 x. This means we cannot explicitly use the ilnear model we just obtained. Rather we define a new state variable z x 1 x 1. It has the nonlinear dynamics ż K z + 1 + 1 A (f 1 f 3 ). We linearize this model about the equilibrium z. We have f 1 f 3 KA. Let s pick f 1 f 3 ka. This yields z K z + 1 A ( f 1 + f 3 ). Then we can see that z is an asymptotically stable equilibrium point so long as f 1 + f 3. Thus, we don t have to do a feedback design. 4
Now we return to our original model (1). Since only x can be measured, we set C, 1 1 and D,. It is easy to check that rank(c; CA) rank( ), such that K K the system is observable. We design an observer l1 L, to estimate x 1. From det(si A + LC), we can obtain the characteristic polynomial of this observer as s + (K + l )s + l 1 K + l K. If we want two poles of the observer at s, then we can calculate l 1 7.9 and l 3.74. The final equation for the observer is given by ˆx1 K K ˆx1 ˆx K K ˆx + l 1 1 f1 f 3 + L(y ˆx ). 6. Since the A matrix is diagonal and its eigenvalues are distinct, we must simply examine the B and C matrices to determine which modes are controllable and observable, respectively. Since modes {1,, 4, 5} have non-zero rows in the B matrix, they are controllable. Also, modes {1,, 3, 5} are observable because they have non-zero columns in C matrix. Hence, only modes {1,, 5} are observable and controllable. The minimum realization of the system then: 1 1 ẋ x + 1 u 5 1 y 1 1 1 7. Let s consider the radial thruster alone, and calculate the controllability matrix. Recall, that the controllability matrix for the given input is Q r b r Ab r A b r A 3 b r, resulting in Q r x 1 ω 1 ω ω ω ω 3 with rank(q r ) 3. Therefore, the system is not controllable from the radial thruster alone. Next, consider the tangential thruster, and calculate the controllability matrix Q t b t Ab t A b t A 3 b t, which gives Q t ω ω ω 3 1 4ω 1 4ω and has full rank, i.e. the system is controllable with respect to the tangential thruster. Now, since the system is controllable with respect to the tangential thruster, it is automatically,, 5
controllable using both thrusters. Note: Even though we were given the actual value for ω there was really no need to use it. The only information that we needed was that ω. 8. This problem is meant to give you some practice with a real design example using Matlab. (a) First we run the eig command to obtain the eigenvalues >> eig(a),,, -.5 +.1936i, -.5 -.1936i Because the system has zero eigenvalues, it is stable, but it is not asymptotically stable. (Note, if you do not know the difference, then ask). (b) Next we use the Matlab command ctrb to determine if the system is controllable. This gives: >> Qc ctrb(a,b) 1. -.5.15 -.5 1. -.5.15 -.5 -.5.5 -.5.75 5. -.5 1. -.1.5 Next we check the rank >> rank(qc) 4 Since the answer is less than n, the system is not controllable. (c) To determine the minimal realization in Matlab we use the command minreal. Use the help command to determine its arguments. You will see the command requires as input a state space model that we call sys. >> sysss(a,b,c,d); >> msysminreal(sys) 1 state removed. a x1 x x3 x4 x1 1 x -.1 -.5 x3.5 x4 1 b 6
u1 x1 x 1 x3 x4 c x1 x x3 x4 y1 1 d u1 y1 Now we have a fourth order model. If we tried to do this in the Laplace domain, we would first convert the state equations to a transfer function using the command sstf: >> num,den sstf(a,b,c,d,1) num... 5. den 1..5.1 Next we check the poles and zeros of this transfer function >> zeros roots(num(5:6)) >> poles roots(den) -.5 +.1936i -.5 -.1936i We see that there is a pole-zero cancellation at s. After cancelling the pole we get a new transfer function >> num.5; >> den den(1:5); >> A,B,C,Dtfss(num,den) A -.5 -.1 1. 7
1. 1. B 1 C 5 D Finally, we check that this system is controllable. >> ctrb(a,b) 1. -.5.15 -.5 1. -.5.15 1. -.5 1. 8