Académique Documents
Professionnel Documents
Culture Documents
Zero/pole/gain:
1
-------------(s^2 + 2s + 2)
% Step response
ltiview(Gcl)
Step Response
0.7
System: Gcl
Peak amplitude: 0.522
Overshoot (%): 4.32
At time: 3.15
0.6
0.5
Amplitude
0.4
0.3
0.2
0.1
Time (sec)
% 436-433 Tutorial A2
% Franklin Problem 7.20
% Plant
A = [0 1;0 -10]; B = [0; 1]; C = [1 0]; D = 0;
G = ss(A, B, C, D);
% Desired CLPs
zeta = 0.41; zwn = 41; wn = zwn/zeta;
dcp = roots([1 2*zwn wn^2])
dcp =
-41.0000 +91.2086i
-41.0000 -91.2086i
% Control law gains
K = place(A, B, dcp)
K =
1.0e+004 *
1.0000
0.0072
% Closed-loop system
Gcl = ss(A-B*K, B, C, D);
zpk(Gcl)
Zero/pole/gain:
1
------------------(s^2 + 82s + 1e004)
% Step response
ltiview(Gcl)
Step Response
-4
1.4
x 10
1.2
System: Gcl
Peak amplitude: 0.000124
Overshoot (%): 24.3
At time: 0.035
System: Gcl
Settling Time: 0.0841
Amplitude
0.8
0.6
0.4
0.2
0.05
0.1
Time (sec)
0.15
% 436-433 Tutorial A2
% Franklin Problem 7.25
syms m l k a g real
A = [0 1 0 0
-k*a^2/m/l^2-g/l 0 k*a^2/m/l^2 0
0 0 0 1
k*a^2/m/l^2 0 -k*a^2/m/l^2-g/l 0];
B = [0; -1/m/l; 0; 1/m/l];
Co = [B A*B A^2*B A^3*B]
Co =
[0, -1/m/l, 0, -(-k*a^2/m/l^2-g/l)/m/l+k*a^2/m^2/l^3]
[-1/m/l, 0, -(-k*a^2/m/l^2-g/l)/m/l+k*a^2/m^2/l^3, 0]
[0, 1/m/l, 0, -k*a^2/m^2/l^3+(-k*a^2/m/l^2-g/l)/m/l]
[1/m/l, 0, -k*a^2/m^2/l^3+(-k*a^2/m/l^2-g/l)/m/l, 0]
determinant = det(Co)
determinant =
0
if determinant==0, disp('Uncontrollable!'), end
Uncontrollable!
0
0.5000
0
0.5000
0.5000
0
-0.5000
0
0
0.5000
0
-0.5000
A1 = T\A*T
A1 =
[
0]
[
0]
[
1]
[
0]
0,
1,
0,
-g/l,
0,
0,
0,
0,
0,
0,
0, -(g*m*l+2*k*a^2)/m/l^2,
B1 = T\B
B1 =
[
0]
[
0]
[
0]
[ -2/m/l]
% If forces not symmetrical, e.g., u1 = 0:
B(2) = 0
B =
[
0]
[
0]
[
0]
[ 1/m/l]
%Then
B1 = T\B
B1 =
[
0]
[ 1/m/l]
[
0]
[ -1/m/l]
% Now both modes are controllable from u2
% 436-433 Tutorial A3
% Franklin Problem 7.26
A = [.174 0 0 0 0
.157 .645 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0];
B = [-.207; -.005; 0; 0; 0];
C = [1 0 0 0 0]; D = 0;
Co = ctrb(A, B);
detC = det(Co)
detC =
-2.2829e-007
% Jordan modal form
[V, J]=jordan(A)
V =
0
0
0
0
1.3989
0
0
0
1.3989
10.2086
0
0
1.3989
10.2086
62.0326
1.0000
-0.3333
-1.9157
-11.0098
-63.2748
0
0.3333
0.5168
0.8012
1.2422
0
0
0
0
0
1.0000
0
0
0
0
0
1.0000
0
0
0
0
0
0
0.1740
0
0
0
0
0
0.6450
J =
Bm = V\B
Bm =
0.0000
-0.0318
-0.2015
-0.2070
-0.2220
Cm = C*V
Cm =
0
% 436-433 Tutorial A3
% Question 7.28
% Plant, with state vector = [Q Qdot x xdot]'
syms b K1 K2 K3 K4 real
syms s
A = [0 1 0 0
1 0 0 0
0 0 0 1
-b 0 0 0];
B = [0; 1; 0; -1];
K = [K1 K2 K3 K4];
% (a)
% Desired CLPs
dcp = [-1; -1; -1+j; -1-j];
% Desired char. poly
ac = poly(dcp)
ac =
1
16
12
% (b)
% Symmetric root locus
% Define output as cart displacement x = x3
C = [0 0 1 0]; D = 0;
G = ss(A, B, C, D);
disp('Plant transfer function')
zpk(G)
figure(1)
plot(real(dcp), imag(dcp), 'rs', 'MarkerFaceColor', 'r')
hold on
[rho, clp] = srl(G)
0.66
0.5
0.34
0.18
0.78
3
0.87
2
0.94
1
Imag Axis
0.985
0
3.5
2.5
1.5
0.5
0.985
-1
0.94
-2
0.87
-3
0.78
0.66
-4
-4
0.5
-3
0.34
-2
0.18
-1
Real Axis
18.6227
3.9877
14.2205
% (c)
% Closed-loop systems
Gcl1 = ss(A-B*K1, B, C, D);
Gcl2 = ss(A-B*K2, B, C, D);
figure(2), initial(Gcl1, Gcl2, [10 0 0 0]')
legend('part (a)', 'part(b)', 0)
20
part (a)
part(b)
15
Amplitude
10
-5
Time (sec)
% (d)
% Servo system
Nxu = [A B;C D]\[0; 0; 0; 0; 1];
Nx = Nxu(1:4), Nu = Nxu(5)
% Note that ref state only required for x3 = x
Nx =
0
0
1
0
Nu =
0
% Form closed-loop system
Ga = augstate(G);
% augment output with states
Gc1 = feedback(Ga, K1([1 2 4]), 1, [2 3 5]); % feedback states for which Nx = 0
Gc1 = Gc1(1,1);
% retain only output x3 = x
Gcl1 = feedback(Gc1*K1(3), 1);
Gc2 = feedback(Ga, K2([1 2 4]), 1, [2 3 5]);
Gc2 = Gc2(1,1);
Gcl2 = feedback(Gc2*K2(3), 1);
% Step response
figure(3), step(Gcl1, Gcl2)
legend('part (a)', 'part(b)', 0)
Step Response
1.2
0.8
Amplitude
0.6
0.4
0.2
-0.2
part (a)
part(b)
-0.4
-0.6
Time (sec)
% 436-433 Tutorial A3
% Question 7.42
syms w L1 L2 L3 L4 real
syms s
% State equations
A = [ 0 1 0 0
3*w^2 0 0 2*w
0 0 0 1
0 -2*w 0 0];
B = [0; 0; 0; 1];
C = [0 0 1 0];
D = 0;
% (a) Observability
Ob = [C; C*A; C*A^2; C*A^3]
Ob =
[
0,
[
0,
[
0,
[ -6*w^3,
0,
0,
-2*w,
0,
% observability matrix
1,
0]
0,
1]
0,
0]
0, -4*w^2]
detOb = det(Ob)
detOb =
-12*w^4
if detOb == 0
disp('Not fully state observable from y')
else
disp('Fully state observable from y')
end
Fully state observable from y
% (b) Observer design
dep = [-2*w; -3*w; -3*w+j*3*w; -3*w-j*3*w];
ae = 1;
for k = 1:4, ae = ae*(s - dep(k)); end
ae = collect(simple(ae), s)
ae =
s^4+11*s^3*w+54*s^2*w^2+126*s*w^3+108*w^4
L = [L1; L2; L3; L4];
aL = det(s*eye(4) - A + L*C);
aL = collect(simple(aL), s)
aL =
s^4+s^3*L3+(w^2+L4)*s^2+(w^2*L3-2*w*L2)*s-6*w^3*L1-3*w^2*L4
% numeric coefficients
ae_coeff =
1
11
108
54
126
11*w,
aeA = polyvalm(ae_coeff, A)
aeA =
[ 267*w^4, 115*w^3,
[ 345*w^5,
55*w^4,
[ -66*w^4, -106*w^3,
[ -318*w^5, -230*w^4,
0, 106*w^3]
0, 230*w^4]
108*w^4,
82*w^3]
0, -104*w^4]
L = aeA*inv(Ob)*[0; 0; 0; 1]
L =
[
-89/2*w]
[ -115/2*w^2]
[
11*w]
[
53*w^2]
% 436-433 Tutorial A3
% Question 7.43
% (a) State-space equations
w = 5; num = 1; den = [1 0 w^2];
Gtf = tf(num, den)
[A, B, C, D] = tf2ss(num, den) % gives controller canonical form
C = [1 0]
% but get theta-dot as observed output
Transfer function:
1
-------s^2 + 25
A =
0
1
-25
0
B =
1
0
C =
0
D =
0
C =
1
I/O
I
O
Channel(s)
1
1
% 436-433 Tutorial A3
% Question 7.42
A
B
C
D
=
=
=
=
[0 1; 4 0];
[0; 4];
[1 0];
0;
1.0000
Zero/pole/gain:
-264 (s+2.621)
----------------(s^2 + 24s + 292)
I/O groups:
Group name
Measurement
Controls
Gol = -Greg*G;
zpk(Gol)
I/O
I
O
Channel(s)
1
1
Zero/pole/gain:
1056 (s+2.621)
----------------------------(s+2) (s-2) (s^2 + 24s + 292)
I/O groups:
Group name
Controls
I/O
O
Channel(s)
1
[Gm,Pm,Wcg,Wcp] = margin(Gol)
Gm =
0.4220
Pm =
36.1147
Wcg =
0
Wcp =
3.3903
margin(Gol)
Bode Diagram
Gm = -7.4945 dB (at 0 rad/sec), Pm = 36.115 deg (at 3.3903 rad/sec)
20
10
Magnitude (dB)
0
-10
-20
-30
-40
-50
Phase (deg)
-60
-135
-180
-225
-270
-1
10
10
10
Frequency (rad/sec)
10
% 436-433 Tutorial A3
% Question 7.48
A
B
C
D
=
=
=
=
[0 1; 0 -1];
[0; 10];
[1 0];
0;
Zero/pole/gain:
-54.8 (s+3.695)
----------------(s^2 + 17s + 262)
I/O groups:
Group name
Measurement
Controls
I/O
I
O
Channel(s)
1
1
Zero/pole/gain:
548 (s+3.695)
------------------------s (s+1) (s^2 + 17s + 262)
I/O groups:
Group name
Controls
I/O
O
Channel(s)
1
Root Locus
20
0.76
0.64
0.5
0.34
0.16
0.86
15
10
Imag Axis
0.94
0.985
25
-5
-10
20
15
10
0.985
0.94
-15
0.86
0.76
-20
-30
-25
0.64
-20
-15
0.5
-10
Real Axis
0.34
0.16
-5
10
% 436-433 Tutorial A3
% Question 7.54
%
A
B
C
G
Plant equations
= [0 1; 1 0];
= [1; 0]; Bw = B;
= [0 1]; D = 0;
= ss(A, [B Bw], C, D);
1
0
1
0
0
0
Ba =
1
0
0
K =
3.0000
Ko = K(1:2);
Ki = K(3);
5.0000
2.0000
step(Gcl)
Step Response
From: r
From: w
0.9
0.8
0.7
To: y
Amplitude
0.6
0.5
0.4
0.3
0.2
0.1
6 0
Time (sec)
0 1
1
y = [ 1 ] x
a) Determine, if it exists, a state feedback gain matrix K such that the closed-loop poles are
located at s = 5 and 6.
[5 marks]
b) Determine, if it exists, a state feedback gain matrix K such that the closed-loop natural
motions have the form 1e 2t cos(0.5t + 2 )
[3 marks]
c) Find the range of values of the parameter for which the system is completely state
observable.
[4 marks]
d) Choose a convenient value of that makes the system completely observable, and design an
estimator whose errors decay like e5t.
[5 marks]
e) Draw a detailed simulation diagram of your estimator (with inputs u and y, and outputs
x1 and x 2 ).
[3 marks]
tut_a3.doc
Page 1 of 4
Question A1 (2000)
(a)
(b)
1 0
0
0 1 x(t ) + 0 u (t )
10
0 0
0] x(t )
c ( s ) = s 3 + 3.5s 2 + 8.6s + 8
e ( s ) = s 3 + 10.5s 2 + 77.4 s + 216
Given that the controllability matrix for the realisation is
0 0 10
C = 0 10 0
10 0 0
tut_a3.doc
Page 2 of 4
(iv)
A root locus for an alternative design, in which the desired control and estimator
poles were selected from a symmetric root locus (SRL), is shown in figure 2. The
control and estimator gains for this design are K = [0.259 0.208 0.204] and
L = [7.17 97.3 367]T, respectively.
Compare the important features of the ITAE and SRL designs.
[4 marks]
ITAE design
10
Imag Axis
10
15
10
5
Real Axis
Figure 1
SRL design
8
Imag Axis
8
12
10
4
Real Axis
Figure 2
tut_a3.doc
Page 3 of 4
Question A1 (1999)
Consider a plant with the state-space representation
2 1
1
x =
x
+
0 u
0
1
y = [0 1]x
(a)
Design a full state feedback control law which will place the closed-loop poles at
s = 2, 2.
[7 marks]
(b)
A full state estimator is to be used, with estimator poles placed at s = p0, p0. Show that the
required estimator gain matrix is
p 2 + 4 p 0 + 3
L= 0
2( p 0 + 1)
(c)
[7 marks]
It is desired to investigate the effect of sensor noise on the operation of the closed-loop
regulator system. Let the sensor signal be y + n, where y is the actual plant output. Derive a
T
set of state-space equations (involving the state vector [x x ] ) which describe how the
plant output y and the control signal u respond to the noise input n.
[6 marks]
tut_a3.doc
Page 4 of 4