Solution Manual Digital Control Engineering Analysis and Design
Solution Manual Digital Control Engineering Analysis and Design
1.1 A fluid level control system includes a tank, a level sensor, a fluid source and an actuator to control
fluid inflow. Consult any classical control text1 to obtain a block diagram of an analog fluid control
system. Modify the block diagram to show how the fluid level could be digitally controlled.
Reference Water
Level Actuator & Level
Computer DAC Tank
InflowValve
Level
ADC Sensor
1.2 If the temperature of the fluid of Problem 1.1 is to be regulated together with its level, modify the
analog control system to achieve the additional control (Hint: an additional actuator and sensor are
needed). Obtain a block diagram for the two-input-two-output control system with digital control.
Note that the DAC and ADC can have more than one input and output channel.
1.3 Position control servos are discussed extensively in classical control texts. Draw a block diagram for a
DC motor position control system after consulting your classical control text. Modify the block
diagram to obtain a digital position control servo.
For the angular position sensor we could use a potentiometer, which is often packaged with an ADC to
give a digital output.
1See for example: J. Van deVegte, Feedback Control Systems, Prentice Hall, Englewood Cliffs, NJ, 1994.
1
Reference Angular
Position Motor Position
Computer DAC & Load
Angular
ADC Position
Sensor
For the angular velocity sensor we could use a tachometer, which is often combined with an ADC to
give a digital output. Alternatively, we could use an optical encoder , which has a digital output.
Reference Angular
Velocity Motor Velocity
Computer DAC & Load
Angular
ADC Velocity
Sensor
1.5 A ballistic missile is required to follow a predetermined flight path by adjusting its angle of attack
(the angle between its axis and its velocity vector v). The angle of attack is controlled by adjusting the
thrust angle (angle between the thrust direction and the axis of the missile). Draw a block diagram
for a digital control system for the angle of attack including a gyroscope to measure the angle and a
motor to adjust the thrust angle .
2
Reference
Angle Angle
Computer DAC Thruster Missile
Actuator
Angle
ADC Sensor
1.6 A system is proposed to remotely control a missile from an earth station. Due to cost and technical
constraints, the missile coordinates would be measured every 20 seconds for a missile speed of up to
500 m/s. Is such a control scheme feasible? What would the designers need to do to eliminate
potential problems?
If the missile is only observed every 20 seconds with speeds of up to 500 m/s, the missile position
could change drastically between measurements. This makes the control scheme unrealistic. The
missile coordinates need to be measured at a much higher rate.
1.7 The control of the recording head of a dual actuator hard disk drive (HDD) requires two types of
actuators to achieve the required high areal density. The first is a coarse voice coil motor (VCM) with
large stroke but slow dynamics and the second is a fine piezo-electric transducer (PZT) with a small
stroke and fast dynamics. A sensor measures the head position and the position error is fed to a
separate controller for each actuator. Draw a block diagram for a dual actuator digital control system
for the HDD2.
Reference
Position Control Coarse Recording
Computer DAC VCM +
Controller Head
ADC Position
Sensor
2J. Ding, F. Marcassa, S.-C. Wu, and M. Tomizuka, “Multirate control for Computational Saving”, IEEE
Trans. Control Systems Tech., Vol. 14, No. 1, January 2006, pp. 165-169.
3
Chapter 2 Solutions
2.1 Derive the discrete-time model of Example 2.1 from the solution of the system differential equation
with initial time kT and final time(k+1)T.
d h h qi
dt C
where = R C is the fluid time constant for the tank. The solution of this equation is
1 t
h(t ) e (t t0 ) / h(t 0 ) t e ( t ) / q i ( ) d
C 0
Let qi be constant over each sampling period T, i.e. qi(t) = qi(k) = constant, for t in the interval
[kT, (k+1)T). Then
C kT
1 ( k 1)T [( k 1)T ] /
e d qi (kT ) d : d
T, kT
e
1 0 /
C T
(d ) qi (kT )
0, (k 1)T
C
1 e q (kT )
T /
i
h(k 1) e T / h(k ) R 1 e T / q i (k )
2.2 For each of the following equation, determine the order of the equation then test it for
(i) Linearity. (ii) Time-invariance. (iii) Homogeneousness.
1
2.3 Find the transforms of the following sequences using Definition 2.1
(a) {0, 1, 2, 4, 0, 0,...} (b) {0, 0, 0, 1, 1, 1, 0, 0, 0,...}
(c) {0, 20.5 , 1, 20.5 , 0, 0, 0, ... }
From Definition 2.1, {u0, u1 , u2 , ... , uk , ... } transforms to U (z) uk zk . Hence:
k 0
2 k 1 , k 0 8 2 k 4 , k 4
where f (k ) g(k )
0, k 0 0, k4
8z z3 8
Z 0,1,2,4,0,0,... z 1 z
z 4 3
z2 z 2 z ( z 2)
1, k 3 1, k 6
where f (k ) g(k )
0, k 3 0, k 6
z 3 1
Z 0,0,0,1,1,1,0,0,... z 3 z
z 6
z
5
z 1 z 1 z ( z 1)
= {f(k)} + {g(k)}
sin(k 4) , k 0 sin( k 4) , k 4
where f (k ) g(k )
0, k 0 0, k4
2.5 Prove the linearity and time delay properties of the z-transform from basic principles.
To prove linearity, we must prove homogeneity and additivity using Definition 2.1,
2
Z f (0), f (1), f (2),..., f (i),... f (0) f (1) z 1 f (2) z 2 ... f (i) z i ... f (i) z i
i 0
Z f (0), f (1), f (2),..., f (i),... f (0) f (1) z 1 f (2) z 2 ... f (i) z i ... f (i) z i
i 0
To prove the time delay property, we write the transform of the delayed sequence
Z 0, f (0), f (1), f (2),..., f (i),... f (0) z 1 f (1) z 2 f (2) z 3 ... f (i) z i 1 ...
z 1 f (i ) z i z 1 Z f (k )
i 0
2.6 Use the linearity of the z-transform and the transform of the exponential function to obtain the
transforms of the discrete-time functions.
(a) sin(kT) (b) cos(kT)
e jkT e jkT
(a) sin( k T )
2j
Z sin (kT ) 1
2j
Z e Z e jkT jkT
1 z z
2 j z e jT z e jT
1
e jT e jT z
sin (T ) z
2
2j
2
z e
jT
e
jT
z 1 z 2cos(T ) z 1
e jkT e jkT
(b) cos(kT )
2
2.7 Use the multiplication by exponential property to obtain the transforms of the discrete-time functions.
(a) ekTsin(kT) (b) ekTcos(kT)
3
The multiplication by exponential property with a k e T k
e kT gives
Z e kT f (k ) F (e T z )
2.8 Find the inverse transforms of the following functions using Definition 2.1 and, if necessary, long
division
(a) F ( z ) 1 3 z 1 4 z 2 (b) F ( z ) 5 z 1 4 z 5
z z 0.1
(c) F ( z) 2 (d) F ( z) 2
z 0.3 z 0.02 z 0.04 z 0.25
z 0.3 0.02 z -1
(c)
0.3 0.02 z -1
0.3 0.09 z -1 0.006 z 2
0.07 z 1 0.006 z 2
z
F ( z) z 1 0.3z 2 0.07 z 3 ..... {f (k )} {0,1,0.3,0.07,....}
z 0.3z 0.02
2
z 0.04 0.25 z -1
(d)
0.14 0.25 z -1
0.14 0.0056 z -1 0.035 z 2
0.244 z 1 0.035 z 2
z
F ( z) z 1 0.14 z 2 0.244 z 3 ....
z 0.04 z 0.25
2
{f (k )} {0,1,0.14,0.244,....}
2.9 For Problems 2.8.(c), (d), find the inverse transforms of the functions using partial fraction expansion
and table look-up.
4
F ( z) 1 1 1 1
(c) 2 10
z z 0.3 z 0.02 z 0.1 z 0.2 z 0.1 z 0.2
z
F ( z ) 10
z
z 0.1 z 0.2
k
{f (k )} 10 0.1 0.2
k
F ( z) z 0.1 0.4 0.4 z 1.016
(d) 2
z 2
z z 0.04 z 0.25 z z 0.04 z 0.25
0.4 z 2 1.016 z
We obtain F ( z ) 0.4 and use the identities
z 2 0.04 z 0.25
e sin( d ) z
Z e k sin(k d )
z 2 2e cos( d ) z e 2
z[ z e cos( d )]
Z e k cos(k d )
z 2 2e cos( d ) z e 2
e 0. 25 0. 5 cos( d ) 0. 04 d 1. 611rad
0.4 z 2 1.016 z
0.4 z 2 0.02 z 1.008 z 0.4 z 2 0.02 z 2.0180.4996 z
z 2 0.04 z 0.25 z 2 0.04 z 0.25 z 2 0.04 z 0.25
0.4
2.057 0.42 2.0182 0.196 sin 1
2.057
sin(A+B) = sin(A) cos(B) + cos(A) sin(B)
z-transform
f (k ) 0.8 ,k 0,1,2,...
z
zY ( z ) z 0.8Y ( z ) 0 Y ( z )
k
z 0.8
z-transform
z z
( z 0.8)Y ( z ) Y ( z)
z 1 ( z 0.8)( z 1)
Y ( z) 1 1 1
5
z ( z 0.8)( z 1) z 1 z 0.8
5
f (k ) 5 1 0.8 ,k 0,1,2,...
k
The solution is the sum of the solutions from (a) and (b)
f (k ) 5 1 0.8
k
0.8 ,k 0,1,2,...
k
2.11 Find the transfer functions corresponding to the difference equations of Problem 2.2 with input u(k)
and output y(k). If no transfer function is defined, explain why.
(a) and (e) are nonlinear and (b) is homogeneous. They have no transfer functions.
2.12 Test the linearity with respect to the input of the systems for which you found transfer functions in
2.11.
z
G( z)
z 1
5
6
u (k ) u1 (k ) u 2 (k )
z z
Y ( z ) G ( z )U ( z ) U1 ( z) 5 U 2 ( z)
z5 1 z 1
Y1 ( z ) Y2 ( z )
2.13 If the rational functions of Problems 2.8.(c), (d), are transfer functions of LTI systems, find the
difference equation governing each system.
z
(c) F ( z)
z 2 0.3 z 0.02
z 0.1
(d) F ( z)
z 0.04 z 0.25
2
2.14 We can use z-transforms to find the sum of integers raised to various powers. This is accomplished
by first recognizing that the sum is the solution of the difference equation
where a(k) is the kth term in the summation. Evaluate the following summations using z-transforms
n n
(a) k
k 1
(b) k
k 1
2
f(k) = f(k1) + k
Z-transform
z z2 1 z z 1 z
F ( z ) z 1 F ( z )
z 1 2
z 1 3
2 z 13
z 12
Inverse z-transform
n
nn 1
k
k 1 2
f(k) = f(k 1) + k2
7
z z 1
F ( z ) z 1 F ( z )
z 13
F ( z)
z 2 z 1
z z 2 4z 1 zz 1 z
z 1 4
3 z 1
4
2 z 1
3
6 z 1
2
n
n3 n2 n 1
k 2
nn 12n 1
k 1 3 2 6 6
2.15 Find the impulse response functions for the systems governed by the following difference equations
Equating coefficients, we solve for e and d then use the tables and the delay theorem
1.12(0.893) k 1 sin 1.515(k 1) , k 1
g (k )
0, k 1
z z
(a) F ( z) (b) F ( z)
z 1.2 z 0.2
2
z 0.3 z 2
2
z 1 z 1 1
f
z
(a) 1.25
z 1.2 z 0.2
2
z z 1 z 1z .2 z 1
0.8
z z
F ( z) 2
z 0.3 z 2 z 2e cos( d ) z e 2
2
(b)
z
z e j d
z e j d
The denominator has complex conjugate poles with magnitude 2 greater than unity.
Therefore the corresponding time sequence is unbounded and the final value theorem does not
apply.
2.17 Find the steady-state response of the systems due to the sinusoidal input u(k) = 0.5 sin(0.4 k)
(a) z (b) z
H ( z) H ( z)
z 0 .4 z 0.4 z 0.03
2
8
Sinusoidal input u (k ) 0.5 sin(0.4k )
z 1
(a) H ( z)
z 0.4 1 0.4 z 1
H e j 0.4 1
1 0.4e j 0.4
1.537 0.242
z
(b) H ( z)
z 0.4 z 0.03
2
H e j 0.4 j 0.4
1
e 0.4 0.03e j 0.4
0.714 0.273
2.18 Find the frequency response of a noncausal system whose impulse response sequence is given by
K 1
h (t )
*
h(l mK ) (t l mK )
l 0 m
K 1
H * ( s) h(l mK )e ( l mK ) s
l 0 m
K 1
H * ( j ) h(l mK )e j ( l mK )
l 0 m
sin s t kT
2
u (t ) u (k )
s
k
t kT
2
Use the convolution theorem to justify the above expression.
9
By the sampling theorem, the signal can be recovered from its samples using a LPF of bandwidth s.
Multiplication in the frequency domain is equivalent to convolution with the inverse transform, the
sinc function in the time domain. Convolution of the samples and the sinc function yields the
expression.
2.20 Obtain the convolution of the two sequences {1,1,1} and {1,2,3}
(a) Directly (b) Using z-transformation.
2.21 Obtain the modified z-transforms for the functions of Problems (2.6) and (2.7).
e jkT e jkT
For 2.6-(a), sin kT
2j
jkT
e jkT
Zm sin(kT ) Zm e
2j
1 e jmT e jmT sin m T z sin(1 m)T
2 j z e jT z e jT z 2 2 cosT z 1
e jkT e jkT
For 2.6-(b), coskT
2
jkT jkT
Zm cos(kT ) Zm e e
2
1 e jmT e jmT cosmT z cos(1 m)T
2 z e jT z e jT z 2 2 cosT z 1
For 2.7-(a) ,
10
jkT akT
e jkT akT
Zm e akT sin(kT ) Zm e
2j
1 e jmT maT e jmT maT
2 j z e jT aT z e jT aT
sin m T z e aT sin(1 m)T
e maT
z 2 2e aT cosT z e 2 aT
For 2.7-(b),
Z e e jkT akT
jkT akT
Z em
akT
cos(kT ) m
2
2.22 Using the modified z-transform, examine the intersample behavior of the functions h(k) of:
(a) Problem 2.15, and (b) 2.16. Use delays of (i) 0.3T, (ii) 0.5T, and (iii) 0.8T.
F z 1 1 1 1
z z 1z .2 0.8 z 1 z 0.2
2.15(a)
1
F ( z , m) 1.25
0.2m
z 1 z 0.2
1
F ( z , m) 1.25
0.2m
For any value m
z 1 z 0.2
F ( k , m) 1.25 1 0.2 0.2
m k 1
, k 1,2,3,.... and zero elsewhere
(i) 0.3T, m = 0.7 (ii) 0.5T, m = 0.5, and (iii) 0.8T, m = 0.2.
z z
F ( z)
z 0.3z 2 z 0.15 j1.406z 0.15 j1.406
2
2.15(b)
z
z
2e j1.677 z 2e j1.677
F ( z ) 3.5556e j 3.5556e j
z z 2e j1.677 z 2e j1.677
f (k ) 0.7111 2 sin 1.6771k
k
11
sin m T z e aT sin(1 m)T
Zm e akT
sin(kT ) e maT
z 2 2e aT cosT z e 2 aT
Zm 0.7111
2 sin 1.6771k 0.7111 2
k
m sin 1.6771m z 2 sin1.6771(1 m)
z 2 0.3 z 2
2 2 cos1.6771 0.3
(i) m = 0.7
sin 1.1740 z 2 sin0.5031
F ( z ,0.7) 0.7111 2 0.7
z 2 0.3z 2
0.7111 2 0.7 0.9223z 0.6819
z 2 0.3 z 2
f ( k ,0.7) 0.7111 2 2 0 .7 k 1
sin1.6771k 1 1.1740, k 1,2,3,.... and zero elsewhere
0.7111 2 0.5
0.8844 z 2
z 2 0.3z 2
f ( k ,0.7) 0.7111 2 2 0 .5 k 1
sin1.6771k 1 0.8386, k 1,2,3,.... and zero elsewhere
(iii) m = 0.2
z 2 0.3z 2
0.7111 2 0.2 0.3528 z 1.4762
z 2 0.3 z 2
f (k ,0.7) 0.7111 2 2 0 .2 k 1
sin1.6771k 1 0.3354, k 1,2,3,.... and zero elsewhere
z 0 .4
(v) m = 0.5 H ( z ,0.5) 0.4 h(k ,0.5) 0.4 0.5 0.4 k 1 , k 1,2,3,.... and zero elsewhere
0 .5
z 0.4
(iii) m = 0.2 H ( z ,0.2) 0.4 h(k ,0.2) 0.4 0.2 0.4k 1 , k 1,2,3,.... and zero elsewhere
0 .2
z 0 .4
2.16(b) z 5z 5z
H ( z) 2
z 0.4 z 0.03 z 0.1 z 0.3
12
0.1 m 0.3m
H ( z , m ) 5
z 0 .1 z 0 .3
h(k , m) 5 0.1 0.1
m k 1
0.3 0.3
m k 1
, k 1,2,3,....
and zero elsewhere
(0.1) and (0.3)m are complex numbers. Thus, the sequence is not defined between sampling points.
m
2.23 The following open-loop systems are to be digitally feedback controlled. Select a suitable sampling
period for each if the closed-loop system is to be designed for the given specifications
(a) Gol ( s ) 1 Time Constant = 0.1 s
s3
(b) Gol ( s ) 1 Undamped natural frequency = 5 rad/s, Damping ratio = 0.7
s 2 4s 3
2 2
T 0.025s Let T = 25 ms.
s 70 d
2.24 Repeat problem 2.23 if the systems have sensor delays of : (a) 0.025 s (b) 0.03 s
(a) T = 0.025 s (b) T = 0.03 s. (cannot sample faster than the sensor delay)
Computer Exercises
2.25 Consider the closed-loop system of Problem 2.23(a)
a. Find the impulse response of the closed-loop transfer function and obtain the impulse
response sequence for a sampled system output.
b. Obtain the z-transfer function by z-transforming the impulse response sequence.
c. Using MATLAB, obtain the frequency response plots for the analog system and for
sampling frequencies s = k b, k = 5, 35, 70.
d. Comment on the choices of sampling periods of part (b).
1 10
The closed-loop transfer function is G ( s )
0.1s 1 s 10
(a) The impulse response is
g (t ) 10e 10t
and the impulse response sequence for a sampled system output is g (kT ) 10e 10 kT
10 z
G( z)
z e 10T
13
(c) The corresponding frequency response plots for sampling periods T = 0.1, 0.05, 0.02, 0.1 s, as
well as for the analog system can be obtained using the MATLAB commands
G(j) 1.1
0.8
Slower sampling
0.6
0.4
0.2
Analog System
0
0 20 40 60 80 100
Frequency response plots for sampling frequencies s = k b, k = 5, 35, 70 and for the
analog system for Problem 2.25.
The frequency response plots are normalized (multiplied by T) to simplify their comparison. The
plots for the discrete time system are closer to the analog frequency response for faster sampling.
The discrete time plots are significantly different from the analog plot for T = 0.1 s and almost
14
indistinguishable for T = 0.1/35 and 0.1/70s. This verifies the rule of thumb for the selection of the
sampling rate.
2.26 Repeat Problem 2.25 for the second order closed-loop system of Problem 2.23(b) with plots for
sampling frequencies s = k d, k = 5, 35, 70.
25 7.0014 3.5707
The closed-loop transfer function is G ( s )
s 7 s 25 s 3.52 3.5707 2
2
% Exercise 2_24
clf
hold on
wn=5;zeta=0.7; % Closed-loop data
wd=wn*sqrt(1-zeta^2); % Damped natural frequency
ttt=2*pi/wd; T=[ttt/5,ttt/35, ttt/70]; % Sampling periods
w=[.1:.1:200];
gc=tf(wn^2,[1,2*zeta*wn,wn^2]); % Analog transfer function
% Plot the frequency response for the analog system
w=.1:.1:200;
[mc,ac, w]=bode(gc,w); plot(w,mc(:),'r')
% Calculate and plot discrete frequency responses
for i=1:length(T)
ti=T(i);
% numerator and denominator od z-transfer function
num=[7.0014*exp(-3.5*ti)*sin(3.5707*ti),0];
den=[1,-2*exp(-3.5*ti)*cos(3.5707*ti), exp(-7*ti)];
g=tf(num,den,ti);
[mm,aa,w]= bode(g,w);
plot(w,ti*mm(:))
end
(d) The frequency response show little aliasing in the frequency range of interest for T = 2/(70d) s,
some aliasing for T = 2/(35d) s, and unacceptable aliasing T = 2/(5d) s,. The analog plot (red)
is similar to that of the two faster rates at low frequencies and differs from the T = 2/(35d) s plot
close to the folding frequency. The results confirm that the rule of thumb gives a reasonable
estimate of the required sampling rate.
15
G(j) 1
0.8
0.6
0.4
Slow sampling
0.2
0
0 20 40 60 80 100 120 140 160 180 200
Frequency response plots for sampling frequencies s = k b, k = 5, 35, 70 and for the
analog system for Problem 2.26.
2.27 Use SIMULINK with a sampling period of 1s. to verify the results of Problem 2.17. Simulate the
system for 300 s then change the axes to display the last 50 s only.
Use SIMULINK with a sampling period of 1s to verify the result of Problem 2.17. Simulate the
system for 300 s then change the axes to display the last 50 s only.
(a) z
H ( z)
z 0 .4
z
(z-0.4)
Sine Wave Discrete Scope
Zero -Pole
Scope 1
Simulation diagram for Problem 2.17(a) using SIMULINK.
16
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
250 255 260 265 270 275 280 285 290 295 300
Sampled sinusoidal input (red) and steady-state sinusoidal (blue) for Problem 2.17(a).
(b) z
H ( z)
z 0.4 z 0.03
2
z
poles (z)
Sine Wave Discrete Scope
Zero -Pole
Scope 1
17
0.5
0.4
0.3
0.2
0.1
-0.1
-0.2
-0.3
-0.4
-0.5
250 255 260 265 270 275 280 285 290 295 300
Sampled sinusoidal input (red) and steady-state sinusoidal (blue) for Problem 2.17(a).
2.28 The following difference equation describes the evolution of the expected price of a commodity1
where pe(k) is the expected price after k quarters, p(k) is the actual price after k quarters, and is a
constant.
a) Simulate the system with = 0.5 and a fixed actual price of one unit and plot the actual and
expected prices. Discuss the accuracy of the model prediction
b) Repeat part (a) for an exponentially decaying price p(k) = (0.4)k.
c) Repeat part (a) for an exponentially decaying price p(k) = (0.95)k.
d) Discuss the predictions of the model referring to your simulation results.
The recursion describing the solution can be easily simulated using a discrete state-space block.
Although discrete state-space equations are introduced in Chapter 7, they reduce to the simple
recursion of our model for the case of scalar vector x(k), where x(k) is the price pe(k). We could
also avoid the use of state-space blocks by z-transforming to obtain the corresponding transfer
function.
a) Simulate the system with = 0.5 and a fixed actual price of one unit and plot the actual and
expected prices. Discuss the accuracy of the model prediction.
y(n)=Cx(n)+Du(n)
1
x(n+1)=Ax(n)+Bu(n)
Constant Discrete State -Space Scope
18
The model converges to the correct estimate after a few sample points. At k = 5, the error is less
than 5%.. This is a reasonable estimate assuming that the sampling period is small relative to the
time after which the price estimate is used.
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
We use a state space block with unity initial condition and A=0.4.
y(n)=Cx(n)+Du(n) y(n)=Cx(n)+Du(n)
x(n+1)=Ax(n)+Bu(n) x(n+1)=Ax(n)+Bu(n)
Scope 1
Simulation diagram for exponentially decaying price using SIMULINK.
The dynamics of the model are too slow to track the exponentially decaying price. The
actual price decays much faster than the model predictions.
19
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
We use a state space block with unity initial condition and A=0.95 and with the same
simulation diagram as part (b).
The dynamics of the model are able to track the exponentially decaying price since the
decay is very slow.
20
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 2 4 6 8 10 12 14 16 18 20
The price estimator dynamics are able to estimate a constant price but are unable to
estimate a decaying exponential if the rate of decay is fast relative to the filter dynamics. If
the price decay is very slow, then the estimator is able to track the price with some error.
21
Chapter 3 Solutions
3.1. Find magnitude and phase at frequency ω=1 rad/s of a zero-order hold with sampling period T=0.1
s.
T 0.1
sin sin 1
T 2 0.1 2 0.1
| G ZOH ( j ) | T sin c T
2 T 0.1
1
2 2
while the phase is given by
T 0.1
G ZOH ( j ) 1 0.05 rad
2 2
3.2. The first-order hold uses the last two numbers in a sequence to generate its output. The output of
both the zero-order hold and the first order hold is given by
(a) For a discrete impulse input, obtain and sketch the impulse response for the above equation
with a = 0 and a = 1.
(b) Write an impulse sampled version of the above impulse response and show that the transfer
function is given by
GH ( s)
1
s
1 e sT 1 ae sT
a
sT
1 e sT
(c) Obtain the transfer functions for the zero-order hold and for the first-order hold from the above
transfer function. Verify that the transfer function of the zero-order hold is the same as that
obtained in Section 3.3.
u(t ) u( kT ), kT t ( k 1)T
The first order hold uses the last two numbers of a sequence to generate the output
u kT u k 1T
u(t ) u kT
T
t kT , kT t ( k 1)T
1
u kT u k 1T
u(t ) u kT a
T
t kT , kT t ( k 1)T
(a) For a zero-order hold (ZOH), the output for each sampling period is a constant equal to the
input at the beginning of the period. Thus it is equal to one for the first period and zero
thereafter. For a first-order hold (FOH), the output increases steadily from an initial level =
u(0) =1, to reach a level of 2 at t = T. For the second sampling period, u(T) is zero and u(0)
is unity. Thus the output decrease steadily to a level of -1 at t = 2T. At t = 3T, the output
goes to zero since both u(T) and u(2T) are zero. The results of this analysis are shown in
Figure P3.0.
1 1 1
2T
0 0 T 0 T
Unit Impulse Impulse
Impulse Response Response
of ZOH of FOH
Figure P3.0 Unit impulse and impulse responses for ZOH and FOH.
(b) The output of Problem 3.1 for u(0) = 1 and u(k) = 0, k > 0, gives the impulse sampled form
u 0
u * (t ) u 0 1t 1t T a t.1t (t T )1t T au (0)1t T
T
u 0
a (t T ).1t T (t 2T )1t 2T au (0)1t 2T
T
with Laplace transform the impulse response to obtain
1 1 1
U * ( s)
s
1 e sT a
Ts
2
1 2e sT e 2 sT ae sT 1 e sT
1 a
s
1 e sT 1 ae sT
sT
1 e sT
1 a
i.e.
s
G H ( s) 1 e sT 1 a e sT
sT
1 e sT
(c) Thus for a = 0, we have the impulse response of the zero-order hold (as given in the notes)
1
*
GZOH ( s)
s
1 e sT
2
and for a = 1, we have the impulse response of the first-order hold
*
GFOH ( s)
1
s
1 e sT 1 e sT
1
sT
1 e sT
3.3. Many chemical processes can be modelled by the following transfer function:
K
G ( s) e Td s
s 1
where K is the gain, is the time constant and Td is the time delay. Obtain the transfer function
G Z A S (z) for the system in terms of the system parameters. Assume that the time delay Td is a
multiple of the sampling time T.
G ( s) K K K Td s
Obtain the partial fraction expansion e Td s e
s s s 1 s s 1
1 z 1
K K Td / T
1
T 1
z
1 z 1 e z
K z 1 Td / T
K z
z e T
K 1 e T Td / T
z
z e T
3.4. Obtain the transfer function of a point mass (m) with force as input and displacement as output
neglecting actuator dynamics then find G Z A S ( z) for the system.
X 1
The transfer function for the system is G ( s)
F m s2
3
1
GZAS ( z ) 1 z 1 Z 1 z Z
G(s) 1
3
s ms
1 T z 1 z
2 1 1
1 z
1
m 1 z 1 3
T 2 z 1
m z 12
3.5. For an internal combustion engine, the transfer function with injected fuel flow rate as input and fuel
flow rate into the cylinder as output is given by1
s 1
G( s)
s 1
where is a time constant and is known as the fuel split parameter. Obtain the transfer function
G Z A S (z) for the system in terms of the system parameters.
G ( s ) s 1 1 1
Obtain the partial fraction expansion
s s s 1 s s 1
G ZAS ( z ) 1 z 1 Z G(ss) 1 z Z 1s s11
1
1
1
1 z 1 1
1 e T z 1
1 z
1
1z 1
z e T
3.6. Repeat Problem 3.5 including a delay of 25 ms in the transfer function with a sampling period of
10 ms.
25 = 3 10 0.5 10
Hence, m = 3 and f = 0.5. The partial fraction coefficient corresponding to the s-domain pole at
(1/) is modified by the factor e5/ where the time constant is assumed to be given in ms. The
transfer function for the system with ZOH and sampler is given by
1J. Moskwa, Automotive Engine Modeling and Real Time Control, MIT Doctoral Thesis, 1988.
4
GZAS ( z ) 1 z 1 Z G(ss)
1
1 z 1
1e5 / z 3
1 z
1
1 e T z 1
1 z 1e 5 / 3
1 z
z e T
Hence, m = 3 and f = 0.5. The partial fraction coefficient corresponding to the s-domain pole at
(1/) is modified by the factor e5/ where the time constant is assumed to be given in ms. The
transfer function for the system with ZOH and sampler is given by
GZAS ( z ) 1 z 1 Z G(ss)
1
1 z 1
1e5 / z 3
1 z
1
1 e T z 1
1 z 1e 5 / 3
1 z
z e T
3.7. Find the equivalent sampled impulse response sequence and the equivalent z-transfer function for
the cascade of the two analog systems with sampled input
1 10
H 1 (s) H 2 ( s)
s6 s 1
(a) In the absence of samplers between the systems, the overall transfer function is
10
H (s)
( s 6)( s 1)
2 2
s 6 s 1
5
H ( z)
2z
2z
2 e T e 6T z
z e 6T z e T
z e 6T z e T
(b) If the analog systems are separated by a sampler then each has a z-domain
transfer function and the transfer functions are given by
z 10 z
H1 ( z) H 2 ( z)
z e 6T z e T
10 z 2
H ( z)
z e 6T z e T
The partial fraction expansion of the transfer function is
10 e 6T z e T z
H ( z)
e e T
6T
z e
6T
z e T
h(kT )
10
6T
e e T
e 6T e 6 kT e T e kT
6T
e e
10
T
e 6( k 1)T e ( k 1)T ,k 0,1,2,...
3.8. Obtain expressions for the analog and sampled outputs from the block diagrams of Figure P3.1
(a)
R(s)
U(s) U*(s) Y(s) Y*(s)
C(s) G(s)
T T
H(s)
(b)
6
R(s) E(s)
*
E (s) Y(s) Y*(s)
C(s) G(s)
T
T
H(s)
(c)
H(s)
(CR ) * ( s)
Solving for U*(s), we obtain U * ( s)
1 (CHG ) * ( s)
G ( s)(CR ) * ( s)
The analog output is Y ( s) G ( s) U ( s)
*
1 (CHG ) * ( s)
G * ( s)(CR ) * ( s)
The sampled output is Y ( s)
1 (CHG ) * ( s)
7
R * ( s)
Solving for E*(s), we obtain E ( s)
*
1 H * ( s)(CG ) * ( s)
C ( s) G ( s ) R * ( s)
Hence, we have the output Y ( s)
1 H * ( s)(CG ) * ( s)
(CG ) * ( s) R * ( s)
and the sampled output Y * ( s)
1 H * ( s)(CG ) * ( s)
(c) Since there are samplers between all blocks, we use the feedback rule for block diagrams to
obtain
C * ( s) R * ( s)
U * ( s)
1 H * ( s)G * ( s)C * ( s)
G * ( s)C * ( s) R * ( s)
Y * ( s)
1 H * ( s) G * ( s) C * ( s)
G ( s)C * ( s) R * ( s)
The analog output is Y ( s) G ( s) U ( s)
*
1 H * ( s)G * ( s)C * ( s)
3.9. For the shown unity feedback system of Figure P3.2, we are given the analog subsystem
s8
G( s)
s5
The system is digitally controlled with a sampling period of 0.02 s. The controller transfer function
was selected as
0.35 z
C ( z)
z 1
(a) Find the z-transfer function for the analog subsystem with DAC and ADC.
(b) Find the closed-loop transfer function and characteristic equation.
(c) Find the steady-state error due to a sampled unit step and a sampled unit ramp. Comment on
the effect of the controller on steady-state error.
Figure P3.2 Block diagram for a closed-loop system with digital control.
(a)
8
R(z) E(z) U(z) Y(z)
C(z) ZOH G(s)
T
G ( s) s8 16
. 0.6
s s s 5 s s5
G ZAS ( z ) 1 z 1 Z Gs(s)
z 1 1.6 z 0.6 z
z z 1 z e 50.02
0.6z 1
1.6
z e 0.1
z 0.845
z 0.905
(b) The closed-loop transfer function is
C ( z)GZAS ( z )
Gcl ( z )
1 C ( z )GZAS ( z )
0.35 z z 0.848
z 1 z 0.905 0.35 z z 0.848
0.35 z z 0.848
. z 2 2.202 z 0.905
135
0.259 z z 0.848
z 2 1631
. z 0.670
(c) The system is type 1 and therefore has zero steady-state error due to a step and finite steady-
state error due to a ramp. The error due to a unit ramp is
9
100T
e()% %
z 1C ( z )GZAS ( z ) z 1
2
% 3.57%
z 1
0.351.6
z e 0.1 z 1
The steady-state error is improved because the controller increases the type of the system by
1.
3.10. Find the steady-state error due to a unit step disturbance input for the systems of Figure P3.3 with
a sampling period of 0.03 s and the transfer functions
2 4s 2 e sT 0.95
Gd ( s) G ( s) C * ( s)
s 1 s s 3 e sT 1
(a)
D(s)
Gd(s)
(b)
D(s)
Gd(s)
Y(s) Y*(s)
R(s)
C*(s) ZOH
T T G(s)
T
Sampling gives
10
z z z z 0.911 10 2 z
(Gd D)( z ) 2 2
z 1 z e z 1 z 0.970 z 1 z 0.970
T
The transfer function for the plant with ZOH and sampler is
GZAS ( z ) 1 z 1 Z s4ss23
2
8 3 4 1 1
1 z 1 Z 2
9 s s 3
s
8 3
1 z 1 4 1
1
1 z 1
2
9 1 z 1
1 e 3 0.03 1
z
83 4 1 z 1
1
1 z 1 9 1 0.914 z 1
0.118 z 0.942
z 1z 0.914
z 0.95
C ( z)
z 1
Y ( z)
(Gd D)( z ) 0.911 10 2 z
z 0.942 z 0.95
1 0118
.
1 C ( z)GZAS ( z ) z 1 z 0.97 z 1 2 z 0.914
y ( ) z 1Y ( z ) z 1 0
8s 2 4 3 10 9 1 19
G ( s )Gd ( s ) D( s ) 4 2
s s 1s 3
2
s s s 1 s 3
Sampling gives
4 3z 10 9z z 1 9z
(GGd D)( z ) 4
z 1
T
2
z 1 ze z e 3T
3.529 10 3 z z 0.980 z 0.942
z 12 z 0.970 z 0.914
The transfer function for the plant with ZOH and sampler is (as in part a)
11
GZAS ( z ) 1 z 1 Z s4ss23
2
0.118 z 0.942
z 1 z 0.914
z 0.95
C( z)
z 1
(Gd D)( z )
Y ( z)
1 C ( z )GZAS ( z )
3.529 10 3 z z 0.980 z 0.942 z 0.942z 0.95
1 0.1182
z 1 z 0.970 z 0.914 z 12 z 0.914
2
y ( ) z 1Y ( z ) z 1 0
12
Computer Exercises
(a) Obtain the transfer function for the system with sampled input and output.
(b) Obtain the transfer function for the system with DAC and ADC.
(c) Obtain the unit step response of the system with sampled output and analog input.
(d) Obtain the poles of the systems in (a), (b) and the output of (c) and comment on the differences
between them.
>> g=zpk(-2,[0,-5],10)
>> gd=c2d(g,.05,'imp')
>> g=zpk(-2,[0,-5],10)
>> gd = c2d(g,.05,'zoh')
0.4654 z 0.905
we obtain the transfer function G( z)
z 1z 0.7788
(c) Obtain the output with the MATLAB command
>> [y,t]=step( tf([10,20],[1,5,0]),[0:0.05:2]) % Sampled analog step response
>> plot(t, y, ‘*’) % Plot samples with period 0.05
13
Figure P3.4 Step response of system with analog input and sampled output.
0.05 p
(d) The two systems of (a) and (b) have the same poles at (1, 0.779) given by e s
with ps = 0, -
5 (the poles of the analog system). The output of (c) has an extra pole at unity resulting from
the step input with its pole at the origin.
(a) The transfer function for the analog subsystem with DAC and ADC of Figure P3.3 is obtained
using the MATLAB command
(b) The responses show that the steady-state error due to a unit step has been drastically reduced
using the controller. The transient response has been somewhat adversely affected. The
deterioration in the time response is the price paid for improving the steady-state error. A
different controller must be used if the transient response is unacceptable.
14
1.6
1.5
1.4
1.3
1.2
1.1
1
0 0.5 1 1.5 2
1.1
0.9
0.8
A m plitude
To: Y (1)
0.7
0.6
0.5
0.4
0.3
0.2
0 0.1 0.2 0.3 0.4 0.5 0.6
Tim e (s ec .)
(c) The frequency response plot shows that the magnitude at the folding frequency is relatively low.
Thus the sampling frequency is acceptable.
The sampling frequency is chosen based on the actual dynamics of the system after the loop is
closed since these are the conditions under which the system actually operates. The open-loop
dynamics are irrelevant and may be much slower than the closed-loop dynamics.
15
1.1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0 100 200 300 400 500
3.14. Consider the internal combustion engine model of Problem 3.4. Assume that, for the operational
conditions of interest, the time constant is approximately 1.2 s while the parameter can vary in
the range 0.4 to 0.6. The digital cascade controller
0.02 z
C ( z)
z 1
was selected to improve the time response of the system with unity feedback and a sampling period
of 4 ms. Simulate the digital control system with = 0.4, 0.5, 0.6, and discuss the behavior of the
system in each case.
We use SIMULINK to simulate the system with the numerical values of the parameters entered in
MATLAB. The simulation diagram is shown in Figure P3.8. Alternatively, the following
MATLAB commands yield the same results.
The step responses plotted using MATLAB are shown in Figure P3.9. As the value of the
parameter increases, the zero of the system gets closer to the origin and its effect on the time
response increases. This results in a higher percentage overshoot and a faster response. The
controller includes an integral term which results in zero steady-state error due to step for all three
parameter values.
16
1/z
0.02 z eps *tau .s+1
Zero-Order
Hold
Figure P3.8 Simulation diagram for the closed-loop control of the internal combustion engine.
Step Response
0.6 0.5
0.4
0.8
Amplitude
0.6
0.4
0.2
0
0 1 2 3 4 5 6
Time (sec)
Figure P3.9 Step response for the internal combustion engine with = 0.4, 0.5, and 0.6.
3.15. Simulate the continuous-discrete system of Problem 3.7 and examine the behavior of both the
continuous output and the sampled output. Repeat the simulation with a %10 error in the plant
gain. Discuss the simulation results and comment on the effect of the parameter error on
disturbance rejection.
The SIMULINK scheme employed for the simulation of the control system is shown in Figure
Figure P3.10.
17
Figure P3.10 SIMULINK block diagram for Problem 3.13
A step reference input is applied at time t=0 s and a step disturbance is applied at time t=1 s. The
resulting continuous and sampled process output are shown in Figure P3.11.
1.5
process output
0.5
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time [s]
Figure P3.11 Time response for the nominal system of Problem 3.15. Black: analog output.
Red: sampled output.
The results obtained when the gain of the process is increased by 10% are shown in Figure P3.12. The
steady-state error is zero despite the gain modification because of the presence of an integrator in the
controller.
18
2
1.5
process output
0.5
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time [s]
Figure P3.12 Time response for Problem 3.15 when the gain is increased by 10%. Black: analog
output. Red: sampled output.
19
Chapter 4. Solutions
4.1 Determine the asymptotic stability and the BIBO stability of the following systems
y ( k 2 ) 0.8 y ( k 1) 0. 07 y ( k ) 2u( k 1) 0. 2 u( k )
a)
k 0, 1, 2,...
y ( k 2 ) 0.8 y ( k 1) 0. 07 y ( k ) 2u( k 1) 0. 2 u( k )
b)
k 0, 1, 2,...
y ( k 2 ) 0.1y ( k 1) 0. 9 y ( k ) 3. 0u( k )
c)
k 0, 1, 2,...
To determine the asymptotic stability or BIBO stability, we z-transform to obtain the transfer
function. The system is both BIBO stable and asymptotically stable if its poles are all inside
the unit circle (without transfer function reduction).
y ( k 2 ) 0.8 y ( k 1) 0. 07 y ( k ) 2 u( k 1) 0. 2 u( k )
a)
k 0, 1, 2,...
2 z 0.2 2 z 01
.
G ( z)
z 0.8z 0.07 z 0.7 z 01
2
.
y ( k 2 ) 0.8 y ( k 1) 0. 07 y ( k ) 2u( k 1) 0. 2 u( k )
b)
k 0, 1, 2,...
2 z 0.2 2 z 01
.
G ( z)
z 0.8z 0.07 z 0.7 z 01
2
.
y ( k 2 ) 0.1 y ( k 1) 0. 9 y ( k ) 3. 0u( k )
c)
k 0, 1, 2,...
3 3
G ( z)
2
. z 0.9 z 0.05 0.9 0.052
z 01 2
1
4.2 Biochemical reactors are used in different processes such as waste treatment and alcohol fermentation.
By considering the dilution rate as the manipulated variable and the biomass concentration as the
measured output, the biochemical reactor can be modeled by the following transfer function in the
vicinity of an unstable steady-state operating point1
5.8644
G ( s)
5.888s 1
Determine GZAS(z) with a sampling rate T=0.1 and then consider the feedback controller
z 1.017
C ( z) = -
z 1
G ZAS ( z ) = 1 z 1 Z Gs(s) z 0.11004
.017
Although the transfer function from the reference input to the system output
Y ( z) 0.1004
R( z ) z 0.8997
appears to be asymptotically stable (note that the pole is inside the unit circle), the controller
results in pole-zero cancellation outside the unit circle and therefore the system is not internally
stable according to Theorem 4-5. This can also be verified by considering the transfer function
between the disturbance input D and the system output Y
Y ( z) 0.10045( z 1)
D( z ) ( z 1.017)( z 0.0997)
The pole at 1.017 is outside the unit circle and therefore the system output is unbounded when a
disturbance occurs in the system.
4.3 Use the Routh-Hurwitz criterion to investigate the stability of the systems
5( z 2)
a) G( z)
( z 0.1)( z 0.8)
10( z 01
.)
b) G ( z)
( z 0.7)( z 0.9)
1
B. W. Bequette, Process Control – Modeling, Design, and Simulation, Prentice Hall, Upper Saddle River
(NJ), 2003.
2
1 w
z
1 w
The systems investigated in (a) and (b) are both second order and the following conditions
(see Example 4.4) can be used. For the second order polynomial
F(z) = a2 z2 + a1 z + a0 = 0
i) a2 - a1 + a0 > 0
ii) a2 - a0 > 0
iii) a2 + a1 + a0 > 0
5 z 2 5 z 2
a) G( z) 2
z 0.1z 0.8 z 0.9 z 0.08
i) 1 - (-0.9) + 0.08 > 0
ii) 1 - 0.08 > 0
iii) 1 + (-0.9) + 0.08 > 0
Hence, the system is stable. This is obvious since its poles are inside the unit circle.
Hence, the system is stable. This is obvious since its poles are inside the unit circle.
The conditions for the Jury criterion are equivalent to those of Problem 4.3. The conditions
are:
F(1) > 0
F(-1) > 0
a2 > | a0 |
5 z 2 5 z 2
a) G( z) 2
z 0.1z 0.8 z 0.9 z 0.08
i) 1 + (-0.9) + 0.08 > 0
ii) 1 - (-0.9) + 0.08 > 0
iii) 1 > 0.08
3
i) 1 + (-1.6) + 0.63 > 0
ii) 1 - (-1.6) + 0.63 > 0
iii) 1 > 0.63
4.5 Obtain the impulse response for the systems of Problem 4.3 and verify the results obtained
using the Routh-Hurwitz criterion. Also determine the exponential rate of decay for each
impulse response sequence.
The impulse response sequence is the inverse z-transform of the z-transfer function.
Exponential rate of decay is (0.8)k, which clearly goes to zero asymptotically. We have
either of the bounds
271428
.
i 0
h(i ) 2 135.714 0.8i
i 0 1 0.8
1357.14
27.1428
i 0
h(i ) 2 13.5714 0.8i
i 0 1 0.8
135.714
G( z) 10( z 01.) .
1587 57.143 55.556
b)
z z ( z 0.7)( z 0.9) z z 0.7 z 0.9
10( z 01.) 40 50
G ( z)
( z 0.7)( z 0.9) z 0.7 z 0.9
1587
. ( k ) 57.143 (0.7) k 55.556 (0.9) k , k 0
g(t)
0, k 0
40 (0.7) k 1 50 (0.9) k 1 , k 1
0, k 1
Exponential rate of decay is (0.9)k, which clearly goes to zero asymptotically. We have
either of the bounds
4
114.286
i 0
h(i ) 2 57143
. 0.9i
i 0 1 0.9
1142.86
100
i 0
h(i ) 2 50 0.9 i
i 0 1 0.9
1000
4.6 Use the Routh-Hurwitz criterion to find the stable range of K for the closed-loop unity
feedback systems with loop gain
K ( z 1)
a) G( z)
( z 0.1)( z 0.8)
K ( z 01.)
b) G ( z)
( z 0.7)( z 0.9)
The characteristic equation for a system with forward gain G(z) and unity feedback is
where N(z) and D(z) are the numerator and denominator of the transfer function
respectively.
K ( z 1)
a) G ( z )
( z 0.1)( z 0.8)
( z 01
. )( z 0.8) K ( z 1) z 2 ( K 0.9) z 0.08 K 0
This is a second order polynomial and the Routh-Hurwitz test yields the stability
conditions are
i) a2 - a1 + a0 > 0
ii) a2 - a0 > 0
iii) a2 + a1 + a0 > 0
Hence
(i) 1 (K 0 .9) + (0.08 K) > 0 1.98 2 K > 0 K < 0.99
(ii) 1 (0.08 K) > 0 K > 0.92
(iii) 1 + (K 0 .9) + (0.08 K) > 0 0.18 > 0
K ( z 01
.)
b) G ( z )
( z 0.7)( z 0.9)
5
The closed loop characteristic equation is
( z 0.7)( z 0.9) K ( z 01
. ) z 2 ( K 1.6) z 0.63 01
.K0
This is a second order polynomial and the Routh-Hurwitz test yields the conditions of
Problem 4.3. The stability conditions are
(i) 1 (K 1.6) + (0.63 + 0.1K) > 0 3.23 0.9 K > 0 K < 3.589
(ii) 1 (0.63 + 0.1K) > 0 K < 3.7
(iii) 1 + (K 1.6) + (0.63 + 0.1K) > 0 1.1 K 0.03 > 0 K > 0.0273
The systems are all second order and the Jury criterion gives the same three conditions
obtained in Problem 4.6 for each systems. The remainder of the analysis is identical to
Problem 4.6.
4.8 Use the Jury criterion to dermine the stability of the following polynomials
a) z 5 0.2 z 4 z 2 0.3 z 0.1 0
b) z 5 0.25 z 4 0.1z 3 0.4 z 2 0.3z 0.1 0
Row z0 z1 z2 z3 z4 z5
1 0.1 0.3 1 0 0.2 1
2 1 0.2 0 1 0.3 0.1
3 0.99 0.23 0.1 1 0.32
4 0.32 1 0.1 0.23 0.99
5 0.8777 0.0923 0.0067 0.9164
6 0.9164 0.0067 0.0923 0.8777
7 0.0199 0.1277 0.131
6
Row z0 z1 z2 z3 z4 z5
1 0.1 0.3 0.4 0.1 0.25 1
2 1 0.25 0.1 0.4 0.3 0.1
3 0.99 0.22 0.14 0.41 0.275
4 0. 275 0.41 0.14 0.22 0.99
5 0.9045 0.3306 0.1001 0.4664
6 0. 4664 0. 1001 0. 3306 0. 9045
7 0.812 0.2752 0.2288
We conclude that the polynomial is stable. The polynomial has no roots outside the unit
circle.
4.9 Determine the stable range of the parameter a for the closed-loop unity feedback systems
with loop gain
1.1( z 1)
a) G( z)
( z a)( z 0.8)
1.2( z 0.1)
b) G( z)
( z a)( z 0.9)
1.1( z 1)
a) G( z)
( z a)( z 0.8)
This is a second order polynomial and the Routh-Hurwitz test yields the stability
conditions are
i) a2 - a1 + a0 > 0
ii) a2 - a0 > 0
iii) a2 + a1 + a0 > 0
Hence
(i) 1 (0 .3 a) + (0. 8 a1.1) > 0 1.8 a 0.4 > 0 a > 2/9
(ii) 1 (0. 8 a1.1) > 0 a <
(iii) 1 + (0 .3 a) + (0. 8 a1.1) > 0 0.2 0.2 a > 0 a < 1
7
The stable range of a is: 2/9 < a < 1
1.2( z 0.1)
b) G( z)
( z a)( z 0.9)
This is a second order polynomial and the Routh-Hurwitz test yields the stability
conditions are
(i) 1 (0 .3 a) + (0. 9 a0.12) > 0 1.9a 0.82 > 0 a > 41/95
(ii) 1 (0. 9 a 0.12) > 0 0.88 0.9 a > 0 a < 44/45
(iii) 1 + (0 .3 a) + (0. 9 a 0.12) > 0 1.42 0.1 a >0 a < 14.2
4.10 For a gain of 0.5, derive the gain margin and phase margin of the systems of Problem 4.6 analytically.
Let T = 1 with no loss of generality since the value of T in radians is all that is needed for the
solution. Explain why the phase margin is not defined for the system of Problem 4.6(a).
Hint: The gain margin is obtained by finding the point where the imaginary part of the frequency
response is zero. The phase margin is obtained by finding the point where the magnitude of the
frequency respone is unity.
K ( z 1)
a) G ( z )
( z 0.1)( z 0.8)
j 0.5(e j 1)
G (e ) j 2
e 0.9e j 0.08
0.5cos 1 j sin
cos2 0.9 cos 0.08 jsin 2 0.9 sin
which yields
8
The second value corresponds to the positive real-axis intersection
G ( e j ) 0.5435
cos 1 ( 0.91)
The first value corresponds to the negative-real axis intersection we seek and to the value z = 1.
The intersection with the negative real axis is given by
G (1) 0.5051
0.5( z 0.1)
b) G ( z )
( z 0.7)( z 0.9)
0.5(e j 0.1)
G ( e j )
e j 2 1.6e j 0.63
0.5cos 0.1 j sin
cos2 1.6 cos 0.63 jsin 2 1.6 sin
sin 2 cos 2 1.6 cos 0.37
cos 0.12 sin cos 1.6 sin sin 0.2 cos 0.21 0
which yields
sin pc 0
Thus, the negative-real axis intersection corresponds to the value z = 1. The intersection with the
negative real axis is given by
G (1) 0.1393
9
To find the phase margin, we evaluate the magnitude squared of the frequency response
2
G ( e j )
0.25 cos 0.1 sin 2
2
cos2 1.6 cos 0.632 sin 2 1.6 sin 2
0.250.2 cos 1.01
1
2.52 cos2 5.216 cos 2.6969
We solve for the frequency and obtain the positive solution = 0.801 rad/s
PM 180 G (e j ) 25.872
Computer Exercises
4.11 Write a computer program to perform the Routh-Hurwitz test using a suitable CAD tool.
A MATLAB function to bilinearly transform a given polynomial and test its stability is given
below.
function [con,sump]=drouth(pol)
% First perform the bilinear transformation to obtain the
% polynomial sump i.e z=(w+1)/(w-1)
np=[1,1]; nn=[1,-1]; sn=nn; l=length(pol);
sump=pol(1)*np+pol(2)*nn;
for i=3:l
sn=conv(sn,nn); sump=conv(sump,np)+pol(i)*sn; end
dl=length(sump);
% Test the polynomial coefficient using the necessary
% stability condition that all must be positive
for i=1:dl
if sump(i)<0; con = 'Unstable'; return; end
end
% If all coefficients are positive, use the Routh-Hurwitz
% criterion
dlp = dl; a = sump;
for j=1:dl-2
ni=floor(dlp/2);
for i = 1:ni-1
b(i) = a(2*i+1)-a(1)*a(2*i+2)/a(2);
if b(1) <= 0; con = 'Unstable'; return; end
end
10
if dlp/2 > ni; b(ni)=a(dlp); end
for k = 2:2:dlp
a(k-1) = a(k); a(k) = b(k/2); end
dlp = dlp-1; end
con = 'stable';
4.12 Write a computer program to perform the Jury test using a suitable CAD tool.
A MATLAB function to test the stability of polynomial using the Jury test is given below.
4.13 Write a computer program that uses the Jury test program of 4.10 to determine the stability
of a system with an uncertain gain K in a given range [Kmin , Kmax]. Verify the answers
obtained for Problem 4.5 using your program.
The following program shows that the stability ranges obtained for Problem 4.5 are correct.
It calls the function jurytest. If Kmax=0.99 or Kmin=-0.92, instability results.
% Program JuryRange
% Set K = Kmin, call jury, increment K until K>= Kmax or an
unstable
% polynomial is encountered
Kmin =-0.921; Kmax=0.989; Kstep=0.001; % Define Kmin, Kmax,
Kstep
K=Kmin;
while K< Kmax
pol=[1, K-0.9, 0.08-K];% Statement to evaluate the coefficient
of pol
con=jurytest(pol);
if con==0; 'unstable', K, return; end
K=K+Kstep;
11
end
'stable'
4.14 Show how the program of Problem 4.11 can be used to test the stability of a system with
uncertain zero location. Use the program to test the effect of a 20% variation in the
location of the zero for the systems of Problem 4.5, with a fixed gain equal to half the
critical value.
0.495( z a )
The open-loop transfer function is G ( z ) , 0.8 a 1.2
( z 0.1)( z 0.8)
The closed loop characteristic equation is
0.495( z a ) ( z 0.1)( z 0.8) z 2 0.405 z 0.08 0.495a, 0.8 a 1.2
The program JuryRange with Kmin=0.8, Kmax=1.2, and the above polynomial shows that
the system is stable for the given range of zero locations.
4.15 Show how the program of Problem 4.11 can be used to test the stability of a system with
uncertain pole location. Use the program to test the effect of a 20% variation in the
location of the first pole for the systems of Problem 4.5, with a fixed gain equal to half the
critical value.
0.495( z 1)
The open-loop transfer function is G ( z ) , 0.64 p 0.96
( z 0.1)( z p)
The closed loop characteristic equation is
0.495( z 1) ( z 0.1)( z p) z 2 0.395 p z 0.1 p 0.495, 0.64 p 0.96
The program JuryRange with Kmin=0.64, Kmax=0.96, and the above polynomial shows
that the system is stable for the given range of pole locations.
4.16 Simulate the closed-loop systems of Problem 4.5 with a unit step input and (i) gain K equal
to half the critical gain, (ii) gain K equal to the critical gain. Discuss their stability using
your simulation results.
12
Step Response
1
0.8
0.6
0.4
Amplitude
0.2
-0.2
-0.4
-0.6
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)
Figure 4-1 Step response of the unstable system of Problem 4.5(a) at the critical gain.
For K = Kcr/2 = 0.495, we obtain a stable step response but because the system has a zero
at 1, the response decays to zero. This is similar to the response to the response of an
analog system with a differentiator or numerator s.
Step Response
0.5
0.45
0.4
0.35
0.3
Amplitude
0.25
0.2
0.15
0.1
0.05
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45
Time (sec)
Figure 4-2 Step response of the system of Problem 4.5(a) at half the critical gain.
13
Step Response
150
100
50
Amplitude
-50
-100
-150
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)
Figure 4-3 Step response of unstable system of Problem 4.5(b) at the critical gain.
For K = Kcr/2 = 1.8945, we obtain a stable step response. The system is type zero and the
steady-stae error is small but not zero.
Step Response
1.8
1.6
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 0.1 0.2 0.3 0.4 0.5 0.6
Time (sec)
Figure 4-4 Step response of unstable system of Problem 4.5(b) at half the critical gain.
14
4.17 For unity gain, obtain the Nyquist and Bode plots of the systems of Problem 4.5 using
MATLAB and determine
i) The intersection with the real axis using the Nyquist plot then using the Bode plot.
ii) The stable range of positive gains K for the closed-loop unity feedback systems.
iii) The gain margin and phase margin for a gain K = 0.5
( z 1)
a) G( z)
( z 0.1)( z 0.8)
>> g=(z-1)/(z-.1)/(z-.8)
Transfer function:
z-1
------------------
z^2 - 0.9 z + 0.08
>> nyquist(g)
>> bode(g)
15
Nyquist Diagram
0.8
0.6
0.4
System: g
0.2
Real: -1.01
Imag: 5.72e-016
Imaginary Axis
-0.2
-0.4
-0.6
-0.8
-1
Figure 4-5 Nyquist plot for the system of Problem 4.5(a) with unity gain.
Bode Diagram
2
0
System: g
Frequency (rad/sec): 3.14
-1 Magnitude (dB): 0.0873
Magnitude (dB)
-2
-3
-4
-5
-6
90
45
0
Phase (deg)
-45
-90
-135 System: g
Frequency (rad/sec): 3.14
Phase (deg): -180
-180
-1 0 1
10 10 10
Frequency (rad/sec)
Figure 4-6 Bode plot for the system of Problem 4.5(a) with unity gain.
iv) The intersection with the real axis using the Nyquist plot then using the Bode plot.
16
From the Nyquist plot, the intersection with the real axis is at 1.01 and the system is
closed-loop unstable. From the Bode plot, at an angle of 180 the corresponding
magnitude is 0.0873 dBs, i.e. magnitude greater than unity. The corresponding
magnitude is
v) The stable range of positive gains K for the closed-loop unity feedback systems.
To put the system on the verge of instability, we need to reduce the gain to the critical
gain Kcr = 0.99 (as shown in Problem 4.5).
vi) The gain margin and phase margin for a gain K = 0.5
>> margin(g*.5)
Bode Diagram
Gm = 5.93 dB (at 3.14 rad/sec) , Pm = Inf
-4
-5
-6
-7
Magnitude (dB)
-8
-9
-10
-11
-12
90
45
0
Phase (deg)
-45
-90
-135
-180
-1 0 1
10 10 10
Frequency (rad/sec)
Figure 4-7 Phase margin and gain margin for the system of Problem 4.5(a) with a gain of 0.5.
17
The gain margin is 5.93 dB at a frequency of 3.14 rad/s, which is the phase crossover
frequency obtained earlier. The phase magin is infinite since the frequency response
magnitude remains below unity or zero dBs.
( z 0.1)
b) G ( z )
( z 0.7)( z 0.9)
>> z=tf('z')
Transfer function:
z
Sampling time: unspecified
>> g=(z+.1)/(z-.7)/(z-.9)
Transfer function:
z + 0.1
------------------
z^2 - 1.6 z + 0.63
>> nyquist(g)
>> bode(g)
i) The intersection with the real axis using the Nyquist plot then using the Bode plot.
From the Nyquist plot, the intersection with the real axis is at 0.279 and the system is
closed-loop stable. From the Bode plot, at an angle of 180 the corresponding
magnitude is 11.1 dBs, i.e. magnitude greater than unity. The corresponding
magnitude is
ii) The stable range of positive gains K for the closed-loop unity feedback systems.
To put the system on the verge of instability, we need to reduce the gain to the critical gain
Kcr = 3.584 (which is approximately the same as the value of 3.589 obtained in Problem
4.5).
18
Nyquist Diagram
25
20
15
10
Imaginary Axis
0
-5
-10
-15
-20
-25
-5 0 5 10 15 20 25 30 35 40
Real Axis
-3
x 10 Nyquist Diagram
2
1.5
0.5
System: g
Real: -0.279
Imag: 3.41e-017
Imaginary Axis
-0.5
-1
-1.5
-2
-0.3 -0.295 -0.29 -0.285 -0.28 -0.275 -0.27 -0.265 -0.26 -0.255 -0.25
Real Axis
Figure 4-9 Nyquist plot for the sytem of Problem 4.5(b) showing intersection with the real axis.
19
Bode Diagram
30
25
20
15
Magnitude (dB)
10
-5 System: g
Frequency (rad/sec): 3.14
Magnitude (dB): -11.1
-10
-15
-45
-90
Phase (deg)
-135
System: g
Frequency (rad/sec): 3.14
Phase (deg): -180
-180
-1 0 1
10 10 10
Frequency (rad/sec)
Figure 4-10 Bode plot for the system of Problem 4.5(b) with unity gain.
Nyquist Diagram
1
0.8
0.6
0.4
0.2 System: g
Real: -0.279
Imag: -3.41e-017
Imaginary Axis
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Real Axis
Figure 4-11 Nyquist plot for the sytem of Problem 4.5(b) with unity gain showing intersection with
the real axis.
vii) The gain margin and phase margin for a gain K = 0.5
>> margin(g*.5)
The gain margin is 17.1 dB at a frequency of 3.14 rad/s, which is the phase crossover
frequency obtained earlier. The phase magin is 25.9 at a frequency of 0.8 rad/s. We can
20
also obtain the phase margin and gain margin using the Nyquist plot as shown in Figure
Figure 4-13 by clicking on the plot and selecting
Characteristics
All stability margins
Bode Diagram
Gm = 17.1 dB (at 3.14 rad/sec) , Pm = 25.9 deg (at 0.801 rad/sec)
25
20
15
10
Magnitude (dB)
-5
-10
-15
-20
-45
-90
Phase (deg)
-135
-180
-1 0 1
10 10 10
Frequency (rad/sec)
Figure 4-12 Phase margin and gain margin for the system of Problem 4.5(b) at a gain of 0.5 using the
Bode plot.
Nyquist Diagram
10
4
System: untitled1 System: untitled1
Phase Margin (deg): 25.9 Gain Margin (dB): 17.1
2Delay Margin (samples): 0.564 At frequency (rad/sec): 3.14
Imaginary Axis
-2
-4
-6
-8
-10
-2 -1.5 -1 -0.5 0 0.5 1
Real Axis
Figure 4-13 Phase margin and gain margin for the system of Problem 4.5(b) at a gain of 0.5 using the
Nyquist plot.
4.18 For twice the nominal gain, use MATLAB to obtain the Nyquist and Bode plots of the
oven control system of Example 4.10 with a sampling period of 0.01 and determine
i) The intersection with the real axis using the Nyquist plot then using the Bode plot.
ii) The stable range of additional positive gains K for the closed-loop unity feedback
systems.
iii) The gain margin and phase margin for twice the nominal gain.
i) The intersection with the real axis using the Nyquist plot then using the Bode plot.
21
We obtain the Nyquist plot (Figure 4.14), zoom in on the point (1, 0) of the Nyquist plot
(Figure 4.15), and the Bode plot (Figure 4.16). To obtain more accurate values for the
intersection in the Nyquist plot, we use the command
The intersection with the negative real axis is at 0.576 which corresponds to the value
on the Bode plot since
20 log10(0.562) = 4.8
Nyquist Diagram
15
10
5
Imaginary Axis
-5
-10
-15
-5 0 5 10 15 20
Real Axis
22
Nyquist Diagram
0.06
0.04
0.02
System: untitled1
Real: -0.576
Imag: 0.000424
Imaginary Axis Frequency (rad/sec): -5.24
0
-0.02
-0.04
-0.06
-0.6 -0.58 -0.56 -0.54 -0.52 -0.5 -0.48 -0.46 -0.44 -0.42 -0.4
Real Axis
Figure 4-15 Nyquist plot for the oven control system in the vicinity of the point (1, 0).
Bode Diagram
40
20
System: untitled1
-20 Frequency (rad/sec): 5.24
Magnitude (dB): -4.8
Magnitude (dB)
-40
-60
-80
-100
-120
-140
0
-45
-90
-135
-180
Phase (deg)
System: untitled1
-225 Frequency (rad/sec): 5.26
Phase (deg): -180
-270
-315
-360
-405
-450
-2 -1 0 1 2 3
10 10 10 10 10 10
Frequency (rad/sec)
ii)The stable range of additional positive gains K for the closed-loop unity feedback
systems.
23
1
GM 1.74
0.576
To put the system on the verge of instability, we can increase the gain to the critical value
Kcr = 1.74 and the allowable range of positive gains is [0, 1.74]
iii) The gain margin and phase margin for twice the nominal gain.
The Bode plot including the margins of Figure 4.17 is obtained using
>> margin(gdt*2)
Bode Diagram
Gm = 4.82 dB (at 5.25 rad/sec) , Pm = 15.5 deg (at 3.93 rad/sec)
40
20
0
Magnitude (dB)
-20
-40
-60
-80
0
-45
-90
-135
Phase (deg)
-180
-225
-270
-315
-360
-1 0 1 2
10 10 10 10
Frequency (rad/sec)
Figure 4-17 Phase and gain margins show on the Bode plot for the oven control system.
Th gain and phase margins can also be obtained using the Nyquist command as shown in
Figure 4.18 by clicking on the plot and selecting
Characteristics
All stability margins
24
Nyquist Diagram
10
2 System: untitled1
Gain Margin (dB): 4.82
At frequency (rad/sec): 5.25
Imaginary Axis Closed Loop Stable? Yes
0
System: untitled1
Phase Margin (deg): 15.5
Delay Margin (samples): 6.9
-2 At frequency (rad/sec): 3.93
Closed Loop Stable? Yes
-4
-6
-8
-10
-2 -1.5 -1 -0.5 0 0.5 1
Real Axis
Figure 4-18 Phase and gain margins show on the Nyquist plot for the oven control system.
4.19 In many applications, there is a need for accurate position control at the nanometer scale. This is
known as nano-positioning and is now feasible due to advances in nanotechnology. The
following transfer function represents a single-axis nanopositioning system2
G ( s) 4.29 E10
s
631.2 s 9.4 E 6 2
s 2 638.8s 45 E 6
s 2 178.2 s 6 E 6 s 2 412.3s 16 E 6 s 2 209.7 s 56 E 6 s 5818
a) Obtain the DAC-analog system-ADC transfer function for a sampling period of 100 ms and
determine its stability using the Nyquist criterion.
b) Obtain the DAC-analog system-ADC transfer function for a sampling period of 1 ms and
determine its stability using the Nyquist criterion.
c) Plot the closed-loop step response of the system of (b) and explain the stability results of (a) and
(b) based on your plot.
d) Obtain the DAC-analog system-ADC transfer function for a sampling period of 100 ms and
determine its stability using the Nyquist criterion.
>> gd=c2d(g,.1)
Transfer function:
0.5801 z^6 - 0.0001393 z^5 + 1.051e-008 z^4 - 3.084e-013 z^3 + 3.704e-018 z^2 + 4.488e-027 z + 2.376e-
036
----------------------------------------------------------------------------------------------
z^7 - 0.0003086 z^6 + 3.139e-008 z^5 - 1.068e-012 z^4 + 1.424e-017 z^3 + 2.807e-026 z^2 + 1.769e-035
z - 4.254e-055
2
A. Sebastian and S. M. Salapaka, “Design Methodologies for Robust Nano-Positioning,” IEEE TRANS. CONTROL
SYSTEMS TECH., VOL.13, NO.6, November, 2005.
25
>> nyquist(gd)
Nyquist Diagram
0.8
0.6
0.4
0.2
System: gd
Real: -0.58
Imag: 5.86e-016
Imaginary Axis
-0.2
-0.4
-0.6
-0.8
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6
Real Axis
Figure 4-19 Nyquist plot for the nano-positioning system with a sampling period T=100ms.
e) Obtain the DAC-analog system-ADC transfer function for a sampling period of 1 ms and
determine its stability using the Nyquist criterion.
>> gd1=c2d(g,.001)
Transfer function:
0.9063 z^6 + 1.227 z^5 + 1.16 z^4 + 1.114 z^3 + 0.9899 z^2 + 0.4766 z + 0.05919
-----------------------------------------------------------------------------------
z^7 + 1.82 z^6 + 2.191 z^5 + 1.865 z^4 + 1.79 z^3 + 1.114 z^2 + 0.4459 z - 0.001336
26
Nyquist Diagram
4
Imaginary Axis
0
-1
-2
-3
-4
-4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1
Real Axis
Figure 4-20 Nyquist plot for the nano-positioning system with a sampling period T=1ms.
f) Plot the closed-loop step response of the of the system of (b) and explain the stability results of (a)
and (b) based on your plot.
The step response of the system with sampling period 1 ms is shown in Figure 4-21 and the system is
clearly unstable as predicted by the Nyquist criterion. The analog subsystem is unstable at a gain of unity
but at a slow sampling rate, the digital system appears stable. The system will have intersample oscillations
and this is revealed by the instability of the digital system with the faster sampling rate of 1 ms.
4
x 10
4
-1
-2
-3
-4
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
Figure 4-21 Step response for the closed-loop digital system with a samping rate T=1 ms.
27
Chapter 5 Solutions
5.1 For the transfer function
sa
G ( s) , a p1 p2 or p1 p2 a
( s p1 )( s p2 )
The breakaway and break-in points are obtained by minimizing the gain
( p1 )( p2 )
K
a
A necessary condition for a minimum or maximum is that the first derivative with respect to be
zero. The first derivative is
dK
( p1 ) ( p2 )( a) ( p1 )( p2 )
d a2
2 2 ( p1 p2 2 a) a( p1 p2 ) 2 ( p1 p2 ) p1 p2
a2
2 2 a a( p1 p2 ) p1 p2
a2
Equating to zero and solving for gives
b a a2 a( p1 p2 ) p1 p2
a ( a p1 )( a p2 )
For a < p1 < p2 or p1 < p2 <a, there are two real solutions for b . One solution corresponds to a
breakaway point since it lies between the two poles and will yield a positive gain K. The second is a
break-in point that corresponds to a negative gain. For a outside the specified range, the root locus is
entirely on the real axis with no breakaway or break-in points. The breakaway point is where K is at a
maximum and the break-in point is where K is at a minimum.
K ( s 4)
KG ( s)
s( s 2 )
has a breakaway point at
1
b 4 ( 4 0)( 4 2)
11716
.
The second solution obtained using the results of Problem 5.1 is not between the two open-loop
poles (b =-6.8284) and corresponds to the break-in point associated with a negative gain.
The root locus off the real line is a circle centered at the zero (-4) with radius (8)1/2
The root locus is shown in Figure 5-1.
1
Imag Axis
-1
-2
-3
-4
-10 -8 -6 -4 -2 0 2
Real Axis
Figure 5-1 Root locus for Problem 5.2.
K K ( s + 2)
5.3 ( i ) KG ( s) (ii) KG ( s) =
s( s 2)( s 5) s( s + 3)( s + 5)
2
6
Imag Axis 0
-2
-4
-6
-8 -6 -4 -2 0 2
Real Axis
1
Imag Axis
-1
-2
-3
-4
-5
-8 -6 -4 -2 0 2
Real Axis
5.4 Consider the system in 5.3(ii) with a required steady-state error of 20%, and an adjustable PI
controller zero location. Show that the corresponding closed-loop characteristic equation is given by
sa 1
1 K 0
s ( s 3)( s 5)
Next, rewrite the equation as
1 K f G f ( s) 0
where Kf = K, K z is constant and Gf(s) is a function of s, and examine the effect of shifting the zero
on the closed-loop poles.
3
a) Design the system for a dominant second order pair with a damping ratio of 0.5. What is n for
this design?
K ( s + a)
For the transfer function KG ( s ) =
s ( s + 3)( s + 5)
Hence K v
LimsG ( s ) Ka 5
s 0
15
i.e. K a = 5 15 = 75
The closed-loop characteristic equation with unity feedback and cascade PD control is
Ks 75
1 KG ( s) C( s) 1 0
s( s 3)( s 5)
Multiply by the denominator of the loop gain then divide by all terms that do not include K to obtain
Ks
1 0
s 8s 15s 75
3 2
where K a =75 is fixed. To examine the effect of shifting the zero on the closed-loop poles, we
obtain the root locus for the new transfer function using the MATLAB command rlocus and obtain
the desired design suing the cursor.
For a dominant second order pair with a damping ratio of 0.5, n =5.04 rad/s, K = 25.3,
a =75/25.3 = 2.96.
Root Locus
10
7 System: g
Gain: 25.3
6 Pole: -2.52 + 4.37i
Damping: 0.5
Imaginary Axis
-1
-8 -7 -6 -5 -4 -3 -2 -1 0
Real Axis
4
b) Obtain the time response using a CAD program. How does the time response compare with that of
a second order systems with the same n and as the dominant pair? Give reasons for the
differences.
The time response of the system is shown below together with the response of a second order
systems with the same n and as the dominant pair. For the second order system, the percentage
overshoot is given by
1 2
PO 100 e / % 16.3%
Step Response
0.8
Amplitude
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5
Time (sec)
Our system behaves almost exactly like the second order underdamped pair because it has a zero at
2.96 very close to a third pole at 3. So it has PO = 16.3 %. The system has time to first peak
is
Tp 0.72s
d 4.37
c) Discuss briefly the tradeoff between error, speed of response and relative stability in this problem.
The root locus of the system of Figure 5-6 for a zero fixed at 2.96 shows that increasing the gain of
the system to improve its steady-state error would result in a decrease in the damping ratio.
Increasing the gain would speed up the system but would decrease its relative stability and the PO
will be unacceptably high. For example, if the gain is increased to 40 we obtain the time response of
Figure 5-7 with a PO of 25.4%. Thus the choice of 20% steady-state error due to ramp is a
compromise that yield an acceptable transient response.
5
Root Locus
8 System: g
Gain: 40
Pole: -2.52 + 5.81i
7 Damping: 0.399
Overshoot (%): 25.5
Frequency (rad/sec): 6.33
6
Imaginary Axis
4
-1
-4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0
Real Axis
Step Response
1.4
1.2 System: gc
Peak amplitude: 1.25
Overshoot (%): 25.4
At time (sec): 0.547
1
0.8
Amplitude
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5
Time (sec)
5.5 Prove equations (5.13) and (5.14) and justify the design Procedures 5.1, 5.2.
By the angle condition, the sum of the angles of all the blocks in the loop must be 180 at any closed-
loop pole. If the compensator angle is c and the loop gain (before compensation) is L(s), the angle
conditon gives
6
Equation (5.14) follows from the geometry of Figure 5-8
d
a n (5.14)
tan C
j
scl
d
c = (scl + a)
n
a
5.6 Show that a PI feedback controller is undesirable since it results in a differentiator in the forward
path. Discuss the step response of the closed-loop system.
Let the feedforward transfer function be G(s) and the feedback controller transfer function be
sa
C ( s) K
s
The closed-loop transfer function of the system is
G ( s)
T (s)
1 C ( s )G ( s )
G ( s)
sa
1 K G(s)
s
sG ( s )
s K s a G ( s )
e ( ) Lim
s 0
1 T ( s)sR( s)
sG ( s )
Lim
s 0
1 sR ( s )
s K s a G ( s )
LimsR ( s )
s 0
Thus the system has a large error due to step and cannot follow a ramp or a parabolic.
7
5.7 Design a controller for the transfer function
1
G ( s)
( s 1)( s 5)
to obtain (i) zero steady-state error due to step, (ii) a settling time of less than 2 s, and (iii) an
undamped natural frequency of 5 rad/s. Obtain the response due to a unit step and find the
percentage overshoot, the time to the first peak and steady-state error percent due to a ramp input.
1
The plant transfer function is G ( s)
( s 1)( s 5)
For zero steady-state error due to step, a PI controller is needed. The simplest design is by
cancellation of the pole at 1 with the controller zero. This leaves the loop gain
1
L( s) C( s)G ( s)
s( s 5)
The corresponding root locus includes a vertical line at 2.5 i.e. for sufficiently high gain we have an
underdamped system with n = 2.5 and Ts = 4/2.5 < 2. For = 0.5, n = 2.5/0.5 = 5 rad/s.
From the symmetry of the root locus, the gain K at the desired closed-loop pole is equal to the square
of the distance from the location to the origin i.e. K = 52 = 25. The same results can be obtained using
a CAD tool or analytically, since the compensated system is simple.
The design yields a second order system and the remaining design criteria can be computed
analytically as follows
1 2
PO 100e % 16.3%
Tp 0.726 s
d 5 1 (.5) 2
25 100
Kv sC( s)G ( s) s 0 5 e( )% 20%
s 5 s 0 Kv
Root Locus
5
4 System: l
Gain: 24.9
Pole: -2.5 + 4.32i
Damping: 0.501
Overshoot (%): 16.2
3 Frequency (rad/sec): 4.99
Imaginary Axis
-1
-5 -4 -3 -2 -1 0 1
Real Axis
8
5.8 Repeat Problem 5.7 with a required settling time less than 0.5 s and an undamped natural frequency of
10 rad/s.
1
The plant transfer function is G ( s)
( s 1)( s 5)
For zero steady-state error due to step, a PI controller is needed but the transient response
specifications can not be met with pole-zero cancellation. For proportional control, the root locus
includes a vertical line at 3 which yields a settling time of 4/3 > 0.5 s. Hence, PI control cannot
meet the design specifications and PID control is needed.
We begin the design by selecting a PD controller using a CAD tool. We choose =0.8 and n = 10
rad/s which give a settling time of 0.5 s. We obtain the values K= 10 and z = 9.5. Next, we add a PI
controller with a zero at n/10 = 0.8. The PID controller is now of the form
( s 0.8)( s 9.5)
C ( s) K
s
Using a CAD tool, we obtain a gain K = 11.8 for = 0.8. The corresponding time response is good
with PO of 6%, a time to first peak of 0.27 s, and a settling time of about 0.44 s.
Root Locus
7
6 System: l
Gain: 11.8
Pole: -8.49 + 6.37i
5 Damping: 0.8
Overshoot (%): 1.52
Frequency (rad/sec): 10.6
4
Imaginary Axis
-1
-20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2
Real Axis
Figure 5-10 Root locus for the PID controlled system of Problem 5.8
9
Step Response
1.4
System: untitled1
Peak amplitude: 1.06
1.2 Overshoot (%): 6.06
At time (sec): 0.274 System: untitled1
Settling Time (sec): 0.441
1
0.8
Amplitude
0.6
0.4
0.2
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
Time (sec)
Figure 5-11 Time response for the PID controlled system of Problem 5.8
5.9 Consider the oven temperature control system of Example 3.5 with transfer function
K
G(s)
s 3s 1
2
a) Design a proportional controller for the system to obtain a percentage overshoot less than 5 %
ln(.05)
2
.69
ln(.05) 2
We select a damping ratio of 0.7. We can solve the problem analytically since the system is second
order. It is more convenient to use MATLAB to obtain the gain value. We obtain the root locus plot of
Figure 5-13 for the system and observe that for a gain of about 3.5 we have the desired damping ratio.
10
Root Locus
2
System: g
Gain: 3.55
Pole: -1.5 + 1.52i
Damping: 0.704
Overshoot (%): 4.46
Frequency (rad/sec): 2.13
1.5
1
Imaginary Axis
0.5
-0.5
-1
-3 -2.5 -2 -1.5 -1 -0.5 0 0.5
Real Axis
Figure 5-12 Root locus for the oven temperature control system.
b) Design a controller for the system to reduce the steady-state error due to step to zero without
significant deterioration in the transient response.
We need a PI controller to reduce the steady-state error to zero. The proportional control design yields a
pole with real part equal to 1.5. The PI controller zero is at one tenth this value, which is approximately 0.1
and the controller transfer function is
s 0.1
C ( s) K
s
For a gain of 3.5, we have a dominant pair of poles with about the same damping ratio as for proportional
control. However, the step response for the system is sluggish and the settling time is very large. We
increase the gain to K = 7 and obtain the step response of Figure 5-14. Although the 2% settling time is
large (over 17s), the 5 % settling time is about half this value and the response is acceptable with an
overshoot less than 4 %.
11
Step Response
1.4
System: gcl
1.2 Peak amplitude: 1.04
Overshoot (%): 3.73
At time (sec): 1.46 System: gcl
Settling Time (sec): 17.6
1
0.8
Amplitude
0.6
0.4
0.2
0
0 5 10 15 20 25 30 35 40 45
Time (sec)
Figure 5-13 Step response for the system with PI control and a gain of 7.
Design a feedback controller to stabilize the system and reduce the percentage overshoot below 10%
with a settling time of less that 4 s.
1
G(s)
s2
We use PD control to stabilize the system. The feedback control does not result in a closed-loop
zero. The closed-loop system is second-order with the damping ratio constraint
ln(.1)
.591
2
ln(.1) 2
4 4
n 1.667
Ts 4 0.6
12
We choose n = 2 rad/s. The corresponding desired closed-loop pole is at
s cl 1.2 j1.6
d
a n 1.6667
tan C
4
G ( s)
s 2.4s 4
2
For this system, analytical design is also simple since the closed-loop chacacteristic equation is
s 2 K s a s 2 2 n s n2 s 2 2.4 s 4
The step response of the system shown in Figure 5-14 meets the design specifications.
Figure 5-14 Step response for the compensated system of Problem 5.9
Computer Exercises
13
5.11 Consider the oven temperature control system of Example 3.5 with transfer function
K
G ( s)
s 3s 10
2
c) Obtain the step response of the system with the a PD cascade controller with gain 80 and a zero at
5.
System: gc
Time (sec): 0.236
Step Response
Amplitude: 0.984
1
System: gc
Final Value: 0.889
0.9
System: gc
Settling Time (sec): 0.549
0.8
0.7
0.6
Amplitude
0.5
0.4
0.3
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)
d) Obtain the step response of the system with the a PD feedback controller with a zero at 5 and
unity gain and a forward gain of 80.
14
System: gf
Step Response
Settling Time (sec): 0.617
0.9
System: gf
0.8 Final Value: 0.889
0.7
0.6
0.5
Amplitude
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1 1.2
Time (sec)
s5
L( s ) C ( s )G ( s ) 16
s 3s 10
2
f) Why are the time responses different although the systems have the same loop gains?
The time responses are different because the cascade configuration has a closed loop zero at 5 while the
feedback configuration has no closed-loop zero.
g) Complete a comparison table using the responses of (a) and (b) including the percentage
overshoot, the time to first peak, the settling time, and the steady-state error. Comment on the
results and explain the reason for the differences in the response.
The step responses give the values shown in Table P5.1. The percentage overshoot for cascade
compensation is calculated using the equation
The system with cascade compensation has a faster response due to the closed-lop zero at 5 but the
response is more oscillatory. The two systems have the same steady-state error of 11%.
15
Table P5.1 Summary of simulation results for cascade and feedback compensation.
Configuration %OS Tp Ts e()%
Cascade 10.7% 0.236 0.549 11%
Feedback No overshoot Not defined 0.617 11%
5.12 Use SIMULINK to examine a practical implementation of the cascade controller of Problem 5.11.
The compensator transfer function includes a pole since PD control is only approximately realizable.
The controller transfer is of the form
0.2s 1
C ( s ) 80
0.02s 1
(a) Simulate the system with a step reference input both with and without a saturation block
with saturation limits 5 between the controller and plant. Export the output to MATLAB
for plotting (you can use a Scope block and select “Save data to workspace”).
0.2s+1 1
80 2
Step 0.02 s+1 s +3s+10
Subtract Gain Transfer Fcn Saturation Transfer Fcn 1 Sat y
0.2s+1 1
80
Step 1 0.02 s+1 s 2 +3s+10
Subtract 1 Gain 1 y
Transfer Fcn 2 Transfer Fcn 3
Figure 5.17 Simulation diagram for the cascade control system with and without saturation.
(b) Plot the output of the system with and without saturation together and comment on the
difference between the two step responses.
16
1
No saturation
0.9
0.8
0.7
Saturation
0.6
y
0.5
0.4
0.3
0.2
0.1
0
0 0.5 1 1.5 2 2.5 3
time
Figure 5.18 Step response of the cascade control system with and without saturation.
The saturation block reduces the output of the controller resulting in a slower response with a smaller
peak and a much smaller steady-state value.
1
G ( s)
( s 1) 4
and apply the Ziegler-Nichols procedure to design a PID controller. Obtain the response due to a
unit step input as well as a unit step disturbance signal.
The application of an open-loop unit step input gives the response shown in Figure 5-19. It can be
seen that K=1 and L=1.3. Since the value of +L is the time interval between the application of the
step input and the time when the process output reaches 63.2% of its final value, we have =3. The
Ziegler-Nichols rules given in Table 5.1 provide the following PID parameters: Kp=2.77, Ti=2.6, and
Td=0.65. The resulting process output when a step is applied to the set-point signal at time t=0 and a
load disturbance signal is applied at time t=35 is plotted in Figure 5-20.
Conversely, if we compute the sum +L as the time interval between the application of the step
input and the intersection of the tangent line with the straight representing the final steady-state
value of the process output, we obtain +L=6, and therefore =3. Thus, we can determine the
following PID parameters: Kp=4.34, Ti=2.6, and Td=0.65. The resulting process output when a step is
applied to the set-point signal at time t=0 and to the load disturbance signal at time t=60 is shown in
Figure 5-21. It appears that in this case the output is more oscillatory than in the previous case. This
actually occurs in general because the estimate of the dominant time constant is usually higher when
17
estimated using the intersection of the tangent line with the steady-state value of the process output.
This implies that the proportional gain estimate is higher than the estimate obtained by considering
the time when the process output reaches 63.2% of its final value.
0.9
0.8
0.7
0.6
process output
0.5
0.4
0.3
0.2
0.1
0
0 2 4 6 8 10 12 14
time
1.5
1
process output
0.5
0
0 10 20 30 40 50 60 70
time
Figure 5-20 Set-point and load disturbance step response for Kp=2.77, Ti=2.6, and Td=0.65
18
1.8
1.6
1.4
1.2
process output
1
0.8
0.6
0.4
0.2
0
0 20 40 60 80 100 120
time
Figure 5-21 Set-point and load disturbance step response for Kp=4.34, Ti=2.6, and Td=0.65
5.14 Write a computer program that implements the estimation of a first-order-plus-dead-time transfer
function with the tangent method and then determines the PID parameters using the Ziegler-Nichols
formula. Apply the program to the system
1
G ( s)
( s 1) 8
and simulate the response of the control system when a set-point step change and a load disturbance
step are applied. Discuss the choice of the time constant value based on the results.
function [Kp,Ti,Td]=zn(Gs)
% tangent method
sampling_time=t(2)-t(1);
dy=diff(y);
[diff_max,max_pos]=max(dy);
t_max=t(max_pos);
dy_max=diff_max/sampling_time;
L=t_max-y(max_pos)/dy_max;
Ttop=t_max+(y(end)-y(max_pos))/dy_max;
T=Ttop-L; % the time constant is determined by considering
% the intersection of the tangent line with the
% straight line representing the final
% steady-state value of the process output
19
% T=t(find(y>0.632*y(end),1))-L;
% use the second form of T to determine the time constant
% as the time interval between the application of the
% step input and the time when the process output attains
% the 63.2% of its final value
K=y(end);
% Ziegler-Nichols tuning
Kp=1.2*T/K/L;
Ti=2*L;
Td=0.5*L;
The open-loop step response with the tangent is plotted in Figure 5-22.
0.9
0.8
0.7
0.6
process output
0.5
0.4
0.3
0.2
0.1
0
0 2 4 6 8 10 12 14 16 18 20
time
If we run the MATLAB function with the given process transfer function, two options are available
for calculating the time constant. The first is by considering +L as the time interval between the
application of the step input and the intersection of the tangent line with the steady-state output
level. We obtain K=1, =6.7 and L=4.3. Thus, we have Kp=1.87, Ti=8.6, and Td=2.15. The set-point
step response is shown in Figure 5-23, while the load disturbance response is shown in Figure 5-
24Figure 5-23. Both responses are highly oscillatory. This is not surprising as the system is of high-
order and the approximation with a first-order-plus-dead-time model is not accurate.
20
Step Response
1.6
1.4
1.2
Amplitude
0.8
0.6
0.4
0.2
0
0 100 200 300 400 500 600
Time (sec)
Figure 5-23 Set-point step response for Problem 5.11 with =6.7
Step Response
0.6
0.5
0.4
0.3
Amplitude
0.2
0.1
-0.1
-0.2
0 100 200 300 400 500 600
Time (sec)
Figure 5-24 Load disturbance step response for Problem 5.11 with =6.7
The second approach is to take the value of +L as the time interval between the application of the
step input and the time when the output attains 63.2% of its final value. We obtain K=1, =4.2 and
L=4.3. This yields Kp=1.23, Ti=8.6, and Td = 2.15. The resulting set-point step response is shown in
Figure 5-25, while the load disturbance response is shown in Figure 5-26. Note that in the second
case the time constant is smaller than the first and the process output is far less oscillatory.
21
Step Response
0.8
Amplitude
0.6
0.4
0.2
0
0 10 20 30 40 50 60 70
Time (sec)
Figure 5-25 Set-point step response for Problem 5.11 with =4.2
Step Response
0.7
0.6
0.5
0.4
Amplitude
0.3
0.2
0.1
-0.1
0 10 20 30 40 50 60
Time (sec)
Figure 5-26 Load disturbance step response for Problem 5.11 with =4.2
1
G(s)
( s 1) 2
and simulate the response of the control system when a set-point step change and a load
disturbance step are applied. Compare the result obtained with those of Problem 5.14.
The application of the script of Problem 5.14, where we take the value of +L as the time interval
between the application of the step input and the time when the output attains 63.2% of its final
value, yields K=1, =1.94 and L=0.28. This yields Kp=8.30, Ti=0.56, and Td = 0.14. The resulting
set-point step response is shown in Figure 5-27, while the load disturbance response is shown in
Figure 5-28. It can be seen that, while the response is still oscillatory, as it is typical of the Zeigler-
Nichols tuning rules, the settling time is much less than that obtained in Problem 5.14. In fact,
being the process of second order instead of eighth order, the approximating first order model has
a smaller time constant and a smaller ratio L/T. Similar considerations holds for the case where
22
+L is considered as the time interval between the application of the step input and the
intersection of the tangent line with the steady-state output level.
Step Response
1.5
1
Amplitude
0.5
0
0 2 4 6 8 10 12
Time (sec)
Step Response
0.1
0.08
0.06
0.04
Amplitude
0.02
-0.02
-0.04
0 2 4 6 8 10 12
Time (sec)
23
Chapter 6 Solutions
6.1 Sketch the z-domain root locus and find the critical gain for the following systems
K K
(i) G ( z) (ii) G ( z)
z 0.4 ( z 0.9)( z 0.9)
Kz K ( z 0.9)
(iii) G ( z) (iv) G ( z)
( z 0.2)( z 1) ( z 0.2)( z 0.8)
To sketch the z-domain root locus by hand, we apply the root locus rules. The plots can more easily
be obtained using the MATLAB command rlocus.
K
(i) For G ( z) , the closed-loop characteristic equation is K + z 0.4 = 0
z 0.4
At z = 1, we obtain the critical gain, Kcr = 1.4 (see also the root locus plot)
Root Locus
1
0.8
0.6
System: g
0.4 Gain: 1.4
Pole: -0.998
Damping: 0.000755
0.2
Imaginary Axis
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Real Axis
K
(ii) For G ( z) , the closed-loop characteristic equation isK + z2 0.81 = 0
( z 0.9)( z 0.9)
On the unit circle, z2 = 1 and we obtain Kcr = 1.81
Root Locus
1
System: g
Gain: 1.81
Pole: -8.03e-017 + 1i
0.8 Damping: -0.00079
Overshoot (%): 100
Frequency (rad/sec): 157
Imaginary Axis
0.6
0.4
0.2
Kz
(iii) For G ( z) , the closed-loop characteristic equation is
( z 0.2)( z 1)
K z + z2 1.2 z + 0.2 = 0. On the unit circle, z = 1, K + 1 + 1.2 +0.2 =0 and the
critical gain is
Kcr = 2.4
Root Locus
0.9
0.8
0.7
0.6
Imaginary Axis
0.5
0.4
0.3
System: g
0.2 Gain: 2.4
Pole: -1
Damping: -0.000941
0.1 Overshoot (%): 100
Frequency (rad/sec): 314
0
-0.1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Real Axis
K ( z 0.9)
(iv) For G ( z) , the closed-loop characteristic equation is
( z 0.2)( z 0.8)
z2 z + 0.16 + K z + 0.9 K = 0. On the unit circle, |z|2 =1 = 0.9 K + 0.16 and we obtain
Kcr = 0.933
Root Locus
1.5
1
System: g
Gain: 0.934
Imaginary Axis
0.5
6.2 Prove that expression (6.6) describes a constant n contour in the z-plane.
n T 2 2
It is required to prove that constant n contours are defined by the equation z e
n T
We first write z1,2 e d T z , i.e. we have an angle equation
d T nT 1 2 and a magnitude equation z e n T . We solve the angle equation
for and obtain
2
1 and n T n T 2 2
nT
6.3 Hold equivalence is a digital filter design approach which approximates an analog filter using
z 1
*
C a ( s)
Z L 1
C ( z) s
z
(a) Obtain the hold equivalent digital filter for the PD, PI, and PID controllers. Modify the results
as necessary to obtain a realizable filter with finite frequency response at the folding
frequency.
z 1
*
s a
Z L 1
PD: C ( z) K s
z
z 1 *
s a
Z L 1
PI: C ( z) K s 2
z
z 1 1 s a s b
*
PID: C ( z) Z L K
z s2
(b) Why are the filters obtained using hold equivalence always stable?
The s-domain poles ps are mapped to z-domain poles pz using the rule
p z e p sT
where T is the sampling period. This maps LHP poles ps to poles pz inside the unit circle.
6.4 Show that the bilinear transformation of the PID controller expression (5.20) yields expression (6.32).
1
C ( s ) K p 1 Td s
Ti s
2 z 1 1 T z 1 2 z 1
If we substitute s we trivially have C ( z ) K 1 T
T z 1 T 2 z 1
p d
i T z 1
6.5 Design proportional controllers for the systems of Problem 6.1 to meet the following specifications
where possible. If the design specification cannot be met, explain why and suggest a more appropriate
controller.
(a) A damping ratio of 0.7.
(b) A steady-state error of 10 % due to a unit step.
(c) A steady-state error of 10 % due to a unit ramp.
K
(i) G ( z )
z 0.4
(a) A damping ratio of 0.7
This is a first order system and does not have an oscillatory response. Hence, the design
specification cannot be met with proportional control.
A PI controller would give a system with the desired damping ratio but it is probably preferable to
use proportional control to obtain a good time response with the appropriate time constant unless
the steady-state error is required to be zero.
(b) A steady-state error of 10 % due to a unit step
The position error constant is
K 100
K p G (1) 1 9
1 0.4 e()%
Hence, the gain for 10% error due to step is K = 5.4. Unfortunately, the critical gain for the
system is 1.4 and a gain of 5.4 would make the system unstable and the design specifications
cannot be met with proportional control.
Using a PD controller would allow us to increase the gain without causing instability.
Alternatively, we could use a PI controller to reduce the error due to a step to zero, which would
meet the desired specifications.
A PI controller is needed for the system to become type 1 and have a finite steady-state error due
to ramp.
K
(ii) G ( z )
( z 0.9)( z 0.9)
For a gain K>0.81, we have imaginary poles so that the angle of the pole is
d T n T 1 2 n T 0.51 / 2
Note that we only need the value of the product nT to solve the problem rather than each of the two
values. Hence, the result can be verified with MATLAB using a unity sampling period and the
command rlocus.
Root Locus
1
0.8
System: g
0.6 Gain: 0.856
Pole: -2.54e-017 + 0.214i
Damping: 0.7
0.4 Overshoot (%): 4.59
Frequency0.7(rad/sec): 2.2
0.2
Imaginary Axis
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Real Axis
Figure 6.5 Root locus for Problem 6.5 (ii) and the gain for a damping ratio of 0.7.
A PI controller is needed for the system to become type 1 and have a finite steady-state error due
to ramp.
Kz
(iii) G( z)
( z 0.2)( z 1)
n T ln 0.2 0.7 1.1496
cos d T cos n T 1 2
cos 1.1496 0.51 0.6815
K 1.2 2 cos d T e nT 2 0.6815 0.4472 0.6096
K 1.2 0.6096 0.5904
We obtain approximately the same answer using the MALAB command rlocus.
Root Locus
1
0.8 System: g
Gain: 0.595
Pole: 0.301 + 0.328i
0.6 Damping: 0.698
Overshoot (%): 4.66
0.4 Frequency (rad/sec): 1.16
0.7
0.2
Imaginary Axis
-0.2
-0.4
-0.6
-0.8
-1
-2 -1.5 -1 -0.5 0 0.5 1 1.5
Real Axis
Figure 6.6 Root locus for Problem 6.5 (iii) and the gain for a damping ratio of 0.7.
The steady-state error is zero since the system is type I and the specification can be met for any
stable gain. The gain can be selected as in Part (a) to obtain a satisfactory transient response.
1 1 K
Kv ( z 1)G ( z ) z 1 10
T T (1 0.2)
K 8T
The sampling period is typically sufficiently small to result in a small gain that is less than the
critical value and the specifications can be met.
K ( z 0.9)
(iv) G ( z)
( z 0.2)( z 0.8)
(a) A damping ratio of 0.7
Root Locus
1.5
System: g
Gain: 0.141
Pole: 0.428 + 0.32i
Damping: 0.699
0.5 Overshoot (%): 4.64
Frequency (rad/sec): 0.897
0.7
Imaginary Axis
-0.5
-1
-1.5
-3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1
Real Axis
Figure 6.7 Root locus for Problem 6.5 (iv) and the gain for a damping ratio of 0.7.
The specification can be met because the gain is less than the critical gain.
A PI controller is needed for the system to become type 1 and have a finite steady-state error due
to ramp.
6.6 Design digital controllers to meet the desired specifications for the systems of Problems 5.4, 5.7 and
5.8 by bilinearly transforming the analog designs.
Problem 5.4 We first select a sampling period for the digital control system. For our analog design, the
damped natural frequency is 4.37 rad/s. Using our rule of thumb for the sampling period
2
T 0.02 s
70 4.37
>> gd1=c2d(g,.02)
The corresponding z-transfer function for the plant with ADC and DAC is
Zero/pole/gain:
0.00018965 (z+0.9481)
---------------------
(z-0.9418) (z-0.9048)
>> c=c2d(ca,.02,'tustin')
26.0489 (z-0.9425)
C(z) = -----------------
(z-1)
1.8
1.6
1.4
1.2
Imaginary Axis
1
0.8
0.6 System: l
Gain: 0.918
0.5
0.4 Pole: 0.949 + 0.0796i
Damping: 0.502
Overshoot (%): 16.2
0.2 Frequency (rad/sec): 4.84
Figure 6-8 Root locus for the indirect digital design of Problem 5.4
The gain has to be reduced to 0.92 of its analog value for a damping ratio of 0.5 and the corresponding
error constant is
1 0.00451 .94251 .9481
Kv ( z 1)G ( z ) 4.594
T z 1 0.021 .94181 .9048
This corresponds to a steady-state error of 21.8%. We have to accept a compromise between the
desired steady-state error and damping ratio or repeat the analog design. The error is close to the
required value and the time response meets the design requirements. The design would be acceptable
in many applications.
Step Response
1.4
1.2
0.8
Amplitude
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5
Time (sec)
Figure 6-9 Time response for indirect digital design of Problem 5.4
Problem 5.7 The required specifications are (i) zero steady-state error due to step, (ii) a settling time of
less than 2 s, and (iii) an undamped natural frequency of 5 rad/s.
4 4
Ts n 10
We select a damping ratio = 0.5 which corresponds to an undamped natural frequency d = 4.33
rad/s. We calculate the sampling period as
2 2
T 0.02 s
70 d 70 4.33
The corresponding z-transfer function for the plant with ADC and DAC is
>> gd=c2d(g,.02)
Zero/pole/gain:
0.0001922 (z+0.9608)
---------------------
(z-0.9802) (z-0.9048)
z 0.9802
C ( z)
z 1
The root locus of the of Figure 6-10, shows that for the desired undamped natural frequency we
need a gain of about 25. The corresponding step response of Figure 6-11shows a settling time of
1.65 and 18% overshoot, which is acceptable for the given design specifications.
Root Locus
2
1.8
1.6
1.4
1.2
Imaginary Axis
0.8
0.6
0.4
System: l
Gain: 25.1
Pole: 0.95 + 0.084i
Damping: 0.476
0.2
Overshoot (%): 18.2
Frequency (rad/sec): 5.02
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Real Axis
Figure 6-10 Root locus for the indirect digital design of Problem 5.7
Step Response
1.4
System: gcl
Peak amplitude: 1.18
Overshoot (%): 18.4
At time (sec): 0.72
1.2
System: gcl
Settling Time (sec): 1.65
0.8
Amplitude
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5
Time (sec)
Figure 6-11 Time response for indirect digital design of Problem 5.7
Problem 5.8 The design specifications require a settling time less than 0.5 s and an undamped natural
frequency of 10 rad/s. We obtain the damping ratio
4 4
0.8
Ts n 5
The damping ratio = 0.5 which corresponds to an undamped natural frequency d = 6 rad/s. We
calculate the sampling period as
2 2
T 0.015 s
70 d 70 6
>> gd=c2d(g,.015)
Zero/pole/gain:
0.00010919 (z+0.9704)
---------------------
(z-0.9851) (z-0.9277)
Root Locus
1
0.9
0.8
0.7
0.6
Imaginary Axis
0.5
0.4
System: l
Gain: 2.2e+003
Pole: 0.419 + 0.25i
Damping: 0.8
0.3 Overshoot (%): 1.52
Frequency (rad/sec): 59.8
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Real Axis
Figure 6-12 Root locus for the indirect digital design of Problem 5.8
Step Response
1.4
System: gcl
Peak amplitude: 1.13
1.2 Overshoot (%): 13.3
At time (sec): 0.075
System: gcl
Settling Time (sec): 0.224
0.8
Amplitude
0.6
0.4
0.2
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35
Time (sec)
Figure 6-13 Time response for indirect digital design of Problem 5.7
6.7 Design a digital filter by applying the bilinear transformation to the analog (Butterworth) filter
1
C a (s)
s 2s 1
2
2 z 1
By substituting s with T=0.1 we have
T z 1
0 z 1 z 1 2 z 1
s 20
0T z 1 z 1 T z 1
tan
2
6.8 Design a digital PID controller (with T=0.1) for the plant
1
G(s) e 5 s
10s 1
by applying the Ziegler-Nichols tuning rules of Table 5.1.
The Ziegler-Nichols tuning rules shown in Table 5.1 can be applied by considering K=1, τ=10, L=5. We
obtain Kp=2.4, Ti=10, Td=2.5. Thus, by applying (6.32) we have
6.9 Design digital controllers to meet the desired specifications for the systems of Problems 5.4, 5.7 and
5.8 in the z-domain directly.
Problem 5.4 We first select a sampling period for the digital control system. For a plant with poles at
3 and 5 a realistic choice of the damped natural frequency with acceptable percentage overshoot
would be about 7 rad/s. Using our rule of thumb for the sampling period
2
T 0.01 s
70 7
The corresponding z-transfer function for the plant with ADC and DAC is
>> gd=c2d(g,.01)
Zero/pole/gain:
4.8687e-005 (z+0.9737)
----------------------
(z-0.9704) (z-0.9512)
4.869 10 5 K z a z .9737
L( z )
z 1z .9704z .9512
We can substitute the above constraint into the characteristic equation for the system to eliminate the
product Ka and rewrite it in the form that allows the use of the command rlocus
0 1 K
z 1z .9737
z 1z .9704z .9512 4.869 10 5 (0.75)z .9737
1 K
z 1z .9737
z .9283 z 2 1.993z 0.9944
We then select the gain value corresponding to a damping ratio of 0.5.
Root Locus
0.3
0.25
0.2
0.15
Imaginary Axis
System: gk
0.1 Gain: 33.4
Pole: 0.991 + 0.0144i
Damping: 0.506
0.05 Overshoot (%): 15.8
Frequency (rad/sec): 1.68
-0.05
-0.1
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
Real Axis
Step Response
1.4
System: gc
Peak amplitude: 1.14
Overshoot (%): 13.8
1.2 At time (sec): 0.62
System: gc
Settling Time (sec): 1.42
1
0.8
Amplitude
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec)
The procedure is almost identical to the analog design but no approximation of the controller is
involved and the design specifications are met.
Problem 5.7 The required specifications are (i) zero steady-state error due to step, (ii) a settling time of
less than 2 s, and (iii) an undamped natural frequency of 5 rad/s.
1
G( s)
( s 1)( s 5)
From the transient response specifications, we obtain the damping ratio
4 4
Ts n 10
We select a damping ratio = 0.5 which corresponds to an undamped natural frequency d = 4.33
rad/s. We calculate the sampling period as
2 2
T 0.02 s
70 d 70 4.33
The corresponding z-transfer function for the plant with ADC and DAC is
>> gd=c2d(g,.02)
Zero/pole/gain:
0.0001922 (z+0.9608)
---------------------
(z-0.9802) (z-0.9048)
We need a PI controller to reduce the error due to step to zero. The controller has a pole at unity and
we select its zero to cancel the closest pole to the unit circle. The corresponding root locus is shown
in Figure 6-16.
Root Locus
1
0.9
0.8
0.7
0.6
Imaginary Axis
0.5
0.4
0.3
0.2 System: l
Gain: 23.2
Pole: 0.95 + 0.0791i
Damping: 0.5
Overshoot (%): 16.3
0.1 Frequency (rad/sec): 4.8
0
0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
Real Axis
Figure 6-16 Root locus for the digital control of Problem 5.7.
1 2
PO 100e % 16.3%
Step Response
1.4
System: gcl
Peak amplitude: 1.17
Overshoot (%): 16.5
1.2 At time (sec): 0.76
System: gcl
Settling Time (sec): 1.69
1
0.8
Amplitude
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5
Time (sec)
Figure 6-17 Step response of the digital PI-controlled system of Problem 5.7.
Problem 5.8 The design specifications require a settling time less than 0.5 s and an undamped
natural frequency of 10 rad/s. We obtain the damping ratio
4 4
0.8
Ts n 5
The damping ratio = 0.5 which corresponds to an undamped natural frequency d = 6 rad/s. We
calculate the sampling period as
2 2
T 0.015 s
70 d 70 6
>> gd=c2d(g,.015)
Zero/pole/gain:
0.00010919 (z+0.9704)
---------------------
(z-0.9851) (z-0.9277)
We select a realizable PID control that cancels the two poles closest to the unit circle in the form
C ( z) K
z 0.9851z 0.9277
z z 1
The root locus of the system is shown in Figure 6- 18. For a gain of about 2000, we have the
desired damping ratio. The step response of Figure 6-19 shows that the system has 1.25%
overshoot and a settling time about 0.06 s. The design easily meets the desired specifications but
the high gain may not be acceptable in some applications.
Root Locus
1
0.9
0.8
0.7
0.6
Imaginary Axis
0.5
0.4
System: l
Gain: 2.04e+003
Pole: 0.378 + 0.253i
Damping: 0.8
0.3 Overshoot (%): 1.51
Frequency (rad/sec): 65.6
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Real Axis
1.2
System: gcl
Peak amplitude: 1.01
Overshoot (%): 1.25
At time (sec): 0.09
System: gcl
Settling Time (sec): 0.0639
0.8
Amplitude
0.6
0.4
0.2
0
0 0.05 0.1 0.15 0.2 0.25 0.3
Time (sec)
Figure 6-19 Step response of the digital PI-controlled system of Problem 5.8.
6.10 In Example 4.9, we examined the closed-loop stability of the furnace temperature digital control
system with proportional control and a sampling period of 0.01 units. We obtained the z-transfer
function
4.95 z 4.901
G ZAS (z) = 10 5
z 1.97 z 0.9704
2
Design a controller for the system to obtain zero-steady-state error due to a step input without
significant deterioration in the transient response.
To reduce the steady-state error to zero we need to design a PI controller for the system. We first
examine the root locus of the system (Figure 6-20) and observe that for a gain of about 5. The step
response of Figure 6-21 is significantly faster with an overshoot less than 10%, a peak time of 1.6, and
the settling time is less than 2.5. However, the steady-state error is large and must be reduced. We now
add a pole at unity and a zero to reduce the steady-state error due to step to zero. We select the zero at
the location of one of the system poles and obtain the system root-locus of Figure 6-22. The time
response of the system with PI control (Figure 6-23) has an overshoot of 11%, a peak time of 1.7, a
settling time of about 2.6, and zero steady-state error due to step. Thus, the transient response is only
slightly adversely affected but the steady-state error specification is met.
Root Locus
1.8
1.6
1.4
1.2
Imaginary Axis
0.8
0.6
0.4
System: gd
Gain: 5.12
0.2 Pole: 0.985 + 0.0195i
Damping: 0.609
Overshoot (%): 8.97
Frequency (rad/sec): 2.49
0
-0.2
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
Real Axis
0.8 System: gc
Settling Time (sec): 2.43
0.7
0.6
Amplitude
0.5
0.4
0.3
0.2
0.1
0
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (sec)
Figure 6-21 Step response for the furnace control system with proportional control and a gain of 5.
Root Locus
1.8
1.6
1.4
1.2
Imaginary Axis
0.8
0.6
0.4
System: lg
Gain: 5.98
Pole: 0.987 + 0.0205i
0.2
Damping: 0.539
Overshoot (%): 13.4
Frequency (rad/sec): 2.46
-0.2
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
Real Axis
1
System: gc
Settling Time (sec): 2.64
0.8
Amplitude
0.6
0.4
0.2
0
0 1 2 3 4 5 6
Time (sec)
Figure 6-23 Step response for the furnace control system with PI control and a gain of 5.
6.11 Consider the DC motor position control system of Example 3.6, where the (type 1) analog plant has
the transfer function
1
G ( s)
s s 1 s 10
and design a digital controller by using frequency response methods to obtain a settling time of about
one second and an overshoot of less than 5%.
ln(0.05)
0 .7
2
ln(0.05) 2
Then, from (6.42) we have that the system in the w-plane should have a phase margin of about 70
degrees. Further, given the settling time Ts=1, we calculate the undamped natural frequency
4
n 5.7 rad / s
Ts
and using (6.41), we obtain the desired gain crossover frequency gc=3.7 rad/s. A suitable sampling
period for the selected dynamics is T=0.01 s. The discretized process is then determined as
( z 3.623)( z 0.2606)
G ZAS ( z ) 1 z 1 Z Gs(s) 1.6217 10 7
C ( w) 39.5( w 1)
The Bode diagram of the loop transfer function C(w)G(w), together with the Bode diagram of G(w) is
shown in Figure 6-24. The figure also shows the phase and gain margins. By transforming the
controller back to the z-plane by means of (6.35) we obtain
7940 z 7861
C ( z)
z 1
The corresponding discretized closed-loop step response is plotted in Figure 6-25 and clearly meets
the design specifications.
Bode Diagram
Gm = 34.1 dB (at 45.1 rad/sec) , Pm = 68.6 deg (at 3.7 rad/sec)
100
50 C(w)G(w)
Magnitude (dB)
0
G(w)
-50
-100
-150
270
180
Phase (deg)
90
0
-2 -1 0 1 2 3 4
10 10 10 10 10 10 10
Frequency (rad/sec)
Figure 6-24 Bode plots of C(w)G(w) and G(w) for Problem 6.11
Step Response
1.4
System: Fz
1.2 Peak amplitude: 1.02
Overshoot (%): 2.03 System: Fz
At time (sec): 0.8 Settling Time (sec): 0.822
1
0.8
Amplitude
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4
Time (sec)
6.12 Use direct control design for the system of Problem 5.7 (with T=0.1), namely, design a controller for
the transfer function
1
G( s)
( s 1)( s 5)
to obtain (i) zero steady-state error due to step, (ii) a settling time of less than 2 s, and (iii) an
undamped natural frequency of 5 rad/s. Obtain the discretized and the analog output. Then, apply the
designed controller to the system
1
G ( s)
( s 1)( s 5)(0.1s 1)
and obtain the discretized and the analog output in order to verify the robustness of the control system.
( z 0.8189)
G ZAS ( z ) 1 z 1 Z G(ss) 0z.0041172
0.9048 z 0.6065
Then, the desired analog characteristic polynomial is
s 2 2 n s n2
4
where, according to the specifications, ωn=5 and Ts 2 , which implies that ζ=0.4. Thus, by
n
taking into account that a zero steady-state error is required, the desired closed-loop transfer function
is
25
Gcl ( s )
s 4s 25
2
Then, the desired closed-loop transfer function is obtained by using z = esT , namely,
z 1
Gcl ( z ) 0.1009
z 1.469 z 0.6703
2
The obtained discretized and analog closed-loop system output are shown in Figure 6-26 and Figure
6-27 while the corresponding control variable is plotted in Figure 6-28. If the same controller is
applied to the system
1
G ( s)
( s 1)( s 5)(0.1s 1)
the process output obtained is that in Figure 6-29. It can be seen that the additional lag causes a more
significant overshoot and an increment of the settling time.
1.4
1.2
1
process output
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5
time [s]
process output
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5
time [s]
30
25
20
control variable
15
10
-5
0 0.5 1 1.5 2 2.5 3 3.5
time [s]
1
process output
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5
time [s]
1
G ( s)
( s 1)( s 5)(0.1s 1)
We consider the same discretized process transfer function of Problem 6.12, but in this case we set
Gcl ( z ) z 1 .
The corresponding discretized and analog output are shown in Figure 6-30, the control variable in
Figure 6-31. We observe that the deadbeat controller causes wide intersampling oscillations and
requires a much higher control effort. It results in an increased overshoot without significantly
decreasing the settling time. When the system
1
G ( s)
( s 1)( s 5)(0.1s 1)
1.5
1
process output
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5
time [s]
200
100
control variable
0
-100
-200
-300
-400
0 0.5 1 1.5 2 2.5 3 3.5
time [s]
1.2
1
process output
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5
time [s]
6.14 Find a solution for Problem 6.13 which avoids intersampling ripple.
1
R( z )
1 z 1
we have
Gcl ( z ) K z 1 ( 1+0.8189 z 1 )
where the value K=0.55 is found by imposing Gcl (1) 1 . Thus, by applying (6.43) we have
The discretized and analog process output is shown in Figure 6-33 , while the control variable is
plotted in Figure 6-34. It can be seen that the intersample ripple is avoided and the amplitude of the
control variable is decreased with respect to the deadbeat controller of Problem 6.13. When the
system
1
G ( s)
( s 1)( s 5)(0.1s 1)
0.8
process output
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5
time [s]
100
control variable
50
-50
-100
0 0.5 1 1.5 2 2.5 3 3.5
time [s]
150
100
control variable
50
-50
-100
0 0.5 1 1.5 2 2.5 3 3.5
time [s]
Computer Exercises
6.15 Write a MATLAB function to plot a constant damped natural frequency contour in the z-plane.
For a constant damped natural frequency, we need to plot a radial line.
% constantwd
% Program to plot a constant wd line on the z-domain root locus.
% The program plots a radial line at an angle wd T where T is
% the sampling period. The user selects the maximum
% x coordinate for the plot, xmax.
%
function constantwd(wd,T,rmax,step)
theta=tan(wd*T); % Calculate the slope of the radial line
rho=0:step:rmax; % Calculate the magnitude vector
thetaV=theta*ones(1,length(rho)); % Define the angle vector
hold on
polar(thetaV,rho)
6.16 Write a MATLAB function to plot a constant time constant contour in the z-plane.
For a constant time constant, we need to plot a circle.
% constant mag
% Program to plot a constant manitude line on the z-domain root locus.
% The program plots a circle of radius exp(-zeta wn T) where T is
% the sampling period. The user selects the step on the x-grid.
%
function constantmag(zeta, wn,T,step)
mag=exp(-zeta*wn*T); % Calculate the pole magnitude
theta=-pi:step:pi; % Define the angle vector from 0 to pi
rho=mag*ones(1,length(theta)); % Define the magnitude vector
hold on
polar(theta,rho) % Plot a circle of radius mag
6.17 Write a computer program that estimates a first-order-plus-dead-time transfer function with the
tangent method and determines the digital PID parameters according to the Ziegler-Nichols formula.
Apply the program to the system
1
G ( s)
( s 1) 8
and simulate the response of the digital control system (with T=0.1) when a set-point step change and a
load disturbance step are applied. Compare the result with those of Problem 5.14.
We can slightly modify the computer program of Problem 5.14 in order to estimate the process
parameters and to determine the PID parameters with the Ziegler-Nichols formula. Note that here T/2
is added to the dead time of the process before applying Table 5.1.
function [Cz]=digital_zn(Gs,T)
% tangent method
sampling_time=t(2)-t(1);
dy=diff(y); % difference of the process output
[diff_max,max_pos]=max(dy);
t_max=t(max_pos); % time instant of the maximum derivative
dy_max=diff_max/sampling_time; % maximum derivative
L=t_max-y(max_pos)/dy_max; % estimated dead time
tautop=t_max+(y(end)-y(max_pos))/dy_max; % tau+L
tau=Ttop-L; % the time constant is determined by considering
% the intersection of the tangent line with the
% straight line representing the final
% steady-state value of the process output
% tau=t(find(y>0.632*y(end),1))-L;
% use the second form of tau to determine the time constant
% as the time interval between the application of the
% step input and the time when the process output attains
% the 63.2% of its final value
% Ziegler-Nichols tuning
Kp=1.2*tau/K/L; % proportional gain
Ti=2*L; % integral time constant
Td=0.5*L; % derivative time constant
z=tf(‘z’);
If we run the MATLAB function with the given process transfer function, two options are available
for calculating the time constant. The first is by considering +L as the time interval between the
application of the step input and the intersection of the tangent line with the steady-state output level.
We obtain K=1, =6.7 and L=4.35 (note that with respect to Problem 5.11 only the dead time L is
different). Thus, we have Kp=1.85, Ti=8.71, and Td=2.18 (note that all the three PID paramters are
slightly different from those found in Problem 5.11). The digital PID controller transfer function is
82.4167( z 0.9773) 2
C ( z)
( z 1)( z 1)
The set-point step response is shown in Figure 6-36, while the load disturbance response is shown in
Figure 6-37. The responses are very similar to those obtained with the analog PID controller of
Problem 5.11.
The second approach is to take the value of +L as the time interval between the application of the
step input and the time when the output attains 63.2% of its final value. We obtain K=1, =4.2 and
L=4.35. This yields Kp=1.22, Ti=8.71, and Td = 2.18. Also in this case the modification of the dead
time yields to PID gains that are slightly different from those obtained in Problem 5.11. The digital
PID controller transfer function is
54.3363( z 0.9773) 2
C ( z)
( z 1)( z 1)
The resulting set-point step response is shown in Figure 6-38, while the load disturbance response is
shown in Figure 6-39. The responses are very similar again to those obtained with the analog PID
controller of Problem 5.11.
Step response
1.6
1.4
1.2
Amplitude
0.8
0.6
0.4
0.2
0
0 100 200 300 400 500 600
Time (sec)
Figure 6-36 Set-point step response for Problem 6.17 with =6.7
Step response
0.6
0.5
0.4
0.3
Amplitude
0.2
0.1
-0.1
-0.2
0 100 200 300 400 500 600
Time (sec)
Figure 6-37 Load disturbance step response for Problem 6.17 with =6.7
Step response
1.2
0.8
Amplitude 0.6
0.4
0.2
0
0 10 20 30 40 50 60 70
Time (sec)
Figure 6-38 Set-point step response for Problem 6.17 with =4.2
Step response
0.7
0.6
0.5
0.4
Amplitude
0.3
0.2
0.1
-0.1
0 10 20 30 40 50 60 70
Time (sec)
Figure 6-39 Load disturbance step response for Problem 6.17 with =4.2
6.18 To examine the effect of the sampling period on the relative stability and transient response of a digital
control system, consider the system
1
G ( s)
s 1s 5
a) Obtain the transfer function of the system, the root locus and the critical gain for T = 0.01, 0.05, 0.1
s.
Zero/pole/gain:
1
-----------
(s+1) (s+5)
>> gd1=c2d(g,.01)
Zero/pole/gain:
4.9013e-005 (z+0.9802)
----------------------
(z-0.99) (z-0.9512)
Zero/pole/gain:
0.0011327 (z+0.9049)
---------------------
(z-0.9512) (z-0.7788)
Zero/pole/gain:
0.0041172 (z+0.8189)
---------------------
(z-0.9048) (z-0.6065)
>> [Gm,PM]=margin(gd1)
We obtain the gain margin, which is the critical gain value. The values obtain are summarized in
the following table.
1.2
0.8
Amplitude
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5
Time (sec)
Figure 6- 40 Step response for sampling period T= 0.01 (blue), T=0.05 (green), and T=0.1 s (red).
c) Discuss the effect of the sampling period on the transient response and relative stability of the
system based on your results from (a) and (b).
The transfer functions for the different sampling period with generally faster poles for slower
sampling. Faster poles are poles that are closer to the origin. The systems with slower sampling
does not monitor the process as closely as ones with faster sampling. As a result, the step response
of the system is more oscillatory.-
Chapter 7 Solutions
7.1 Classify the state-space equations regarding linearity and time-variance:
x1 1 1 0 x1 1
x 0 2 0 x 2u
2 2
x 3 1 5 7 x 3 0
b)
x1
y 1 1 2 x 2
x 3
Linear time-invariant.
x 2 x 2 7 x x u
c)
y 3x
x 7 x u
d)
y 3x 2
T
M d() g( )
f
m m12 0 g ( )
M 11 d() g ( ) 1
m12 m22 D2 2 g 2 ( )
m ma12
M a M 1 a11
ma12 ma 22
where = [1, 2]T is a vector of joint angles. The entries of the positive definite inertia matrix M
depend on the robot coordinates . D2 is a damping constant. The terms gi, i = 1, 2, are gravity
related terms that also depend on the coordinates. The right hand side is a vector of generalized
forces.
x1 x11 x12
T
x 2 x 21 x 22
T
We now have
x 1 x 2
x 2 M a (x1 )u d(x 2 ) g(x1 )
m ma12
M a M 1 a11
ma12 ma 22
Multiplying out the second state equation we have
x 1 x 2
m m g ma12 g 2
x 2 M a (x1 )u a12 D2 (x 22 ) a11 1
ma 22 ma12 g1 ma 22 g 2
b) Obtain the linearized model in the vicinity of zero coordinates, velocities and inputs.
x 1 x 2
T ma11 g1 ma12 g 2 m
D2 (x 22 ) a12 0
x1 x1
x 2 T x1 M a (x1 ) D2 (x 22 ) x 2
ma12 g1 ma 22 g 2 ma 22 x
D2 (x 22 ) 2
x1 x1 x
1 0
7.3 Obtain the matrix exponentials for the state matrices using four different approaches
0 0 1
ii) A 0 1 0
6 0 0
0 1 1
iii) A 0 0 1
0 6 5
iv) A is a block diagonal matrix with the matrices of (ii) and (iii) on its diagonal.
(results for (ii) and (iii) obtained using the MATLAB Symbolic Toolbox or MAPLE)
For a diagonal state matrix, the state-transition matrix can be written by inspection
0 0 1
ii) A 0 1 0
6 0 0
s 1
s2 6 0
s 6
1 2
s 0 1
1
sI 3 A 0 s 1 0
1
0 0
s 1
6 0 s 6 s
s 2 6 0
s 2 6
s 1
s2 6 0
s 6 cos 6 t
2 0
1
sin 6 t
6
1
e At L -1 0 0 0 e t 0
6
s 1
0
s 6 sin 6 t 0
cos 6 t
s 2 6 s 2 6
0 1 1
iii) A 0 0 1
0 6 5
1 s 1 s 1
s 1 1
1 s
s s 5s 6
2
s s 5s 6
2
s5 1
sI 3 A1 0 s 1 0
s 5s 6
2
s 5s 6
2
0 6 s 5 6 s
0
s 5s 6
2
s 5s 6
2
1 s 1 s 1
s s s 2 5 s 6 s s 2 5s 6
s5 1
e At L -1 0
s 5s 6
2
s 5s 6
2
6 s
0
s 5s 6
2
s 5s 6
2
1 1 3 1 4 2
1 6 6 0 2 0
2 2t
3 3
0 0 0 0 3 1 e 0 2 1 e 3t
0 0 0 0 6 2 0 6 3
iv) A is a block diagonal matrix with the matrices of (ii) and (iii) on its diagonal.
cos 6 t 0
1
sin 6 t
6
0 e t 0 0 33
6 sin 6 t 0
cos 6 t
e At 1 1 3 1 4 2
1 6 6 0
2 2 0
3
3 3t
0 33 0 0 0 0 3 1 e 2 t 0 2 1 e
0 0 0 0 6 2 0 6 3
7.4 Obtain the zero-input responses of the systems of Problem 7.3 due to the initial condition vectors:
(i), (ii), (iii) [1, 1, 0]T and [1, 0, 0]T.
x ZI (t ) e At x(0)
1 exp(3t )
(i)
diag exp(3t ), exp(5t ), exp(7t )1 exp(5t )
0 0
x ZI (t ) e At x(0)
1 exp(3t )
diag exp(3t ), exp(5t ), exp(7t )0 0
0 0
(ii)
x ZI (t ) e At x ( 0 )
1
1 0 0 0 0
6 0 0 0 1
0 0 0 cos 6 t 0
0 0 sin
6 t 0 1
0 e t 1
0 0 1 6 0 0 0 0 0 0
1 0 0
0 cos 6 t 0 sin 6 t 1 e t
0 6 0
x ZI (t ) e At x(0)
1
1 0 0 0 0
6 0 0 0 1
0 0
0 cos 6 t 0 0
0 sin 6 t 0 1 0 e t 0
0 0 1 6 0 0 0 0 0 0
1 0
0 cos
6 t 0 sin 6 t
0 6
x ZI (t ) e x(0)
At
1 1 3 1 4 2
1 0 0
3 3t
1
6 6 2 2 3
(iii) 0 0 0 0 3 1 e 2 t 0 2 1 e 1
0 0 0 0 6 2 0 6 3 0
5 3 4
6 2 3
0 3 e 2 t 2 e 3t
0 6 6
x ZI (t ) e x(0)
At
1 1 3 1 4 2
1 0 0
3 3t
1 1
6 6 2 2 3
0 0 0 0 3 1 e 2 t 0 2 1 e 0 0
0 0 0 0 6 2 0 6 3 0 0
7.5 Determine the discrete-time state equations for the systems of Problem 7.3(i), (ii), (iii) with b = [0, 0,
1]T in terms of the sampling period T.
(ii)
6 sin 6T
0 cos 6 T
1
B d 0 0
1 cos 6 T sin 6 T
0
6 6
0 1
11 3 1 4 2
1 0 0
6 6 2 2 3 3
Ad e AT 0 0 0 0 3 1 e 2T 0 2 1 e 3T
0 0 0 0 6 2 0 6 3
(iii)
1 1 2
6 2 2T 3
1 1 e 3T
Bd 0 T 1 1
e
2 3
0 2 3
7.6 Prove that (right) eigenvectors of the matrix AT are the left eigenvectors of A and that its eigenvalues
are the eigenvalues of A using
A VV 1 VW
AT V T AT V 1 AT W T W T
1 T
The last expression is equivalent shows that the transpose of the rose of the matrix of left eigenvectors
are the right eigenvectors (columns) of AT and that the eigenvalues of AT are those of A.
7.7 Prove the properties of the constituent matrices given in Section 7.4.c using (7.44).
Z , i j
2- The product of two constituent matrices is Zi Z j i
0, i j
Recall that the product of the right eigenvector matrix and the left eigenvector matrix (with
appropriate scaling of the vectors is the identity. Hence, we have
w1T
T
w
W V 2 v1 v2 vn
T
w n
w1T v1 w1T v 2 w1T v n 1 0 0
T 0
w v w T2 v 2 w T2 v n 1 0
2 1
T
w n v1 w Tn v 2 w Tn v n 0 0 1
1, i j
w Ti v j
0, i j
We now examine the product of any constituent matrices and observe that
Z i , i j
Z i Z i v i w Ti v j w Tj
0, i j
i, j 1, , n
Since the square of any constituent matrix is the matrix itself, all powers of the matrix are
equal and the matrix is idempotent.
3- The sum of the n constituent matrices of a n n matrix is equal to the identity matrix
n
Z i In
i 1
Equation (7.44) with t =0 gives
n n
I n e At Z i e 0 v i w Ti
t 0
i 1 i 1
7.8 (a) Derive the expressions for the terms of the adjoint matrix used in the Leverrier algorithm.
Hint: Multiply both sides of (7.26) by the matrix [sI A] and equate coefficients.
(b) Derive the expressions for the coefficients of the characteristic equations used in the Leverrier
algorithm.
Hint: Laplace transform the derivative expression for the matrix exponential, take the trace, then use
the identity
a1 2a 2 s ... n 1a n 1 s n 2 ns n 1
tr L s I n A a 0 a1 s ... a n 1 s n 1 s n
2a 2 s ... n 1a n 1 s n 2 ns n 1
tr s I n A
1
a 1
a 0 a1 s ... a n 1 s n 1 s n
a 0
a1 s ... a n 1 s n 1 s n I n P0 P1 s ... Pn 1 s n 1 s I n A
(c) Derive the expressions for the coefficients of the characteristic equations used in the Leverrier
algorithm.
Hint: Laplace transform the derivative expression for the matrix exponential, take the trace, then use
the identity
s_ e At I _ e At A
Take the trace, then use the identity
a1 s 2a 2 s 2 ... n 1a n 1 s n 1 ns n n a 0 a1 s ... a n 1 s n 1 s n
D( s)
na 0 (n 1)a1 s (n 2)a 2 s 2 ... a n 1 s n 1
a0 a1 s ... a n 1 s n 1 s n
7.9 The biological component of the fishery system is assumed to be governed by the population
dynamics equation1
dx(t )
r x(t ) (1 x(t ) / K ) h(t )
dt
where r is the intrinsic growth rate per unit time, K is the environment carrying capacity, x (t ) is the
stock biomass and h (t ) is the harvest rate in weight1
a) Determine the harvest rate for a sustainable fish population x0< K.
b) Linearize the system in the vicinity of the fish population x0.
c) Obtain a discrete-time model for the linearized model with a fixed average yearly harvest rate h(k)
in the kth year.
d) Obtain a condition for the stability of the fish population from your discrete-time model and
comment on the significance of the condition.
0 r x 0 (1 x 0 / K ) h0
The harvest rate is given by
h0 r x 0 (1 x 0 / K )
dx(t )
ax(t ) h(t )
dt
To obtain a discrete-time model, we examine the solution of the equation for fixed harvest rate h
t
x(t ) e at x(0) e a (t ) hd
o
1 e at
e at x(0) h
a
The discrete model for h(t) fixed over a sampling period of one year is
1
C. W. Clark, Mathematical Bioeconomics: The Optimal Management of Renewable Resources, J. Wiley, N.
Y., 1990.
1 e a
x(k 1) e a x(k ) h( k )
a
The stability condition for the population is a>0. Hence, the population must not drop below half the
environment carrying capacity to be sustainable for any intrinsic growth rate r.
7.10 The following differential equations represent a simplified model of an overhead crane2:
where mC is the mass of the trolley, mL is the mass of the hook/load, l is the rope length, g is the
gravity acceleration, u is the force applied to the trolley, x1 is the position of the trolley and x3 is the
rope angle. Consider the position of the load y=x1+lsinx3 as the output.
(a) Determine a linearized state- space model of the system about the equilibrium point x=0 with
state variables x1, x3, the first derivative of x1 and the first derivative of x3.
(b) Determine a second state-space model when the sum of the trolley position and of the rope
angle is substituted for the rope angle as a third state variable.
(a) The nonlinear model can be expressed in state-space form by defining x 2 x1 and x 4 x 3 .
The dynamic model can be linearized about the equilibrium point x=0 using the approximations
cos x3 1 , sin x3 x3 , sin 2 x3 0 , x 42 0
The following linear state-space model results:
x Ax Bu
y Cx Du
where
0 1 0 0 0
mL 1
0 0 g 0 m
B C C 1 0 1 0
mC
A D0
0 0 0 1 0
0 ( m L mC ) g 1
0 0
mL l mC l
z1 (t ) x1 (t )
z 2 (t ) x 2 (t )
z 3 (t ) x1 (t ) x3 (t )
z 4 (t ) x 4 (t )
2
A. Piazzi, A. Visioli, “Optimal dynamic-inversion-based control of an overhead crane”, IEE Proceedings –
Control Theory and Applications, Vol. 149, No. 5, pp. 405-411, 2002.
1 0 0 0
0 1 0 0
T 1
1 0 1 0
0 0 0 1
0 1 0 0 0
mL mL 1
m g 0
mC
g 0 m
A=T AT=
1 C
B=T1B= C
0 1 0 1 0
m L mC g 0
m L mC
g 0 1
mC l mC l mC l
C=CT= 0 0 1 0 D=0
7.11 Consider the discretized armature-controlled DC motor system obtained in Example 7.15. Obtain the
diagonal form for the system (note that the angular position of the motor is measured).
The eig command of MATLAB yields the eigenvalues and the modal matrix
1 0.9901 0.1045
diag{1,0.990,0.9049} V 0 0.0991 0.0994
0 0.0992 0.9895
Thus, we have
1 0 0 0.0998
A=V1AdV= 0 0.990 0
B=V1B= 0.1120
0 0 0.9049 0.1069
Since the system is linear, we can consider the zero-state and zero-input responses separately.
Necessity
For zero initial conditions at any time k, the state at time k+1 is
x ZS (k 1) b u (k )
If the input matrix has one or more negative entries, then the corresponding entries of the state vector
will also be negative for any positive input. Similarly, for zero input at time k and nonzero state, the
state at time k+1 is
x ZI (k 1) A x(k )
Let the ijth entry of the matrix aij be negative, then for the state x(k) with 1 as the ith entry and all other
entries zero will yield a state equal to the jth column of A and will include the negative term aij.
Sufficiency
We examine the three equations considered earlier when the assumptions hold true. Let the entries of
the input matrix be nonnegative, then for any nonnegative input the zero-state response is
nonnegative. Similarly, if all the entries of the state matrix are positive, then for any nonnegative state
at time k, the state at time k+1 is nonnegative. Finally, for an output matrix with nonnegative entries
the output is nonnegative for any nonnegative state at time k.
7.13 To monitor river pollution, we need to model the concentration of biodegradable matter contained in
the water in terms of biochemical oxygen demand for its degradation. We also need to model the
dissolved oxygen deficit defined as the difference between the highest concentration of dissolved
oxygen and the actual concentration in mg/l. If the two variables of interest are the state variable x1
and x2, respectively, then an appropriate model is given by
k 0
x (t ) 1 x(t )
k1 k 2
where k1 is a biodegradation constant and k2 is a reaeration constant and both are positive. Assume
that the two positive constants are unequal. Obtain a discrete-time model for the system with
sampling period T and show that the system is positive.
3
L. Farina and S. Rinaldi, Positive Linear Systems: Theory & Applications, Wiley-Interscience, NY, 2000.
1
1
0
s k1 0 s k1
k
1 s k 2 k1 1
s k1 s k 2 s k 2
The diagonal entries of the discrete state matrix are clearly positive. The third nonzero term is also
positive since
e k1T e k 2T if k1 k2
e k1T e k 2T if k1 k2
7.14 Autonomous underwater vehicle (AUV) are robotic submarines that can be used for a variety of
studies of the underwater environment. The vertical and horizontal dynamics of the vehicle must be
controlled to remotely operate the AUV. The INFANTE is a research AUV operated by the Instituto
Superior Tecnico of Lisbon, Portugal4. The variables of interest in horizontal motion are the sway
speed and the yaw angle. A linearized model of the horizontal plane motion of the vehicle is given by
x1 0.14 0.69 0.0 x1 0.056
x 0.19 0.048 0.0 x 0.23 u
2 2
x 3 0.0 1.0 0.0 x 3 0.0
x1
y 1 1 0 0
y x2
2 0 1 0 x
3
where x1 is the sway speed, x2 is the yaw angle, x3 is the yaw rate and u is the rudder deflection.
Obtain the discrete state-space model for the system with a sampling period of 50 ms.
The state transition matrix is the matrix exponential given by the inverse Laplace transform of the
matrix
1
s 0.14 0.69 0.0
sI 3 A1
0.19 s 0.048 0.0
0.0 1.0 s
4
C. Silvestre and A. Pascoal, “Control of the INFANTE AUV using gain scheduled static output feedback,”
Contrl Engineering Practice, Vol. 12, pp. 1501-1509, 2004.
s s 0.048 0.69 0
0.19 s s s 0.14 0
0.19 s 0.14 s 2 0.188s 0.12438
s s 0.271s 0.459
0 0 0 0.437 0.9452 0 0.5630 0.9452 0
0 0 0 0.2603 0.5630 0
0.2603 0.437 0
1.5276 1.1256 1 0.9605 2.0776 0 0.5671 0.9521 0
s s 0.271 s 0.459
Next, we inverse Laplace transform to obtain the state-transition matrix
0.9932 0.03434 0
Ad e A( 0.05 )
0.009456 0.9978 0
0.0002368 0.04994 1
e 0.271T 1 1 e 0.459T
B d Z 1 BT Z 2 B Z 2 B
0.271 0.459
0.002988
0.0115
0.0002875
The discrete state-space equations of the system are
7.15 A typical assumption in most mathematical models is that the system differential equations or transfer
functions have real coefficients. In a few applications, this assumption is not valid. In models of
rotating machines, the evolution of the vectors governing the system with time depends on their space
orientation relative to fixed inertial axes. For an induction motor, assuming symmetry, two stator
fixed axes are used as the reference frame: the direct axis (d) in the horizontal direction and the
quadrature axis (q) in the vertical direction. The terms in the quadrature direction are identified with a
(j) coefficient which is absent from the direct axis terms. The two axes are shown in Figure P7.1.
We write the equations for the electrical subsystem of the motor in terms of the stator and rotor
currents and voltages. Each current is decomposed into a direct axis component and quadrature
component, with the latter identified with the term (j) . The s-domain equations of the motor are
obtained from its equivalent circuit using Kirchhoff’s laws. The equations relative to the stator axes
and including complex terms are
where stator (rotor) resistance
stator, rotor, mutual inductance, respectively,
= rotor angular velocity.
(a) Write the state equations for the induction motor.
(b) Without obtaining the eigenvalues of the state matrix, show that the two eigenvalues are not
complex conjugate.
stator
rotor d
Solution
(a) We rewrite the equation as
where
7.16 In many practical applications, the output sampling in a digital control system is not exactly
synchronized with the input transition. Show that the output equation corresponding to output
sampling at
is
where
If the direct transmission matrix is zero, does the input directly influence the sampled
output?
When is the resulting input-output model time-invariant?
Solution
The state of the continuous time system at the output sampling points is
Substituting in the output equation gives the expression for the sampled output.
Evaluating the matrix when is zero gives , which is nonzero. Thus, the
input influences the sampled output even if the direct transmission matrix is zero.
The system is time invariant if the output matrix and the direct transmission matrix are
both constant. This occurs if the output sampling delay is constant and the two matrices reduce
to
Computer Exercises
7.17 Write computer programs to simulate the systems of Problem 7.1 for various initial conditions with
zero input and discuss your results referring to the solutions of Example 7.4. Obtain plots of the phase
trajectories for any second order system.
The following function is for the system of part (i) but can be easily modified to simulate other
systems
function dx = state(t,x)
dx = zeros(2,1); % a column vector
dx(1) = sin(t) + x(2);
dx(2) = -2*x(2);
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.5 1 1.5 2 2.5
7.18 Write a program to obtain the state-transition matrix using the Leverrier algorithm.
for i=1:n-1
P{i+1}=P{i}*A+a(i)*In;
a(i+1)=-trace(P{i+1}*A)/(i+1);
end
% %-------Checking for accuracy--------------------------
e=P{n}*A+a(n)*In; % Ideally zero
norme=norm(e,1);
7.19 Simulate the systems of Problem 7.3(i-iii) with the initial conditions of 7.4 and obtain state-trajectory
plots with one state variable fixed for each system.
The simplest approach to getting the simulation results is to use the MATLAB command initial with
a state-space model. Any choice of input matrix is acceptable, with output matrix C = I and d=0.
The following commands will yield the step response:
(i) A = diag{3, 5, 7} (the second initial condition vector is an eigenvector).
x2
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x1
Figure P7.3 State-space trajectories for Problem 7.13(i).
0 0 1
(ii) A 0 1 0 (the second initial condition vector is an eigenvector).
6 0 0
x2 1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
x1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
x2 1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
x1
0
0.8 0.85 0.9 0.95 1 1.05 1.1 1.15 1.2
7.20 Repeat 7.5 using a CAD package for two acceptable choices of the sampling period and compare the
resulting systems.
Since we only need the state equation, any choice of output equation is acceptable. For all three
systems, T = 0.01 s is acceptable.
(i) A = diag{3, 5, 7} Here 0.01 is much smaller than the smallest time constant 1/7.
>> pd=c2d(p,.01)
a=
x1 x2 x3
x1 0.9704 0 0
x2 0 0.9512 0
x3 0 0 0.9324
b=
u1
x1 0
x2 0
x3 0.009658
c=
x1 x2 x3
y1 1 0 0
d=
u1
y1 0
0 0 1
(ii) A 0 1 0
6 0 0
The state matrix has eigenvalues at {1,j2.4495} and T=0.01 is sufficiently fast sampling.
>> pd=c2d(p,.01)
a=
x1 x2 x3
x1 0.9997 0 0.009999
x2 0 0.99 0
x3 -0.05999 0 0.9997
b=
u1
x1 5e-005
x2 0
x3 0.009999
c=
x1 x2 x3
y1 1 0 0
d=
u1
y1 0
0 1 1
(iii) A 0 0 1
0 6 5
The state matrix has eigenvalues at {0,-2,-3}and T=0.01 is sufficiently fast sampling for the two
nonzero eigenvalues. The first eigenvalue is zero and yields a constant term for any sampling
period for both the state and input matrices.
>> pd=c2d(p,.01)
a=
x1 x2 x3
x1 1 0.009999 4.917e-005
x2 0 0.9997 0.009753
x3 0 -0.05852 0.9509
b=
u1
x1 1.646e-007
x2 4.917e-005
x3 0.009753
c=
x1 x2 x3
y1 1 0 0
d=
u1
y1 0
7.21 Simulate the river pollution system of Problem 7.13 for the normalized parameter values of k1 = 1, k2
= 2, with a sampling period T=0.01 s for the initial conditions xT (0) = [1, 0], [0,1], [1, 1], and plot all
the results together.
Using the program used for the solution of Problem 7.15, we obtain the trajectories of Figure P7.. all
of which are in the first quadrant of the state plane since the system is positive.
1
x2
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x1
Figure P7.6 Zero-input responses of river pollution system.
a=
-0.1400 -0.6900 0
-0.1900 -0.0480 0
0 1.0000 0
>> b=[.56;-2.3;0]/10
b=
0.0560
-0.2300
0
>> c=[1,0,0;0,1,0]
c=
1 0 0
0 1 0
>> p=ss(a,b,c,0)
a=
x1 x2 x3
x1 -0.14 -0.69 0
x2 -0.19 -0.048 0
x3 0 1 0
b=
u1
x1 0.056
x2 -0.23
x3 0
c=
x1 x2 x3
y1 1 0 0
y2 0 1 0
d=
u1
y1 0
y2 0
Continuous-time model.
>> pd=c2d(p,.05)
a=
x1 x2 x3
x1 0.9932 -0.03434 0
x2 -0.009456 0.9978 0
x3 -0.0002368 0.04994 1
b=
u1
x1 0.002988
x2 -0.0115
x3 -0.0002875
c=
x1 x2 x3
y1 1 0 0
y2 0 1 0
d=
u1
y1 0
y2 0
x1 (k 1) 0 1 x1 (k ) 0
x (k 1) u (k )
2 0.5 0.1 x 2 (k ) 1
x (k )
y (k ) 1 1 1
x 2 (k )
when
(i) u(k)=0
(ii) u(k)=1
(i) The equilibrium state is trivially at the origin and the corresponding output is y(k)=0.
(ii) The equilibrium state can be determined by solving the equation
x1 (k ) 0 1 x1 (k ) 0
x (k )
2 0.5 0.1 x 2 (k ) 1
which reduces to
1
0 1 0 0.625
x e I 2
0.5 0.1 1 0.625
x1 (k 1) 0 1 x1 (k ) 0
x (k 1) 0.5 a x (k ) u(k )
2 1 2 1
x (k )
y (k ) 1 0 1
x 2 (k )
where a1 is dependent on viscous friction.
(a) Using the results of Chapter 4, determine the range of the parameter a1 for which the system
is internally stable.
(b) Predict the dependence of the parameter a1 on viscous friction and use physical arguments to
justify your prediction (Hint: friction dissipates energy and helps the system reach its
equilibrium).
1
iii) 1 + a1 + 0.5 > 0
Condition (ii) is always met. Combining conditions (i) and (iii) gives
x1 (k 1) 0.1 0 x1 (k ) 0
x (k 1) 1 0.2 x (k ) 0.2u(k )
2 2
i)
x (k )
y (k ) 1 1 1
x 2 (k )
The state matrix is triangular and its eigenvalues are {0.1, 0.2}, both of which are inside the unit
circle. The system is internally stable. Any internally stable system is also input-output stable.
x1 (k 1) 0.2 .2 0 x1 (k ) 1 0
x (k 1) 0 1 0.1 x 2 (k ) 0 0u(k )
2
x3 (k 1) 0 0 1 x3 (k ) 1 1
ii)
x1 (k )
y 1 0 0 x 2 (k )
x3 (k )
The state matrix is triangular and its eigenvalues are {0.2, 1, 1}, two of which are on the unit
circle. The system is not internally stable.
G ( z ) C zI 3 A B
1
1
z 0.2 0.2 0 1 0
1 0 0 0 z 1 0.1 0 0
0 0 z 1 1 1
z 2 0.98
0.02
z 0.2z 1z 1
The unstable poles are present in the transfer function and the system is not input-output stable.
2
x1 (k 1) 0.1 0.3 x1 (k ) 0
x (k 1) u( k )
2 1 0.2 x 2 (k ) 0.2
iii)
x (k )
y (k ) 1 1 1
x 2 (k )
The state matrix has the eigenvalues {0.4, 0.7}, both of which are inside the unit circle. The
system is internally stable and is therefore input-output stable.
x1 (k 1) 0.1 0.3 0 x1 (k ) 1 0
x (k 1) 0.1 1 0.1 x 2 (k ) 1 0u(k )
2
x3 (k 1) 0.3 0 1 x3 (k ) 0 1
iv)
x1 (k )
y 1 0 1 x 2 (k )
x3 (k )
The state matrix has the eigenvalues {0.0627, 0.9676, 1.0049}, one of which is outside the unit
circle. The system is not internally stable.
G ( z ) C zI 3 A B
1
1
z 0.1 0.3 0 1 0
1 0 1 0.1 z 1 0.1 0 0
0.3 0 z 1 1 1
z 1.3z 1.3
z 0.1z 1
z 1.005z 0.9676z 0.0627
The unstable poles are present in the transfer function and the system is not input-output stable.
8.4 Determine the stable, marginally stable, and unstable modes for each of the unstable systems of
Problem 8.3.
i) The stable modes are (0.1)k and (0.2)k and there are no unstable modes.
ii) The stable mode is (0.2)k and the marginally stable modes are {(1)k , 1}.
iii) The stable modes are (0.4)k and (0.7)k and there are no unstable modes.
iv) The stable modes are {(0.0627)k , (0.9676)k } and the unstable mode is (1.0049)k.
8.5 Determine the controllability and stabilizability of the systems of Problem 8.3.
i) The system is internally stable and therefore stabilizable. The first state equation is decoupled
and has no control input term and the mode (0.1)k is uncontrollable. Clearly, the rank test will
yield the same result. The controllability matrix is
C = Bd Ad Bd
0 0
=
0.2 0.04
The controllability matrix has rank 1 and the system is not controllable.
3
ii) The controllability matrix of the system is
C = Bd Ad Bd Ad2 Bd
1 0 0.2 0 0.06 0.02
= 0 0 0.1 0.1 0 0 T
1 1 0.1 0.1 1 1
The controllability matrix has rank 3 and the system is controllable and therefore stabilizable.
iii) The system is internally stable and therefore stabilizable. The controllability matrix is
C = Bd Ad Bd
0 0.06
=
0.2 0.04
The controllability matrix has rank 2 and the system is controllable.
8.6 Transform the following system to standard form for uncontrollable systems and use the
transformed system to determine if it is stabilizable:
C = Bd Ad B d Ad2 B d
1 0 0.05 0.19 0.012 0.0285
= 0 1 0.05 0.1 0.0075 0.0195
0 1 0.05 0.1 0.0075 0.0195
The second and third rows are identical and the matrix has rank 2. The left eigenvector
w T 0 1 1 satisfies the condition wT C = 0T. We use it to form the nonsingular transformation
matrix whose inverse is
4
1 0 0
T c
1
0 1 0
0 1 1
8.7 Transform the system to the standard form for unobservable systems and use the transformed system
to determine if it is detectable:
x1 (k 1) 0.2 0.08 x1 (k ) 1
x (k 1) u( k )
2 0.125 0 x 2 (k ) 0
x (k )
y (k ) 1 0.8 1
x 2 (k )
C 1 0.8
O=
CAd 0.1 0.08
The second row is equal to the first scaled by 0.1 and the matrix has rank 1. The system has one
unobservable mode. The eigenvector
v 0.8 1
T
0.8 0
To
1 1
8.8 Determine the controllability and stabilizability of the systems of Problem 8.3 with the input
matrices changed to:
5
i) B 1 0 T
The controllability matrix is
C = Bd Ad Bd
1 0.1
=
0 1
The controllability matrix has rank 2 and the system is controllable and therefore stabilizable.
ii)
B 1 1 0 T
To use the eigenvector test we determine the left eigenvectors and evaluate the product
0 0 1 1 0
WB 0 1 0.05 1 1
0.986 0.164 0.021 0 0.822
The first left eigenvector corresponds to the eigenvalues 1 and it yields a zero product. Hence
the mode (1)k is not controllable and the system is not stabilizable since the eigenvalues is not
inside the unit circle.
iii) B 1 0 T
The controllability matrix is
C = Bd Ad Bd
1 0.1
=
0 1
The controllability matrix has rank 2 and the system is controllable and therefore stabilizable.
iv)
B 1 0 1 T
The controllability matrix of the system is
C = Bd Ad Bd Ad2 Bd
1 0.1 0.05
= 0 0.2 0.12
1 0.7 0.67
The controllability matrix has rank 3 and the system is controllable and therefore stabilizable.
8.9 An engineer is designing a control system for a chemical process with reagent concentration as the
sole control variable. After determining that the system is not controllable, why is it impossible for
him to control all the modes of the system by an innovative control scheme using the same control
variables? Explain and suggest an alternative solution to the engineer’s problem.
Controllability is a structural property and no control will affect all the modes if the system is not
controllable. The engineer must select an additional control variable to make the system
controllable. The choice of the control variable will depend on the process.
8.10 The engineer of Problem 8.9 examined the chemical process more carefully and discovered that all
the uncontrollable modes with concentration as control variable are asymptotically stable with
sufficiently fast dynamics. Why is it possible for the engineer to design an acceptable controller
6
with reagent concentration as the only control variable? If such a design is possible, give reasons for
the engineer to prefer it over a design requiring additional control variables.
The process is not controllable but is stabilizable. Furthermore, the uncontrollable modes are
sufficiently fast and do not require control action to speed up their dynamics. The engineer can
therefore design a satisfactory controller with reagent concentration as the only control variable.
Because using one control variable requires less hardware, the cost of the controller with one control
variable is less. Engineers always prefer the least costly solution to achieve their design objectives.
8.11 Determine the observability and detectability of the systems of Problem 8.3.
i) The system is internally stable and therefore detectable. The observability matrix is
C 1 1
O=
CAd 1.1 0.2
The matrix has rank 2 and the system is observable.
ii) We determine the eigenvectors of the state matrix and use the eigenvector test. The system is
observable and therefore detectable.
1 0.1644 0.0125
CV 1 0 00 0.9864 0.0499 1 0.1644 0.0125
0 0 0.9987
There are no zero products for an eigenvector with the input matrix and the system is
observable. Note that the zeros in the output matrix do not indicate loss of observability since
the system is not in diagonal form. The system is detectable since it is observable.
iii) The system is internally stable and therefore detectable. The observability matrix is
C 1 1
O=
CAd 1.1 0.5
The matrix has rank 2 and the system is observable.
ii) C 0 1 0
7
C 0 1 1
O = CAd 0 1 0.1
CAd2 0 1 0
The matrix has rank 2 and the system is not observable. The product of the matrix with the
eigenvector [1 0 0]T corresponding to the eigenvalue 0.2 is the only one that is equal to zero. The
eigenvalues is inside the unit circle and the system is detectable.
iii) C1 0
The system is internally stable and therefore detectable. The observability matrix is
C 1 0
O=
CAd 0.1 0.3
The matrix has rank 2 and the system is observable.
iv)
C1 0 0
The observability matrix is
C 1 0 0
O = CAd 0.1 0.3 0
CAd2 0.02 0.27 0.03
The matrix has rank 3 and the system is observable and therefore detectable.
0 1 0 0
A 0 0 1 b 0 c 0.5 1 0 d 0
0.005 0.11 0.7 1
(a) Can we design a controller for the system that can influence all its modes?
(b) Can we design a controller for the system that can observe all its modes?
(a) The system is in controllable form and is therefore controllable. Hence, we can design a
controller for the system that can influence all its modes.
The matrix has rank 2 and the system is not observable. We cannot design an observer that
observes all the system modes.
8
8.14 Consider the system (A, B, C) and the family of systems ( A, B, C) with each of (, , )
nonzero.
a) Show that if is an eigenvalue of A with right eigenvector v and left eigenvector wT then
is an eigenvalue of A with right eigenvector v/ and left eigenvector wT/.
b) Show that (A, B) is controllable if and only if ( A, B) is controllable for any nonzero
constants (,).
c) Show that system (A, C) is observable if and only if ( A, C) is observable for any nonzero
constants (,).
Av v Av / v /
w T A w T w T / A w T /
b) Using the eigenvector test for controllability we have
w T B 0 w T / B 0
c) Using the eigenvector test for observability we have
Cv 0 C v / 0
C = Bd Ad Bd ... Adn 1 Bd
0 0 0 1
0 0 1 a
n 1
x
0 1 x x x
1 a n 1 x x x
where x denotes terms that depend on the entries of the last row of the state matrix. The matrix is
clearly full-rank and the system is controllable.
Recall that the observable form can be obtained using the state-space matrices of the controllable
form by (i) transposing the state matrix, and (ii) transposing and interchanging the input and output
matrices. Hence the observability matrix is given by
9
C BcT
CA T T
d Bc Ac
O= CcT
n 1 T T n 1
CAd Bc Ac
where the subscript c denotes the matrices for controllable form. The transpose of a full-rank matrix
is full-rank and the system is observable. The result can be obtained directly using the input and
state matrices of the observable form.
z 0.5
i) G ( z) 3
( z 01
. )( z 01
.)
3 z 1.5
a) We rewrite the transfer function in the form G ( z )
z 2 0.01
The matrices for the realization are
0 1 0
A b c T 1.5 3 d = 0
0.01 0 1
b) Transpose A, interchange and transpose band cT to obtain
0 0.01 1.5
A b c T 0 1 d=0
1 0 3
c) The partial fraction expansion of the transfer function is
G( z)
9
6
z 0.1 z 0.1
The matrices for the parallel realization are
0.1 0 1
A b c T 9 6 d = 0
0 0.1 1
z ( z 0.5)
ii) G ( z) 5
( z 01
. )( z 01
. )( z 0.8)
5 z 2 2.5 z 0
G( z)
z 3 0.8 z 2 0.01z 0.008
The controllable realization is
10
0 1 0 0
A 0 0 1 b 0 c T 0 2.5 5 d=0
0.008 0.01 0.8 1
0 0 0.008 0
A 1 0 0.01 b 2.5 c T 0 0 1 d=0
0 1 0.8 5
0.1 0 0 1
A 0 0.1 0 b 1 c T 1.6667 1.4286 1.9048 d=0
0 0 0.8 1
z 2 ( z 0.5)
iii) G ( z)
( z 0.4)( z 0.2)( z 0.8)
0 1 0 0
A 0 0 1 b 0 cT 0.064 0.4 0.3 d = 1
0.064 0.4 0.2 1
0 0 0.064 0.064
A 1 0 0.4 b 0.4 c T 0 0 1 d=1
0 1 0.2 0.3
11
0.4 0 0 1
A 0 0.2 0 b 1 c T 0.6 0.14 0.16 d=1
0 0 0.8 1
z ( z 0.1)
iv) G( z)
z 0.9 z 0.8
2
0 0.8 0.8
A b c T 0 1 d=1
1 0.9 0.8
8.18 Obtain the controller form that corresponds to a renumbering of the state variables of the
controllable realization (also known as phase variable form) from basic principles.
Follow the same step as phase variable form. We start with the denominator of the transfer function
P( z ) 1
U ( z ) z n a n 1 z n 1 ... a1 z a 0
Define the state vector as
We have
xi (k 1) xi 1 (k ), i 2, , n
The first state equation is obtained from the transfer function
12
x1 (k 1) a n 1 x1 (k ) a1 x n 1 (k ) a 0 x n (k ) u (k )
Y ( z ) c nU ( z ) Gd ( z )U ( z )
c n 1 z n 1 c n 2 z n 2 ... c1 z c0
c nU ( z ) U ( z)
z n a n 1 z n 1 ... a1 z a 0
c nU ( z ) c n 1 z n 1 c n 2 z n 2 ... c1 z c0 P ( z )
p(k n 1)
p ( k n 2)
. du (k )
y (k ) c n 1 cn2 ... c1 c 0
.
p(k 1)
p(k )
x1 (k )
x (k )
2
.
c n 1 cn2 ... c1 c 0 du (k )
.
x n 1 (k )
x n (k )
8.19 Obtain the transformation matrix to transform a system in phase variable form to controller form.
Prove that the transformation matrix will also perform the reverse transformation.
0 0 1 0 0 1
0 1 0
x( k ) z ( k ) z ( k ) 0 1 0 x ( k )
1 0 0 1 0 0
The transformation matrix is identical to its inverse and hence the same matrix performs the reverse
transformation.
13
8.20 Use the two steps of Section 8.5 to obtain a second observable realization from controller form.
What is the transformation that will take this form to the first observable realization of Section 8.5.d.
We transpose the state matrix and we transpose and interchange the input and output matrices
x1 (k 1) a n 1 x1 (k ) c n 1
x (k 1) a x ( k ) c
2 n2 I 2 n2
. n 1 . u (k )
0 n 11
x n 1 (k 1) a1 x n 1 (k ) c1
x n (k 1) a 0 x n (k ) c0
y (k ) 1 01n 1 x(k ) du (k )
8.21 Show that the observable realization obtained from the phase variable form realizes the same
transfer function.
Go ( s ) B T s I n AT
1
CT d
we transpose the scalar to obtain the transfer function of the controllable form
Go ( s ) B T s I n AT C 1 T
d
B s I A C
T
T 1
T
n
T
d
C s I n A B d Gc ( s )
1
8.22 Show that the transfer functions of the following systems are identical and give a detailed
explanation.
0 1 0
A b c T 0 1 d=0
0.02 0.3 1
01
. 0 1
A b c T 1 2 d = 0
0 0.2 1
For both systems the transfer function is
G ( z ) C zI A B D
1 z
z 0.3z 0.02
2
14
This yields the parallel realization of the second system. The transformation matrix relating the
two systems can be obtained from their controllability matrices. Using the subscript “c” to denote
the first realization (controllable form), the transformation matrix to take the system to the parallel
realization is
10 10
Tc b c Ac b c b Ab
1
1 2
1
Tc1 Ac Tc diag 0.1, 0.2
1
Tc b c
1
Recall that the MATLAB command ss2ss uses the inverse of Tc for similarity transformation.
8.23 Obtain a parallel realization for the transfer function matrix of Example 8-15.
The minimal polynomial of the system is z 0.2466 z 0.2479 10
2
z 0.3012 and has
no repeated roots. The partial fraction expansion of the matrix is
0.5896 0 0.1822 0 0 0
0 4.7012 0 0 0 5.0873
z 0.2466 z 0.2479 10 2 z 0.3012
The ranks of the partial fraction coefficient matrices, given with the corresponding poles are (2,
0.2466), (1, 0.2479ꞏ10-2) and (1, 0.3012). The matrices can be factorized as
0 . 5896 0 1 0 0 . 5896 0
0
4 . 7012 0 1 0 4 . 7012
0 . 1822 0 1
0 .1822 0
0 0 0
0 0 0
0 5 . 0873 1 0 5 . 0873
0.2466 0 0 0 0.5896 0
0 0.2466 0 0 0 4.7012
A B
0 0 0.2479 10 2 0 0.1822 0
0 0 0 0.3012 0 5.0873
1 0 1 0
C D 0 22
0 1 0 1
Note that the realization is minimal since it is fourth order and the system was determined to have
four poles in Example 8-15.
15
8.24 Find the poles and zeros of the following transfer function matrices
1
z 0.1 1 0
z 0.1
z 0.1
G ( z ) z 0.1
2 z 0.2 1
(i) (ii) G( z)
1 z 0.1z 0.3 z 0.3
0
z 0.1 2
0
z 0.3
The least common denominator of the entries of the matrix is z 0.1z 0.1
2
(i)
The least common denominator of all the minors is z 0.1z 0.1 and the system has poles at
2
Y1(z)
U1(z) z 0.1 1
z 0.1 + z 0. 1
Y2(z)
1
U2(z)
z 0. 1
To obtain the zeros, we rewrite the transfer function matrix with the pole polynomial as the
denominator of every entry
detG ( z )
z 0.12 z 0.12 z 0.1
z 0.1 z 0.1 z 0.1z 0.12
2 4
The system has a zero at 0.1, which is obvious since the transfer function matrix has a zero column
at this value. The poles and zeros of the system can also be seen in the block diagram of Figure
P8.1
(ii) The least common denominator of the entries of the matrix is z 0.1z 0.3
16
The least common denominator of all the minors is z 0.1 z 0.3 and the system has poles at
2
To obtain the zeros, we rewrite the transfer function matrix with the pole polynomial as the
denominator of every entry
Y2(z)
U1(z) z 0.2 1
z 0.1 + z 0.3
Y1(z)
1
U2(z)
z 0. 1
Y3(z)
2
z 0.3
0 z 0.1z 0.32
z 0.1z 0.2 z 0.3 z 0.1 z 0.3
2
The poles and zeros of the system can also be seen in the block diagram of Figure P8.1
8.25 Autonomous underwater vehicle (AUV) are robotic submarines that can be used for a variety of
studies of the underwater environment. The vertical and horizontal dynamics of the vehicle must be
controlled to remotely operate the AUV. The INFANTE is a research AUV operated by the
Instituto Superior Tecnico of Lisbon, Portugal. The variables of interest in horizontal motion are the
sway speed and the yaw angle. A linearized model of the horizontal plane motion of the vehicle is
given by
x1 0.14 0.69 0.0 x1 0.056
x 0.19 0.048 0.0 x 0.23 u
2 2
x 3 0.0 1.0 0.0 x 3 0.0
x1
y1 1 0 0
y x2
2 0 1 0 x
3
17
where x1 is the sway speed, x2 is the yaw angle, x3 is the yaw rate and u is the rudder deflection
The matrix has rank 3 < 4 at z0 = 0. The controllability matrix of the system is
C= B AB A2 B
0.056 0.1509 0.0214
= 0.23 0.0004 0.0287
0 0.23 0.0004
The matrix is full rank and the system is controllable and therefore has no input-decoupling zeros.
1 0 0
0 1 0
C
0 .14 0 .690 0
O = CA =
0.19 0.048 0
CA 2
0.1507 0.1297 0
0.0357 0.1334 0
The matrix is has rank 2 < 3 and the system is not observable. The system has an output
decoupling zero. Furthermore, the product of the observability matrix and the eigenvector
corresponding the eigenvalue zero is zero
0
O 0 = 0
1
The MATLAB commands zero and tzero also yield the zero value at zero.
8.26 The terminal composition of a binary distillation column uses reflux and steam flow as the control
variables. The 2-input-2-output system is governed by the transfer function
18
12.8e s 18.9e 3 s
G ( s ) 16.7 s7 s1 21.0 s 1
6.6e 19.4e 3s
10.9s 1 14.4s 1
Find the discrete transfer function of the system with DAC, ADC, and a sampling period of one time
unit then determine the poles and zeros of the discrete-time system.
The time delays are integer multiples of the sampling period and the transfer function can first be
obtained with them, then appropriate powers of z can be added to the denominator of each term.
Recall that for a single real pole, we have
K
G( s)
s 1
G ( z ) = 1 z 1 Z K 1s s 11
ZAS
z 1
K 1
z e 1 /
1 e 1 /
K
z e 1 /
0.744 0.8789
z z 0.9419 z z 0.9535
3
G( z)
0.5786 1.3015
z z 0.9123
7
z z 0.9329
3
The system has a pole at the origin with multiplicity 14 and four poles on the positive real axis
inside the unit circle at { 0.9123, 0.9329, 0.9419, 0.9535}.
We rewrite the transfer function matrix with the pole polynomial as its denominator
0.744 z13 z 0.9536z 0.9123z 0.9329 0.8769 z11 z 0.9419z 0.9123z 0.9329
0.5786 z 7 z 0.9419z 0.9536z 0.9329 1.302 z11 z 0.9419z 0.9536z 0.9123
G( z)
z14 z 0.9419z 0.9536z 0.9123z 0.9329
19
0.9683z10 z 0.9536z 0.9123 0.5073 z 4 z 0.9419z 0.9329
detG ( z )
z 14 z 0.9419z 0.9536z 0.9123z 0.9329
0.9683 z 4 z 0.8986z 0.9609 z 2 1.807 z 0.8177 z 2 0.8994 z 0.8075 z 2 0.8964 z 0.8075
z14 z 0.9419z 0.9536z 0.9123z 0.9329
>> zero(gd)
ans =
-0.8986
-0.4497 + 0.7780i
-0.4497 - 0.7780i
0.4482 + 0.7789i
0.4482 - 0.7789i
-0.0000 + 0.0000i
-0.0000 - 0.0000i
0.9609
0.9033 + 0.0413i
0.9033 - 0.0413i
0.0000
0
Computer Exercises
8.27 Write computer programs to simulate the second order systems of Problem 8.3 for various initial
conditions. Obtain state plane plots and discuss your results referring to the solutions of Examples
8.1 and 8.2.
clf
hold on
a=[0.1,0;1,0.2];b=[0;0.2];c=[1,1];%state-space matrices
for ix1=-1:1
for ix2=-1:1
x=[ix1;ix2]%ICs
xa={x}; % Save initial state
for i=1:30 % Compute states
x=a*x;
xa{i+1}=x; % Save state
end
for i=1:length(xa)
x1(i)=xa{i}(1); % First coordinate
x2(i)=xa{i}(2); % Second coordinate
end
plot(x1,x2) % Plot state trajectory
end
end
20
The computer program yields the phase plots of Figure P8.3 and Figure P8.4.
The phase plots show that all trajectories converge to the origin as expected since the systems are
internally stable. The plot for the system of Example 8.1(iii) shows oscillations prior to
convergence to the origin because the system has a negative eigenvalues.
1.5
0.5
-0.5
-1
-1.5
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
1.5
0.5
-0.5
-1
-1.5
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
8.28 Repeat Problem 8.22 using a CAD package. Comment on any discrepancies between CAD results
and solution by hand.
0 1 0
A b c T 0 1 d=0
0.02 0.3 1
01
. 0 1
A b c T 1 2 d = 0
0 0.2 1
For both systems the transfer function is
G ( z ) C zI A B D
1 z
z 0.3z 0.02
2
>> a=[0,1;-0.02,0.3];b=[0;1];c=[0,1];
21
>> p=ss(a,b,c,0,.01);
>> tf(p)
Transfer function:
z - 2.776e-017
------------------
z^2 - 0.3 z + 0.02
>> a1=[0.1,0;0,0.2];b1=[1;1];c1=[-1,2];
>> p1=ss(a,b,c,0,.01);
>> tf(p1)
Transfer function:
z - 2.776e-017
------------------
z^2 - 0.3 z + 0.02
Note that the computer results include the term 2.776e-17 which is the result of computational
zeros and is clearly negligible.
>> [k,poles,rem]=residue([1,0],[1,-.3,.02])
k=
2.0000
-1.0000
poles =
0.2000
0.1000
rem =
[]
>> con=ctrb(a,b)
22
con =
0 1.0000
1.0000 0.3000
>> con1=ctrb(a1,b1)
con1 =
1.0000 0.1000
1.0000 0.2000
>> Tc=con/con1
Tc =
-10.0000 10.0000
-1.0000 2.0000
10 10
Tc b c Ac b c b Ab
1
1 2
1
Tc Ac Tc diag 0.1, 0.2
1 1
Tc b c
1
Recall that the MATLAB command ss2ss uses the inverse of Tc for similarity transformation.
>> pa=ss2ss(p,inv(Tc))
a=
x1 x2
x1 0.1 0
x2 6.939e-017 0.2
b=
u1
x1 1
x2 1
c=
x1 x2
y1 -1 2
d=
u1
y1 0
We again observe the term 6.939e-017, which is due to computational errors and is actually zero.
8.29 Write a MATLAB function that determines the equilibrium state of the system with the state matrix
A, the input matrix B and a constant input u as input parameters.
23
function equilibriumstate=equilibrium(A,B,u);
8.30 Select a second order state equation in diagonal form for which some trajectories
converge to the origin and others diverge. Simulate the system using SIMULINK
and obtain plots for one diverging trajectory and one converging trajectory with
suitable initial states.
Solution
We choose the unforced state-space model
and assign any values to the remainder of the system matrices in the state-space
SIMULINK block. The simulation diagram is shown in Figure P8.24.1
3000
2500
2000
1500
1000
500
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
24
3
2.5
1.5
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
25
Chapter 9 Problem Solutions
9.1 Show that with the closed-loop quadruple for (A, B, C, D) with the state feedback u(k) =Kx(k)+v(k) is
( A BK , B, C DK , D)
9.2 Show that a necessary condition for the pair (A, B) with state feedback gain matrix K to have the
closed-loop state matrix Acl =A BK is that for any vector wT satisfying wTB=0T, and wT A = wT, Acl
must satisfy wTAcl = wT. Explain the significance of this necessary condition (Note that the condition
is also sufficient).
The vector wT is a left eigenvector of the state matrix A corresponding to an uncontrollable mode.
The result follows from premultiplying Acl by wT to obtain
wT Acl= wT (A BK) = wT A = wT
The condition implies that left eigenvectors corresponding to uncontrollable modes are invariant under
state feedback.
9.3 Show that a sufficient condition for the pair (A, B) with m by n state feedback gain matrix K to have the
closed-loop state matrix Acl =A BK is
A Acl = BK
This is now a linear equation to be solved for the matrix K. The RHS is a linear combination of the
columns of the matrix B. Hence, for a solution to the linear system to exist the columns of the matrix
on the LHS must also be linear combinations of the columns of B, i.e. must not include any columns
that are linearly independent of the columns of B. Since the rank of a matrix is the number of linearly
independent columns, we have the condition
Assuming B is full rank and n by m, we have m linearly independent columns and the condition
follows. Since K has n columns, there are more unknowns than equations and the solution is not
unique except in the rare case where m = n, where the matrix K is given by
K = B1 {A Acl }
9.4 Using the results of Problem 9.3, determine if the closed-loop matrix can be obtained using state
feedback for the pair
1.0 0.1 0 0 0
A 0 1
0.01 B 1 0
0 0.1 0.9 1 1
0 0 .1 0
1.0 0.1 0
(a) Acl 12.2 1.2 0
(b) A cl 12 . 2 1 .2 0
0.01 0.01 0 0 . 01 0 . 01 0
9.5 Show that a necessary condition for the pair (A, C) with observer gain matrix L to have the observer
matrix Ao =A LC is that for any vector v satisfying C v=0, and A v = v, Ao must satisfy Aov = v.
Explain the significance of this necessary condition (Note that the condition is also sufficient).
The vector v is a right eigenvector of the state matrix A corresponding to an unobservable mode. The
result follows from postmultiplying Ao by v to obtain
Ao v= (A BK) v = A v= v
The condition implies that right eigenvectors corresponding to unobservable modes are invariant in
observer design.
9.6 Show that a sufficient condition for the pair (A, C) with n by l observer gain matrix L to have the
observer matrix Ao =A LC is
C
rank C rank l
A Ao
A Ao = LC
This is now a linear equation to be solved for the matrix L. The RHS is a linear combination of the rows
of the matrix B. Hence, for a solution to the linear system to exist the rows of the matrix on the LHS
must also be linear combinations of the rows of C, i.e. must not include any rows that are linearly
independent of the rows of C. Since the rank of a matrix is the number of linearly independent rows, we
have the condition
C
rank C rank
A Ao
Assuming C is full rank and l by l, we have l linearly independent rowss and the condition follows.
Since L has n rows, there are more unknowns than equations and the solution is not unique except in the
rare case where l = n, where the matrix L is given by
L = {A Ao} C1
9.7 Design a state-feedback control law to assign the eigenvalues to the set {0, 0.1,0.2} for the systems with
0 .1 0 .5 0 0.01
a)
A 2
0 0.2 b 0
0.2 1 0.4 0.005
1
0 0 1 0.01 0.001 0.0106 29.3542 9.785 58.708
T c
1
0 1 0.5 0
0.021 0.0028 10.763 44.031 21.526
1 0.5 1.41 0.005 0.004 0.0228 91.292 16.145 17.417
k T a 0d a 0 a1d a1
a 2d a 2 Tc1
29.3542 9.785 58.708
0.4 0.02 1.16 0.3 0.5 10.763 44.031 21.526
91.292 16.145 17.417
17.299 59.100 5.401
0 .2 0 .2 0 .4 0.01
b) A 0.5 0 1 b 0
0 0.4 0.4 0
The characteristic polynomial of the state matrix is
3 0.5 2 1.16 + 0.4 i.e. a2 = 0.5, a1 = 1.16, a0 = 0.4
1
0 0 1 0.01 0.002 0.0006 0 0 500
T 1
0 1 0.6 0 0.005 0.001 0 200 200
c
1 0.6 0.62 0 0 0.002 100 80 320
k T a 0d a 0 a1d a1
a 2d a 2 Tc1
0 0 500
0.28 0.02 0.98 0.3 0.6 0 200 200
100 80 320
90 120 340
9.8 Using eigenvalues that are four times as fast as those of the plant, design a state estimator for the system
0 .2 0 .3 0 .2
a) A 0 0 0.3 C 1 1 0
0.3 0 0.3
We choose the eigenvalue set {0, 0.025, 0.05}
1
0 0 1 1 0.2 0.19 5.3763 5.3763 1.07553
T 1
0 1 0.5 1 0.3 0.06 0.3226 0.3226 1.9355
c
1
0 0 1 1 0.2 0.1 0 4.444 6.667
T 1
0 1 0.5 0 0.3 0.06 0 2 2
o
1 0.5 0.25 0 0.2 0.19 1 0.6 0.6
l Tc1 a 0d a 0 a1d a1 a 2d a 2
T
0 0 1 0.027
4.444 2 0.6 0.0013
6.667 2 0.6 0.075 0.5
0.425 0.1375 0.4375
T
0 1 0 0
A 0 0 1 B 0
0.005 0.11 0.7 1
C 0.5 1 0 d 0
(a) Design a controller that assigns the eigenvalues {0.8, 0.3 j 0.3}. Why is the controller
guaranteed to exist?
(b) Why can we design an observer for the system with the eigenvalues {0.5, 0.1 j 0.1}. Explain
why the value (0.5) must be assigned [Hint: (s+0.1)2 (s+0.5) = s3 +0.7s2 +0.11s+0.005].
(c) Obtain a similar system with a 2nd order observable subsystem for which an observer can be easily
designed as in Section 8.3.b. Design an observer for the transformed system with two eigenvalues
shifted as in (b) and check your design using the MATLAB commands place or acker. Use the
result to obtain the observer for the original system.
Hint: Obtain an observer gain lr for the similar third order system from your design by setting the first
element equal to zero, then obtain the observer gain for the original system using l = Tr lr where Tr
is the similarity transformation matrix.
(d) Design an observer-based feedback controller for the system with the controller and observer
eigenvalues selected as in (a) and (b) respectively.
(a) The system is in controllable form and is therefore controllable. Hence, a controller that arbitrarily
assigns its eigenvalues is guaranteed to exist. The desired characteristic polynomial is
k T a0d a 0 a1d a1 a 2d a 2
0.144 0.005 0.66 0.11 1.4 0.7
0.139 0.55 0.7
(b) The state matrix has the eigenvalues {0.5, 0.1, 0.1} and the eigenvector corresponding to the
first eigenvalue satisfies
4
Cv 0.5 1 0 2 0
1
The mode (0.5)k is unobservable and cannot be shifted in observer design. However, the system
is detectable and we can still design a stable observer if the eigenvalue at 0.5 is included but the
usual procedure for observer design will not work because the observability matrix is singular.
We use the eigenvector of the unobservable mode to form the nonsingular transformation matrix
4 1 0
Tr = 2 0 1
1 0 0
This transforms the state and output matrix to
0.04 0.02
T
(d) By the separation principle, we simply use the controller gain of (b) and the observer gain of (c)
for our design. The state feedback is given by
u(k ) K xˆ (k ) v(k )
with the observer dynamics
xˆ (k 1) Axˆ ( k ) Bu( k ) l y( k ) C xˆ ( k )
9.10 Design a reduced-order estimator state feedback controller for the discretized system
The feedback gain matrix is determined by using the command place of MATLAB as
k T 10 85 40
Then, the second and third state variables must be estimated. Let the desired observer eigenvalues be
{0.1±j 0.1}. The state matrix is partitioned as
01
. .
0 01
a a T2
A 1 0 0.5 0.2
a 3 A4
0.2 0 0.4
1 1 0
Q0 0 1 0
0 0 1
The system is transformed to
0 .1 0 .4 0 .3 0.01
At 0 0.5 0.2 b t 0
0.2 0.2 0.4 0.005
0.5 0.2
Ao l0.4 0.3
0.2 0.4
to obtain
0.3211 0.0658
l 0.4474 1.7368
T
Ao
0.8947 0.1211
b o b 2 l b1
0 0.4474 0.4474
10 2 0.01 10
2
a y Ao l a 3 l a1
0.3211 0.0658 0.4474 0 0.4474
0.1
0.8947 0.1211 1.7368 0.2 1.7368
0.2132
0.5842
Thus, we have
1 01T2 y (k )
xˆ (k ) Qo
l I 2 x ( k )
1 1 0 1 01T2
0 1 0 0.4474 y (k )
I 2 x(k )
0 0 1 1.7368
0.5526 1 0
y (k )
0.4474 1 0
x(k )
1.7368 0 1
Finally, we have the estimator state feedback
u (k ) k T xˆ (k )
0.5526 1 0
y (k )
10 85 400.4474 1 0
x(k )
1.7368 0 1
y (k )
101.9737 95 40
x(k )
9.11 Consider the following model of an armature controlled DC motor, which is slightly different from that
of Example 7.15
x1 0 1 0 x1 0
x 0 0 1 x 2 0 u
2
x 3 0 11 11.1 x3 10
x1
y 1 0 0 x 2
x3
For digital control with T=0.02, apply the state feedback controllers determined in Example 9.4 in
order to verify their robustness.
Then, the eigenvalues for the vector gains of Example 9.4 obtained using MATLAB are respectively
(i) eig(Ad-Bd*K)
ans =
0.964979897460521
-0.032562329563822 + 0.515050949150576i
-0.032562329563822 - 0.515050949150576i
(ii) eig(Ad-Bd*K)
ans =
0.975131078267913
0.312223251280780 + 0.416340814288603i
0.312223251280780 - 0.416340814288603i
(iii) eig(Ad-Bd*K)
ans =
0.959539232727393
-0.479676083698749 + 0.522496615587290i
-0.479676083698749 - 0.522496615587290i
Clearly, the eigenvalues obtained are somewhat different from the desired ones. The lack of
robustness of the control system can also be evaluated by considering the discretized zero-input
response for the three states and the corresponding control variable u for the initial condition [1,1,1].
The response for case (i) is shown in Figure P9.1, for case (ii) in Figure P9.2, and for case (iii) in
Figure P9.3.
1 2
0.5 -2
x1
x2
-4
0 -6
0 0.5 1 1.5 2 0 0.5 1 1.5 2
time time
4
x 10
500 1
0.5
0
0
x3
-500
-0.5
-1000 -1
0 0.5 1 1.5 2 0 0.5 1 1.5 2
time time
Figure P9.1 Zero input state response and control variable for case (i) of Problem 9.11
1.5 1
0
1
-1
x1
x2
0.5
-2
0 -3
0 0.5 1 1.5 2 0 0.5 1 1.5 2
time time
100 0
0 -2000
-100 -4000
x3
-200 -6000
-300 -8000
0 0.5 1 1.5 2 0 0.5 1 1.5 2
time time
Figure P9.2 Zero input state response and control variable for case (ii) of Problem 9.11
1 2
0.5 -2
x1
x2
-4
0 -6
0 0.5 1 1.5 2 0 0.5 1 1.5 2
time time
4
x 10
2000 2
1000 1
0 0
x3
u
-1000 -1
-2000 -2
0 0.5 1 1.5 2 0 0.5 1 1.5 2
time time
Figure P9.3 Zero input state response and control variable for case (iii) of Problem 9.11
9.12 Consider the following model of a DC motor speed control system, which is slightly different from that
of Example 6.8
1
G ( s)
(1.2s 1)( s 10)
For a sampling period T=0.02, obtain a state-space representation corresponding to the discrete-time
system with DAC and ADC, then use it to verify the robustness of the state controller of Example 9.5.
The discretized transfer function of the system with DAC and ADC is
z 0.9303
G ZAS ( z ) 1 z 1 Z G(ss) 1.5521 10 z 0.8187
4
z 0.9835
The corresponding state-space model, computed with MATLAB, is
K 0.068517 0.997197
1.8033 0.8208
Acl A BK
1 0
whose eigenvalues are {0.9+j 0.088, 0.9j 0.088} are very close to the desired values. The closed-
loop state-space model is therefore
Thus, if the feedforward gain F =50.42666 is employed with v(k)=Fr(k), we obtain the discretized
step response of Figure P9.4 which has a nonzero steady-state error (unlike the response for
Example 9.11). This occurs despite the fact that the modeling error is unrelated to the gain of the
plant.
Step Response
1
0.9
0.8
0.7
0.6
Amplitude
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1 1.2
Time (sec)
9.13 Verify the robustness of the state controller determined in Example 9.6 by applying it to the model of
Problem 9.12.
As in Problem 9.12 the discretized transfer function of the system with DAC and ADC is
z 0.9303
G ZAS ( z ) 1 z 1 Z G(ss) 1.5521 10 z 0.8187
4
z 0.9835
Then, adding integral control, we obtain
1.8033 0.8208 0 0.01563
~ B
B 0
~ A 0
A
1 0 0
C 1 0.009934 0.009242 1 0 0
with eigenvalues are {0.9+j 0.07, 0.9j 0.07, 0.206} almost equal to those selected in Example 9.6.
The closed-loop state-space model is therefore
The discretized step response of the system is plotted in Figure P9.5. Note that the presence of
integral control yields zero steady-state error despite the presence of modeling uncertainties.
Step Response
0.8
0.6
Amplitude
0.4
0.2
0
0 0.5 1 1.5
Time (sec)
1
G ( s)
s s 1 s 10
For the digital control system with T=0.02, design a state-feedback controller to obtain a step
response with null steady-state error, zero overshoot, and with a settling time of less than 0.5 s.
The discretized transfer function of the system with DAC and ADC is
ZAS
G ( z ) 1 z 1 Z Gs(s) 1.2629 10 z 1zz 3.535
6
0.
z 0.2534
8187 z 0.9802
Since zero steady-state error is required, we need integral control. We therefore obtain
Real closed-loop poles are required to eliminate overshoot in the step response. For the desired
settling time of 0.5 s, a suitable choice of closed-loop poles is {0.2, 0.4, 0.6, 0.8}. The feedback gain
vector determined with the MATLAB command place is
~
K 10 3 0.9211 0.5653 0.1972 5.3491
Step Response
1
System: syscl
0.9 Settling Time (sec): 0.456
0.8
0.7
0.6
Amplitude
0.5
0.4
0.3
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
Time (sec)
9.15 Design a digital state feedback controller for the analog system
s 1
G(s)
(5s 1)(10 s 1)
with T=0.1 to place the closed-loop poles at {0.4, 0.6}. Show that the zero of the closed-loop system
is the same as the zero of the open-loop system.
The discretized transfer function of the system with DAC and ADC is
G ( z ) 1 z 1
ZAS
Z Gs(s) 18.712 10 z 0.z991.z1053
4
0.9802
Thus, the system has a zero at z0=1.1053. The corresponding state-space model, computed with
MATLAB, is
For the desired closed-loop poles at {0.4, 0.6} the feedback gain vector is determined with the
MATLAB command place as
K 15.524 11.687
To check the location of the closed-loop zero, we compute the closed-loop transfer function
1
1 0 1 0.24 0.0625
G ( z ) 0.030 0.033 z
0 1 1 0 0
cl
z 1.1053
18.712 10 4
z 0.4z 0.6
As expected, the zero of the closed-loop system is the same as that of the open-loop system.
9.16 Write the closed-loop system state space equations of a full-observer state feedback system with
integral action.
By substituting the expression of y(k) and u(k) in the first three equations, after a few trivial
passages we obtain
x(k 1) A BK BK x ( k ) 0
x(k 1) C
I 0 x(k ) I r( k )
xˆ (k 1) LC BK A BK LC xˆ (k ) 0
x( k )
y( k ) C 0 0 x(k )
xˆ (k )
Alternatively, we can consider the estimation error vector as a component of state vector, namely,
we can combine (9.25) and (9.31):
Adding and subtracting the term BKx(k) from the first equation, we obtain after trivial calculations:
9.17 Consider the continuous-time model of the overhead crane proposed in Problem 7.10 with mc=1000
kg, ml=1500 kg and l=8 m. Design a discrete full-order observer state feedback in order to provide
motions of the load without sway.
As in Problem 7.10, we obtain a linearized state-space model of the system about the equilibrium
point x=0 with state variables x1, x3, the first derivative of x1 and the first derivative of x3. Using the
approximations
cos x3 1 , sin x3 x3 , sin 2 x3 0 , x 42 0
gives the following linear state-space model
0 1 0 0 0
x1 (t ) mL x1 (t ) 1
x (t ) 0 0 g 0 x (t ) m
2 mC
2 C u (k )
x 3 (t ) 0 0 0 1 x3 (t ) 0
( m L mC ) g 1
x 4 (t ) 0 0 0 x 4 (t )
m L l
m
Cl
x1 (t ) 0 1 0 x1 (t )
0 0
x (t ) 0
0 14.7 0 x 2 (t ) 1 10 3
2 u (t )
x 3 (t ) 0 0 0 1 x 3 (t ) 0
x 4 (t ) 0 0 2.04 0 x 4 (t ) 0.125 10 3
We examine the possibility of only measuring the state variable x1 (the position of the trolley). This
gives the output equation
x1 (t )
x (t )
y (t ) 1 0 0 0 2
x3 (t )
x 4 (t )
1 0 0 0
0 1 0 0
O
0 0 14.7 0
0 0 0 14.7
Since the observability matrix is evidently full-rank, we can design an observer state feedback by
only measuring the trolley position. The transfer function of the system with one measurement is
1
1 0 0 0 0 1 0 0 0
0 1 0 0 0 0 14.7 0 1 10 3
G ( s ) 1 0 0 0 s
0 0 1 0 0 0 0 1 0
0 3
0 0 1 0 0 2.04 0 0.125 10
s 2 0.2042
0.001
s 2 s 2 2.042
The poles of the system are {0, 0, ±j1.43}. Because of the systems physical limitations, the
controller can only speed up the system to a limited degree and we can use the open-loop dynamics
to select a suitable sampling interval. For a choice of T=0.1, discretizing the system with MATLAB
gives the discrete state-space model
where
1 0 .1 0 .07338 0 .00245
0 4.992 10 6
1 1 .465 0 .07338
A 9.969 10 5
0 0 0 .9898 0 .09966 B 6.239 10 7
5
0 0 0 .2035 0 .9898 1.246 10
C 1 0 0 0
Real closed-loop poles are required to eliminate sway in the step response. Taking the actuator effort
into account, a sensible choice for the closed-loop poles is pc={0.7, 0.75, 0.8, 0.85, 0.9}. The
feedback gain vector is therefore determined with the MATLAB command
>> Ktilde=place(Atilde,Btilde,pc)
as
Next, we choose the eigenvalues of the full-order observer sufficiently faster than the controller
eigenvalues. We select the values po={0.1±j0.1, 0.2±j0.2} and use the MATLAB command
>> L=place(A’,C’,po)’
to obtain
3.3796
32.540
L
13.012
33.477
The closed-loop system state-space equations can be therefore derived as (see Problem 9.16)
x(k 1) A BK BK x ( k ) 0
x(k 1) C
1 0 x(k ) 1 r ( k )
xˆ (k 1) LC BK A BK LC xˆ (k ) 0
x( k )
y ( k ) C 0 0 x(k )
xˆ (k )
The closed-loop unit step response (namely, the motion of the trolley) is plotted in Figure P9.7
Step Response
1.8
1.6
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
-0.2
0 2 4 6 8 10 12 14
Time (sec)
9.18 Consider the continuous-time model of the overhead crane proposed in Problem 7.10 with mc=1000
kg, ml=1500 kg and l=8 m. Design a control system based on pole assignment using transfer
functions in order to provide motions of the load without sway.
s 2 0.2042
G ( s ) 0.001
s 2 s 2 2.042
Discretizing the system with T=0.1 we obtain
6 3 6 2 6 6
G ( s ) 4.992 10 z 4.982 10 z 4.982 10 z 4.992 10
G ZAS ( z ) 1 z 1
Z
s z 4 3.98 z 3 5.959 z 2 3.98 z 1
Thus, we have
We observe that the plant is fourth order i.e. n=4, and the solvability condition of the Diophantine
equation is m = n 1 = 3. The order of the desired closed-loop characteristic polynomial is m+n=7.
We can therefore select the controller poles as pc={0.75, 0.8, 0.85, 0.9} and the observer poles as
{0.1, 0.2±j0.2} with the corresponding polynomials
1 0 0 0 0 0 0 0 d 3 1
3.98 1 0 0 4.992 10 6 0 0 0 d 3 .8
2
5.959 3.98 1 0 4.982 10 6 4.992 10 6 0 0 d 1 5.8475
3.98 5.959 3.98 1 4.982 10 6 4.982 10 6
4.992 10 6 0 d 0 4.6785
1 3.98 5.959 3.969 4.992 10 6 4.982 10 6 4.982 10 6 4.992 10 6 s 3 2.092575
0 1 3.98 5.939 0 4.992 10 6 4.982 10 6 4.982 10 6 s 2 0.53041
0 0 1 3.969 0 0 4.992 10 6 4.982 10 6 s1 0.072966
0 0 0 1 0 0 0 4.992 10 6 s 0 0.003672
dc (1)
k ff 3.6797 10 4
P (1)
The step response (namely, the motion of the trolley) of the control system is shown in Figure P9.8.
Step Response
2
1.5
1
Amplitude
0.5
-0.5
0 1 2 3 4 5 6 7 8 9
Time (sec)
Computer Exercises
9.19 Write a MATLAB script to evaluate the feedback gains using Ackermann’s formula for any pair
(A,B) and any desired poles {λ1,…, λn}.
9.20 Write a MATLAB function that, given the system state-space matrices A, B, and C, the desired
closed-loop poles, and the observer poles, determines the closed-loop system state-space matrices of
a full-observer state feedback system with integral action.
function [Acl,Bcl,Ccl]=closedloop(A,B,C,pc,po);
9.21 Write a MATLAB function that uses the transfer function approach to determine the closed-loop
system transfer function for a given plant transfer function Gz, desired closed-loop system poles,
and observer poles.
function [Gcl]=transfer(Gz,pc,po);
A=[]; % initialization
vs
i
Rs R L
RL
PL i 2 RL v s2
R s R L 2
dPL Rs RL 2 RL 2 Rs R L 2
vs v 0
dRL R s R L 3
Rs RL 3 s
This gives the condition RL = Rs. The second derivative is
d 2 PL Rs RL 3Rs RL 2 v s2
vs 0
dRL2 Rs RL
R s R L 4 R R
s L
Rs RL 3
Note that the power is zero for zero and infinite load and positive otherwise.
Hence, the necessary condition clearly yields a maximum between the two zero
limiting values.
2 J ( x)
P0
x 2
Bx c
1 T
J ( x) x Px q T x r T Bx c
2
J (x)
Px q B T 0
x
J (x)
BT x c 0
x P 1 B T * q
*
Bx * BP 1 B T * q c
* BP 1 B T BP 1q c
1
x * P 1 B T BP 1 B T BP
1 1
qc q
The sufficient condition for a maximum is satisfied since
2 J ( x)
P0
x 2
10.3 Prove that the rectangle of largest area that fits inside a circle of diameter D is a
square of diagonal D.
Consider a rectangle of width W and height H. The largest rectangle must have its
four vertices on the circle and must therefore satisfy
W 2 H 2 D2
L WH W 2 H 2 D 2
The necessary conditions for a maximum are
L
H 2 W 0
W
L
W 2 H 0
H
L
W 2 H 2 D2 0
H W
H W
2W 2 H
10.4 With q =1 and r = 2, S(kf)=1, write the design equations for digital optimal
quadratic regulator for the integrator
x u
x(k 1) x(k ) u (k )
S (k ) AT S (k 1) S (k 1) B B T S (k 1) B R(k )
1
B T S (k 1) A Q(k )
S 2 (k 1)
S (k 1) 1
S (k 1) r
S (k 1)r
1
S (k 1) r
10.5 The discretized state-space model of the Infante AUV of Problem 7.14 is given by
Design a steady-state linear quadratic regulator for the system using the weight
matrices Q = I3 and r = 2.
K=
0.8576 -1.8840 -0.6986
S=
127.3268 -119.0444 5.4625
-119.0444 301.4720 124.3046
5.4625 124.3046 117.5985
E=
0.9676
0.9858
0.9920
10.6 A simplified linearized model of a drug delivery system to maintain blood glucose
and insulin levels at prescribed values is given by1
1
F. Chee, A. V. Savkin, T. L. Fernando, and S. Nahavandi, “Optimal H Insulin Injection Control for
Blood Glucose Regulation in Diabetic Patients,” IEEE Trans. Biomed. Eng. Vol. 52, No. 10, pp. 1625-
1631, 2005.
x1 (k 1) 0.04 4.4 0 x1 (k ) 1 0
x (k 1) 0 0 . 025 1. 3 10 5
( ) 0 0 u1 (k )
2 x 2 k u (k )
x3 (k 1) 0 0.09 0 x3 (k ) 0 0.1 2
x1 (k )
y1 (k ) 1 0 0
y ( k ) 0 0 1 x2 ( k )
2 x (k )
3
where all variables are perturbations from the desired steady-state levels. The
state variables are the blood glucose concentration x1 in mg/dl., the blood insulin
concentration x3 in mg/dl., and a variable describing the accumulation of blood
insulin x2. The controls are the rate of glucose infusion u1 and the rate of insulin
infusion u2, both in mg/dl./min. Discretize the system with a sampling period T =5
min and design a steady-state regulator for the system with weight matrices Q = I3
and R = 2 I2. Simulate the system with the initial state x(0) = [6 0 1]T and plot
the trajectory in the x1-x3 plane as well as the time evolution of the glucose
concentration.
% State-space model
x{1}=[6;0;-1]; % Initial state
A=[-0.04 -04.4 0
0 -0.025 13E-6
0 0.09 0];
B=[1,0
0,0
0,.1 ];
C=[1,0,0;0,0,1];
p=ss(A,B,C,0); % Analog state-space model
T=5; % Sampling period
pd=c2d(p,T); % Discretize with sampling period T
[Ad,Bd,C,D]=ssdata(pd); % Discrete state-space data
[K, S, e] = dlqr(Ad, Bd, Q, R); % Solve lqr
Acl=Ad-Bd*K; % Closed-loop state matrix
pc=ss(Acl,Bd,C,0);
% time=0:T:20*T;
t(1)=0; % Initial time
for i=1:N
t(i+1)=t(i)+T;
x{i+1}=Acl*x{i}-Bd*K*x{i}; % State equation
end
xmat=cell2mat(x); % Change cell to mat to extract data
xx=xmat(1,:); % Glucose concentration
xv=xmat(3,:); % Insulin concentration
hold on
stem(t,xx) % Plot glucose vs. time
hold off
figure
plot(xx,xv)% Plot phase plane trajectory
x1 6
-2
-4
-6 t min
0 10 20 30 40 50 60 70 80 90 100
x3 0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1 x1
-6 -4 -2 0 2 4 6
A x(0) C (k ) u (k )
k
C (k ) B AB Ak 1B
u (k ) colu(k 1),, u(0)
J
k T T
1 f u (k ) R (k ) u (k ) 2 x(0) A Q(k )C (k ) u (k )
T k
2 k 0 x(0) AT k Q(k ) A k x(0) u T (k ) R(k )u(k )
with Q(k f ) S (k f ), R(k f ) 0 mm
(ii) Without the tedious evaluating the matrix Req and the vector l,explain why
it is possible to rewrite the performance measure in the equivalent form
1 T
J eq u (k f ) Req u (k f ) u T (k f )l
2
(iii) Show that the solution of the optimal control problem is given by
u (k f ) Req1l
T
x T ( k ) Q ( k ) x ( k ) A k x ( 0) C ( k ) u ( k ) Q ( k ) A k x ( 0) C ( k ) u ( k )
Q ( k )C ( k ) u ( k )
T k
u T ( k ) C T ( k ) Q ( k ) C ( k ) u ( k ) 2 T x ( 0) A
k
x(0) AT Q(k ) Ak x(0)
T T k
1 u (k ) R (k ) u (k ) 2 x(0) A Q(k )C (k ) u (k )
k f 1 T
2 k 0 x(0) AT k Q(k ) Ak x(0) uT (k ) R(k )u(k )
We define the matrices Q(k f ) S (k f ), R(k f ) 0m m , and rewrite the
performance measure in the form
J
k T T
1 f u (k ) R (k ) u (k ) 2 x(0) A Q(k )C (k ) u (k )
T k
2 k 0 x(0) AT k Q(k ) A k x(0) u T (k ) R (k )u(k )
(ii) We use the expression for the cost obtained in Part (i). Since each vector
u (k ) includes the control inputs u(k), k = 0, 1, k1, all the terms in the
performance measure that involve the control are entries of u (k f ) . The
terms are either quadratic or linear. We expand the quadratic in u (k )
BT
T T
u T ( k ) C T ( k ) Q ( k )C ( k ) u ( k ) u T ( k )
B A
Q(k ) B
AB Ak 1B u (k )
T T k 1
B A
u T (k ) R (k ) u (k )
BT Q(k ) B BT Q(k ) AB BT Q(k ) Ak 1B
BT AT Q(k ) B BT AT Q(k ) Ak 1B
R (k )
T T k 1
B A Q(k ) B
k 1 k 1
BT AT Q(k ) AB BT AT Q(k ) Ak 1B
The matrix can be written more concisely in terms of its ijth term as
R (k ) BT AT i 1
Q(k ) A j 1B
and the quadratic form can be written as
k 1 k 1
u
i 1
T
(i )B T AT Q(k ) A j 1 B u( j )
i 0 j 0
k
x(0) AT Q(k )C (k ) u (k ) x(0) AT B AB A Bu(k )
k k 1
x(0)A A
k 1
T k k i 1
Bu(i)
i 0
Returning to the performance measure, we observe that the quadratic in the
initial conditions can be dropped since it has not relevance to optimization
using the control. The problem is equivalent to minimizing the
performance measure
k 1 k 1 T
A
k 1
1 u (i )B A
i 1 k
kf T T
Q(k ) A j 1B u( j ) 2T x(0) AT k i 1
Bu(i )
J i 0 j 0 i 0
2 k 0 T
u (k ) R(k )u(k )
The quadratic terms can be collected in a quadratic form with weight matrix
Req and the linear terms can be written in terms of a vector l. However, the
exact forms of Req and l are very difficult to evaluate. The quadratic in the
initial conditions can be dropped since it has not relevance to optimization
using the control.
The solution is
u (k f ) Req1l
10.8 For (A,B) stabilizable and (A, Q1/2) detectable, the linear quadratic regulator yields a
closed-loop stable system. To guarantee that the eigenvalues of the closed—loop
system will lie inside a circle of radius 1/, we solve the regulator problem for the
scaled state and control
x ( k ) k x( k ) u (k ) k 1u(k )
(i) Obtain the state equation for the scaled state vector.
(ii) Show that if the scaled closed-loop state matrix with the optimal control
u (k ) K x(k ) has eigenvalues inside the unit circle, then the
eigenvalues of the original state matrix with the control
u(k ) K x(k ), K K , are inside a circle of radius 1/.
(i) From the definition of the scaled state and control we have
x(k 1) k 1x(k 1)
A k x(k ) B k 1u(k ) A x(k ) B u (k )
A A
u (k ) k 1u(k )
x(k 1) k 1x(k 1)
1 A B K k x(k )
A B 1K x(k )
10.9 Repeat Problem 10.5 with a design that guarantees that the eigenvalues of the
closed-loop system are inside a circle of radius equal to one half.
Kbar =
1.0e+005 *
-2.0214 -0.4948 -1.5833
Sbar =
1.0e+012 *
1.6800 0.4095 1.2995
0.4095 0.0998 0.3168
1.2995 0.3168 1.0052
Ebar =
0.5181
0.4978
0.5000
The state feedback and the eigenvalues for the final design are
K=
1.0e+005 *
-1.0107 -0.2474 -0.7916
E=
0.2590
0.2489
0.2500
Unlike the design of Problem 10.5, the eigenvalues meet are all of magnitude less
than half.
10.10 Show that the linear quadratic regulator with cross-product term of the form
k f 1
J x T (k f ) S (k f )x(k f ) x T (k ) Qx(k ) 2x T Nu u T (k ) Ru(k )
k k0
kf 1
J x (kf )S(kf )x(kf ) xT(k)Qx(k)uT(k)RuT(k)
T
kk0
Q QNR1NT
u(k) u(k)R1NTx(k)
k f 1
J x (k f ) S (k f )x(k f ) x T (k ) Qx(k ) 2x T Nu u T (k ) Ru(k )
T
k k0
to show the equivalence for the performance index. We add and subtract
x T (k ) NR 1 N T x(k ) and use the equality x T (k ) N u(k ) u T (k ) N T x(k ) to rewrite
the general term as
x T Q NR 1 N T x x u T Ru 2x T N u x T NR 1 N T x
Q x u R
1 T
xT N T x R u R 1 N T x
xT Q x u T R u
with the argument k dropped for brevity. Substitution gives the equivalent cost
function.
Next, we add and subtract the term R 1 N T x(k ) to the plant state equation
x(k 1) A BR 1 N T x(k ) B u(k ) R 1 N T x(k )
A x( k ) B u ( k ) k k 0 , , k f 1
u(k ) u (k ) R 1 N T
R B T S (k 1) B 1
B T S (k 1) A R 1 N T x(k )
10.11 Rewrite the performance measure of Problem 10.10 in terms of a combined input
and state vector col{x (k), u(k)}. Then use the Hamiltonian to show that for the
linear quadratic regulator with cross-product term a sufficient condition for a
minimum is that the matrix
Q N
N T R
must be positive definite.
k f 1
J x T (k f ) S (k f )x(k f ) x T (k ) Qx(k ) 2x T (k ) Nu(k ) u T (k ) R u(k )
k k0
k f 1
x T (k f ) S (k f )x(k f ) x T (k ) Qx(k ) x T Nu u T (k ) N T x(k ) u T (k ) R u(k )
k k0
k f 1
Q
x ( k f ) S ( k f ) x( k f ) x T ( k ) u T ( k ) T
T
N x( k )
R u(k )
k k0 N
Q N
N T 0
R
Computer Exercise
10.12 Design a steady-state regulator for the Infante AUV of Problem 10.5 with the
performance measure modified to include a cross-product term with
S = [1 0.2 0.1]T
(i) Using the MATLAB command dlqr with the cross-product term.
(ii) Using the MATLAB command dlqr and the equivalent problem with no
cross product as in Problem Problem 10.5.
Kbar =
Sbar =
38.2988 -50.8816 -5.5560
-50.8816 270.3801 130.3031
-5.5560 130.3031 102.0525
Ebar =
0.9768
0.9815
0.9914
K=
0.8438 -1.5137 -0.7002
The command gives the value obtained earlier for the gain K and the eigenvalues
E.
10.13 Design an output quadratic regulator for the Infante UAV of Problem 10.5 with the
weights Qy =1 and r = 100. Plot the output response for the initial condition vector
x(0) = [1, 0, 1]T.
Ky =
0.978745866207956 -2.114628801206936 0
S=
1.0e+004 *
0.358662942722262 -0.769638465049177 0
-0.769638465049177 1.664089378965256 0
0 0 0
E=
1.000000000000000
0.977397502782181
0.986359773355693
K=
0.978745866207956 -2.114628801206936 0
S=
1.0e+004 *
0.358662942722262 -0.769638465049177 0
-0.769638465049177 1.664089378965256 0
0 0 0
E=
1.000000000000000
0.977397502782181
0.986359773355693
Acl =
0.990275507351771 -0.028021489141994 0
0.001799577461391 0.973481768786120 0
0.000044589436535 0.049332044219653 1.000000000000000
The response of the system to the initial conditions x(0) = [1, 0, 1]T is shown in
Figure P10.3.
1
y1
0.9
y2
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.5 1 1.5 2 2.5 3
time
10.14 Design an optimal LQ state-space tracking controller for the drug delivery system
of Problem 10.6 to obtain zero steady-state error due to a unit step input.
0.04 4.4 0 1 0
A 0 5
0.025 1.3 10 B 0 0
0 0.09 0 0 0.1
1 0 0
C
0 0 1
~ 1 0 0 0 0
C C 0
0 0 1 0 0
>> [Ktilde,S,E]=dlqr(Atilde,Btilde,Q,R)
Ktilde =
Columns 1 through 4
Column 5
-0.000000647595529
-0.946762916583234
~ ~ ~~ 0
x (k 1) ( A B K )~
x (k ) r (k )
I l
y (k ) C 0x (k )
~
0.8
0.6
y1
0.4
0.2
0
0 20 40 60 80 100 120 140 160 180 200
time [min]
0.8
0.6
y2
0.4
0.2
0
0 20 40 60 80 100 120 140 160 180 200
time [min]
10.15 Write a MATLAB script that determines the steady-state quadratic regulator for
the inertial system of Example 10-4 for r=1 and different values of Q. Use the
following three matrices and discuss the effect of changing Q on the results of your
computer simulation:
1 0 10 0 100 0
(i) Q (ii) Q (iii) Q
0 1 0 10 0 100
and simulate the closed-loop system state response for the initial condition vector x(0) =
[1, 1]T. Plot the state trajectory and the control variable and evaluate the result.
The response for the cases (i)-(iii) are shown in Figures P10.5-7. The response shows that
a faster transient response is obtained at the expenses of a higher amplitude of the control
variable.
1.5
x1
1
x2
0.5
-0.5
0 1 2 3 4 5 6 7
time
1
u
0
-1
-2
-3
0 1 2 3 4 5 6 7
time
Figure P10.5 State response and control variable for case (i) of Problem 10.15.
2
x1
1 x2
-1
0 1 2 3 4 5 6 7
time
5
u
-5
-10
0 1 2 3 4 5 6 7
time
Figure P10.6 State response and control variable for case (ii) of Problem 10.15.
2
x1
1 x2
-1
0 1 2 3 4 5 6 7
time
10
u
-10
-20
0 1 2 3 4 5 6 7
time
Figure P10.7 State response and control variable for case (iii) of Problem 10.15.
10.16 The linearized analog state-space model of the three tanks system shown in Figure P10.8 can be
written as2
2
D. M. Koenig, Practical Control Engineering, McGraw-Hill, 2009.
x1 (t ) 1 0 0 x1 (t ) 1
x (t ) 1 1 0 x (t ) 0 u (t )
2 2
x 3 (t ) 0 1 1 x3 (t ) 0
x1 (t )
y (t ) 0 0 1 x 2 (t )
x3 (t )
where xi(t) is the level of the ith tank and u(t) is the inlet flow of the first tank. A digital controller is
required to control the fluid levels in the tanks. The controller must provide a fast step response without
excessive overshoot that could lead to fluid overflow. Using the appropriate MATLAB commands, design
a digital LQ tracking controller for the system then simulate the closed-loop dynamics using SIMULINK.
simulate the closed-loop system using SIMULINK. Use a sampling period of 0.1 s, a state-weighting
matrix Q=0.1 I4, and an input-weighting matrix R=1.
x1
x2
x3
Solution
x1 (k 1) 0.9048 0 0 x1 (k ) 0.09516
x (k 1) 0.09048 0.9048 0 x 2 (k ) 0.004679 u (k )
2
x3 (k 1) 0.004524 0.09048 0.9048 x3 (k ) 0.0001547
x1 (k )
y(k ) 0 0 1 x2 (k )
x3 (k )
Integral control can be introduced by considering the augmented system of (10.55) and by applying the
following commands:
>> A1=sysd.a;
>> B1=sysd.b;
>> C1=sysd.c;
>> D1=sysd.d;
>> Atilde=[A1 zeros(3,1); -C1 1];
>> Btilde=[B1; 0];
>> Ctilde=[C1 0];
We obtain
0.904837418035960 0 0 0
0.090483741803596 0.904837418035960 0 0
~
A
0.004524187090180 0.090483741803596 0.904837418035960 0
0 0 -1 1
0.095162581964040
~ 0.004678840160444
B
0.000154653070265
0
~
C 0 0 1 0
The state feedback gain matrix is determined using the MATLAB command dlqr:
>> Q=0.01*eye(4);
>> R=1;
>> [Ktilde,S,E]=dlqr(Atilde,Btilde,Q,R);
>> K=-Ktilde(1:3);
>> Kbar=-Ktilde(4);
We simulate the system using SIMULINK to obtain the closed-loop step response of Figure P10.9. For
simplicity, we assume that all state variables are measurable and can be used for state feedback without the
need for an observer. The resulting state trajectories are shown in Figure P10.10 while the control variable
is shown in Figure P10.11.
1.2
x1
x2
0.8
x3
State Variables
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10
Time s
Figure P10.10 State variables resulting for a step reference input and Q=0.1I4.
1
0.8
Control Variable
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10
Time s
Figure P10.11 Control variable for a step reference input and Q=0.1I4.
Q=1*eye(4);
we obtain the faster response shown in Figure P10.12 with the larger control peak of Figure P10.13. In
addition to the larger control cost, the faster response comes with a large overshoot that can yield an
overflow of the fluid in the tanks.
1.8
x1
1.6
1.4
x2
1.2
State Variables
x3
1
0.8
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10
Time s
Figure P10.12 State variables resulting for a step reference input and Q=I4.
3.5
2.5
Control Variable
1.5
0.5
0
0 1 2 3 4 5 6 7 8 9 10
Time s
Figure P10.13 Control variable resulting for a step reference input and Q=I4.
10.17. xxx
Chapter 11 Solutions
x2 0 1 3 1
B1 x 1 B2 A
0 x22 0 1 2
We integrate to obtain
x 1
hx 11
x2
w 1 3 1 w1 1
w 1 2 w 0u (k )
2 2
to obtain
x1 1 / w1 x2 1 / w2
1 Iz Iy I Iy sin( 2 )
sin( 2 ) mgA cos( ) 2 z
2 I x I
x
I z
I y
I z I y cos(2 )
Tp
1
I z I y I z I y cos(2 )
Ty
where Ix, Iy, Iz are the moments of inertia about the center of gravity
m is the total mass of the system
g is the acceleration due to gravity
and are the pitch and yaw angles in radians
Tpand Ty are the pitch and yaw input torques.
Obtain an equivalent linear discrete-time model for the system and derive the equations for the
torque in terms of the linear system inputs.
x1 x 2
x 2 u1
x 3 u 2
x1 (k 1) 1 T 0 T 2 2
x (k 1) 0 1
2 0 T u (k )
x3 (k 1) 0 0 1 T
I I I I cos(2 x (k ))
I u (k ) I
1 1
Tp I y u 2 (k ) sin(2 x1 (k )) mgA cos( x1 (k ))
z y z y
2I I sin(2 x (k )) x (k )u (k )
x 1 z
z y 1 2 2
2
Ty (k ) I I I I cos(2 x (k ))u (k )
z y z y 1 2
11.3 A single-link manipulator with a flexible link has the equation of motion2
where
1
A. L. Elshafei and F. Karray, “Variable structure based fuzzy logic identification of a class of nonlinear
systems”, IEEE Trans. Control Systems Tech., Vol. 13, No. 4, July 2005, pp. 646-653.
2
M. W. Spong and M. Vidyasagar, Robot Dynamics and Control”, J. Wiley, NY, 1989, pp. 269-273.
L is the distance from the shaft to the center of gravity of the link
M is the mass of the link
I is the moment of inertia of the link
J is the moment of inertia of the joint
K is the rotational spring constant for the flexible joint
L is the distance between the center of gravity of the link and the flexible joint.
and are the link and joint rotational angles in radians
is the applied torque
x 1 x 2
0
x 2 u (t )
1
where x1 x11 x12 , x1 x21
T T T
x22
T
. The equivalent discrete
model is
x1 (k ) I 2 T I 2 x1 (k ) 031
x (k ) 0 x (k ) T u (k )
2 I 2 2
(k ) Ju (k ) k x11 (k ) x12 (k )
M c.g.
L
k
,
Figure 11.1 Schematic of single
u k e k .
z 2
2 z 1.25 X z
z
z 12
yields X(z) as
z z
X z
z
2
z 1 z 1 0.5
2 2
4
z 1 0.5
2 2
z 12
x1 (k 1) x1 (k ) 9 2 x 22 (k ) 0
x (k 1) u (k )
x 2 (k ) 9 0.4 x1 (k ) x1 (k )
2
2
x e 0.165 1.624
T
x e 0.482 0.517
T
11.6 Use the Lyapunov approach to show that if the function f(x) is a contraction then the
system x(k+1) = f(x(k)) is exponentially stable.
2
V (x(k )) x T (k )x(k ) x(k )
11.7 Obtain a general expression for the eigenvalues of a 2 by 2 matrix and use it to
characterize the equilibrium points of the second-order system with the given state matrix
0.9997 0.0098 3 1
(i) 0.0585 0.9509 (ii) 1 2
0.3 0.1 1.2 0.4
(iii) 0.1 0.2 (iv) 0.4 0.8
(i) The eigenvalues of the matrix are {0.9802, 0.9704}, which are positive and less than
unity. The equilibrium is a stable node.
(ii) The eigenvalues of the matrix are {1.382, 3.618}}, which are positive and greater than
unity. The equilibrium is an unstable node.
(iii) The eigenvalues of the matrix are {0.25 j 0.0.0866}, which are complex conjugate with
positive real part and magnitude 0.2646 less than unity. The equilibrium is a stable focus.
(iv) The eigenvalues of the matrix are {1 j 0.0.3464}, which are complex conjugate with
positive real part and magnitude 1.0583 greater than unity. The equilibrium is an
unstable focus.
11.8 Determine the stability of the origin using the linear approximation for the system
x1 k 1 0.2 x1 (k ) 1.1x23 (k )
x2 (k 1) x1 (k ) 0.1x2 (k ) 2 x1 (k ) x22 (k ), k 0,1,2,
x1 k 1 0.2 0 x1 k 1.1x23 (k )
x (k 1) 2 , k 0,1,2,
2 1 0.1 x2 (k ) 2 x1 (k ) x2 (k )
The state matrix A of the linear approximation has one eigenvalue = 2 >1. Hence the
origin is an unstable equilibrium of the nonlinear system.
11.9 Verify the stability of the origin using the Lyapunov approach and estimate the rate of
convergence to the equilibrium
The system has an equilibrium point at the origin. We select the quadratic Lyapunov
function
The difference remains negative provided that the term between braces is negative. If we
select p1=15, we have
V (k ) 15 x12 (k )
0.4 x12 (k ) 0.15 x2 (k ) 0.05 x22 (k ) x1 (k ) 0.0375 x22 (k ) 0.0025 x24 1 x22 (k )
11.4 x (k ) 0.46 0.9 x1 (k )x (k )
2
1
2
2
Note that different values of p1 give different estimates of the stable domain of the
equilibrium point. For example, choosing p1 = 1 would lead us to restrict the magnitudes
of x1(0) and x2(0) to less than 2 for a negative difference.
We can obtain the rate of convergence for the weighted vector norm as
2 2
x(k ) 0.81k x(0)
x(k ) 0.09 k x(0)
2
x(k ) 15 x12 (k ) x22 (k )
-1
-2
-3
-4
-5
-6
2
1 2
1
0
0
-1
-1
-2 -2
we can express the state vector in terms of the error and the nominal state vector as
xk ek x* k
We obtain the error dynamics by subtracting the nominal state vector from the state
equation
ek 1 xk 1 x* k 1 f ek x* k x* k
If the error converges to zero, i.e. if they are asymptotically stable, then the system
trajectories will converge to the nominal trajectory.
x(k 1) ax 3 (k )
V x(k ) x 2 (k )
V x(k ) a 2 x 6 (k ) x 2 (k )
x 2 (k ) 1 a 2 x 4 (k )
is negative definite in the region x(k ) 1 a . Hence, the system is locally
asymptotically stable in the region.
11.12 Use Lyapunov stability theory to investigate the stability of the system
ax1 (k )
x1 (k 1)
a bx22 (k )
bx2 (k )
x2 (k 1) , a 0, b 0
b ax12 (k )
The system has an equilibrium point at the origin. We select the quadratic Lyapunov
function
V ( x) x T x
11.13 Use the Lyapunov approach to determine the stability of the discrete-time linear time-
invariant systems
0 .3 0 .1 0
0.3 0.1 0.1 0.22 0.2
(i) 0.1 0.22 (ii)
0.4 0.2 0.1
We use the Lyapunov equation
AdT PAd P I n
1.1099 0.0105
P
0.0105 1.0630
V (k ) 0.3929 x12 (k ) 0.0041x24 (k ) 0.15 x1 (k ) 1.25 2 x 22 (k )
0.3929 x (k ) 0.0041x (k ),
2
1
4
2 k 0,1,2,
The inequality follows from the fact that the last term in V is positive semidefinite. We
conclude that V is positive definite since it is greater than the sum of even powers and
that the equilibrium at x = 0 is unstable.
1.31 0.1996
P
0.1996 1.4107
The largest eigenvalue of P is equal to 1.5662. The norm PA is 0.8844 and our
estimate of the domain of attraction is
B ( x ) x : x
1 0.8844
0.88442 0.36
0.36 1.5662
x : x 0.3269
Computer simulation shows that the estimate of the domain of attraction is quite
conservative and that the system is stable well outside the estimated region.
2.5
1.5
0.5
-0.5
-1
-1.5
-2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3
Figure P2. Phase portrait for the nonlinear system of Problem 11.15.
0.5268x (k ) 0.267x (k ) x (k )
2
2 1 2 0.6823 x22 (k ) 0.4447x1 (k ) x2 (k ) x( k )
1.2377 x24 (k ) 0.6348 x23 (k ) 0.4447x1 (k ) x2 (k ) 0.6348 x1 (k ) x24 (k ) 1.4301x12 (k )
Computer Exercises
11.17 Write a MATLAB program to generate phase plane plots for a discrete-time second order
linear time-invariant system. The function should accept the eigenvalues of the state
matrix and the initial conditions needed to generate the plots
11.18 Design a controller for the nonlinear mechanical system of Example 11.15 with the
nonlinear damping b( x ) 0.25 x 5 , the nonlinear spring c( x) 0.5 x 0.02 x 3 , T
=0.02 s, and the desired eigenvalues for the linear design equal to 0.2 j 0.1 .
Determine the value of the reference input for a steady state position of unity and
simulate the system using SIMULINK.
Using the MATLAB command place¸ we obtain the feedback gain matrix
k T 1625 63.8
f u b( x 2 ) c( x1 )
u ( k ) r ( k ) k T x( k )
The simulation diagram for the system is shown in Figure P.3 and the simulation
diagram for the controller block in Figure P.4. We select the amplitude of the step
input to obtain a steady state value of unity using the equilibrium condition
1 0.02 2 104 1
x(k 1) x( k ) r 1625 63.8x(k ) x(k )
0 1 0.02 0
This simplifies to
2 10 4 0.41
r
0.02 41
which gives the amplitude r = 2050. The step response for the nonlinear system
with digital control of Figure P.5 shows a fast response to a step input at t = 0.2 s
that quickly settles to the desired steady state value of unity. Figure P.6 shows a
plot of the velocity for the same input.
r
Step x1 Out 1
1 1
s s
Zero -Order x2
Hold Subtract 2 x2 x1 x1 data
Subsystem
x2 data
Zero -Order
Hold 1
Polynomial 1
P(u)
O(P) = 5
P(u)
O(P) = 3
Polynomial 2
Subtract 2
-K-
Gain
1
r
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Figure P.5 Step response for the linear design of Problem 11.18
10
-2
-4
-6
-8
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Figure P.6 Velocity plot for the step response for the linear design of Problem 11.18
11.19 Design a stabilizing digital controller with a sampling period T = 0.01 s for a
single-link manipulator using extended linearization then simulate the system
with your design. The equation of motion of the manipulator is given by
Hint: Use SIMULINK for your simulation and use a ZOH block, or a Discrete Filter block with
both the numerator and denominator set to 1 for sampling.
x1 x 2
x 2 0.01 sin( x1 ) 0.01 x1 0.001 x13 u (t )
> place(ad,bd,.6*[1+.5*j,1-.5*j])
ans =
1.0e+003 *
2.5000 0.0675
u (k ) 2500 x1 (k ) 67.5 x2 (k )
(k ) u (k ) 0.01sin( x1 (k )) 0.01x1 (k ) 0.001x13 (k )
1 sin(2*pi*u)
s -K-
1
Integrator Gain 1/2pi s
Sine Scope
P(u) Integrator 1
Add
O(P) = 2
Scope 1 Polynomial 1
-K-
1
Gain x 2
Sample /Hold 1
1
1 -K-
Gain x 1
Sample /Hold
-K- sin(2*pi*u)
Gain 1/2pi1
Sine 1
P(u)
O(P) = 2
Polynomial 1
1.2
0.8
0.6
0.4
0.2
-0.2
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
Figure P11.8 Time response for of the single-link manipulator with = 1 rad.
5
-5
-10
-15
-20
-25
-30
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
Figure p11.9 Time response for of the single-link manipulator with = 1 rad.
Chapter 12 Problem Solutions
12.1 Write pseudocode that implements the following controller
U ( z ) 2.01z 1.99
C ( z)
E ( z) z 1
u (k ) u (k 1) 2.01e(k ) 1.99e(k 1)
function controller
% This function must be executed for each sampling period
% r is the value of the reference signal
% u1 and e1 are the values of the control variable and of the tracking
% error, respectively, at the previous sampling instant
y=read_ADC(ch0) % Read the process output value from ADC channel 0
e=r-y; % Compute the new tracking error
u=u1+2.01*e-1.99*e1; % Compute the new control variable
u1=u; % Save the control variable for the next sampling period
e1=e; % Save the tracking error for the next sampling period
write_DAC(ch0,u); % Write the control variable to DAC channel 0
12.2 Rewrite the pseudocode for the controller of Problem 12.1 to decrease the execution time by
assigning priorities to computational tasks.
In order to decrease the execution time, two tasks can be implemented with different priorities.
Task 2
u1=u; % Save the previous control value for the next sampling period
e1=e; % Save the previous tracking error for the next sampling period
1
G (s)
s ( s 10)
s 0.5
C ( s ) 50
s
Select an appropriate sampling frequency and discretize the controller.
50 s 25
Gcl ( s )
s 10 s 2 50s 25
3
and its bandwidth can be easily determined using the MATLAB commands
Transfer function:
50 s + 25
------------------------
s^3 + 10 s^2 + 50 s + 25
>> bandwidth(g)
ans =
7.4005
i.e. ωb=7.4 rad/s. A suitable first-order antialiasing filter has a bandwidth of 50 rad/s and the transfer
function
1
F ( s)
0.02s 1
We compute the phase shift introduced by the antialiasing filter at ωb using the MATLAB commands
mag =
0.9892
ph =
-8.4187
The phase shift of about 8.42 is not very significant. The sampling frequency can therefore be
chosen as 314 rad/s. This is more than 6 times the bandwidth of the antialiasing filter and much larger
than the bandwidth of the closed-loop system. The corresponding sampling interval is T 0.02 s.
Bilinear transformation gives the digital controller transfer function
50.25 z 49.75
C ( z)
z 1
12.4 Determine the mean and variance values of the quantization noise when a 12-bit ADC is used to
sample a variable in a range 0-10 V for (i) rounding, and (ii) truncation.
e 0
2
q 2 10 1
2
e
12 2 12 12
(ii) Since the value of q is the same as in (i), we have
q 1 10
e
2 2 212
2
q 2 10 1
2
e
12 212 12
12.5 For the system and the controller of Problem 12.3 with a sampling period T=0.02 s, determine the
decrease in the phase margin due to the presence of the ZOH.
We determine the gain crossover frequency of the system of Problem 12.3 by solving the equation
C ( j c )G ( j c ) 1
Squaring the equation gives
Whose only feasible solution is ωc=4.574 rad/s. The decrease in the phase margin due to the ZOH is
therefore
T 180
c 2.62
2
12.6 Consider an oven control system [4] with transfer function
1.1
G ( s) e 25 s
1300s 1
and a PI controller
200s 1
C ( s ) 13
200s
Let both the actuator and the sensor signals be in the range 0-5 V and let 1 Celsius of the temperature
variable corresponds to 0.02 V. Design the hardware and software architecture of the digital control
system.
The critical frequency of the analog control system is ωc=0.012 rad/s and the phase margin is
φm=53.9. Thus, a possible choice is to select a sampling period T=1 s and to employ a second-order
Butterworth antialiasing filter with cut-off frequency 0.2 rad/s. The filter transfer function is,
0.04
F ( s)
s 0.283s 0.04
2
The antialiasing filter does not change the crossover frequency, nor the phase margin (which is
reduced to φm=49.0), significantly. However, the antialiasing filter decreases the magnitude of the
noise at the Nyquist frequency of π/T=3.14 rad/s of 47.8 dB. The phase delay introduced by the
zero-order hold is ωcT/2ꞏ180/ π = 0.34, which is negligible. A 12-bit ADC can be chosen with a
quantization level of 1.2 mV, which corresponds a quantization error in the temperature of 0.06.
We also choose a 12-bit DAC. Its conversion time is in the order of microseconds and does not
influence the overall design.
12.7 Write the difference equations for the controller in (i) direct form, (ii) parallel form, and (iii) cascade
form.
( z 0.9879)( z 0.9856)
C ( z ) 50
( z 1)( z 0.45)
U ( z ) 50 z 2 98.68 z 48.68
C ( z)
E( z) z 2 1.45 z 0.45
(ii) To obtain the controller in parallel form, we use the partial fraction expansion
U ( z ) 0.0158 26.191
C ( z) 50
E( z) z 1 z 0.45
u1 (k ) u (k 1) 0.0158e(k 1)
u 2 (k ) 0.45u (k 1) 26.191e(k 1)
u 3 (k ) 50e(k )
u (k ) u1 (k ) u 2 (k ) u 3 (k )
12.8 For the PID controller that results by applying the Ziegler-Nichols tuning rules to the process
1
G(s) e 2 s
8s 1
determine the discretized PID controller transfer functions (12.11) and (12.12) with N=10 and T=0.1.
The process transfer function G(s) has a gain K = 1, a time constant τ = 8. and a dead time L = 2.
Using Table 5.1 we calculate Kp=4.8, Ti=4 and Td=1. Thus, we have
Td T Td NTd
K 0 K p 26.34
NT Td Ti NT Td NT Td
Td T NTd
K 1 K p 1 2 55.08
NT Td Ti NT Td
NTd
K 2 K p 1 28.80
NT Td
Td
0 .5
NT Td
12.9 Design a bumpless manual/automatic mode scheme for the PID controller (T=0.1)
From the expression of the PID controller (12.11) we compute K0=241.6, K1=493.4, K2=252, and
γ=0.13. The block diagram for the bumpless manual/automatic transfer is that of Figure 12.10 where
K=K2=252 and
( K 1 K K ) z K 0 K 0.8279 z 0.8287
D( z ) 2
K 2 z K1 z K 0
2
z 1.958 z 0.9587
12.10 Design a bumpless manual/automatic mode scheme for the controller obtained in Example 6.18
12.11
1.422( z 0.8187)( z 0.9802)( z 1)
C ( z)
( z 1)( z 0.9293)( z 0.96)
The block diagram for the bumpless manual/automatic transfer is that of Figure 12.10 where
C ( z) K
D( z )
C ( z)
To avoid an algebraic loop, we ensure that the numerator of D(z) must is second order with a third
order denominator by selecting K=1.422. Then, we have the transfer function
12.12 Determine the digital PID controller (with T=0.1) in incremental form for the analog PID controller
1
C ( s ) 31 2s
8s
From the expression of the analog PID controller it is easy to determine the value of the parameters
as Kp=3, Ti=8, and Td=2. By applying (12.18)-(12.20) we have therefore
T T
K 2 K p 1 d 63.04
Ti T
2T
K 1 K p 1 d 123
T
Td
K0 K p 60
T
and the corresponding z-transform transfer function is
63.04 z 2 123 z 60
C ( z)
z ( z 1)
Computer Exercises
12.13 Write a MATLAB script and design a SIMULINK diagram that implements the solution of problem
12.8 with different filter parameter values N and discuss the set-point step responses obtained by
considering the effect of measurement noise on the process output.
A script that solves the problem is the following:
Gs=tf(1,[8 1],'inputdelay',2); % process transfer function
Kp=4.8; % PID parameters
Ti=4;
Td=1;
T=0.1; % sampling interval
z=tf('z',T);
for N=5:5:20, % different values of N
% digital PID parameters
K0=Kp*(Td/(N*T+Td)-T/Ti*Td/(N*T+Td)+N*Td/(N*T+Td));
K1=-Kp*(1+Td/(N*T+Td)-T/Ti+2*N*Td/(N*T+Td));
K2=Kp*(1+N*Td/(N*T+Td));
gam=Td/(N*T+Td);
Cz=(K2*z^2+K1*z+K0)/(z-1)/(z-gam); % digital PID
transfer
% function
[t,x,y]=sim('Problem12_12',50); % simulations with
% SIMULINK
figure % plot of the step
responses
subplot(2,1,1);
plot(t,y(:,1),'k-');
title(['process output N=',num2str(N)]);
subplot(2,1,2);
plot(t,y(:,2),'k-');
title('control variable');
axis([0 50 -10 40])
end
The SIMULINK diagram for the simulation of the closed-loop system is shown in Figure P12.1.
By setting the Uniform Random Number between 0.1 and 0.1, we obtain the step responses shown in
Figure P12.2. It appears that the noise effect increases, as expected, by increasing the value of N. The
detrimental effect of the noise on the actuator is more relevant, as it can damage the actuator itself.
1.5 1.5
1 1
0.5 0.5
0 0
0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50
30 30
20 20
10 10
0 0
-10 -10
0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50
1.5 1.5
1 1
0.5 0.5
0 0
0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50
30 30
20 20
10 10
0 0
-10 -10
0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50
K pT k
u ( k ) K p e( k )
Ti
e(i)
i 0
and this can be implemented by the SIMULINK diagram shown in Figure P12.3. The step response is
shown in Figure P12.4 where the windup effect appears clearly.
Figure P12.3 SIMULINK block diagram for Problem 12.14 (i)
0.8
process output
0.6
0.4
0.2
0
0 10 20 30 40 50 60 70 80 90 100
time
(ii) The conditional integration method consists of freezing the integral action when the actuator saturates
and when the control variable and the control error have the same sign (namely, it is u×e>0). The
SIMULINK implementation of this scheme is shown in Figure P12.5 where the error to be integrated is
set to zero when the condition is true.
Figure P12.5 SIMULINK block diagram for Problem 12.14 (ii)
0.8
process output
0.6
0.4
0.2
0
0 10 20 30 40 50 60 70 80 90 100
time
(iii) The back-calculation strategy is implemented by considering the SIMULINK diagram of Figure P12.7 where
Tt=Ti=8. The step response is shown in Figure P12.8.
Figure P12.7 SIMULINK block diagram for Problem 12.14 (iii)
(iv) The PI controller in incremental form can be determined by using (12.8)-(12.9) with Td=0. We obtain
T
K 2 K p 1 3.0375
Ti
K 1 K p 3
K 2 z K 1 3.0375 z 3
C ( z)
z 1 z 1
0.8
process output
0.6
0.4
0.2
0
0 10 20 30 40 50 60 70 80 90 100
time
The controller can be implemented by using the SIMULINK block diagram of Figure P12.9 where the
employed MATLAB function is
function u=incrementalPI(input_parameters);
0.8
process output
0.6
0.4
0.2
0
0 10 20 30 40 50 60 70 80 90 100
time
The scheme for the bumpless transfer between automatic and manual mode is that of Figure 12.10,
where in this case we have (see Problem 12.14)
K 2 z K 1 3.0375 z 3
C ( z)
z 1 z 1
We obtain the filter transfer function
C ( z ) K K 2 K z K 1 K
D( z )
C ( z) K 2 z K1
To avoid an algebraic loop, we set K=K2 and the filter transfer function reduces to
K1 K 3 3.0375
D( z )
K 2 z K 1 3.0375 z 3
The SIMULINK diagram that simulates the bumpless control scheme is shown in Figure P12.11,
while the obtained step response is shown in Figure P12.12. The scheme for (bumpy)
manual/automatic transfer is shown in Figure P12.13 and the corresponding step response is shown in
Figure P12.14, where the bump in the process output is evident.
Figure P12.11 SIMULINK block diagram for Problem 12.15 (bumpless transfer)
1
0.8
0.4
0.2
0
0 10 20 30 40 50 60 70 80 90 100
time
Figure P12.13 SIMULINK block diagram for Problem 12.15 (bumpy transfer)
2
1.8
1.6
1.4
1.2
process output
1
0.8
0.6
0.4
0.2
0
0 10 20 30 40 50 60 70 80 90 100
time
12.16 Design and simulate a dual-rate inferential control scheme with T=0.01 and λ=4 for the plant
1
G(s)
( s 1)( s 5)
s 1
C ( s ) 25 .
s
Apply then the controller to the process
~ 1
G ( s)
( s 1)( s 5)(0.1s 1)
z 0.9802
G ZAS ( z ) 4.9013 10 5
z 0.99z 0.9512
Then, the controller transfer function is obtained, by applying the bilinear transformation with
T=0.01, as
25.13 z 24.88
C ( z)
z 1
The control scheme of Figure 12.23 is implemented in SIMULINK as in Figure P12.15, where the
lower part is necessary in order to cope with numerical inaccuracies. The resulting step response is
~
shown in Figure P12.16. If G ( s ) is used instead of G(s), the step response is shown in Figure
P12.17. It can be seen that the overshoot is larger. Thus, in general, the robustness of the controller
must be considered when a dual-rate inferential control scheme is employed.
1.4
1.2
1
process output
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
time
1.2
process output
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
time
~
Figure P12.17 Step response for Problem 12.16 with G ( s )
12.17 Consider the analog process and the analog PI controller of Problem 12.15. Write a MATLAB script
that simulates the step response with a digital controller when the sampling period switches at time
t=0.52 from T=0.04 to T=0.01.\
By considering the technique described in Section 12.5, a MATLAB script that solves the problem
is the following one.
1.5
process output
0.5
0
0 0.5 1 1.5 2 2.5 3
time
30
control variable
20
10
0
0 0.5 1 1.5 2 2.5 3
time
12.18 Consider the analog process and the analog PI controller of Problem 12.15. Write a MATLAB script
that simulates the step response with a digital controller when the sampling period switches at time
t=0.52 from T=0.01 to T=0.04.
By considering the technique described in Section 12.5, a MATLAB script that solves the problem is the
following one.
1.5
process output
0.5
0
0 0.5 1 1.5 2 2.5 3
time
30
control variable
20
10
0
0 0.5 1 1.5 2 2.5 3
time
Figure P12.19 Step response for Problem 12.18