0% found this document useful (0 votes)
2 views

Rt Exercises

The document contains exercises related to control systems and MATLAB, including Laplace transforms, differential equations, and dynamic systems. It provides hints, answers, and solutions for various mathematical problems and system modeling tasks. Additionally, it includes a glossary of terms in Swedish and English, along with an introduction to MATLAB and the Control System Toolbox.

Uploaded by

yasser bouzid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Rt Exercises

The document contains exercises related to control systems and MATLAB, including Laplace transforms, differential equations, and dynamic systems. It provides hints, answers, and solutions for various mathematical problems and system modeling tasks. Additionally, it includes a glossary of terms in Swedish and English, along with an introduction to MATLAB and the Control System Toolbox.

Uploaded by

yasser bouzid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 173

Reglerteknik: Exercises

• Exercises, Hints, Answers, Solutions


• Liten reglerteknisk ordlista (SV-ENG och ENG-SV)
• Introduktion till MATLAB och Control System Toolbox

This version: 2021-08-12

LERTEKNIK
REG

AU L
T O MA RO
TI C C O N T

LINKÖPING
Exercises
This version: 2021-08-12
1 Mathematics
1.1 Determine the Laplace transform of the following signals. a)
1
F (s) =
(
0, t < 0 s2 +s
a) A step-function, u(t) = , where A is a constant.
A, t ≥ 0
( b)
0, t<0 1
b) A ramp-function u(t) = , where A is a constant. F (s) =
At, t ≥ 0 s2 −1
c) u(t) = e−2t for t ≥ 0. c)
d) u(t) = cos 5t for t ≥ 0. 1
F (s) =
(s + 1)2
Express the following in terms of U (s), the Laplace transform of u(t).
Hint Answer Solution
e) u̇(t)
f) u̇(t), when u(t) = 0 for t ≤ 0. 1.4 Below, differential equations that describe dynamic systems are given together
g) ü(t) with system inputs and initial conditions. Use the Laplace transform to de-
h) ü(t), when u(t) = u̇(t) = 0 for t ≤ 0. termine the solution y(t).
i) u(t − T ) a)
d2 y(t) dy(t)
Hint Answer Solution
2
+3 + 2y(t) = u(t)
dt dt (
1.2 Consider the differential equation 0, t < 0
u(t) =
1, t ≥ 0
ẏ(t) + 2y(t) = u(t)
dy(0)
= y(0) = 0
a) If u(t) is constant and y(t) converges to a constant value, then ẏ(t) ≈ 0 dt
when time goes to infinity. What value will y(t) approach as t → ∞ if
b)
u(t) = 5?
ẏ(t) + y(t) = u(t)
b) Determine the .transfer . . . . . . . . . relating U (s) and Y (s) for the differential
. . . . . . . . function
equation above. Assume y(0) = 0. u(t) = 1 + sin t
y(0) = 0
c) Solve the problem in (a) using the .final
. . . . .value . . . . . . . . and the result in
. . . . . .theorem
(b). Hint Answer Solution
Hint Answer Solution
1.5 The water level, y(t), in a tank with an outlet hole is modelled by the differ-
1.3 What are the time functions corresponding to the Laplace transforms below? ential equation
What values will the time functions approach as time goes to infinity? ẏ(t) + y(t) = z(t)

1
where z(t) denotes the inflow. The inflow is a function of a valve . . . . . position,
which in turn is controlled by the electric control signal u(t). The relation
between control signal and resulting inflow is given by the differential equation
z̈(t) + ż(t) + z(t) = u(t)
What differential equation relates the water level y(t) to the control signal
u(t)? You can assume all initial conditions to be 0.
Hint Answer Solution

1.6 Verify that a quadratic s2 + as + b has roots with negative real part if and only
if a > 0 and b > 0
Hint Answer Solution

1.7 Write the following complex numbers in polar form, that is, determine their
absolute value and argument
. . . . . . . . . (angle). Draw the points in the complex plane
and indicate the geometric meaning of the absolute value and .argument.
.........
a) 1 + i
1+i
b) 5i(1+ √
3i)

Write the following complex numbers on rectangular form, and draw the points
in the complex plane and indicate the geometric meaning of the absolute value
and argument.
..........
c) 2ei 3
π

d) 5e−iπ
Hint Answer Solution

1.8 A system has gain 100. What is the gain expressed in decibel (dB20 )? What is
the gain corresponding to 20 dB20 , −3 dB20 , 0 dB20 , −10 dB20 , and 10 dB20
respectively?
Hint Answer Solution

1.9 Verify that the following rule for inversion of 2 × 2 matrices holds.
1
   
a11 a12 a22 −a12
A= ⇒ A−1 =
a21 a22 a11 a22 − a12 a21 −a21 a11
Hint Answer Solution

2
2 Dynamic Systems
Ra La r e u y
i
+ Σ K Amp Motor

Figure 2.2a
u v θ
J, f
Hint Answer Solution
Lo
ad
2.2 A servo system for positioning of a tool in a tooling machine is depicted in
Figure 2.2a. In Figure 2.2b, the poles (there are three of them) of the closed
Figure 2.1a
loop system are plotted as a function of K , and locations are indicated for
K = 0.1, K = 0.5, K = 2.5, K = 3.0. Find (without calculations), for each
2.1 A common component in a control system is a DC-motor,
. . . . . . . . . . schematically de- of the step . . . . . . . . . . in Figure 2.2c, the corresponding value of K used when
. . . . .responses
picted in Figure 2.1a. The motor is characterized by a number of physical generating the step . . . . .response.
.........
relationships as will now be explained. The rotating axis is described by
Im
J θ̈(t) = −f θ̇(t) + M (t),

where θ(t) is the angle of rotation, M (t) is the applied .torque, . . . . . . J is the
moment of inertia
................... of the load and f is a friction coefficient. K = 2.5 K = 3.0
Kirchhoff’s voltage K = 0.5
. . . . . . . law states that
K = 3.0 K = 0.5
di(t) K = 0.1 K = 0.1
u(t) − Ra i(t) − La −v =0
dt Re
K = 2.5 K = 0.5
The interplay between rotor and stator in the motor is given by
K = 0.1
M (t) = ka i(t) and v(t) = kv θ̇(t) K = 2.5 K = 3.0

where i(t) is the current,


. . . . . . . . ka a proportional constant characteristic for the
motor, v(t) is voltage
. . . . . . . generated by the rotating axis and kv is a proportional
constant. The input voltage . . . . . . . u(t) is the control signal and θ(t) is the output.
Figure 2.2b
a) Use the equations above to write a differential equation that relates u(t)
and θ(t). The inductance La can be neglected and set to 0. Hint Answer Solution
b) Determine the transfer . . . . . . . . of the system from u(t) to θ(t).
. . . . . . . . .function
c) Study the behavior of the system by calculating θ(t) when u(t) is a step.

3
a unit . . . . on the screw position will make an appropriately sized input for
. . . . . step
identification purposes, and that is the input used in the experiment for which
1 1
the resulting thickness profile d1 (t) is shown in Figure 2.3b.
0 0
a) Find the transfer . . . . . . . . from the position of the screw to the thickness
. . . . . . . . .function
Step 1 Step 2 d1 , i.e., identify the parameters β and T .
b) In production the thickness cannot be measured directly behind the
rollers for practical reasons, and instead the thickness d2 (t) is measured L
length units after the rollers. Find the transfer . . . . . . . . from the position
. . . . . . . . .function
1 1
of the screws to the thickness d2 . The sheet moves with speed V .
0 0
12
Step 3 Step 4 10
8
Figure 2.2c. All comparable axes have equal scaling.

d1
6
4
Screw
2
u 0
0 4 8 12 16 20
Roller t [s]

Figure 2.3b
d1 d2 Plate

L Hint Answer Solution

2.4 The step . . . . . . . . . of the following system


. . . . .response
Figure 2.3a 1
G(s) =
s2 + s + 1
2.3 Consider the simple model of the .rolling . . . . depicted in Figure 2.3a. To
. . . . . . . mill
obtain a simple model we describe the relationship between the position of the is shown as the dashed line in each part of Figure 2.4a.
screw u(t) and the thickness d1 (t) of the .sheet . . . . . directly after the rollers as a a) The step . . . . . . . . . of the system
. . . . .response
first order transfer function
..................
β 1
G(s) = G(s) =
1 + sT s2 + as + 1
To determine the constants β and T we register the effect of a sudden change is shown as the solid line in the left of Figure 2.4a. Determine if a > 1 or
in the position of the screw. The units used in the model are chosen such that a < 1.

4
b) The step . . . . . . . . . of the system
. . . . .response Pole-zero map Step
. . . . . response
.........
Im
b2
G(s) =
s + bs + b2
2
A 1
is shown as the solid line in the right of Figure 2.4a. Find b. Re

b) Im
1 a) 1
B 2
Re

0 0 Im
0 5 10 0 5 10
t [s] t [s]
C 3
Figure 2.4a. Dashed: original system. Solid left: part a). Solid right: part b). Re

Hint Answer Solution


Im

2.5 Pair the step . . . . . . . . . . and pole-zero diagrams in Figure 2.5a. Poles are
. . . . . responses D 4
marked by an x and zeros are marked by a o. The dashed line in the Re
step . . . . . . . . . corresponds to 0.
. . . . .response
Hint Answer Solution
Im
B 2.6 The purpose of this exercise is to learn simple commands to analyze linear
systems and understand the connection between the poles of a system and the
E 5
resulting dynamical response.
Re
When working in Matlab, it is recommended to open a file and save every-
thing in scripts (write edit in the command prompt). That way you can easily
copy-paste code and quickly create all the models and plots. Im
Define the symbolic variable s = tf( ’s’ ); and you can define the systems
using this variable with standard operators +-*/. To simulate step-responses F 6
with a .unit . . . . use the command step. The command can take multiple ar-
. . . . .step, Re
guments to plot several step responses. After plotting, right click in the figure
and select “Characteristics” if you want to see information about rise . . . . .time,
....
settling time
............. etc. To compute poles of a system use pole. To analyze the Real part Time

Figure 2.5a. All comparable diagrams have equal scaling. In the pole-zero maps, imagi-
5 nary and real parts have equal scaling, × marks poles, and ◦ marks zeros.
computed poles, use abs for absolute value and angle for the argument.
. . . . . . . . . . Re- a) Steady state value.
member that the angle is in radians. Another way to study poles is by the b) Overshoot M in % of the final value.
command pzmap applied to a system. Note that you can send several systems
at the same time to both step and pzmap. c) Rise time Tr .
Consider the systems d) Settling time Ts .

5 25 2
GA (s) = GB (s) =
s2 + 6s + 5 s2 + 10s + 25 1.8
25 100 1.6
GC (s) = 2 GD (s) = 2
s + 5s + 25 s + 10s + 100 1.4
25 25 1.2
GE (s) = 2 GF (s) = 2

y
s + 1s + 25 s + 4s + 25 1
0.8
a) Plot the step . . . . . . . . . of GA (s) and GB (s) (in the same figure). How
. . . . .responses 0.6
do they differ? Compute the poles of the two systems. What do you see? 0.4
0.2
b) Plot the .step . . . . . . . . . of GC (s) and GD (s). How do they differ? Com-
. . . . .responses 0
pute the poles of the two systems and compute their absolute values and
0 5 10 15
. . . . . . . . . . . (and plot them using pzmap. What do you see?
arguments
t [s]
c) Plot the .step . . . . . . . . . of GE (s) and GF (s). How do they differ? Com-
. . . . .responses
pute the poles of the two systems and compute their absolute values and Figure 2.8a
. . . . . . . . . . . (and plot them using pzmap. What do you see?
arguments
Hint Answer Solution
d) Plot the step . . . . . . . . . of the product GA (s)GE (s). What do you see and
. . . . . response
why?
2.9 Figure 2.9a shows the step . . . . . . . . . of four different systems. Combine each
. . . . .responses
Hint Answer Solution step response
.............. with a transfer . . . . . . . . . from the alternatives below.
. . . . . . . . .function
B 2.7 Consider a system with the transfer
. . . . . . . . .function
........ transfer Poles Zeros |G(0)|
. . . . . . . . .function
.........
100
αs + 1 G1 (s) = s2 +2s+100 −1 ± 10i 1
G(s) = G2 (s) = s+2 1
−2 1/2
s2 + 2s + 1
10s2 +200s+2000
G3 (s) = (s+10)(s 2 +10s+100) −10, −5 ± 8.7i −10 ± 10i 2
Compute and plot the step . . . . . . . . . of the system for some different values of
. . . . .response 200
G4 (s) = (s2 +10s+100)(s+2) −2, −5 ± 8.7i 1
α in the range −10 < α < 10. Where is the zero of the .transfer . . . . . . . . (root
. . . . . . . . .function 600
G5 (s) = (s2 +10s+100)(s+3) −3, −5 ± 8.7i 2
of numerator) located as a function of α, and how are the properties of the 400
G6 (s) = (s2 −10s+100)(s+2) −2, 5 ± 8.7i 2
step . . . . . . . . . affected by the location of the zero?
. . . . .response
Hint Answer Solution
Hint Answer Solution

2.8 Figure 2.8a shows the step . . . . . . . . of a system Y (s) = G(s)U (s). The input
. . . . .response
step has amplitude 1. Use the figure and determine

6
Step A Step B

Step C Step D

Figure 2.9a. All comparable axes have equal scaling.

7
3 Feedback Systems
Valve the output y(t). Do not confuse the term input with inflow and outflow
x
with output. With input in systems theory, we mean the action causing
an effect, and output is the result of this action.
Inflow
b) The transfer . . . . . . . . . of the valve
. . . . . . . . .function . . . . . from input voltage u(t) to flow x(t) is
assumed to be
kv
Gv (s) =
1 + Ts
To find kv and T a unit . . . . change in u has been applied. The step
. . . . . step
u y Tank y response, that is, the resulting liquid flow, is shown in Figure 3.1b. De-
1 m2 termine the constants kv and T .
v c) Draw a block diagram of the system, in which the valve
. . . . . and the tank are
represented by one block each, and the signals u, x, y and v are indicated.

Pump 1.5

x
Figure 3.1a 1

0.5
3.1 Consider a part of a process industry, consisting of a valve
. . . . . and a tank. The
system is described by Figure 3.1a and the following information: 0
0 5 10 15 20 25 30
• The valve
. . . . . is operated electrically, and the input voltage
. . . . . . . is denoted u. The t [s]
resulting liquid flow is denoted x.
Figure 3.1b
• The level in the tank is denoted y, and the flow out from the tank, v,
is determined by a pump located further down the process. We have no
Hint Answer Solution
control over this flow so v(t) is a disturbance.
............
• The pipes are always filled with incompressible liquid, so there are no
3.2 Consider the system studied in Problem 3.1. The aim is now to control the tank
transport delays in the system.
level automatically, and therefore PID feedback
. . . . . . . . . control is introduced according
• The cross section area of the tank is 1 m2 . to Figure 3.2a. This means that the valve
. . . . . input is determined according to
the expression
a) Use mass balance, that is, the fact that the change in volume per time unit
is proportional to the difference between inflow and outflow, to determine t
de(t)
Z
a transfer u(t) = KP e(t) + KI e(τ ) dτ + KD (3.1)
. . . . . . . . . Gt (s) for the tank from the inputs x(t) and v(t) to
. . . . . . . . . function 0 dt

8
Valve Hint Answer Solution
x

Inflow 3.3 Consider the level control system studied in Problems 3.1 and 3.2.

a) Assume that the tank level is controlled using proportional control, that
is, F (s) = KP . Compute the poles of the closed loop system for KP =
0.02 and KP = 1 respectively. How does the choice of KP affect the
u properties of the closed loop system?
PID- y Tank y
b) Assume that the reference level is constant, r(t) = 5, and that the
controller 1 m2
. . . . . . . . . . . . outflow is constant, v(t) = 2. Determine the steady state
disturbance
tank level when the proportional .feedback . . . . . . . . F (s) = KP is used. Is it pos-
v
r sible for the output signal y(t) to reach the desired level? What happens
with the steady state level and other properties of the closed loop system
if KP is chosen very large?
c) Assume that a PI controller is used, that is,
Pump Z
u(t) = KP e(t) + KI e(τ ) dτ
Figure 3.2a
What can be said about the steady state tank level in this case (you may
where e(t) denotes the control error, that is, assume the controller parameters have been selected so that the closed
loop system is stable)? What is the possible benefit of introducing the
e(t) = r(t) − y(t) integrating part in the feedback?
and r(t) denotes the reference level, that is, desired tank level. d) Finally, assume that a PD controller is used, that is,
a) Verify, using Laplace transform, that the relationship in (3.1) can be de(t)
expressed u(t) = KP e(t) + KD
dt
U (s) = F (s)(R(s) − Y (s))
where Assume also that KP = 1 and calculate a value of√KD so the damping
1 ratio of the closed loop poles will be greater than 1/ 2. This corresponds
F (s) = KP + KI + KD s
s to placing the poles in the grey area in Figure 3.3a. What is the benefit
b) Let the PID controller F (s) be represented by a block and draw a block of including the derivative part in the feedback?
diagram of the entire feedback
. . . . . . . . control system including GV (s), Gt (s) and
all signals of interest e, u, x, v and y. Hint Answer Solution
c) Use the block diagram from above together with the transfer . . . . . . . . . functions
......... B 3.4 Consider the system
Gv (s), Gt (s), and F (s), and derive the transfer . . . . . . . . . . . . . . . . . of the closed
functions
loop system, that is, the transfer . . . . . . . . from the reference level r(t)
. . . . . . . . .functions 0.2
and flow v(t) to the tank level y(t). Y (s) = G(s)U (s) = U (s).
(s2 + s + 1)(s + 0.2)

9
Im Since true differentiation is difficult to implement, the derivative part is
approximated by 1+sT KD s
. (This will low-pass filter the error signal before
differentiation.) Put KP = 1, KI = 1 and T = 0.1 and try some val-
1 ues of KD in the range 0 < KD < 3. How does the D-part affect the
. . . . . . . . . of the closed loop system?
Re step
. . . . .response
1
Hint Answer Solution

+ Σ Go (s)
Figure 3.3a −

Figure 3.5a
a) Suppose G(s) is controlled by a proportional controller with gain KP ,
that is,
U (s) = KP (R(s) − Y (s)). 3.5 Draw a .root . . . . . with respect to K for the system in Figure 3.5a, with Go (s)
. . . . locus
given below. For which values of K are the systems stable? What conclusions
Use Matlab to compute the closed loop system, and to plot the on the principal shape of the step . . . . . . . . . can be drawn from the root
. . . . .response . . . . .locus?
.....
step . . . . . . . . . of the closed loop system. Choose some values for KP
. . . . .response
in the range 0.1 to 10. How are the properties of the .step . . . . . . . . af-
. . . . .response a) A Ferris wheel (Swedish: Pariserhjul):
fected by KP ? What happens with the steady . . . . . . . state . . . . . when KP in-
. . . . . .error
creases? Is it possible to obtain a well damped closed loop system and K(s + 2)
small steady Go (s) =
. . . . . . . .state . . . . . using proportional control? To form a closed loop
. . . . . error s(s + 1)(s + 3)
system 1+F FG
G , use the command feedback(F*G,1). An alternative when
you only want to plot step . . . . . . . . . . is to simply write F*G/(1+F*G) but
. . . . . responses b) A Mars rover:
the problem with this direct sapproach is that Matlab often fails to
K
reduce it to a minimal transfer . . . . . . . . so some of the poles and zeros
. . . . . . . . .function Go (s) =
will be reported twice when computing these. Try both and look at the s(s2 + 2s + 2)
results.
c) A magnetic floater:
b) Let us now introduce integration in the regulator and use K(s + 1)
Go (s) =
1 s(s − 1)(s + 6)
U (s) = (KP + KI )(R(s) − Y (s)).
s
Hint Answer Solution
Put KP = 1 and try some values of KI in the range 0 < KI < 2. How are
the step . . . . . . . . . and the .steady
. . . . . response . . . . . . .state . . . . . affected by the introduction
. . . . . .error
of the integrating part and the value of KI ?
c) Finally we will introduce the differentiating part in the regulator and use
1 KD s
U (s) = (KP + KI + )(R(s) − Y (s)).
s sT + 1

10
θref k θ̇ 1 θ 3.8 Figure 3.8a shows the root . . . . . for the characteristic equation of a P-
. . . . . locus
+ Σ + Σ K
1 + sτ s controlled process G with respect to the gain K. In Figure 3.8b four
− − step . . . . . . . . . . for the closed loop system with different values of K are shown.
. . . . .responses
α Match the plots in Figure 3.8b with the K-values below. Justify your answer.

K = 4 K = 10 K = 18 K = 50
Figure 3.6a

Im
3.6 Consider the servo system in Figure 3.6a with a DC-motor.
. . . . . . . . . . Suppose that the
angular velocity can be measured with a tachometer
. . . . . . . . . . . . and let the control law
be as in the block diagram. Let τ = 0.5 and k = 2.
2
a) Draw the root . . . . . with respect to K for the system without the
. . . . .locus
. . . . . . . . . . . . . . . . . . . . (that is, α = 0).
tachometer feedback
b) Draw the root . . . . . with respect to K for α = 1.
. . . . .locus
c) Draw the root 2 Re
. . . . . with respect to K for α = 1/3.
-4 -2
. . . . .locus
d) Let K = 1 and draw the .root . . . . with respect to α.
. . . . .locus
-2
Discuss, using the results from a), b), c), and d), what is gained by using the
tachometer.
............
Hint Answer Solution

3.7 We want to control the temperature of an unstable chemical reactor. The Figure 3.8a. Starting points are marked × and end points ◦.
transfer . . . . . . . . . is
. . . . . . . . .function
1 Hint Answer Solution
(s + 1)(s − 1)(s + 5)
a) Use a proportional controller and draw a root . . . . . with respect to the
. . . . .locus
amplification
.............. K. Calculate which K in the compensator that stabilizes
the system.
b) Use a PD controller. The control law is given by
de
u = K(e + TD )
dt
where e is the error. Let TD = 0.5 and draw a root . . . . . with respect to
. . . . . locus
K. For which values of K does the controller stabilize the system?
Hint Answer Solution

11
b) If K > 0, for which values of K are the different closed loop systems
stable?
Im Im

Step A Step B
-0.4

-1 Re -1 Re

Step C Step D

Figure 3.8b. All comparable axes have equal scaling.


(i) (ii)
Im Im
3.9 Consider a system with the transfer
. . . . . . . . .function
........
sn−1 + b1 sn−2 + · · · bn
G(s) =
sn + a1 sn−1 + · · · + an
that has all zeros strictly in the left half plane. Show that such a system always
can be stabilized by -2 -1 Re Re
-4 -2 -1
u(t) = −Ky(t)
if K is selected large enough.
Hint Answer Solution
(iii) (iv)
+ Σ K G(s)
Figure 3.10b

Hint Answer Solution
Figure 3.10a
3.11 a) Draw the Nyquist curve for an integrator G(s) = 1/s.
3.10 A system G(s) is controlled using .feedback
. . . . . . . . with a proportional controller ac- b) Draw the Nyquist curve for the double integrator G(s) = 1/s2 .
cording to Figure 3.10a.
Hint Answer Solution
a) For K = 1, the open loop system KG(s) has the Nyquist diagram ac-
cording to (i), (ii), (iii), or (iv) in Figure 3.10b. Is the closed loop system 3.12 The system G(s) is asymptotically stable and has the Nyquist curve in Fig-
stable in each case? G(s) has no poles in the right half plane. ure 3.12a. It is controlled using feedback
. . . . . . . . according to Figure 3.12b.

12
Im B 3.13 The equations for the P, PI, and PID controllers to be used in this problem
are given in Problem 3.4.
In Matlab, the command for drawing the root-loci of the characteristic equa-
−1.5 2 tion P (s) + KQ(s)) = 0 is rlocus(Q/P).
Re
ω = 10 ω=∞ ω=0 a) Let the system
0.2
Y (s) = G(s)U (s) = U (s)
(s2 + s + 1)(s + 0.2)
be controlled by a proportional controller with gain KP . Use Matlab
to plot the .root . . . . with respect to KP of the characteristic equation
. . . . .locus
of the closed loop system. For which values of KP > 0 is the closed loop
system asymptotically stable?
ω=2
−3 In Problem 3.4, we found that the step . . . . . . . . . was slow but well damped
. . . . .response
for small values of KP , while it became faster but more oscillatory when
Figure 3.12a KP was increased. For large values of KP the system became unstable.
We also found that the steady . . . . . . . .state . . . . . was reduced when KP was in-
. . . . . error
yref e y creased. Can these results be interpreted using the plot of the root . . . . .locus?
.....
+ Σ K G(s) b) Now assume that the system is controlled by a PI controller where KP =
− 1. Plot the .root . . . . . of the characteristic equation, with respect to KI ,
. . . . .locus
and determine for which values of KI > 0 the closed loop system is
Figure 3.12b asymptotically stable.
Problem 3.4 showed that an integrator eliminates the steady . . . . . . .state
. . . . . .error.
.....
A small value of KI gives a large settling ............. time, while a too large value
a) For what values of K (K > 0) is the closed loop system asymptotically
gives an oscillatory, and perhaps unstable closed loop system. Give an
stable?
interpretation of these results using the root . . . . .locus.
.....
b) Determine the steady
. . . . . . . state . . . . . e, as a function of K if yref is a
. . . . . .error, c) Finally, let the system be controlled by a PID controller where KP = 1,
unit step.
......... KI = 1 and T = 0.1. Plot a .root . . . . . of the closed loop characteristic
. . . . locus
c) Assume that G is controlled using an I controller according to Fig- equation, with respect to KD > 0, and relate the behavior of the root . . . . .locus
.....
ure 3.12c. For what values of K is the closed loop system stable? to the simulation result in Problem 3.4, that is, that the derivative part
increases the damping of the closed loop system, but a too large KD will
give an oscillation with a higher frequency, and finally an unstable closed
yref e K y
loop system.
+ Σ s
G(s)

Hint Answer Solution
Figure 3.12c B 3.14 Consider the system
0.2
Y (s) = G(s)U (s) = U (s).
Hint Answer Solution (s2 + s + 1)(s + 0.2)

13
a) Use Matlab to plot the Nyquist curve of the open loop system when 3.16 A system is controlled by a PID controller,
G(s) is controlled by a proportional regulator. Try some different values
of KP and find for which KP the closed loop system is asymptotically 1
U (s) = (KP + KI + KD s)E(s)
stable. Compare your results with those from Problem 3.13a. s
b) Assume now that the system is controlled by a PI controller where KP = In Figure 3.16a four step . . . . . . . . . . from a unit
. . . . .responses . . . . for the parameter triples
. . . . . step
1. Investigate how KI affects the Nyquist curve and determine for which
values of KI the closed loop system is asymptotically stable. Do you get i) KP = 1 KI = 0 KD = 0
the same results as in Problem 3.13b? ii) KP = 1 KI = 1 KD = 0
c) Finally test a PID controller with KP = 1, KI = 1 and T = 0.1 (cf iii) KP = 1 KI = 0 KD = 1
Problem 3.2). How is the Nyquist curve affected by the value of KD ? iv) KP = 1 KI = 1 KD = 1
Hint Answer Solution
are shown. Match each one of the parameter triples to one of the
B 3.15 a) Assume that the system . . . . . . . . . . . . . . . Justify your answer!
step responses.

0.4
Y (s) = G(s)U (s) = U (s)
(s2 + s + 1)(s + 0.2)
1 1
is controlled by a proportional controller where KP = 1. Use
Matlab to make a Bode plot of the open loop system and deter-
mine ωc (.gain . . . . .crossover . . . . . . . . . . ωp (phase
. . . . . . . . . . frequency), . . . . . . .crossover . . . . . . . . . . ϕm
. . . . . . . . . . frequency),
(phase . . . . . . . and Am (gain
. . . . . . .margin) . . . . . . . respectively. Compute the closed
. . . . .margin)
loop system and plot the step A B
. . . . .response.
.........
b) Now let KP = 2.5. How does the change of KP affect ωc , ωp , ϕm , and
Am ? Simulate the step . . . . . . . . . of the closed loop system and plot the
. . . . .response
result. How have the properties of the step 1 1
. . . . . . . . . changed?
. . . . .response
c) How much can KP be increased before the closed loop system becomes
unstable? How does this value relate to the value of Am that was obtained
for KP = 1? Compute and plot the step . . . . . . . . of the closed loop
. . . . .response
system for this value of KP . How does the closed loop system behave in C D
this case?
Figure 3.16a. Four step responses. All comparable axes have equal scaling.
Hint Answer Solution
Figure 3.16b

Hint Answer Solution

Go back

14
3.17 Assume that a .DC-motor
. . . . . . . . . . of the type described in Problem 2.1 is controlled b) of the closed loop system from R(s) to Y (s),
by a proportional controller, that is, u(t) = KP (θref − θ). c) from the measurement error N (s) to the output Y (s),
a) Write down a block diagram for the control system. Compute the closed d) from the reference signal R(s) to the error signal E(s).
loop transfer . . . . . . . . and determine how the poles of the closed loop
. . . . . . . . .function Hint Answer Solution
system depend on the control gain KP . Discuss what this means for the
behavior of the system for different values of KP .
3.20 Consider again the control system in Figure 3.19a, with n = 0 and
b) Determine the .transfer . . . . . . . . . from the reference signal to the error.
. . . . . . . . function
Let the reference signal be a step and a ramp respectively and determine 1
what the control error will be in steady state in these two cases. G(s) =
(s + 1)(s + 3)
c) Let the controller be a PI controller. What will the steady
. . . . . . . .state . . . . . . be
. . . . . error a) Assume F (s) = K. Determine the steady state control error when r(t) is
in this case if the reference signal is a ramp?
a step with amplitude A.
Hint Answer Solution b) Determine a regulator F (s) such that the steady
. . . . . . . state . . . . . is zero when
. . . . . .error
r(t) is a step amplitude A.
3.18 Determine the transfer . . . . . . . . . for the loop
. . . . . . . . .function . . . . and the closed loop system
. . . . . .gain c) Assume F (s) = 1. Determine the poles and zeros of the closed loop
for the control system given by the block diagram in Figure 3.18a. system.

r u y Hint Answer Solution


+ Σ Go (s)
+
3.21 The system
−1 1
Y (s) = U (s)
(s/0.6 + 1)(s + 1)
Figure 3.18a
is controlled using PID feedback
1
Hint Answer Solution U (s) = (KP + KI + KD s)(R(s) − Y (s))
s
Figure 3.21a shows the .step . . . . . . . . . for the following four combinations of
. . . . .responses
r e u y
coefficient values. Combine the .step . . . . . . . . . and coefficients.
. . . . .responses
+ Σ F G
− +
+ n (1) KP = 4 KI = 0 KD = 0
Σ
(2) KP = 4 KI = 3 KD = 0
Figure 3.19a (3) KP = 4 KI = 1 KD = 0
(4) KP = 4 KI = 0 KD = 4
3.19 Figure 3.19a shows a block diagram of a control system. Determine the
transfer
. . . . . . . . .function
.........
Hint Answer Solution
a) of the loop
. . . . .gain,
....

15
1 1

A B

1 1

C D

Figure 3.21a. Four step responses. All comparable axes have equal scaling.

16
4 Frequency Description
4.1 A mercury thermometer can be described with high accuracy as a first or-
der linear time invariant dynamic system s+b a
. The input is the real tem-
perature and the output is the thermometer reading. In order to decide the
transfer . . . . . . . . . in a thermometer it is placed in liquid where the temperature
. . . . . . . . .function
is varied as a sinusoid around a constant level. The obtained result is shown Ψ
in Figure 4.1a. Find the transfer . . . . . . . . of the thermometer, considering the
. . . . . . . . .function δ
input and output as deviations around the constant levels.

Period = 0.314 min

32
Figure 4.2a
0.056 min

30.9 Ψref e u δ Ψ
+ Σ F (s) Gr (s) Gs (s)
30 −
29.1
Thermometer Figure 4.2b
reading
28

Bath temperature where T1 = 100 and K1 = 0.1. The desired course, Ψref , and the measured
course, Ψ, are fed in to the auto pilot, which gives the signal u to the rudder
engine. Figure 4.2b shows a block diagram of the auto pilot. The auto pilot
Transient Stationary state
has the .transfer
. . . . . . . . .function
........
0
1 + as
F (s) = K , a = 0.02, b = 0.05
Figure 4.1a 1 + sb

while Gr is given by
Hint Answer Solution 1
Gr (s) = , T2 = 10
1 + sT2
4.2 We want to keep a ship on a given course, Ψ, with an automatic control system and Gs (s) is defined by (4.1) and (4.2).
using the rudder angle δ. See Figure 4.2a. If ω denotes the angular velocity of
the ship, a) Make a Bode plot for the .transfer . . . . . . . . . F Gr Gs , for K = 0.5.
. . . . . . . . function
ω = Ψ̇ (4.1)
the following differential equation is valid for small values of ω and δ,

T1 ω̇ = −ω + K1 δ (4.2)

17
b) At the testing of the auto pilot we do the following experiment. The gain
of the auto pilot K is increased until the control system oscillates with
constant amplitude. At what value of K does this occur? What is the
period time of the oscillation?
c) Ψref is allowed to vary as a sinusoid Step Bode plot
. . . . . response
.........
Ψref (t) = A sin αt

where A = 5◦ and α = 0.02. When the movements of the ship have


stabilized we have 1 1
A
Ψ(t) = B sin(βt + ϕ)
What values do B, β, and ϕ have if K = 0.5? 0
Hint Answer Solution

1 1
Im B
1
0
1

Re 1 1
C

Figure 4.3a
1 1
D
4.3 a) In Figure 4.3a the Nyquist curve for a system is shown. Draw the Bode
plot for the same system. The scale on the ω-axis is not important, as 0
long as the amplitude and phase curve are in agreement.
b) Draw a diagram for the poles and zeros for the system. The relative Time Frequency
placement is important, not the scale.
Figure 4.4a. All comparable diagrams have equal scaling.
Hint Answer Solution

4.4 Figure 4.4a shows the step . . . . . . . . . . (when the input is a .unit
. . . . . responses . . . and Bode
. . . . .step)
gain plots of four different systems, in no particular order. Identify the pair
of plots that belongs to each system. That is, for each step response, find the

18
e−0.5s
corresponding Bode gain plot (amplitude curve). Motivate your answer by d) Y (s) = s+1 U (s)
pointing out a set of unique features for each system.
Hint Answer Solution
Hint Answer Solution

4.5 a) Assume we have the following closed-loop .transfer 4.8 A system is described by Y (s) = G(s)U (s). Figure 4.8a shows u(t) = sin(ωt)
B . . . . . . . . .functions.
........ and the corresponding output y(t) (after all transients have faded away) for
5 25 the frequencies ω = 1, 5, 10, and 20 rad/s (from top to bottom).
GA (s) = GB (s) =
s2
+ 6s + 5 s2
+ 10s + 25 a) Determine the gain (|G(iω)|) and phase (arg G(iω)) for the system for
25 100
GC (s) = 2 GD (s) = 2 each value of ω.
s + 5s + 25 s + 10s + 100
25 25 b) Determine the gain values in dB20 (20 log10 (|G(iω)|)).
GE (s) = 2 GF (s) = 2 c) Sketch the Bode plot using the values determined above.
s + 1s + 25 s + 4s + 25
Study the amplitude curves of the Bode plots for the systems and find Hint Answer Solution
the static . . . . and bandwidth of the systems. In cases when it is relevant
. . . . . . .gain
find also the resonance frequency and resonance peak. 4.9 Combine the transfer . . . . . . . . . below with the Bode plots in Figure 4.9a.
. . . . . . . . . functions
b) Describe qualitatively (without formulas) the relationships between Tr 1 6(s + 1)
(rise G1 (s) = , G2 (s) =
. . . . and ωB (bandwidth) and between M (overshoot)
. . . . .time) . . . . . . . . . . and Mp s+1 (s + 2)(s + 3)
(resonance peak) respectively? 1 1
G3 (s) = , G4 (s) =
Hint Answer Solution s s(s + 1)
5
G5 (s) = 2 (poles: − 1 ± i2)
4.6 A system has the transfer
. . . . . . . . .function
......... s + 2s + 5

e−2s
G(s) = Hint Answer Solution
s(s + 1)

What is the output (after transients) when the input is 4.10 Figure 4.10a shows the Bode gain plots and .step . . . . . . . . . of four different
. . . . .responses
systems, in no particular order. Identify the pair of plots that belongs to
u(t) = 2 sin(2t − 1/2) each system. That is, for each Bode gain plot (amplitude curve), find the
corresponding step . . . . . . . . Motivate your answer by pointing out a set of
. . . . .response.
Hint Answer Solution unique features for each system.
Hint Answer Solution
4.7 For the systems below the input is chosen as u(t) = sin(2t). Determine the
output signal y(t) after transients have faded away, provided that it exists. 4.11 A system
Y (s) = Go (s)U (s)
1
a) Y (s) = s+1 U (s) is used with a controller
1
b) Y (s) = s−1 U (s)
U (s) = R(s) − Y (s).
1
c) Y (s) = (s+1)(2s+1) U (s)

19
1 1

1
0.5 Bode gain A Bode gain B
0
-0.5
-1 1 1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
1
0.5 Bode gain C Bode gain D
0
-0.5
1
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
1
Bode gain E
0.5
0 Figure 4.9a. All diagrams have equal scaling.

-0.5
a) In Figure 4.11a are Bode diagrams of the open loop systerm Go for two
-1
different systems (top), the closed loop systems Gc (second row), step
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
responses of the closed loop systems (third row) and the poles of the
1
closed loop systems (bottom). Assign each closed loop system, closed
0.5 loop step . . . . . . . . . and closed loop pole diagram to the correct open loop
. . . . . response
0 system.
b) Solve the same task for Figure 4.11b.
-0.5
-1 Hint Answer Solution
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
4.12 A system is described by
Figure 4.8a. u(t) = sin(ωt) (solid) and y(t) (dashed). Y (s) = G(s)U (s)
where the transfer function from the input u to the output y is given by
s
+1
G(s) = α
α>0
s+1

20
Bode Diagram Bode Diagram
Gm = 41.6 dB (at 3.87 rad/sec) , Pm = 87.9 deg (at 0.0666 rad/sec) Gm = 1.62 dB (at 3.87 rad/sec) , Pm = 5.31 deg (at 3.52 rad/sec)

50 100

0 50

Magnitude (dB)

Magnitude (dB)
−50 0

−100 −50

−150 −100

−200 −150
−90 −90

−135 −135

Phase (deg)

Phase (deg)
Bode plot Step
. . . . . response
.........
−180 −180

−225 −225

−270 −270
−3 −2 −1 0 1 2 3 −3 −2 −1 0 1 2 3
10 10 10 10 10 10 10 10 10 10 10 10 10 10
Frequency (rad/sec) Frequency (rad/sec)

Open system A Open system B


1 1
A 50
Bode Diagram

0
Bode Diagram

−20

−40
0
−60

Magnitude (dB)

Magnitude (dB)
−80

0 −50 −100

−120

−140
−100
−160

−180

−150 −200
0 0

−90 −90

Phase (deg)

Phase (deg)
1 1
B
−180 −180

−270 −270
−3 −2 −1 0 1 2 3 −3 −2 −1 0 1 2 3
10 10 10 10 10 10 10 10 10 10 10 10 10 10
Frequency (rad/sec) Frequency (rad/sec)

0 Closed loop system a Closed loop system b


Step Response Step Response

1.8
1.8

1.6 1.6

1.4 1.4

1 1
C
1.2 1.2

Amplitude

Amplitude
1 1

0.8 0.8

0.6 0.6

0 0.4 0.4

0.2 0.2

0 0
0 10 20 30 40 50 60 70 80 90 0 10 20 30 40 50 60 70 80 90
Time (sec) Time (sec)

Step
. . . . . .response
........ 1 Step reponse 2
1 1
D 5
Pole−Zero Map

5
Pole−Zero Map

4 4

3 3

0 2 2

Imaginary Axis (seconds−1)

Imaginary Axis (seconds−1)


1 1

0 0

Frequency Time −1

−2
−1

−2

−3 −3

Figure 4.10a. All comparable diagrams have equal scaling.


−4 −4

−5 −5
−8 −7 −6 −5 −4 −3 −2 −1 0 1 2 −8 −7 −6 −5 −4 −3 −2 −1 0 1 2
Real Axis (seconds−1) Real Axis (seconds−1)

Poles I Poles II

Figure 4.11a. The frequency scales of the Bode diagrams are the same. The time scales
of the step responses are the same. In the pole-zero maps, × marks poles.

21
Bode Diagram
Gm = 41.6 dB (at 3.87 rad/sec) , Pm = 87.9 deg (at 0.0666 rad/sec)
Bode Diagram
Gm = 24.7 dB (at 3.87 rad/sec) , Pm = 76 deg (at 0.459 rad/sec) a) Determine the pole and zero of the system.
50 100

0
50

0
b) Determine the static gain of the system for the values α = 2 and α = 0.5.
Magnitude (dB)

Magnitude (dB)
−50

−50

c) Determine | G(iω) |. What value does the function tend to when ω → ∞?


−100
−100

−150
−150

d) Make simple sketches of | G(iω) | for the values α = 2 and α = 0.5. How
−200 −200
−90 −90

−135 −135

does the location of the zero relative to the location of the pole affect the
Phase (deg)

Phase (deg)
−180 −180

shape of | G(iω) |?
−225 −225

−270 −270
−3 −2 −1 0 1 2 3 −3 −2 −1 0 1 2 3
10 10 10 10 10 10 10 10 10 10 10 10 10 10
Frequency (rad/sec) Frequency (rad/sec)

Open system A Open system B Hint Answer Solution


Bode Diagram Bode Diagram

0 0

−20 −20

−40 −40

−60 −60
Magnitude (dB)

Magnitude (dB)
−80 −80

−100 −100

−120 −120

−140 −140

−160 −160

−180 −180

−200 −200
0 0

−90 −90
Phase (deg)

Phase (deg)

−180 −180

−270 −270
−3 −2 −1 0 1 2 3 −3 −2 −1 0 1 2 3
10 10 10 10 10 10 10 10 10 10 10 10 10 10
Frequency (rad/sec) Frequency (rad/sec)

Closed loop system a Closed loop system b


Step Response Step Response

1.8 1.8

1.6 1.6

1.4 1.4

1.2 1.2
Amplitude

Amplitude

1 1

0.8 0.8

0.6 0.6

0.4 0.4

0.2 0.2

0 0
0 10 20 30 40 50 60 70 80 90 0 10 20 30 40 50 60 70 80 90
Time (sec) Time (sec)

.Step ........ 1
. . . . .response Step reponse 2
Pole−Zero Map Pole−Zero Map

5 5

4 4

3 3

2 2
Imaginary Axis (seconds−1)

Imaginary Axis (seconds−1)

1 1

0 0

−1 −1

−2 −2

−3 −3

−4 −4

−5 −5
−8 −7 −6 −5 −4 −3 −2 −1 0 1 2 −8 −7 −6 −5 −4 −3 −2 −1 0 1 2
Real Axis (seconds−1) Real Axis (seconds−1)

Poles I Poles II

Figure 4.11b. The frequency scales of the Bode diagrams are the same. The time scales
of the step responses are the same. In the pole-zero maps, × marks poles.

22
5 Compensation
5.2 In Figure 5.2a we have arranged step . . . . . . . . . . and open loop and closed loop
. . . . . responses
(feedback with −1) Bode plots for five different systems. Identify the three
u
plots that belong to each of the five systems, one open loop and one closed
loop Bode plot and one step . . . . . . . . Motivate your answer by pointing out
. . . . .response.
one unique feature for each system.

B Hint Answer Solution

5.3 A DC-servo is described by the block diagram in Figure 5.3a, where T1 = 50 ms


is a mechanical time constant, km = 10 is a proportional constant, T2 = 25 ms
is an electrical time constant, and T = 10 ms is an amplifier time constant.
The system is tested with F (s) = 1 and we find that the dynamic properties
A are satisfactory but that the system is somewhat too slow. Find an F (s) so
that the closed loop system is twice as fast as for F (s) = 1, without increasing
the .overshoot.
. . . . . . . . . F (s) should also give a closed loop system which fulfills the
Figure 5.1a following accuracy demands:

• |θ − θref | ≤ 0.001 rad in steady state when θref is constant.


5.1 The outflow temperature θ in the liquid A can be controlled in a heat exchanger
by controlling the flow of the liquid B by a valve
. . . . . with the setting denoted u. • When θref is a ramp with slope 10 rad/s we should have |θ − θref | ≤
See Figure 5.1a. Measurements have been made using a sinusoidal input u 0.01 rad in steady state.
and the gain and phase shift have been measured at different frequencies. The
results are given in the following table. Hint Answer Solution

Frequency [rad/s] Gain Phase shift


0.05 1.37 −67◦
0.1 0.80 −106◦
0.2 0.34 −153◦
0.3 0.18 −185◦
0.4 0.11 −210◦

a) Make a Bode plot for the system.


b) What is the largest .gain
. . . . .crossover . . . . . . . . . . possible to achieve when
. . . . . . . . . . frequency
using proportional control and wanting a phase . . . . . . . of at least 50 ?
. . . . . . .margin

c) Suggest a compensator that doubles the speed compared to b) and still


keeps the phase
. . . . . . margin.
.......

23
θref e u 1 km θ
+ Σ F (s)
1 + sT s(1 + sT1 )(1 + sT2 )
Bode plot Bode plot Step −
. . . . . response
.........
Open loop system Closed loop system Closed loop system
Figure 5.3a
1
1 1
A u 1 y

0 G1
s
-180◦ 0
Figure 5.4a
1
1 1 5.4 A system G(s) can be split into two sub-systems
B

0 1
-180◦ 0 G(s) = G1 (s)
s
according to Figure 5.4a. The Bode plot for G1 (s) is given in Figure 5.4b.
1 Find a compensator for the system G(s) such that the following is fulfilled:
1 1
C
0◦ • The phase . . . . . . . for the compensated system is 40 .
. . . . . . .margin

-180◦ 0 • The closed loop system is twice as fast as what is possible to achieve using
proportional control with a 40◦ phase . . . . . . margin.
........
1 • The steady
. . . . . . . .state . . . . . when the reference signal is a ramp is 1% of the
. . . . . error
1 1 corresponding error with proportional control and 40◦ .phase . . . . . . margin.
.......
D

0 Hint Answer Solution
-180◦ 0
5.5 The Bode plot for a system is given in Figure 5.5a.
1 a) Draw the Nyquist curve of the system.
1 1
E b) Assume that the system is controlled using the proportional feedback
0◦
-180◦ 0 U (s) = K(R(s) − Y (s))

Frequency Frequency Time For which K > 0 is the closed loop system asymptotically stable?
c) Assume that we choose K = 2 in the proportional controller in problem
Figure 5.2a. All comparable diagrams have equal scaling. 5.5 b). What will the steady
. . . . . . . .state . . . . . . be when r(t) = 10t?
. . . . . error
d) Assume that y(t) is delayed T seconds. How large is T allowed to be in
order for the system to still be asymptotically stable with K = 2?

24
5.6 a) A plot of the amplitude curve of a stable transfer . . . . . . . . . Go (s) is given
. . . . . . . . .function
10-1 in Figure 5.6a. Choose one of the following alternatives regarding the
|G1 (iω)|

Go
stability of the closed loop system :
1 + Go
10-2 1. It is stable.
2. It is not stable.
3. Impossible to determine given these facts only.
0◦ b) Repeat for the .transfer . . . . . . . . . whose amplitude curve is given in Fig-
. . . . . . . . function
arg G1 (iω)

ure 5.6b. Justify your answers carefully.


-90◦

100

|Go (iω)|
-180◦
10-2 10-1 100 101 102
ω [rad/s] 10−1

Figure 5.4b

100

arg Go (iω)
10 ?
|G(iω)|

1
0.1
0.01
10−2 10−1 100 101 102

-90 ω [rad/s]
-120◦
arg G(iω)

Figure 5.6a
-150◦
-180◦ Hint Answer Solution

-210

10-2 10-1 100 101


ω [rad/s]

Figure 5.5a

Hint Answer Solution

25
100 b) Compute a regulator such that the open loop system fulfills the following
requirements:
|Go (iω)|

(i) ωc = 5
10−1
(ii) ϕm ≥ 60◦
and the closed loop system fulfills:
(iii) e0 = 0
Draw the Bode plot of the compensated open loop system and check
arg Go (iω)

? that the requirements are satisfied. Simulate the closed loop system for
a step in the reference signal and plot the step . . . . . . . . Check that the
. . . . .response.
requirement on the steady state error
.................. is satisfied.
c) Draw the amplitude curve of the Bode plot of the closed loop system with
10−2 10−1 100 101 102 and without the compensator. Describe how the properties of the closed
ω [rad/s] loop system have been changed by the compensation.
Figure 5.6b d) Simulate the control error when the reference signal is a ramp and the
regulator designed in b) is used. Is the stationary error zero?

B 5.7 Consider a system described by Hint Answer Solution

Y (s) = G(s)U (s) 5.8 A vehicle is described by the model


where Y (s) = G(s)U (s)
725
G(s) =
(s + 1)(s + 2.5)(s + 25)
where u is the input and y is the position and
a) Assume that the system is controlled by 0.1
G(s) =
s(s + 1)2
U (s) = F (s)(R(s) − Y (s))
The Bode diagram of the model is given in Figure 5.8a.
where F (s) = 1. Find ωc , ωp , ϕm , and Am for the loop
. . . . . gain.
.....
a) Assume that the vehicle is controlled using proportional feedback

U (s) = K(R(s) − Y (s))

What is highest .gain . . . . .crossover . . . . . . . . . . that can be achieved if it is


. . . . . . . . . . frequency
required that the phase . . . . . . . . . . . . . . at least 60 ? For which value of K is
margin is ◦

thisgain
. . . . . crossover . . . . . . . . . obtained?
. . . . . . . . . . .frequency

26
b) Assume that it is required that the vehicle is able to follow a reference a) Give a possible combination of values of p, n and m such that the diagram
path given by the function corresponds to the transfer
. . . . . . . . . function
.........
r(t) = 0.5 · t t ≥ 0 K(s + z1 ) · · · (s + zm )
G(s) =
sp (s + p1 ) · · · (s + pn )
What is the resulting steady
. . . . . . . state . . . . . if the vehicle is controlled by the
. . . . . .error
proportional feedback
........ designed in a). b) Assume that the system is going to be controlled using the feedback
c) Design a controller,
U (s) = F (s)(R(s) − Y (s))
U (s) = F (s)(R(s) − Y (s))
Determine F (s) such that the control system fulfulls the following re-
for the vehicle above, such that the resulting control system fulfills the quirements:
following requirements:  The steady
. . . . . . .state . . . . . is zero when the reference signal is a .unit
. . . . . .error . . . . .step.
....
 The steady
. . . . . . . .state . . . . . . using the same reference signal as in b), is
. . . . . error,  The absolute value of the .steady state error
.................. is less than 0.01 when
less that 10% of what was achieved in problem b). the reference signal is a unit ramp.
 The phase . . . . . . . is at least 60 .
. . . . . . .margin
◦  The compensated open loop system has gain . . . . .crossover ......... 3
. . . . . . . . . . .frequency
 The gain rad/s and phase . . . . . . . 45 .

. . . . . .crossover . . . . . . . . . . is the same as what was obtained in
. . . . . . . . . .frequency . . . . . . .margin
problem a).
Hint Answer Solution
Hint Answer Solution
5.11 A system is described by the model
5.9 The upper figure in Figure 5.9a shows, in four different cases, the Bode diagram 2
for the loop Y (s) = U (s)
. . . . .gain
.... (10s + 1)2
GO (iω) = F (iω)G(iω)
and is controlled by the feedback
and the lower figure in Figure 5.9a shows the amplitude curve, | GC (iω) |, for
the transfer . . . . . . . . . of the closed loop system
. . . . . . . . . function τD s + 1
U (s) = K (R(s) − Y (s))
βτD s + 1
GO (s)
GC (s) =
1 + GO (s) In Figure 5.11a, four .step . . . . . . . . . for the parameter pairs
. . . . .responses
in the corresponding four cases. Combine the diagrams in Figure 5.9a. i) K = 10 β = 0.1
Hint Answer Solution ii) K = 10 β = 0.8
iii) K = 5 β = 0.1
5.10 A system is described by the relationship iv) K = 5 β = 0.8

Y (s) = G(s)U (s) are shown. Combine these values with the step . . . . . . . . . . in Figure 5.11a.
. . . . . responses
where the Bode diagram of G(s) is given in Figure 5.10a.

27
Bode Diagram A B
100 100

Magnitude (dB)

Magnitude (dB)
2
10

0 0

1 −100 −100
10
0 −90

Phase (deg)

Phase (deg)
−90
0
10
−180 −180
−2 0 2 −2 0 2
10 10 10 10 10 10
Frequency (rad/sec) Frequency (rad/sec)
Magnitude (abs)

−1
10 C D
100 100

Magnitude (dB)

Magnitude (dB)
0 0
−2
10

−100 −100
−90 0

Phase (deg)

Phase (deg)
−3
10 −90

−180 −180
−2 0 2 −2 0 2
10 10 10 10 10 10
−4
10 Frequency (rad/sec) Frequency (rad/sec)
−2 −1 0 1
10 10 10 10
Frequency (rad/sec) I II
40 20
Bode Diagram

−90 20 0

Magnitude (dB)

Magnitude (dB)
0 −20

−20 −40
−135

−40 −60
−1 0 1 2 −1 0 1 2
10 10 10 10 10 10 10 10
Frequency (rad/sec) Frequency (rad/sec)
Phase (deg)

Bode Diagram IV
20 0
−180

0
−20

Magnitude (dB)

Magnitude (dB)
−20
−40
−225
−40

−60
−60

−80 −80
−1 0 1 2 −1 0 1 2
10 10 10 10 10 10 10 10
Frequency (rad/sec) Frequency (rad/sec)
−270
−2 −1 0 1
10 10 10 10
Frequency (rad/sec) Figure 5.9a. Upper: GO (iω). Lower: | GC (iω) |.

Figure 5.8a
28
2
10

1
10

0
10

−1
10

−2
10 A B

1.5 1.5
−3
10

Amplitude

Amplitude
1 1
−4
10

0.5 0.5
−5
10

0 0
0 10 20 30 40 0 10 20 30 40
−6 Time (sec) Time (sec)
10
−2 −1 0 1 2
10 10 10 10 10
−80 C D

1.5 1.5
−100

Amplitude

Amplitude
−120 1 1

−140 0.5 0.5

−160
0 0
0 10 20 30 40 0 10 20 30 40
Time (sec) Time (sec)
−180

−200
Figure 5.11a

−220

−240

−260

−280
−2 −1 0 1 2
10 10 10 10 10

Figure 5.10a

29
6 Sensitivity and Robustness
v Im

+
r=0 e u 1 y
+ Σ K
s(s + 1) + Σ
− −1

Re
Figure 6.1a

6.1 Consider the control system in Figure 6.1a where v(t) is a sinu-
soidal disturbance,
. . . . . . . . . . . v(t) = sin(t). Compute the absolute value of the Go
sensitivity . . . . . . . . at ω = 1 rad/s as a function of K. How must K be
. . . . . . . . . . . .function Figure 6.3a
selected if the amplitude of y(t) shall be less than the amplitude of v(t) at this
frequency?
v
Hint Answer Solution
+
y
r e u y + Σ Go + Σ
+ Σ F (s) G(s) −

Figure 6.3b
Figure 6.2a

6.2 Assume that we have constructed a controller F (s) for the model G(s), see . . . . . . . . . . . . on the output are amplified in the sense that the output amplitude
disturbances
Figure 6.2a, such that there is no steady of the control system in Figure 6.3b is larger than the .disturbance . . . . . . . . . . . amplitude.
. . . . . . .state . . . . . when the reference signal
. . . . . .error
is a step. Let the real system be given by Hint Answer Solution
0
G (s) = (s + 1)G(s)
and assume that G0 (s) → 0, s → ∞. Also assume that the amplitude curve
of the closed loop system has no resonance peaks and decreases, at least
and asymptotically, with 20 dB20 /decade for frequencies over the bandwidth.
What is the highest possible bandwidth we can use for the closed loop system
in Figure 6.2a, while at the same time guaranteeing stability?
Hint Answer Solution

6.3 Figure 6.3a shows a Nyquist diagram for the .loop . . . . Go . Show in a figure for
. . . . .gain
what frequencies (that is, for what part of the Nyquist curve above) additive

30
r e u y Hint Answer Solution
+ Σ F (s) G0 (s)

Figure 6.4a 100

|Gc (iω)|
6.4 Consider the control system in Figure 6.4a. The true system, denoted G0 (s),
is modeled as 10-1
1
G(s) =
s + 10
The controller 10-1 100 101
s + 10 ω [rad/s]
F (s) =
s
Figure 6.6a
gives an asymptotically stable closed loop system with the model G(s). Now
assume that the system is given by
6.6 A DC-motor
. . . . . . . . . . is assumed to have the transfer
. . . . . . . . .function
........
G0 (s) = G(s)(1 + ∆(s))
1
where it is known that ∆(s) has no poles in the right half plane, and that G(s) =
s(s + 1)
0.9
|∆(iω)| < √ and it is controlled using proportional feedback,
1 + ω2
Can we be sure that the closed loop system is asymptotically stable? U (s) = F (s)(R(s) − Y (s))
Hint Answer Solution where F (s) = 4. The amplitude curve of the .feedback
. . . . . . . . system
6.5 A process is described by the model G(s), while the process in reality has the F (iω)G(iω)
|Gc (iω)| =
transfer
. . . . . . . . .function
......... 1 + F (iω)G(iω)
G0 (s) = e−sT G(s)
is given in Figure 6.6a. Assume that the real system is given by
a) Draw the absolute value of the inverse of the relative model error, that
α
is, G0 (s) = G(s) , α>0
1 s+α
|∆(iω)| and the controller F (s) is used on the system G0 (s).
b) Assume that we design a controller F (s) starting with the model G(s).
How large may a) Draw a .root . . . . . with respect to α for the characteristic equation of the
. . . . locus
F (iω)G(iω) closed loop system and determine for which α the closed loop system is
1 + F (iω)G(iω) asymptotically stable.
be at most, in order to guarantee asymptotic stability of the closed loop b) Use the robustness criterion to decide for which α the closed loop system
system for all values of T , when the controller F (s) is used on the system is asymptotically stable.
G0 (s)? c) Comment on the possible differences in the demands on α in a) and b).

31
Hint Answer Solution v
+
r u y
6.7 A system G0 (s) is controlled using a regulator F (s). In Figure 6.7a the am-
plitude part the Bode plot of the nominal closed loop system, + Σ Go + Σ
− +
+ n
F (s)G(s) Σ
Gc (s) =
1 + F (s)G(s)
Figure 6.8a
0
is shown. It is known that Gc is stable, and it is assumed that G and G have
the same number of poles in the right half plane. The model uncertainty ∆(s), 6.8 Consider the system in Figure 6.8a. For r(t) = 0, n(t) = 0 and v(t) = sin t the
defined by steady-state output is given by
G0 − G 1 π
∆= y(t) = √ sin(t − )
G 2 4
is assumed bounded by |∆(iω)| ≤ γω. In what interval must γ lie to guarantee
Determine the steady-state output y(t) when r(t) = 0, v(t) = 0 and n(t) =
stability of the closed loop system?
sin t.
Hint Answer Solution
101
B 6.9 Recall the model that was used in the design of a lead-lag controller using
|Gc (iω)|

100 Matlab in Problem 5.7. Assume that the true system contains a time constant
10-1 that was neglected, and that the transfer . . . . . . . . . of the system is given by
. . . . . . . . .function
10-2 1
G0 (s) = G(s)
10-3 s+1
10-1 100 101 a) Determine the relative model error ∆(s).
ω [rad/s]
1 F (iω)G(iω)
b) Draw |∆(iω)| and 1+F (iω)G(iω) in a Bode plot, when G(s) is given by
Figure 6.7a
725
G(s) =
Hint Answer Solution (s + 1)(s + 2.5)(s + 25)
for the two cases F (s) = 1 and F (s) being the controller designed in
Problem 5.7. What can be said about the robustness of the closed loop
system in these two cases when F (s) is used for control of the “true”
system G0 (s)?
One possible solution to the design problem in Problem 5.7 was the con-
troller
0.43s + 1 2.0s + 1
F (s) = 0.46 · ·
0.090s + 1 2.0s
Hint Answer Solution

32
7 Special Controller Structures
Valve b) To improve the control system, Stu also introduces a proportional
x
. . . . . . . . of the water level h. What is the steady-state error in the level
feedback
h now, if the outflow is changed in the same way as in a)?
Inflow
Hint Answer Solution

7.2 Consider the following system


u 2 3
P- h h Y (s) = U (s) + V (s)
Σ Tank s+3 s+4
controller
where u is the control signal, y is the output and v is a .disturbance.
. . . . . . . . . . . It is
v desired that y should be as small as possible despite the disturbance
. . . . . . . . . . . v.
Feed- a) Design a feedforward controller from v to u that eliminates the influence
forward of v on y.
b) Assume that v is a pure sinusoid with amplitude 2. How large will the
Pump control signal be?
c) The real system is described by
Figure 7.1a
b 3
Y (s) = U (s) + V (s)
7.1 A level control system for a water tank is shown in Figure 7.1a, where all s+3 s+4
variables denote offsets from an operation point. The inflow, x(t), to the tank
where b value is not exactly known but has its value close to 2. To solve
(with area A) is determined by the valve, . . . . . and the outflow, v(t), is determined this problem a P controller is added to the feedforward controller that
by the pump. Stu Dent has got the assignment to keep the water level in
was designed in a). The full controller looks like
the tank constant, in spite of variations in the outflow v(t). First, Stu de-
termines the transfer . . . . . . . . Gv (s) from the valve
. . . . . . . . .function . . . . . to x(t). By .step
. . . . response
......... U (s) = −KY (s) + Ff (s)V (s)
experiments, he obtains the following result:
1 where Ff (s) is the feedforward controller. What is the stationary error if
Gv (s) = v = 1?
0.5s + 1
a) Because the .disturbance
. . . . . . . . . . . v(t) is measurable, Stu first considers a feedfor- Hint Answer Solution
ward compensator to completely eliminate it. Stu, who also knows that
it is dangerous to differentiate the disturbance,
. . . . . . . . . . . cancels all the derivative
terms in the compensator. Compute the feedforward compensator, and
determine the response h(t) Stu will get, if the outflow v(t) is changed
stepwise with an amplitude of 0.1.

33
B 7.3 The transfer . . . . . . . . . for a temperature control system is given by
. . . . . . . . .function
3 4
Y (s) = U (s) + V (s)
s+1 (s + 2)(s + 5)

where y is the controlled temperature, u is the supplied power and v is the


temperature of the surroundings. Assume that the desired temperature is zero.
a) Design a feedforward controller U (s) = Ff (s)V (s) which eliminates the
influence of the disturbance
. . . . . . . . . . . . v on y.
b) To simplify implementation Ff (s) is replaced with a constant, Fef = Ff (0).
Assume that v is given by v(t) = −1 − 0.1t and that U (s) = Fef V (s) is
used. What will y(t) be in steady state?
c) The previous controller is now extended with a P controller:

U (s) = Fef V (s) − KY (s)

What will now y(t) be in steady state?


d) Assume that one only uses the P controller

U (s) = −KY (s)

What will now y(t) be in steady state?


Hint Answer Solution

34
8 State Space Description
8.1 Define suitable state space variables for the DC motor discussed in Prob-
lem 2.1, and write the system in state space form. Ml
− +
i Mi 1 z 1 θ 1 y
Hint Answer Solution K1 + Σ s + Σ s
K2 + Σ s

Ma
z
Figure 8.3a

8.3 The block diagram in Figure 8.3a describes an electric motor that drives a
load via an elastic axis. Here i is the driving .current . . . . . . . to the motor, which gives
the torque
. . . . . . . Mi . z is the turning rate of the motor and y is the turning rate of
l the load. θ is the angle of the transmission axis. Ma = K2 θ is the torque . . . . . . this
angle causes. Ml is the torque . . . . . . from the load. Give a state space description
for the system with Ml and i as inputs and y as output. (There are at least
θ
two different ways to solve this problem.)
Hint Answer Solution
m
Figure 8.2a 8.4 Write the following systems in state space form.

a)
8.2 Consider the system illustrated in Figure 8.2a. It consists of a hinge that can
d3 y d2 y dy
move in the direction marked “z”, and an attached pendulum. The system is + 6 2 + 11 + 6y = 6u
dt 3 dt dt
described by the equation
b)
`θ̈ + g sin θ + z̈ cos θ = 0 d3 y d2 y dy d2 u du
+ + 5 + 3y = 4 + + 2u
Define state space variables, input, and output as dt3 dt2 dt dt2 dt

x1 = θ x2 = θ̇ u = z̈/` y=θ c)
2s + 3
G(s) =
and s2 + 5s + 6
ω02 = g/` Use for example controllable
. . . . . . . . . . . . or observable canonical form or diagonal form.
Linearize the system around the equilibrium
. . . . . . . . . . . point given by Hint Answer Solution
x1 = π x2 = 0 u = 0
8.5 A system has the impulse response (weight function)
Hint Answer Solution
g(t) = 2e−t + 3e−4t

35
Write the system in state space form. m
Hint Answer Solution ϕ m
8.6 Consider the system l
z αl
1 1
   
−2
ẋ = x+ u
0 −3 1
y = −1 2 x


Compute the .transfer . . . . . . . . of the system.


. . . . . . . . .function
Hint Answer Solution Figure 8.9a

8.7 A (bad) state


. . . . . .space . . . . . . of
. . . . . . model
1 8.9 Two mathematical pendulums are mounted on a trolley. . . . . . . They are mounted
G(s) = so that they can move without friction in a plane coinciding with the direction
s+1
of movement for the trolley.
. . . . . . . The lengths of the pendulums are ` and α` and
is given by their masses are m. For one pendulum we have
0 1
   
−1
ẋ = x+ u z̈ cos ϕ + ϕ̈` = g sin ϕ
0 2 1
y= 1 0 x

a) Linearize the system around ϕ = 0 and put the constants `, m, and g to
a) Compute x1 (t) x2 (t) and y(t) if x(0) = 0 and 1 and write the equations in the form ẋ = Ax + Bu.
b) Give the values on α for which the system is controllable.
. . . . . . . . . . . . Give a practical
(
0, t < 0
u(t) = motivation.
1, t ≥ 0
Hint Answer Solution
b) Is the system asymptotically stable? Input-output-stable?
c) Examine the controllability and observability for the system.
d) Explain why the realization is not suitable for simulating a system whose
transfer . . . . . . . . . is G(s).
. . . . . . . . .function
Hint Answer Solution

8.8 Compute the poles and zeros of the system


1 −1 1
   
ẋ = x+ u
2 1 0
y= 1 1 x


Hint Answer Solution

36
1 x1 v Störning
s+1 + Ventil Ledning Damm
u y u q y
Σ kV V q kD
D
+ + Σ
1 x2 Insignal s τV + 1 Flöde Flöde s τD + 1 Nivå
+ Σ s+3

Figure 8.10a
Figure 8.12a. Dam system
8.10 A system is given by the block diagram in Figure 8.10a. Derive a
state space model
.................. of the system, with the state space variables given in the
figure. 8.12 A simplified description of a system for controlling the water level in a dam is
Hint Answer Solution shown in Figure 8.12a.
Assume that the influence of the pipe can be neglected, i.e. q(t) = qV (t) =
8.11 An electromagnet can make a metal ball levitate. The electromagnet is posi- qD (t). Verify that the system, using the state variables x1 (t) = y(t) and
tioned so as to make the magnetic force act upwards in the vertical plane. By x2 (t) = q(t) can be expressed in state space form as
placing a metal ball under the magnet, the ball stays in the air if the magnetic  1 kD
0
    kD 
force exactly matches the gravity acting on the ball. − τD
ẋ(t) = τD x(t) + u(t) + τD v(t) y(t) = (1 0)x(t)
0 − τ1V kV
τV 0
The gravitational force is Fg = mg where m in the mass of the ball and g is
the gravitational constant. The force from the magnet is described by Fm (t) =
Hint Answer Solution
ku(t)y −2 (t) where u(t) is the current . . . . . . . . through the coil of the electromagnet,
y(t) is the distance from the magnet to the ball and k is a proportionality
constant. Force equilibrium ku(t) 8.13 An object with mass m moves horizontally with non-negative velocity x(t)
. . . . . . . . . . . . leads to mÿ(t) = − y2 (t) + mg.
subject to a driving force u(t) and .air . . . . which is proportional to the square
. . . .drag,
Using the states x1 = y and x2 = ẏ leads to the state space description of the velocity. The object can hence be described by the differential equation
x2 (t)
!
mẋ(t) = −cx2 (t) + u(t)
ẋ(t) = ku(t)
− mx 2 (t) + g

where the coefficient c describes the aerodynamic properties of the object.


1

y(t) = x1 (t)
a) Assume the force is constant u(t) = u0 . Determine the steady state
a) Show that all stationary points are given by x1 = x10 , x2 = 0 and u0 = velocity (equilibrium) of the object. How can it be seen that this is a
mx2
g k10 . non-linear system? How much must the force increase in order to double
b) Determine a linear state the velocity?
. . . . . .space . . . . . . approximating the nonlinear system
. . . . . .model
around each stationary point. b) Linearize the system around the stationary point (xo , u0 ) and formulate
a linear system using the variables
Hint Answer Solution
∆x(t) = x(t) − x0 ∆u(t) = u(t) − u0

37
c) Determine the pole of the linearized system. Which factors affect the
location of the pole? How does the force in the stationary point affect
the location of the pole? Does that seem natural considering the “shape”
of the right hand side of the state equation?

Hint Answer Solution

38
9 State Feedback
9.1 Consider the system
1
   
−2 −1
ẋ = x+ u
1 0 0
y= 0 1 x


a) Calculate state feedback


. . . . . . . . laws u = −Lx + r that places the poles in
I) { −3, −5 },
II) { −10, −15 }
What limits the possibility to achieve arbitrarily fast dynamics of the real
closed loop system?
b) Extend the controllers to include a feedforward scaling l0 on the reference,
u = −Lx + l0 r. Derive the closed-loop transfer . . . . . . . . from r to y for
. . . . . . . . .function Figure 9.3a
the control law in (I). Based on the result, suggest a value on l0 such that
a constant reference signal can be followed without any stationary error.
The module is both in the θ-direction and in the z-direction obeying Newton’s
Hint Answer Solution law of motion without any kind of damping. The .transfer . . . . . . . . from the
. . . . . . . . .function
control signal of the astronaut (yref ) to velocity ż is
9.2 A system can be described in state space form as
K1 K2
0 0 1
   
ẋ = x+ u s3
0 −1 1
which is very difficult to control by hand.
y = 1 −1 x


a) Write the system in state space form.


We want to place the closed loop poles in { −2, −3 }. Create a controller based
on pole placement and .feedback
. . . . . . . . of observer states. θ
Hint Answer Solution
Attitude
Direction
9.3 Figure 9.3a shows the Lunar Excursion Module from the Apollo project. Con- thrusters
of motion
sider the module hovering a short distance above the surface of the moon using
its main engine. If the pitch angle of the module (angle between the vertical
line and the direction of movement) differs from zero, a horizontal component
of the force is obtained and the module is accelerating along the surface. z
We will study a block diagram which shows the connection between the input u
Figure 9.3b
(the control signal to the attitude thrusters), the pitch angle θ and the position
coordinate z. See Figures 9.3b and 9.3c.

39
yref u θ̈ 1 θ̇ 1 θ z̈ 1 ż 1 z b) Introduce a controller
+ Σ K1
s s
K2
s s
− u = l0 θref − l1 θ − l2 ω
m1 m2 m3
1
such that the poles of the closed loop system becomes τ (−1 ± i) and
Feedback θ = θref in steady-state if f = 0 and θref is constant.
Figure 9.3c c) Introduce a modified controller

u = l0 θref − l1 θ − l2 ω + u0
b) In order to make the control duty of the astronaut easier we change
the dynamics of the module by making internal feedback.
. . . . . . . . . The following such that θ = θref in steady-state even for constant non-zero f and con-
signals are measurable: stant θref .
m1 , the attitude angular velocity measured using rate gyro.
Hint Answer Solution
m2 , the acceleration in z-direction measured using accelerometers posi-
tioned on gyro-stabilized platforms.
9.5 Is it possible to design an observer with poles in { −5, −6, −7, −8 } for the
m3 , the velocity in z-direction measured using doppler-radar.
system below? Motivate your answer.
Calculate a state-feedback using these signals such that the closed loop
system obtains its poles in s = − 12 and the control signal of the astronaut 0 1 1 1 1
   

becomes the reference signal of the velocity in z-direction. 0 0 1 1  10 


0 0 0 1 x + −3 u
ẋ =    
c) Suppose we by safety reasons are interested in the possibility of controlling
0 0 0 1 2
the module even if the sensors measuring m1 and m2 are not working.
y= 1 0 0 0 x

Design a controller that can handle this and has approximately the same
behavior as in a).
Hint Answer Solution
Hint Answer Solution

9.4 A DC motor with an external load, f , is described by

θ̇ = ω
1
ω̇ = − ω + c1 u + c2 f
τ
where θ is the angle, ω the angular velocity, u the control signal, f the torque
......
of the load, and c1 , c2 , and τ are constants.

a) Let y = θ and define x and the matrices A, B, C, H in a state-space


representation ẋ = Ax + Bu + Hf , y = Cx.

40
u1 x1 x2 x3 u2 a) Generate the transfer . . . . . . . . in Matlab and convert it to a
. . . . . . . . .function
state space model
.................. using ss. Which physical signals are represented by
Figure 9.6a the states in the model that ss creates from the transfer . . . . . . . . . function?
.........
b) Suppose that the system is going to be controlled using state feedback
9.6 We want to control the temperature in a long copper rod by heating or cooling
its endpoints. Principally, this problem is described by a partial differential u(t) = −Lx(t) + l0 r(t)
equation. To simplify the problem we assume that the temperature profile Compute the gain vector L using the command place for the following
in the rod can be approximated by the temperatures x1 , x2 , and x3 at three two choices of closed loop poles:
points. The temperatures in the end points are the inputs, u1 and u2 . All
 Real poles at { −2.2, −2.1 }
temperatures are relative to the temperature of the surroundings.
 Poles at −1 ± i
We get the following ordinary differential equations:
Create a temporary ss object of the closed loop system from r to y with
ẋ1 = α(u1 − x1 ) + α(x2 − x1 ) l0 set to 1, and use the command dcgain to compute the resulting closed
ẋ2 = α(x1 − x2 ) + α(x3 − x2 ) loop .static . . . . then select l0 based on this information to ensure that
. . . . . .gain,
ẋ3 = α(x2 − x3 ) + α(u2 − x3 ) the final closed loop system has .static . . . . 1. With u = −Lx + l0 r our
. . . . . .gain
closed-loop system is given by
where α is a constant that depends on the coefficient of thermal conductivity
and the specific heat of the rod. For simplicity, let α = 1. Consider the problem ẋ(t) = (A − BL)x(t) + Bl0 r(t)
of controlling the temperature in x1 , x2 , and x3 with u1 only, assuming u2 = 0. y(t) = Cx(t)
a) Assume that we want to have an arbitrary . . . . . . . . . temperature profile, that is, Note that this is the system C(sI − (A − BL))−1 Bl0 , and that the static
reach .arbitrary
......... values of x 1 , x 2 , and x3 . Is this possible? Why/why not? gain of this system is linear in l0 . Hence, if the static gain is 25 when l0
b) Assume that all the temperatures x1 , x2 and x3 are measurable. Find a is 1, it means we should use l0 = 1/25 to achive unit static gain.
state feedback
. . . . . . . . that brings any initial state to zero as e .
−3t Using the ss command the closed-loop system is created with
c) Assume that only one of the temperatures x1 , x2 , or x3 is measurable, and G_r_to_y = ss(G.A-G.B*L,G.B*l_0,G.C,0);
that we still want a controller which damps a disturbance . . . . . . . . . . . . as e
−3t
by using
What is the trade-off between response speed and control signal mag-
an observer. The sensor can be placed so that any of the three values x1 ,
nitude? A simple way to look at the control signal when performing a
x2 , or x3 is measured. Which choices of measure point make it possible
step is to define a linear system which outputs the control law −Lx + l0 r
to control the system as desired? Give a motivation. Choose one of the
instead of the controlled signal y.
points making the wanted design possible and design a controller, that
is, an observer and a state feedback, giving the desired error damping. ẋ(t) = (A − BL)x(t) + Bl0 r(t)
Hint Answer Solution u(t) = −Lx(t) + l0 r(t)
B 9.7 Consider the model of a DC-motor
. . . . . . . . . . . from applied voltage to angle. Compare this to a standard state-space model and we have
Y (s) = G(s)U (s) G_r_to_u = ss(G.A-G.B*L,G.B*l_0,-L,l_0);
step(G_r_to_y);
where
1 step(G_r_to_u);
G(s) =
s(s + 1)

41
c) Now let L be computed using linear quadratic optimization (LQ) in order 9.8 The ingestion and metabolism of a drug in a human body can be described by
to minimize the cost function the following equations:
dq(t)
Z ∞
x(t)TQx(t) + u(t)2 dt = −aq(t) + u(t)
0 dt
dm(t)
for the three choices of weight matrices given below. Compute the closed = aq(t) − bm(t)
dt
loop poles and the step . . . . . . . . . . of the closed loop system for the three
. . . . . responses
cases. Describe how the properties of the .step where the input signal u(t) is the ingestion rate of the drug, the output y(t) is
. . . . . . . . . in the different
. . . . .responses
cases. the mass m(t) of the drug in the blood, and q(t) is the mass of the drug in the
gastrointestinal tract. The constants a and b are metabolism rates, satisfying
0 0 a > b > 0. b characterizes the excretory process of the individual. In this
 
(i) Q=
0 1 example, a = 0.05 and b = 0.02.
0 0
 
(ii) Q = a) Is the system controllable?
............
0 10
b) Design a state feedback
. . . . . . . . that places the closed loop poles in −0.1.
0 0
 
(iii) Q = q(t) (the mass of the drug in the gastrointestinal tract) cannot be measured,
0 0.1
so to be able to use the state feedback
. . . . . . . . . in b) we need an observer.
d) Start from case (ii) and increase the weight on the control signal gradually c) How should the poles of the observer be selected?
until the cost function becomes
d) Design an observer with poles in −0.2.
Z ∞
x(t)TQx(t) + 10 u(t)2 dt Hint Answer Solution
0

Compare the result with the result obtained for case (i). 9.9 An object with mass m moves, without friction, subject to a force u(t) and
can be described by the differential equation
e) Start from case (i) and introduce a weight on the velocity ẏ(t). Increase
the weight gradually and study how the poles and the step . . . . . . . . . of
. . . . . response mÿ(t) = u(t)
the closed loop system change.
where y(t) is the position of the object.
Hint Answer Solution a) Let the state variables be chosen as x1 (t) = y(t) and x2 (t) = ẏ(t), assume
that m = 1 and write the model in state space form.
b) Determine a state feedback
u(t) = −Lx(t) + r̃(t)
where
L = l1

l2
such that the poles of the closed loop system have absolute value ω0 and
relative damping ζ.

42
c) Assume that r̃(t) = l0 r(t). Determine the transfer function from r(t) to c) Assume now that the measurement of the output (angle) is affected by a
y(t). measurement disturbance in terms of a sinusoid
d) Assume that l0 is chosen such that the closed loop system achieves static
ym (t) = y(t) + 0.01 sin(20t)
gain 1. Verify that this leads to l0 = l1 independent of where the closed
loop poles are placed. Why is this a natural property? Add the disturbance and plot the measured signal. Is the effect of the
Hint Answer Solution disturbance visible?

B 9.10 Consider again the model of a .DC-motor


. . . . . . . . . . in Problem 9.7, i.e. >> ym=y+0.01*sin(20*t);
>> plot(t,ym);
1
G(s) = d) Also assume that we want to estimate the angular velocity by an approx-
s(s + 1)
imate differentiation of the measured angle. This can be done as
a) Create (or reuse from Problem 9.7) the state space model of the motor.
>> s=tf(’s’); V̂est (s) = Fdif f (s)Ym (s)
>> G=1/(s*(s+1)); where
>> Gss=ss(G) s
Fdif f (s) =
τs + 1
Notice (by studying the created state-space model) that the way Mat-
lab generates the state space model from the transfer function (called and τ is a suitably chosen time constant. “True” differentiation is not
realization) results in that the output (angle) is given by x2 (t) and that possible in reality, and hence the denominator (τ s + 1) has been included.
x1 (t) represents the angular velocity ẏ(t). Computing the estimate of the angular velocity, and comparing the es-
b) Generate a time axis from 0 to 10 seconds, a square wave, i.e. a series of timate with the true angular velocity can be done using the following
steps, with period time 2 seconds. Plot the input and check that it looks Matlab sequence:
OK. >> Fdiff=s/(0.1*s+1);
>> t=0:0.01:10; >> vel_est=lsim(Fdiff,ym,t);
>> u=square(pi*t)’; >> plot(t,vel_est,t,x(:,1))
>> plot(t,u) Try some different values of the time constant τ in the range 0.01 − 1 and
Simulate the DC-motor compare the result. Is it possible to get a good estimate of the velocity?
. . . . . . . . . . . using this input, and plot the result. This can be
done using the command lsim as in the Matlab sequence below. The What happens with the estimate for low and high values of τ in the
function lsim gives both output, time and state vector as result: suggested interval?
>> [y,t,x]=lsim(Gss,u,t); e) Let us now use an observer to estimate the angular velocity. The ob-
>> plot(t,x) server is given by the equation

Do the states x1 (t) and x2 (t) behave as one can expect? The state equa- ˙
x̂(t) = Ax̂(t) + Bu(t) + K(y(t) − C x̂(t))
tions are given by (verify that by looking at the matrices Gss.a and
Gss.b) which can be rewritten as
ẋ1 (t) = −x1 (t) + u(t) ẋ2 (t) = x1 (t) 
 u(t)

˙
x̂(t) = (A − KC)x̂(t) + Bu(t) + Ky(t) = (A − KC)x̂(t) + B K
This means that the system from input to angular velocity behaves as a y(t)
first order system. (9.1)

43
The observer hence has u(t) and y(t) as inputs, and it delivers the esti-
mates x̂(t) of the states of the system. Assuming that the system is given
as an LTI-object in state space form as the variable Gss, which means
that the matrices A, B and C of the state space description are given by
Gss.a, Gss.b and Gss.c respectively, an estimate can be obtained as
follows.
Determine the gain K of the observer by placing the observer poles,
i.e. the eigenvalues of the matrix A − KC, at desired locations. As an
example, we here choose to place them in −2.
>> K=acker(Gss.a’,Gss.c’,[-2 -2])’;
Generate the observer as an LTI-object. Compare equation (9.1).
>> G_obs=ss(Gss.a-K*Gss.c,[Gss.b K],eye(2),zeros(2,2));
Estimate the states and compare the estimate with the true angular ve-
locity.
>> [yhat,t,xhat]=lsim(G_obs,[u ym],t);
>> plot(t,xhat(:,1),t,x(:,1))
Plot also the estimation error
>> plot(t,x(:,1)-xhat(:,1))
Try some different locations of the observer poles and observe the differ-
ence in behavior of the estimate. Compare also the estimate of the angle
and the measurement.
Hint Answer Solution

44
11 Implementation
11.1 If you discretize the controller
s+b
U (s) = KN ( )E(s)
s + bN
with Tustin’s formula you get a discrete-time controller of the form

u(t) = β1 u(t − T ) + α1 e(t) + α2 e(t − T )

What are the values of α1 , α2 , and β2 , if T = 0.1, N = 10, b = 0.1, and


K = 2?
Hint Answer Solution

45
Hints
This version: 2021-08-12
1 Mathematics
1.1 Use the table on page 233, and linearity of the Laplace transform (rule A.5 on 1.8 x in dB20 is given by 20 log10 x
page 232). Go back
Go back
1.9 What should A−1 A be?
1.2 a) Plug in what you know about ẏ(t) for large t
Go back
b) Apply Laplace transforms and solve for Y (s)
c) Insert the Laplace transform of the step u(t) to obtain U (s), and then
apply the theorem limt→∞ y(t) = lims→0 sY (s)
Go back

1 1
1.3 Start by writing using partial fractions, such as s2 +s = s(s+1) = A
s + B
s+1
Go back

1.4 Apply Laplace transform to all terms in the differential equation, and use
the table on page 233. For (a), you can alternatively proceed by deriving
the transfer . . . . . . . . from u to y, and use the results on page 234 which
. . . . . . . . .function
1
lists step
. . . . . . . . . . . . . . . y(t), assuming a unit
responses . . . . input U (s) = s and Y (s) =
. . . . .step
F (s)U (s), given a .transfer . . . . . . . . F (s).
. . . . . . . . .function
Go back

1.5 Apply Laplace transform to both differential equations, eliminate Z(s), and
go back.
Go back

1.6 Compute the roots!


Go back

1.7 z = |z| ei arg(z) , |a + bi| = a2 + b2 , arg(a + bi) can be computed from
arctan(b/a) but you have understand in which orthant you are and com-
pensate accordingly (arg(1 + i) and arg(−1 − i) leads to the same result
but their argument differ), |z1 z2 | = |z1 | |z2 |, arg(z1 z2 ) = arg(z1 ) + arg(z2 ),
|z1 /z2 | = |z1 | / |z2 |, arg(z1 /z2 ) = arg(z1 ) − arg(z2 ), eiφ = cos(φ) + i sin(φ)
Go back

1
2 Dynamic Systems
2.1 Start with J θ̈(t) = −f θ̇(t) + M (t) and try to write M (t) as a function of θ(t) B 2.7 You can easily compute the zero by hand, but also try using the command
and u(t) by eliminating i(t). tzero.
Go back Go back

2.2 What is the relationship between the response of the system and the pole 2.8 See Glad&Ljung page 64.
locations? Stability, oscillations, and speed are typical properties to look for. Go back
Go back
2.9 What is the relation on the steady-state values among the four responses,
2.3 a) Use the final and how is the steady-state value related to the .transfer . . . . . . . . . when you
. . . . . . . . function
. . . . . .value . . . . . . . . to find the steady state gain, and calculate
. . . . . .theorem perform a step? How is dynamic behaviour related to the poles.
the time constant by estimating the time to reach 63% of the final value.
Go back
b) If it moves with a certain velocity, how long time does it take to reach a
position further down?
Go back

2.4 Identify the coefficients ω0 and ζ in the system description for the known and
unknown system
ω02
G(s) = 2
s + 2ζω0 s + ω02

Go back

2.5 What do you know about complex vs real poles? What happens if you have
a pole in the origin? Can you find the exact step . . . . . . . . . if you have the
. . . . .response
1
transfer function
.................. s ? If you have a zero in the origin, what happens when you
use the .final value theorem
................... on a step response?
Go back

B 2.6 The important properties to study is how the absolute value of the poles
relate to how fast the system is, and how the relation between real and imag-
inary part (i.e. the .argument)
. . . . . . . . . relates to oscillations and .overshoots
. . . . . . . . . (and thus
settling time).
.............
Go back

2
3 Feedback Systems
3.1 a) The volume of water is Ay(t) where A is the cross section area, so the c) Characteristic equation:
change in volume per time unit is what mathematically?
s(s − 1)(s + 6) + K(s + 1) = 0
b) Static gain, final
. . . . . value
. . . . . . .theorem...
........
P (s) = s(s − 1)(s + 6), Q(s) = s + 1.
c) The outflow caused by the pump enters in the block diagram as a
Go back
. . . . . . . . . . . . on the input signal of the tank.
disturbance
Go back
3.6 Derive the general closed loop transfer . . . . . . . . by first deriving the
. . . . . . . . .function
3.2 a) Apply Laplace on all terms in the definition of the controller.
transfer . . . . . . . . . for the inner loop.
. . . . . . . . .function

b) Write down all relations you know E(s) = R(s) − Y (s), X(s) = a) Let α = 0. The characteristic equation is then
GV (s)U (s),..., and then draw.
s(s + 2) + 4K = 0
c) Use your relations, and solve for Y (s).
Compute the poles explicitly as a function of K.
Go back
b) The characteristic equation is
3.3 a)
s(s + 2) + 4K(1 + s) = 0
b) Plug in R(s) and V (s) and apply the final
. . . . . value
. . . . . . .theorem.
........
c) Characteristic equation:
c) Same as above, just a new controller.
d) What do you know about the connection between characteristic be- s(s + 2) + 4K(1 + s/3) = 0
haviour, position of poles, and the damping ratio.
d) Characteristic equation:
Go back
3.4 Go back s2 + 2s + 4 + 4αs = 0
B

3.5 a) The characteristic equation is Go back

s(s + 1)(s + 3) + K(s + 2) = 0 3.7 a) Start by deriving the characteristic equation (s + 1)(s − 1)(s + 5) + K = 0
so you can define P (s) and Q(s)
which gives P (s) = s(s + 1)(s + 2) and Q(s) = s + 2.
b) Characteristic equation:
b) Characteristic equation:

s(s2 + 2s + 2) + K = 0 (s + 1)(s − 1)(s + 5) + K(1 + 0.5s) = 0

P (s) = s(s2 + 2s + 2), Q(s) = 1. Go back

3
3.8 Check the root . . . . . to find in which order different K-values gives a sta-
. . . . .locus 3.17 a) To compute the closed loop transfer . . . . . . . . combine
. . . . . . . . .function
ble/unstable system, more/less oscillative system.
θ(s) = G(s)U (s)
Go back
and
3.9 Investigate the starting points and end points of the root U (s) = F (s)(θref (s) − θ(s))
. . . . .locus.
.....
Go back b) The control error can be computed using
1
3.10 Since G(s) has no poles in the RHP, the closed loop system is stable if the E(s) = θref (s)
1 + F (s)G(s)
Nyquist path of KGo does not encircle −1. Note that the K will only modify
the distance to the origin, not the shape of the curve. To find the steady-state error, use the final
. . . . . value
. . . . . . theorem.
........
Go back
c) See b).
Go back
3.11 Study the amplitude and phase of G(iω).
Go back 3.18 Go back

3.12 a) Draw the complete Nyquist path and use the Nyquist criterion. (Note 3.19 Go back
that Go (−iω) is the mirror image of Go (iω), mirrored in the real axis.)
3.20 Go back
b) Use the final
. . . . . .value . . . . . . . . and that Go (0) is known from the Nyquist
. . . . . .theorem,
path.
3.21 Go back
c) Apply the Nyquist criterion to K
s G(s)
Go back

B 3.13 Go back

B 3.14 Go back

B 3.15 Go back

3.16 Check the .steady


. . . . . . .state . . . . . the relative damping, etc.
. . . . . .error,
Go back

Go back

4
4 Frequency Description
4.1 Start by subtracting the constant levels from all inputs and outputs. De- 4.4 Check the final values of y(t) against the static . . . . . G(0). Check also the
. . . . . . gain
termine the angular frequency ω of the signals using the figure. Remember . . . . . . . . . . of y(t) against the height of the resonance peaks in G(iω). Check
overshoots
ω = 2πT where T is the period time (not to be confused with any time constant the frequency of the oscillation in y(t) against the resonance frequency in
of a first order system). Use the relationship saying that when u(t) = A sin ωt G(iω).
the output becomes Go back
y(t) = |G(iω)| A sin(ωt + arg G(iω)) B 4.5 Use Matlab, in particular the command bode or bodemag.
to determine gain |G(iω)| and phase shift arg G(iω). Use that phase shift is Go back
given from time difference ∆T by ω∆T
Go back 4.6 Recall that for stable, linear systems “a sinusoid in gives a sinusoid out” after
initial transients.
Go back
4.2 a) For K = 0.5 the open loop system is given by

0.05(1 + s/0.02) 4.7 Recall that for stable, linear systems “a sinusoid in gives a sinusoid out” after
Go (s) = F (s)Gr (s)Gs (s) =
s(1 + s/0.01)(1 + s/0.05)(1 + s/0.1) initial transients.
Go back
Use the rules in Glad&Ljung to make the Bode plot.

b) What can be said about the phase and .gain . . . . . . . when the output of
. . . . .margin 4.8 Go back
the closed loop system oscillates with constant amplitude?

c) When the reference signal is A sin αt the output signal becomes 4.9 Go back

y(t) = |Gc (iω)| A sin(αt + arg Gc (iω)) 4.10 Go back

The Bode plot of the open loop system can be used to compute Gc (iω).
4.11 Go back
Go back
4.12 a)
4.3 a) Check the behavior of G(iω) when ω → 0 and ω → ∞ respectively. See
also if the absolute value and the argument b)
. . . . . . . . . . decrease monotoneoulsy or
not. c)
b) Translate the behavior of the amplitude and phase curves to a pole-zero d)
diagram.
Go back
Go back

5
5 Compensation
5.1 a) Glad&Ljung gives a good description of how Bode plots can be drawn by B 5.7 bode and margin.
hand. Go back
b) A proportional controller does not affect the phase curve.
5.8 Go back
c) Try lead compensator.
5.9 Study GO (iω) and GC (iω) at low frequencies and around the
5.2 Check for signs of dominating poles, pure integrations, resonance frequencies.
. . . . . . . . . . of GO (iω), and remember that from GC = 1+GO
GO
gain
. . . . . .crossover
. . . . . . . . . .frequency
And remember, Gc = 1+G Go
o
, so if you know the value of either one of them you can infer the value of one if you know the value of the other
in a frequency, you the value of the other. This is particularily easy to use if
either of them is 0, 1 or ∞. Use connections between .gain
. . . . .crossover
. . . . . . . . . . frequency
.......... 5.10
and closed-loop bandwidth.
Go back
5.11 By increasing K you increase the loop . . . . . and thus move the
. . . . . gain
gain crossover frequency
.......................... to the right and make the system faster. By reducing
5.3 Draw asymptotic Bode plot using the guidelines in Glad&Ljung. See the β you increase the phase margin and add more derivative action.
..............
discussion on lead-lag compensators in Glad&Ljung.
Go back

5.4 Start by adjusting Figure 5.4b to obtain the Bode plot of G.


Go back

5.5 b) It is possible to derive limits on K using either the Bode plot or the
Nyquist curve.
c) Use the final
. . . . . value
. . . . . . .theorem.
........
d) A time . . . . . is described by the transfer
. . . . . delay ........ e
. . . . . . . . .function
−sT
.
Go back

5.6 Think of all possible phase curves.


Go back

6
6 Sensitivity and Robustness
6.1 The sensitivity . . . . . . . . . is the .transfer
. . . . . . . . . . . function . . . . . . . . . from v to y.
. . . . . . . . function b) Derive the relative model error
Go back
G0 (s) − G(s)
∆(s) =
G(s)
6.2 Derive the relative model error
G0 (s) − G(s) Check where the absolute value of the inverse of the relative model error
∆(s) = intersects |Gc (iω)| given in the figure. It is sufficient to check the low
G(s)
frequency asymptote.
Make a simple plot of Gc (iω) using the information in the problem formulation.
Compare with the inverse of the relative model error. c) What can be said about the necessity and sufficiency of the stability con-
ditions in a) and b)?
Go back
Go back
6.3 Convert the condition that the amplitude of y is larger than the amplitude of
v to the condition 6.7 Check where the absolute value of the relative model error intersects |Gc (iω)|
|1 + Go (iω)| < 1 given in the figure.
What does this inequality say about the distance between the Nyquist curve Go back
and the origin?
Go back 6.8 Derive the closed loop equation relating y(t), r(t), v(t), and n(t) using
Y (s) = V (s) + Go (s)(R(s) − N (s) − Y (s)). Then use the fact that the
6.4 Compute the transfer . . . . . . . . . of the closed loop system. Apply the robustness
. . . . . . . . .function
sensitivity . . . . . . . . S(s) and the complementary
. . . . . . . . . . . .function . . . . . . . . . . . . . . . . .sensitivity . . . . . . . . . T (s) are
. . . . . . . . . . .function
criterion using the given upper bound of the relative model error. related as S(s) + T (s) = 1. (Here T (s) coincides with the closed loop system.)
Go back B 6.9 a) The relative model error is given by

6.5 a) Derive the relative model order G0 (s) − G(s)


∆(s) =
G(s)
G0 (s) − G(s)
∆(s) =
G(s) b) Use Matlab and results from previous exercises.
and plot 1/ |∆(iω)|. Go back
b) Determine the level that |Gc (iω)| cannot exceed.
Go back

6.6 a) The characteristic equation becomes


s2 (s + 1) + α(s2 + s + 4) = 0

7
7 Special Controller Structures
7.1 a) Use the relationship B 7.3 Go back

1 1
 
H(s) = U (s) − V (s)
As 1 + s/2

b) Derive the .transfer . . . . . . . . . from V to H when both feedforward and


. . . . . . . . function
feedback
........ are used.
Go back

7.2 a) Use Y (s) = (Gu (s)Ff (s) + Gv (s)) V (s).

b) Recall that for stable, linear systems “a sinusoid in gives a sinusoid out”
after initial transients.
Go back

8
8 State Space Description
8.1 Define x1 = θ, x2 = θ̇, and utilize the differential equation for the motor. 8.8 The system is minimal, compute the transfer
. . . . . . . . . function.
.........
Go back Go back

8.2 For the nonlinear equation ẋ2 = f2 (x1 , x2 , u), the linearized equation is given 8.9 a) For small deviations around 0, sin(φ) ≈ φ, cos(φ) ≈ 1. Take z̈ as input.
by 1
b) det S = α (1 − α1 )2
ẋ2 = f2 (x1,0 , x2,0 , u0 ) Go back
∂f2
+ (x1,0 , x2,0 , u0 ) · (x1 − x1,0 )
∂x1 8.10 Go back
∂f2
+ (x1,0 , x2,0 , u0 ) · (x2 − x2,0 )
∂x2 8.11 a) A stationary point fulfills f (x0 , u0 ) = 0, y = h(x0 , u0 ).
∂f2
+ (x1,0 , x2,0 , u0 ) · (u − u0 )
∂u b) Use
A = fx (x0 , u0 ) B = fu (x0 , u0 )
Go back C = hx (x0 , u0 ) D = hu (x0 , u0 )

8.3 Remember q =
R
r → q̇ = r, and 1
denotes integration. Go back
s
Go back
8.12 When given an input-output relation Z(s) = B(s)
A(s) W (s), start by writing as
A(s)Z(s) = B(s)W (s) and go back to time-domain to see the differential
8.4 Use canonical forms.
equation.
Go back
Go back

8.5 Take the Laplace transform of g(t).


8.13 a) At equilibrium, the derivative is 0 (velocity is not changing).
Go back
b)
8.6 G(s) = C(sI − A) −1
B. c)
Go back Go back

8.7 b) Compare what happens to the states as t → ∞, to the transfer


. . . . . . . . .function
........
poles.
c) Check if det S and det O are nonzero.
Go back

9
9 State Feedback
9.1 a) The closed loop system ẋ = Ax + Bu, y = Cx, u = −Lx + r has charac- 9.7 a) The connection between the states and the output is given by the C ma-
teristic polynomial det(sI − A + BL) = 0. trix, and connections between the states and their derivatives are revealed
by the matrix A.
b) Closed loop system is ẋ = (A − BL)x + (Bl0 )r, y = Cx. Use (8.15) in
book with these matrices and variables. We must have limt→∞ y(t) = r(t) Go back
when r(t) is constant.
Go back 9.8 Go back

9.2 First develop the state feedback 9.9 Go back


. . . . . . . . law, and then develop an observer to supply
state estimates to replace the states in the .feedback
. . . . . . . . law. The observer should
have poles faster than the designed closed loop poles. B 9.10 Go back
Go back

9.3 a) Write the system in state space form by introducing three state variables
corresponding to the outputs of the three left-most integrators in the
figure (ż = output). Design a state feedback
. . . . . . . . . controller u = −Lx + yref
and place the poles in −0.5.
c) Design an observer with poles to the left of the closed loop poles.

9.4 a) A state
. . . . . .space . . . . . . is a collection of first order derivatives...
. . . . . .model
b) Use your state
. . . . . .space . . . . . . The constant l0 is most easily found by using
. . . . . .model!
that θ̇ = ω̇ = 0 at steady state.
c) Introduce the integrated control error as an auxillary state.
Go back

9.5 Is the system observable?


Go back

9.6 a) Is the system controllable?


............
b) What does it mean to have a pole at −p?
c) Is the system observable?
Go back

B
10
11 Implementation
11.1 Go back

11
Answers
This version: 2021-08-12
1 Mathematics
1.1 a) s.
A
1.5 y (3) + 2ÿ + 2ẏ + y = u
Go back
b) s2 .
A

1
c) s+2
1.6 Roots given by s = ±
d) s
s2 +25 Go back
e) sU (s) − u(0)

2ei 4
π
f) sU (s). (u(0) = 0 is a common assumption in the course.) 1.7 a)

2 −i 180
105
g) s2 U (s) − su(0) − u̇(0) b) 10 e
π


h) s2 U (s). (u(0) = u̇(0) = 0 is a common assumption in the course.) c) 1 + 3i

i) A time . . . . . . . . signal has Laplace transform, e


. . . . . delayed
−sT
U (s). d) −5
Go back Go back

1.2 a) limt→∞ y(t) = 5/2 1.8


deciBel (dB20 ) Definition Amplification F
1
b) Y (s) = s+2 U (s) 20 20 log F = 20 ⇒ F = 101 = 10
−3 20 log F = −3 ⇒ F = 10−3/20 ≈ 0.708 ≈ √12
c) limt→∞ y(t) = 5/2 (of course!)
0 20 log F = 0 ⇒ F = 100 = 1 √
Go back 10 20 log F = 10 ⇒ F = 100.5 = 10 ≈ 3.16
−10 20 log F = −10 ⇒ F = 10−0.5 = √110 ≈ 0.316
1.3 a) f (t) = 1 − e−t ; 1.
Go back
b) f (t) = −0.5e−t + 0.5et ; ∞.

c) f (t) = e−t · t; 0. 1.9 Multiplication of the two matrices gives the unit matrix.
Go back Go back

1
1.4 a) y(t) = 2 − e−t + 12 e−2t , t≥0

b) y(t) = 1 − 0.5e−t + 0.5 sin t − 0.5 cos t


Go back

1
2 Dynamic Systems
2.1 a) Differential equation 2.6 GA is slow compared to GB , GC is slow compared to GD , GE is very oscillative
compared to GF (s). Consistent with dominant pole distance to origin mainly
1 controlling speed, and angle to real line specifying oscillatory behaviour.
θ̈(t) + · θ̇(t) = k0 · u
τ
Go back
where
1 Ra f + ka kv ka 2.7 α > 0 gives overshoot,
= k0 = B . . . . . . . . . . α < 0 gives undershoot.
τ JRa JRa
Go back
b) transfer
. . . . . . . . .function
.........
θ(s) k0
G(s) = = 2.8 a) 1.5
U (s) s(s + 1/τ )
b) M ≈ 26%
c) Step
. . . . . .response
........
θ(t) = k0 τ t − k0 τ 2 (1 − e−t/τ ) c) Tr ≈ 1.5

Go back d) Ts ≈ 7.8
Go back
2.2 (1) K = 0.1
(2) K = 2.5 2.9 G1 –C, G3 –B, G4 –A, G5 –D.
Go back
(3) K = 3
(4) K = 0.5
Go back

10e−(L/V )s
2.3 G(s) = 1+3s
Go back

2.4 a) a < 1
b) b = 2
Go back

2.5 A–2, B–6, C–1, D–3, E–5, F-4.

B
2
3 Feedback Systems
1
v b) Steady state level is 5 − KP , but the system will be oscillatory if KP is
large.

u x y
Gv (s) + Σ Gt (s) c) As long as the system is stable, the steady state level will equal the ref-
erence.
Figure 3.1a
d) The derivative part in the .feedback
. . . . . . . . can be used to improve the damping
3.1 a) transfer 1 (move poles towards the real line) in the closed loop system, that is, to
. . . . . . . . . of the tank is Gt (s) =
. . . . . . . . .function s.
make it less oscillatory.
b) kv = 2, T = 5 Go back
c) A block diagram is given in Figure 3.1a.
B 3.4 a) For small values of KP the step . . . . . . . . . is slow, well damped and the
. . . . . response
Go back steady state error
.................. is large. For increasing KP the step . . . . . . . . . becomes
. . . . .response
faster but more oscillatory, while the error is reduced. For large KP the
amplitude of the oscillations increases, that is, the closed loop system
v becomes unstable.
− b) The integrator in the regulator eliminates the steady
r e u x y . . . . . . .state . . . . . A too
. . . . . .error.
+ Σ F (s) Gv (s) + Σ Gt (s) small value of KI gives a large settling time
............. while a too large value gives
− an oscillatory (finally unstable) closed loop system.

Figure 3.2a c) Using the (approximate) derivative of the error in the regulator increases
the damping of the closed loop system. Increasing KD too much, however,
gives that an oscillation with higher frequency appears in the .step
. . . . .response
........
3.2 b) A block diagram is given in Figure 3.2a. and finally (approximately when KD > 65) the closed loop system be-
c) comes unstable.
2(KD s2 + KP s + KI ) Go back
Y (s) = R(s)
5s3 + (1 + 2KD )s2 + 2KP s + 2KI
s(1 + 5s)
− 3 V (s) 3.5 Root loci are shown in Figure 3.5a.
5s + (1 + 2KD )s2 + 2KP s + 2KI

Go back b) Intersection with the imaginary axis for K = 4, ω = ± 2.

c) Intersection with the imaginary axis for K = 7.5, ω = ± 1.5.

3.3 a) The poles are located at −0.1 ± 0.01 − 0.4KP , and are stable for all
KP > 0. Conclusions about the step . . . . . . . . . of the corresponding systems:
. . . . . response

3
5 2 1
2

4
0.8
1.5 1.5
3
0.6
1
1
2
0.4

1 0.5
0.5
0.2
Imag Axis

Imag Axis

Imag Axis

Imag Axis
0 0
0 0
−1
−0.5
−0.2
−2 −0.5
−1
−0.4
−3
−1
−1.5 −0.6
−4

−1.5
−5 −2 −0.8
−4 −3 −2 −1 0 1 2 −2 −1.5 −1 −0.5 0 0.5 1
Real Axis Real Axis
8 −2 −1
−3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 −3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2
Real Axis Real Axis
6 2 2

4 1.5 1.5

2
1 1
Imag Axis

0
0.5 0.5

Imag Axis

Imag Axis
−2
0 0

−4

−0.5 −0.5
−6

−1 −1
−8
−7 −6 −5 −4 −3 −2 −1 0 1 2 3
Real Axis
−1.5 −1.5

Figure 3.5a −2
−7 −6 −5 −4 −3 −2 −1 0 1 2
−2
−3 −2.5 −2 −1.5 −1 −0.5 0 0.5 1
Real Axis Real Axis

Figure 3.6a
a) Asymptotically stable all K > 0.
Small K: No oscillations, larger K gives faster system.
Larger K: Oscillations. Larger K gives more oscillations. The root loci are shown in Figure 3.6a.
b) Asymptotically stable for 0 < K < 4. Oscillating all K > 0. a) Asymptotically stable for all K > 0, oscillatory for large K.
Small K: larger K gives faster system.
Larger K: larger K gives more oscillating system. Unstable for large K b) Asymptotically stable for all K > 0, not oscillatory for any K.
(> 4).
c) Asymptotically stable for all K > 0, no oscillations for small and large
c) Asymptotically stable for K > 7.5. Unstable for K < 7.5. Stable and K, faster for large K.
oscillating for K > 7.5. Larger K gives faster system, until the real pole
d) Asymptotically stable for all α > 0. Oscillatory for small α. Larger α
becomes dominating, then larger K gives a slower system.
gives more damped system.
Go back
With the tachometer . . . . . . . . we can make the system both fast and well
. . . . . . . . . . . . feedback
damped. The .tachometer . . . . . . . . is equivalent to the D-part in a PID con-
. . . . . . . . . . . feedback
3.6 General characteristic equation: troller.
s(s + 2) + 4K(1 + αs) = 0 Go back

4
8

6
8

6
a) b)
4 4
Im Im
2 2
Imag Axis

Imag Axis
0 0

−2 −2
ω
−4 −4

−6 −6
Re Re
−8
−7 −6 −5 −4 −3 −2 −1 0 1 2 3
−8
−6 −5 −4 −3 −2 −1 0 1 2 3
ω
Real Axis Real Axis

Figure 3.7a

Figure 3.11a
3.7 Root loci in Figure 3.7a.

a) The system is unstable for all K. 3.11 The Nyquist curves are shown in Figure 3.11a.
b) Asymptotically stable for K > 5. Go back

Go back
3.12 a) K < 2/3
1
3.8 K Step b) 1+2K when K < 2/3
4 C
10 D c) K < 2/3
18 B Go back
50 A
Go back B 3.13 a) The root . . . . . with respect to KP is shown in Figure 3.13a. When KP
. . . . .locus
increases the two complex poles move towards the imaginary axis, that is,
the closed loop system becomes more oscillatory. Finally, for KP ≈ 6.2,
3.9 The poles of the system all tends to points in the LHP or to −∞ for large K. the poles cross the imaginary axis and the closed loop system becomes
Go back unstable. This result is in accordance with Problem 3.4. For small values
of KP the properties of the step . . . . . . . . . are mainly determined by the
. . . . .response
real pole close to the origin. For larger values the complex poles start
3.10 a) The closed loop system is stable in (i), (ii), and (iv). to dominate and when the complex poles cross the imaginary axis the
amplitude of the oscillations in the .step . . . . . . . . increases and the system
. . . . .response
b) Stable when: (i) K < 2.5, (ii) K > 0, (iii) K < 1/2, and (iv) K < 1/4 or becomes unstable.
K > 1/2. Note, however, that the root . . . . . alone does not give sufficient informa-
. . . . .locus
Go back tion to tell how the steady . . . . . . changes with the parameter.
. . . . . . . . . . . . . error
state

5
2.5 1.5

1
1.5

1
0.5

0.5
Imag Axis

Imag Axis
0 0

−0.5

−0.5
−1

−1.5
−1

−2

−2.5 −1.5
−1 −0.8 −0.6 −0.4 −0.2 0 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 Real Axis

Figure 3.13a Figure 3.13b

b) The root . . . . . with respect to KI is shown in Figure 3.13b. For small


. . . . . locus B 3.14 a) The Nyquist curve is “far away” from the point −1 for all frequencies
KI the response of the closed loop system is dominated by the poles on and the step . . . . . . . . . of the closed loop system is well damped. As KP
. . . . .response
the real axis close to the origin. When KI increases the poles become increases the Nyquist curve grows in size and for KP = 6.2 the Nyquist
complex and move towards the imaginary axis, that is, the closed loop curve reaches −1 and thus is the limit of stability.
system becomes more oscillatory. Finally, for KI ≈ 1.5, the poles cross
the imaginary axis, that is, the closed loop system becomes unstable. As b) For low frequencies the Nyquist curve is now far away from the origin
can be seen in Problem 3.4 a small value of KI , that is, a pole close to since the integrating part makes |G(iω)| large for low frequencies. The
the origin, gives a slow .step Nyquist curve now passes closer to −1 which results in a more oscillatory
. . . . . . . . When KI increases the dominating
. . . . .response.
poles become complex and the step closed loop system. The system becomes unstable around KI = 1.44.
. . . . . . . . . becomes oscillatory.
. . . . .response
A large .settling . . . . will typically follow if the system is slow or has poor
. . . . . . . .time c) The Nyquist curve is now further away from −1 which corresponds to
damping. Here, the large .settling . . . . for small KI is due to the system
. . . . . . . .time an improved damping of the closed loop system. The system becomes
being slow. That the steady . . . . . is eliminated cannot easily be
. . . . . . . . . . . . .error
state unstable around KD = 66.
seen in the root locus.
.......... Go back
c) The root . . . . . with respect to KD is shown in Figure 3.13c. When KD
. . . . .locus B 3.15 a) ωc = 0.38, ωp = 1.1, ϕm = 94◦ and Am = 3.1.
increases the complex poles closest to the origin move towards the origin
and and at the same time the damping of the poles is increased. When b) The closed loop system is now much more oscillatory due to the reduced
KD increases even more the second pair of complex poles moves towards phase and .gain
. . . . .margins.
.......
the imaginary axis giving a high frequency oscillation which finally gives
instability. c) KP = 3.1.
Go back Go back

6
4
3.18 Gc = Go
1+Go
3 Go back
2

Imag Axis
1 3.19 a) Go = F G
0 b) Gc = FG
1+F G
−1
c) Gny = − 1+F
FG
G
−2
1
d) Gre = 1+F G
−3
Go back
−4
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2
Real Axis
3A
3.20 a) 3+K
Figure 3.13c
1
b) F (s) = s (for example)
3.16 A–iii, B–i, C–iv, D–ii. c) Poles in −2, −2. No zeros.
Go back Go back

Go back
3.21 A–4, B–2, C–3, D–1.
3.17 a) KP small ⇒ Both poles on the real axis, but one pole very close to the Go back
origin ⇒ Slow but not oscillatory system.
KP = 1/(4τ 2 k0 ) ⇒ Both poles in −1/(2τ ), that is, faster than in (1) but
still no oscillations.
KP large ⇒ Complex poles with large imaginary part relative to the real
part, that is, oscillatory system.
b) If the reference is a step,
lim e(t) = 0
t→∞

If the reference is a ramp,


A
lim e(t) =
t→∞ KP k0 τ

c) limt→∞ e(t) = 0
Go back

7
4 Frequency Description
0.16 √1
4.1 G(s) = s+0.16 4.6 y(t) = 5
sin(2t − 1/2 − 4 − π
2 − arctan 2).
Go back Go back

4.2 a) See figure in the solution. ωc = 0.025, ϕm = 31◦ , Am = 2.5. 4.7 a) 0.45 sin(2t − 1.1)

b) The period time will be 108 seconds, K = 1.25. b) Unstable system.

c) B = 8◦ , β = 0.02 rad/s and ϕ = −42◦ . c) 0.11 sin(2t − 2.4)


Go back d) 0.45 sin(2t − 2.1)
Go back
4.3 a) Figure 4.3a in Solutions.

b) Figure 4.3b in Solutions. 4.8 a,b)


ω |G(iω)| arg G(iω)
Go back
1 1 = 0 dB20 −0.2 rad = −11◦
5 0.8 = −1.9 dB20 −0.9 rad = −52◦
4.4 A–B, B–C, C–D, D–A. 10 0.5 = −6 dB20 −1.6 rad = −92◦
20 0.2 = −14 dB20 −2.2 rad = −126◦
Go back
c) See Figure 4.8a in Solutions.
B 4.5 a)
System Staticgain ωB ωr Mp Go back
GA 1 0.96
GB 1 3.2
4.9 G1 –B, G2 –D, G3 –A, G4 –C, G5 –E.
GC 1 6.35 3.55 1.15
GD 1 12.71 7.08 1.15 Go back
GE 1 7.71 4.95 5.02
GF 1 6.87 4.15 1.36 4.10 Bode gain–step response pairs: A–D, B–C, C–A, D–B.
b) The bandwidth of a system is (approximately) inversely proportional to Go back
the rise . . . . The damping is inversely proportional to the height of the
. . . . .time.
resonance peak. A large peak implies low damping and large overshoot. ..........
As the damping ζ approaches 0 the resonance frequency approaches ω0 , 4.11 a) B – a – 1 – II and A – b – 2 – I.
ω2
in a second-order system s2 +2ζω00 s+ω2 b) B – b – 1 – I and A – a – 2 – II.
0

Go back Go back

8
4.12 a) Pole s = −1 and zero s = −α.
b) The static gain is 1.

c) 1/α
d) See Figure 4.12a

Bode Diagram
Bode Diagram 1
0.95
1.9
1.8 0.9

1.7 0.85

1.6 0.8

Magnitude (abs)
Magnitude (abs)

1.5 0.75

1.4 0.7

1.3 0.65

1.2 0.6

1.1 0.55

0.5
10 -2 10 -1 10 0 10 1 10 -1 10 0 10 1 10 2
Frequency (rad/s) Frequency (rad/s)

Figure 4.12a. | G(iω) |. Left curve for α = 0.5. Right curve α = 2.

Go back

9
5 Compensation
5.4 The following compensator fulfills the requirements:
1

Am = 5.02
0.7 2
|G(iω)|

s + 0.53 s + 0.105

0.525 0.5
F (s) = 4.4 · 4
0.3 s + 0.53 · 4 s + 0.105/195
0.2
Go back
0.1
0◦

ϕm = 88.13◦
arg G(iω)

-90◦ Im
-130◦
-180◦
−0.091 1
ωp = 3.2

-270 Re
0.03 0.05 0.07 0.1 0.2 0.3 0.5
ωc = 0.079 0.145 ωp = 0.28 ω [rad/s]
133◦
Figure 5.1a
ωc = 0.78

5.1 a) See Figure 5.1a.


b) Largest gain crossover frequency: 0.14 rad/s.
c) One controller that fulfills the requirements is the lead compensator (with
gain adjustment)
s + 0.106 Figure 5.5a
F (s) = 1.9 · 7
s + 0.106 · 7
5.5 a) See Figure 5.5a.
5.2 A–E–C, B–C–E, C–A–B, D–D–D, E–B–A.
b) Asymptotically stable for 0 < K < 10.
Go back
c) limt→∞ e(t) = 5

5.3 One controller which satisfies the demands is d) T < 0.4


s + 8.0 s + 1.8 Go back
F (s) = 1.2 · 5 ·
s + 5 · 8.0 s + 1.8/84

Go back 5.6 a) Impossible to determine.

10
b) It is stable. B 5.7 a) ωc = 5 rad/s, ωp = 9.5 rad/s, Am = 3.5 and ϕm = 27◦ .
Go back b)-d) See solution.
Go back

5.8 a) The maximum gain. . . . . .crossover . . . . . . . . . . is ωc = 0.27 rad/s and it is


. . . . . . . . . .frequency
acheived for K = 2.86.
b) The steady
. . . . . . . state . . . . . is approximately 1.75.
. . . . . .error
c)
(4.4s + 1) (37s + 1)
F (s) = 2.39
(0.7 · 4.4s + 1) (37s + 0.1)

Go back

5.9 The combinations are: A - III, B - I, C - II, and D - IV.


Go back

5.10 a) One possible solution is p = 1, n = 2, and m = 0.


b)
(0.92s + 1) (3.3s + 1)
F (s) = 3.6 .
(0.92 · 0.13s + 1) (3.3s + 0.036)

5.11 A – iii, B – ii, C – i and D – iv

11
6 Sensitivity and Robustness
1
6.1 The gain of the sensitivity is: 6.7 0 ≤ γ < 35
√ Go back
2
|S(1i)| = p
(K − 1)2 + 1
6.8 y(t) = √1 sin(t − π4 ) − sin(t)
2
and the requirement on K becomes K > 2.
Go back
Go back
1
B 6.9 a) ∆(s) = − s+1
s

6.2 The maximum bandwidth is ωB = 1. b) Stability cannot be guaranteed for F (s) = 1, while it can be guaranteed
Go back for the regulator from Problem 5.7.
Go back

6.3 See the solution, Figure 6.3a.


Go back

6.4 Yes.
Go back

6.5 a) See the solution, Figure 6.5a.

b)
F (iω)G(iω) 1
<
1 + F (iω)G(iω) 2

Go back

6.6 a) Asymptotically stable for α > 3. See the solution, Figure 6.6a.

b) α > 4

c) The robustness criterion gives a sufficient but not necessary condition.


Go back

12
7 Special Controller Structures
4(s+1)
7.1 a) Ff (s) = 1, and h(t) = − A0.1
· 2 (1 − e ).
−2t
B 7.3 a) Ff (s) = − 3(s+2)(s+5)

b) Zero .steady
. . . . . . .state
. . . . . .error.
..... b) limt→∞ y(t) = −0.012
Go back 0.012
c) limt→∞ y(t) = − 3K+1
d) y(t) doesn’t have a final value.
7.2 a)
Gv 3(s + 3) Go back
Ff = − =−
Gu 2(s + 4)

b) The amplitude of the control signal is 3.


9(1−b/2)
c) limt→∞ y(t) = 12+4Kb
Go back

13
8 State Space Description
8.1 b)

0 1 0 ẋ1 (t) = −x1 (t) + x3 (t) + 4u(t)


   
ẋ = x+ u
0 −1/τ K ẋ2 (t) = −3x1 (t) + 2u(t)
y= 1 0 x

ẋ3 (t) = −5x1 (t) + x2 (t) + u(t)
y(t) = x1 (t)
Go back
c)

ẋ1 (t) = −2x1 (t) − u(t)


8.2
ẋ2 (t) = −3x2 (t) + 3u(t)
ẋ1∆ = x2∆ y(t) = x1 (t) + x2 (t)
ẋ2∆ = ω02 x1∆ + u∆
Go back
y∆ = x1∆

Go back 8.5

ẋ1 (t) = −x1 (t) + 2u(t)


8.3 ẋ2 (t) = −4x2 (t) + 3u(t)
y(t) = x1 (t) + x2 (t)
ẋ1 (t) = K2 x2 (t) + Ml (t)
ẋ2 (t) = −x1 (t) + x3 (t) Go back
ẋ3 (t) = −K2 x2 (t) + K1 i(t)
8.6 G(s) = s
(s+2)(s+3)

Go back Go back

8.4 a) 8.7 a) x1 = 1 − e−t , x2 = 0.5(e2t − 1)


b) No. Yes.
ẋ1 (t) = x2 (t)
c) Controllable, not observable.
ẋ2 (t) = x3 (t)
ẋ3 (t) = −6x1 (t) − 11x2 (t) − 6x3 (t) + 6u(t) d) Unobservable growing state ⇒ simulation collapses.
y(t) = x1 (t) Go back

14

8.8 Poles: 1 ± i 2. Zeros: −1. 8.13 a) x0 = . Scaling input does not scale output correspondingly.
p u0
c
Go back b)
c 1
∆ẋ(t) = −2 x0 ∆x(t) + ∆u(t)
m m
8.9 a)
c) −2 m
c
x0 . The dynamics when moving away from equilibrium is faster at
ẋ1 = x2 higher velocities.
1 u
ẋ2 = x1 − Go back
α α
ẋ3 = x4
ẋ4 = x3 − u

b) det S = α12 (1 − α1 )2 . Thus, the system is controllable


. . . . . . . . . . . . except for the case
α = 1, that is, when the two pendulums have the same lengths.
Go back

8.10 a)

0 1
   
−1
ẋ = x+ u
1 −3 1
y= 1 1 x


b) u = −5x1 + x2 + 3.2r
3.2(2s+5)
c) Y (s) = (s+4)2 R(s)

8.11 b)
!
0 1 0
 
A= 2g B= − mxk2
x10 0
10

C= 1 0


Go back

8.12 Go back

15
9 State Feedback
9.1 a) State .feedback.
. . . . . . . . Poles in { −3, −5 } gives the state feedback 9.6 a) Yes, since the system is .controllable.
...........
u = −6x1 − 14x2 + r b) Closed loop poles in −3 gives

Poles in { −10, −15 } gives the state feedback u = −3x1 − 5x2 − 4x3 + yref

u = −23x1 − 149x2 + r̃ c) The system is observable with the sensor at x1 or x3 . The sensor at x1
and observer poles in −4 give K T = 6 14 14 .
b) Gc (s) = s2 +8s+15 .
l0
Use l0 = 15. Go back
Go back 9.7 a) x2 = y (motor angle) and x1 = ẏ (angular velocity).
B
b) The pole locations give similar rise and .settling
. . . . . . . .times.
.... With complex
. . . . . . . . gain L = 6
9.2 State .feedback −2 . Observer gain K T = 16 9 .
 
poles the maximum value of the input is lower.
Go back
c) Larger weight on the motor angle gives faster response.
d) Increasing weight on the input makes the system slower.
9.3 a)
0 0 0 e) Increasing weight on the velocity makes the system slower.
   
K2
ẋ = 0 0 1 x +  0  u Go back
0 0 0 K1

b) u = − 8K11 K2 x1 − 3
4K1 x2 − 3
2K1 x3 9.8 a) Yes the system is controllable.
............
c) Observer gain K T = 6 12/K2 8/K2 b) Poles in −0.1 gives the state feedback


u(t) = −0.13x1 (t) − 0.128x2 (t)


0 1 0 0
     
9.4 a) x1 = θ and x2 = ω, ẋ = x+ u+ f, y = 1 0

0 −1/τ c1 c2 c) It is desirable that the estimation error converges to zero faster than the
dynamics of the system. Thus, we should place the eigenvalues of the
b) u = − c12τ 2 θ − 1
τ c1 ω + 2
c1 τ 2 θref
observer to the left of the poles of the closed loop system. To avoid large
. . . . . . . . . . . . . . of the measurement noise the poles of the observer should
amplification
c) u = − c12τ 2 θ − 1
τ c1 ω + 2
c1 τ 2 θref − c2
c1 x̂3 not be placed too far into the left hand plane.
Go back
d) Observer poles in −0.2 gives the observer gain
0.45
 
9.5 The system is observable and the poles of the observer may be placed K=
0.33
arbitrarily.
...........
Go back Go back

16
9.9 a)
b)

c)
d)
Go back

B 9.10 a)
b)
c)
Go back

17
11 Implementation
11.1 β1 = 0.905, α1 = 19.14, and α2 = −18.95.
Go back

18
Reglerteknik: Solutions
• Solutions

This version: 2021-08-12


Solutions
This version: 2021-08-12
1 Mathematics
1
1.1 a) A .unit . . . . (A = 1) has the Laplace transform s . By linearity, a unit
. . . . .step . . . . . step
.... 1.3 a) Writing the function with partial fractions yields
multiplied with A will have the Laplace transform As
1 1
F (s) = −
a) A unit ramp (A = 1) has the Laplace transform 1 s s+1
s2 .
By linearity, a unit
ramp multiplied with A will have the Laplace transform sA2 The inverse transform is then computed by use of a Laplace transform
table:
1
c) s+2 f (t) = 1 − e−t
d) s This means that f (t) → 1 as t → ∞. The same result can also be obtained
s2 +25
by use of the .final
. . . . .value . . . . . . . . that is, by computing lims→0 sF (s).
. . . . . .theorem,
e) sU (s) − u(0)
b) Writing the function with partial fractions yields
f) sU (s). (u(0) = 0 is a common assumption in the course.) 0.5 0.5
F (s) = − +
s+1 s−1
g) s2 U (s) − su(0) − u̇(0)
The inverse transform is then computed by use of a Laplace transform
h) s2 U (s). (u(0) = u̇(0) = 0 is a common assumption in the course.) table:
f (t) = −0.5e−t + 0.5et
i) A time . . . . . . . . signal has Laplace transform, e
. . . . . delayed
−sT
U (s).
This means that f (t) will grow without bound as t → ∞. Here, the
Go back final
. . . . . .value . . . . . . . . cannot be used since f (t) lacks a final value.
. . . . . .theorem
c) The inverse transform can be computed by use of the relation
1.2 a) Insert ẏ(t) = 0 och u(t) = 5 into the differential equation ⇒ 2y(t) = 5. L−1 {G(s + a)} = e−at · g(t)
b) Apply Laplace transforms on all terms in the differential equation to arrive Here, G(s) = 1
s2 and a = 1. The inverse transform of G is g(t) = t, so
1
at sY (s) + Y (s) = U (s) which we can write as Y (s) = s+2 U (s). We call
1
G(s) = s+2 the transfer 1
. . . . . . . . of the system, and the denominator
. . . . . . . . .function f (t) = L−1 { } = e−t · t
of G(s) coincides with the characteristic polynomial of the differential (s + 1)2
equation. which tends to 0 as t → ∞. This result can also be obtained by use of
1 the final
. . . . . .value
. . . . . .theorem.
........
c) With Y (s) = s+2 U (s) and the Laplace transform of a step, U (s) = 5s , we
1 5
have Y (s) = s+2 1 5 1 Go back
s . Hence limt→∞ y(t) = lims→0 s s+2 s = 5 lims→0 s+2 =
1
5 2 . Note that we have derived that the amplitude of the output is the
amplitude of the input (5) times the so called static . . . . . G(0) of the
. . . . . . . gain
system. 1.4 a) Laplace of the differential equation yields

Go back (s2 + 3s + 2)Y (s) = U (s)

1
1
With a unit . . . . we have U (s) =
. . . . . step, s leading to Rewriting the first term using partial fractions leads to
1 1 1 1 1 1 1 1
Y (s) = = Y1 (s) = = −
(s2 + 3s + 2) s (s + 1)(s + 2) s s+1s s s+1

We can use the table on page 234 directly with result (A.34) to obtain with inverse transform
y1 (t) = 1 − e−t
1 2e−t − e−2t 1 1
 
y(t) = 1− = − e−t + e−2t , t ≥ 0 Rewriting the second term using partial fractions leads to
2 1 2 2
1 1 0.5 0.5s 0.5
Alternative, rewrite using partial fractions Y2 (s) = 2
= − 2 + 2
s+1s +1 s+1 s +1 s +1
1 A B C with inverse transform
Y (s) = = + +
s(s + 1)(s + 2) s s+1 s+2
y2 (t) = 0.5e−t − 0.5 cos t + 0.5 sin t
with solution
1/2 1 1/2 Hence, the system output is
Y (s) = − +
s s+1 s+2
Laplace inverse from table 233 y(t) = 1 − 0.5e−t + 0.5 sin t − 0.5 cos t

1 1 Go back
y(t) = − e−t + e−2t
2 2

b) The Laplace transform of the input


1.5 The relation between inflow z(t) and water level y(t) is given by
u(t) = 1 + sin t 1
sY (s) + Y (s) = Z(s) ⇒ Y (s) = Z(s)
yields s+1
1 1
U (s) = + and the relation between control signal u(t) and inflow z(t) is
s s2 + 1
The differential equation 1
s2 Z(s) + sZ(s) + Z(s) = U (s) ⇒ Z(s) = U (s)
s2 + s + 1
ẏ(t) + y(t) = u(t)
This means that the Laplace transforms of the control signal and water level
is Laplace transformed and we see the model is represented by the are related by
1
transfer
. . . . . . . . .function
. . . . . . . . . s+1 1 1 1
1 Y (s) = U (s) = 3 U (s)
Y (s) = U (s) (s + 1) (s2 + s + 1) s + 2s2 + 2s + 1
s+1
Hence, the Laplace transform of the system output is given by which corresponds to the differential equation
1 1 1 1 y (3) + 2ÿ + 2ẏ + y = u
Y (s) = +
s + 1 s s + 1 s2 + 1
| {z } | {z }
Y1 (s) Y2 (s) Go back

2
q q
1.6 Solving s2 + as + b = 0 yields s = − a2 ± a4 − b. Note that corresponds to 20 log 100 = 40 dB20 .
4 − b can
2 a2

become both real and complex. If a ≤ 0 we will immediately have a non-


decibel (dB20 ) Definition Amplification F
negative realqpart on one of the roots. If a > 0 we can only get a non-negative
q 20 20 log F = 20 ⇒ F = 101 = 10
real part if a2
4 − b is real and a2
4 −b≥ a
2 which only can occur if b ≤ 0. −3 20 log F = −3 ⇒ F = 10−3/20 ≈ 0.708 ≈ √12
Go back 0 20 log F = 0 ⇒ F = 100 = 1 √
10 20 log F = 10 ⇒ F = 100.5 = 10 ≈ 3.16
−10 20 log F = −10 ⇒ F = 10−0.5 = √110 ≈ 0.316
√ 1
1.7 a) The absolute value is |1 + i| = 2, and the argument
. . . . . . . . . is arctan 1 =
π
4 =
45◦ . Hence, the polar form is Note that increasing (or decreasing) the gain with a factor 10 leads to 20dB20
increase (decrease).

2ei 4
π
Go back

b) The absolute value is


√ 1.9 Multiplication of the two matrices gives the unit matrix.
|1 + i| 2
= ≈ 0.14 1
   
1 0

5 1 + (3)i 5 · 2 a22 −a12 a11 a12
p
=
a11 a22 − a12 a21 −a21 a11 a21 a22 0 1
The argument
. . . . . . . . . . is Go back
1+i √
 
arg √ = arg (1 + i) − arg 5i − arg (1 + 3i)
5i(1 + 3i)

= arctan 1 − 90◦ − arctan 3 = 45◦ − 90◦ − 60◦
= −105◦

Hence, the polar form is √


2 −i 105 π
e 180
10

c) 2ei 3 = 2 cos π3 + 2i sin π3
π
= 1 + 3i

d) 5e−iπ = 5 cos(−π) + 5i sin(−π) = −5


Go back

2
1.8 The amplification
. . . . . . . . . . . . . . in decibel is computed as 10 log |F | = 20 log |F |, where F
is the absolute value of the amplification. . . . . . . . . . . . . . The amplification
. . . . . . . . . . . . . F = 100 hence

3
2 Dynamic Systems
2.1 a) We start from the equations and this gives the .transfer
. . . . . . . . .function
........
J θ̈(t) = −f θ̇(t) + M (t) (2.1) θ(s) k0
G(s) = =
M (t) = ka i(t) (2.2) U (s) s(s + 1/τ )
v(t) = kv θ̇(t) (2.3) Note that the transfer . . . . . . . . . from
. . . . . . . . . function u(t) to angular velocity θ̇(t) will be
Voltage equilibrium given by the first-order system (s+1/τ k0
) = (sτ +1) , i.e. the time-constant is
k0 τ
. . . . . . . . . . . gives
τ and the static . . . . is k0 τ
. . . . . . .gain
di(t)
u(t) − Ra i(t) − La − v(t) = 0 (2.4) c) Suppose that u(t) is a unit . . . . that is,
. . . . .step,
dt
(
where La = 0. Equation (2.2) in (2.1) gives 0, t < 0
u(t) =
1 t≥0
J θ̈(t) + f θ̇(t) = ka i(t) (2.5)

From (2.4) and (2.3) we get that is


1
U (s) =
i(t) = (u(t) − kv θ̇(t))/Ra s
This gives
which in (2.5) gives
1 1
 
k0 k0 τ k0 τ
J θ̈(t) + f θ̇(t) = ka (u(t) − kv θ̇(t))/Ra θ(s) = G(s)U (s) = · = − ·
s(s + 1/τ ) s s s + 1/τ s
that is Inverse Laplace transformation (using either the table on page 233 on the
Ra f + ka kv ka
θ̈(t) + θ̇(t) = u(t) signal θ(s) or the table on page 234 on the system G(s)) gives
JRa JRa
Define some help variables to simplify expression (we define it in terms of θ(t) = k0 τ t − k0 τ 2 (1 − e−t/τ )
1/τ as τ then will correspond to a time-constant of the motor later on,
impossible to see right now though) that is, θ will grow unlimited when t increases (which of course comes as
no surprise, if you apply a constant .voltage
. . . . . . . on a motor, it will reach a
1 Ra f + ka kv ka certain angular velocity and then keep rotating.)
= k0 =
τ JRa JRa Go back
which gives
1
θ̈(t) + · θ̇(t) = k0 u(t) (2.6)
τ 2.2 (1) Asymptotically stable system. Monotonic step response, that is, real
b) Laplace transformation of (2.6) gives poles: K = 0.1.

1 (2) Very oscillative system on the border to instability. Poles close to the
(s2 + · s)θ(s) = k0 U (s) imaginary axis: K = 2.5.
τ

4
(3) Unstable system. Poles in the right half plane: K = 3. 2.4 Use the system description

(4) Asymptotically stable system. Oscillative step response, that is, complex ω02
G(s) =
poles in the left half plane: K = 0.5. s2 + 2ζω0 s + ω02
Go back In the first figure ω0 = 1 and ζ = 0.5.

a) For the system


2.3 a) The inverse Laplace transform gives the step response 1
G(s) =
s2 + as + 1
1
 
β
d1 (t) = L−1 · = β(1 − e−t/T ) we have ω0 = 1 and ζ = 0.5a. The .step . . . . . . . . is more oscillative than
. . . . .response
1 + sT s in the case ζ = 0.5, that is, ζ < 0.5. This gives a < 1.
For the final value, we have b) For the system
b2
d1 (t) → β, t → ∞ G(s) =
s2 + bs + b2
This can be derived directly as β is the .static we have ω0 = b and ζ = 0.5. The .step . . . . . . . . is in this case pure
. . . . .response
. . . . of the transfer
. . . . . .gain . . . . . . . . .function
........
time scaling compared to the case ω0 = 1. The figure shows that the
1 step . . . . . . . . . is twice as fast as in the case ω0 = 1. This gives b = ω0 = 2.
. . . . .response
 
β
lim d1 (t) = lim sD1 (s) = lim s · =β
t→∞ s→0 s→0 1 + sT s
Go back
The figure gives β = 10. At the time t = T , the system time constant,
the step . . . . . . . . . has reached 63% of the final value, that is,
. . . . . response
2.5 The pairs of plots that belong to the same system will be written in the form
d1 (T ) = 0.63 · 10 pole-zero-letter–step-response-letter. Assume we have a unit . . . . for notational
. . . . . step
simplicity (it makes no difference if we scale all inputs)
The figure gives T = 3, which gives the total transfer
. . . . . . . . .function
........
Pole-zero diagram B has a single pole in the origin G(s) = K 1s which gives a
1
10 ramp as step . . . . . . . . . Y (s) = K s2 and thus y(t) = Kt , that is, B–6.
. . . . . response
G(s) =
1 + 3s Pole-zero diagram D also has a pole in the origin which gives an infinitely
growing step . . . . . . . . . and the only possible combination left is D–3.
. . . . .response
b) If we measure the signal d2 (t) it takes VL time units for the material to go Pole-zero diagram A has a zero in the origin so Y (s) = (s+a)(s+b) 1
s which gives
Ks
from the rollers down to the sensor. The total .transfer . . . . . . . . including
. . . . . . . . .function final value 0 if we apply the final value theorem,
.................... A–2.
this time delay then becomes
Pole-zero diagram F has complex poles which gives an oscillative step response,
10e
L
−V s F–4.
G(s) =
1 + 3s The two remaining ones are more tricky. The difference between the step
responses is a slight overshoot,
. . . . . . . . . . and the difference in the .transfer . . . . . . . . . is a
. . . . . . . . functions
Go back zero. A system with only real poles and no zero cannot lead to any oscillation

5
or overshoot,
. . . . . . . . . . so we must have C–1, and step response E is the only alternative b) Same procedure again, but >> GC = 25/(s^2 + 5*s + 25)
left for pole-zero diagram E, i.e. the addition of a zero can lead to .overshoots.
......... also compute absolute val- >> GD = 100/(s^2 + 10*s + 100)
ues and arguments
. . . . . . . . . . . (con- >> step(GC,GD);
verted to degrees). >> pole(GC)
ans =
Answer: A–2, B–6, C–1, D–3, E–5, F–4.
-2.5000 + 4.3301i
-2.5000 - 4.3301i

Go back >> pole(GD)


ans =

-5.0000 + 8.6603i
-5.0000 - 8.6603i
B
>> abs(pole(GC))
ans =

2.6 a) Enter the systems to check. >> GA = 5/((s + 5)*(s+1)) 5.0000


>> GB = 25/((s + 5)*(s+5)) 5.0000
>> step(GA,GB);
>> pole(GA) >> abs(pole(GD))
ans =
ans =
10.0000
-5 10.0000
-1

>> pole(GB) >> angle(pole(GC))*180/pi


ans =
ans =
120.0000
-5 -120.0000
-5
>> angle(pole(GD))*180/pi

ans =
GA (s) has a slow dominating pole (closer to the origin) which slows down
the system. 120.0000
-120.0000

We can plot the poles also >> pzmap( GA, GB ) >> pzmap(GC,GD)

6 Same angles and thus similiar responses in terms


of overshoot
. . . . . . . . . . and oscillations, but the poles of
GC (s) are closer to the origin leading to a slower
c) and again >> GE = 25/(s^2 + 1*s + 25) d) The product of the two sys- >> step(GA*GE)
>> GF = 25/(s^2 + 4*s + 25) tems is conveniently created
>> step(GE,GF); Even though there are bad complex poles in this system, the slow real
>> pole(GE) pole in GA (s) is dominating and damps out the severe oscillations.
ans =
Go back
-0.5000 + 4.9749i
-0.5000 - 4.9749i B 2.7 Enter the system. Here we >> s = tf( ’s’ );
>> pole(GF) consider the case α = 2, that >> G1 = ( 2*s + 1 ) / ( s^2 + 2*s + 1 );
ans = is the system has a zero in
−0.5.
-2.0000 + 4.5826i Plot the .step
. . . . .response.
........ >> step( G1, 10 ); grid
-2.0000 - 4.5826i
Step Response

1.4
>> abs(pole(GE))
ans =
1.2

5.0000 1
5.0000
>> abs(pole(GF)) 0.8

Amplitude
ans =
0.6

5.0000
0.4
5.0000
0.2
>> angle(pole(GE))*180/pi
ans = 0
0 1 2 3 4 5 6 7 8 9 10
Time (sec.)
95.7392
-95.7392
A zero located close to the origin on the negative real axis causes an overshoot ..........
>> angle(pole(GF))*180/pi in the step . . . . . . . . . A zero on the positive real axis causes the .step
. . . . .response. . . . . response
.........
ans = to initially move in the negative direction. This means that in some cases the
zeros of the system can have significant influence in the system properties.
113.5782 Systems with zeros in the right half plane normally imply extra difficulties
-113.5782 for the design of control systems as the system initially reacts in the ’wrong’
direction.
>> pzmap(GE,GF)
To see that we have a movement in the negative direction with a positive zero
is easy to see from the equations. Let y1 (t) be the step-response from the
system without a zero
Same distance to the origin, but more complex compared to real part on 1 1
GE (s), thus leading to a more oscillatory response. Y1 (s) = 2
s + 2s + 1 s

7
Now consider the system with a zero G6 : Can be excluded due to instability.
αs + 1 1 Go back
Y (s) = = αsY1 (s) + Y1 (s)
s2 + 2s + 1 s
In time-domain this is
y(t) = αy˙1 (t) + y1 (t)
The output from the system will initially be proportional to the derivative of
the output from the system without any zero, and if α < 0 (positive zero) it
negative since the output derivative of the system without any zero is positive.
Go back

2.8 a) The steady state value, i.e. the value the signal converges to, is 1.5.
b) The output signal almost reaches 1.9, which is slightly less than 0.4 over
0.4
the final value. The .overshoot
. . . . . . . . . is hence 1.5 ≈ 26%.
c) Find the time points where the output is 10% (0.15) and 90% (1.35) of the
steady state value. The rise . . . . is the difference between these values,
. . . . .time
here approximately Tr ≈ 1.5 s.
d) Find the earliest time such that the output then lies within ±5% of
the steady state value. Here, the interval is [ 1.425, 1.575 ], and the
settling . . . . is Ts ≈ 7.8.
. . . . . . . . .time
Go back

2.9 G1 –C: G1 is poorly damped, which gives an oscillatory behavior.


1
G2 : Can be excluded since it is the only system having static . . . . 2 , and
. . . . . . .gain
among the step . . . . . . . . . there is always more than one match for each of the
. . . . .responses
present final values.
G3 –B: This case has the shortest rise . . . . and some overshoot
. . . . .time, . . . . . . . . . . due to the
pair of complex poles. The static gain
........... is 2.
G4 –A: The pole in −2 dominates, which gives slower step . . . . . . . . . than sys-
. . . . .response
tems G3 and G5 . The static gain
........... is 1.
G5 –D: The dominating pole is in −3, which is slower than for G3 but faster
than for G4 . The static . . . . is 2.
. . . . . . .gain

8
3 Feedback Systems
3.1 a) The balance equation is, with the bottom area of the tank being 1 m2 , The time constant T is the time it takes for the step . . . . . . . . . to reach
. . . . .response
63% of its final value. (This comes from the observation (1−e−1 ) ≈ 0.63.)
ẏ(t) = x(t) − v(t) From the plot it follows that T = 5 and kv = 2, that is

that is (note that all initial conditions are zero when deriving 2
Gv (s) =
transfer
. . . . . . . . .functions)
......... 1 + 5s
sY (s) = X(s) − V (s)
Hence v
Y (s) = Gt (s)(X(s) − V (s))

where u x y
1 Gv (s) + Σ Gt (s)
Gt (s) =
s
Figure 3.1a
b) The transfer . . . . . . . . . for the valve
. . . . . . . . .function . . . . . is
c) The outflow caused by the pump enters in the block diagram as an additive
kv
Gv (s) = . . . . . . . . . . . . on the input of the tank. The resulting structure of the open
disturbance
1 + Ts loop system is shown in Figure 3.1a.
With the input taken as a unit . . . . signal, that is,
. . . . . step Go back

1
U (s) =
s
3.2 a) Taking the Laplace transform of both sides of (3.1) gives
it follows that
kv 1 1
X(s) = · U (s) = KP E(s) + KI E(s) + KD sE(s)
1 + Ts s s
The final
. . . . . .value . . . . . . . . gives
. . . . . .theorem which can be written

lim x(t) = lim sX(s) = kv U (s) = F (s)(R(s) − Y (s))


t→∞ s→0

The transfer if
. . . . . . . . for the valve
. . . . . . . . .function . . . . . corresponds to the differential equation 1
F (s) = KP + KI + KD s
T ẋ(t) + x(t) = kv u(t) s
and
Assuming the intial value x(0) = 0 and that u(t) is a step with amplitude E(s) = R(s) − Y (s)
one gives the solution
b) By using the controller F (s), the closed loop system shown in Figure 3.2a
x(t) = kv (1 − e−t/T ) is obtained.

9
v 3.3 (a) The needed transfer . . . . . . . . were derived in Problem 3.2 and give,
. . . . . . . . .functions
putting KD = KI = 0,

r e u x y
+ Σ F (s) Gv (s) + Σ Gt (s) 2KP (1 + 5s)
− Y (s) = R(s) − 2 V (s)
5s2 + s + 2KP 5s + s + 2KP

Figure 3.2a with characteristic equation

5s2 + s + 2KP = 0
c) From the block diagram, the following equations are obtained:
or, equivalently,
Y (s) = Gt (s)(−V (s) + F (s)Gv (s)(R(s) − Y (s))) s2 + 0.2s + 0.4KP = 0
= −Gt (s)V (s) + F (s)Gv (s)Gt (s)R(s) − F (s)Gv (s)Gt (s)Y (s)
The equation has the roots
Collecting all terms involving Y (s) on the left hand side gives p
s = −0.1 ± 0.01 − 0.4KP
Y (s)(1 + F (s)Gv (s)Gt (s)) = −Gt (s)V (s) + F (s)Gv (s)Gt (s)R(s)
KP = 0.02 gives the poles { −0.14, −0.06 }. Since both poles are real
and hence this implies that the level will change without oscillations when a step is
F (s)Gv (s)Gt (s)
Y (s) = R(s) applied to the reference or .disturbance
. . . . . . . . . . . signal.
1 + F (s)Gv (s)Gt (s)
Gt (s) KP = 1 gives the poles −0.1 ± 0.62i. In this case the poles are complex
− V (s) and since the magnitude of the imaginary part is large compared to the
1 + F (s)Gv (s)Gt (s)
real part, the closed loop system will not be well damped.
Inserting
For KP ≥ 0.025 the poles are given by
1 KD s2 + KP s + KI
F (s) = KP + KI + KD s =
p
s s s = −0.1 ± i 0.4KP − 0.01

and When KP increases, the imaginary part of the poles increases while the
1 2
Gt (s) = Gv (s) = real part is constant. The result will thus be more and more oscillatory
s 1 + 5s behaviour the larger KP is.
gives
2(KD s2 + KP s + KI ) (b) The Laplace transforms of r(t) = 5 and v(t) = 2 are
Y (s) = R(s)
5s3 + (1 + 2KD )s2 + 2KP s + 2KI
5 2
s(1 + 5s) R(s) = V (s) =
− 3 V (s) s s
5s + (1 + 2KD )s2 + 2KP s + 2KI
Note that both transfer The Laplace transform of the level is then given by
. . . . . . . . . have the same denominator, that is, sta-
. . . . . . . . .functions
bility analysis can be carried out using either of the two transfer . . . . . . . . .functions.
......... 2KP 5 (1 + 5s) 2
Y (s) = · − ·
Go back (5s2 2
+ s + 2KP ) s (5s + s + 2KP ) s

10
Since the closed loop system is stable for all KP > 0 the This equation can be compared to the general characteristic equation for
final
. . . . . .value . . . . . . . . can be applied. This gives
. . . . . .theorem the case of complex roots

1 s2 + 2ζω0 s + ω02 = 0
lim y(t) = lim sY (s) = 5 −
t→∞ s→0 KP
where ω0 denotes the absolute
√ value of the roots and ζ is the relative
Hence, if KP is chosen very large the steady state level will be close to the damping. Here one gets ω0 = 0.4, which implies
desired level, but the system will be very oscillatory due to the location
of the poles. 0.2 + 0.4KD
ζ= √
2 0.4
c) The transfer . . . . . . . . . from Problem 3.3 give, putting KD = 0,
. . . . . . . . .functions √
The condition ζ > 1/ 2 implies KD > 1.7. Poles with such damping ratio
2(KP s + KI ) s(1 + 5s) correspond to an overshoot
Y (s) = R(s) − 3 V (s) . . . . . . . . . . of less than 5% (the overshoot
. . . . . . . . . may also be
5s3 + s2 + 2KP s + 2KI 5s + s2 + 2KP s + 2KI affected by the zeros). Hence, the derivative part in the feedback . . . . . . . . can be
used to improve the damping in the closed loop system, that is, to make
The Laplace transform of the level, using r(t) = 5 and v(t) = 2, becomes it less oscillatory.
2(KP s + KI ) 5 s(1 + 5s) 2 Go back
Y (s) = · − ·
(5s3 + s2 + 2KP s + 2KI ) s (5s3 + s2 + 2KP s + 2KI ) s
B 3.4 a) Enter the system. >> s = tf( ’s’ );
Provided that the coefficients KP and KI are chosen such that the closed >> G = 0.2 / ( ( s^2 + s + 1 ) * ( s + 0.2 ) );
loop system is stable, the steady state level can be deterimined using the Generate a proportional >> F = 1;
regulator.
final
. . . . . .value . . . . . . . . This gives
. . . . . .theorem.
Generate the closed loop >> Gc = feedback( F * G, 1 );
lim y(t) = lim sY (s) = 5 system.
t→∞ s→0
Compute and plot the >> step( Gc, 30 ); grid
which means that the desired level is reached. Hence, if the regulator step
. . . . .response.
......... Step Response

coefficients are chosen such that the closed loop system is stable, the 0.7

integrating part eliminates the steady


. . . . . . . state
. . . . . .error.
..... 0.6

(d) The transfer . . . . . . . . . from Problem 3.2 give, putting KI = 0, KP = 1,


. . . . . . . . .functions 0.5

2(KD s + 1) (1 + 5s)
Y (s) = V (s)
0.4

Amplitude
R(s) − 2
5s2 + (1 + 2KD )s + 2 5s + (1 + 2KD )s + 2
0.3

with characteristic equation 0.2

2
5s + (1 + 2KD )s + 2 = 0 0.1

or, equivalently, 0
0 5 10 15 20 25 30

2 Time (sec.)
s + (0.2 + 0.4KD )s + 0.4 = 0

11
By trying some different values of KP the following behavior can be seen: Plot the result. >> Gc = feedback( F * G, 1 );
For small values of KP the step . . . . . . . . . is slow, well damped and the
. . . . . response >> step( Gc, 50 ); grid
steady state error
.................. is large. For increasing KP the step . . . . . . . . . becomes
. . . . .response Step Response
faster but more oscillatory, while the error is reduced. For large KP the 1.5

amplitude of the oscillations increases over time, that is, the closed loop
system becomes unstable.

b) Generate a PI controller >> KP = 1; KI = 1;

Amplitude
with KP = 1 and KI = 1. >> F = KP + KI / s;

Plot the result. >> Gc = feedback( F * G, 1 ); 0.5

>> step( Gc, 50 ); grid


Step Response

1.8

0
0 5 10 15 20 25 30 35 40 45 50
1.6
Time (sec.)

1.4

1.2 Using the (approximate) derivative of the error in the regulator increases
the damping of the closed loop system. Increasing KD too much, however,
Amplitude

1
gives that an oscillation with higher frequency appears in the .step
. . . . .response
........
0.8
and finally (approximately when KD > 65) the closed loop system be-
0.6
comes unstable.
0.4
Go back
0.2

0
0 5 10 15 20 25 30 35 40 45 50
Time (sec.)
3.5 a) The transfer . . . . . . . . . for the closed loop system is
. . . . . . . . .function
Go (s) K(s + 2)
The following effects of the integrator can be found by trying some dif- Gc (s) = =
ferent values of KI . (i): The integrator in the regulator eliminates the 1 + Go (s) s(s + 1)(s + 3) + K(s + 2)
steady
. . . . . . . state . . . . . (ii): A too small value of KI gives a large .settling
. . . . . .error. . . . . . . . .time
.... The characteristic equation is
while a too large value gives an oscillatory (finally unstable) closed loop
system. s(s + 1)(s + 3) + K(s + 2) = P (s) + KQ(s) = 0

that is
c) Generate a PID controller >> KP = 1; KI = 1; T = 0.1; KD = 1; P (s) = s(s + 1)(s + 3) Q(s) = s + 2
with KP = 1, KI = 1, KD = >> FP = KP;
2 and T = 0.1. >> FI = KI / s;
>> FD = KD * s / ( s*T + 1 );
 Starting points: ⇔ zeros of P (s) : 0, −1, −3
>> F = FP + FI + FD; End points: ⇔ zeros of Q(s) : −2

12
3 3
Im Im
Asymptote

2 2

{ ω= 2
K=4
1 1
K ≈ 0.4186 Asymptotes

Re −2/3 Re

−4 −3 −2 −1 1 −3 −2 −1 1

−1 −1

{ ω=− 2
K=4

−2 −2

Asymptote

−3 −3

Figure 3.5a Figure 3.5b

 Number of asymptotes: 2 The characteristic equation reads


Directions: 12 [π + 2kπ] = ±π/2
s(s2 + 2s + 2) + K = 0
Intersection with the real axis: 21 [0 + (−1) + (−3) − (−2)] = −1
that is
 Real axis: [−3, −2) and [−1, 0] belongs to the .root
. . . . .locus
.... P (s) = s(s2 + 2s + 2) Q(s) = 1
 Intersection with the imaginary axis: Set s = iω and solve the char-
 Starting points: ⇔ zeros of P (s) : 0, −1 ± i
acteristic equation
End points: ⇔ There are no zeros of Q(s)
iω(iω + 1)(iω + 3) + K(iω + 2) = −iω 3 − 4ω 2 + (3 + K)iω + 2K = 0  Number of asymptotes: 3
Directions: 13 [π + 2kπ] = π, ±π/3
(−ω 2 + 3 + K)ω = 0 ω=K=0

⇒ ⇒ Intersection of asymptotes: 31 [0 + (−1 + i) + (−1 − i)] = −2/3
−4ω 2 + 2K = 0 (starting point)
 Part of the real axis that belongs to the root . . . . . (−∞, 0]
. . . . .locus:
This gives the .root . . . . in Figure 3.5a.
. . . . .locus  Intersection with the imaginary axis: Set s = iω and solve the char-
Answer: All poles are in the left half plane, that is, the closed loop acteristic equation
system is asymptotically stable for all K > 0. For small values of K
there are no oscillations and the speed is increasing with increasing K. iω((iω)2 + 2iω + 2) + K = −iω 3 − 2ω 2 + 2iω + K = 0
For a certain value of K the system becomes oscillating. The damping is √ 
(−ω 2 + 2)ω = 0 ω = K = 0 or ω = ± 2

decreasing with increasing K. ⇒
−2ω 2 + K = 0

(start point) K=4
b) The transfer . . . . . . . . . for the closed loop system is
. . . . . . . . .function This gives the .root . . . . in Figure 3.5b.
. . . . .locus
Go (s) K Answer: All poles are in the left half plane. That is, the system is
Gc (s) = = asymptotically stable for 0 < K < 4. The step
1 + Go (s) 2
s(s + 2s + 2) + K . . . . . . . . . is oscillating
. . . . . response

13
for all K. To begin with the system will be faster with increasing K.
5
Asymptote Im

However, for K sufficiently large the oscillating part is dominating. The 4

damping will decrease with increasing K and for (K ≥ 4) the closed loop 3

system is unstable. 2

K ≈ 1.1021 1 { ω = 1.5
K = 7.5

c) The transfer . . . . . . . . . for the closed loop system is


. . . . . . . . .function Re

−7 −6 −5 −4 −3 −2 −1 1 2

Go (s) K(s + 1) −1
{ ω = − 1.5
Gc (s) = = K = 7.5

1 + Go (s) s(s − 1)(s + 6) + K(s + 1) −2

−3
The characteristic equation is
−4

s(s − 1)(s + 6) + K(s + 1) = P (s) + KQ(s) = 0


Asymptote
−5

P (s) = s(s − 1)(s + 6) Q(s) = s + 1 Figure 3.5c

 Starting points: ⇔ zeros of P (s) : 0, 1, −6


End points: ⇔ zeros of Q(s) : −1 3.6 The transfer . . . . . . . . . for the closed loop system is obtained from
. . . . . . . . .function
 Number of asymptotes: 3 − 1 = 2 1 1 k
Directions: 21 [π + 2kπ] = ±π/2 θ(s) = θ̇(s) = · · K · (θref (s) − αsθ(s) − θ(s))
s s 1 + sτ
Intersection of the asymptotes: 12 [0 + 1 + (−6) − (−1)] = −2

 Part of the real axis that belongs to the root . . . . . [−6, −1) and
. . . . .locus: θ(s) k·K 4K
[0, 1] G(s) = = =
θref (s) s(1 + sτ ) + k · K(1 + αs) s(s + 2) + 4K(1 + αs)
 Intersection with the imaginary axis: Set s = iω and solve the char-
The characteristic equation is:
acteristic equation:
iω(iω − 1)(iω + 6) + K(iω + 1) = −iω 3 − 5ω 2 + (K − 6)iω + K = 0 s(s + 2) + 4K(1 + αs) = 0

a) α = 0. The characteristic equation is then


q
(−ω 2 + K − 6)ω = 0 ω=K=0 ω = 32
 
⇒ ⇒ or
−5ω 2 + K = 0 (start point) K = 7.5 s(s + 2) + 4K = s2 + 2s + 4K = 0
This gives the .root . . . . in Figure 3.5c.
. . . . .locus with the solution √
Answer: All poles are in the left half plane, that is, the closed loop s = −1 ± 1 − 4K
system is asymptotically stable for K > 7.5. For small values on K the
This gives the .root . . . . in Figure 3.6a.
. . . . .locus
closed loop system is (as the open loop system) unstable. For K > 7.5
the closed loop system is stable and oscillating. As K is increasing from Answer: All poles are in the left half plane, that is, the closed loop
the critical value both the damping and the response speed are increasing system is asymptotically stable for all K > 0.
(the time constant is always ≥ 1/2s), until they both are beginning to
b) α = 1. The characteristic equation is then
decrease. The damping is decreasing with increasing K.
Go back s(s + 2) + 4K(1 + s) = 0

14
2 2
Im Im
Asymptote

1 1
Asymptote

K = 0.25
Re Re

−3 −2 −1 1 −6 −5 −4 −3 −2 −1 1

K = 3 + 0.5 27 K = 3 − 0.5 27

−1 −1

Asymptote

−2 −2

Figure 3.6a Figure 3.6c

2
Im

which gives
1
P (s) = s(s + 2) Q(s) = 4(1 + s/3)
Asymptote

This gives the .root . . . . in Figure 3.6c.


. . . . .locus
Re

−3 −2 −1 1 Answer: All poles are in the left half plane, that is, the closed loop
system is asymptotically stable for all K > 0.
−1

d) K = 1. The characteristic equation becomes

−2 s(s + 2) + 4(1 + αs) = s2 + 2s + 4 + 4αs = 0


Figure 3.6b
that is
P (s) = s2 + 2s + 4 Q(s) = 4s
that is
P (s) = s(s + 2) Q(s) = 4(1 + s) This gives the .root . . . . in Figure 3.6d.
. . . . .locus
Answer: All poles are in the left half plane, that is, the closed loop
This gives the .root . . . . in Figure 3.6b.
. . . . .locus system is stable for all α ≥ 0. From d) it follows that the system will be
Answer: All poles are in the left half plane, that is, the closed loop more damped for larger values on α (compare b, c: in b) the system is not
system is asymptotically stable for all K > 0. oscillating for any value on K). For α sufficiently large, the time constant
can be arbitrary
. . . . . . . . . large. This is natural since the term −αθ̇ · K (D-term)
c) α = 1/3. The characteristic equation is then that appears in the input voltage . . . . . . . of the motor reduces the velocity of the
axis. The effect is as if the motor has been drained with thick oil. With a
s(s + 2) + 4K(1 + s/3) = P (s) + KQ(s) = 0 suitable viscosity α the system can be made fast and stable as in c). With

15
which gives
2
Im

1
P (s) = (s + 1)(s − 1)(s + 5) Q(s) = 1
Asymptote

α = 0.5

Re 6
Im

−3 −2 −1 1

K = 5.0 K ≈ 5.049
−1 ⇒
2
two poles in
Asymptotes ≈ 0.097
−5/3 Re

−7 −6 −5 −4 −3 −2 −1 1 2
−2

−2
Figure 3.6d
−4


α = 0 as in a) and K large enough, the system is not becoming faster −6

just less damped.


Figure 3.7a
Go back
Answer: There exists at least one pole in the RHP. Hence, the system
is not asymptotically stable for any value of K.
3.7 Set
1 b) Here, F (s) = K(1 + 0.5s). Hence
G(s) =
(s + 1)(s − 1)(s + 5)
K(1 + 0.5s)
With U (s) = F (s)E(s), the transfer Gc (s) =
. . . . . . . . . of the closed loop system be-
. . . . . . . . .function (s + 1)(s − 1)(s + 5) + K(1 + 0.5s)
comes
G(s)F (s) The characteristic equation is
Gc (s) =
1 + G(s)F (s)
(s + 1)(s − 1)(s + 5) + K(1 + 0.5s) = 0
a) Here, F (s) = K, so
which gives
K
Gc (s) =
(s + 1)(s − 1)(s + 5) + K P (s) = (s + 1)(s − 1)(s + 5) Q(s) = 1 + 0.5s

The characteristic equation is


This gives the .root . . . . in Figure 3.7b.
. . . . .locus
(s + 1)(s − 1)(s + 5) + K = 0 Answer: The system is asymptotically stable (all poles in the LHP) if
∗ Note that altough the system does get faster with respect to risetime, this is not a very useful K > 5.
notion of speed in highly oscillative systems. Rather, the settling
. . . . . . . . .time
. . . . should be used, and this
property of a system is related to the real part of the poles, not their distance to the origin. Go back

16
with the characteristic equation
5
Asymptote Im

3 Nn (s) + KTn−1 (s) = 0


2

1
that is,
P (s) = Nn (s) Q(s) = Tn−1 (s)
K ≈ 5.1262 K = 5.0
Re

−6 −5 −4 −3 −2 −1 1 2
−1
• Starting points: The zeros of Nn (s)
−2
End points: The zeros of Tn−1 (s)
−3

−4
• Number of asymptotes: 1 since deg Nn (s) − deg Tn−1 (s) = 1
Asymptote
−5
Direction: π

Figure 3.7b When K tends to infinity, one root approaches −∞, the remaining roots ap-
proaches the zeros of Tn−1 (s). The zeros of Tn−1 (s) are in the LHP according
to the problem formulation. Hence, if K is large enough, the system is asymp-
3.8 When K is small the system has a real unstable pole, that is, the magni-
totically stable.
tude of the step . . . . . . . . grows without bound and the .step
. . . . .response . . . . . . . . has no
. . . . .response
oscillations ⇒ K = 4 corresponds to step response C. Go back
When K is larger we have an unstable complex-conjugated pole pair, that is,
the magnitude of the step . . . . . . . . . grows without bound and the .step
. . . . . response . . . . response
.........
is oscillative. ⇒ K = 10 corresponds to step response D. 3.10 The system G(s) has no poles in the RHP. The closed loop system is asymp-
totically stable if the Nyquist curve of KGo (s) does not enclose the point −1.
For even larger values of K all poles end up in the LHP. As K grows the In the problem, Nyquist diagrams for G(s) are given. The axes must hence be
step . . . . . . . . . becomes faster since the dominating poles move away from the
. . . . .response rescaled with a factor K.
origin. K = 18 corresponds to step response B and K = 50 to step response A.
Answer: K Step a) (i) Yes. (ii) Yes. (iii) No. (iv) Yes.
4 C
b) (i) Stable if 0.4K < 1, that is, K < 2.5.
10 D
18 B (ii) Stable for K > 0.
50 A
(iii) Stable if 2K < 1, that is, K < 1/2.
Go back
(iv) Stable if 4K < 1 or 2K > 1, that is, K < 1/4 or K > 1/2.

3.9 Go back
sn−1 + b1 sn−2 + · · · + bn Tn−1 (s)
G(s) = n =
s + a1 sn−1 + · · · + an Nn (s)
With a proportional feedback
. . . . . . . . the closed loop system becomes 3.11 a) G(iω) = 1
iω gives
G(s) Tn−1 (s) 1
Gc (s) = = |G(iω)| = arg G(iω) = −90◦
1 + KG(s) Nn (s) + KTn−1 (s) ω

17
1
b) G(iω) = −ω 2 gives as the open loop system. On the large half circle 1s ≈ 0 which means that
it is mapped onto the origin even for 1s · G(s). On the small half circle
1
arg G(iω) = arg G(iω) = −180◦ π π
ω2 s = r · eiθ − <θ<
2 2
This gives the Nyquist curves in Figure 3.11a. we have G(s) ≈ 2 and
1 1
= e−iθ
a) b) s r
1
Im Im Hence, it is transformed by s · G(s) to a large half circle in the RHP.
Setting s = iω in 1s gives the absolute value ω1 and the argument
. . . . . . . . . . −π/2.
The Nyquist curve is turned 90◦ and “increased” by a factor ω1 . This gives
the Nyquist path in Figure 3.12a.
ω 3
Answer: The closed loop system is asymptotically stable if 2K < 1.
This means that also in this case we have K < 2/3.
Re Re
Im
ω

Figure 3.11a
−3/ω=−3/2
1.5/ω=0.15
Re
Go back

3.12 a) Since G(iω) → 0, ω → ∞, we assume that the large half circle is mapped
onto the origin. The small half circle is mapped onto the point 2. The
point −1 must not be encircled by the curve. This means that the closed
loop system is stable if 1.5 · K < 1. Hence K < 2/3.

b) Figure 3.12a
1 1 1
lim e(t) = lim sE(s) = lim s · · =
t→∞ s→0 s→0 1 + KG(s) s 1 + 2K Go back
for K < 2/3 according to a. B 3.13 a) The characteristic equation of the closed loop system is given by

c) The Nyquist criterion can also be applied to (s2 + s + 1)(s + 0.2) + KP · 0.2 = 0

K that is,
· G(s) P (s) = (s2 + s + 1)(s + 0.2) Q(s) = 0.2
s

18
Enter P (s) and Q(s). >> s = tf( ’s’ ); Draw the root
. . . . .locus.
. . . . . Click >> rlocus( Q / P )
>> P = ( s^2 + s + 1) * ( s + 0.2 ); in the figure to determine
1.5
>> Q = 0.2; the imaginary axis cross-
Draw the root
. . . . .locus.
. . . . . Click >> rlocus( Q / P ) ings.
1
in the figure to determine
2.5
the imaginary axis cross-
0.5
ings. 2

Imag Axis
1.5
0
1

0.5
−0.5

Imag Axis
0

−1
−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 Real Axis

−2

−2.5
For small KI the response of the closed loop system is dominated by the
poles on the real axis close to the origin. When KI increases the poles
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
Real Axis

become complex and move towards the imaginary axis, that is, the closed
When KP increases the two complex poles move towards the imaginary loop system becomes more oscillatory. Finally, for KI ≈ 1.5, the poles
axis, that is, the closed loop system becomes more oscillatory. Finally, for cross the imaginary axis, that is, the closed loop system becomes unstable.
KP ≈ 6.2, the poles cross the imaginary axis and the closed loop system As can be seen in Problem 3.4 a small value of KI , that is, a pole close to
becomes unstable. This result is in accordance with Problem 3.4. For the origin, gives a slow .step . . . . . . . . When KI increases the dominating
. . . . .response.
small values of KP the properties of the .step . . . . . . . . are mainly deter-
. . . . .response poles become complex and the step . . . . . . . . . becomes oscillatory.
. . . . .response
mined by the real pole close to the origin. For larger values the complex
A large settling . . . . will typically follow if the system is slow or have poor
. . . . . . . . .time
poles start to dominate and when the complex poles cross the imaginary
damping. Here, the large .settling . . . . for small KI is due to the system
. . . . . . . .time
axis the amplitude of the oscillations in the step . . . . . . . . increases and
. . . . .response being slow. That the steady . . . . . is eliminated cannot easily be
. . . . . . . . . . . . .error
state
the system becomes unstable.
seen in the root..........locus.
Note, however, that the root . . . . . alone does not give sufficient informa-
. . . . .locus
tion to tell how the stationary error changes with the parameter. c) Using PID control with KP = 1, KI = 1 and T = 0.1 the characteristic
equation of the closed loop system is given by
b) The characteristic equation of the closed loop system using the PI con-
troller with KP = 1 is given by (0.1s + 1)(s(s2 + s + 1)(s + 0.2) + 0.2(s + 1)) + KD · 0.2s2 = 0

s((s2 + s + 1)(s + 0.2) + 0.2) + KI · 0.2 = 0 that is,

that is, P (s) = (0.1s + 1)(s4 + 1.2s3 + 1.2s2 + 0.4s + 0.2) Q(s) = 0.2s2
3 2
P (s) = s(s + 1.2s + 1.2s + 0.4) Q(s) = 0.2
Enter P (s) and Q(s). >> P = ( 0.1*s + 1 ) * ...
Enter P (s) and Q(s). >> P = s * ( s^3 + 1.2*s^2 + 1.2*s + 0.4 ); ( s^4 + 1.2*s^3 + 1.2*s^2 + 0.4*s + 0.2 )
>> Q = 0.2; >> Q = 0.2*s^2;

19
Draw the root . . . . .locus.
..... By >> rlocus( Q / P ) 3.14 a) Enter the system and the >> s = tf( ’s’ );
changing the axes or using >> axis([ -2 2 -4 4 ]) regulator. Plot the Nyquist >> G = 0.2 / ( ( s^2 + s + 1 ) * ( s + 0.2) );
the function zoom the region curve of the open loop sys- >> F = 1;
4
of interest can be seen more tem. >> nyquist( F * G )
clearly (there is also a fifth 3
Nyquist Diagrams
pole which is of less inter- 0.8
2
est since it is located on the
negative real axis, far away 1 0.6

Imag Axis
from the origin). 0 0.4

−1 0.2

Imaginary Axis
−2 0

−3
−0.2

−4
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2 −0.4
Real Axis

−0.6

−0.8
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
Real Axis

When KD increases the complex poles closest to the origin move to-
wards the origin and and at the same time the damping of the system
is increased. When KD increases even more the second pair of complex
poles moves towards the imaginary axis giving a high frequency oscillation
which finally gives instability.

Go back

The Nyquist curve is “far away” from the point −1 for all frequencies
and the step . . . . . . . . . of the closed loop system is well damped. As KP
. . . . .response
B increases the Nyquist curve grows in size and for KP = 6.2 the Nyquist
curve reaches −1 and thus is the limit of stability.

20
b) Generate a PI controller. >> F = 1 + 1/s; c) Generate a PID controller. >> F = 1 + 1/s + 2*s / ( 0.1*s + 1 );
Plot the Nyquist curve of >> nyquist( F * G ) Plot the Nyquist curve of >> nyquist( F * G )
the open loop system. >> axis([ -2 2 -2 2 ]) the open loop system. Here >> axis([ -2 2 -2 2 ])
with the parameters KP =
Nyquist Diagrams Nyquist Diagrams

2
1, KI = 1, KD = 2, and 2

T = 0.1
1.5 1.5

1 1

0.5 0.5

Imaginary Axis

Imaginary Axis
0 0

−0.5 −0.5

−1 −1

−1.5 −1.5

−2 −2
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2
Real Axis Real Axis

The Nyquist curve is now further away from −1 which corresponds to an


improved damping of the closed loop system. The system becomes unstable
around KD = 66.

Go back

For low frequencies the Nyquist curve is now far away from the origin
since the integrating part makes |G(iω)| large for low frequencies. The
Nyquist curve now passes closer to −1 which results in a more oscillatory B
closed loop system. The system becomes unstable around KI = 1.44.

21
3.15 a) Enter the systems and the >> s = tf( ’s’ ); b) Increase the gain in >> F = 2.5;
regulator. Make a Bode >> G = 0.4 / ( ( s^2 + s + 1 ) * ( s + 0.2 ) ); the regulator. Make >> margin( F * G )
plot of the open loop sys- >> F = 1; a Bode plot. The
Bode Diagram
tem when the regulator and >> margin( F * G ) gain
. . . . . .crossover
. . . . . . . . . .frequency
.......... 2
Gm = 1.24 (at 1.1 rad/sec) , Pm = 12.6 deg (at 0.99 rad/sec)
10
the system are put in se- ωc has increased while ωp
ries. This gives ωc = 0.38, 2
Bode Diagram
Gm = 3.1 (at 1.1 rad/sec) , Pm = 94.2 deg (at 0.377 rad/sec) is the same, since only 10
0

ωp = 1.1, ϕm = 94◦ and

Magnitude (abs)
10
the amplitude curve is
−2

Am = 3.1. 10
0 changed when the gain is 10

Magnitude (abs)
changed. Both the gain 10
−4
−2
10
and phase . . . . . . margins
. . . . . . . . have −6

10
−4 decreased. 10 0

−45

−6 −90

Phase (deg)
10 0

−135
−45
−180
−90
Phase (deg)

−225
−135
−270
−180 −2 −1 0 1 2
10 10 10 10 10
−225 Frequency (rad/sec)

−270
−2 −1 0 1 2
10 10 10 10 10
Frequency (rad/sec)

Plot the .step


. . . . .response.
........ >> Gc = feedback( F * G, 1 ); Plot the .step . . . . response.
......... The >> Gc = feedback( F * G, 1 );
>> step( Gc, 50 ) closed loop system is now >> step( Gc, 50 )
much more oscillatory due
Step Response Step Response

0.8
to the reduced phase and 1.4
gain
. . . . . .margins.
.......
0.7
1.2

0.6
1

0.5
0.8
Amplitude

Amplitude
0.4

0.6
0.3

0.4
0.2

0.2
0.1

0 0
0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50
Time (sec.) Time (sec.)

22
c) Increase the gain to 3.1, >> F = 3.1; 3.16 The top row gives a steady
. . . . . . .state . . . . . ⇒ KI = 0. Left column less oscillative
. . . . . .error
that is, the value of Am >> margin( F * G ) than the right one ⇒ KD 6= 0.
in a). Both the gain and
phase Bode Diagram Answer: A–iii, B–i, C–iv, D–ii.
. . . . . . .margin
. . . . . . . are at the 10
2
Gm = 1 (at 1.1 rad/sec) , Pm = 0.000321 deg (at 1.1 rad/sec)

limit between what would


give an stable or unstable 10
0
Go back

Magnitude (abs)
closed loop system. Any
−2

further increase of the gain 10

will give an unstable closed


3.17 a) The motor transfer . . . . . . . . . is (from Solution 2.1))
. . . . . . . . .function
−4
10

loop system.
θ(s) k0
= G(s) =
−6
10 0

−45 U (s) s(s + 1/τ )


−90
Phase (deg)

−135 Feedback control


−180
U (s) = F (s)(θref (s) − θ(s))
−225

−270
10
−2
10
−1
10
0
10
1 2
10
where F (s) is the control law .transfer . . . . . . . . and θref is the reference
. . . . . . . . .function
Frequency (rad/sec) signal. The closed loop transfer
. . . . . . . . . . . . . . . . . . is given by
function

Plot the step


. . . . . response.
. . . . . . . . . The >> Gc = feedback( F * G, 1 ); θ(s) F (s)G(s)
Gc (s) = =
output now oscillates with >> step( Gc, 50 ) θref (s) 1 + F (s)G(s)
constant amplitude.
Step Response
Proportional feedback
. . . . . . . . . F (s) = KP and G(s) according to above give
1.5

KP k0
Gc (s) =
s2 + s/τ + KP k0
1
The poles of the closed loop system are given by
Amplitude

s2 + s/τ + KP k0 = 0

0.5 that is, √


−1 ± 1 − 4τ 2 KP k0
s=

0
0 5 10 15 20 25 30 35 40 45 50
(1) KP small ⇒ Both poles on the real axis, but one pole very close to
Time (sec.) the origin ⇒ Slow but not oscillatory system.

Go back (2) KP = 1/(4τ 2 k0 ) ⇒ Both poles in −1/(2τ ), that is, faster than in
(1) but still no oscillations.

(3) KP large ⇒ Complex poles with large imaginary part relative to the
real part, that is oscillative system.

23
b) The transfer . . . . . . . . . from the reference signal to the tracking error e =
. . . . . . . . .function gives
θref − θ is given by
1 s2 (s + 1/τ )
1 s(s + 1/τ ) E(s) = θref (s) = 2 θref (s)
E(s) = θref (s) = θref (s) 1 + F (s)G(s) s (s + 1/τ ) + k0 (KP s + KI )
1 + F (s)G(s) s(s + 1/τ ) + KP k0
When θref is a ramp according to b) we get
The reference signal is a step
( lim e(t) = lim sE(s) = 0
t→∞ s→0
0, t<0
θref (t) =
A, t≥0 Comment: The .final . . . . .value . . . . . . . . can only be used when the denominator
. . . . . . theorem
of G(s)U (s) has all zeros in the left half plane or at the origin. G(s) is the
which gives system transfer
A . . . . . . . . . and U (s) is the input signal.
. . . . . . . . .function
θref (s) = Go back
s
The final
. . . . . .value . . . . . . . . gives
. . . . . .theorem
s(s + 1/τ ) A 3.18 The transfer . . . . . . . . . for the loop
. . . . . . . . .function . . . . . is Go .
. . . . . gain
lim e(t) = lim s · · =0
s(s + 1/τ ) + KP k0 s The transfer . . . . . . . . from the reference signal R to the output Y is obtained
t→∞ s→0
. . . . . . . . .function
The reference signal is a ramp by using the block diagram and observing that

Y = Go (R − Y )
(
0, t<0
θref (t) =
At, t ≥ 0 Solving this equation for Y gives
which gives Go
Y = R
θref (s) = 2
A 1 + Go
s
The final value theorem gives (the closed loop is asymptotically stable for that is, the .transfer . . . . . . . . for the closed loop system is Gc =
. . . . . . . . .function 1+Go .
Go
....................
all KP according to a)) Go back

s(s + 1/τ ) A A
lim e(t) = lim s · · =
s(s + 1/τ ) + KP k0 s2 KP k0 τ 3.19 a) The loop . . . . Go , is F G.
t→∞ s→0
. . . . .gain,
The error can be decreased by selecting KP large, but according to a) the b) The influence of the disturbance
. . . . . . . . . . . . (N = 0) can be neglected. Use the
system becomes very oscillative for large KP . solution to problem Solution 3.18. The transfer . . . . . . . . . from R to Y is
. . . . . . . . .function
c) PI controller Gc = 1+F
FG
G , that is, Y = G c R.
Z t
u(t) = KP e(t) + KI e(τ ) dτ c) The influence of the reference signal can be neglected. (R = 0). The block
0 diagram gives
that is Y = F GE = −F G(Y + N )
1
F (s) = KP + KI which implies that the .transfer . . . . . . . . . from N to Y is Gny = − 1+F G .
. . . . . . . . function
FG
s

24
d) The influence of the disturbance
. . . . . . . . . . . can be neglected (N = 0). The block 3.21 • The four step . . . . . . . . . . are characterized by, for example, that A and D
. . . . .responses
diagram gives have a .steady . . . . . while C and B do not. Further, A shows better
. . . . . . . . . . . . .error,
state
E = R − Y = R − F GE damping than D, and C shows better damping than B. It can also be
noticed (although it is not as apparent as the other characteristics) that
Solving for E gives
1 the error decays more slowly in C than in B.
E= R
1 + FG • The four regulators are characterized by, for example, that regulators 1
that is, the .transfer 1 and 4 don’t have any integral action. Regulator 2 has more integral action
. . . . . . . . from R to E is Gre =
. . . . . . . . .function 1+F G .
than 3, and regulator 4 gives better damping than 1.
Go back
• The derivative part in the regulator improves the damping, while inte-
gral action eliminates the steady
. . . . . . .state . . . . . and reduces the damping.
. . . . . .error
3.20 a) The transfer . . . . . . . . . from reference signal to error signal is (see Solu-
. . . . . . . . . function Besides, for small values of KI , the error will decay slowly to zero.
tion 3.19d) Answer: A–4, B–2, C–3, D–1.
1 1 (s + 1)(s + 3) Go back
E= R(s) = R(s) = R(s)
1 + FG 1+ K
(s+1)(s+3)
(s + 1)(s + 3) + K

r(t) step ⇒ R(s) = As . The steady state value of the error is given by
the final
. . . . . .value
. . . . . .theorem
........
(s + 1)(s + 3) 3A
lim e(t) = lim sE(s) = lim A=
t→∞ s→0 s→0 (s + 1)(s + 3) + K 3+K

b) In order to make the .steady


. . . . . . .state . . . . . equal to zero the regulator has to
. . . . . .error
contain an integrator. Using, for example, F (s) = 1s one gets

A A
lim e(t) = lim = lim 1 1 =0
t→∞ s→0 1 + F (s)G(s) s→0 1 + s (s+1)(s+3)

Notice though, that the integrating feedback


. . . . . . . . . normally has to be combined
with proportional feedback.
.........
c) The transfer . . . . . . . . . from R to Y using F (s) = 1 is
. . . . . . . . .function
FG 1 1 1
Gc (s) = = = 2 =
1 + FG (s + 1)(s + 3) + 1 s + 4s + 4 (s + 2)2

The system has two poles in −2 and no zeros.


Go back

25
4 Frequency Description
4.1 If we let ū(t) and ȳ(t) denote the actual temperature and the measured tem- 4.2 The equation
perature, respectively, we can divide the temperatures into their mean values ω = ψ̇
and variations as follows:
ū(t) = u0 + u(t) and
T1 · ω̇ = −ω + K1 · δ
and
ȳ(t) = y0 + y(t) give the transfer
. . . . . . . . .function
.........
where u0 = y0 = 30 C. ◦
K1 0.1
The thermometer is modeled as a first order linear system Gs (s) = =
s(1 + T1 s) s(1 + s/0.01)
Y (s) a
= G(s) = The transfer . . . . . . . . . of the rudder machine is
. . . . . . . . .function
U (s) s+b
Since 1 1
Gr (s) = =
u(t) = A sin(ωt) 1 + sT2 1 + s/0.1
it follows that after the transients have vanished (that is, in steady state)
and the controller has the transfer
. . . . . . . . .function
.........
y(t) = |G(iω)| A sin(ωt + φ)
1 + s/a 1 + s/0.02
where (assuming a positive) F (s) = K =K
1 + s/b 1 + s/0.05
φ = arg(G(iω)) = arg(a) − arg(iω + b) = 0 − arctan(ω/b)
a) K = 0.5 gives
From the relationship ω = 2π/T and from the figure the following is obtained:
2π 0.05(1 + s/0.02)
1. ω = 0.314 · 60 rad/s = 0.33 rad/s Go (s) = F (s)Gr (s)Gs (s) =
s(1 + s/0.01)(1 + s/0.05)(1 + s/0.1)
2. φ = −0.056
0.314 · 2π rad = −1.12 rad
0.9
It thus follows that
3. |G(iω)| = 2.0 = 0.45
ω 2
0.05 1 + ( 0.02 )
p
Hence |Go (iω)| = p ω 2 ω 2 ω 2
0.33 ω 1 + ( 0.01 ) 1 + ( 0.05 ) 1 + ( 0.1 )
p p
ω
tan(φ) = − ⇒ b= = 0.16
b 2.066
and with low frequency asymptote
a
|G(iω)| = √ ⇒ a = 0.16 0.05
ω + b2
2
|Go (iω)| → , ω→0
ω
Answer:
0.16 and
G(s) =
s + 0.16
ω ω ω ω
Go back arg Go (iω) = arctan − 90◦ − arctan − arctan − arctan
0.02 0.01 0.05 0.1

26
c)
10 Ψref (t) = A sin(αt)
|Go (iω)|

Am = 4.18
gives
1
Ψ(t) = B sin(βt + ϕ)
0.1 where A = 5 , α = 0.02, β = α, B = A |Gc (iα)| and ϕ = arg Gc (iα). The

transfer . . . . . . . . . for the closed loop system when K = 0.5 is


. . . . . . . . .function
-90◦ Go (s)

ϕm = 31.93◦
Gc (s) =
1 + Go (s)
arg Go (iω)

-180◦ where
|Go (i0.02)| = 1.44 arg Go (i0.02) = −142◦
That is
-270◦
Go (i0.02) = −1.135 − i0.886
0.001 0.01 0.1 1
which gives
ωc = 0.026 ω [rad/s]
ωp = 0.06 1.44
|Gc (i0.02)| = √ = 1.61 ⇒ B = 8◦
0.1352 + 0.8862
Figure 4.2a
and
0.886
The gain is drawn approximatively based on a known gain at some point arg Gc (i0.02) = −142◦ + 180◦ − arctan( ) = −0.76 rad
0.05
0.135
of the low frequency asymptote, 0.005 = 10, and the breakpoints and
slopes of the asymptotes: Answer: B = 8◦ , β = 0.02 rad/s and ϕ = −0.76 rad.
Frequency [rad/s] 0.01 0.02 0.05 0.1 Go back
Slope −1 −2 −1 −2 −3
The phase shift is drawn based on a couple of samples:
Frequency [rad/s] 0.005 0.01 0.02 0.04 0.08 4.3 a) As ω → 0, |G(iω)| → ∞ and arg G(iω) → −90◦ . The gain is first de-
Phase −111◦ −125◦ −142◦ −163◦ −194◦ creasing (low frequencies). It then increases, and finally decreases again
(approaching zero for high frequencies). The phase shift is increasing at
The Bode plot in Figure 4.2a gives: ωc = 0.026 rad/s, ϕm = 32◦ , Am =
low frequencies. As the frequency becomes higher the phase shift is posi-
4.2.
tive in an interval until it decreases towards −90◦ . This gives the plot in
b) The system starts to oscillate if K is chosen so that arg(Go (iωc )) = −180◦ . Figure 4.3a.
This gives the gain
. . . . . crossover . . . . . . . . . ωc = ωp = 0.06 rad/s. This
. . . . . . . . . . .frequency b) A system with a Bode plot as the one shown above must have one pole
implies that the gain should be amplified 4.2 times. Therefore, choose
in the origin since arg G(iω) → −90◦ as ω → 0. Then two break points
K = 0.5 · 4.2 = 2.1.
appear (up), since there is a positive phase shift. After that, there must
2π 2π be two break points (down), since the phase shift should approach −90◦ .
ω = 2π/T ⇒ T = = = 105 s
ωc 0.06 Hence, the plot in Figure 4.3b is possible.
Answer: The period time will be 105 seconds, and K = 2.1. Go back

27
4.4 From the final value of step . . . . . . . . . B (the only one greater than 1) and
. . . . . response
static gain
........... in Bode gain C (the only one greater than 1), the step response–
101 Bode gain pair B–C follows. Step . . . . . . . . . C and A have approximately the
. . . . .responses
same .overshoots
......... but different fundamental frequencies. Bode gains B and
100 D have equal resonance peaks but D has a lower resonance frequency. This
|G(iω)|

gives the combinations C–D and A–B. The remaining combination is D–A,
10−1 which is a good match with small .overshoot . . . . . . . . . (resonance peak) and final value
( static gain)
........... 1.
10−2
Go back
60◦
B 4.5 a) Enter the system and make >> s = tf( ’s’ );
30◦
arg G(iω)

a Bode plot. >> GA=/(s^2+6*s+5)


0◦
>> bode( GA )
−30◦
Sometimes you might want to increase resolution and use specific frequen-
−60◦
cies, and only plot the amplitude
−90◦
1000 points from 0.1 to 10 >> w = logspace(-1,1,1000);
10−1 100 101 102 103 104 105 >> bodemag( GA , w)
ω [rad/s]
Use, for example, curve handles and “Characteristics” in the right click
Figure 4.3a menu to find static . . . . bandwidth, resonance frequency, and resonance
. . . . . . .gain,
peak. The other systems are treated in the same way. The results can
be summarized in the following table. (Note that gain values may be
presented in dB20 in Matlab.)

System G(0) ωB ωr Mp
Im
GA 1 0.96
GB 1 3.2
GC 1 6.35 3.55 1.15
GD 1 12.71 7.08 1.15
GE 1 7.71 4.95 5.02
Re
GF 1 6.87 4.15 1.36

b) Using the results in a) and in Problem 2.6, the following observations can
be made. (i): The bandwidth of a system is (approximately) inversely
proportional to the rise . . . . High bandwidth implies a short rise
. . . . .time. . . . . .time
....
Figure 4.3b. Pole-zero diagram. Not accurate in scale; the diagram shall only be inter- and hence a fast system. (ii): The damping is inversely proportional to
preted as a right to left ordering of poles and zeros, with the first pole at the origin. the height of the resonance peak. A large peak implies low damping and
large overshoot.
..........
Go back

28
4.6 From the frequency responce interpretation of the .transfer . . . . . . . . (“a sinu-
. . . . . . . . .function 4.8 a) To determine the phase difference, φ, given a diagram with two sinusoids,
soid in gives a sinusoid out”) and the input being sin(ωt) and K sin(ωt + φ), one possibility is to consider the time points
when the two curves pass 0. Determine t1 and t2 such that
u(t) = 2 sin(2t − 1/2)
sin(ωt1 ) = 0
it follows that the output is
K sin(ωt2 + φ) = 0
y(t) = 2 |G(i2)| sin(2t − 1/2 + arg G(i2))
This gives that ωt1 = ωt2 + φ, that is,
−2s
Here G(s) = s(s+1) ,
e
and hence φ = −ωt∆
1 1 where t∆ = t2 − t1 . For example, consider the second graph where t∆ ≈
|G(i2)| = √ = √
2
2 2 +1 2 5 0.18 s and ω = 5 rad/s). Hence, φ = −0.9 rad. This results in the table
π below, where the answer to part b is also included.
arg G(i2) = −4 − − arctan 2
2
ω |G(iω)| arg G(iω)
Go back 1 1 = 0 dB20 −0.2 rad = −11◦
5 0.8 = −1.9 dB20 −0.9 rad = −52◦
10 0.5 = −6 dB20 −1.6 rad = −92◦
4.7 The input is a sinusoid with amplitude 1 and angular frequency ω = 2 rad/s. 20 0.2 = −14 dB20 −2.2 rad = −126◦

a) 0.45 sin(2t − 1.1). b) Just evaluate the decibel formula to obtain the values in the table above.
1 √1
(Gain: i2+1 = ≈ 0.45, phase: − arg(i2 + 1) ≈ −1.1 rad = −63 .) ◦
5 c) A Bode plot of the system is given in Figure 4.8a
b) The system is unstable. Hence, the system output will tend to infinity, Go back
and the system will not reach a steady state. To be more precise, the
general form of the solution to the differential equation describing the
system output is y(t) = C0 et + √15 sin(2t − π + arctan 2), and any initial 4.9 Answer: G1 –B, G2 –D, G3 –A, G4 –C, G5 –E.
state y(0) 6= √15 sin(−π + arctan 2) will lead to a solution that tends to
infinity. This will almost always be the case in practice. • The Bode plot B has .static . . . . 1 and no resonance peak, and hence
. . . . . .gain
G1 –B. It can also be seen that the Bode plot B decays by one decade
c) 0.11 sin(2t − 2.4)
(20 dB20 ) when the frequency increases by a factor of ten (“the slope is
1 √ 1
(Gain: (i2+1)(i4+1) = √
5 17
≈ 0.11, phase: − arg(i2 + 1) − arg(4i + 1) ≈ −1”) and that G1 has one pole.
−2.4 rad = −139 .) ◦
• The Bode plots A and C have both infinite gain for when the frequency
d) 0.45 sin(2(t − 0.5) − 1.1) = 0.45 sin(2t − 2.1). tends to zero, that is, they correspond to systems containing an integrator
Similar to problem a), with an extra time . . . . . of 0.5 s.
. . . . . .delay ⇒ systems G3 and G4 . The Bode plot C decays more rapidly for high
frequencies ⇒ the relative degree (number of poles − number of zeros) is
Go back higher. Hence G3 –A, G4 –C.

29
1 Go back
0.5
|G(iω)|

0.2
0.1 4.11 a) The closed loop system a has a peak resonance, corresponding to an os-
0.05 cillatory system as in .step . . . . . . . . 1. An oscillatory system also means
. . . . .response
0.02 a system with small phase
. . . . . . . . . . . . . . and complex poles.
margin
0.01 Answer: B – a – 1 – II and A – b – 2 – I.
0◦
b) Step . . . . . . . . 1 is faster than .step
. . . . . .response . . . . . . . . 2, that is, has a higher band-
. . . . .response
arg G(iω)

width and higher gain crossover frequency. Thus, it matches the closed
-90◦ loop system b and the open system B. A faster .step . . . . . . . . has the dom-
. . . . .response
inant pole further into the left half plane.
-180◦
Answer: B – b – 1 – I and A – a – 2 – II.
Go back
0.5 1 2 5 10 20 50
ω [rad/s]

Figure 4.8a 4.12 a) Putting the denominator equal to zero gives the pole s = −1, and putting
the numerator equal to zero gives the zero s = −α.

• The Bode plots D and E have peaks ⇒ systems G2 and G5 . (For G2 b) The static . . . . of the system is given by G(0), and in this case this gives
. . . . . . .gain
the peak is caused by the zero where the curve “turns up” at ω = 1.) G(0) = 1
The Bode plot E has larger slope than D for high frequencies, that is,
E corresponds to a system with higher relative degree. G2 has one pole for all values of α.
more than zeros, G5 has 2 poles, and hence G2 –D, G5 –E. c) The absolute value of the frequency function is given by
(ω/α)2 + 1 (1/α)2 + 1/ω 2
p p
Go back
| G(iω) |= √ =
ω2 + 1 1 + 1/ω 2
p

4.10 • In step which tends to 1/α as ω → ∞.


. . . . . . . . . A and D the step
. . . . . response . . . . . . . . . . tend to one, that is, they
. . . . .responses
correspond to Bode gain A and C. Step . . . . . . . . D has larger overshoot,
. . . . . .response .......... d) In both cases the curves are approximately horizontal at one for small
that is, it corresponds to Bode gain A, and consequently step ......... A
. . . . .response values of ω and approximately horizontal at 1/α for large values of ω. For
corresponds to Bode gain C. This gives the Bode gain–step response pairs α = 0.5 the curve will “bend upwards” around ω = 0.5 and then “bend
A–D and C–A. back” around ω = 1. For α = 2 the curve will “bend down” around ω = 1
• Step and then “bend back” around ω = 2. The curve hence bends down first
. . . . . . . . B has no overshoot,
. . . . . .response . . . . . . . . . . which implies that it corresponds to
Bode gain D, which has no peak. This gives the combination D–B. when the zero is to the left of the pole on the negative real axis, while it
bends up first when the zero is to the right of the pole. Figure 4.12a show
• The remaining combination is B–C. Step . . . . . . . . . C has an .overshoot
. . . . . response ......... the two cases. Both axes have logarithmic scales.
which can be related to the peak in the Bode gain plot. It can also be Go back
seen that this pair belongs to the fastest system.

30
Bode Diagram
Bode Diagram 1
0.95
1.9
1.8 0.9

1.7 0.85

1.6 0.8
Magnitude (abs)
Magnitude (abs)

1.5 0.75

1.4 0.7

1.3 0.65

1.2 0.6

1.1 0.55

0.5
10 -2 10 -1 10 0 10 1 10 -1 10 0 10 1 10 2
Frequency (rad/s) Frequency (rad/s)

Figure 4.12a. | G(iω) |. Left curve for α = 0.5. Right curve α = 2.

31
5 Compensation
c) Twice as large gain
. . . . .crossover . . . . . . . . . is desired:
. . . . . . . . . . .frequency
1

Am = 5.02
0.7
|G(iω)|

0.525 0.5 ωc,d = 0.30 rad/s ϕm,d = 50◦


0.3
0.2 At the frequency 0.30 rad/s the .phase . . . . . . . is −5 . Hence, a phase
. . . . . .margin

lead of 55 is needed. To this end, use the lead-compensator Flead , where


0.1 Flead (s) = K(τD s + 1)/(βτD s + 1). Set β = 0.1 (according to the diagram
0◦ in Glad&Ljung) in order to achieve the required phase lead. To obtain
the maximum phase lead at the desired gain crossover frequency, let

ϕm = 88.13◦
arg G(iω)

-90◦
-130◦ 1
τD = √ = 10.54
-180◦ ωc,d β

-270◦ Finally, K is chosen so that ωc,d is obtained. From the data, we have
0.03 0.05 0.07 0.1 0.2 0.3 0.5 |G(i0.3)| = 0.18
ωc = 0.079 0.145 ωp = 0.28 ω [rad/s] √
K β
1 = |Flead (iωc,d )G(iωc,d )| = √ |G(iωc,d )| ⇔K= = 1.76
Figure 5.1a β 0.18

Answer:
5.1 Let G denote the heat exchanger’s transfer
. . . . . . . . .function.
......... (10.54s + 1)
F (s) = 1.76
(0.1 · 10.54s + 1)
a) Draw the Bode plot using the given table. From the diagram in Figure 5.1a
it follows that
5.2 Notation. The notation “A – B – C” is used to say that the system with
ωc = 0.079 rad/s ϕm = 88◦ Am = 5.0 open loop Bode plot in row A has its closed loop Bode plot in row B, and its
step . . . . . . . . . in row C.
. . . . .response
b) A proportional controller does not change the phase curve. Accord- A good start is often to look at the static . . . . and the final value of the
. . . . . . .gain
ing to Figure 5.1a, the phase curve crosses −130◦ at the frequency step responses.
............... The static gain
........... of the open loop system and the closed
|Go (0)|
0.15 rad/s. A gain crossover at this frequency will yield exactly the re- loop system are related as |Gc (0)| = |1+Go (0)| . Systems with the same
quired phase . . . . . . . . and any higher gain
. . . . . . margin, . . . . . .crossover . . . . . . . . . . will yield
. . . . . . . . . .frequency static . . . . can then be separated by looking at stability margins, resonance
. . . . . . .gain
one that is too small.∗ peek, .overshoot,
. . . . . . . . . bandwidth, and speed. Three of the combinations are easy
∗ The controller gain that yields the desired gain to identify:
. . . . . .crossover
. . . . . . . . . .frequency
. . . . . . . . . . can be computed as
1 1 B – C – E: Infinite open loop static . . . . . matches closed loop static
. . . . . . gain . . . . equal
. . . . . . .gain
K= = = 1.9
|G(0.15i)| 0.525 1, which in turn matches a step response
.............. that settles at amplitude 1.

32
C – A – B: Zero static loop 10
. . . . . matches zero closed-loop gain, which in turn
. . . . . gain
matches a step response
.............. that settles at amplitude 0. It is also possible to relate 1

|G(iω)|
the Bode plots by their high frequency gains. 0.371
0.1
A – E – C: Finite but non-zero open loop static . . . . matches non-zero closed
. . . . . . .gain
loop .static . . . . less than 1. No resonance frequency in neither the open-loop
. . . . . .gain 0.01
or closed-loop can be seen, and the step . . . . . . . . . is monotonic without any
. . . . .response
overshoot
.......... -90◦

ϕ∆ = 34.86◦
arg G(iω)
The remaining open loop Bode plots are D and E. These should be matched
-180◦
with the closed-loop gain curves B and D, and step . . . . . . . . . . A and D. All
. . . . . responses
Bode plots show signs of resonance frequencies in the open-loop, surving to
the closed-loop. Both open loop Bode plots show a static . . . . near 1, which
. . . . . . .gain -270◦
will make it hard (albeit possible) to use that feature for identification. We
5 10 20 50 100 200
note though that D has a significantly lower bandwidth than E. Since the
ωc = 8.9 ω [rad/s]
closed-loop is given by Gc = 1+G
Go
we can expect the closed-loop bandwidth
o ωc,d = 18
with D to be much lower than with E (consider for instance a high frequency
where open-loop E is around 1 in absolute value, at that point D will be very Figure 5.3a
small, consequently the closed-loop terms will be around 1 and 0 in order of
magnitudes). A high bandwidth in closed loop leads to a faster system. The
last two combinations are thus D–D–D, E–B–A. The gain is drawn approximatively based on a known gain at some point of
the low frequency asymptote, 10
10 = 1, and the breakpoints and slopes of the
Go back
asymptotes:
Frequency [rad/s] 20 40 100
Slope −1 −2 −3 −4
5.3
10 The phase curve is drawn based on a couple of samples:
G(s) =
s(1 + 20 )(1
s
+ 40
s
)(1 + 100 )
s Frequency [rad/s] 10 20 50
Phase −136◦ −173◦ −236◦
gives
In addition, one can also use
10
|G(iω)| = ω 2 ω 2 ω 2
ω 1 + ( 20 ) 1 + ( 40 ) 1 + ( 100 )
p p p
arg G(iω) → −90◦ , ω → 0
with low frequency asymptote arg G(iω) → −360◦ , ω → ∞

10 The Bode plot in Figure 5.3a gives that ωc = 8.9 rad/s, ϕm = 48◦ and
|G(iω)| → , ω→0
ω Am = 3.9. However, it is only the .gain . . . . .crossover . . . . . . . . . . which directly
. . . . . . . . . . frequency
interests us here; an increase of the speed with a factor of two and a preserved
and damping imply ωc,d = 18 rad/s and ϕm,d = ϕm . From the figure, we have
ω ω ω
arg G(iω) = −90◦ − arctan − arctan − arctan ϕ∆ = arg G(iωc ) − arg G(iωc,d ) = 35◦ . We suspect a lag compensator will be
20 40 100

33
introduced later, as we have low frequency requirements. A lag compensator, 5.4
if designed according to the prescribed recipe, will decrease the phase by at 1
G(s) = G1 (s)
most 6◦ in the designed gain
. . . . . .crossover . . . . . . . . . . Therefor, we require an
. . . . . . . . . .frequency. s
additional 6◦ phase advancement and end up in 41◦ To this end, use a lead gives
compensator (with standard notation of the parameters) with β = 0.21 and
τD = 1√
= 0.12. K is adjusted to get the desired gain crossover frequency: |G1 (iω)|
ωc,d β |G(iω)| =
ω
√ arg G(iω) = G1 (iω) − 90◦
K β
|G(iωc,d )Flead (iωc,d )| = |G(iωc,d )| · √ = 1 ⇒ K= = 1.2
β 0.37
A P controller gives a phase . . . . . . . . of 40 when
. . . . . . margin

The transfer . . . . . . . . from the reference input to the control error is given by
. . . . . . . . .function arg G(iω) = −140◦ ⇒ arg G1 (iω) = −50◦
1
E(s) = θref (s)
1 + F (s)G(s)

When θref (t) is a step, the .final


. . . . .value . . . . . . . . gives
. . . . . .theorem 10-1 1/8.58

|G1 (iω)|
lim e(t) = lim sE(s) = 0 0.0242
t→∞ s→0
-2
10
even without a lag compensator thanks to the integration in G(s). Here, the
final
. . . . . .value . . . . . . . . may be used since the system by construction is stable (the
. . . . . .theorem
. . . . . . . . . . . . . . is positive).
phase margin
0◦

arg G1 (iω)
In order to handle errors for ramp references, introduce a lag compensator
(with the usual notation of parameters) in the controller. Then |Flag (0)| = 1/γ, -50◦
and if θref (t) = 10 · t, that is, if -90◦
-107◦
10
θref (s) = -180◦
s2
10-2 10-1 100 101 102
one obtains ωc,P = 0.52 ω [rad/s]
ωc,d = 1.05
1 10 10γ
lim e(t) = lim sE(s) = lim s = < 0.01
t→∞ s→0 s→0 1 + F (s)G(s) s2 km · K Figure 5.4a

which gives γ < 0.01K = 0.012. Take γ = 0.012 to avoid excessively high low
From Figure 5.4a it is seen (although not easily) that this occurs at ωc,P =
frequency loop . . . . According to the rule of thumb, let τI = 10/ωc,d = 0.56.
. . . . .gain. 0.52 rad/s, which is also the highest possible gain . . . . .crossover . . . . . . . . . possible
. . . . . . . . . . .frequency
Answer:
0.12s + 1 0.56s + 1 to obtain with P control. The desired increase in speed by a factor of two is
F (s) = 1.2 · thus achieved by a new gain
. . . . . crossover . . . . . . . . . ωc,d = 1.05 rad/s. Figure 5.4a
. . . . . . . . . . .frequency
0.21 · 0.12s + 1 0.56s + 0.012
gives
Go back arg G1 (iωc,d ) = −107◦ ⇒ arg G(iωc,d ) = −197◦

34
A desired phase . . . . . . . of 40 requires that the phase be advanced by 57 +
. . . . . . .margin
◦ ◦
5.5 a) The Nyquist curve is drawn based on the following observations: First,
6 = 63 . To this end, employ a two equal lead compensators (using standard
◦ ◦
as ω → 0, |G(iω)| increases and arg G(iω) → −90◦ . Then, as ω → ∞,
notation of parameters), each advancing the phase by 32◦ ; take β = 0.31 and |G(iω)| → 0 and arg G(iω) decreases. We also have, ωc = 0.78 rad/s with
1√
τD = = 1.72. The controller gain is adjusted by the factor K to get arg G(iωc ) = −133◦ , and finally ωp = 3.2 rad/s with |G(iωp )| = 0.091.
ωc,d β
the desired gain crossover frequency: The resulting Nyquist curve is shown in Figure 5.5a.

2 1 0.024 √ Im
|Flead (iωc,d )| · |G(iωc,d )| = 1 ⇒ K2 √ 2 =1 ⇒ K= 13.3
0.31 1.05
−0.091 1
In order to handle errors for ramp references, introduce a lag compensator ωp = 3.2
(with the usual notation of parameters) in the controller. Then |Flag (0)| = 1/γ, Re
and |F (0)| = K 2 /γ. To choose γ, consider the Laplace transform of the control
error, 133◦
1
E(s) = R(s)
1 + F (s)G(s) ωc = 0.78
If r(t) = A · t (a ramp), that is, if
A
R(s) =
s2
one obtains
1 A A
lim e(t) = lim sE(s) = lim s = lim Figure 5.5a
t→∞ s→0 s→0 1 + F (s)G1 (s)/s s2 s→0 s + F (s)G1 (s)

A
=
|F (0)| · |G1 (0)| b) The gain . . . . . . . is 1/ |G(iωp )| = 11, which is also the highest possible
. . . . . .margin
proportional gain that preserves closed loop asymptotic stability.
This shows that the ramp error is inversely proportional to the .static . . . . of
. . . . . .gain
the controller. According to Figure 5.4a, the highest possible controller gain c) The Laplace transform of the control error is related to the reference as
when using a P controller and a phase . . . . . . . of 40 is required, is 8.6 ωc,P =
. . . . . . .margin

follows:
1 1
4.5 (remember that s contributes with ωc,P to the loop . . . . at ωc,P ). Hence,
. . . . .gain 1
E(s) = R(s)
to reduce the ramp error to 1% of that of the P controller, the static 1 + KG(s)
. . . . . of the
. . . . . . gain
new controller has to be at least 450. Therefore, take γ = K 2 /450 = 0.0296, With
and, according to the rule of thumb, let τI = 10/ωc,d = 9.52. 10
r(t) = 10t ⇒ R(s) =
Answer: s2
2 and using the final
. . . . . .value . . . . . . . . (from b we have that the system is
. . . . . .theorem
1.72s + 1 9.52s + 1

F (s) = 13.3 · stable), this yields
0.31 · 1.72s + 1 9.52s + 0.0296
10
Go back lim e(t) = lim sE(s) =
t→∞ s→0 2 lims→0 sG(s)

35
For small ω we have B 5.7 a) Enter the system and the >> s = tf( ’s’ );
1 regulator. Draw the Bode >> G = 725 / ...
G(s) ≈ ⇒ sG(s) → 1, s → 0 ⇒ lim e(t) = 5 plot. This gives ωc = ( ( s + 1 ) * ( s + 2.5 ) * ( s + 25 ) )
s t→∞
5 rad/s, ωp = 9.5 rad/s, >> F = 1;
Am = 3.5 and ϕm = 27◦ . >> margin( F * G )
d) Raising the gain curve in the Bode plot by K = 2 results in
Bode Diagram

ωc = 1.24 rad/s ϕm = 32◦ Gm = 10.8 dB (at 9.49 rad/sec) , Pm = 26.6 deg (at 4.99 rad/sec)

50

The closed loop system becomes unstable when the phase . . . . . . . is eaten
. . . . . . .margin
0

Magnitude (dB)
up by the phase lag of the delay, −50

−100

arg e−iωT = −ωT


−150
0

so in order to get an asymptotically stable closed loop system it is thus −45

−90

Phase (deg)
required that −135

−180

32◦ 0.55 rad −225

ωc T < 32 ◦
⇒ T < = = 0.44 s −270

1.24 rad/s 1.24 rad/s


−2 −1 0 1 2 3
10 10 10 10 10 10
Frequency (rad/sec)

Go back
b) From a) we know that at ωc,d = 5 rad/s the phase . . . . . . . is 27 . In order
. . . . . . .margin

to have ϕm ≥ 60 we need to increase the phase by approximately 40◦ ,



5.6 a) For this amplitude curve we cannot say anything about the stability since including 6◦ extra to compensate for a future lag compensator. This is
the system can have arbitrarily
. . . . . . . . . . . negative phase in any frequency. obtained using a lead compensator (using standard notation of parame-
ters) with β = 0.21. The phase compensation is located at the correct
b) It is stable, since the gain is less than 1 for all frequencies; there is no risk 1√
frequency by taking τD = = 0.43.
that the Nyquist curve could encircle −1 under these circumstances. ωc,d β

Go back The controller gain is adjusted by the factor K to get the desired gain
crossover frequency:

1 1
K · √ · |G(i5)| = K · √ ·1 = 1 ⇒
β 0.21
K = 0.46

The requirement e0 = 0, that is, no steady


. . . . . . . .state . . . . . . for a unit
. . . . . error . . . . . step
....
reference signal, is achieved by incorporating a lag compensator (using
standard notation of parameters) with γ = 0, and, using the rule of
thumb for the choice of τI , we take τI = 10/5 = 2.

36
Generate a lead-lag >> wc = 5; c) Compute the >> Gc1 = feedback( G, 1 );
regulator and make a >> b = 0.21; transfer function
.................. of the >> bode( Gc1, ’-’, Gc, ’-.’ )
Bode plot of the open >> tD = 1 / ( wc * sqrt( b ) ); closed loop system for
loop system. Both the >> K = sqrt( b ) / 1; F (s) = 1. Draw its Bode Bode Diagram

gain crossover frequency


.......................... >> Flead = K*( tD * s + 1 ) / ( b * tD * s + 1 ); plot side by side with the 50

and the phase


. . . . . . .margin
....... >> g = 0; Bode plot for the compen- 0

Magnitude (dB)
requirements are satisfied. >> tI = 10 / wc; sated system. (The curves −50
>> Flag = ( tI * s + 1 ) / ( tI * s + g ); of the compensated system
−100
>> F = Flead * Flag; are dash-dotted.)
>> margin( F * G ) −150
0

−45

Bode Diagram −90

Phase (deg)
Gm = 16.8 dB (at 17.5 rad/sec) , Pm = 62.6 deg (at 5.01 rad/sec)
−135
50
−180

0 −225
Magnitude (dB)

−270
−1 0 1 2 3
10 10 10 10 10
−50
Frequency (rad/sec)

−100

−150
−45
Comparing the two Bode plots we see that the main difference is that the
−90
height of the resonance peak has been reduced, that is, the damping of the
Phase (deg)

−135

−180
closed loop system has been increased due to the increased phase
. . . . . . margin.
........
−225 We also see that the bandwidth is approximately the same, since we have
−270
10
−2
10
−1
10
0
10
1
10
2 3
10
not changed the gain
. . . . .crossover
. . . . . . . . . . .frequency.
.........
Frequency (rad/sec)

d) Calculate the transfer . . . . . . . . from the reference signal to the error:


. . . . . . . . .function
Plot the .step
. . . . .response
. . . . . . . . of >> Gc = feedback( F * G, 1 );
the closed loop system. >> step( Gc, 10 ) 1
E(s) = R(s) − F (s)G(s)E(s) ⇒ E(s) = R(s)
1 + F (s)G(s)
Step Response

1.4

1.2
Let
1
1
S(s) =
1 + F (s)G(s)
Amplitude

0.8

0.6

Enter the .transfer


. . . . . . . . function
......... >> S = 1 / ( 1 + F * G );
0.4
S.
0.2
Create a time vector be- >> t = ( 0 : 0.1 : 30 ).’;
0
0 1 2 3 4 5 6 7 8 9 10 tween 0 and 30 with step >> r = t;
Time (sec)
0.1, and a reference signal
vector r(t) = t.

37
Plot the result. >> y = lsim( S, r, t );
1
Even though the >> plot( t, y ) |Flead (iωc,d )G(iωc,d )| = K √ 0.35 = 1
steady
. . . . . . . state
. . . . . .error
..... for a β
step reference signal is 0.4 which gives K = 2.39
zero (due to γ = 0), the
steady 0.35 In order to reduce the steady
. . . . . . . state . . . . . we introduce
. . . . . .error
. . . . . . . state
. . . . . .error
..... for a
ramp reference signal is 0.3
τI s + 1
non-zero. Flag (s) =
0.25
τI s + γ
0.2
The requirement on the steady
. . . . . . . state . . . . . using the same reference signal
. . . . . .error,
0.15
as in b), gives
0.1
1 0.5 γ
lim e(t) = lim sE(s) = lim s 2
= 5 ≤ 0.175
0.05
t→∞ s→0 s→0 1 + Flead (s)Flag (s)G(s) s K
0
0 5 10 15 20 25 30
which implies that γ ≤ 0.175 · K/5 ≈ 0.1. Using the rule of thumb from
Glad&Ljung implies τI = 10/ωc = 37. The entire feedback
. . . . . . . . controller
Go back hence becomes
(4.4s + 1) (37s + 1)
F (s) = Flead (s)Flag (s) = 2.39
(0.7 · 4.4s + 1) (37s + 0.1)
5.8 a) The phase curve crosses −120◦ at ω = 0.27 rad/s and there the gain
is | G0 (iω) |≈ 0.35. The maximum gain . . . . . crossover . . . . . . . . . is hence
. . . . . . . . . . .frequency Go back
ωc = 0.27 rad/s and it is achieved for K = 1/0.35 = 2.86.
b) The reference signal r(t) = 0.5t implies that R(s) = 0.5/s2 . The
5.9 In B and C the gain of GO (iω) tends to infinity when ω tends to zero,
steady
. . . . . . . state . . . . . can be computed using the final
. . . . . .error . . . . . value . . . . . . . . which
. . . . . . .theorem, which means that they can be combined with I and II since these curves
implies
have steady state gain one, i.e. GC (0) = 1. The curve in B has higher
1 0.5 5 gain
. . . . . .crossover . . . . . . . . . . and lower phase
. . . . . . . . . .frequency . . . . . . . which implies that it corre-
. . . . . . .margin,
lim e(t) = lim sE(s) = lim s K · 0.1
= ≈ 1.75
t→∞ s→0 s→0 1+ s(s+1)2
s2 K sponds to I, which has the highest resonance peak. This gives the combinations
B - I and C - II respectively. Using the same arguments it can be seen that
c) In order to reduce the steady
. . . . . . .state . . . . . it will be necessary to introduce
. . . . . .error A has higher .gain . . . . .crossover . . . . . . . . . . and lower phase
. . . . . . . . . . frequency . . . . . . . which means
. . . . . . .margin,
a lag compensation, but in order to maintain phase . . . . . . . 60 after the
. . . . . . .margin

that it correponds to III. Hence D corresponds to IV.
lag compensation has been included it will be necessary to introduce a Go back
lead compensation. Introduce the lead compensation
τD s + 1
Flead (s) = K .
βτD s + 1 5.10 a) The phase for low frequencies tends to −90◦ which implies that the system
contains an integrator, i.e. a factor s in the denominator, which means
In order to guarantee .phase . . . . . . . 60 the phase needs to be increased
. . . . . . margin

that p = 1. For high frequencies the phase tends to −270◦ which means
by ≈ 6◦ ⇒ β = 0.7. With ωc,d = 0.27 rad/s from problem a) this implies that the difference between the order of the denominator and the order
1√
that τD = = 4.44. The gain K is given by the relationship of the numerator is three, i.e. p + n − m = 3.
ωc,d β

38
b) Use a lead-lag compensator, i.e. 5.11 B and C have a smaller stationary error than A and D ⇒ Higher K ⇒ B and
C ↔ i,ii, A and D ↔ iii,iv. Small β ⇒ Large increase in phase . . . . . . . ⇒ Less
. . . . . . .margin
τD s + 1 τI s + 1
F =K . oscillatory ⇒ A and C ↔ i,iii, B and D ↔ ii,iv.
τD βs + 1 τI s + γ
Answer: A – iii, B – ii, C – i and D – iv.
At the desired gain
. . . . .crossover . . . . . . . . . ωc,d = 3 we have arg G(i3) ≈
. . . . . . . . . . .frequency
−178◦ and |G(i3)| = 0.1. In order to obtain phase . . . . . . . . 45 , also
. . . . . . margin

including a lag compensator, the phase has to be increased by 45−2+6 =


49◦ . This is obtained by choosing
1
β = 0.13, τD = √ = 0.92.
ωc,d β
Take also K = 3.6 such that
K
|Flead (iωc,d | · |G(iωc,d )| = √ · 0.1 = 1.
β
For low frequencies the transfer . . . . . . . . . can be approximated by
. . . . . . . . .function
A
G(s) ≈
s
where the Bode diagram, by looking at ω = 0.01, gives that A = 1.
The steady
. . . . . . . state . . . . . when r(t) is a .unit
. . . . . .error . . . . becomes
. . . . .step
1 1 1
lim e(t) = lim sE(s) = lim s = lim 1
= 0.
t→∞ s→0 s→0 1 + F G(s) s s→0 1 + Kγ s

and the steady


. . . . . . . state . . . . . when r(t) is a unit ramp becomes
. . . . . .error
1 1 1 γ
lim e(t) = lim sE(s) = lim s = lim K 1
= ,
t→∞ s→0 s→0 1 + F G s2 s→0
γ ss
K

By choosing
γ = 0.01K = 0.036,
and
10
τI = = 3.3.
ωc,d
according to the rule of thumb we get

(0.92s + 1) (3.3s + 1)
F (s) = 3.6 .
(0.92 · 0.13s + 1) (3.3s + 0.036)

39
6 Sensitivity and Robustness
6.1 The sensitivity . . . . . . . . is the transfer
. . . . . . . . . . . .function . . . . . . . . from v to y. The block dia-
. . . . . . . . .function slope
√ −20 dB20 /decade, which implies that ωB cannot be arbitrarily
. . . . . . . . . . close to
gram gives 2.
1 s2 + s For example, if Gc is a first order system, then the breakpoint of the asymptote
Y (s) = V (s) = V (s)
1 + s(s+1)
K s2 + s + K must be 1 rad/s if it shall coincide with 1/ω. The first order system with that
1
| {z }
S(s) asymptote is 1+s/1 , which has a bandwidth of 1 rad/s. If Gc would be a higher
√ order system, the bandwidth could be made slightly higher, but the limited
ω ω2 + 1
|S(iω)| = p information about Gc excludes this possibility.
(K − ω 2 )2 + ω 2
Answer: The maximum bandwidth is ωB = 1.
For ω = 1 we get √
2 Go back
|S(1i)| = p
(K − 1)2 + 1
The amplitude of y(t) is less than the amplitude of v(t) if |S(1i)| < 1, that is, Im

2
< 1 ⇔ 2 < (K − 1)2 + 1
K>0
⇔ K>2
(K − 1)2 + 1
p

Go back
−1

6.2 Determine the upper limit of the relative model error Re

G0 (s) − G(s)
∆(s) = =s ⇒ |∆(iω)| = ω
G(s)
The stability is then guaranteed if
Go
F (iω)G(iω) 1
|Gc (iω)| = < ∀ω
1 + F (iω)G(iω) ω Figure 6.3a
No steady
. . . . . . . state . . . . . for steps implies Gc (0) = 1 and the bandwidth ωB is
. . . . . . error
thus defined by the smallest value that satisfies 6.3 The disturbance
. . . . . . . . . . . . is amplified when the magnitude of the sensitivity
. . . . . . . . . . . .function
........
exceeds one, that is, when
1
|Gc (iω)| < √ , ω > ωB 1
2 >1
1 + Go (iω)
√ √
The curve
√ 1/ω crosses 1/ 2 at ω = 2. Thus, the bandwidth must be less that is
than 2. However, the curve |Gc (iω)| asymptotically approaches a line with |1 + Go (iω)| < 1

40
which corresponds to the part of Go (iω) that is within a circle with center at 5
−1 and radius 1, see Figure 6.3a. 4.5
4

1/ 2 − 2 cos ωT
Go back 3.5
3
2.5
6.4 Let 2
0.9


g(ω) = √ 1.5
1 + ω2 1
denote the upper bound on the norm of the relative model error. Robustness 0.5
condition: 0
F (iω)G(iω) 1 0 5 10 15 20 25 30
|T (iω)| = < ∀ω
1 + F (iω)G(iω) g(ω) ωT
Now, Figure 6.5a
s + 10 1 1
F (s)G(s) = = ⇒
s s + 10 s
F (iω)G(iω) 1 1 b) The robustness criterion results in
= =√
1 + F (iω)G(iω) iω + 1 ω2 + 1
F (iω)G(iω) 1
so the robustness condition becomes ∀ω : <
√ 1 + F (iω)G(iω) |∆(iω)|
1 ω2 + 1
∀ω : √ < ⇔ Figure 6.5a therefore provides the answer.
ω2 + 1 0.9
Answer:
∀ω : 0.9 < ω 2 + 1 F (iω)G(iω) 1
<
which is satisfied. Answer: Yes. 1 + F (iω)G(iω) 2
Go back Go back

6.5 a) Using notation similar to that in Glad&Ljung, we have 6.6 a) The characteristic equation can be determined for a generic nominal
∆(s) = e −sT
−1 loop . . . . . Note that you are not required to derive the generic formula
. . . . . gain.
— just make sure that you are able to determine the correct polynomials
that is, ∆(iω) = cos ωT − 1 − i sin ωT . This implies P (s) and Q(s) below. Let

|∆(iω)| = 2 − 2 cos ωT b(s)
Go (s) =
and in particular a(s)
denote the nominal loop . . . . . The true closed loop system becomes
. . . . . gain.
(
0, when cos ωT = 1
|∆(iω)| =
2, when cos ωT = −1 b(s) α
a(s) s+α b(s)α b(s)α
Gc (s) = = =
In Figure 6.5a, |∆(iω)|
−1
is plotted as a function of ωT . 1 b(s) α
+ a(s) a(s)(s + α) + b(s)α a(s)s + (a(s) + b(s))α
s+α

41
and has the same root . . . . . with respect to α as the open loop system
. . . . .locus
Im

ω = 3, α = 3
a(s) + b(s) Go + 1
=
a(s)s s
1
has with respect to a proportional feedback.
. . . . . . . . This can be used to draw the Asymptote
root locus
.......... using Matlab. However, to draw the .root . . . . . by hand, we
. . . . locus (2)
use that here Go (s) = KG(s), so
-2 -1 1 Re
b(s) = 4 a(s) = s(s + 1)

which lets us identify the polynomials P and Q in the characteristic equa- -1


tion P (s) + αQ(s) = 0 as

P (s) = a(s)s = s2 (s + 1) Q(s) = a(s) + b(s) = s2 + s + 4 ω = − 3, α = 3

 Starting points ⇒ zeros of P (s): 0 (double),



and −1 Figure 6.6a
1 15
End points ⇒ zeros of Q(s): − 2 ± i 2
 Number of asymptotes: 3 − 2 = 1. b) Begin by identifying the relative model error:
Direction of asymptote: 11 · π, that is, the negative real axis.  
α α
 Part of the real axis that belongs to the root . . . . . (−∞, −1].
. . . . .locus: G0 (s) = G(s) = G(s) 1 + −1
(s + α) (s + α)
 Intersection with the imaginary axis: Set s = iω and solve the char-
| {z }
∆(s)
acteristic equation:
Thus √
−ω 2 (iω + 1) + α(−ω 2 + iω + 4) = 0 1 s+α ω 2 + α2
= = =: f (ω)
|∆(iω)| −s ω
Isolate real and imaginary parts:
The robustness criterion ∀ω : |Gc (iω)| < f (ω) is fulfilled if the low fre-
quency asymptote of f (ω) exceeds the resonance peak at ω = 2, where
( 2
−ω (1 + α) + 4α = 0
|Gc (i2)| = 2. This gives the condition
−ω 3 + αω = 0

4 + α2 α>0 √
with solutions >2 ⇔ α > 12
2

( α = 0, ω = 0 ) or ( α = 3, ω = ± 3 ) √
Answer: α > 12
The root . . . . . is shown in Figure 6.6a, from which the conclusion imme-
. . . . .locus c) The robustness criterion gives a sufficient but not necessary condition,
diately follows. that is, the system can be√stable even if the criterion is not satisfied.
Answer: Asymptotically stable for α > 3. In this case for 3 < α < 12. With a .root . . . . we obtain an exact
. . . . .locus

42
characterization of the stabilizing parameter values, that is, a necessary and thus for n(t) = sin t,
and sufficient condition.
Go back
Y (s) = −T (s)N (s) = −(1 − S(s))N (s) = S(s)N (s) − N (s) ⇒
1 π
y(t) = √ sin(t − ) − sin(t)
2 4
6.7 Since the equation for Gc has the same “F ” in the numerator and the denom-
inator, it follows that the complementary
. . . . . . . . . . . . . . . . sensitivity . . . . . . . . T and Gc are
. . . . . . . . . . . .function
the same. It can be shown that both F (iω)G(iω) and F (iω)G0 (iω) tend to 0
as ω → ∞. The robustness criterion guarantees stability if |T (iω)| < 1/(γω)
since Go back
1 1
|∆(iω)| < γω ⇒ <
γω |∆(iω)|
The transfer . . . . . . . . . T has a resonance peak at ω = 1 (seen in Figure 6.7a,
. . . . . . . . .function B
since T = Gc ) with |T (i1)| = 35, which leads to the condition 6.9 a) Putting
1 1
35 < ⇔ γ<
γ ·1 35 1
G0 (s) = G(s) = G(s)(1 + ∆(s))
(s + 1)
Trivially, γ must also be positive.
1
Answer: 0 ≤ γ < 35
Go back gives

s 1 s+1
∆(s) = − ⇔ =−
6.8 The closed loop system becomes s+1 ∆(s) s

Y (s) = V (s) + Go (s)(R(s) − N (s) − Y (s)) ⇒


Go (s) 1
Y (s) = (R(s) − N (s)) + V (s)
1 + Go (s) 1 + Go b) Enter the system and the >> s = tf( ’s’ );
regulator from Problem 5.7. >> G = 725 / ...
where we can identify ( ( s + 1 ) * ( s + 2.5 ) * ( s + 25 ) )
>> wc = 5;
Go (s) 1
T (s) = S(s) = >> b = 0.21;
1 + Go (s) 1 + Go (s) >> tD = 1 / ( wc * sqrt( b ) );
>> K = sqrt( b ) / 1;
Notice that S(s) + T (s) = 1. In the problem formulation we have Y (s) = >> Flead = ( tD * s + 1 ) / ( b * tD * s + 1 );
S(s)V (s) since the other inputs are zero. Hence, for v(t) = sin t, we have >> g = 0;
>> tI = 10 / wc;
1 π
L−1 {SV } (t) = √ sin(t − ) >> Flag = ( tI * s + 1 ) / ( tI * s + g );
2 4 >> F = K * Flead * Flag;

43
Enter the inverse rela- >> IDG = - ( s + 1 ) / s; In this case |T (iω)| stays below the inverse relative model error, and hence
tive model error and the >> T = feedback( 1 * G, 1 ); we can guarantee that the closed loop system obtained when the lead-lag
complementary
. . . . . . . . . . . . . . . . .sensitivity
. . . . . . . . . . .function
. . . . .>>
. . . .bode( IDG, ’k-’, ... regulator is applied to G0 (s) will be asymptotically stable.
obtained when G(s) is con- T, ’k-.’ );
trolled by F (s) = 1. Plot Go back
the amplitude curve of the Bode Diagram

inverse relative model error 50

in the same diagram as 0

Magnitude (dB)
the amplitude curve of the −50
complementary
. . . . . . . . . . . . . . . . .sensitivity
. . . . . . . . . . .function.
.........
−100

−150
180

90
Phase (deg)
0

−90

−180

−270
−2 −1 0 1 2 3
10 10 10 10 10 10
Frequency (rad/sec)

Since the absolute value of the complementary


. . . . . . . . . . . . . . . . .sensitivity . . . . . . . . . goes
. . . . . . . . . . . function
above the inverse relative model error over a frequency interval, we cannot
guarantee that the closed loop system obtained when G0 (s) is controlled
by F (s) is asymptotically stable.

Enter the >> T = feedback( F * G, 1 );


complementary sensitivity function
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .>>
. . . .bode( IDG, ’k-’, ...
obtained when G(s) is con- T, ’k-.’ );
trolled by the lead-lag
regulator designed in Bode Diagram

Problem 5.7. Plot the 50

amplitude curve of the 0


Magnitude (dB)

inverse relative model error −50


in the same diagram as the
−100
the amplitude curve of the
complementary
. . . . . . . . . . . . . . . . .sensitivity
. . . . . . . . . . .function.
......... −150
180

90
Phase (deg)

−90

−180

−270
−2 −1 0 1 2 3
10 10 10 10 10 10
Frequency (rad/sec)

44
7 Special Controller Structures
v the level becomes independent of v(t), but to get the controller Stu uses,
Ff we remove the derivative term:

+ − Ff (s) = 1
0 h
+ Σ Gv + Σ G The level as a function of v(t) then becomes

Figure 7.1a 1 1 1 1
H(s) = ( − 1)V (s) = − V (s)
As 1 + s/2 2A 1 + s/2
7.1 Consider the block diagram in Figure 7.1a. The change in tank volume per
With V (s) = 0.1/s this yields
time unit is given by
d
A h(t) = x(t) − v(t) 0.1 1 0.1 1 1
 
dt H(s) = − =− −
2A s(1 + s/2) 2A s 2+s
or, equivalently,
A · s · H(s) = X(s) − V (s) that is
0.1
which gives h(t) = − (1 − e−2t )
A·2
1
H(s) = (X(s) − V (s)) which gives the steady
As . . . . . . . state . . . . . −0.05/A.
. . . . . .error
Furthermore,
X(s) = Gv (s)U (s) v
Ff
where
1
Gv (s) =
1 + s/2 + −
0 h
+ Σ K + Σ Gv + Σ G
a) We let the input u(t) be a function of v(t) only, that is, −

U (s) = Ff (s)V (s) Figure 7.1b

The level h(t) as a function of v(t) then becomes b) We now choose the input u(t) to be a function of both h(t) and v(t), that
is, we add the term −Kh(t) to the control law from a). (See Figure 7.1b.)
1
H(s) = (Gv (s)Ff (s) − 1)V (s) Thus
As u(t) = −Kh(t) + v(t)
If we choose
1 or, equivalently,
Ff (s) = = 1 + s/2 U (s) = −KH(s) + V (s)
Gv (s)

45
This gives v
Ff
AsH(s) = Gv (s)(−KH(s) + V (s)) − V (s)
(As + KGv (s))H(s) = (Gv (s) − 1)V (s)
Gv
H(s) −s/2 −s
= 2
= 2
V (s) A/2 · s + As + K A(s + 2s + 2K/A) +
y
To select K, we may compare∗ Gu + Σ

s2 + 2s + 2K/A = 0 Figure 7.2a

with the standard equation


7.2 a) A block diagram of the system is given in Figure 7.2a. The output is
s2 + 2ζω0 s + ω02 = 0 given by
Y = (Gv + Gu Ff )V
which gives where
ω02 = 2 · K/A ζω0 = 1 2 3
Gu (s) = Gv (s) =
s+3 s+4
To obtain approximately 5% overshoot
. . . . . . . . . . we choose ζ = 0.707, and from Chose Ff such that (Gv + Gu Ff )V = 0:
A/(2K) = ζ = 0.707
p
Gv 3(s + 3)
Ff = − =−
Gu 2(s + 4)
we get K = A. Hence,
−s Compute the controller. >> s = tf( ’s’ );
H(s) = V (s) >> Gu = 2 / ( s + 3 );
A(s2 + 2s + 2) >> Gv = 3 / ( s + 4 );
>> F = - Gv / Gu;
If v(t) is a step of amplitude 0.1, the final level becomes
b) If v(t) = 2 sin ωt then
−s 0.1
lim h(t) = lim sH(s) = s =0 u(t) = 2 |Ff (iω)| sin(ωt + arg Ff (iω))
t→∞ s→0 A(s2 + 2s + 2) s

that is, there will be no steady The amplitude is then


. . . . . . . .state . . . . . . in the level for a step
. . . . . error
disturbance.
............ 3 ω2 + 9
r
A(ω) = 2 |Ff (iω)| = 2 · ≤3
2 ω 2 + 16
Go back A(ω) → 3, ω → ∞

c) A block diagram of the system with both feedforward and feedback


. . . . . . . . . is
∗ Notethat any K > 0 results in a stable closed loop system, and that the .steady
. . . . . . .state
. . . . . .error
..... shown in Figure 7.2b. The output is now given by
computations below are independent of the particular value of K. Hence, selecting K is not
necessary for the solution of this problem. Y = Gv V + G
e u U = (Gv + G
e u Ff )V − G
e u KY

46
v B 7.3 a) The output is given by
Ff
Y = (Gv + Gu Ff )V
Gv
where
+ 3 4
y Gu (s) = Gv (s) =
K Σ G
eu
+ Σ s+1 (s + 2)(s + 5)

Chose Ff such that (Gv + Gu Ff )V = 0:


−1
Gv (s) 4(s + 1)
Figure 7.2b Ff (s) = − =−
Gu (s) 3(s + 2)(s + 5)

where
b Create the system and the >> s = tf( ’s’ );
e u (s) =
G
s+3 feedforward controller. >> Gv = 4 / ( s + 2 ) / ( s + 5 );
>> Gu = 3 / ( s + 1 );
The transfer . . . . . . . . . from V to Y is given by
. . . . . . . . .function >> F = - Gv / Gu;
3 3b
Gv + G
e u Ff −
Y (s) = V (s) =
s+4 2(s+4)
V (s) b) The constant to replace Ff (s) is given by
1+Geu K 1+ b
K s+3
3(1 − b/2)(s + 3) 4
= V (s) Fef = Ff (0) = −
(s + 4)(s + 3) + Kb(s + 4) 30

This is stable for K ≥ 0 and b ≥ 0. The final The output is then given by
. . . . . .value . . . . . . . . can therefore
. . . . . .theorem
be used (with V (s) = 1s ):
12 4 40(s + 1) − 4(s + 2)(s + 5)
 
Y (s) = − + V (s) = V (s)
3(1 − b/2)(s + 3) 1 9(1 − b/2) 30(s + 1) (s + 2)(s + 5) 10(s + 1)(s + 2)(s + 5)
lim y(t) = lim sY (s) = lim s · =
t→∞ s→0 s→0 (s + 4)(s + 3) + Kb(s + 4) s 12 + 4Kb −4s2 + 12s
= V (s)
10(s + 1)(s + 2)(s + 5)
Go back
Taking the Laplace transform of v(t) = −1 − 0.1t we get V (s) = − 1s − 0.1
s2 .
The final value theorem
.................... then gives (verify that the system is stable)

−4s2 + 12s 1 0.1


 
lim y(t) = lim s − − 2
t→∞ s→0 10(s + 1)(s + 2)(s + 5) s s
12
= · (−0.1) = −0.012
100

47
Create the system with the >> F = -4/30; Create the new closed loop >> K = 1;
controller and create the >> G = F * Gu + Gv; system with different values >> Gc = minreal( G / ( 1 + K * Gu ) );
disturbance
. . . . . . . . . . . . signal. >> t = ( 0 : 0.001 : 20 ).’; on K. >> lsim( Gc, v, t )
>> v = -1 - 0.1*t;
Linear Simulation Results
>> lsim( G, v, t ) 0.02

Linear Simulation Results


0.03 0.01

0.02

0
0.01

Amplitude
0
−0.01

−0.01
Amplitude
−0.02 −0.02

−0.03

−0.03
−0.04

−0.05
−0.04
0 2 4 6 8 10 12 14 16 18 20
−0.06 Time (sec)

−0.07
0 2 4 6 8 10 12 14 16 18 20
Time (sec)

d) When only a P controller is used we have the following relationship be-


tween the disturbance
. . . . . . . . . . . . and the output
c) With the P controller the output is given by
3 4
Y (s) = − KY (s) + V (s)
(s + 1) (s + 2)(s + 5)
3 12 4
 
Y (s) = − KY (s) + − + V (s)
(s + 1) 30(s + 1) (s + 2)(s + 5) which means that

which means that 4(s + 1)


Y (s) = V (s)
(s + 2)(s + 5)(s + 3K + 1)
40(s+1)−4(s+2)(s+5)
10(s+1)(s+2)(s+5) −0.4s2 + 1.2s 1 0.1
Y (s) = 3K
V (s) = V (s) Again using the same disturbance,
. . . . . . . . . . . V (s) = − s − s2 , a careful inspection of
1 + s+1 (s + 3K + 1)(s + 2)(s + 5)
Y (s) gives that there is no final value of y, hence the .final . . . . .value
. . . . . .theorem
........
does not apply.∗ However, the possibility to simulate the system remains.
1 0.1
Using the same disturbance,
. . . . . . . . . . . V (s) = − s − s2 , the .final
. . . . .value
. . . . . .theorem
........ ∗ If it is assumed that the final value exists, a contradiction follows since then the
gives (verify that the system is stable)
final
. . . . . .value
. . . . . .theorem
. . . . . . . . would apply, but give

−0.4s2 + 1.2s 1 0.1 4(s + 1) 1 0.1


   
lim y(t) = lim s − − 2 lim y(t) = lim s − − 2
s→0 (s + 2)(s + 5)(s + 3K + 1) s s
s→0 (s + 3K + 1)(s + 2)(s + 5)
t→∞
t→∞ s s
4(s + 1) s + 0.1
1.2 0.012 = − lim = −∞
= · (−0.1) = − s→0 (s + 2)(s + 5)(s + 3K + 1) s
(3K + 1) · 10 3K + 1

48
Simulate the output. >> Gc = minreal( Gv / ( 1 + K * Gu ) );
>> lsim( Gc, v, t )

Linear Simulation Results


0

−0.05

−0.1

−0.15

Amplitude
−0.2

−0.25

−0.3

−0.35
0 2 4 6 8 10 12 14 16 18 20
Time (sec)

Go back

49
8 State Space Description
8.1 According to Solution 2.1 the differential equation for the motor is and output
1 y=θ
θ̈ + θ̇ = Ku
τ
gives the (nonlinear) state space description
where
f Ra + ka kv 1 ka
= =K ẋ1 = x2 =: f1 (x, u)
JRa τ JRa
g z̈
Introduce the state variables x1 and x2 according to ẋ2 = θ̈ = − sin θ − cos θ = −ω02 sin x1 − u cos x1 =: f2 (x, u)
` `
x1 = θ x2 = θ̇
where ω02 = g/`. We get that
This gives the state space equations
∂f1
= 0 1

ẋ1 = θ̇ = x2 ∂x
1 1 ∂f1
ẋ2 = θ̈ = − θ̇ + Ku = − x2 + Ku =0
τ τ ∂u
∂f2
= −ω02 cos x1 + u sin x1 0

In matrix form we get ∂x
∂f2
0 1 0 = − cos x1
   
ẋ = x+ u ∂u
0 −1/τ K
y= 1 0 x Introduce x1∆ = x1 − π, x2∆ = x2 , u∆ = u, and y∆ = y − π. Linearization

around x1 = π, x2 = 0 and u = 0 gives
where xT = x1 x2 .


Go back ẋ1∆ = x2∆


ẋ2∆ = ω02 x1∆ + u∆
y∆ = x1∆
8.2 We start with the differential equations

`θ̈ + g sin θ + z̈ cos θ = 0 Go back

The state variables


x1 = θ x2 = θ̇
8.3 Introduce the state variables
input

u= x1 = y x2 = θ x3 = z
`

50
According to the figure, the variables are related as In matrix form we get
1 0 1 0 0
   
X1 (s) = Y (s) = (Ml (s) + K2 X2 (s))
s ẋ(t) =  0 0 1  x(t) + 0 u(t)
1 −6 −11 −6 6
X2 (s) = θ(s) = (X3 (s) − X1 (s))
s
y(t) = 1 0 0 x(t)

1
X3 (s) = Z(s) = (K1 I(s) − K2 X2 (s))
s
b)
Inverse Laplace transformation gives, in the time domain,
d3 d2 d d2 d
ẋ1 (t) = K2 x2 (t) + Ml (t) 3
y(t) + 2 y(t) + 5 y(t) + 3y(t) = 4 2 u(t) + u(t) + 2u(t)
dt dt dt dt dt
ẋ2 (t) = −x1 (t) + x3 (t)
If we introduce x1 (t) = y(t) in the equation and collect all terms without
ẋ3 (t) = −K2 x2 (t) + K1 i(t)
differentiation on the right hand side we get
In matrix notation this becomes
d3 d2 d d2 d
x 1 (t) + x 1 (t) + 5 x 1 (t) − 4 u(t) − u(t) = −3x1 (t) + 2u(t)
0 K2 0 0 1 dt 3 dt2 dt dt2 dt
     

ẋ(t) = −1 0 1 x(t) +  0  i(t) + 0 Ml (t)


that is
0 −K2 0 K1 0
 2
d d d d

y(t) = 1 0 0 x(t)

x1 (t) + x1 (t) + 5x1 (t) − 4 u(t) − u(t) = −3x1 (t) + 2u(t)
dt dt2 dt dt
Go back
Now introduce the expression within the parenthesis as a new state vari-
able
d2 d d
8.4 a) x2 (t) = 2 x1 (t) + x1 (t) + 5x1 (t) − 4 u(t) − u(t)
dt dt dt
d3 d2 d
3
y(t) + 6 2
y(t) + 11 y(t) + 6y(t) = 6u(t) that is
dt dt dt
ẋ2 (t) = −3x1 (t) + 2u(t) (8.1)
The state variables
Repeating this procedure yields
x1 (t) = y x2 (t) = ẏ x3 (t) = ÿ
d d
( x1 (t) + x1 (t) − 4u(t)) = x2 (t) − 5x1 (t) + u(t) (8.2)
gives dt dt

ẋ1 (t) = x2 (t) and we can introduce


ẋ2 (t) = x3 (t) d
x3 (t) = x1 (t) + x1 (t) − 4u(t)
d 3 dt
ẋ3 (t) = y(t) = −6ÿ(t) − 11ẏ(t) − 6y(t) + 6u(t)
dt3 that is
= −6x3 (t) − 11x2 (t) − 6x1 (t) + 6u(t) ẋ1 (t) = x3 (t) − x1 (t) + 4u(t) (8.3)

51
Equation (8.1), (8.2), and (8.3) define the state space equations gives the transfer
. . . . . . . . .function
.........

−1 0 1

4
  2 3
G(s) = +
ẋ(t) = −3
 0 0 x(t) + 2 u(t) s+1 s+4
−5 1 0 1 The output can then be written
y(t) = 1 0 0 x(t) 2 3

Y (s) = U (s) + U (s)
s+1 s+4
c) Partial fraction expansion of
| {z } | {z }
X1 (s) X2 (s)

2s + 3 Defining the state variables as above gives


Y (s) = 2 U (s)
s + 5s + 6
sX1 (s) + X1 (s) = 2U (s)
gives sX2 (s) + 4X2 (s) = 3U (s)
1 3
Y (s) = − U (s) + U (s)
s+2 s+3 which in time domain can be written as
Introducing the state variables ẋ1 (t) = −x1 (t) + 2u(t)
1 3 ẋ2 (t) = −4x2 (t) + 3u(t)
X1 (s) = − U (s) X2 (s) = U (s)
s+2 s+3 y(t) = x1 (t) + x2 (t)
gives
Go back
ẋ1 (t) = −2x1 (t) − u(t)
ẋ2 (t) = −3x2 (t) + 3u(t)
8.6 The transfer . . . . . . . . . is given by
. . . . . . . . .function
G(s) = C(sI − A)−1 B
in the time domain. Furthermore, we have −1  
 s+2 1

−1
= −1 2
y(t) = x1 (t) + x2 (t) 0 s+3 1
1  s+3 1 1
  
In matrix form = −1 2
(s + 2)(s + 3) 0 s + 2 1
0
   
−2 −1 s
ẋ(t) = x(t) + u(t) =
0 −3 3 (s + 2)(s + 3)
y(t) = 1 1 x(t)

Go back

Go back
8.7 a)

8.5 The impulse response ẋ1 = −x1 + u ⇒ x1 = 1 − e−t


g(t) = 2e−t + 3e−4t ẋ2 = 2x2 + u ⇒ x2 = 0.5(e2t − 1)

52
b) The system is not asymptotically stable since x2 → ∞ as t → ∞, but and for pendulum 2
input-output stable because the transfer . . . . . . . . has its pole in the com-
. . . . . . . . .function z̈ cos(φ2 ) + φ̈2 = sin(φ2 )
plex left hand plane.
Linearization gives
c) 
1 −1
 z̈ + αφ̈1 = φ1
S= det S = 3
1 2 z̈ + φ¨2 = φ2
The system is .controllable.
........... Consider z̈ as an input to the system (the acceleration of the trolley
...... ∼

1 0
 the force applied to the system). Introduce the state variables
O= det O = 0
−1 0
x 1 = φ1 x2 = φ̇1 x 3 = φ2 x4 = φ̇2
The system is not observable. Ox = 0 has solutions
This gives the state space equations
0
 
x= ẋ1 = x2
a
1 u
ẋ2 = x1 −
This implies that the second component of the state vector cannot be seen α α
in the output. ẋ3 = x4
d) Because the second component of the state vector has unconstrained ẋ4 = x3 − u
..............
growth and this is not reflected in the output, the system will finally
In matrix form
collapse.
0 1 0 0 0
    
Go back x1
1/α 0 0 0
ẋ =   x2  + −1/α u
   
 0 0 0 1 x3   0 
0 0 1 0 x4 −1
8.8

G(s) = C(sI − A)−1 B b) The controllability matrix becomes


−1  
 s−1 1 1 s+1

0 0 −1/α2
 
= 1 1 = −1/α
−2 s − 1 0 (s − 1)2 + 2 −1/α 0 −1/α2 0  1 1
S=  0 det S = (1 − )2
0

√ −1 −1  α2 α
This gives poles in 1 ± i 2 and zeros in −1. −1 0 −1 0
Go back
Thus, the system is .controllable
. . . . . . . . . . . except for the case α = 1, that is, when
the two pendulums have the same lengths. If the pendulums have different
lengths they react differently to the input, but if they have the same length
8.9 a) For pendulum 1 we have
there is no possibility to act upon them separately using the input.
z̈ cos(φ1 ) + αφ̈1 = sin(φ1 ) Go back

53
8.10 The figure gives b) Use
A = fx (x0 , u0 ) B = fu (x0 , u0 )
1
X1 (s) = U (s) ⇒ sX1 (s) = −X1 (s) + U (s) C = hx (x0 , u0 ) D = hu (x0 , u0 )
(s + 1)
where
and !
∂x1 (x0 , u0 ) ∂x2 (x0 , u0 )
∂f1 ∂f1
∂u (x0 , u0 )
 ∂f1 
1 A= B=
X2 (s) = (U (s) + X1 (s)) ⇒ sX2 (s) = −3X2 (s) + U (s) + X1 (s)
∂x1 (x0 , u0 ) ∂x2 (x0 , u0 ) ∂u (x0 , u0 )
∂f2 ∂f2 ∂f2
(s + 3)

Inverse Laplace transformation gives


Differentiation gives the A matrix elements
ẋ1 = −x1 + u ∂f1 ∂f1
ẋ2 = −3x2 + x1 + u f1 (x, u) = x2 ⇒ (x0 , u0 ) = 0, and (x0 , u0 ) = 1
∂x1 ∂x2
ku(t) ∂f2 2ku
In matrix form this becomes f2 (x, u) = − 2 +g ⇒ = ⇒
mx1 (t) ∂x1 mx31
−1 0 1
   
ẋ = x+ u ∂f2 2kgmx210 2g ∂f2
1 −3 1 (x0 , u0 ) = 3 = , and =0
∂x1 kmx10 x10 ∂x2
y= 1 1 x

and the B matrix
Go back ∂f1
=0
∂u
∂f2 k ∂f2 k
=− ⇒ (x0 , u0 ) = − .
8.11 a) A stationary point fulfills f (x0 , u0 ) = 0, y = h(x0 , u0 ). ∂u mx21 ∂u mx210

f1 (x, u) = x2 ⇒ f1 (x0 , u0 ) = x20 = 0


We thus have the matrices A, B and C (already linear)
ku(t) ku0
f2 (x, u) = − + g ⇒ f2 (x0 , u0 ) = − +g =0
mx21 (t) mx210
!
0 1 0
 
A= 2g B=
y = x1 ⇒ y0 = x10 x10 0 − mxk2
10

C= 1 0

For any stationary y = x10 6= 0, we can rewrite the second row as

ku0 mx210 and the linearized state


. . . . . .space . . . . . . is described by
. . . . . .model
f2 (x0 , u0 ) = − 2 + g = 0 ⇐⇒ u0 = g
mx10 k
∆ẋ = A∆x + B∆u
This means that any position (any x10 6= 0) can be a stationary point, ∆y = C∆x.
mx2
with the corresponding input u0 = g k10 . The vertical velocity x20 has
to be zero. Go back

54
8.12 The first part of the block diagram gives b) Using the general form for non-linear systems
kV ẋ(t) = f (x(t), u(t))
Q(s) = U (s)
sτV + 1
Multiplying both sides with the denominator polynomial gives we have
c 2 1
f (x(t), u(t)) = − x (t) + u(t)
(sτV + 1)Q(s) = kV U (s) m m
This implies that
which gives 0 c 0 1
fx = −2 x(t) fu =
τV sQ(s) + Q(s) = kV U (s) m m
Inverse Laplace transform and some rewriting gives Evaluating the partial derivatives in the stationary point and using the
variables ∆x(t) = x(t) − x0 and ∆u(t) = u(t) − u0 gives
1 kV
q̇(t) = − q(t) + u(t) c 1
τV τV ∆ẋ(t) = −2 x0 ∆x(t) + ∆u(t)
m m
and hence
1 kV
ẋ2 (t) = − x2 (t) + u(t) c) The pole of the linearized system is −2 m c
x0 and it describes how the ve-
τV τV
locity of the object behaves around its steady state value. The expression
In a similar way the second part of the diagram gives says that the higher the steady state velocity is the faster will the velocity
kD return to its steady state value if it is perturbed by for example some
Y (s) = (Q(s) + V (s)) disturbance. This is due to the fact that the air drag is proportional to
sτD + 1
the square of the velocity.
which leads to the state equation
Go back
1 kD kD
ẋ1 (t) = − x1 (t) + x2 (t) + v(t)
τD τD τD

Go back

8.13 a) Steady state is when the object moves with constant velocity, i.e. when
ẋ(t) = 0. This gives that the steady state velocity is given by

0 = −cx20 + u0

which gives r
u0
x0 =
c
The system is non-linear since, for example, doubling the force does not
lead to that the velocity is doubled. Instead, in order to double the
velocity the force has to be made four times larger.

55
9 State Feedback
9.1 a) The control law b) We have Gc (s) = C(sI − (A − BL))−1 Bl0 which evaluates to s2 +8s+15 l0
for
u = −Lx + r the first case. For this system to have static . . . . 1 (which is required for
. . . . . . .gain
the output to converge to the constant reference) we must have l0 = 15.
gives the closed loop system
Go back
ẋ = (A − BL)x + Br

and the poles of the closed loop system are given by the eigenvalues of
9.2 The feedback
. . . . . . . . u = −Lx + l0 r gives the closed loop system
A − BL.

−2 −1
  
1

−2 − l1 −1 − l2
 ẋ = (A − BL)x + Bl0 r
A − BL = l1 l2 =


1 0 0 1 0 with characteristic equation
The characteristic equation is given by s2 + (1 + l1 + l2 )s + l1 = 0
det(sI − A + BL) = s2 + (2 + l1 )s + 1 + l2 = 0 Poles in { −2, −3 } implies that we will have the equation
Poles in { −3, −5 } implies that we will have the equation (s + 3)(s + 2) = s2 + 5s + 6 = 0
(s + 3)(s + 5) = s2 + 8s + 15 = 0 Identification of the coefficients gives
Identification of the coefficients gives l1 = 6 l2 = −2
l1 = 6 l2 = 14 and the control law becomes
This gives the control law u = −6x1 + 2x2 + l0 r
u = −6x1 − 14x2 + r Introduce the observer
Similarly, poles in { −10, −15 } gives ˙
x̂(t) = Ax̂ + Bu(t) + K(y(t) − C x̂(t))
l1 = 23 l2 = 149 It is desirable that the estimation error converges to zero faster than the dy-
namics of the system. Thus, we should place the eigenvalues of the observer
corresponding to the control law to the left of the poles of the closed loop system, for example, in −4. The
characteristic equation of the observer is
u = −23x1 − 149x2 + r
s2 + (1 + k1 − k2 )s + k1 = 0
One observes that the coefficients in the control law increase when the
poles are placed further into the left half plane. In a physical system, and poles in −4 corresponds to the equation
this means that larger forces/voltages/flow/...
....... are required to realize the
control law. s2 + 8s + 16 = 0

56
Identification of coefficients gives The characteristic equation
k1 = 16 k2 = 9 det(sI − A + BL) = s3 + K1 l3 s2 + K1 l2 s + K2 K1 l1 = 0
The complete system, that is, the closed loop system with reconstructed states,
All three poles in −0.5 implies that we will have the equation
will have poles in { −2, −3 }, and the observer will have poles in { −4, −4 }.
Go back (s + 0.5)3 = s3 + 1.5s2 + 0.75s + 0.125 = 0

Identification of the coefficients gives


9.3 a) Introduce the state variables
1 3 3
l1 = l2 = l3 =
x1 = ż x2 = θ x3 = θ̇ 8K1 K2 4K1 2K1

The figure gives the state equations


c) If only x1 is measurable we have
1
X1 (s) = K2 X2 (s) y= 1 0 0 x

s
1
X2 (s) = X3 (s) Employ the observer
s
1
X3 (s) = K1 U (s) ˙
x̂(t) = Ax̂(t) + Bu(t) + K(y(t) − C x̂(t))
s
Inverse Laplace transformation gives where  
k1
ẋ1 (t) = K2 x2 (t) ẋ2 (t) = x3 (t) ẋ3 (t) = K1 u(t) K = k2 
In matrix form we get k3
The characteristic equation is
0 0 0
   
K2
ẋ(t) = 0 0 1 x(t) +  0  u(t)
det(sI − A + KC) = s3 + k1 s2 + k2 K2 s + k3 K2 = 0
0 0 0 K1
To get a similar behavior as in a), the poles of the observer are placed to
b) Since it is assumed that all states are measurable we apply a state feedback the left of the poles of the closed loop system, for example, in −2. This
u = −Lx + yref pole placement corresponds to the equation

which gives the closed loop system s3 + 6s2 + 12s + 8 = 0

ẋ = (A − BL)x + Byref Identification of the coefficients gives


where k1 = 6 k2 = 12/K2 k3 = 8/K2
0 0
 
K2
A − BL =  0 0 1 
−K1 l1 −K1 l2 −K1 l3 Go back

57
9.4 a) Introduce the state variables so that
2
l0 =
x1 = θ x2 = ω c1 τ 2
The resulting control law becomes
We have ẋ1 = θ̇ = ω = x2 and ẋ2 = ω̇ = − τ1 ω + c1 u + c2 f = − τ1 x2 +
c1 u + c2 f . This gives the state-space model in matrix representation 2 1 2
u=− 2
θ− ω+ θref
c1 τ τ c1 c1 τ 2
0 1 0 0
     
ẋ = x+ u+ f
0 −1/τ c1 c2 c) Introduce the integrated control error as an extra state:

b) The feedback ẋ3 = θref − θ

u = −l1 θ − l2 ω + l0 θref = −Lx + l0 θref The new state equations become


0 1 0 0 0 0
       
gives 
0 1
 ẋ =  0 −1/τ 0 x + c1  u + c2  f + 0 θref
A − BL = −1 0 0 0 0 1
−c1 l1 −(c1 l2 + 1/τ )
The characteristic equation Using the feedback
. . . . . . . . law
1 u = −l1 θ − l2 ω − l3 x3
det(sI − A + BL) = s2 + (l2 c1 + )s + c1 l1 = 0
τ
we get the state derivative term
1
Poles in τ (−1 ± i) corresponds to
0 0 0 0
   
1−i 1+i 2 2 c1  u = −c1 l1 −c1 l2 −c1 l3  x
(s + )(s + ) = s2 + s + 2 = 0
τ τ τ τ 0 0 0 0
Identification of the coefficients gives and hence the closed loop system
2 1 0 1 0 0 0
     
l1 = l2 =
c1 τ 2 τ c1 ẋ = −c1 l1 −1/τ − c1 l2 −c1 l3  x + c2  f + 0 θref
−1 0 0 0 1
This gives the closed loop system
The poles of the closed loop system are the eigenvalues of the “A” matrix,
0 1 0 0
     
ẋ = x + l 0 θ ref + f that is, they are given by the characteristic equation
−2/τ 2 −2/τ c1 c2
1 0
 
−λ
To derive l0 we could derive the transfer function from θref to θ and
det −c1 l1 −1/τ − c1 l2 − λ −c1 l3  = 0
ensure the static . . . . is 1. Alternatively, at steady state, that is, when
. . . . . . .gain −1 0 −λ
ẋ1 = ẋ2 = 0, we should have θ = θref when f = 0. ẋ1 = 0 implies that
x2 = 0, and ẋ2 = 0 then gives Writing out and changing sign yields
−2 1 2
x1 + c1 l0 θref = 0 λ3 + (c1 l2 + )λ + c1 l1 λ − c1 l3 = 0
τ2 τ

58
Poles in { τ1 (−1 ± i), 1
τ (−2) } correspond to the equation and since det S = 1 the system is controllable
. . . . . . . . . . . . and an arbitrary
. . . . . . . . . tempera-
ture profile can be obtained.
4 2 6 4
λ3 +
λ + 2λ + 3 = 0
τ τ τ b) How the state decays depends on the poles of the closed loop system.
where the coefficients may be identified as: Poles in −3 will yield the desired result. The closed loop system,
6 3 4
l1 = l2 = l3 = − ẋ = (A − BL)x + Byref
c1 τ 2 c1 τ c1 τ 3
The resulting control law becomes (note that the .static . . . . is 1 by con-
. . . . . .gain 1 − l2
 
−2 − l1 −l3
struction, so there is no “l0 ” in this controller) A − BL =  1 −2 1 
0 1 −2
ẋ3 = θref − θ
6 3 4 has the characteristic equation
u=− 2
θ− ω+ x3
c1 τ c1 τ c1 τ 3
s3 + (6 + l1 )s2 + (10 + 4l1 + l2 )s + 4 + 3l1 + 2l2 + l3 = 0
Go back
Poles in −3 implies that this coincide with the equation

9.5 The system has the observability matrix (s + 3)3 = s3 + 9s2 + 27s + 27 = 0
1 0 0 0
 
0 1 Identification of the coefficients gives
1 1
O= 0 0 1 3

l1 = 3 l2 = 5 l3 = 4
0 0 0 4
that is, det O =
6 0. The system is observable and thus the poles of the observer Thus, the control law is given by
may be placed arbitrarily.
...........
u = −3x1 − 5x2 − 4x3 + yref
Go back

c) Check when the


 system is observable. The sensor at x1 corresponds to
9.6 The system is described in matrix form by C = 1 0 0 , and results in

−2 1 0 1
   
0 0 1
 
ẋ(t) =  1 −2 1  x(t) + 0 u(t) O = −2 1 0 det O = 1
0 1 −2 0 5 −4 1
a) Arbitrary values of the states can be reached if the system is controllable.
............ The sensor at x2 corresponds to C = 0 1 0 , and results in

The controllability matrix becomes
1 −2 5 0 1 0
   

S = 0 1 −4 O= 1 −2 1 det O = 0


0 0 1 −4 6 −4

59
The sensor at x3 corresponds to C = 0 0 1 , and results in We hence have the .state

. . . . . space
. . . . . . .model
......
0 0 1
 
−1 0 1
   
O = 0 1 −2 det O = −1 ẋ(t) = x(t) + u(t)
1 0 0
1 −4 5
y(t) = 0 1 x(t)

The system is hence observable when the sensor is placed at x1 or x3 ,
but not with the sensor placed at x2 . That is, the specifications may be From the last equation we have x2 (t) = y(t), that is, x2 is the motor
fulfilled with the sensor placed at x1 or x3 . If the sensor is placed at x1 , angle. From the first equation we have ẋ2 (t) = x1 (t), that is, x1 is the
the characteristic equation of the observer is given by angular velocity.
s3 + (6 + k1 )s2 + (10 + 4k1 + k2 )s + 4 + 3k1 + 2k2 + k3 = 0
Placing the poles in −4 (which is somewhat faster than the nominal closed
loop system) corresponds to the equation
(s + 4)3 = s3 + 12s2 + 48s + 64 = 0
Identification of coefficients gives
k1 = 6 k2 = 14 k3 = 14

Go back
B 9.7 a) Enter the .transfer
. . . . . . . . function
......... >> s = tf( ’s’ );
and generate the >> G = ss( 1 / ( s * ( s + 1 ) ) )
state
. . . . . . . . . . . . model.
space ...... a =
x1 x2
x1 -1 -0
x2 1 0

b =
u1
x1 1
x2 0

c =
x1 x2
y1 0 1

d =
u1
y1 0

Continuous-time model.

60
b) Compute feedback
. . . . . . . . gains. >> L = place( G.a, G.b, [ -2.2 -2.1 ] ); Calculate the step
. . . . . response
......... >> step(G_r_to_y,G_r_to_u);
The gain l0 is computed by >> Gctemp = ss( G.a - G.b * L, G.b, G.c, 0 ); and the corresponding con- >> grid
constructing a system with >> l_0 = 1 / dcgain( Gctemp); trol signal. Plot the result.
l0 = 1 first, and then cor- >> G_r_to_y = ss(G.a - G.b * L, G.b*l_0, G.c, 0); 2

recting l0 by the inverse of


that system’s static
. . . . . . gain.
..... 1.5

0.5

Calculate the step


. . . . . response
......... >> G_r_to_u = ss(G.a - G.b * L, G.b*l_0, -L, l_0);
and the control signal. To >> step(G_r_to_y,G_r_to_u); 0

see the control signal we de- >> grid


fine a second system which −0.5
0 1 2 3 4 5 6 7 8 9 10

outputs −Lx + l0 r instead 5

of Cx + 0r.
The step . . . . . . . . . . have approximately the same rise and settling
4

. . . . .responses . . . . . . . .times.
.....
3 By choosing the closed loop poles complex, and hence allowing a small
. . . . . . . . . . in the step response, we have however reduced the maximum
overshoot
2
value of the input signal significantly.
1

−1
0 1 2 3 4 5 6 7 8 9 10

Compute a new feedback. ........ >> L = place( G.a, G.b, [ -1+i -1-i ] );
This time, we compute the >> l_0 = 1/( G.c*inv(-G.a+G.b*L)*G.b );
gain l0 manually by us- >> G_r_to_y = ss(G.a-G.b*L,G.b*l_0,G.c, 0 );
ing the formula for the >> G_r_to_u = ss(G.a-G.b*L,G.b*l_0,-L, l_0 );
static
. . . . . . .gain
. . . . of the closed
loop system system with
l0 = 1 (put s = 0 in the
generic expression for the
transfer
. . . . . . . . .function).
.........

61
c) Case (i): Compute the >> L = lqr( G.a, G.b, diag([ 0 1 ]), 1); Simulate the system and >> step(G_r_to_y,G_r_to_u);
feedback
........ gain L, l0 , and the >> l_0 = 1 / ... plot the result. The >> grid
closed loop system. ( G.c * inv( -G.a + G.b*L ) * G.b); step
. . . . .response
. . . . . . . . . is now signifi-
3.5
>> G_r_to_y = ss(G.a-G.b*L,G.b*l_0,G.c, 0); cantly faster.
>> G_r_to_u = ss(G.a-G.b*L,G.b*l_0,-L, l_0); 3

2.5

Simulate the system and >> step(G_r_to_y,G_r_to_u); 1.5


plot the result. >> grid
1

1.2

0.5

1
0

0.8
−0.5
0 1 2 3 4 5 6 7 8 9 10

0.6

0.4

0.2

Compute the closed loop >> pole( G_r_to_y )


−0.2
0 1 2 3 4 5 6 7 8 9 10
poles. This time us- ans =
ing a dedicated command -1.3532 + 1.1537i
from the toolbox instead -1.3532 - 1.1537i
of the standard eig com-
mand. The poles are now
further away from the origin
Compute the closed loop >> eig( G_r_to_y.a ) and the relative damping is
poles. This time, via the ans = slightly reduced.
eigenvalues of the “A” ma- -0.8660 + 0.5000i
trix. -0.8660 - 0.5000i

Case (ii): Repeat, this time >> L = lqr( G.a, G.b, diag([ 0 10 ]), 1 ); Case (iii): Repeat, this time >> L = lqr( G.a, G.b, diag([ 0 0.1 ]), 1 );
with larger weight on the >> l_0 = 1 / ... with smaller weight on the >> l_0 = 1 / ...
motor angle. ( G.c * inv( -G.a + G.b*L ) * G.b ); motor angle. ( G.c * inv( -G.a + G.b*L ) * G.b );
>> G_r_to_y = ss(G.a-G.b*L,G.b*l_0,G.c, 0 ); >> G_r_to_y = ss(G.a-G.b*L,G.b*l_0,G.c, 0 );
>> G_r_to_u = ss(G.a-G.b*L,G.b*l_0,-L, l_0 ); >> G_r_to_u = ss(G.a-G.b*L,G.b*l_0,-L, l_0 );

62
1
Simulate the system and >> step(G_r_to_y,G_r_to_u);
plot the result. The >> grid 0.9

step
. . . . .response
. . . . . . . . . is now much 0.8
1
slower.
0.7
0.9

0.6
0.8 0.4

0.3 0.5
0.7

x1
0.2

0.4
0.1
0.6
0
0 1 2 3 4 5 6 7 8 9 10 0.3
0.5
1
0.2
0.8
0.4
0.6
0.1

x2
0.4
0.3
0.2

0
0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
0.2

0.1
Increasing the weight on the angular velocity forces the motor to move
0
0 1 2 3 4 5 6 7 8 9 10 slower, and then also the step . . . . . . . . . becomes slower.
. . . . .response
Go back
Compute the closed loop >> pole( G_r_to_y )
poles. We now get two ans =
real closed loop poles, where -0.9420 9.8 Introduce the state variables
the pole in −0.34 causes the -0.3357
slow .step
. . . . response.
......... x1 (t) = q(t) x2 (t) = m(t)
This gives the state space description
d) If we start from case (ii) and increase the matrix called R in the call 0 1
   
−0.05
to lqr, the closed loop system gradually becomes slower, since we put ẋ(t) = x(t) + u(t)
0.05 −0.02 0
an increasing weight on the control signal magnitude. When we reach
y(t) = 0 1 x(t)

R = 10 we get exactly the same result as for case (i). Since it is the
“ratio” between Q and R that determines the closed loop properties we get a) The system has the controllability matrix
the same feedback
. . . . . . . . . gain if we scale Q and R by the same scalar.
1 −0.05
 
S = B AB = det S = 0.05

0 0.05
e) Compute feedback
. . . . . . . . gains, >> L = lqr( G.a, G.b, diag([ 1 1 ]), 1);
Thus, the system is controllable.
............
adjust static
. . . . . . .gain,
. . . . and com- >> l_0 = 1 / ...
pute closed loop system, ( G.c * inv( -G.a + G.b*L ) * G.b); b) The control law
but this time output all the >> G_r_to_x = ss(G.a-G.b*L,G.b*l_0,eye(2), 0); u(t) = −Lx(t)
states instead of y >> G_r_to_u = ss(G.a-G.b*L,G.b*l_0,-L, l_0);
gives the closed loop system
Simulate the system plot >> step(G_r_to_x);
the states, x1 and x2 >> grid ẋ(t) = (A − BL)x(t)

63
and the poles of the closed loop system is given by the eigenvalues of Go back
A − BL.  
−0.05 − l1 −l2
A − BL =
0.05 −0.02 9.9 a) With the given state variables we get
The characteristic equation is given by
ẋ1 = ẏ(t) = x2 (t)
2
det(sI − A + BL) = s + (0.07 + l1 )s + 0.001 + 0.02l1 + 0.05l2 = 0
and
Both poles in −0.1 implies that we shall have the equation ẋ2 = ÿ(t) = u(t)
Introducing the state vector
(s + 0.1)2 = s2 + 0.2s + 0.01 = 0
x1 (t)
 
Identification of the coefficients gives x(t) =
x2 (t)
l1 = 0.13 l2 = 0.128 the system can be expressed in state space form as
This gives the control law ẋ(t) = Ax(t) + Bu(t) y(t) = Cx(t)
u(t) = −0.13x1 (t) − 0.128x2 (t) where
0 1 0
   
A= B= C= 1 0

c) It is desirable that the estimation error converges to zero faster than the 0 0 1
dynamics of the system. Thus, we should place the eigenvalues of the
observer to the left of the poles of the closed loop system. To avoid large b) Using the proposed feedback the closed loop system becomes
. . . . . . . . . . . . . . of the measurement noise the poles of the observer should
amplification
ẋ(t) = (A − BL)x(t) + Br̃(t) y(t) = Cx(t)
not be placed too far into the left hand plane.
The poles of the closed loop system are given by
d) Only y(t) = x2 (t) is measurable. Employ the observer
˙ det(sI − (A − BL)) = 0
x̂(t) = Ax̂(t) + Bu(t) + K(y(t) − C x̂(t))
which gives
where   s2 + l2 s + l1 = 0
k1
K=
k2 The desired location of the closed loop poles correspond to the character-
The characteristic equation is istic equation
s2 + 2ζω0 s + ω02 = 0
det(sI − A + KC) = s2 + (0.07 + k2 )s + 0.05k1 + 0.05k2 + 0.001 Comparing the two equations gives
Both poles in −0.2 implies that we shall have the equation l1 = ω02 l2 = 2ζω0
2
s + 0.4s + 0.04 = 0 Note the intuitive solution. To achieve a faster closed loop (larger ω0 )
Identification of the coefficients gives with unchanged damping (ζ) we increase both the proportional feedback
from position (y) and derivative feedback velocity ẏ. To only increase
k1 = 0.45 k2 = 0.33 damping (ζ) we only increase the feedback from the velocity.

64
c) The transfer function of the closed loop system from R(s) to Y (s) is given x1 1
by x2 0
GC (s) = C(sI − (A − BL))−1 Bl0
C =
where we have used that r̃(t) = l0 r(t). Inserting the matrices above gives
x1 x2
l0 y1 0 1
GC (s) =
s2 + l2 s + l1
D =
d) The static gain of the closed loop system is GC (0), which gives u1
y1 0
l0
GC (0) =
l1 Continuous-time state-space model.
When l0 is chosen such that GC (0) = 1 this gives l0 = l1 . The controller
can hence be written

u(t) = −l1 x1 (t) − l2 (t) + l1 r(t) = l1 (r(t) − y(t) − l2 x2 (t)

In this problem the input u(t) is a force, and for the mass to remain in
the desired postion (and there are no other forces acting on the mass) the
force has to be zero. In the controller above, with l0 = l1 , the first term is
a proportional feedback based on the error e(t) = r(t) − y(t), which zero
when y(t) = r(t). The second term is based on the velocity, and this is
zero when the mass is at rest.
Go back

B 9.10 a) Using the function ss without semi-colon gives the output below. The
matrices of the state space model can be accessed as G.a, G.b, etc.

>> Gss=ss(G)

Gss =

A =
x1 x2
x1 -1 0
x2 1 0

B =
u1

65
b) The first set of commands gives Figure 9.10a. The square wave can be 0.8

seen as a sequence of positive and negative steps.


0.6

0.4

1
0.2

0.5 0

-0.2

0
-0.4

-0.6
-0.5 0 2 4 6 8 10

-1

0 2 4 6 8 10
Figure 9.10b. States. Dashed: x2 (t). Solid: x1 (t).

Figure 9.10a. Square wave input.


c) Adding the disturbance to the output gives the result in Figure 9.10c.

0.7

The second sequence of commands gives Figure 9.10b. Since the input is 0.6
a sequence of steps and the relationship between input and velocity is a
first order systems, the plot of the state x1 (t) becomes a sequence of step 0.5

responses of a first order system. 0.4

0.3

0.2

0.1

0
0 2 4 6 8 10

Figure 9.10c. Measured output ym (t), including the measurement disturbance.

d) The command sequence gives the results in Figure 9.10d. Choosing a


smaller time constant in F (s) gives that the measurement disturbance is
amplified more and has bigger influence on the estimated velocity. On the
other hand, a larger value will cause delay (phase shift) in the estimate.
e) The sequence of commands gives the result in Figure 9.10e, which shows
the estimation error, i.e. the difference between the estimated velocity

66
0.8 Go back
0.6

0.4

0.2

-0.2

-0.4

-0.6
0 2 4 6 8 10

Figure 9.10d. Solid: True velocity. Dashed: Estimated velocity.

and the true velocity. As can be seen the error is very small, which means
that the estimate is very close to the true signal. One of the key features
of using an observer is that we use the input signal u(t) and a model of
the system, so that the estimate is generated as a simulation of the model
assisted by measured output. Also, in the example here the observer has
the same initial values as the true system, which cannot be assumed in
practice.

10 -3
1.5

0.5

-0.5

-1

-1.5
0 2 4 6 8 10

Figure 9.10e. Estimation error x1 (t) − x̂1 (t).

67
11 Implementation
11.1 Inverse Laplace transformation of
s+b
U (s) = KN E(s)
s + bN
gives the differential equation
u̇(t) + bN u(t) = KN ė(t) + bKN e(t) (11.1)
At time t − T we have
u̇(t − T ) + bN u(t − T ) = KN ė(t − T ) + bKN e(t − T ) (11.2)
By replacing u̇(t) and ė(t) in (11.1) and (11.2) with ∆t u(t) and ∆t e(t), re-
spectively, and then adding the equations we get

∆t u(t) + ∆t u(t − T ) + bN u(t) + bN u(t − T )


= KN ∆t e(t) + KN ∆t e(t − T ) + bKN e(t) + bKN e(t − T )
Tustins formula
1 1
(∆t u(t) + ∆t u(t − T )) = (u(t) − u(t − T ))
2 T
now gives
2
(u(t) − u(t − T )) + bN (u(t) + u(t − T ))
T
2
= KN (e(t) − e(t − T )) + bKN (e(t) + e(t − T ))
T
Inserting the numerical values, K = 2, T = 0.1, N = 10 and b = 0.1, we get

20(u(t) − u(t − T )) + (u(t) + u(t − T ))


= 400(e(t) − e(t − T )) + 2(e(t) + e(t − T ))
which gives
19 402 398
u(t) = u(t − T ) + e(t) − e(t − T )
21 21 21
that is
u(t) = 0.905u(t − T ) + 19.14e(t) − 18.95e(t − T )
Go back

68
Liten reglerteknisk ordlista
This version: 2021-08-12
1 Engelsk-svensk
actuator ställdon overshoot översläng
amplitude amplitud peak frequency resonansfrekvens
attenuation dämpning peak resonance resonanstopp
bandwidth bandbredd phase crossover frequency fasskärfrekvens
closed loop system slutet system phase lag fasretarderande
control law styrlag phase lead fasavancerande
controllability styrbarhet phase margin fasmarginal
controller regulator ramp function ramp
crossover frequency skärfrekvens rank rang
damping dämpning resonant frequency resonansfrekvens
damping ratio relativ dämpning rise time stigtid
disturbance rejection störningsundertryckning root locus (pl. loci) rotort
eigenvalue egenvärde sensitivity function känslighetsfunktion
feedback återkoppling sensor givare
final value theorem slutvärdesteoremet settling time insvängningstid, lösningstid
feedforward framkoppling sinusoidal sinusformad
flow flöde state tillstånd
gain förstärkning state feedback tillståndsåterkoppling
gain crossover frequency (amplitud)skärfrekvens static gain statisk förstärkning
gain margin amplitudmarginal steady state stationärt tillstånd
impulse response impulssvar step function steg
initial value begynnelsevärde step repsonse stegsvar
loop gain kretsförstärkning, öppna systemet subspace underrum
magnitude amplitud time delay tidsfördröjning
observability observerbarhet transfer function överföringsfunktion
observer observatör unit step enhetsteg
open-loop system öppet system, kretsförstärkning unstable instabil

1
2 Svensk-engelsk
(amplitud)skärfrekvens gain crossover frequency observatör observer
aggregerade modeller lumped models observerbarhet observability
amplitud amplitude ramp ramp function
amplitud magnitude regulator controller
amplitudmarginal gain margin reglering control
bandbredd bandwidth reglerteknik automatic control
begynnelsevärde initial value relativ dämpning damping ratio
dämpning damping, attenuation resonansfrekvens peak frequency
egenvärde eigenvalue resonansfrekvens resonant frequency
enhetsteg unit step resonanstopp peak resonance
faltning convolution rotort root locus (pl. loci)
fasavancerande phase lead sinusformad sinusoidal
fasmarginal phase margin slutet system closed loop system
fasretarderande phase lag skärfrekvens gain crossover frequency
fasskärfrekvens phase crossover frequency stationärt tillstånd steady state
flöde flow statisk förstärkning static gain
framkoppling feedforward steg step function
förstärkning gain stegsvar step repsonse
impulssvar impulse response stigtid rise time
instabil unstable styrbarhet controllability
insvängningstid, lösningstid settling time styrlag control law
kretsförstärkning loop gain, open loop system ställdon actuator
känslighetsfunktion sensitivity function störningsundertryckning disturbance rejection
tidsfördröjning time delay
tillstånd state
tillståndsåterkoppling state feedback
återkoppling feedback
öppet system open-loop system, loop gain
överföringsfunktion transfer function
översläng overshoot

2
Introduktion till
MATLAB & Control System Toolbox
This version: 2021-08-12
1 Inledning Mata in systemet och ge objek-
tet namnet G. Argumenten till
>> G = tf( 4, [ 1 2 4 0 ] )

funktionen tf utgörs av radvek- Transfer function:


Denna skrift är en kort inledning till hur MATLAB och Control System Toolbox torer innehållande täljarens re- 4
(CST) används i kurserna i Reglerteknik. spektive nämnarens koefficien- -----------------
ter. s^3 + 2 s^2 + 4 s
Det absolut viktigaste kommandot i Matlab är help.

>> help help Med det andra alternativet kan man mata in överföringsfunktionen på symbolisk
help Display help text in Command Window. form genom att först skapa ett objekt bestående av symbolen s. Därefter kan
help NAME displays the help for the functionality specified by NAME, man t ex addera och multiplicera med denna symbol på samma sätt som görs med
such as a function, operator symbol, method, class, or toolbox. Laplace-variabeln s vid handräkning.
NAME can include a partial path. OBS, För att få till ˆ måste man i många system skriva shift ˆ mellanslag.

T.ex
Skapa ett objekt bestående av >> s = tf( ’s’ );
symbolen s. Bilda överförings- >> G = 4 / ( s * ( s^2 + 2*s + 4 ) )
>> help tf
funktionen genom att använda
tf Construct transfer function or convert to transfer function. vanliga räkneoperationer. Transfer function:
4
Construction: -----------------
SYS = tf(NUM,DEN) creates a continuous-time transfer function SYS with s^3 + 2 s^2 + 4 s
numerator NUM and denominator DEN....
En finess med överföringsfunktioner representerade som LTI-objekt är att man kan
Alternativt kan man använda doc som öppnar en browser till hjälpsystemet. multiplicera och addera överföringsfunktioner på ett rättframt sätt.

2 System Skapa en ny överföringsfunk-


tion G2 genom att seriekoppla
>> G2 = G * 1 / ( s + 1 )

G(s) och överföringsfunktionen Transfer function:


I Control System Toolbox finns datastrukturer för att hantera s k LTI-objects, dvs 4
1
linjära tidsinvarianta system, på ett bekvämt sätt. Vi kommer inledningsvis främst -------------------------
s+1
att arbeta med system på överföringsfunktionsform, men senare även med system s^4 + 3 s^3 + 6 s^2 + 4 s
på tillståndsform. Ett objekt som representerar ett system på överföringsfunktions-
form skapas med funktionen tf. Detta kan göras på två olika sätt, och det första
alternativet visas i exemplet nedan.

Betrakta överföringsfunktionen
4
G(s) =
s(s2 + 2s + 4)

1
3 Poler, nollställen och statisk Rita in systemets poler och
nollställen i det komplexa
>> pzmap( G )
>> axis([ -2 0 -2 2 ])

förstärkning talplanet. Poler markeras med


kryss och nollställen, i de fall 2
Pole−Zero Map

de förekommer, markeras med


ringar. 1.5

0.5

Imaginary Axis
0

−0.5

−1

−1.5

−2
−2 −1.8 −1.6 −1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 0

Poler och nollställen till överföringsfunktioner beräknas med funktionerna pole Real Axis

respektive tzero. Poler och nollställen kan även ritas med funktionen pzmap.
Statisk förstärkning G(0) beräknas dcgain.

Beräkna polerna till G(s). Sys-


temet har en reell pol i origo
>> pole( G ) 4 Återkoppling
och två komplexa poler. ans =
I kursen behandlas återkopplade reglersystem enligt figur 1.
0
-1.0000 + 1.7321i V
-1.0000 - 1.7321i
+
Beräkna nollställena till G(s). >> tzero( G ) R U Y
Eftersom täljaren i överförings- + Σ F (s) G(s) Σ
funktionen är konstant saknar ans = −
systemet nollställen.
Empty matrix: 0-by-1 Figure 1. Reglersystem

Beräkna statisk förstärkning (här oändlig eftersom vi Med systembeskrivningen


har en pol i origo)
Y (s) = G(s)U (s) + V (s)
>> dcgain( G )
och återkopplingen
ans =
Inf
U (s) = F (s)(R(s) − Y (s))

2
ges det återkopplade systemet av
5 Nyquistdiagram (ingår ej i alla
Y (s) = Gc (s)R(s) + S(s)V (s) kurser)
där
F (s)G(s)
Gc (s) =
1 + F (s)G(s)

och
1 Nyquistkurvor för en eller flera överföringsfunktioner ritas med funktionen
S(s) =
1 + F (s)G(s) nyquist. Eftersom funktionen nyquist graderar axlarna automatiskt kan dia-
grammet ibland bli svårläst. Läsbarheten kan förbättras genom att man själv
Överföringsfunktionerna för det återkopplade systemet kan beräknas med funktio- väljer axlarnas gradering med funktionen axis. Man kan få ut mycket information
nen feedback. ur figuren genom att använda vänster respektive höger musknapp. Med vänster
musknapp kan man t ex markera en punkt på kurvan och få ut motsvarande värde
på ω samt nyquistkurvans värde i denna frekvens. Med höger musknapp får man
Generera överföringsfunk- >> F = tf( 0.7 )
en meny med olika operationer som kan göras med figuren.
tionen för en proportionell
regulator med förstärkning Transfer function:
Kp = 0.7. 0.7
Rita nyquistkurvan för det >> nyquist( F * G )
Beräkna överföringsfunktionen >> Gc = feedback( F * G, 1 ) öppna systemet då systemet >> axis([ -1 1 -1 1 ])
för det återkopplade systemet. G(s) styrs med en proportionell
Transfer function: återkoppling med förstärkning Nyquist Diagram
1
2.8 KP = 0.7. Justera axlarnas
----------------------- gradering och markera punk- 0.8

s^3 + 2 s^2 + 4 s + 2.8 ten där nyquistkurvan passerar 0.6

Beräkna känslighetsfunktio- >> S = 1 / ( 1 + F * G ) negativa delen av reella axeln. 0.4


nen.
System: untitled1
Transfer function: 0.2 Real: −0.349

Imaginary Axis
Imag: −0.000867
s^3 + 2 s^2 + 4 s 0
Frequency (rad/sec): −2

-----------------------
−0.2
s^3 + 2 s^2 + 4 s + 2.8
−0.4

−0.6

I exemplet ovan hade vi kunnat beräkna Gc på motsvarande sätt som S beräknades, −0.8
dvs Gc=F*G/(1+F*G). Med denna metod får dock täljaren och nämnaren i Gc ett
antal gemensamma faktorer som kan förkortas bort. Genom att använda funktio-
−1
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
Real Axis
nen feedback undviks detta. De gemensamma faktorerna i det första alternativet
kan elimineras genom att använda funktionen minreal(Gc) Testa själv och jämför.

3
6 Bodediagram Beräkna frekvensfunktionen för
systemet G och rita upp den i
>> margin( G )

ett bodediagram. Bode Diagram


Gm = 6.02 dB (at 2 rad/sec) , Pm = 50.3 deg (at 1.13 rad/sec)
50

0
Bodediagram för en eller flera överföringsfunktioner ritas med funktionen bode.

Magnitude (dB)
Även i detta fall kan man läsa av punkter i figuren genom att markera med vänster −50

musknapp. Med höger knapp får man en meny där man t ex kan välja att markera
frekvenserna där stabilitetsmarginalerna läses av. −100

−150
−90

−135

Phase (deg)
−180

Beräkna frekvensfunktionen för >> bode( G ) −225


systemet G och rita upp den
Bode Diagram
i ett bodediagram. Notera 50
−270
10
−1
10
0
10
1 2
10
att amplitudkurvan graderas Frequency (rad/sec)

i decibel. Använd höger 0


Magnitude (dB)

musknapp för att lägga in


−50
rutnät i figuren samt mark- För att t ex kunna göra jämförelser mellan två frekvensfunktioner kan dessa ritas
era var fas- och amplitudskär-
−100 i samma diagram.
frekvenserna ligger. Det går
även att byta till andra skalor −150
−90
i menyer som kommer upp i
högerknapp. Om du bara vill −135
Phase (deg)

rita amplitudkurvan kan du an- −180


vända bodemag.
−225

−270
−1 0 1 2
10 10 10 10
Frequency (rad/sec)

För att bestämma skärfrekvenser samt fas- och amplitudmarginal kan man även
använda funktionen margin, vilken förutom att rita upp amplitud- och faskurvorna
även skriver ut dessa värden. Gm och Pm betecknar amplitud- respektive fasmarginal.

4
Beräkna frekvensfunktionerna >> bode( G, G2 ) Beräkna frekvensfunktionen för >> bode( G, { 0.1, 10 } )
för systemen G och G2. systemet G från 0.1 till 10 rad/s
Bode Diagram Bode Diagram
100
och rita upp den i ett bodedia- 40
gram.
50 20

Magnitude (dB)

Magnitude (dB)
0 0

−50 −20

−100 −40

−150
−90 −60
−90

−135
−180
Phase (deg)

Phase (deg)
−180

−270
−225

−360 −270
−2 −1 0 1 2 −1 0 1
10 10 10 10 10 10 10 10
Frequency (rad/sec) Frequency (rad/sec)

Skalan på frekvensaxeln kan väljas genom att som sista argument i funktionsan-
ropet ange största och minsta frekvensvärdet mellan krullparenteser .

7 Simulering
7.1 Stegsvar

Den vanligaste typen av simulering är att beräkna ett systems stegsvar. Detta
kan utföras med funktionen step, med vilken man både simulerar systemet och
ritar dess stegsvar. I likhet med tidigare kan man läsa av enskilda värden i figuren
med vänster musknapp och få en meny med olika val med höger knapp. Genom
att t ex välja Peak Response från Characteristics markeras tidpunkt och värde
för överslängen. Placera markören över punkten i diagrammet visas tillhörande
numeriska värden.

Antag att systemet G styrs med proportionell återkoppling med förstärkning Kp =


0.7.

5
Beräkna och rita upp det >> step( Gc ) Beräkna det återkopplade sys- >> step( Gc, 15 )
återkopplade systemets temets stegsvar under femton
stegsvar. Markera stegsvarets Step Response sekunder och rita upp resul- Step Response
1.4
översläng. tatet. 1.4

1.2
1.2

1
1

0.8

Amplitude

Amplitude
0.8

0.6
0.6

0.4
0.4

0.2
0.2

0
0 1 2 3 4 5 6 7
0
Time (sec) 0 5 10 15
Time (sec.)

I normalfallet väljs simuleringstiden automatiskt, men genom att ange ett extra
argument kan man välja simuleringstiden själv.
7.2 Allmän insignal
För att simulera linjära system med allmänna insignaler kan man använda funk-
tionen lsim(G,u,t). Indata till denna funktion är ett (eller flera) system G, en
insignalvektor u och en tidsvektor t.
Antag exempelvis att vi vill studera reglerfelet för det återkopplade systemet ovan
då referenssignalen är en ramp. Vi vet att sambandet mellan referenssignal och
reglerfel ges av känslighetsfunktionen

E(s) = S(s)R(s)

där
1
S(s) =
1 + F (s)G(s)

Skapa en tidsvektor mellan 0 >> t = ( 0 : 0.1 : 10 ).’;


och 10 med steget 0.1.

6
Simulera det återkopplade sys- >> lsim( S, 0.5*t, t ) Rotort för P (s) + KQ(s) = >> rlocus( Q/P )
temet då referenssignalen är en 0. Markera där en av rötterna
Root Locus
ramp med lutning 0.5. Re- 0.8
Linear Simulation Results
passerar imaginäraxeln. 4
glerfelet går i detta fall mot System: G
Gain: 2.03
0.71. Funktionen ritar även 0.7 3 Pole: 0.00739 + 2.01i
Damping: −0.00368
insignalen, men den kan välja Overshoot (%): 101
Frequency (rad/sec): 2.01
0.6 2
bort på menyn som nås via
höger musknapp. 0.5 1

Imaginary Axis
Amplitude
0.4 0

0.3 −1

0.2 −2

0.1 −3

0 −4
0 1 2 3 4 5 6 7 8 9 10 −5 −4 −3 −2 −1 0 1 2
Time (sec) Real Axis

För att skapa sinus- och fyrkantsignaler kan funktionen gensig användas. För att t ex kontrollera för vilken förstärkning polerna har viss dämpning kan man
med höger musknapp lägga in ett nät vilket markerar polplaceringar med samma
avstånd till origo respektive samma dämpning.

8 Rotort
För att avgöra hur rötterna till ekvationen

P (s) + KQ(s) = 0
9 SISO Design Tool
rör sig i komplexa talplanet då K går från noll och mot oändligheten kan man
rita ekvationens rotort med funktionen rlocus. Indata till funktionen är en över-
Ett ytterligare användbart verktyg är SISO Design Tool, vilket är ett användar-
föringsfunktion med polynomet Q(s) som täljare och polynomet P (s) som nämnare
gränssnitt med vilket man enkelt kan studera ett system ur olika aspekter såsom
(rotortsanalysen motsvarar rötter i ett slutet systemet där G(s) = Q(s)/P (s) styrs
stegsvar, bodediagram, poler och nollställen, etc. Verktyget SISO Design Tool star-
med en P-regulator med förstärkning K). Med höger musknapp kan man markera
tas genom att skriva sisotool. Automatiskt kommer de skapade LTI-objekten att
relevanta punkter i figuren, såsom t ex då rotorten passerar imaginäraxeln.
finnas tillgängliga för analys. I figuren nedan visas ett exempel på vilka figurer
som kan visas samtidigt. Testa dig fram!

7
10 Tillståndsbeskrivning
I Control System Toolbox finns även en datastruktur för att hantera system på
tillståndsform
ẋ(t) = Ax(t) + Bu(t)
y(t) = Cx(t)
För att skapa ett system på denna form används funktionen ss, med vilken man
kan skapa ett system på tillståndsform från början eller konvertera ett system från
Root Locus Editor (C) Open−Loop Bode Editor (C)
4 50

överföringsfunktionsform.
3 0

2 −50 Överför systemet G till till- >> G = ss( G )


ståndsform.
1
−100
a =
G.M.: 6.02 dB x1 x2 x3
Freq: 2 rad/sec
0
Stable loop x1 -2 -2 0
−150
x2 2 0 0
−90
−1
x3 0 1 0

b =
−2
−180 u1
x1 2
−3
x2 0
P.M.: 50.3 deg
Freq: 1.13 rad/sec x3 0
−4 −270
−6 −4 −2 0 2 −1 0 1 2
10 10 10 10
Real Axis Frequency (rad/sec) c =
x1 x2 x3
y1 0 0 1

d =
u1
y1 0

Continuous-time model.

Matriserna A, B, C och D i tillståndsbeskrivningen ingår nu i datastrukturen G.


Figure 1. SISO Design Tool. För att komma åt matriserna kan man referera till dem direkt genom att skriva
G.a, G.b etc.

8
Beräkna egenvärdena till ma- >> eig( G.a ) Generera tillståndsbeskrivnin- >> Gc = ss( G.a - G.b * L, G.b, G.c, 0 );
trisen A i tillståndsmodellen gen för det återkopplade sys- >> eig( Gc.a )
ans = temet. Kontrollera att polerna
placerats på önskat sätt. ans =
0
-1.0000 + 1.7321i -2.0200
-1.0000 - 1.7321i -2.0000
-1.9800
Denna möjlighet är användbar t ex när man skall beräkna polplacerande tillstånds-
återkoppling på formen Det återkopplade systemets stegsvar kan nu beräknas och ritas upp med funktionen
step.
u(t) = −Lx(t) + r(t)

vilket kan göras med funktionen place (och i special-fall med acker). Beräkna och rita upp det >> step( Gc )
återkopplade systemets steg-
svar. Step Response

Bestäm en tillståndsåterkop- >> L = place( G.a, G.b, ... 0.5


pling som placerar det återkop- -2 * ( 1 + [ -0.01 0 0.01 ] ) )
0.45
plade systemets poler i
närheten av −2. Lägger man L = 0.4
alla polerna exakt i −2 kan 0.35
återkopplingen inte beräknas 2.0000 1.9999 1.9998
med hjälp av place, så polerna 0.3

Amplitude
sprids ut en aning. För att 0.25
få alla polerna exakt i −2
0.2
kan acker användas, men
den funktionen har så dåliga 0.15
numeriska egenskaper att den 0.1
alltid bör undvikas till förmån
för place. 0.05

0
0 1 2 3 4 5 6 7
Det återkopplade systemet Time (sec.)

ẋ(t) = (A − BL)x(t) + Br(t)


På detta sätt ser vi endast den utsignal som definieras av vektorn C. Vill vi
studera samtliga tillstånd kan detta göras genom att låta C vara en enhetsmatris
y(t) = Cx(t) med dimension lika med systemets ordningstal.

kan nu skapas t ex med funktionen ss.

9
Skapa det återkopplade sys-
temet på nytt, men med
>> Gc = ss( G.a - G.b * L, G.b, eye(3), 0 );
>> step( Gc )
11 Sammanfattning av komman-
samtliga tre tillstånd som utsig-
naler. 0.03
Step Response don
0.02

To: Out(1)
0.01

−0.01
0.08

0.06

To: Out(2)
Amplitude
0.04

0.02 11.1 Användbara kommandon i Control System


0
1 Toolbox
To: Out(3)

0.5

0
0 1 2 3 4 5 6 7
Time (sec)

tf System på överföringsfunktionsform
För att beräkna linjärkvadratisk tillståndsåterkoppling kan funktionen lqr använ- ss System på tillståndsform
das. pole Poler
step Stegsvar
tzero Nollställen
feedback Återkoppling
nyquist Nyquistdiagram
bode Bodediagram
bodemag Bodediagrammets amplitudkurva
sigma Generalisering av bodemag
margin Bodediagram och stabilitetsmarginaler
rlocus Rotort
lsim Simulering med godtycklig insignal
place Polplacerande tillståndsåterkoppling
lqr Linjärkvadratisk tillståndsåterkoppling
ctrb Styrbarhetsmatris
obsv Observerbarhetsmatris
ltiview Startar LTI Viewer
pzmap Pol-nollställediagram
minreal Förkortning av gemensamma faktorer
sisotool Grafiskt gränssnitt

10
11.2 Användbara MATLAB-kommandon
abs Absolutbelopp
eig Egenvärden
conv Polynommultiplikation
det Determinant
diag Diagonalmatris
imag Imaginärdel
inv Matrisinvers
real Realdel
roots Rötter till polynom
grid Nät i figurer
hold Frysning av figur
loglog Diagram i log-log skala
plot Diagram i linjär skala
cd Byte av bibliotek
dir Listning av bibliotek
clear Radering av variabler och funktioner i arbetsminnet
load Inläsning av variabler från fil
save Lagring av variabler på fil
who Listning av variabler i arbetsminnet
helpdesk Startar HTML-baserad hjälpfunktion

11

You might also like