






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Questions to hwlp with preparation
Typology: Exercises
1 / 11
This page cannot be seen from the preview
Don't miss anything!







AP11.1 We are given a system with open loop transfer function
G(s) = X 1 (s) U (s)
X 1 (s) X 2 (s)
X 2 (s) X 3 (s)
X 3 (s) U (s)
s
s + 1
s + 4
s(s + 1)(s + 4)
and all states available for measurement (so we can design a full-state feedback controller). We are asked to select feedback gains so that the system has steady state error of zero in response to a step input and less than 3 percent overshoot. Solution: At first glance, the problem statement is a little confusing. We are asked to select “gains” when we have a single gain “K” in the transfer function. However, we can see what is meant by noting that the transfer function G(s) = X 1 (s)/U (s) and that with full-state feedback we will have a gain matrix K = [k 1 , k 2 , k 3 ] such that u(t) = r(t) + Kx(t) = r(t) + k 1 x 1 (t) + k 2 x 2 (t) + k 3 x 3 (t). From the block diagram shown in Figure AP11.1 on page 714 of the text, we see that
x˙ 1 = x 2 (3) x˙ 2 = −x 2 + 2x 3 (4) x˙ 3 = − 4 x 3 + 2Ku (5)
so substituting for u we find that in state space form we have the system
x ˙ =
2 Kk 1 2 Kk 2 2 Kk 3 − 4
(^) x +
(^) r (6)
y = [1 0 0] x. (7)
The closed loop transfer function is then
T (s) = CΦ(s)B = [1 0 0] (sI − A)−^1 B. (8)
Using Maple or computing by hand yields
Φ(s) =
∆(s)
s^2 + (5 − 2 Kk 3 )s + 4 − 2 Kk 3 − 4 Kk 2 s + 4 − 2 Kk 3 2 4 Kk 1 s(s + 4 − 2 Kk 3 ) 2 s 2 Kk 1 s + 2Kk 1 2 Kk 2 s 2 Kk 1 s(s + 1)
where ∆(s) = s^3 + (5 − 2 Kk 3 )s^2 + (4 − 2 Kk 3 − 4 Kk 2 )s − 4 Kk 1. (10) Premultiplication by C selects the first row of Φ(s) and postmultiplication by B then selects the third element and multiplies it by 2K so
T (s) =
s^3 + (5 − 2 Kk 3 )s^2 + (4 − 2 Kk 3 − 4 Kk 2 )s − 4 Kk 1
The steady state error to a step will be
ess = lim s→ 0 s
(1 − T (s)) = 1 − T (0) = 1 +
k 1
thus to obtain zero steady state error for a step input we need k 1 = −1.
Now we have an underconstrained problem. There are many triples of values (K, k 2 , k 3 ) that will yield the appropriate overshoot. Suppose we choose ζ = 0.75 and ωn = 1 to obtain characteristic polynomial
p(s) = (s^2 + 2ζωns + ω n^2 )(s + ωn) (13) = s^3 + (2ζ + 1)ωns^2 + ω^2 n(2ζ + 1)s + ω^3 n (14) = s^3 + 2. 5 s^2 + 2. 5 s + 1. (15)
Then (K, k 2 , k 3 ) = (1/ 4 , − 1 , 5) results in the denominator of T (s) matching p(s).
Testing our results in Matlab (we could do this by hand, using the Laplace transform, of course, but we won’t) yields the step response shown in Figure 1. The overshoot is 0. percent, satisfying the design requirement. The Matlab script is shown below.
% % AP11_1.m solves part of problem AP11_1 from Dorf and Bishop 10th ed. % % 1 May 05 --sk % clear all
k1 = -1; K = 1/4; % First solve y = Mq+b for q = [k2,k3] M = [0 -2K;-4K -2K]; b = [5;4]; y = [5/2;5/2]; q = M(y-b) k2 = q(1) %%% = -1; k3 = q(2) %%% = 5; % Now define the closed loop transfer function T(s) Tcl = tf([4K],[1 5-2Kk3 4-2Kk3-4Kk2 -4Kk1]) t = [0:.01:20]’; y = step(Tcl,t); figure(1) plot(t,y) grid title(’Closed-Loop Step Response for AP11.1’) xlabel(’Time (s)’) ylabel(’Position x_1(t)’) print -deps ap11_
The closed-loop matrix Acl = A − BK is
Acl =
−k 1 −k 2 −k 3 + 1 −k 4 0 0 0 1 k 1 k 2 − 9 .8 + k 3 k 4
so we see that we will not want to find the determinant of sI − Acl, and instead use Ackermann’s formula. This is easily automated in a Matlab script as shown below and yields characteristic polynomial coefficients and gain matrix K as follows
ps =
1 14 70 150 125
and the feedback control law will be u = −Kx. Here’s the script.
% % AP11_4.m solves part of problem AP11_4 from Dorf and Bishop 10th ed. % % 1 May 05 --sk % clear all
A = [0 1 0 0; 0 0 -1 0; 0 0 0 1; 0 0 9.8 0]; B = [0,1,0,-1]’; Pc = [B AB AAB AAAB] ps = conv(conv([1 2+i],[1 2-i]),[1 10 25]) K = [0 0 0 1]/Pc(ps(1)A^4+ps(2)A^3+ps(3)A^2+ps(4)A + ps(5)eye(4))
MP11.2 We are given a system
x ˙ =
x +
u (19)
y = [1 0] x. (20)
and asked to determine whether the system is controllable and observable. We are also asked to find the transfer function from u to y. Solution:
We can check controllability and observability easily enough by hand, finding that
Pc = [B AB] =
Po =
from which we immediately see that both matrices have full rank and the system is con- trollable and observable. We can also easily compute the transfer function by hand. It is
G(s) = C(sI − A)−^1 B (24)
= [1 0]
s + 4. 5 1 − 2 s
s^2 + 4. 5 s + 2
s^2 + 4. 5 s + 2
MP11.7 We are given the system
x ˙ =
(^) x (27)
y = [1 0 0] x. (28)
having no input. We are also given three observations of y, namely
y(0) = 1 y(2) = − 0. 0256 y(4) = − 0. 2522. (29)
We are asked to (a) develop a method for determining the initial condition x(t 0 ) (meaning any t 0 — not just t 0 = 0), (b) compute x(t 0 ) in terms of the observations and comment on conditions under which this is possible, and (c) test the prediction in Matlab. Solution: Since there is no input,
x(t) = eA(t−t^0 )x(t 0 ), ∀t ≥ t 0. (30)
Thus (^)
y(4) y(2) y(0)
Ce(4−t^0 )A Ce(2−t^0 )A Ce(0−t^0 )A
(^) x(t 0 ) (31)
and we can solve for the initial condition x(t 0 ) so long as the matrix premultiplying it is invertible. We compute x(0) and six values of y(t) integer times 0 through 5, using the following Matlab script.
MP11.11 We are given the system
x ˙ =
(^) x +
y = [0 1 0] x + 0u. (33)
We are asked to (a) use the acker function to determine the full-state feedback gain matrix and observer gain matrix to place the closed-loop system poles at s 1 , 2 = − 1. 4 ± 1. 4 j, s 3 = −2, and the observer poles at s 1 , 2 = − 18 ± 5 j , s 3 = −20, (b) construct the state variable compensator, (c) simulate the behavior of the closed-loop system for initial system state x(0) = [1 0 0]′^ and initial estimator state xˆ = [0.5 0.1 0.1]′. Solution: First, we check to see whether the system is controllable and observable. Finding that it is, we execute the following Matlab script to obtain the controller gain K = [10.11 22. 34 − 5 .43] and observer gain L = [−1622 49.3 737]′^ and plot the system behavior for the given initial conditions. The system behavior is shown in Figure 2. Note that as expected, since we placed the poles of the observer roughly an order of magnitude farther from the origin than those of the controller, the estimates converge faster than the states. The Matlab script is given below.
% % MP11_11.m solves part of problem MP11.11 from Dorf and Bishop 10th ed. % % 1 May 05 --sk % clear all
A = [0 1 0; 0 0 1; -4.3 -1.7 -6.7]; B = [0 0 0.35]’; C = [0 1 0]; D = 0;
sp = [-1.4+1.4i -1.4-1.4i -2]’; so = [-18+5i -18-5i -20]’;
K = acker(A, B, sp) L = acker(A’, C’, so)’
% combined system matrices Ac = [A-BK BK;0A A-LC]; Bc = [0B;0B];
Figure 2: Response of Closed-Loop System of MP11.
0 1 2 3 4 5 6 7 8 9 10 −1.
−
−0.
0
1
2
3
Time Response for MP11.11 with Initial Condition [1 0 0 0.5 0.1 0.1]T
Time (s)
x 1 (t) x 2 (t) x 3 (t) e 1 (t) e 2 (t) e 3 (t)
Cc = eye(6); Dc = [0 0 0 0 0 0]’; t = [0:.01:10]’; x0 = [1 0 0]’; xhat0 = [0.5 0.1 0.1]’; xc0 = [x0;xhat0]; ysim = lsim(Ac,Bc,Cc,Dc,0*t,t,xc0); plot(t,ysim) title(’Time Response for MP11.11 with Initial Condition [1 0 0 0.5 0.1 0.1]^{T}’) xlabel(’Time (s)’) legend(’x_1(t)’,’x_2(t)’,’x_3(t)’,’e_1(t)’,’e_2(t)’,’e_3(t)’) print -depsc mp11_
conditions (the second element of x is one while the third element of hatx is one and all other elements are zero). The result is shown in Figure 3. Responses to other initial conditions can be easily generated using the Matlab script below. The Matlab
Figure 3: Response of Closed-Loop System of MP11.
0 1 2 3 4 5 6 7 8 9 10 −
−
−
−
0
1
2
Time Response for MP11.13 with Initial Condition [0 1 0 0 0 0 1 0]T
Time (s)
x 1 (t) x 2 (t) x 3 (t) x 4 (t) e 1 (t) e 2 (t) e 3 (t) e 4 (t)
script is as follows. % % MP11_13.m solves part of problem MP13.11 from Dorf and Bishop 10th ed. % % 1 May 05 --sk % clear all
A = [0 1 0 0; 0 0 1 0; 0 0 0 1; -2 -5 -1 -13];
sp = [-1.4+1.4i -1.4-1.4i -2+i -2-i]’; so = [-18+5i -18-5i -20 -20]’;
K = acker(A, B, sp) L = acker(A’, C’, so)’
% combined system matrices Ac = [A-BK BK;0A A-LC]; Bc = [0B;0B]; Cc = eye(8); Dc = [0 0 0 0 0 0 0 0]’; t = [0:.01:10]’; x0 = [0 1 0 0]’; xhat0 = [0 0 1 0]’; xc0 = [x0;xhat0]; ysim = lsim(Ac,Bc,Cc,Dc,0*t,t,xc0); figure(1) clf plot(t,ysim) grid title(’Time Response for MP11.13 with Initial Condition [0 1 0 0 0 0 1 0]^{T}’) xlabel(’Time (s)’) legend(’x_1(t)’,’x_2(t)’,’x_3(t)’,’x_4(t)’,’e_1(t)’,’e_2(t)’,’e_3(t)’,’e_4(t)’) print -depsc mp11_