Sie sind auf Seite 1von 217

EE/ME 574: Intermediate Controls

Review-By-Example of some of the Basic


Concepts and Methods of Control System
Analysis and Design
Contents
1 Differential Eqns, Transfer Functions & Modeling 4
1.1 Example 1, Golden Nugget Airlines . . . . . . . . . . . . . . . . 4
1.2 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Laplace Transforms and Transfer Functions . . . . . . . . . . . . 6
1.3.1 Laplace transform . . . . . . . . . . . . . . . . . . . . . 6
1.3.2 Some basic Laplace transform Pairs . . . . . . . . . . . . 7
1.3.3 Transfer Functions are Rational Polynomials . . . . . . . 10
1.3.4 A transfer function has poles and zeros . . . . . . . . . . 11
1.3.5 Properties of transfer functions . . . . . . . . . . . . . . . 13
1.3.6 Forms for a transfer function . . . . . . . . . . . . . . . . 14
1.3.7 Proper and strictly proper transfer functions: . . . . . . . 15
1.3.8 System type . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.3.9 Phasors and the transfer function as complex gain . . . . . 16
1.3.10 The DC gain of a transfer function . . . . . . . . . . . . . 21
1.3.11 The impulse response of a system . . . . . . . . . . . . . 22
2 Closing the loop, feedback control 23
2.1 Analyzing a closed-loop system . . . . . . . . . . . . . . . . . . 27
2.2 Common controller structures: . . . . . . . . . . . . . . . . . . . 28
2.3 Analyzing other loops . . . . . . . . . . . . . . . . . . . . . . . 29
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 1
EE/ME 574: Intermediate Controls
3 Calculating steady-state errors (Franklin et al. sec. 4.2 (6
th
Ed.)) 32
3.1 System type and Bode standard form for the loop gain . . . . . . . 33
3.1.1 Determining steady-state error using Bode standard form . 34
3.2 Table of steady-state errors . . . . . . . . . . . . . . . . . . . . . 35
3.3 Steady-state error example . . . . . . . . . . . . . . . . . . . . . 36
3.4 Summary for steady-state error . . . . . . . . . . . . . . . . . . 36
4 Characteristics of the Step Response 37
4.1 Rise Time, t
r
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.2 Peak Time, t
p
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.3 Settling Time, t
s
. . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.4 Percent Overshoot, PO . . . . . . . . . . . . . . . . . . . . . . . 38
5 Working with the pole-zero constellation
39
5.1 Basics of pole-zero maps, 1
st
order, p
1
= . . . . . . . . . . . 39
5.1.1 Real Pole location and response characteristics . . . . . . 40
5.2 Basis of pole-zero maps, 2
nd
order, p
1,2
= j . . . . . . . 41
5.2.1 Notation for a complex pole pair . . . . . . . . . . . . . . 42
5.2.2 Complex pole location and response characteristics . . . 43
5.2.3 The damping factor: . . . . . . . . . . . . . . . . . . . 46
5.3 Higher order systems: dominant mode . . . . . . . . . . . . . . . 47
5.4 Which mode is the dominant mode ? . . . . . . . . . . . . . . . . 48
5.5 Summary: Pole location and response characteristics . . . . . . . 50
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 2
EE/ME 574: Intermediate Controls
6 Design 51
6.1 Design methods . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.2 Root Locus Design . . . . . . . . . . . . . . . . . . . . . . . . . 52
7 Summary 53
8 Glossary of Acronyms 54
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 3
EE/ME 574: Intermediate Controls Section 1.1.0
1 Differential Eqns, Transfer Functions & Modeling
1.1 Example 1, Golden Nugget Airlines
Dynamic systems are governed by differential equations
(or difference equations, if they are discrete-time)
Example (adapted from Franklin et al. 4
th
ed., problem 5.41, gure 5.79)
GNA
M
e
(t)
(t), (t)
M
p
(t)
Figure 1: Golden Nugget Airlines Aircraft. M
e
(t) is the elevator-moment (the
control input), M
p
(t) is the moment due to passenger movements (a
disturbance input), and (t) is the aircraft pitch angle, (t) =

(t) .
For example, the aircraft dynamics give:
1
d
2
(t)
dt
2
+4
d (t)
dt
+5(t) = 1
d M
t
(t)
dt
+3M
t
(t) (1)
M
t
(t) = M
e
(t) +M
p
(t) ; (t) =
d (t)
dt
(2)
1
d M
e
(t)
dt
+10M
e
(t) = 7v(t) (3)
Where M
t
(t) is the total applied moment.
Eqn (1) has to do with the velocity of the aircraft response to M
t
(t).
Eqn (2) expresses that the pitch-rate is the derivative of the pitch angle.
And Eqn (3) describes the response of the elevator to an input command
from the auto-pilot.
Main Fact: The Differential Equations come from the physics of the system.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 4
EE/ME 574: Intermediate Controls Section 1.2.0
1.2 Block diagram
A block diagram is a graphical representation of modeling equations and
their interconnection.
Eqns (1)-(3) can be laid out graphically, as in gure 2.
Elevator
servo
7
s + 10
Aircraft
Dynamics
s
2
+ 4 s + 5
s + 3
M
e
(t) M
t
(t)
M
p
(t)
Integrator
1
s
(t) (t)
v(t)
+
+
Figure 2: Block diagram of the aircraft dynamics and signals.
Signal Symbol Signal Name / Description Units
v(t) Voltage applied to the elevator drive [volts]
M
e
(t) Moment resulting from the elevator surface [N m]
M
p
(t) Moment resulting from movement of the passengers [N m]
(t) Pitch Rate (angular velocity) [rad/sec]
(t) Aircraft pitch angle [radians]
Table 1: List of signals for the aircraft block diagram.
When analyzing a problem from basic principals, we would also have a list
of parameters.
Parameter Symbol Signal Name / Description Value Units
b
0
Motion parameter of the elevator [N-m/volt]
... ... ...
Table 2: List of parameters for the aircraft block diagram.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 5
EE/ME 574: Intermediate Controls Section 1.3.1
1.3 Laplace Transforms and Transfer Functions
To introduce the Transfer Function (TF), we need to review the Laplace
transform.
1.3.1 Laplace transform
The Laplace transform (LT) maps
a signal (a function of time) to a
function of the Laplace variable s .
The Inverse Laplace transform
maps F (s) to f (t).
f(t)
F(s)
Space of all functions
of time
Space of all
functions of s
L{f(t)}
L
-1
{F(s)}
"Time Domain"
"Frequency Domain"
Why pay attention to Laplace
transforms ?
Answers:
1. Differential equations in time
domain correspond to algebraic
equations in s domain.
2. The LT makes possible the
transfer function.
3. Time domain: nd y(t) for one
u(t).
4. Frequency domain: nd G
uy
(s)
for all U(s).
u(t)
Space of all functions
of time
Space of all
functions of s
Solve
Diff Eq.
y(t)
U(s)
Solve
Algebraic
Eqn.
Y(s)
Figure 3: Solve differential equation in time domain or solve an algebraic
equation in s domain.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 6
EE/ME 574: Intermediate Controls Section 1.3.2
1.3.2 Some basic Laplace transform Pairs
Time Domain Signal Laplace transform
Unit Impulse: f (t) =(t) F (s) = 1
Scaled Impulse: f (t) = b(t) F (s) = b
Unit step: f (t) = 1
+
(t) = 1.0, t 0 F (s) =
1
s
Unit ramp: f (t) =t, t 0 F (s) =
1
s
2
Higher Powers of t: f (t) = t
n
, t 0 F (s) =
n!
s
n+1
Decaying Exponential: f (t) = be
t
F (s) =
b
s+
Sinusoid: f (t) = sin(wt) F (s) =

s
2
+
2
Sinusoidal oscillation: f (t) = B
c
cos(t) +B
s
sin(t) F (s) =
Bcs+Bs
s
2
+0s+
2
Oscillatory Exp. Decay: f (t) = e
t
(B
c
cos(t) +B
s
sin(t)) F (s) =
Bcs+(Bc +Bs)
s
2
+2s+
2
n

n
=

2
+
2
Table 3: Basic Laplace-transform pairs.
t=0
Area = 1.0

1/
t=0
1
+
(t)
t=0
(t), impulse function 1
+
(t), unit step Unit ramp
t=0
t=0
t=0
e
-t
Decaying expon. A Sinusoid Oscil. decay exp.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 7
EE/ME 574: Intermediate Controls Section 1.3.2
Two theorems of the Laplace transformpermit us to build transfer functions:
1. The Laplace transform obeys superposition and scaling
Given: z(t) = x(t) +y(t) then Z(s) = X (s) +Y (s)
Given: z(t) = 2.0x(t) then Z(s) = 2.0X (s)
2. The Laplace transform of the derivative of a signal x(t) is s times the LT
of x(t):
Given: X (s) =L{x(t)} , then L
_
d x(t)
dt
_
= sX (s)
Putting these rules together lets us nd the
transfer function of a systemfromits governing
differential equation.
System
u(t) y(t)
G
p
(s)
Consider a system that takes in the signal u(t) and gives y(t), governed by
the Diff Eq:
a
2
d
2
y(t)
dt
2
+a
1
d y(t)
dt
+a
0
y(t) = b
1
d u(t)
dt
+b
0
u(t) (4)
(Notice the standard form: output (unknown) on the left, input on the right.)
Whatever signals y(t) and u(t) are, they have Laplace transforms. Eqn (4)
gives:
L
_
a
2
d
2
y(t)
dt
2
+a
1
d y(t)
dt
+a
0
y(t)
_
= L
_
b
1
d u(t)
dt
+b
0
u(t)
_
(5)
a
2
s
2
Y (s) +a
1
sY (s) +a
0
Y (s) = b
1
sU(s) +b
0
U(s) (6)
_
a
2
s
2
+a
1
s +a
0
_
Y (s) = (b
1
s +b
0
) U (s) (7)
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 8
EE/ME 574: Intermediate Controls Section 1.3.2
Eqns (5)-(7) tell us something about the ratio of the LT of the output to the
LT of the input:
_
a
2
s
2
+a
1
s +a
0
_
Y (s) = (b
1
s +b
0
) U (s) (7, repeated)
Y (s)
U (s)
=
(b
1
s +b
0
)
(a
2
s
2
+a
1
s +a
0
)
=
Output LT
Input LT
= G
p
(s) (8)
A Transfer Function (TF) is a ratio of the input and output LTs
Given G
p
(s) =
(b
1
s +b
0
)
(a
2
s
2
+a
1
s +a
0
)
, Y (s) = G
p
(s) U (s) (9)
Where G
p
(s) is the TF of the plant.
Important fact:
The transfer function is like the gain of the system, it is the ratio of the
output LT to the input LT.
However, the TF depends only on the parameters of the system
(coefcients a
2
..a
0
and b
0
..b
1
in the example), and not on the actual
values of U (s) or Y (s) (or u(t) and y(t)).
Basic and Intermediate Control System Theory are present transfer
function-based design.
By engineering the characteristics of the TF, we engineer the system to
achieve performance goals.
Controller
Plant
r(t) y(t) +
-
ys(t)
KcGc(s)
Gp(s)
Hy(s)
Sensor Dynamics
e(t) u(t)
Figure 4: Block diagram of typical closed-loop control.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 9
EE/ME 574: Intermediate Controls Section 1.3.3
1.3.3 Transfer Functions are Rational Polynomials
GNA
M
e
(t)
(t), (t)
M
p
(t)
Figure 5: Golden Nugget Airlines Aircraft. (t) [radians/second] is the
pitch-rate of the aircraft, and M
t
(t) is the moment (torque) applied by
the elevator surface.
Consider the differential equation of the Aircraft pitch angle:
1
d
2
(t)
dt
2
+4
d (t)
dt
+5(t) = 1
d M
t
(t)
dt
+3M
t
(t) (10)
From (10) we get the TF, take LT of both sides, and rearrange:
_
s
2
+4s +5
_
(s) = (s +3) M
t
(s) (11)
(s)
M
t
(s)
=
s +3
s
2
+4s +5
Note:
We can write down the TF directly fromthe coefcients of the differential
equation.
We can write down the differential equation directly from the coefcients
of the TF.
Transfer functions, such as Eqn (11), are ratios of two polynomials:
(s)
M
t
(s)
=
s +3
s
2
+4s +5
:
numerator polymonial
denominator polynomial
We call a TF such as (11) a rational polynomial.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 10
EE/ME 574: Intermediate Controls Section 1.3.4
1.3.4 A transfer function has poles and zeros
A TF has a numerator and denominator polynomial, for example
Gp (s) =
N(s)
D(s)
=
2s
2
+8s +6
s
3
+ss
2
+4s +0
(12)
The roots of the numerator are called the zeros of the TF, and the roots of
the denominator are called the poles of the TF. For example:
>> num = [2 8 6]
>> den = [1 2 4 0 ]
num = 2 8 6
den = 1 2 4 0
>> zeros = roots(num)
zeros = -3
-1
>> poles = roots(den)
poles = 0
-1.0000 + 1.7321i
-1.0000 - 1.7321i
We can also use Matlabs system tool to nd the poles and zeros
>> Gps = tf(num, den) %% Build the system object
Transfer function: 2 s^2 + 8 s + 6
-----------------
s^3 + 2 s^2 + 4 s
>> zero(Gps), ans = -3
-1
>> pole(Gps), ans = 0
-1.0000 + 1.7321i
-1.0000 - 1.7321i
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 11
EE/ME 574: Intermediate Controls Section 1.3.4
Interpreting the poles (p
1
, p
2
, ..., p
n
) and zeros (z
1
, ..., z
m
)
We can use the poles and zeros to write the TF in factored form:
G(s) =
2s
2
+8s +6
s
3
+2s
2
+4s
=
b
2
(s z
1
) (s z
2
)
(s p
1
) (s p
2
) (s p
3
)
=
2(s +3) (s +1)
(s 0) (s +11.732 j) (s +1+1.732 j)
With a complex pole pair we can do two things,
1. Use a shorthand
G(s) =
2(s +3) (s +1)
s (s +11.732 j)
(Because poles always come in complex conjugate pairs.)
(a) Write the complex pole pair as a quadratic, rather than 1
st
order terms
G(s) =
2(s +3) (s +1)
s (s
2
+2s +4)
The zeros are values of s at which the transfer function goes to zero
The poles are values of s at which the transfer function goes to innity
We can plot a pole-zero map:
>> Gps=tf([2 8 6], [1 2 4 0])
>> pzmap(Gps)
4 2 0
2
1
0
1
2
real
i
m
a
g
i
n
a
r
y
PZ Map
Figure 6: Pole-Zero constellation of aircraft transfer function.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 12
EE/ME 574: Intermediate Controls Section 1.3.5
1.3.5 Properties of transfer functions
Just as a differential equation can be scaled by multiplying the left and right sides
by a constant, a TF can be scaled by multiplying the numerator and denominator
by a constant.
Monic: A TF is said to be monic if a
n
=1. We can always scale a TF to be monic.
If G
1
(s) is scaled to be monic, then
G
1
(s) =
b

0
s +a

1
(13)
with b

0
= b
0
/a
n
and a

1
= a
1
/a
n
.
Rational Polynomial Form: A TF is in rational polynomial form when the
numerator and denominator are each polynomials. For example
G
p
(s) =
2s
2
+8s +6
s
3
+ss
2
+4s +0
(14)
An example of a TF not in rational polynomial form is:
G
3
(s) =
2(s +3)/(s)
(s
2
+2s +4)/(s +1)
(15)
By clearing the fractions within the fraction, T
3
(s) can be expressed in rational
polynomial form
G
3
(s) =
2(s +3)/(s)
(s
2
+2s +4)/(s +1)
(s)
(s)
(s +1)
(s +1)
=
2(s +3)(s +1)
(s
2
+2s +4)(s)
=
2s
2
+8s +6
s
3
+2s
2
+4s
Note the middle form above, which can be called factored form.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 13
EE/ME 574: Intermediate Controls Section 1.3.6
1.3.6 Forms for a transfer function
1. Rational polynomial form
G(s) =
bms
m
+b
m1
s
m1
+b
1
s +b
0
a
n
s
n
+a
n1
s
n1
+ +a
1
s +a
0
(16)
Example:
G(s) =
3s +8
2s
3
+16s
2
+30s
(17)
2. Factored form
G(s) = K
rlg
(s z
1
) ... (s z
m
)
(s p
1
) ... (s p
n
)
(z
i
and p
i
are zeros and poles)
=
3
2
_
s +
8
3
_
s (s +3) (s +5)
(note: z
i
and p
i
are commonly negative values)
3. Bode form
1. Bring out any poles or zeros at the origin,
2. Bring out a constant, so that the least signicant coefcients of the
polynomials are 1.0
Example:
G(s) =
1
s
no
K
Bode
b

m
s
m
+... +b

1
s +1
a

nno
s
nno
+... +a

1
s +1
(18)
=
1
s
1
8
30
3
8
s +1
2
30
s
2
+
16
30
s +1
_
n
o
= 1, K
Bode
=
8
9
_
4. Root locus form
1. Bring out a factor, so that the numerator and denominator polynomials
are monic.
Example:
G(s) = K
rlg
s
m
+b

m1
s
m1
+... +b

1
s +b

0
s
n
+a

n1
s
n1
+... +a

1
s +a

0
(19)
=
3
2
s +
8
3
s
3
+8s
2
+15s
_
K
rlg
=
3
2
_
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 14
EE/ME 574: Intermediate Controls Section 1.3.7
1.3.7 Proper and strictly proper transfer functions:
m = number of zeros, n = number poles
A TF with m n is said to be proper.
When m < n the TF is said to be strictly proper
Example of a TF that is not proper:
G
4
(s) =
2s
2
+5s +4
s +1
note: m = 2,
n = 1
such a TF can always be factored by long division:
G
4
(s) =
2s
2
+5s +4
s +1
=
2s (s +1)
(s +1)
+
3s +4
s +1
=2s+
3s +4
s +1
= (2s +3)+
1
s +1
A non-proper TF such as G
4
(s) has a problem: As s = j j , the gain
goes to innity !
Since physical systems never have innite gain at innite frequency,
physical systems must have proper transfer functions.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 15
EE/ME 574: Intermediate Controls Section 1.3.9
1.3.8 System type
System Type: A property of transfer functions that comes up often is the system
type. The type of a system is the number of poles at the origin.
So, for example, the aircraft transfer function from elevator input to pitch
rate gives a type 0 system:
G
p1
(s) =
(s)
M
e
(s)
=
s +3
s
2
+4s +5
poles : s =21 j , type : 0
But the TF from the elevator to the pitch angle gives a type I system:
G
p2
(s) =
(s)
Me (s)
=
s +3
s (s
2
+4s +5)
poles : s =0, 21 j , type : I
If we put a PID controller in the loop, which adds a pole at the origin, the
system will be type II.
1.3.9 Phasors and the transfer function as complex gain
To consider the complex gain, we need to represent sinusoidal signals
as phasors. A phasor is a complex number that represents a sinusoidal
waveform. A time domain signal, such as
v(t) = A
v
cos(t +
v
) (20)
is represented by the complex number

V = A
v

v
= a+ j b. (21)
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 16
EE/ME 574: Intermediate Controls Section 1.3.9
For example, the time-domain waveform
v(t) = 3.0 cos(t +40
o
)
is represented by

V = 3.040
0
= 2.30+1.93 j .
For a phasor to represent a sinusoidal signal, the frequency, [rad/sec] must
be given.
Phasors in polar and rectangular coordinates
Polar Rectangular

V = Avv

V = a+ j b (22)
Av =
_
a
2
+b
2
, v = atan2(b, a) a = Av cos(v) , b = Av sin(v) (23)
Sinusoidal signals in polar and rectangular coordinates
v(t) = A
v
cos(t +
v
) v(t) = a cos(t) b sin(t) (24)
With a and b as given in Eqn (23).
Notice the difference of - sign between the phasor in rectangular
coordinates and the time-domain function in rectangular coordinates. This
extra - comes from the trig identity:
cos() = cos() cos() sin() sin() (25)
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 17
EE/ME 574: Intermediate Controls Section 1.3.9
In the example of gure 7,
G
p
(s)
u(t)=A
u
cos(t+
u
) y(t)=A
y
cos(t+
y
)
Figure 7: An element with sinusoid in and sinusoid out.
The TF evaluated with s = j gives the complex gain of the system element
Output Phasor = G
p
(s = j) Input Phasor (26)
A
y

y
= G
p
( j ) A
u

u
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 18
EE/ME 574: Intermediate Controls Section 1.3.9
Example Question: If v(t) = 1.5 cos(2.0t +0
o
) ,
what is the response of the aircraft, (t) ?
Solution: Looking back at the transfer functions
(s)
V (s)
=
7
s +10
s +3
s
2
+4s +5
Evaluating at s = j = j 2 gives the complex gain
(s)
V (s)
s=2 j
=
7
10+2 j
3+2 j
(2 j)
2
+4 (2 j) +5
=
21+14 j
6+82 j
(27)
= 0.15122.2672 j = 0.30760.5
o
The complex gain determines the output phasor:

= (0.30760.5
o
) (1.50
o
) = 0.46160.5 (28)
So the output, in the time domain, is:
(t) = 0.461 cos(2.0t 60.5
o
)
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 19
EE/ME 574: Intermediate Controls Section 1.3.9
The complex gain is a function of frequency. Evaluating
G
p
(s) =
(s)
V (s)
s=j
as a function of gives the Bode plot.
Bode plot of Gp(s)
Frequency (rad/s)
100
80
60
40
20
0
M
a
g
n
i
t
u
d
e

(
d
B
)
Magnitude at w=2.0
10
1
10
0
10
1
10
2
10
3
180
135
90
45
0
P
h
a
s
e

(
d
e
g
)
Phase at w=2.0
Figure 8: Bode plot of G
p
(s).
Summary, section 1.3.9:
1. The dynamics of the aircraft itself gave us a differential equation
2. For linear differential equations, we can get the transfer function directly
from the Diff Eq.
(a) And for non-linear differential equations, there is no transfer function.
3. With the TF we can determine the complex gain, and nd the output for
any sinusoidal input.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 20
EE/ME 574: Intermediate Controls Section 1.3.10
1.3.10 The DC gain of a transfer function
Following up on the idea that the TF gives the complex gain of a system
block and recalling the Laplace variable
s = j (29)
the DC gain is given with s = j0, or simply
DC Gain : G(s)
s=0
=
B(s)
A(s)
s=0
(30)
In some cases T (s = j 0) may evaluate to
0
0
(undened). In such cases apply
lHopitals rule:
DC Gain : lim
s0
G(s)
The example TFs give these values of DC gain
(s)
V (s)
=
3
s +10
s +3
s
2
+4s +5
(s)
V (s)
=
3
s +10
s +3
s
2
+4s +5
1
s
Evaluating the DC Gain
(s)
V (s)
s=0
=
3
10
3
5
=
9
50
(s)
V (s)
s=0
=
3
10
3
5
1
0
=
(Many systems have a DC gain of innity, it is a common property of control
systems.)
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 21
EE/ME 574: Intermediate Controls Section 2.0.0
1.3.11 The impulse response of a system
When we have a system such as in gure 9, the Laplace transform of the
output (a signal) is given by
Y (s) = G
p
(s) U (s) (31)
A unit impulse input is a very short pulse with an area under the curve of
the pulse of 1.0.
Since the Laplace transform of a unit-impulse is 1, then the Laplace
transform of the impulse response is the transfer function
Y
imp
(s) = G
p
(s) U
imp
(s) = G
p
(s) 1 = G
p
(s)
U(s)=1 Y(s)=G
p
(s)
System
G
p
(s)
u(t): impulse y(t): impulse response
t
u(t)
t
y(t)
Figure 9: The transfer function is the Laplace transform of the impulse response.
The connection between the impulse response and TF can be used to
determine the TF
Apply an impulse and measure the output, y(t). Take the LT and use
G
p
(s) =Y (s).
The connection between the impulse response and TF helps to understand
the mathematical connection between an LT and a TF
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 22
EE/ME 574: Intermediate Controls Section 2.0.0
2 Closing the loop, feedback control
Open Loop
G
p
(s)
u(t) y(t)
G
p
(s)
u(t)
y(t)
r(t)
Closed Loop
sensor
+
-
Figure 10: A plant with TF G
p
(s) in open and closed loop. Closed loop requires
a sensor.
Feedback is the basic magic of controls. A feedback controller can
Make an unstable system stable . . . . . . . . . . . . . . . . . . Helicopter autopilot
Make a stable system unstable . . . . . . . . . . . . . . . . Early y-ball governors
Make a slow system fast . . . . . . . . . . . Motor drive, industrial automation
Make a fast system slow. . . . . . . . F16 controls, approach / landing mode
Make an inaccurate system accurate . . . . . . . . . . . . . . . . . . . . machine tools
The magic comes because closing the loop changes the TF
Open loop:
Y (s)
U (s)
= G
p
(s)
For the Closed loop use U(s) = R(s) Y (s), dropping the (s) arguments:
Y = G
p
(RY) = G
p
RG
p
Y
Y (1+G
p
) = G
p
R
Y (s)
R(s)
=
G
p
1+G
p
(32)
Y (s)
R(s)
=
Forward PathGain
1+LoopGain
= T
ry
(s) (33)
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 23
EE/ME 574: Intermediate Controls Section 2.0.0
Example, wrapping a simple feedback loop around the aircraft dynamics
s
2
+ 4 s + 5
s + 3 M
t
(t)
(t)
r(t)
+
-
1
s
Figure 11: Simple feedback of aircraft pitch angle.
(s)
R(s)
=
G
p
(s)
1+G
p
(s)
=
s+3
s(s
2
+4s+5)
1+
s+3
s(s
2
+4s+5)
(34)
Eqn (34) is not in rational polynomial form, so
(s)
R(s)
=
s+3
s(s
2
+4s+5)
1+
s+3
s(s
2
+4s+5)
s
_
s
2
+4s +5
_
s (s
2
+4s +5)
=
s +3
s (s
2
+4s +5) + (s +3)
(35)
The closed-loop TF is still not quite in Rat Poly form, here is the nal step:
(s)
R(s)
=
s +3
s
3
+4s
2
+6s +3
(36)
(s) r(t) (t)
R(s)
Figure 12: Block with r (t) as input and (t) as output.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 24
EE/ME 574: Intermediate Controls Section 2.0.0
Analyzing the response
Gps = tf([1 3], [1 4 5 0]) %% LTI models
Try = tf([1 3], [1 4 6 3])
figure(1), clf
[Y_open, Top] = step(Gps, 6);
[Y_closed, Tcl] = step(Try, 6);
plot(Top, Y_open, Tcl, Y_closed)
xlabel(t [seconds]);
ylabel(\Omega, pitch-rate)
title(Open- and closed-loop)
text(3, 1.6, Open-loop, rotation, 45)
text(4, 0.8, Closed-loop)
SetLabels(14)
print(-deps2c, OpenClosedResponse1)
The response
completely
changes !
The open-loop
system is type I
The closed-loop
system is type 0
0 1 2 3 4 5 6
0
0.5
1
1.5
2
2.5
3
3.5
t [seconds]

,

p
it
c
h

r
a
t
e
Open and closedloop response, aircraft
O
p
e
n

lo
o
p
Closedloop
Figure 13: Open and Closed loop response of the aircraft, the two responses have
very different characteristics.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 25
EE/ME 574: Intermediate Controls Section 2.0.0
Introduce a proportional controller gain
s
2
+ 4 s + 5
s + 3 M
t
(t)
(t)
r(t)
+
-
1
s
K
c
e(t)
Figure 14: Feedback for aircraft pitch control, with P-type gain K
c
.
Look at K
c
=
_
1.0, 3.0, 10, 0
_
Kc = 1; Try1 = tf(Kc*[1 3], [1 4 5 0]+Kc*[0 0 1 3])
Kc = 3; Try2 = tf(Kc*[1 3], [1 4 5 0]+Kc*[0 0 1 3])
Kc = 10; Try3 = tf(Kc*[1 3], [1 4 5 0]+Kc*[0 0 1 3])
figure(1), clf
...
plot(Top, Y_open, Tcl, Y_closed1, Tcl, Y_closed2, Tcl, Y_closed3)
...
System gets much
faster as K
c
increases
System gets less
stable as K
c
increases
0 1 2 3 4 5 6
0
0.5
1
1.5
2
2.5
3
3.5
t [seconds]

,

p
it
c
h

r
a
t
e
Open and closedloop response, aircraft
O
p
e
n

lo
o
p
Closedloop, Kc =1
Kc =3
Kc =10
Figure 15: Open and Closed loop response of the aircraft, with K
c
= 1.0,
K
c
= 3.0, and K
c
=10.0 .
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 26
EE/ME 574: Intermediate Controls Section 2.1.0
2.1 Analyzing a closed-loop system
A typical, basic loop (such as velocity PI control of a motor drive) has 3
components:
1. Plant (thing being controlled)
2. Controller or compensator (usually a computer, a often PLC for motor
drives)
3. A sensor
Controller Plant
r(t) y(t) +
-
y
s
(t)
N
c
(s)
D
c
(s)
K
c
G
c
(s) =
N
p
(s)
D
p
(s)
G
p
(s) =
N
y
(s)
D
y
(s)
H
y
(s) =
Sensor Dynamics
K
c
e(t) u(t)
Figure 16: Basic loop with a plant, compensator and sensor.
The TF is given as
Try (s) =
Y (s)
R(s)
=
Forward PathGain
1+LoopGain
=
K
c
G
c
G
p
1+Kc Gc Gp Hy
Often, for the controls engineer the plant, G
p
(s), is set (e.g., the designer of
a cruise-control does not get to change the engine size).
As a controls engineer, we get to pick G
c
(s) and maybe inuence H
y
(s)
(e.g., by convincing the project manager to spring $$$ for a better sensor).
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 27
EE/ME 574: Intermediate Controls Section 2.2.0
2.2 Common controller structures:
PD PI PID Lead-Lag
Proportional-Derivative Prop.-Integral Prop.-Int.-Deriv.
G
c
(s) = k
d
s +k
p
G
c
(s) =
kps+ki
s
G
c
(s) =
kds
2
+kps+ki
s
G
c
= K
c
(s+z1) (s+z2)
(s+p1) (s+p2)
Common Applications
PI: Velocity control of motor drives, temperature control (good speed and
accuracy, acceptable stability)
PD: Position control where high accuracy is not required (good speed and
stability, so-so accuracy)
PID: Many many places, Astrom has estimated that 80% of controllers are
PID (good, speed accuracy, stability)
Lead-Lag: Used where a pole at the origin is unacceptable, can be as good
as PID (notice, 5 parameters rather than 3)
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 28
EE/ME 574: Intermediate Controls Section 2.3.0
2.3 Analyzing other loops
Input Shaping
Hr(s)
Controller Plant
d(t)
r(t) y(t)
Sensor Dynamics
+
-
+
+
+
+
Vs(t)
ys(t)
Nc
Dc
KcGc(s) =
Np
Dp
Gp(s) =
Ny
Dy
Hy(s) =
Disturbance Filter
Nd
Dd
Gd(s) =
Kc
e(t) uc(t) up(t)
Figure 17: Basic loop with a disturbance input, d (t) , and sensor noise, V
s
(t)
added.
In some cases we may want to consider additional inputs and outputs.
Many systems have a disturbance signal that acts on the plant, think of
wind gusts and a helicopter autopilot.
All systems have sensor noise.
Any signal in a system can be considered an output. For example, if we
want to consider the controller effort, u
c
(t), arising due to the reference
input
Tru (s) =
U
c
(s)
R(s)
=
ForwardPathGain
1+LoopGain
=
H
r
(s) K
c
G
c
(s)
1+K
c
G
c
(s) G
p
(s) H
y
(s)
(37)
If we wanted to consider the error arising with a disturbance, we would have
T
de
(s) =
E (s)
D(s)
=
G
d
(s) G
p
(s) H
y
(s) (1)
1+K
c
G
c
(s) G
p
(s) H
y
(s)
(38)
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 29
EE/ME 574: Intermediate Controls Section 2.3.0
2.3 Analyzing other loops (continued)
As a nal example, lets consider the output arising with sensor noise
T
vy
(s) =
Y (s)
V
s
(s)
=
H
y
(s) (1) K
c
G
c
(s) G
p
(s)
1+K
c
G
c
(s) G
p
(s) H
y
(s)
(39)
The example transfer functions, Eqns (37), (38) and (39) show some
interesting properties. The TFs are repeated here (omitting the many (s)s)
T
ry
(s) =
H
r
K
c
G
c
G
p
1+K
c
G
c
G
p
H
y
, T
ru
(s) =
H
r
K
c
G
c
1+K
c
G
c
G
p
H
y
T
ed
(s) =
G
d
G
p
H
y
(1)
1+K
c
G
c
G
p
H
y
, T
vy
(s) =
H
y
(1) K
c
G
c
G
p
1+K
c
G
c
G
p
H
y
The denominators are all the same
The poles are the same for any input/output signal pair
The stability and damping (both determined by the poles) are the same
for any signal pair
The numerators are different
The zeros are in general different for each input/output signal pair
Since the numerator help determine if the signal is small or large, signals
may have very different amplitudes and phase angles
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 30
EE/ME 574: Intermediate Controls Section 2.3.0
If we consider what happens as K
c
, we can see what happens for very
high gain. For this, assume that Hr (s) = 1.0 and G
d
(s) = 1.0, since these
two terms merely pre-lter inputs.
When K
c
, 1+K
c
G
c
G
p
H
y
K
c
G
c
G
p
H
y
, so
T
ry
(s)
K
c
G
c
G
p
K
c
G
c
G
p
H
y
=
1
H
y
, T
ru
(s)
K
c
G
c
K
c
G
c
G
p
H
y
=
1
G
p
H
y
T
de
(s)
G
d
G
p
H
y
(1)
Kc Gc Gp Hy
=
G
d
v
Kc Gc
, Tvy (s)
H
y
(1) K
c
G
c
G
p
Kc Gc Gp Hy
=1
T
ry
(s) 1/H
y
(s) shows that the TF of the plant can be compensated, it
disappears from the closed-loop TF as K
c
.
T
ry
(s) 1/H
y
(s) also shows that the TF of the sensor can not be
compensated. If the characteristics of H
y
(s) are bad (e.g., a cheap sensor)
there is nothing feedback control can do about it !
T
de
(s) 1/Kc Gc shows that disturbances can be compensated, as Kc ,
errors due to disturbances go to zero ;)
T
ru
(s) 1/G
p
H
y
shows that U
1
(s) does not go up with K
c
, and also, if the
plant has a small gain (G
p
(s) is small for some s = j ) then a large control
effort will be required for a given input.
T
vy
(s) 1 shows that there is no compensation for sensor noise. If there
is sensor noise, it is going to show up in the output !

Summary:
Feedback control can solve problems arising with characteristics of the
plant, G
p
(s), and disturbances, d (t).
Feedback control can not solve problems with the sensor, Hy (s), or
sensor noise, v
s
(t) .
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 31
EE/ME 574: Intermediate Controls Section 3.0.0
3 Calculating steady-state errors (Franklin et al.
sec. 4.2 (6
th
Ed.))
Steady-state errors are computed from the transfer function r (t) e(t), and
the nal value theorem:
Final value theorem: For a stable system with transfer function
T
re
(s) = E (s)/R(s),
ess = lim
t
e(t) = lim
s0
sE (s) (40)
In Eqn (40) E (s) (a Laplace transform) is given by T
re
(s) (a transfer
function) times R(s) (a Laplace transform):
E (s) = T
re
(s) R(s) (41)
which gives
e
ss
= lim
t
e(t) = lim
s0
sT
re
(s) R(s) (42)
To compute the nal value of the error, we have to specify the input r (t).
Signals typically used to compute steady-state error are seen in table 4.
The step, ramp and acceleration input signals and the Laplace Transforms can be
written:
r (t) =
1
k!
t
k
1
+
(t) , R(s) =
1
s
k+1
. (43)
For k = 1, 2, 3 the signals and Laplace transforms are given in table 4.
k Test input signal, r (t) R(s)
Step input 0 r (t) = 1
+
(t) R(s) =
1
s
Ramp input 1 r (t) =t 1
+
(t) R(s) =
1
s
2
Accelerating input 2 r (t) =
1
2
t
2
1
+
(t) R(s) =
1
s
3
Table 4: Typical inputs to consider for determining steady-state error.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 32
EE/ME 574: Intermediate Controls Section 3.1.0
3.1 System type and Bode standard form for the loop gain
Controller
Plant r(t) y(t) +
-
y
s
(t)
N
c
(s)
D
c
(s)
G
c
(s) =
N
p
(s)
D
p
(s)
G
p
(s) =
N
y
(s)
D
y
(s)
H
y
(s) =
Sensor Dynamics
Figure 18: Standard feedback loop, with numerator and denominators called out.
Considering gure 18, the error transfer function is given as:
T
er
(s) =
1
1+K
c
G
c
G
p
H
y
=
1
1+K
c
Nc
Dc
Np
Dp
Ny
Dy
=
D
c
D
p
D
y
D
c
D
p
D
y
+K
c
N
c
N
p
N
y
The poles of the loop gain are the zeros of the error transfer function !
Therefore, if the loop gain has a pole at the origin, the error transfer
function has a zero at the origin (which means its DC gain is zero)
If T
re
(s) has zeros at the origin, these cancel out
1
s
terms coming from
R(s) in the nal value theorem.
The number of poles at the origin in the loop gain is a sufciently basic
property of feedback systems that it is given a special name: the System
Type.
The system type is given as
Type 0: G
L
(s) has no pole at the origin, n
o
= 0
Type I: G
L
(s) has one pole at the origin, n
o
= 1
Type II: G
L
(s) has two poles at the origin, n
o
= 2 etc.
where n
o
is the number of open-loop poles at the origin.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 33
EE/ME 574: Intermediate Controls Section 3.1.1
3.1.1 Determining steady-state error using Bode standard form
Dening the loop gain as product of gains around the loop. For the standard
loop (gure 18):
G
L
(s) = G
c
(s) G
p
(s) H
y
(s) (44)
Writing the loop gain in Bode standard form:
G
L
(s) = G
c
(s) G
p
(s) H
y
(s) =
1
s
no
K
Bode
b
m
s
m
+b
m1
a
m1
... +b
1
s +1
a
n
s
n
+a
n1
s
n1
... a
1
s +1
(45)
Using Eqn (45), a general solution for the steady-state error can be found:
e
ss
= lim
s0
s T
re
(s) R(s)
= lim
s0
s
1
1+
1
s
no
K
Bode
bm s
m
+bm1s
m1
...b1 s+1
an s
n
+an1s
n1
+... a1s+1
R(s) (46)
But in the limit, all of the terms
_
b
m
s
m
+b
m1
s
m1
+.. +b
1
s
_
and
_
a
m
s
m
+a
m1
s
m1
+.. +a
1
s
_
drop out, giving
e
ss
= lim
s0
s
1
1+
1
s
no
K
Bode
R(s)
= lim
s0
s
s
no
s
no
+K
Bode
R(s) (47)
Eqn (47) has a particularly simple form, and is valid for step, ramp or
acceleration inputs, and any system type.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 34
EE/ME 574: Intermediate Controls Section 3.2.0
3.2 Table of steady-state errors
Eqn (47) leads to a general form for the steady-state error. Recall
e
ss
= lim
s0
s
s
no
s
no
+K
Bode
R(s) (48)
Inserting R(s) from Eqn (43), above, into the equation for steady-state error
gives
e
ss
= lim
s0
s
s
no
s
no
+K
Bode
1
s
k+1
(49)
where n
o
is the system type, and k is the order of the input signal. Using
Eqn (49), steady-state errors for system types 0, I and II are seen in table 5.
k r (t) R(s) Type 0 System Type I System Type II System
Step 0 1
+
(t) R(s) =
1
s
1
1+KBode
0 0
Ramp 1 t 1
+
(t) R(s) =
1
s
2

1
KBode
0
Accel 2
1
2
t
2
1
+
(t) R(s) =
1
s
3

1
KBode
Table 5: Connection between system type and steady-state error.
Types 0 and I are the most common system types in practical systems. Type
II is also seen. Type III and above is quite rare.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 35
EE/ME 574: Intermediate Controls Section 3.4.0
3.3 Steady-state error example
Considering the closed loop example of gure 14, with
G
c
(s) =
s +3
s
, G
p
(s) =
1
s
2
+4s +5
, H
y
(s) = 1 (50)
we have the loop gain in Bode standard form:
G
L
(s) = G
c
G
p
H
y
=
3
5
1
s
1
1
3
s +1
1
5
s
2
+
4
5
s +1
(51)
which shows a system type of I, and K
Bode
=
3
5
. Considering table 5, we
nd
e
ss
(step) = 0 , e
ss
(ramp) =
1
K
Bode
=
5
3
, e
ss
(accel) = .
3.4 Summary for steady-state error
The standard way to compute steady-state error is through table 5.
Table 5 shows that steady-state error depends on
1. The system type,
2. K
Bode
,
3. The order of the input (step, ramp or acceleration).
We often use the controller to make a Type 0 system into Type I, specically
to make the steady-state error go to zero for step inputs.
Controllers that increase the system type by one:
PI
PID
K
Bode
is the product of the DC gains around the loop. By increasing the
controller gain we increase K
Bode
and reduce steady-state errors.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 36
EE/ME 574: Intermediate Controls Section 4.1.0
4 Characteristics of the Step Response
Weve seen that steady-state error is a characteristic of the step (ramp)
response. But SSE we usually calculate from the TF.
These performance measures are dened from the step response. Generally
speaking, we cant compute them exactly from the TF, but well see
approximate calculations based on the dominant mode in the next section.
Rise time
Peak time
Settling time
Overshoot
When we consider the step response, it is always the closed-loop step
response.
2 4 6 8
0
0.5
1
1.5
Time [sec]
O
u
t
p
u
t

y
(
t
)
Step response of complex pole pair
Overshoot
2%
e
ss
| |
T
r
: 1090%
Rise Time

|
T
s
: 98% Settling Time

0 1 2 3
0
0.5
1
1.5
2
2.5
O
u
t
p
u
t

y
(
t
)
Step response of complex pole pair
y
10
y
90

y
ss
(1)
y
p

M
p

r
ss
(1)
y
ss
(0)

r
ss
(0)

|
t
10
|
t
90
|
t
p
Time [sec]
T
r
: 1090% Rise Time
Figure 19: Quantity denitions in a CL step response.
4.1 Rise Time, t
r
The 10% - 90% rise time. For the step response, it is the time between crossing
0.10y
ss
and 0.90y
ss
.
t
r

1.8

n
(52)
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 37
EE/ME 574: Intermediate Controls Section 4.4.0
4.2 Peak Time, t
p
Time between application of a step input and the rst peak of the
output. Undened if the output does not have a peak, but taken to be
satised in this case if all other speed-related requirements are met.
t
p

(53)
4.3 Settling Time, t
s
As seen in gure 19, the step response of a linear systemlies within an
exponentially decaying envelop. Settling time, t
s
, is the time required
to assure that the response does not pass again out of a narrow band
around y
ss
.
Typically used: 4 time constants, e
4
= 1.83%. So The 4 time
constant settling time is the time between application of a step input
and the last time that the signal exits a band 1.83% wide around y
ss
.
t
s
= max
t
{abs(
y(t) y
ss
y
ss
) > e
4
}
4

d
(54)
where
d
is the real part dominant pole location.
4.4 Percent Overshoot, PO
Difference between peak response and y
ss
, the steady-state response,
expressed as a fraction of y
ss
:
PO = 100
max(y(t)) y
ss
y
ss
, e

1
2
(55)
where [] is the damping factor. If y(t) never goes above y
ss
, PO=0.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 38
EE/ME 574: Intermediate Controls Section 5.1.0
5 Working with the pole-zero constellation
5.1 Basics of pole-zero maps, 1
st
order, p
1
=
You have seen that:
Each real pole is associated with a mode of the system response.
A real pole gives the terms of Eqn (57), as seen in gure 20.
Y (s) =
C
1
s +
=
3
s +2
y(t) =C
1
e
t
= 3e
2t
(56)
3 2 1 0 1
2
1
0
1
2
PoleZero Map
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]
Splane

Faster
0 1 2 3
0
1
2
3
Time (secs)
A
m
p
l
i
t
u
d
e
e
t
= e
t/
= e
2 t
h(t) =
|

C
1
/ e
Impulse response
Figure 20: First order pole and impulse response.
A real pole has these characteristics:
y(t) e
t/
where [sec] = 1/ is the time constant.
Further to the left indicates a faster response (smaller ).
The pole-zero constellation does not show either the K
DC
or the K
rlg
of
the TF or the amplitude of the impulse response.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 39
EE/ME 574: Intermediate Controls Section 5.1.1
5.1.1 Real Pole location and response characteristics
Example 1: Shifting poles to the left accelerates transient decay
Two example rst-order responses are shown.
X Case: = 4 [sec
1
] = 1/4 [sec]
Case: = 16 [sec
1
] = 1/16 [sec]
20 15 10 5 0 5
5
0
5
PZ map showing two systems
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]
Faster Decay
Figure 21: A change in pole location changes the decay rate and damping.
0 0.5 1
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e
= 0.25 [sec]
X System step response
0 0.5 1
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e
= 0.06 [sec]
System step response
Figure 22: A change in changes the time constant.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 40
EE/ME 574: Intermediate Controls Section 5.2.0
5.2 Basis of pole-zero maps, 2
nd
order, p
1,2
= j
And we have seen for second order:
Each complex pole pair gives a mode of the system response.
A complex pole pair gives the terms of Eqn (57), as seen in gure 23.
Using the Laplace transform pair
F (s) =
B
c
s +(B
c
+B
s
)
s
2
+ss +
2
n
f (t) = e
t
(Bc cos(t) +Bs sin(t))
one nds
Y (s) =
b
1
s +b
0
s
2
+2s +(
2
+
2
)
=
2s +14
s
2
+3s +18.25
(57)

y(t) = Ae
t
cos(t +) = 3.4e
1.5t
cos(4t 53.97
o
) (58)
with s
i
= j ,
n
=

2
+
2
, : damping factor, =

n
8 6 4 2 0 2
5
0
5
PoleZero Map
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]
Splane


0 2 4
2
1
0
1
2
3
Time (secs)
A
m
p
l
i
t
u
d
e
e
t
= e
t/
= e
1.5t

3.40 cos(4t 54.0


o
)
Impulse response
Figure 23: Second order pole and impulse response.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 41
EE/ME 574: Intermediate Controls Section 5.2.1
5.2.1 Notation for a complex pole pair
A complex pole pair can be expressed in polar or rectangular coordinates:
3 2 1 0 1 2
6
4
2
0
2
4
6
PZ Map, p
1
, p
1
*
=1.5 j 4
Real Axis [sec
1
]
I
m
a
g
in
a
r
y

A
x
is

[
s
e
c

1
]

1
Splane
p
1
p
1
*
Figure 24: Complex pole pair with
n
and dened.
Term Description Given by Units
or Decay Rate p
1
=+ j [sec
1
]
or
d
Damped Nat. Freq. p
1
=+ j [rad/sec]

n
Natural Freq.
2
n
=
_

2
+
2
_
[rad/sec]
Pole Angle = atan2(, ) [deg]
or Damping Factor =/
n
Dimless, []
Table 6: Factors derived from the location of a complex pole.
(Note: Franklin et al. often use ,
d
and .)
Rectangular Polar
p
1
=+ j p
1
=
n
(90+)
=
n
= sin()
=
_
1
2

n
=/
n
H(s) =

(s +)
2
+
2
H(s) =

n
_
1
2
s
2
+2
n
s +
2
n
Table 7: The terms of table 6 relate to rectangular or polar form for the poles.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 42
EE/ME 574: Intermediate Controls Section 5.2.2
5.2.2 Complex pole location and response characteristics
Example 1: Shifting poles to the left accelerates transient decay

n
PO
X Case: 1 [sec
1
] 4 [rad/sec] 4.12 [rad/sec] 0.25 [Dim

less] 44%
Case: 4 [sec
1
] 4 [rad/sec] 5.66 [rad/sec] 0.71 [Dim

less] 4%
8 6 4 2 0 2 4
6
4
2
0
2
4
6
PZ map showing two systems
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]
Faster Decay
8 6 4 2 0 2 4
6
4
2
0
2
4
6
7 5 3 1
0.9
0.7 0.5 0.3
0.9
0.7 0.5 0.3
PZ map with sgrid (indicates and
n
)
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]
Figure 25: A change in changes the decay rate and damping.
0 2 4
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e
= 0.24
46 % Overshoot
X System step response
0 2 4
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e
= 0.71
4 % Overshoot
System step response
Figure 26: Step response: a change in , is unchanged.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 43
EE/ME 574: Intermediate Controls Section 5.2.2
Example 2: Shifting poles out vertically increases oscillation frequency
n PO
X Case: 4 [sec
1
] 4 [rad/sec] 5.66 [rad/sec] 0.71 [Dim

less] 4%
Case: 4 [sec
1
] 16 [rad/sec] 16.49 [rad/sec] 0.24 [Dim

less] 44%
30 20 10 0 10
20
10
0
10
20
PZ map showing two systems
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]

Faster
Oscillation
30 20 10 0 10
20
10
0
10
20
28 20 12 4
0.9
0.7 0.5 0.3
0.9
0.7 0.5 0.3
PZ map with sgrid (indicates and
n
)
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]
Figure 27: A change in changes the oscillation frequency and damping.
0 1 2
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e
= 0.71
4 % Overshoot
X System step response
0 1 2
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e
= 0.24
46 % Overshoot
System step response
Figure 28: Step response: a change in .
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 44
EE/ME 574: Intermediate Controls Section 5.2.2
Example 3: Shifting poles out radially rescales time

n
PO
X Case: 4 [sec
1
] 4 [rad/sec] 5.66 [rad/sec] 0.71 [Dim

less] 4%
Case: 16 [sec
1
] 16 [rad/sec] 22.63 [rad/sec] 0.71 [Dim

less] 4%
30 20 10 0 10
20
10
0
10
20
PZ map showing two systems
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]
30 20 10 0 10
20
10
0
10
20
28 20 12 4
0.9
0.7
0.50.3
0.9
0.7
0.50.3
PZ map with sgrid (indicates and
n
)
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]
Figure 29: A radial change in pole location changes the decay rate and oscillation
frequency, but not the damping.
0 1 2
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e
= 0.71
4 % Overshoot
= 0.25 [sec]
X System step response
0 0.2 0.4
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e
= 0.71
4 % Overshoot
= 0.06 [sec]
System step response
Figure 30: Maintaining , time is rescaled.
Note: The S-plane has units of [sec
1
].
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 45
EE/ME 574: Intermediate Controls Section 5.2.3
5.2.3 The damping factor:
Plugging =/
n
back into the 2
nd
order form gives:
H(s) =
b
0
s
2
+a
1
s +a
0
=
b
0
s
2
+2
n
s +
2
n
(59)
giving:
=
a
1
2
n
=
a
1
2

a
0
(60)
is dened by Eqn (60) for either real poles: ( 1.0), or
a complex pole pair: (0.0 < < 1.0).
As illustrated in gure 28, above, on the range 0.0 < < 1.0, the damping
factor relates to percent overshoot. For a system with two poles and no
zeros, the percent overshoot is given by Eqn (61) and plotted in gure 31
P.O. = 100e

/
_
1
2
(61)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
10
20
30
40
50
60
70
80
90
100
Damping factor [.]
P
e
rc
e
n
t O
v
e
rs
h
o
o
t
Figure 31: Percent overshoot versus damping fact. Exact for a system with two
complex poles and no zeros, and approximate for other systems.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 46
EE/ME 574: Intermediate Controls Section 5.3.0
5.3 Higher order systems: dominant mode
The response of a higher order system is the superposition of the responses
of the modes:
1
st
order modes; 2
nd
order modes.
Typically (not quite always) one mode will dominate. In the example of
gure 32, the slower second-order mode dominates.
15 10 5 0
10
5
0
5
10
PoleZero Map
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]
Dom. Mode
0 2 4
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e
Step response
Step response

Dom. mode

0 2 4
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e

Fast secondorder
mode
0 2 4
0
0.5
1
1.5
Time (secs)
A
m
p
l
i
t
u
d
e

Firstorder mode
Figure 32: Example high-order system showing dominant mode in step response.
Recall: the goal of studying the S-plane is to tie controller specications to
pole locations.
The dominant mode dominates the response.
The root-locus design method operates by placing the dominant poles in
the desired region of the S-plane
(Other poles can be anywhere in stable region).
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 47
EE/ME 574: Intermediate Controls Section 5.4.0
Dominant mode (continued)
As the gure 32 Step response plot shows, the dominant mode is only an
approximation to the true step response.
For high-order systems (n 3), design control by:
1. Use dominant mode concept and approximation for initial design; then
2. Fine tune controller based on actual (high order) response
Iterative process of design and analysis.
5.4 Which mode is the dominant mode ?
The dominant mode is:
A slow mode, with a
Large residue.
On the S-plane this means that the dominant mode is (almost always):
The slowest mode (other modes die out faster).
Exceptionally, one must also consider the size of the residue, the dominant
mode should be:
Near to other poles; for example, s = 0 pole from step input
(Graphical method: being near other poles gives a large residue).
Far from zeros
(Graphical method: being far from zeros gives a large residue).
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 48
EE/ME 574: Intermediate Controls Section 5.4.0
5.3 Dominant mode (continued)
A second example is presented in gure 33.
Which mode is dominant in gure 33 ? Student
Exercise
15 10 5 0 5
10
5
0
5
10
PoleZero Map
Real Axis [sec
1
]
I
m
a
g
i
n
a
r
y

A
x
i
s

[
s
e
c

1
]
0 5 10
0
0.5
1
Time (secs)
A
m
p
l
i
t
u
d
e
Step response


Step response
Dominant mode
0 5 10
0
0.5
1
Time (secs)
A
m
p
l
i
t
u
d
e
Slow secondorder
mode
0 5 10
0
0.5
1
Time (secs)
A
m
p
l
i
t
u
d
e

Fast secondorder
mode
Figure 33: Second example showing dominant mode in step response.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 49
EE/ME 574: Intermediate Controls Section 5.5.0
5.5 Summary: Pole location and response characteristics
S-plane
Stable Region
(LHP)
Unstable Region
(RHP)
Marginally Stable Region
(the j axis)
X
X
p1
p1
*
Faster
Decay
Faster
Oscillation
Better Damping
Figure 34: Decay rate, oscillation freq. and damping depend upon pole location.
Figure 35: S-plane and responses.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 50
EE/ME 574: Intermediate Controls Section 6.0.0
6 Design
In some sense, Design is the opposite of Analysis
Performance
Specifications
Completed
Controller
Design
Analysis
Design
Figure 36: Design = Analysis
1
In Analysis, we use mathematical methods to determine performance
specications from a completed controller design (all structure and
parameters specied).
In Design, we use whatever method works !
Mathematical
Gut feeling
Trial and error
Calling a colleague with experience
to determine a controller structure and parameters to meet performance
goals.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 51
EE/ME 574: Intermediate Controls Section 6.2.0
6.1 Design methods
The major design methods are:
Root locus
Speed, Stability: determine by determining pole locations
Accuracy: increase the system type, check the SSE
Frequency response
()
Speed: Bandwidth and Cross-over frequency directly from bode plot
Stability: Phase margin, Gain margin directly from bode plot
Accuracy: tracking accy., disturbance rejection directly from bode plot
State Space methods
()
Design using state-space design methods, check speed, stability and
accuracy from the step response
6.2 Root Locus Design
Devised by Walter R. Evans, 1948 (1920 -
1999)
W.R. Evans, Control system synthesis by
root locus method, Trans. AIEE, vol. 69,
pp. 6669, 1950.
(Amer. Institute of Elec. Engs became
IEEE in 1963)
Evans was teaching a course in controls,
and a student (now anonymous) asked a
question about an approximation.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 52
EE/ME 574: Intermediate Controls Section 7.0.0
7 Summary
Dynamic systems are governed by differential equations
Every input or output signal of the system has a unique Laplace transform
For linear systems,
The ratio of Laplace transforms, however, does not depend on the signals.
The ratio depends only on properties of the system. We call it the transfer
function. For example:
G
uy
(s) =
b
1
s +b
0
s
2
+a
1
s +a
0
(62)
Transfer function gives us many results
The pole locations tells us the stability and damping ratio
We can get approximate values for rise time, settling time and other
performance measures
Control system analysis is the process of determining performance from a
system model and controller design
We have various tools for evaluating performance, including
* Pole locations * Steady-state error * Step response * Bode plot
Control system
Design =Analysis
1
it is the process of determining a controller design given a system model
and performance goals.
The root locus method is one method for controller design.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 53
EE/ME 574: Intermediate Controls Section 8.0.0
8 Glossary of Acronyms
LT: Laplace Transform
TF: Transfer Function
FPG: Forward path gain
LG: Loop Gain, (also G
l
(s))
RHP: Right-half of the S plane (unstable region)
LHP: Left-half of the S plane (stable region)
SSE: Steady-state error
PO: Percent Overshoot
LF: Low frequency (as in LF gain). Frequencies below the cross-over
frequency.
HF: High frequency (as in HF gain). Frequencies above the cross-over
frequency.
CL: Closed loop
OL: Open loop
P, PD, PI, PID: Proportional-Integral-Derivative control, basic and very common
controller structures.
Part 1: Controls Review-By-Example (Revised: Jan 16, 2013) Page 54
EE/ME 574: Intermediate Controls
Frequency-Response Based Analysis
Contents
1 Introduction 3
1.1 Review of complex numbers and arithmetic . . . . . . . . . . . . 5
1.1.1 Complex Conjugate: . . . . . . . . . . . . . . . . . . . . 6
1.1.2 Complex Arithmetic: . . . . . . . . . . . . . . . . . . . 7
2 Frequency Response and the Bode plot 10
2.1 Sketching a Bode plot by hand . . . . . . . . . . . . . . . . . . 12
2.1.1 Why make a Bode plot by hand . . . . . . . . . . . . . . 12
2.1.2 Sketching individual elements . . . . . . . . . . . . . . . 13
2.1.3 Example 1, One pole no zeros . . . . . . . . . . . . . . . 14
2.1.4 Details of the break point . . . . . . . . . . . . . . . . . 15
2.1.5 Example 2, Two poles one zero . . . . . . . . . . . . . . 16
2.1.6 Example 3, A pole at the origin . . . . . . . . . . . . . . 17
2.2 The Bode plot of the loop gain . . . . . . . . . . . . . . . . . . . 19
2.3 Bode standard form for the loop gain . . . . . . . . . . . . . . . . 23
2.3.1 Plotting terms of the form K
Bode
( j )
no
A . . . . . . . . 25
2.3.2 Contrasting K
Bode
with K
rlg
. . . . . . . . . . . . . . . . 26
2.3.3 Plotting terms of the form ( j +1) (a real pole or zero) 27
2.3.4 Plotting a complex pole or zero pair . . . . . . . . . . . . 31
2.3.5 Summary of Bode plot plotting rules . . . . . . . . . . . 35
2.4 Examples: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 1
EE/ME 574: Intermediate Controls
2.4.1 Example 1: Sketch the bode plot for KG(s) . . . . . . . 37
2.4.2 Example 2: Sketch the bode plot for a system with a
complex pole pair . . . . . . . . . . . . . . . . . . . . . . 40
2.5 Steady state errors . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.5.1 Determining K
Bode
and SSE using the Matlab bode()
command . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.6 Summary of Frequency Response and the Bode plot . . . . . . . . 49
3 Stability Considerations, Phase and Gain Margins 50
3.1 Marginal Stability . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.2 Denitions for phase and gain margin . . . . . . . . . . . . . . . 51
3.3 Examples, stability, marginal stability and instability . . . . . . . 52
3.3.1 A challenge with applying gain and phase margin . . . . . 56
3.3.2 Example with the pattern of gure 38(a) . . . . . . . . . . 58
3.4 Interpreting Phase and Gain Margin . . . . . . . . . . . . . . . . 60
4 Summary: Analysis by Frequency Response 61
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 2
EE/ME 574: Intermediate Controls Section 1.0.0
1 Introduction
For a linear system a sinusoidal input produces a sinusoidal output,
(after all transients have died out)
Figure 1 shows the response of the system
G(s) =
1
s +10
1
s+10
u(t) y(t)
G(s)=
for the input
u(t) = sin(10t)
Once the startup transient dies out, an input with = 10 gives and output
with = 10.
0 1 2 3 4 5 6 7 8 9 10
0.1
0.05
0
0.05
0.1
0.15
0.2
S
y
s
t
e
m

O
u
t
p
u
t
Time [seconds]
Zerostate Response of G(s) to sin(10 t)
Figure 1: A sinusoidal input to a linear system results in a sinusoidal output.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 3
EE/ME 574: Intermediate Controls Section 1.1.0
We can determine the steady-state output sinusoid from the input and the
transfer function
Representing the input as a phasor
Waveform : Phasor AComplexNumber
u(t) = A
u
cos(t +
u
)

U = A
u

u
Looking at the system
Output Phasor
Input Phasor
=

U
= ComplexGain = G(s)
s=j
=
1
j +10
For example, with u(t) = sin(10t) and G(s) = 1/(s +10), then y(t) is
determined from:

U
= G(s)
s=j 10
=
1
j 10+10
=
1
10

2
45
o
The input as a phasor is give by
u(t) =sin(10t) =cos(10t 90
o
)

U=1.090
o
(with=10[rad/sec])
The output phasor is given by:

Y = (Input Phasor) (ComplexGain) = (1.090


o
)
_
1
10

2
45
o
_

Y =
1
10

2
135
o
y(t) =
1
10

2
cos(10t 135
o
)
(This is the waveform in gure 1)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 4
EE/ME 574: Intermediate Controls Section 1.1.0
1.1 Review of complex numbers and arithmetic
(See Franklin et al., Appendix B)
Certain polynomials have no solutions which are real numbers,
x
2
+1 = 0 or x
2
=1
Italian mathematicians of the 1500s began considering polynomials and
discussing solutions involving

1
In 1637 Ren Descartes coins the term imaginary number to suggest that
work on the subject was an illusion.
It turns out that imaginary numbers solve a wide range of problems in signal
processing, medical image reconstruction, impedance analysis, etc.
Any complex number is made up of a real and imaginary part
A = + j
real (A) = imag(A) =
j (or i for mathematicians) is the complex number
j
2
=1 (1)
Higher powers of j are given from:
j
3
= j
2
j = 1 j
j
4
= j
2
j
2
=1 1 = 1
j
5
= j
2
j
2
j = j
etc.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 5
EE/ME 574: Intermediate Controls Section 1.1.1
Complex numbers correspond to a point on the plane
a+b j
Complex Plain
Real
Imag
A
<

V
V*
Figure 2: A complex number = A point on the complex plain.
A complex number (point on the complex plain) can be represented in polar
or rectangular coordinates
Polar Rectangular
V = A
v

v
V = a+ j b (2)
A
v
=
_
a
2
+b
2
a = A cos(
v
) (3)

v
= atan2(b, a) b = A sin(
v
) (4)
What the complex plane reveals is that the real and imaginary parts are
orthogonal.
1.1.1 Complex Conjugate:
The complex conjugate of a number V is written V

.
With V = A
v

v
= a+ j b , then V

= A
v

v
= a j b
V+V

gives a real number, V+V

= 2a+ j 0
VV

also gives a real number,


(a+ j b)(a j b) =
_
a
2
+b
2
_
+ j (abab) =
_
a
2
+b
2
_
+ j0
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 6
EE/ME 574: Intermediate Controls Section 1.1.2
1.1.2 Complex Arithmetic:
The operations of complex arithmetic are given as:
Polar Rectangular
V = A , W = B V = a+ j b, W = c + j d
Addition : (none) V+W = (a+c) + j (b+d) (5)
Subtraction : (none) VW = (ac) + j (bd) (6)
Multiplication : VW = AB+ VW = (a+ j b) (c + j d) (7)
= (ac bd) + j (ad +bc)
Division :
V
W
= A/B
V
W
=
(ac +bd) + j (bc ad)
c
2
+d
2
(8)
Where the equation for division in rectangular coordinates comes from
writing:
V
W
=
VW

WW

and multiplying out the terms.


Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 7
EE/ME 574: Intermediate Controls Section 1.1.2
Eulers Formula:
Recall the transcendental functions:
e
x
= 1+x +
x
2
2!
+
x
3
3!
+
x
4
4!
+
cos x = 1
x
2
2!
+
x
4
4!
+
sin x = x
x
3
3!
+
x
5
5!
+
Eulers formula gives meaning to the complex exponential.
e
j
= 1+ j +
j
2

2
2!
+
j
3

3
3!
+
j
4

4
4!
+
j
5

5
5!
+ (9)
Using the fact that j
2
=1, j
4
= 1, etc.
e
j
= 1+ j

2
2!

j
3
3!
+

4
4!
+
j
5
5!
+
=
_
1

2
2!
+

4
4!
+
_
+ j
_

3
3!
+

5
5!
+
_
e
j
= cos + j sin (10)
From Eqns (2) and (10) we nd that
A = Ae
j
= A cos() + j A sin() = a+ j b (11)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 8
EE/ME 574: Intermediate Controls Section 1.1.2
If we write the phasor

V = A (12)
then
v(t) = A cos(t +) = Areal
_
e
j(t+)
_
= Areal
_
e
jt
e
j
_
We can imagine a complex signal (t) =e
j(t+)
as a vector on the complex
plane. The real signal is the projection of the vector onto the real axis.
Complex Plain
Real
Imag
Ae
j(t+)
rotation
t
v(t) = e
j (t+)
= e
jt
e
j
Figure 3: Phasor rotating on the complex plane.
Rotation by an angle (either phase shift or by t) is just multiplication
by e
j
.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 9
EE/ME 574: Intermediate Controls Section 2.0.0
2 Frequency Response and the Bode plot
Considering the steady state, a sinusoidal input gives a sinusoidal output
The relationship between the input and output is given by the complex gain
Which is given by the transfer function evaluated at s = j
In general, the G(s = j ) a function of frequency
In polar coordinates, a complex number has a magnitude and phase
The magnitude and phase are a function of frequency
10
1
10
0
10
1
10
2
10
3
50
40
30
20
10
0
10
G
a
in
d
B
LowPass Filter
G(s)=3/(s+3)
20dB/decade
10
1
10
0
10
1
10
2
10
3
90
60
30
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Lagging phase
10
1
10
0
10
1
10
2
10
3
10
0
10
20
30
40
50
G
a
in
d
B
HighPass Filter
G(s)=(s+10)/10
+20dB/decade
10
1
10
0
10
1
10
2
10
3
0
30
60
90
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Leading phase
Low Pass Filter High Pass Filter
G(s) =
3
s +3
G(s) =
s +10
10
Figure 4: Bode plot: First-order response characteristic.
1
st
order low-pass:
20dB / decade roll-off
90
o
phase at high freq.
1
st
order high-pass:
+20dB / decade
+90
o
phase at high freq.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 10
EE/ME 574: Intermediate Controls Section 2.0.0
2
nd
order
G(s) =

2
n
s
2
+2
n
s +
2
n
(13)
10
1
10
0
10
1
10
2
60
40
20
0
20
G
a
in
d
B
2
nd
order mode, =0.28
G(s)=10/(s
2
+ 1.0 s + 10)
40dB/decade
10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
10
1
10
0
10
1
10
2
60
40
20
0
20
G
a
in
d
B
2
nd
order mode, =0.056
G(s)=10/(s
2
+ 0.2 s + 10)
40dB/decade
10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
2
nd
order, moderate damping 2
nd
order, light damping
G(s) =
10
s
2
+1.0s +10
G(s) =
10
s
2
+0.2s +10
Figure 5: Bode plot: Second-order response characteristic. The smaller the
damping, the higher the resonant peak.
2
nd
order response:
40 dB / decade roll-off
180
o
phase at high frequency
Sharpness of the transition depends on the damping:
Moderate to high damping: shallow peak, smooth phase transition
Low damping: sharp peak, abrupt phase transition
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 11
EE/ME 574: Intermediate Controls Section 2.1.1
2.1 Sketching a Bode plot by hand
2.1.1 Why make a Bode plot by hand
Given G
c
(s) G
p
(s) computers are great for making the exact Bode plot
Given a structure for G
c
(s) and approximate values, computers can be pretty
good at ne tuning the parameters (adaptive control)
Computers are no good at all at determining a good structure for G
c
(s), or
nding the correct ball park for parameters
An approximate sketch of the Frequency Response is a very powerful way
to understand the over-all characteristics of a system.
The Bode plot is a tool on which Engineering judgement and intuition can
be based.
Some key ideas of the bode plot are:
The axes:
Frequency axis is logarithmic
Magnitude is plotted in decibels (dB)
Phase is plotted in degrees
Decibels: a logarithmic scale
|G(s)|
dB
= 20 log
10
(|G(s)|)
Multiplying the loop gain by a factor corresponds to adding decibels
|40|
dB
= 32dB , |50|
dB
= 34dB , |40 50|
dB
= 32+34dB
Multiplicative factors:
2+6dB, 10= +20dB, 20+26dB
0.56dB, 0.1=20dB, 0.0526dB
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 12
EE/ME 574: Intermediate Controls Section 2.1.2
Advantage of working in dB:
Gains of blocks in series multiply,
G
1
u(t) y(t)
G
2
G
1
= A
1

1
, G
2
= A
2

2
, G
1
G
2
= A
1
A
2

1
+
2
= A
12

12
But Bode plot terms in series add
Magnitude : 20 log
10
(A
1
A
2
) = 20 log
10
(A
1
) +20 log
10
(A
2
)
Phase :
12
=
1
+
2
2.1.2 Sketching individual elements
Low frequency asymptote given as
lim
0
G( j ) (14)
High frequency asymptote given as
lim

G( j ) (15)
Poles and zeros make contributions as a function of
A pole adds a slope of 1 and 90
o
of phase lag
A pole pair adds a slope of 2 and 180
o
of phase lag
A zero adds a slope of +1 and 90
o
of phase lead
A zero pair adds a slope of +2 and 180
o
of phase lead
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 13
EE/ME 574: Intermediate Controls Section 2.1.3
2.1.3 Example 1, One pole no zeros
10
1
10
0
10
1
10
2
10
3
50
40
30
20
10
0
10
G
a
in

d
B
One pole no zeros
HighFreq Asymptote
LowFreq Asymptote

20dB/decade
10
1
10
0
10
1
10
2
10
3
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
10/(2 j ) gives 90
o

G(s) =
10
2s +8
Break Point:
= 4 [rad/sec]
Low Freq Asymp:
G( j 2)
10
0 j +8
2.0 dB0
o
High Freq Asymp:
(|2 j | >> 8)
G( j )
10
2 j +0

10
2
90
o
Figure 6: One pole, no zero.
Break points:
Freqs at which poles (or zeros) introduce transitions into the Bode plot.
Also, the break-point frequency is the frequency at which the real and
imaginary parts of the pole (or zero) are equal.
Examples:
Gp (s) =
s +5
s +10
Break point frequency of zero: = 5 [rad/sec].
Break point frequency of pole: = 10 [rad/sec].
G
p
(s) =
3s +1
0.02s +1
Break point frequency of zero: = 1/3 [rad/sec].
Break point frequency of pole: = 50 [rad/sec].
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 14
EE/ME 574: Intermediate Controls Section 2.1.4
2.1.4 Details of the break point
10
1
10
0
10
1
10
2
10
3
50
40
30
20
10
0
10
G
a
in

d
B
Break Point
Gain reduce by 1/sqrt(2)
10
1
10
0
10
1
10
2
10
3
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Phase shift of 45
o
Example:
G(s) =
10
2s +8
The break point is at
= 4.0 [rad/sec]
At the break point,
the real and imaginary
parts are equal.
Figure 7: The break point is at = 4.0 [rad/sec].
The break point is the frequency at which the real and imaginary parts of
the term (pole or zero) are equal
The break point marks the transition from where the real term dominates
to where the imaginary part dominates
Consider
G(s) =
1
s +1
The break point is = 1.0 [rad/sec]
G(s = 1.0 j) =
1
j +1
=
1

2
45
o
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 15
EE/ME 574: Intermediate Controls Section 2.1.5
2.1.5 Example 2, Two poles one zero
G(s) =
40s +160
s
2
+21s +20
=
40(s +4)
(s +1)(s +20)
= 8
1
s
0
1
4
s +1
(s +1)
_
1
20
s +1
_ (16)
10
1
10
0
10
1
10
2
10
3
30
20
10
0
10
20
30
G
a
in

d
B
One pole no zeros
10
1
10
0
10
1
10
2
10
3
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 8: Two poles, one zero.
The two asymptotes are very simple
Low Freq Asymptote:
lim
sj 0
G( j ) = lim
sj 0
_
40s +160
s
2
+21s +20
_
=
160
20
= 18.1dB0
o
High Freq Asymptote:
lim
sj
G( j ) = lim
sj
_
40s +160
s
2
+21s +20
_
=
40s
s
2
=
40
s
=
40
j
=
40

90
o
Three break points: = 1(down), = 4(up), = 20(2x down)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 16
EE/ME 574: Intermediate Controls Section 2.1.6
2.1.6 Example 3, A pole at the origin
G(s) =
40s +160
s
2
+20s
=
40(s +4)
s(s +20)
= 8
1
s
1
1
4
s +1
_
1
20
s +1
_ (17)
10
1
10
0
10
1
10
2
10
3
20
0
20
40
G
a
in

d
B
One pole no zeros
Mag=40 (32dB)

Mag=8 (16 dB)


10
1
10
0
10
1
10
2
10
3
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 9: A Type I system element.
Asymptotes, think about the points where the asymptotes hit = 1.0.
Low Freq Asymptote:
lim
sj 0
G( j ) = lim
sj 0
8
1
s
1
1
4
s +1
_
1
20
s +1
_ = lim
0
8
1
j
=
8

90
o
High Freq Asymptote (same as example 2):
lim
sj
G( j ) = lim
sj
8
1
s
1
1
4
s +1
_
1
20
s +1
_ = 40
1
s
=
40
j
=
40

90
o
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 17
EE/ME 574: Intermediate Controls Section 2.1.6
Two break points: = 4(up), = 20(down)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 18
EE/ME 574: Intermediate Controls Section 2.2.0
2.2 The Bode plot of the loop gain
The Bode plot of elements in series is given by adding the plots of the
individual elements
The loop gain is open loop.
It will turn out that we can establish the stability, disturbance rejection, noise
rejection and other properties from the loop gain, without ever solving for
the closed-loop poles.
Example 5, A basic loop
r(t) y(t) +
-
y
s
(t)
K
c
G
c
(s) G
p
(s)
H
y
(s)
e(t) u(t)
Figure 10: A basic control loop.
With:
K
c
G
c
(s) = 2(s +5)
G
p
(s) =
1
s
H
y
(s) =
20
s +20
The loop gain is given as:
KG
L
= K
c
G
c
G
p
H
y
=
40 (s +5)
s (s +20)
(18)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 19
EE/ME 574: Intermediate Controls Section 2.2.0
10
1
10
0
10
1
10
2
10
3
60
40
20
0
20
G
a
in
d
B
G
p
(s)=1/s
10
1
10
0
10
1
10
2
10
3
100
80
60
40
20
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
10
1
10
0
10
1
10
2
10
3
40
30
20
10
0
10
G
a
in
d
B
H
y
(s)=20/(s+20)
10
1
10
0
10
1
10
2
10
3
90
60
30
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
G
p
(s) =
1
s
H
y
(s) =
20
s +20
Figure 11: Components of the loop gain, the plant and sensor.
10
1
10
0
10
1
10
2
10
3
100
80
60
40
20
0
20
G
a
in

d
B
G
c
(s) H
y
(s)=20/(s
2
+20s)
10
1
10
0
10
1
10
2
10
3
180
150
120
90
60
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Put together the Bode
plots of G
p
(s) and H
y
(s)
G(s) =
20
s
2
+20s
=
20
s(s +20)
Low Freq Asymp:
G( j ) = 20/20s
=
1

90
o
High Freq Asymp:
G( j ) = 20/s
2
=
20

2
180
o
Break Point:
= 20 [rad/sec]
Figure 12: Components of the loop gain, combining the plant and sensor.
Note that at high freq. this system has a roll-off of -40 dB per decade (slope
of -2), and has 180
o
degree of phase lag.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 20
EE/ME 574: Intermediate Controls Section 2.2.0
10
1
10
0
10
1
10
2
10
3
100
80
60
40
20
0
20
G
a
in
d
B
G
c
(s) H
y
(s)=20/(s
2
+20s)
10
1
10
0
10
1
10
2
10
3
180
150
120
90
60
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
10
1
10
0
10
1
10
2
10
3
0
20
40
60
80
100
120
G
a
in
d
B
K
c
G
c
(s)=2s+10
10
1
10
0
10
1
10
2
10
3
0
30
60
90
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Break point
G
p
(s)H
y
(s) =
1
s
20
s +20
K
c
G
c
(s) = 2 (s +5) = 2s +10
Figure 13: Components of the loop gain, the plant and sensor.
10
1
10
0
10
1
10
2
10
3
40
20
0
20
40
60
G
a
in

d
B
Loop Gain K
c
G
c
(s) G
p
(s) H
y
(s)
10
1
10
0
10
1
10
2
10
3
100
80
60
40
20
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Some things to notice:
The phase angle corre-
sponds to the slope.
-20 dB per decade
gives -90 [deg]
The zero comes at
= 5 [rad/sec], while
the sensor pole comes at
= 20 [rad/sec]
So the +90
o
of G
c
(s)
wins out for a range
of
Figure 14: Components of the loop gain, combining the plant and sensor.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 21
EE/ME 574: Intermediate Controls Section 2.2.0
What the Bode plot would look like if the sensor pole came rst (had lower
frequency) than the PD compensator zero
10
1
10
0
10
1
10
2
10
3
100
80
60
40
20
0
20
G
a
in
d
B
10
1
10
0
10
1
10
2
10
3
180
150
120
90
60
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
10
1
10
0
10
1
10
2
10
3
0
20
40
60
80
100
120
G
a
in
d
B
10
1
10
0
10
1
10
2
10
3
0
30
60
90
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
G
p
(s)H
y
(s) =
1
s
20
2s +20
K
c
G
c
(s) =2 (0.25s +5) =0.5s+10
Figure 15: Components of the loop gain, faster compensator, slower sensor.
10
1
10
0
10
1
10
2
10
3
60
40
20
0
20
40
G
a
in

d
B
Loop Gain K
c
G
c
(s) G
p
(s) H
y
(s)
10
1
10
0
10
1
10
2
10
3
120
100
80
60
40
20
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Some things to notice:
The Bode plots of the
components look quite
similar,
The bode plot of the loop
gain is quite different
(especially the phase)
Conclusion:
The relative speed of
poles and zeros
matters
Figure 16: Components of the loop gain, combining the plant and sensor.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 22
EE/ME 574: Intermediate Controls Section 2.3.0
2.3 Bode standard form for the loop gain
The loop gain of a linear system can be written in a standard form, called
Bode form:
KG
L
(s) = K
Bode
1
s
no
G

L
(s)
= K
Bode
1
s
no
(
1
s +1) (
2
s +1)
(
a
s +1) (
b
s +1) (s
2
/
2
n
+2s/
n
+1)
(19)
where
KG
L
(s) is the loop gain
K
Bode
is the DC gain of the loop, after poles or zeros at the orgin are
pulled out using the 1/s
no
term
s
no
, n
o
is the number of poles at the origin; n
o
is the system type
G

L
(s) is the transfer function of poles and zeros not at the origin,
scaled so that the DC gain of G

L
(s) is 1.0.

1
,
2
, ...[seconds] are time constants of the (real) zeros

a
,
b
, ...[seconds] are time constants of the (real) poles

n
[radians/second] and [] are the frequency and damping of a
complex pole pair
Eqn (19) is composed of three classes of terms:
1. K
Bode
( j )
no
, a constant term and poles or zeros at the origin
2. ( j +1)
1
, rst order terms
3.
_
_
j
n
_
2
+2
_
j
n
_
+1
_
1
, second order terms.
We will see how each of these terms contributes to a Bode plot.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 23
EE/ME 574: Intermediate Controls Section 2.3.0
Example,
KG
L
(s) = K
c
G
c
(s) G
p
(s) H
y
(s) = 2 (s +5)
1
s
20
s +20
= 2
1
s
20(s +5)
s +20
(20)
1. Pull out any singularities, poles or zeros, at the origin
KG
L
(s) =
1
s
2
20 (s +5)
s +20
, so n
o
= 1
n
o
= 1 indicates there is a pole at the origin.
2. Scale the polynomical terms of G
L
(s) to have constant coefcients of
1.0, putting the loop gain in Bode standard form:
KG
L
(s) = K
Bode
1
s
no
b(s)
a(s)
=
520
20
1
s
_
1
5
s +1
_
1
20
s +1
= 5.0
1
s
_
1
5
s +1
_
_
1
20
s +1
_
3. Identify the time constants
KG
L
(s) = K
Bode
1
s
no
(
1
s +1)
(
a
s +1)
= 5.0
1
s
_
1
5
s +1
_
_
1
20
s +1
_ (21)
which gives
1
=
1
5
[seconds], a =
1
20
[seconds] , K
Bode
=5.0 and no =1
Eqn (21) is the loop gain example (20), expressed in Bode standard form.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 24
EE/ME 574: Intermediate Controls Section 2.3.1
2.3.1 Plotting terms of the form K
Bode
( j )
no
A
This term combines the DC gain with poles or zeros at the origin.
The magnitude curve is a straight line, with a slope of n
o
20 dB / decade
The phase curve is a at line, at an angle of 90n
o
degrees
Examples of K
Bode
( j )
no
:
10
1
10
0
10
1
10
2
10
3
40
20
0
20
40
60
G
a
in
d
B
10
1
10
0
10
1
10
2
10
3
100
80
60
40
20
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
10
1
10
0
10
1
10
2
10
3
60
40
20
0
20
40
G
a
in
d
B
10
1
10
0
10
1
10
2
10
3
0
20
40
60
80
100
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
K
Bode
( j )
no
=12s
1
, n
o
= +1 K
Bode
( j )
no
=0.05s
+1
, n
o
=1
10
1
10
0
10
1
10
2
10
3
10
0
10
20
30
40
G
a
in
d
B
10
1
10
0
10
1
10
2
10
3
50
0
50
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
K
Bode
( j )
no
= 4, n
o
= 0
Figure 17: First term of the loop gain
The most common cases are: n
o
= 0 (Type 0 system)
n
o
= 1 (Type I system)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 25
EE/ME 574: Intermediate Controls Section 2.3.2
2.3.2 Contrasting K
Bode
with K
rlg
Given an example TF
G
L
(s) =
2s +10
4s
2
+3s +8
(22)
we can write the TF in two standard forms:
Bode Form:
KG
L
(s) =K
Bode
1
s
no
(
1
s +1) (
2
s +1)
(
a
s +1) (
b
s +1) (s
2
/
2
n
+2s/
n
+1)
(19, repeated)
For example:
G
L
(s) = K
Bode
1
s
no
G

L
(s) =
10
8
1
s
0
_
1
5
_
s +1
_
1
2
_
s
2
+
_
3
8
_
s +1
(23)
Root Locus Form:
K
rlg
(s z
1
) (s z
2
)
(s p
a
) (s p
b
) (s
2
+2
n
s +
2
n
)
where z
1
=1/
1
, z
2
=1/
2
, p
a
=1/
a
, p
b
=1/
b
, etc. For example:
G
L
(s) = K
rlg
G

L
(s) =
2
4
s +5
s
2
+
_
3
4
_
s +2
(24)
For making bode plots, we use Bode form and determine K
Bode
For determining K from a root-locus plot we use root-locus form and
determine K
rlg
.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 26
EE/ME 574: Intermediate Controls Section 2.3.3
2.3.3 Plotting terms of the form ( j +1) (a real pole or zero)
First-order terms are understood by their asymptotes and the break point
10
1
10
0
10
1
30
20
10
0
10
G
a
in

d
B
Break Point
10
1
10
0
10
1
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Break Point
Figure 18: First-order asymptotes,
a
= 0.5 [seconds].
The rst-order term is
G
1
(s) =
1

a
s +1
=
1
j
a
+1
Low-frequency asymptote, | j
a
| << 1
G
1
(s) =
1
j
a
+1

1
0 j +1
=
1
1
= 10
o
(25)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 27
EE/ME 574: Intermediate Controls Section 2.3.3
First-order term (continued)
10
1
10
0
10
1
30
20
10
0
10
G
a
in

d
B
Break Point
10
1
10
0
10
1
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Break Point
Figure 19: First-order term,
a
= 0.5 [seconds].
High -frequency asymptote, | j
a
| >> 1
G
1
(s) =
1

a
s +1

1
j
a
=
1

a
90
o
(26)
The high-frequency asymptote has
A slope of 1 ,
A phase of 90
o
Intercepts = 1 at 20 log
10
(1/
a
) (shown at triangle)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 28
EE/ME 574: Intermediate Controls Section 2.3.3
Characteristics of the rst-order break point
10
1
10
0
10
1
30
20
10
0
10
G
a
in

d
B
Break Point
10
1
10
0
10
1
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Break Point
Figure 20: First-order term,
a
= 0.5 [seconds].
The break point is at
bp

a
= 1, or
bp
= 1/
a
At the break point:
G
1
(s) =
1
j a +1
=
1
j 1+1
=
1

2
45
o
(27)
The slope of the phase curve at =
bp
gives the phase transition on the
range
=
_
0.2
bp
... 5
bp

(a 25 : 1 range of frequency !)
On the magnitude curve, the break point is down (or up, for a zero)
by 1/

2 or -3 dB
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 29
EE/ME 574: Intermediate Controls Section 2.3.3
A zero has the same characteristics as a pole, but with the opposite sense.
10
0
10
1
10
2
10
3
60
40
20
0
20
40
60
G
a
in

d
B
Intercept
10
0
10
1
10
2
10
3
0
30
60
90
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Break Point
Figure 21: First-order asymptotes,
1
= 0.02 [seconds].
The rst-order term for a zero is:
G
1
(s) = (s
1
+1) (28)
( j
1
+1) has a low-frequency asymptote of 10
o
( j
1
+1) has a high-frequency asymptote of
1
+90
o
The high-frequency asymptote has a slope of +1
The intercept of the high-frequency asymptote is |
1
|
dB
at = 1.0
The break point is at
bp

1
= 1 []
The phase angle at the break point is +45
0
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 30
EE/ME 574: Intermediate Controls Section 2.3.4
2.3.4 Plotting a complex pole or zero pair
Second-order terms are also understood by their asymptotes and break point
10
0
10
1
10
2
40
20
0
20
G
a
in

d
B
Break Point
Intercept
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
180
o
degrees
0
o
degrees
Break Point
Figure 22: Second-order asymptotes,
n
= 4.0 [radians/second], = 0.2 [] .
The second-order term is
G(s) =
1
_
j
n
_
2
+2
_
j
n
_
+1
=
1

_

n
_
2
+2 j
_

n
_
+1
Low-frequency asymptote, | j /
n
| << 1:
G(s)
1
0 j
2
+0 j +1
=
1
1
= 10
o
(29)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 31
EE/ME 574: Intermediate Controls Section 2.3.4
Complex pole pair (continued)
10
0
10
1
10
2
40
20
0
20
G
a
in

d
B
Break Point
Intercept
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
180
o
degrees
0
o
degrees
Break Point
Figure 23: Second-order asymptotes,
n
= 4.0 [radians/second], = 0.2 [] .
High-frequency asymptote | j /
n
| >> 1:
G(s) =
1

_

n
_
2
+2 j
_

n
_
+1

_

n
_
2
=
_

_
2
180
o
(30)
The high-frequency asymptote has
A slope of -2,
A phase of 180
o
Intercepts = 1 at 20 log
10
_

2
n
_
(shown at triangle)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 32
EE/ME 574: Intermediate Controls Section 2.3.4
Characteristics of the second-order break point
10
1
40
20
0
20
G
a
in

d
B
Break Point, 20 log
10
(1/2)
10
1
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Break Point
Figure 24: Second-order break point, detail.
n = 4.0 [radians/second], = 0.2 [] .
The break point is at
bp
/
n
= 1, or
bp
=
n
At the break point:
G(s) =
1
_
j
n
_
2
+2
_
j
n
_
+1
=
1
1+2 j +1
=
1
2 j
=
1
2
90
o
The amplitude at the break point is (this is the resonant peak)
M
r
=
1
2
The phase is 90
o
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 33
EE/ME 574: Intermediate Controls Section 2.3.4
Second order break versus damping factor
10
1
10
0
10
1
40
20
0
20
G
a
in

d
B
rho: 0.02, 0.10, 0.20, 0.40, 0.60, 0.80, 1.00,
rho=1.0
rho=0.02
10
1
10
0
10
1
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
rho=1.0
rho=0.02
Figure 25: Second-order break point, detail.

n
= 1.0 [radians/second], ={0.2}[] .
As damping decreases
The transition region gets narrower
The peak gets higher
What value of corresponds to M
r
= 1.0 ?\SetScrunchOne
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 34
EE/ME 574: Intermediate Controls Section 2.3.5
2.3.5 Summary of Bode plot plotting rules
1. Put the TF in Bode Form
(a) Determine the number of singularities at the origin
(b) Order the poles and zeros in order of ascending frequency
2. Select a frequency range
Cover the poles and zeros of the system
Consider the frequency range of the inputs and outputs of interest
3. Determine the K
Bode
( j )
no
term
4. Plot the magnitude curve
(a) Plot the low-frequency asymptote, which passes through K
Bode
at = 1
.
Low-frequency asymptote slope: no (20 dB / decade)
Often n
o
= 0 or n
o
= 1
(b) Plot the high-frequency asymptote, which passes through K
rlg
at = 1 .
(c) Complete the Magnitude Asymptotes
Go from low frequency to high frequency, putting in break points
Extend the low-frequency asymptote to the next break point
Change the slope by 20dB / decade or 40 dB / decade
Continue through all break points
(d) Sketch the approximate magnitude curve
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 35
EE/ME 574: Intermediate Controls Section 2.3.5
5. Plot the phase curve
(a) Plot the low-frequency phase, =n
o
90
o
for << 1
(b) Plot the high-frequency asymptote, which occurs above the highest
frequency singularity
(c) As a guide, put in 90
o
or 180
o
steps in phase at the break points
(starting with the lowest frequency break point)
() 90 (nm) (31)
where n is the number of poles to the left of , and m is the number of
zeros to the left of .
(d) Setup the width of the phase transitions
First order, transition width:
1
5

bp
... 5
bp
Second Order: transition width depends on damping for 2
nd
order
(wide for heavy damping, narrow for light damping)
(e) Draw the phase curve

Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 36
EE/ME 574: Intermediate Controls Section 2.4.1
2.4 Examples:
2.4.1 Example 1: Sketch the bode plot for KG(s)
KG(s) =
2000 (s +0.5)
s(s +10) (s +50)
(32)
1. Put the TF in Bode form:
KG( j ) = K
Bode
1
s
no
G

L
(s) = 2.0
1
j
( j 2+1)
( j 0.1+1) ( j 0.02+1)
(a) Poles at origin: n
o
= 1
(b) Poles/zeros in order of ascending
bp
:
zeros:
1
= 2.0 [seconds], (
bp
= 0.5 [rad/sec])
poles:
a
= 0.1 [seconds],
b
= 0.02 [seconds],
_

bp
= 10, 50 [rad/sec]
_
2. Select the frequency range
(a) Poles and zeros:
slowest:
1

(1)
bp
= 0.5 [radians/second]
fastest:
b

(b)
bp
= 50 [radians/second]
(b) Choose = [0.01... 1000][radians/second]
3. Determine the K
Bode
( j )
no
term
K
Bode
( j )
no
= 2.0
1
j
, n
o
= 1
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 37
EE/ME 574: Intermediate Controls Section 2.4.1
4. Plot the magnitude curve,
(a) Put in the low-frequency asymptote
lim
sj 0
2.0
1
j
( j 2+1)
( j 0.1+1) ( j 0.02+1)
= 2.0
1
j
Gives a slope of -1, phase of 90
o
, and an intercept ( = 1) of |2.0|
dB
(b) Put in the high-frequency asymptote
lim
sj
2.0
1
j
( j 2+1)
( j 0.1+1) ( j 0.02+1)
2.0
1
j
( j 2)
( j 0.1) ( j 0.02)
=2000
1
( j )
2
Gives slope of -2, phase: 180
o
, and an intercept
( = 1) of 2000 = 66 dB.
(c) Put in the break points
(d) Proceed from low frequency to high frequency
(e) Sketch the magnitude curve
5. Plot the phase curve
(a) Put in =90
o
at low frequency (below 1/5
(1)
bp
)
(b) Put in =180
o
at high frequency (above 5
(b)
bp
)
(c) Put in 90
o
or 180
o
steps
(d) Setup the width of the phase transitions
(e) Draw the phase curve
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 38
EE/ME 574: Intermediate Controls Section 2.4.2
10
2
10
1
10
0
10
1
10
2
10
3
100
50
0
50
G
a
i
n

d
B
10
2
10
1
10
0
10
1
10
2
10
3
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 26: Bode plotting example 1.
KG(s) =
2000 (s +0.5)
s(s +10) (s +50)
= 2.0
1
j
( j 2+1)
( j 0.1+1) ( j 0.02+1)
Break points:

(1)
bp
= 1/
1
= 0.5 ,
(a)
bp
= 1/
a
= 10 ,
(b)
bp
= 1/
b
= 50 , [rad/sec],
Slopes:
-1 0 -1 -2
Phase angles:
90
o
0
o
90
o
180
o
\SetScrunchOne
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 39
EE/ME 574: Intermediate Controls Section 2.4.2
2.4.2 Example 2: Sketch the bode plot for a system with a complex pole pair
KG(s) =
10
s(s
2
+0.4s +4)
1. Put the TF in Bode Form:
KG( j ) = K
Bode
1
s
no
G

L
(s) =
10
4
1
j
1
( j )
2
/4+0.1 j +1
(a) Poles at origin: n
o
= 1
(b) Poles/zeros in ascending order: poles:
(a)
n = 2 [radians/second]
Note: standard forms for a quadratic form:
Monic :
b
1
+b
0
s
2
+2
n
+
2
n
Bode :
1
s
2
/
2
n
+2s/
n
+1
Rectangular :
b
1
+b
0
s
2
+2s +(
2
+
2
)
Poles at : s
1,2
= j
2. Select the frequency range
The only singularity is at n = 2 [radians/second],
choose = [0.1..100] [radians/second]
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 40
EE/ME 574: Intermediate Controls Section 2.4.2
3. Determine the K
Bode
1
( j )
no term
K
Bode
1
( j )
no
= 2.5
1
j
, no = 1
4. Plot the magnitude curve,
(a) Low-frequency asymptote:
Slope of 1, Phase of 90
o
, intercept ( = 1) of |2.5|
dB
(b) High-frequency asymptote:
lim
sj
=
10
4
1
j
1
( j )
2
/4
= 10
1
( j )
3
Slope of 3, Phase of 270
o
, intercept ( = 1) of |10.0|
dB
(c) Put in the break points (
n
= 2.0)
(d) Sketch the magnitude curve
5. Plot the phase curve
(a) Put in =90
o
at low frequency (below
n
)
(b) Put in =270
o
at high frequency (above n)
(c) Put in 180
o
steps at the break point
(d) Setup the width of the phase transitions
(e) Draw the phase curve
KG(s) =
2000 (s +0.5)
s(s +10) (s +50)
= 2.0
1
j
( j 2+1)
( j 0.1+1) ( j 0.02+1)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 41
EE/ME 574: Intermediate Controls Section 2.4.2
10
1
10
0
10
1
10
2
80
60
40
20
0
20
G
a
i
n

d
B
10
1
10
0
10
1
10
2
270
180
90
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 27: Bode plotting example 2.
Break points:

(a)
n = 2.0 [rad/sec],
Slopes:
-1 -3
Phase angles:
90
o
270
o
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 42
EE/ME 574: Intermediate Controls Section 2.5.0
2.5 Steady state errors
When the Loop Gain is in Bode Form, there is a straight-forward way
to determine the steady-state error for step, ramp or constant acceleration
signal.
Starting with the basic block diagram of gure 28
r(t) y(t) +
-
y
s
(t)
K
c
G
c
(s) G
p
(s)
H
y
(s)
e(t)
u(t)
d(t)
v(t)
+
+
Figure 28: Block Diagram of a Basic Loop.
The input-error TF is given as:
T
re
(s) =
1
1+Loop Gain
=
1
1+K
Bode
1
s
no
(1 s+1) (2 s+1)
(a s+1) (b s+1)(s
2
/
2
n
+2s/n+1)
(33)
When we consider the SSE, we take the limit as s 0
e
ss
= lim
s0
sT
re
(s) R(s)
And in the limit, all the terms except K
Bode
1
s
no
go to 1/1
e
ss
= lim
s0
sT
re
(s) R(s) = lim
s0
s
1
1+K
Bode
1
s
no
1
1
R(s)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 43
EE/ME 574: Intermediate Controls Section 2.5.0
If n
o
= 0, (Type 0 system):
e
ss
(step) = lim
s0
sT
re
(s) R(s) = lim
s0
s
1
1+K
Bode
s
0
1
s
= lim
s0
1
1+K
Bode
1
e
ss
(step) =
1
1+K
Bode
If n
o
= 1, (Type I system):
ess (step) = lim
s0
s
1
1+K
Bode
s
1
1
s
= lim
s0
s
s
s +K
Bode
1
s
= lim
s0
s
s +K
Bode
= 0
e
ss
(ramp) = lim
s0
s
1
1+K
Bode
s
1
1
s
2
= lim
s0
s
s
s +K
Bode
1
s
2
= lim
s0
1
s +K
Bode
=
1
K
Bode
e
ss
(ramp) =
1
K
Bode
If n
o
= 2, (Type II system):
e
ss
(step) = lim
s0
s
1
1+K
Bode
s
2
1
s
= lim
s0
s
s
2
s
2
+K
Bode
1
s
= lim
s0
s
2
s
2
+K
Bode
= 0
e
ss
(ramp) = lim
s0
s
1
1+K
Bode
s
2
1
s
2
= lim
s0
s
s
2
s
2
+K
Bode
1
s
2
= lim
s0
s
s
2
+K
Bode
= 0
e
ss
(accel) = lim
s0
s
1
1+K
Bode
s
2
1
s
3
= lim
s0
s
s
2
s
2
+K
Bode
1
s
3
= lim
s0
1
s
2
+K
Bode
2
e
ss
(accel) =
1
K
Bode
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 44
EE/ME 574: Intermediate Controls Section 2.5.1
We come back to the basic SSE table
Type 0 System Type I System Type II System
Step r (t) = 1, t > 0; R(s) =
1
s
1
1+KBode
0 0
Ramp r (t) = t, t > 0; R(s) =
1
s
2

1
KBode
0
Accel r (t) =
1
2
t
2
, t > 0; R(s) =
1
s
3

1
KBode
Table 1: Connection between system type and steady state error.
In each case, the SSE is determined by K
Bode
.
In all cases, K
Bode
determines where the low-frequency asymptote hits
= 1.0 .
2.5.1 Determining K
Bode
and SSE using the Matlab bode() command
If we setup the transfer function in Matlab, we can directly determine K
Bode
Type 0 system: K
Bode
is given by bode(Kc*GL, 0).
For example, considering the block diagram of gure 28 with
K
c
G
c
(s) = 3000
0.1s +1
0.01s +1
, G
p
=
s +0.5
s
2
+60s +500
, H
y
(s) =
1
0.01s +1
The Matlab code is set up with:
>> Gp = tf([1 0.5], [1 60 500])
>> Hy = tf(1, [0.01 1])
>> Gc = tf([0.1 1], [.01 1])
>> Kc = 3000
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 45
EE/ME 574: Intermediate Controls Section 2.5.1
Now K
Bode
is given by:
>> KBode = bode(Kc*Gc*Gp*Hy, 0)
KBode = 3.0000
The steady-state error is given by:
>> SSEstep = 1/(1+KBode)
SSEstep = 0.25
If the system is type I, the situation is a little more complex, the loop gain
goes to innity as s 0 . Considering
K
c
G
c
= 800
0.1s +1
s
(34)
>> Gc = tf([0.1 1], [1 0]); Kc = 800
We see that the loop gain is innity for s = 0.
>> KDC = bode(Kc*Gc*Gp*Hy, 0)
KDC = Inf
Looking to the Bode form
KG
L
(s) = K
c
G
c
(s) G
p
(s) H
y
(s) = K
Bode
s
no
G

L
(s)
with n
o
= 1.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 46
EE/ME 574: Intermediate Controls Section 2.5.1
If we cancel the pole at the origin, the bode() command will give K
Bode
.
>> KBode = bode( tf([1 0], 1), Kc*Gc*Gp*Hy, eps)
KBode = 0.8
Note that the bode() command is evaluating
sK
c
G
c
s=
= s 800
0.1s +1
s
s +0.5
s
2
+60s +500
1
0.01s +1
(35)
where the s in the numerator cancels the s in the denominator. The
bode() command does not make the cancelation, so we evaluate with
=.
For the Type I system
>> SSEramp = 1/KBode
SSEramp = 1.2500
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 47
EE/ME 574: Intermediate Controls Section 2.5.1
If the system is type II, then the Bode form is:
KG
L
(s) = K
Bode
1
s
2
G

L
(s)
We can determine K
Bode
by canceling two poles at the origin. For
example, considering
K
c
G
c
(s) = 800
0.1s +3
s
, G
p
=
s +0.5
s (s
2
+60s +500)
, H
y
(s) =
1
0.01s +1
The system is now type II, so we cancel two poles at the origin in the
bode() command
>> KBode = bode(tf([1 0 0 ], 1) * Kc*Gc*Gp*Hy, eps)
KBode = 2.4000
>> SSEaccel = 1/KBode
SSEaccel = 0.4167
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 48
EE/ME 574: Intermediate Controls Section 2.6.0
2.6 Summary of Frequency Response and the Bode plot
The loop gain is the product of transfer functions of blocks around the loop
The Bode form is a standard way to algebraically arrange the loop gain into
the form
KG
L
(s) = K
Bode
1
s
no
G

L
(s) (36)
where n
o
determines the system type.
We have seen how to sketch the bode plot based on the break points of the
zeros and poles
First order terms introduce a +1 or -1 slope and 90
o
of phase shift
Second order terms introduce a +2 or -2 slope, and 180
o
of phase shift
Computers can accurately draw a Bode plot graph
The importance of sketching lies in the understanding of how changes to
the controller design effect system response.
In the next section we will see how system stability and transient
characteristics can be determined from the Bode plot.
Hendrik Wade Bode, born 1905 in Madison, Wisconsin, died 1982. H. Bode
made several including
Bode plots, 1938
1944, became director of the Mathematical Research Group at Bell
Laboratories
In 1948, President Harry S. Truman awarded Bode the Presidents
Certicate of Merit, in recognition of his remarkable scientic
contributions
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 49
EE/ME 574: Intermediate Controls Section 3.0.0
3 Stability Considerations, Phase and Gain Margins
Two measures of stability that are useful for analysis and design are:
Phase Margin
Gain Margin
These stability measures can be read directly from the Bode plot, and also
engineered to desired values by shaping the frequency response curve.
Engineering the phase and gain margins to desired values is a topic of
controller design, the subject of the next Part.
Here we look at the determination of phase and gain margin from a Bode
plot, and determination of stability.
Consider a general closed-loop TF for a block diagram like gure 29(a).
T
ry
( j ) =
Forward Path Gain
1+KG
L
( j )
(37)
Figure 29(b) presents a simplied loop, which will have the same stability
as that of gure 29(a).
r(t) y(t) +
-
ys(t)
Kc Gc(s) Gp(s)
Hy(s)
e(t) u(t) r(t) y
s
(t) +
-
K G
L
(s)
e(t)
(a) Control loop (b) Simplied control loop with loop gain
Figure 29: Control loop with compensator, plant and sensor.
Using the phase and gain margins (and one additional test), we can
determine the stability of control loop such as gure 29 (a) or (b).
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 50
EE/ME 574: Intermediate Controls Section 3.2.0
3.1 Marginal Stability
A system is marginally stable when poles lie on the s = j axis.
Considering Eqn (37), marginal stability occurs when one or more values of
give:
1+KG
L
( j ) = 0 (38)
The marginal stability condition, Eqn (38) can be re-written:
KG
L
( j ) = 1.0180
o
(39)
Which gives:
|KG
L
( j )| = 1.0 (0dB)
KG
L
( j ) = 180
o
(n360
o
)
If a value of exists satisfying Eqn (39), the system is marginally stable.
3.2 Denitions for phase and gain margin
Cross-over frequency,
c
: Frequency (-ies) at which the magnitude curve
crosses the 0 dB line.
Phase cross-over frequency,
cp
: Frequency (-ies) at which the phase curve
crosses over the 180
o
line
Phase Margin [degrees]: Degree by which the phase curve misses 180
o
at
=
c
PM =(
c
) (180
o
) =(
c
) +180
o
(40)
Gain Margin [dB]: Degree by which the magnitude curve misses 0 dB at
=
cp
GM =20log
10
(KG
L
( j
cp
)) dB (41)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 51
EE/ME 574: Intermediate Controls Section 3.3.0
3.3 Examples, stability, marginal stability and instability
Consider the example system of gure 30, with G
L
(s) as given.
r(t) y
s
(t) +
-
G
L
(s)
e(t)
K
u(t)
G
L
(s) =
s +4
s(s
2
+3s +2)
(42)
Figure 30: Control loop with controller gain K
c
and loop gain G
L
.
0 5 10
0
0.5
1
1.5
Step Response
Time (sec)
A
m
p
litu
d
e
0 5 10
0
0.5
1
1.5
2
Step Response
Time (sec)
A
m
p
litu
d
e
0 5 10
100
50
0
50
100
Step Response
Time (sec)
A
m
p
litu
d
e
Cases:
(a) K = 0.25 : stable
(b) K = 6.00 :
marginally stable
(c) K = 144 : unstable
(a) K = 0.25 (b) K = 6.00 (c) K = 144
Figure 31: Step response of system for three values of K.
Depending on the value of K, the system can be stable, marginally stable or
unstable.
Clearly it is very desirable to know the critical value of K , K = Kcrit , at
which the system transitions from stability to instability.
Knowing that
KG
L
(s) = 1180
o
when K = K
crit
is the basis for determining stability from the Bode plot.
The gain margin and phase margin are simply the distance (in gain and
phase) by which the KGL (s) curve misses the critical point.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 52
EE/ME 574: Intermediate Controls Section 3.3.0
Looking at the Bode plot for the example, with K = 0.25 (stable).
10
1
10
0
10
1
10
2
100
50
0
50
M
a
g

K

G
_
{
L
1
}
Critical Point, |G|=0dB

c
=2.83 [r/s]
10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Critical Point, <G=180,

cp
=0.45 [rad/sec]
Figure 32: Bode plot of G
L
(s), corresponding to K = 1.0 .
Figure 32 shows two special values of ,

c
: Cross-over frequency, where the magnitude |G
L
( j
c
)| = 1.0 .

cp
: Phase cross-over frequency, where G
L
( j
cp
) =180
o
With K = 0.25,
c
<
cp
, and KG
L
(s) does not hit the critical value of
KGL (s) = 1180
o
.
Evaluating KG
L
(s) at the cross-over and phase cross-over frequencies:
KG
L
(s = j
c
) = 1.0120.4
o
KG
L
(s = j
cp
) = 0.0417180
o
At c, the phase lag is not sufcient for marginal stability.
At
cp
, the gain is not sufcient for marginal stability.
This system is not marginally stable.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 53
EE/ME 574: Intermediate Controls Section 3.3.0
Matlabs margin() command draws the bode plot and marks the gain and
phase margins.
%% Build the model, G
L
(s)
>> GL = tf([1 4], [1 3 2 0])
%% Plot the margins
>> margin(0.25*GL)
Results:

c
= 0.448 [rad/sec]

cp
= 2.83 [rad/sec]
PM = 59.6 deg
GM = 27.6 dB
100
50
0
50
M
a
g
n
itu
d
e
(d
B
)
10
2
10
1
10
0
10
1
10
2
225
180
135
90
P
h
a
s
e
(d
e
g
)
Bode Diagram
Gm = 27.6 dB (at 2.83 rad/sec) , Pm = 59.6 deg (at 0.448 rad/sec)
Frequency (rad/sec)
Figure 33: Output of the margin command, showing gain and phase margins.
Now consider all three levels of gain. Increasing K moves only the
magnitude curve, as seen in gure 34.
Changed:
c
and gain and phase
margins
Unchanged:
cp
(where the
gain margin is measured)
10
1
10
0
10
1
10
2
100
50
0
50
100
w
c M
a
g
K
G
L
1


10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
w
cp
K
c
= 0.25
K
c
= 6.00
K
c
=144.00
Figure 34: Bode plot for three levels of gain.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 54
EE/ME 574: Intermediate Controls Section 3.3.0
%% Plot the margins
>> margin(6.00*GL)
System is marginally stable.
Results:

c
= 2.83 [rad/sec]

cp
= 2.83 [rad/sec]
PM = 0 deg
GM = 0 dB
100
50
0
50
100
M
a
g
n
itu
d
e
(d
B
)
10
2
10
1
10
0
10
1
10
2
225
180
135
90
P
h
a
s
e
(d
e
g
)
Bode Diagram
Gm = 0.000207 dB (at 2.83 rad/sec) , Pm = 0.000681 deg (at 2.83 rad/sec)
Frequency (rad/sec)
Figure 35: Output of the margin command, K = 6.00
%% Plot the margins
>> margin(144*GL)
System is unstable.
Results:

c
= 12.2 [rad/sec]
cp = 2.83 [rad/sec]
PM = -4.15 deg
GM = -27.6 dB
50
0
50
100
M
a
g
n
itu
d
e
(d
B
)
10
2
10
1
10
0
10
1
10
2
225
180
135
90
P
h
a
s
e
(d
e
g
)
Bode Diagram
Gm = 27.6 dB (at 2.83 rad/sec) , Pm = 4.15 deg (at 12.2 rad/sec)
Frequency (rad/sec)
Figure 36: Output of the margin command, K = 144.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 55
EE/ME 574: Intermediate Controls Section 3.3.1
3.3.1 A challenge with applying gain and phase margin
The GM and PM critera give us an exact denition of marginal stability,
but do not indicate whether the system is stable for increasing or decreasing
gain.
Dene the level of gain that sets cross-over where = 180
o
(or,
equivalently choose K to give
c
=
cp
, and GM=0 dB, PM=0
o
)
This critical value of K can be called K
crit
Most control loops are low pass lters, with Bode plots that look similar to
gures 32-36, above.
But not all.
For typical systems, the system is stable when K < K
crit
, giving the pattern
of gure 37.
K=0 K increasing
K
crit
stable unstable
Figure 37: Stability and instability versus K. Marginal stability when K = K
crit
In cases with the pattern of gure 37, the system is stable when
KG
L
( j
c
) >180
o
and

KG
L
( j
cp
)

< 0dB .
Giving the standard denitions of phase and gain margin:
GM =

KG
L
( j
cp
)

dB
PM = 180+(
c
)
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 56
EE/ME 574: Intermediate Controls Section 3.3.1
However, other patterns are possible, as seen in gure 38.
(a)
K=0 K increasing
K
crit
stable unstable
(b)
K=0 K increasing
K
crit2
stable
K
crit1
unstable unstable
Figure 38: Stability and instability versus K, alternative possible patterns.
When using the Bode stability criterion, we need to check that the resulting
closed-loop system is stable. We can check stability by examining:
1. The closed-loop poles
2. The step response
3. A root-locus plot
When the regions of stability followan atypical pattern, the Nyquist stability
criterion can be used.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 57
EE/ME 574: Intermediate Controls Section 3.3.2
3.3.2 Example with the pattern of gure 38(a)
Consider a system described by:
GL (s) =
s
2
+8s +16
s
3
(43)
0 5 10
50
0
50
Step Response
Time (sec)
A
m
p
litu
d
e
0 1 2
0
0.5
1
1.5
Step Response
Time (sec)
A
m
p
litu
d
e
0 0.2 0.4
0
0.5
1
1.5
Step Response
Time (sec)
A
m
p
litu
d
e
Cases:
(a) K = 1.00 : unstable
(b) K = 10.0 : stable
(c) K = 100 : stable
(a) K = 1.00 (b) K = 10.0 (c) K = 100
Figure 39: Step response of system for three values of K.
%% Build the model, G
L
(s)
>> GL = tf([1 8 16], [1 0 0 0])
%% Plot the margins
>> margin(1.00*GL)
Results:

c
= 2.90 [rad/sec]

cp
= 4.00 [rad/sec]
PM = -18.1 deg
GM = 6.02 dB
50
0
50
100
M
a
g
n
itu
d
e
(d
B
)
10
1
10
0
10
1
10
2
270
180
90
P
h
a
s
e
(d
e
g
)
Bode Diagram
Gm = 6.02 dB (at 4 rad/sec) , Pm = 18.1 deg (at 2.9 rad/sec)
Frequency (rad/sec)
Figure 40: Output of the margin command, showing gain and phase margins,
system of Eqn (43).
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 58
EE/ME 574: Intermediate Controls Section 3.3.2
3.3.2 Example with the pattern of gure 38(a) (continued)
The example above shows a case where the phase and gain margins are
difcult to interpret.
Cases where the open-loop system is unstable (right-half-plane poles) or
non-minimum phase (right-half-plane zeros) often give rise to complex
frequency response patterns.
The Nyquist stability criterion (Franklin et al., section 6.3) is a frequency
domain tool capable of handling with complex Bode plots.
We will not be studying the Nyquist stability criterion in detail.
It is complex
With modern computer tools such as Matlab, stability questions can be
answered other ways, the Nyquist stability criterion is seldom used.
The Nyquist stability criterion is important for robust control, such as
H

control. Students who take an advanced course in robust control will


encounter the Nyquist stability criterion.
Bode phase and gain margin remain valuable tools
They apply in a straight forward way to most systems
Phase and gain margin give insight into how to engineer controllers to
achieve performance goals
Bode stability results should be validated by an alternative method:
1. Determine the poles
2. Examine the step response of the nal system, or as a function of K ,
as illustrated in gures 31 and 39
3. Examine the root locus
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 59
EE/ME 574: Intermediate Controls Section 3.4.0
3.4 Interpreting Phase and Gain Margin
For typical systems, a positive PM and GM indicate a stable system.
For example, for the TF given we nd the bode plot and margins of g. 41.
GL (s) =
s +3
s
3
+1.4s
2
+1.44s +1.04
40
30
20
10
0
10
20
M
a
g
n
itu
d
e
(d
B
)
10
1
10
0
10
1
225
180
135
90
45
0
P
h
a
s
e
(d
e
g
)
Bode Diagram
Gm = 4.27 dB (at 1.43 rad/sec) , Pm = 8.28 deg (at 1.64 rad/sec)
Frequency (rad/sec)
Figure 41: Bode plot and margins for GL (s).
Interpretations that can be made from the Bode plot and margins are:
The overall shape of the magnitude and phase curves indicate the
qualitative properties of the system.
The gain margin indicates change in gain required before the system
becomes stable/unstable (an aspect of robustness).
The phase margin indicates
The damping, well see how to determine the approximate overshoot
from from the PM
The amount of additional phase lag the control loop can tolerate
before becoming unstable (an aspect of robustness).
In the next part, we will learn a number of additional control system
performance measures that can be determined from the Bode plot.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 60
EE/ME 574: Intermediate Controls Section 4.0.0
4 Summary: Analysis by Frequency Response
For linear systems, a sinusoid input gives an sinusoid output.
The transfer function can be interpreted as a complex-valued gain:

Y = T (s = j )

U
where

Y is the output phasor,



U is the input phasor and T (s = j ).
By evaluating the transfer function as a function of , we can make the Bode
plot.
The Bode plot can also be sketched by hand, by putting together the break
points for each pole and zero.
The bode plot indicates overall characteristics of the system, as well as
specic features that indicate the stability of the system.
Cross-over frequency,
c
Phase cross-over frequency,
cp
Phase margin, PM
Gain margin, GM
Since the standard interpretation of PM and GM does not apply to all
systems, we need to validate results by checking the poles, step response
or root locus of the system.
Bode analysis is a valuable tool, used in conjunction with analysis of the
poles, root locus and other tools.
Part 2: Frequency Response Analysis (Revised: Mar 26, 2013) Page 61
EE/ME 574: Intermediate Controls
Designing Control by Frequency-Response
Contents
1 Performance measures 3
1.1 Speed related performance measures . . . . . . . . . . . . . . . . 4
1.1.1 Bandwidth (
b
) . . . . . . . . . . . . . . . . . . . . . . 5
1.1.2 Cross-over frequency (c) . . . . . . . . . . . . . . . . . 7
1.2 Stability related performance measures . . . . . . . . . . . . . . . 8
1.2.1 Gain Margin, GM and Phase Margin, PM . . . . . . . . . 8
1.3 Accuracy related performance measures . . . . . . . . . . . . . . 11
1.3.1 Steady State Error . . . . . . . . . . . . . . . . . . . . . 11
1.3.2 Disturbance rejection, magnitude E
dist
at frequency
d
. . 12
1.3.3 Tracking Error, E
track
at frequency
t
. . . . . . . . . . . 17
1.3.4 Noise Rejection, T
noise
at frequency
s
. . . . . . . . . . 20
1.4 Connection between
c
,
b
and t
r
. . . . . . . . . . . . . . . . . 22
1.4.1 Table of approximate dominant-mode relationships . . . . 23
1.5 Summary of performance measures and interpretation on the Bode
plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2 Design of frequency compensation 30
2.1 PD compensator . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.1.1 Basics of PD design . . . . . . . . . . . . . . . . . . . . 31
2.2 Phase-lead compensator . . . . . . . . . . . . . . . . . . . . . . 32
2.2.1 Basics of phase-lead design . . . . . . . . . . . . . . . . 33
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 1
EE/ME 574: Intermediate Controls
2.2.2 Phase-lead compensation design procedure (Franklin,
section 6.7.2) . . . . . . . . . . . . . . . . . . . . . . . . 35
2.2.3 Phase-lead design example . . . . . . . . . . . . . . . . . 37
2.3 PI compensator . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.3.1 Basics of PI design . . . . . . . . . . . . . . . . . . . . . 42
2.4 Phase-Lag compensator . . . . . . . . . . . . . . . . . . . . . . . 43
2.4.1 Basics of phase-lag design . . . . . . . . . . . . . . . . . 45
2.4.2 Phase-lag compensation design procedure (see Franklin,
section 6.7.4) . . . . . . . . . . . . . . . . . . . . . . . . 46
2.4.3 Phase-lag design example #1 . . . . . . . . . . . . . . . 47
2.5 PID compensation . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.5.1 Basics of PID design . . . . . . . . . . . . . . . . . . . . 60
2.5.2 Design procedure . . . . . . . . . . . . . . . . . . . . . . 60
2.5.3 Ziegler-Nichols Method 1: Quarter-Cycle Damping
Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.5.4 Ziegler-Nichols Method 2: Ultimate Sensitivity Method . 64
2.5.5 Tyreus-Luyben Tuning Chart (TLC tuning rules) . . . . 67
2.5.6 PID design by frequency response . . . . . . . . . . . . . 68
2.5.7 Realizable form for PD and PID controllers . . . . . . . . 71
2.6 Lead-Lag compensation . . . . . . . . . . . . . . . . . . . . . . 73
2.6.1 Basics of Lead-Lag compensation . . . . . . . . . . . . . 74
3 Summary of frequency-response based
compensator design 75
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 2
EE/ME 574: Intermediate Controls Section 1.0.0
1 Performance measures
Frequency response gives us a distinct way to understand system behavior
Several performance measures are best understood based on the frequency
response.
The complete list of performance measures of interest is repeated in table 1.
The items based on frequency analysis are highlighted, and will be dened
with the aid of examples.
Performance Measure Symbol Domain Evaluated From
Speed:
Rise Time tr Time Step Response or Dominant Mode
Peak Time tp Time Step Response or Dominant Mode
Settling Time ts Time Step Response or Dominant Mode
Pole Locations pi Freq Transfer Function, S-plane
Bandwidth b Freq Closed-loop Freq. Resp.
Cross-over Frequency c Freq Frequency Response
Degree of Stability:
Stable / Unstable TF Transfer Function
Overshoot Mp Time Step Response or Dominant Mode
Damping Factor Freq Dominant Mode
Pole Locations pi Freq Transfer Function, S-plane
Phase Margin PM Freq Frequency Response
Gain Margin GM Freq Frequency Response
Accuracy:
Steady State Error SSE Time Step/Ramp Response or Trans. Fun.
Integrated Squared Error ISE Time Step Response
Integrated Absolute Error IAE Time Step Response
Disturbance Rejection Edist , d Freq Freq Resp, or closed-loop Freq Resp
Tracking Error Etrack, t Freq Freq Resp, or closed-loop Freq Resp
Noise Rejection Tnoise, s Freq Freq Resp, or closed-loop Freq Resp
Table 1: A list of standard performance measures and how they are evaluated.
Highlighted performance measures are based on frequency analysis.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 3
EE/ME 574: Intermediate Controls Section 1.1.0
1.1 Speed related performance measures
From table 1, there are seven performance measures typically evaluated from the
bode plot. We will look at the seven using an example.
The example system is our basic control loop, including a reference input,
disturbance and sensor noise.
Controller
Plant
d(t)
r(t) y(t)
Sensor Dynamics
+
-
+
+
+
+
vs(t)
ys(t)
KcGc(s)
Gp(s)
Hy(s)
e(t) u1(t) u2(t)
disturbance
sensor
noise
Figure 1: Basic control loop.
The example transfer function is:
G
p1
(s)
s +10
s (s
2
+5s +4)
=
s +10
s (s +1) (s +4)
(1)
in Bode form:
G
p1
(s) =
10
4
s
1
_
1
10
s +1
_
(s +1)
_
1
4
s +1
_ (2)
For our examples will use
H
y
(s) = 1.0 (3)
which is included for completeness.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 4
EE/ME 574: Intermediate Controls Section 1.1.1
The Bode plot of G
p1
(s) is seen in gure 2.
10
1
10
0
10
1
10
2
80
60
40
20
0
20
40
G
a
in

d
B
10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 2: Bode plot of G
p1
(s) (open loop).
1.1.1 Bandwidth (
b
)
The rst performance measure is actually measured from the closed-loop
frequency-response plot.

b
is the lowest frequency at which the magnitude of the closed-loop
transfer function equals (
1

2
) T
ry
(s = j 0), where T
ry
(s = j 0) is the
DC gain of the closed-loop system .

T
ry
( j
b
)

=
_
1

2
_

T
ry
(0)

(4)
Equivalently: the bandwidth is the frequency at which the magnitude
of the closed-loop frequency-response plot as dropped of by 3 dB.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 5
EE/ME 574: Intermediate Controls Section 1.1.2
Example of bandwidth, taking K
c
G
c
(s) = 1.0
10
1
10
0
10
1
10
2
80
60
40
20
0
20
G
a
in

d
B
Determines Bandwidth

b
10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Try (s) =
K
c
G
c
G
p
1+Kc Gc Gp Hy
(5)
>> Gp = tf([1 10], [1 5 4]);
>> Gc = tf(1, 1); Hy = tf(1,1)
>> Try = ...
feedback(Gc*Gp*Hy, 1);
>> bode(Try);
>> Wb = bandwidth(Try);

b
= 2.12 [rad/sec]
Figure 3: Frequency-response plot of T
ry
(s) (closed loop).
Notice the difference between the frequency-response plot of gures 2
and 3.
1. At low frequency, the loop gain, G
p1
(s), is large with 90
o
, but
the closed-loop TF, T
ry
(s), is about 1.0 with 0
o
2. At high frequencies the two curves are very comparable
These two statements reveal basic facts about feedback control:
Within the bandwidth of the closed-loop system, feedback gives the
system very nice behavior (T
ry
(s) 1.00
o
)
Outside the bandwidth, feedback does not signicantly change the
response
Bandwidth,
b
, is commonly used to specify the speed of a system.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 6
EE/ME 574: Intermediate Controls Section 1.1.2
1.1.2 Cross-over frequency (
c
)
We have already seen cross-over frequency when considering the phase margin.

c
is the frequency at which the Bode magnitude curve rst crosses 0 dB.
If the magnitude curve crosses 0 dB several times,
For phase margin, they must all be considered
For performance specication, the lowest frequency of crossing is
taken as
c
10
1
10
0
10
1
10
2
80
60
40
20
0
20
40
G
a
in

d
B
Crossover
10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]

c
= 1.39 [rad/sec]
Figure 4: Bode plot of G
p1
(s) (open loop).
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 7
EE/ME 574: Intermediate Controls Section 1.2.1
1.2 Stability related performance measures
1.2.1 Gain Margin, GM and Phase Margin, PM
We have already seen phase and gain margin. These are determined
on the Bode plot, which is to say the frequency-response plot of the
loop gain (open loop).
10
1
10
0
10
1
10
2
80
60
40
20
0
20
40
G
a
in

d
B
Gain Margin 12.0 dB

c
10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Phase Margin 24.4 deg

cp

c
= 1.39 [rad/sec]

cp
= 2.83 [rad/sec]
Figure 5: Bode plot of G
p1
(s) (open loop).
Note: Generally (but not always)
c
<
cp
for a stable system.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 8
EE/ME 574: Intermediate Controls Section 1.2.1
The phase margin is also connected to closed-loop damping. Consider the
2
nd
order system (see Franklin 5
th
ed. Eqn (6.31) and gures 6.34-6.36)
G
p2
(s) =

2
n
s (s +2
n
)
(6)
When we set up G
p2
(s) with the feedback H
y
(s) = 1.0, K
c
G
c
(s) = 1.0 , we
get the closed-loop transfer function
T
ry
(s) =

2
n
s
2
+2
n
s +
2
n
(7)
For this particular case, the phase margin can be solved explicitly and comes
out to be:
PM = tan
1
_

_
2
_
_
1+4
4
2
_

_ (8)
By evaluating the derivative of Eqn (8) an the approximate relation between
PM and damping is seen to be:

PM
100
(9)
0 10 20 30 40 50 60 70 80
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
D
a
m
p
in
g

r
a
t
io
,

Phase Margin [deg]


vs PM
Approximation
Figure 6: Damping ratio vs. phase margin, for a system with 2 poles and no zeros.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 9
EE/ME 574: Intermediate Controls Section 1.2.1
Another view that shows the relationship between phase margin and
damping is given by evaluating
M
p
= e

(1
2
)
(10)
where 100M
p
is the percent overshoot.
0 10 20 30 40 50 60 70 80 90
0
10
20
30
40
50
60
70
80
90
100
P
e
r
c
e
n
t

O
v
e
r
s
h
o
o
t
,

1
0
0
*
M
p
Phase Margin [deg]
Figure 7: Phase margin vs percent overshoot, for a system with 2 poles and no
zeros.
Note that Eqns (8) - (10) and gures 6 and 7 are all based on the 2-pole
no-zero system.
These approximations show that damping and overshoot are strongly linked
to phase margin
PM and damping factor are both approximate indicators of overshoot,
We must check the actual step response to assure that an overshoot
specication is met.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 10
EE/ME 574: Intermediate Controls Section 1.3.1
1.3 Accuracy related performance measures
1.3.1 Steady State Error
The steady state error is determined by the system type and K
Bode
.
We can read both directly off the Bode plot, as illustrated in g 8.
We see a slope of -1 in low-frequency range, so the system is type I
The DC gain is 8.0 dB (2.5)
K
Bode
is where the low freq. asymptote hits = 1.0 [rad/sec]
Therefore, the steady state error is:
SSE (step) = 0
SSE(ramp) =
1
2.5
= 0.4
10
1
10
0
10
1
40
20
0
20
40
G
a
in

d
B
DC Gain
Lowfreq asymptote
10
1
10
0
10
1
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 8: Bode plot of G
p1
(s) , showing low-frequency asymptote and DC gain.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 11
EE/ME 574: Intermediate Controls Section 1.3.2
1.3.2 Disturbance rejection, magnitude E
dist
at frequency
d
Many closed-loop systems operate with disturbances. For these systems, it is
often necessary to specify the maximum inuence the disturbance can have on
the output. Dening the disturbance transfer function as
T
dy
(s) =
Y (s)
D(s)
=
G
p
(s)
1+K
c
G
c
(s) G
P
(s) H
y
(s)
(11)
A disturbance rejection specication of E
dist
at frequency
d
species:
The magnitude of the disturbance transfer function T
dy
(s) will
not be greater than E
dist
at any frequency at or below
d
. Or,
mathematically

T
dy
( j )

E
dist

d
(12)
For example, if we combine PID control with G
p1
(s),
K
c
G
c
(s) =
k
d
s
2
+k
p
s +k
I
s
= 1.5
s
2
+2.4s +2.44
s
(13)
The transfer function is given as
T
ry
(s) =
K
c
G
c
G
p
1+K
c
G
c
G
P
H
y
=
1.5s
3
+18.6s
2
+39.66s +36.6
s
4
+6.5s
3
+22.6s
2
+39.66s +36.6
And the disturbance transfer function is given as:
T
dy
(s) =
G
p
1+K
c
G
c
G
P
H
y
=
s
2
+10s
s
4
+6.5s
3
+22.6s
2
+39.66s +36.6
(14)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 12
EE/ME 574: Intermediate Controls Section 1.3.2
1.3.2 Disturbance rejection, magnitude E
dist
at frequency
d
(continued)
For example, T
dy
(s) is plotted in gure 9. The frequency-response plot
shows that the closed-loop system meets a requirement of:
E
dist
=20dB ,
d
= 0.3 [rad/sec]
>> Tdy = feedback(Gp, -Hy*Kc*Gc)
>> bode(Tdy)
10
1
10
0
10
1
10
2
80
60
40
20
0
G
a
in

d
B
Dist. Rej.
10
1
10
0
10
1
10
2
180
90
0
90
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 9: Disturbance transfer function, T
dy
(s)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 13
EE/ME 574: Intermediate Controls Section 1.3.2
Figure 10 shows that the system also meets a specication of
E
dist
=25dB ,
d
= 0.2 [rad/sec]
Note that only the magnitude curve is needed to evaluate disturbance
response.
10
1
10
0
10
1
10
2
80
60
40
20
0
Frequency [radians/second]
G
a
in

d
B
Figure 10: Disturbance transfer function, T
dy
(s)
Figure 11 shows that the system does not meet a specication of
E
dist
=25dB ,
d
= 0.3 [rad/sec]
10
1
10
0
10
1
10
2
80
60
40
20
0
Frequency [radians/second]
G
a
in

d
B
Figure 11: Disturbance transfer function, T
dy
(s)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 14
EE/ME 574: Intermediate Controls Section 1.3.2
Considering the two transfer functions:
Input Output : Try (s) =
K
c
G
c
G
p
1+Kc Gc Gp Hy
Disturbance : T
dy(s)
=
G
p
1+K
c
G
c
G
P
H
y
we see that the disturbance transfer function is given as
T
dy
(s) =
1
K
c
G
c
(s)
T
ry
(s) (15)
Eqn (15) can be understood by considering the general characteristics of
closed-loop systems.
In most cases T
ry
(s) 1.00
o
for <<
b
. For example, T
ry
(s) for the
plant of gure 3 and controller of Eqn (13) is seen in gure 12
10
1
10
0
10
1
10
2
40
20
0
20
G
a
in

d
B
10
1
10
0
10
1
10
2
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 12: Closed-loop transfer function, T
ry
(s) , plant with controller (13).
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 15
EE/ME 574: Intermediate Controls Section 1.3.2
Since
T
dy
(s) =
1
Kc Gc (s)
Try (s) and Try (s) 1.00
o
<<
b
Additionally,
d
<<
b
, since, very reasonably, the closed loop can
only compensate for disturbances at frequencies well below the closed-
loop bandwidth.
And nally, in most cases, the controller has relatively high gain at low
frequencies (this improves accuracy). The Bode plot of K
c
G
c
(s) is seen
in gure 13.
10
1
10
0
10
1
0
10
20
30
40
G
a
in

d
B
10
1
10
0
10
1
90
60
30
0
30
60
90
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 13: Gain of the controller K
c
G
c
(s) , Eqn (13), for a PID controller.
Putting these facts together, we nd:
T
dy
(s)
1
K
c
G
c
(s)
s=j , <b
(16)
For good disturbance rejection, we want a large controller gain !
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 16
EE/ME 574: Intermediate Controls Section 1.3.3
1.3.3 Tracking Error, E
track
at frequency
t
A tracking error specication refers to accurately tracking input signals of
any frequency up to a specied frequency.
for 0
t
, 100|T
re
( j )| E
track
%
For the basic system of gure 1, the error response transfer function is:
T
re
(s) =
E ( j )
R( j )
=
1
1+K
c
G
c
G
p
H
y
(17)
We can plot the frequency-response of T
re
(s). For example,
The example system (Eqns (1) and (13)) gives the tracking error
frequency response of gure 14.
10
1
10
0
10
1
10
2
80
60
40
20
0
G
a
in

d
B
10
1
10
0
10
1
10
2
360
270
180
90
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Meets:
E
track
1%,

t
= 0.3 [r/s]
Figure 14: Error response transfer function for the example system (closed-loop).
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 17
EE/ME 574: Intermediate Controls Section 1.3.3
The example system (gure 14) meets the requirement
E
track
= 1
%
, t = 0.3 [radians/second] (note: 1% = -40 dB)
This means that for any input signal
r (t) = Acos(t +)
the output will track the input with an error of less than 1%, for <
t
.
Accurate tracking requires
T
re
(s) =
1
1+K
c
G
c
G
p
H
y
<< 1 (18)
so
K
c
G
c
G
p
H
y
= KG
L
(s) >> 1 for
t
When |KG
L
(s)| >> 1 , tracking error can be approximated by:
T
re
(s)
1
KG
L
(s)
(19)
so even though tracking is a closed-loop property, we can read the
approximate tracking error directly off the Bode plot.
For example,
For a tracking error 2%,
We require |KG
L
( j
t
)| 50. And 50x = 34 dB
To track a signal with less than 2% error, the loop gain must be greater
than 34 dB at
t
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 18
EE/ME 574: Intermediate Controls Section 1.3.3
The bode plot for the example system with PID controller (Eqns (1) and
(13)) is shown in gure 16.
The system can meet tracking requirement up to
t
= 0.4 [rad/sec]
10
1
10
0
10
1
10
2
40
20
0
20
40
60
G
a
in

d
B
Bode plot, Gp1, with PID control
T
r
a
c
k
in
g

E
r
r
o
r

c
10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 15: Loop gain (Bode plot) for the example system, Eqn (1) with example
PID control, Eqn (13).
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 19
EE/ME 574: Intermediate Controls Section 1.3.4
1.3.4 Noise Rejection, T
noise
at frequency
s
Consider the noise response transfer function:
T
vy
(s) =
K
c
G
c
G
p
H
y
1+K
c
G
c
G
p
H
y
=
KG
L
(s)
1+KG
L
(s)
(20)
We would like the noise contribution to the output to be small
At low frequency, <
b
, where |KGL (s)| >> 1
T
vy
1.0180
o
(21)
there is nothing we can do (except buy a better sensor)
At high frequency, >>
b
, we can have low sensor-noise sensitivity by
having
|KGL (s)| << 1 for >>
b
which gives
T
vy
(s) KG
L
(s)
Some sensors (e.g., a tachometer) may have considerable noise at
frequencies higher than the closed-loop bandwidth of the system
So noise rejection in the control loop is important
A noise-gain specication requires that the closed-loop gain of the system
be below some level T
noise
for all frequencies above a specied frequency
s.
for
s
,

T
vy
( j )

T
noise
(22)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 20
EE/ME 574: Intermediate Controls Section 1.3.4
We can form the closed-loop TF T
vy
(s) and plot the frequency response.
For design, it is more useful to consider the Bode plot.
Since |KG
L
(s)| << 1 in the region of interest
T
vy
(s) =
KGL (s)
1+KG
L
(s)

KGL (s)
1
=KG
L
(s)
For >>
b
, the noise gain is approximately the loop gain.
10
1
10
0
10
1
10
2
40
20
0
20
40
60
G
a
in

d
B
N
o
is
e

R
e
je
c
t
io
n
Tnoise

c
10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 16: Loop gain for the example system, Eqn (1) with example PID control,
Eqn (13). Noise rejection plotted.
We meet the sensor noise specication if:

s

T
vy
(s)

T
noise
(23)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 21
EE/ME 574: Intermediate Controls Section 1.4.0
1.4 Connection between
c
,
b
and t
r
These speed characteristics are closely linked:
1. Cross-over frequency,
c
2. Bandwidth,
b
3. Rise time, t
r
For design, it will be useful to consider the connection, so we can see how
to adjust one in order to achieve performance goals in another
The cross-over frequency is dened by a property of the loop gain

c
: |KG
L
( j
c
)| = 1.0 (24)
The bandwidth is dened by a property of the closed-loop transfer function

b
:

T
ry
( j
b
)

=
1

2
T
ry
( j 0) , with T
ry
( j ) =
K
c
G
c
( j ) G
p
( j )
1+KGL ( j )
(25)
Eqn (25) holds at a frequency where KGL ( j ) 1/

2 (not exactly,
because of the complex values in the denominator)
Since the magnitude curve typically trends downward in the region of cross-
over, with a slope between -1 and -1.5 , we nd that
The bandwidth will always be somewhat greater than the cross-over
frequency
We can often use the approximation

2
c
(26)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 22
EE/ME 574: Intermediate Controls Section 1.4.1
Similarly, we can approximate the 10%-90% rise time as:
t
r

1.8

c
(27)
The main point is that if we increase the speed in one measure (such as
c
,
for frequency-domain design), then the speed in all measures (such as
b
or
tr) will increase.
1.4.1 Table of approximate dominant-mode relationships
Approx. Expression Notes
P.O P.O.=100e

1
2
From dominant mode
PM
PM
100
From dominant mode, and
G
L
(s) =
b
s(s+a)

b

b

2
c
From dominant mode, and
G
L
(s) =
b
s(s+a)

n

n

c
_
1+
_
PM
100
_
2
_
From dominant mode,
G
L
(s) =
b
s(s+a)
, numerical study

n

n

b
Close with = 0.7, else approx.
(Franklin et al. sect. 6.1)

n
t
r
t
r

1.8
n

2
b

2
c
From dominant mode
PM,
c

=
n
_
1
2

c
Connecting approximations
t
p
t
p
=


c
From dominant mode

c
, PM
t
s
t
s
=
4

=
4
n

4
c (
PM
100
)
Connecting approximations
Table 2: Table of approximations linking PM and
c
to , P.O.,
b
,
n
, t
r
and t
s
.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 23
EE/ME 574: Intermediate Controls Section 1.5.0
1.5 Summary of performance measures and interpretation on
the Bode plot
The Bode plot of the loop gain shows us 3 regions:
Region I: low-frequency, the magnitude curve shape in this region will
determine the accuracy:
* SSE , * Tracking accuracy , * Disturbance rejection
Region II: cross-over,
the cross-over frequency,
c
determines the speed of the system,
phase curve in this region determines the phase margin and the
stability of the system
Region III: high frequency, there is little useful performance in this
region,
The roll-off of the gain limits noise sensitivity
10
2
10
1
10
0
10
1
10
2
50
0
50
G
a
in

d
B
Region I
(Accuracy)
Region II
(Speed/Damping)
Region III
(Rolloff)
10
2
10
1
10
0
10
1
10
2
180
90
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
G
p
(s) =
1
s
2
+s +0.1
H
y
(s) =
1
s +50
Figure 17: Three regions for consideration of design specications
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 24
EE/ME 574: Intermediate Controls Section 1.5.0
Often in controller design we have three big goals and one minor goal
Big goals:
1. Achieve sufcient accuracy.
That is, get good low-frequency gain. (Region I)
2. Achieve sufcient speed.
That is, get sufcient
c
. (Region II)
3. Achieve sufcient damping.
That is, get good phase margin. (Region II)
Minor goal:
1. Achieve sufcient roll-off at high frequency. Dont amplify noise, if
present.
That is, get good roll-off for >
c
. (Region III)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 25
EE/ME 574: Intermediate Controls Section 1.5.0
Example 1: Boost the gain in Region I, to improve accuracy
Put in a compensator with high gain at low frequencies
Extra slope on the the gain curve increases phase lag at low frequencies
If the frequency range of added gain is well below c, the damage to
phase margin is not too bad.
10
2
10
1
10
0
10
1
10
2
20
10
0
10
20
G
a
in

d
B
Region I
(Accuracy)
10
2
10
1
10
0
10
1
10
2
80
60
40
20
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Added Phase Lag
Phase lag:
Kc Gc (s) = Kc
s +1
s +1
> 1
Example: = 10
K
c
G
c
(s) = 10
10s +1
100s +1
Figure 18: Bode plot of compensator with high gain in Region I (phase-lag)
10
2
10
1
10
0
10
1
10
2
50
0
50
G
a
in
d
B
Region I
(Accuracy)
10
2
10
1
10
0
10
1
10
2
180
90
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Added Phase Lag
- -: Original system
: With phase-lag
compensation
Figure 19: Improve performance by boosting low-frequency gain.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 26
EE/ME 574: Intermediate Controls Section 1.5.0
Example 2: Add positive phase (phase lead) in the region of cross-over
Put in a compensator with phase lead around
c
This example set up to leave speed unchanged
Big boost in phase lead (recall PM/100 )
10
2
10
1
10
0
10
1
10
2
20
10
0
10
20
30
G
a
in

d
B
Boosts HF gain
10
2
10
1
10
0
10
1
10
2
0
20
40
60
80
100
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Added Phase Lead
At crossover
Phase lead:
K
c
G
c
(s) = K
c
s +1
s +1
< 1
Example: = 0.1
K
c
G
c
(s) =0.316
4s +1
0.4s +1
Figure 20: Bode plot of compensator with phase lead in Region II (phase-lead)
10
2
10
1
10
0
10
1
10
2
50
0
50
G
a
in

d
B
Region II
(Speed/Damping)
10
2
10
1
10
0
10
1
10
2
180
90
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Added Phase Lead
- -: Original system
: With phase-lead
compensation
Figure 21: Improve performance by boosting low-frequency gain.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 27
EE/ME 574: Intermediate Controls Section 1.5.0
Example 3: Add phase lead to push out the cross-over frequency
Put in a compensator to support the phase angle at the new
c
Adjust K
c
to move up
c
10
2
10
1
10
0
10
1
10
2
0
20
40
60
G
a
in

d
B
Boosts HF gain
10
2
10
1
10
0
10
1
10
2
0
20
40
60
80
100
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Added Phase Lead
At new crossover
K
c
G
c
(s) = 30
0.3s +1
0.03s +1
Figure 22: Bode plot of compensator with phase lead in Region II (phase-lead)
10
2
10
1
10
0
10
1
10
2
50
0
50
G
a
in

d
B
Region II
(Speed/Damping)
Increase speed
10
2
10
1
10
0
10
1
10
2
180
90
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Added Phase Lead
Figure 23: Improve performance by boosting low-frequency gain.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 28
EE/ME 574: Intermediate Controls Section 1.5.0
Basis of controller design:
Compensators re-shape the loop gain
Some compensators boost gain (improve accuracy)
These compensators will add phase lag
Generally the frequency range has to be low enough that the phase lag
does not damage stability
Some compensators boost phase angle (improve damping)
These compensators can be used for
1. Improve phase margin at the existing cross-over
No change to gain
2. Increase the frequency of cross-over
Increased gain
Trade-offs can be made by adjusting the frequency or gain of compensation
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 29
EE/ME 574: Intermediate Controls Section 2.0.0
2 Design of frequency compensation
To approach compensator design we will
1. Review standard compensators and their properties
2. Consider examples of compensator design
Standard compensators
There are four basic standard compensators
1. Proportional-Derivative (PD)
2. Phase-lead
3. Proportional-Integral (PI)
4. Phase-lag
These can be combined into larger units. Common examples are
1. Proportional-Integral-Derivative (PID)
The most common type of controller, K. Astrm estimates that 80% of
series compensators are PID
2. Lag-lead compensation
3. Double phase lead
4. Double phase lag
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 30
EE/ME 574: Intermediate Controls Section 2.1.1
2.1 PD compensator
u(t) = k
d
e(t) +k
p
e(t) (28)
K
c
G
c
(s) = k
d
s +k
p
= K
c
(
D
s +1) (29)
so: K
c
= k
p
,
D
= k
d
/k
p
4 3.5 3 2.5 2 1.5 1 0.5 0 0.5
0.2
0.15
0.1
0.05
0
0.05
0.1
0.15
0.2
real
im
a
g
1/
D
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
10
2
10
1
10
0
10
1
10
2
10
0
10
20
30
40
50
G
a
in
d
B
10
2
10
1
10
0
10
1
10
2
0
30
60
90
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Phase Lead
Figure 24: PD Compensator
The PD compensator puts a zero in the transfer function.
At the frequency of the zero, the PD compensator introduces phase lead
2.1.1 Basics of PD design
Use the phase lead to improve stability and/or increase the speed of the
closed loop
Cross-over should occur where the compensator gives a reasonable amount
of phase lead
(at or above 3 [rad/sec] in the gure)
The increasing gain with increasing frequency is not helpful
(increased gain in Region III does no good at all)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 31
EE/ME 574: Intermediate Controls Section 2.2.0
2.2 Phase-lead compensator
K
c
G
c
(s) = K
c
(s +1)
(s +1)
, < 1, : [seconds] , : [] (30)
6 5 4 3 2 1 0 1
0.4
0.3
0.2
0.1
0
0.1
0.2
0.3
0.4
real
im
a
g
1/() 1/
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
10
2
10
1
10
0
10
1
10
2
0
10
20
30
G
a
in
d
B
10
2
10
1
10
0
10
1
10
2
0
30
60
90
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Zero Pole
Figure 25: Phase Lead Compensator
The phase lead compensator puts a zero and a pole in the transfer function.
zero: s =1/ , pole: s =1/ , < 1
The phase is concentrated at the center frequency between the zero and pole.
The phase-lead compensator is basically a PD compensator with a pole
above the cross-over frequency to limit the high-frequency gain
Since high-frequency gain is rarely desirable, phase-lead is nearly always
more desirable than PD
Phase lead has 1 more parameter, and the designer has to take care to
place
c
in the center of the phase-lead region
This makes phase-lead a bit trickier than PD, and perhaps less robust
than PD.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 32
EE/ME 574: Intermediate Controls Section 2.2.1
2.2.1 Basics of phase-lead design
First we have to understand the role of the parameters and .
determines the separation between the zero and pole.
10
2
10
1
10
0
10
1
10
2
0
10
20
30
G
a
in

d
B
=0.05
=0.2
=0.5
10
2
10
1
10
0
10
1
10
2
0
30
60
90
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
=0.05
=0.2
=0.5
K
c
G
c
(s) =K
c
(s +1)
(s +1)
< 1
For these plots,
= 1/

Figure 26: Phase Lead Compensator, determines the amount of phase lead.
We need to determine the relationship between and the phase lead
And we need to know the frequency of the peak phase lead (and set Kc so
that this is the cross-over frequency)
These are derived in Franklin et al. ,
sin
max
=
1
1+
(31)
which gives
=
1sin
max
1+sin
max
(32)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 33
EE/ME 574: Intermediate Controls Section 2.2.1
Eqn (32) is plotted in gure 27.
10
0
10
1
10
2
0
10
20
30
40
50
60
70
80
90
M
a
x
im
u
m
p
h
a
s
e
le
a
d
1 /
: 1 0.1 0.01
Figure 27: Maximum phase increase for lead compensation (adapted from
Franklin et al., 5
th
Ed.)
= 0.1 is a typical value, giving 55
o
of phase lead.

max
, the frequency of maximum phase lead
One thing that must be carefully considered in phase-lead design is to be
sure that cross-over occurs at or near the frequency of maximum phase lead,
that is

max
(33)
Otherwise, the benet of the phase lead is lost.
Looking at gure 26, and considering symmetry,
max
is 1/2 way between
the zero and pole frequencies, on a logarithmic scale. Giving

max
=
1

(34)
Or if we write:
K
c
G
c
(s) = K
c
s +z
s + p
then
max
=
_
|z| |p|
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 34
EE/ME 574: Intermediate Controls Section 2.2.2
2.2.2 Phase-lead compensation design procedure (Franklin, section 6.7.2)
Need to nd K
c
(step 1) , (step 4) and (step 5)
K
c
G
c
(s) = K
c
s +1
s +1
Step 1: Determine where the cross-over frequency,
c
, will fall, and the gain K
c
.
Typically
1. Determine K
c
to meet an accuracy requirement. Shifting the magnitude
curve according to K
c
determines
c
2. A speed requirement determines
c
(such as
c
1/

2
b
). Shifting the
magnitude curve to set c determines Kc
Step 2: Evaluate the phase margin (PM) of Gp (s = j c) using c and Kc
Step 3: Allow an extra margin (about 10
o
), and determine the needed phase lead
to meet the stability requirement.
Step 4: Determine from Eqn (32) or gure 27
Step 5: Set
max
=
c
, nd
=
1

max

[seconds] (35)
This completes the design
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 35
EE/ME 574: Intermediate Controls Section 2.2.2
2.2.2 Phase-lead compensation design procedure (continued)
Step 6: Verify the design
1. Draw the bode plot for the compensated system, verify the phase margin,
tracking accuracy, etc., as needed.
2. Verify that
max

c
, since any mismatch will result in phase lead that
is not utilized
3. Plot the step response of the system, verify overshoot, rise and settling
time, etc., depending on requirements
Step 7: Iterate on the design, make adjustments as needed.
If more speed is required, increase
c
(and
max
)
If more damping is required, reduce and to increase the phase margin
Add a second phase-lead lter (double-lead compensation) if
necessary
If more accuracy is required, consider phase-lag compensation to
increase low-frequency gain.
Specifications
Complete
Design Details
Design (approximate, iterative, intuitive)
Analysis (exact)
Figure 28: The design cycle: an asymmetric loop.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 36
EE/ME 574: Intermediate Controls Section 2.2.3
2.2.3 Phase-lead design example
Consider the plant of gure 17 (repeated here)
10
2
10
1
10
0
10
1
10
2
50
0
50
G
a
in

d
B
Gm = 34.1 dB (at 7.08 rad/sec), Pm = 54.2 deg (at 0.82 rad/sec)
10
2
10
1
10
0
10
1
10
2
180
90
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
G
p
(s) =
1
s
2
+s +0.1
H
y
(s) =
1
0.02s +1
Figure 29: A third order plant
The design specications are:
1. SSE (step) 0.01
2. PO 20%
The steady-state error requirement tells us that we need a low-frequency
gain of at least 99 (100, rounding off)
For a PO of 20% we should have a damping ratio of at least =0.46 , which
suggests PM 46
o
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 37
EE/ME 574: Intermediate Controls Section 2.2.3
Step 1: Determine K
c
and
c
K
c
will be driven by the SSE requirement. To achieve SSE(step) 0.01 we
need a LF gain of 100. The current LF gain is about 10, so we need K
c
=10.
Step 2: K
c
= 10 gives the dashed magnitude of gure 31. And we nd

(1)
c = 3.1 [rad/sec] , PM
(1)
= 14.5
o
where
(1)
c and PM
(1)
are the rst measurements of c and PM.
10
2
10
1
10
0
10
1
10
2
50
0
50
G
a
in

d
B
10
2
10
1
10
0
10
1
10
2
180
90
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 30: G
p
(s) with adequate gain
Step 3: The additional phase lead needed is
PM = 4614.5+10 42
o
where +10
o
have been added to have a little extra margin.
Step 4: Reading off of gure 27, for a phase-boost of 42
o
, we nd 0.16 .
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 38
EE/ME 574: Intermediate Controls Section 2.2.3
Step 5:
(1)
c was found from the Bode plot to be
c
= 3.1
(1)
. To get the greatest
benet from the phase-lead compensation, we need
max

c
. With
max = 1/

, solving for :
=
1

=
1
3.1

0.16
= 0.806 [seconds] (36)
Step 6: Verify the design
>> Gps = tf(1, [1 1 0.1]); Hys = tf(1, [0.02, 1]);
>> Gp1a = series(Gps, Hys); Kc = 10;
>> alpha = 0.16; tau = 0.806;
>> Gc = tf( [tau, 1], [alpha*tau, 1])
>> figure(1), clf
>> margin(Kc*Gc*Gp1a)
150
100
50
0
50
M
a
g
n
itu
d
e
(
d
B
)
10
3
10
2
10
1
10
0
10
1
10
2
10
3
270
180
90
0
P
h
a
s
e
(
d
e
g
)
Bode Diagram
Gm = 16.8 dB (at 19.3 rad/sec) , Pm = 41.8 deg (at 6.27 rad/sec)
Frequency (rad/sec)
Figure 31: K
c
G
c
(s) G
p
(s) for verication.
The phase margin came out a little short. On examination, it is because the
cross-over frequency is not 3.1 [rad/sec] as we planned, but 6.27 [rad/sec].
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 39
EE/ME 574: Intermediate Controls Section 2.2.3
Step 7: Iterating on the design, making adjustments as needed
In this case we want to adjust to center the phase lead on the cross-over
frequency (cf. gure 25)
>> wmax = 6.27
>> tau = 1/(wmax*sqrt(alpha))
tau = 0.3987
>> Gc = tf( [tau, 1], [alpha*tau, 1])
150
100
50
0
50
M
a
g
n
itu
d
e
(
d
B
)
10
3
10
2
10
1
10
0
10
1
10
2
10
3
270
180
90
0
P
h
a
s
e
(
d
e
g
)
Bode Diagram
Gm = 23.1 dB (at 26.2 rad/sec) , Pm = 52.6 deg (at 4.33 rad/sec)
Frequency (rad/sec)
Figure 32: K
c
G
c
(s) G
p
(s) for verication II.
The phase margin comes out right at the target of 52
o
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 40
EE/ME 574: Intermediate Controls Section 2.2.3
Verify that requirements are met
The original specication had a steady state error and PO specications,
Checking the error transfer function Tre(s) = E (s)/R(s)
>> Tre = feedback(1, Kc*Gc*Gp1a)
Transfer function:
0.001276 s^4 + 0.08507 s^3 + 1.084 s^2 + 1.008 s + 0.1
-------------------------------------------------------
0.001276 s^4 + 0.08507 s^3 + 1.084 s^2 + 4.996 s + 10.1
T
re
(s) has a DC gain of 0.1/10.1, so the steady state error
SSE (step) = 0.0099
Checking the step response, we just meet the 20% overshoot requirement
(It is a good thing we put the extra 10
o
of phase margin, recall that
= 0.46 is for a 2
nd
order system)
0 0.5 1 1.5 2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 33: Step response, for verication.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 41
EE/ME 574: Intermediate Controls Section 2.3.1
2.3 PI compensator
u(t) = k
p
e(t) +k
I
Z
t
0
e() d (37)
K
c
G
c
(s) = K
c
(
I
s +1)
s
=
k
p
s +k
i
s
(38)
so: K
c
= k
i
;
I
= k
p
/k
I
1.2 1 0.8 0.6 0.4 0.2 0 0.2
0.06
0.04
0.02
0
0.02
0.04
0.06
real
im
a
g
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
10
2
10
1
10
0
10
1
10
2
10
0
10
20
30
40
50
G
a
in
d
B
High LF Gain
10
2
10
1
10
0
10
1
10
2
90
60
30
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Figure 34: PD Compensator
The PI compensator puts a pole at the origin, and zero determined by
I
Below the frequency of the zero, the PI compensator increases gain, for
improved accuracy
The PI compensator introduces phase lag.
We avoid damaging the phase margin by putting the PI controller well
below =
c
Contrast this with the Phase-Lead compensator, were we deliberately
(and carefully !) setup the dynamics to have effect right at = c.
2.3.1 Basics of PI design
Use the increased gain to improve accuracy at low frequencies
Cross-over should occur above the range of signicant phase lag.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 42
EE/ME 574: Intermediate Controls Section 2.4.0
2.4 Phase-Lag compensator
K
c
G
c
(s) = K
c

(s +1)
(s +1)
, > 1, : [seconds] , : [] (39)
6 5 4 3 2 1 0 1
0.4
0.3
0.2
0.1
0
0.1
0.2
0.3
0.4
real
im
a
g
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
10
2
10
1
10
0
10
1
10
2
10
0
10
20
30
40
G
a
in
d
B
10
2
10
1
10
0
10
1
10
2
90
60
30
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Zero Pole
Figure 35: Phase Lag Compensator
The phase lag compensator puts a pole and a zero in the transfer function.
pole: s =1/ , zero: s =1/ , > 1
The phase-lag compensator boosts the low-frequency gain.
The gain boost occurs over the region between the pole and zero
The magnitude of the gain boost is ( > 1 , for phase lag)
In the region between the pole and zero, the phase lag compensator
introduces phase lag, weve got to place the phase-lag away from
c
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 43
EE/ME 574: Intermediate Controls Section 2.4.0
The phase-lag compensator is basically a PI compensator with a nite pole,
and thus nite DC gain
Certain systems (e.g, with static friction) dont work well with an
integrator in the control loop (that is, a pole at the origin)
Phase-lag compensation can be used
In many cases, a nite gain boost is sufcient
The phase lag has one more parameter that PI control (the speed of the
pole)
Phase-lag design is basically no trickier than PI design, in both cases
we must assure that the zero is well below
c
, to avoid damaging the
phase margin.
The desired gain boost determines the location of the pole.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 44
EE/ME 574: Intermediate Controls Section 2.4.1
2.4.1 Basics of phase-lag design
First we have to understand the role of the parameters and .
determines the separation between the zero and pole.
10
2
10
1
10
0
10
1
10
2
0
10
20
30
G
a
in

d
B
=20
=5
=2
10
2
10
1
10
0
10
1
10
2
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
=20
=5
=2
K
c
G
c
(s) =K
c

(s +1)
(s +1)
> 1
For these plots,
= 1/

Figure 36: Phase Lag Compensator, determines the amount of gain boost and
phase lag.
Aspects to consider:
The relationship between and the LF gain boost: Gain boost =
Phase-lag
The phase lag is substantial up to about 5the zero frequency, so
1

<
1
5

c
(40)
(Recall: the zero frequency is above the pole frequency.)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 45
EE/ME 574: Intermediate Controls Section 2.4.2
2.4.2 Phase-lag compensation design procedure (see Franklin, section 6.7.4)
Step 1: Determine
c
and the open-loop gain K
c
that will meet the phase-margin
requirement without compensation
Step 2: Draw the Bode plot of the uncompensated system with
c
and K
c
from
step 1
Step 3: Choose to meet the low-frequency gain requirement (determined from
an accuracy requirement)
Step 4: Choose the corner frequency = 1/, (the zero frequency of the lag
compensator) to be one octave (2) to one decade (10) below the cross-
over frequency,
c
. That is:
1

<
1
2
c ...
1

<
1
10
c (41)
Step 5: The second corner frequency (the pole location) is then at = 1/.
Step 6: Verify the design
1. Draw the bode plot for the compensated system, verify the phase margin,
tracking accuracy, etc., as needed.
2. Plot the step response of the system, verify overshoot, rise and settling
time, etc., depending on requirements
Step 7: Iterate on the design, make adjustments as needed.
If more speed is required, increase
c
(may require phase-lead
compensation)
If more damping is required, increase the phase margin, either by
reducing the zero frequency (
z
= 1/) or by added a phase-lead
compensator.
If more accuracy is required, increase
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 46
EE/ME 574: Intermediate Controls Section 2.4.3
2.4.3 Phase-lag design example #1
Velocity control of a motor is a common application of PI or phase-lag
compensation.
Consider the plant of gure 37
10
1
10
0
10
1
10
2
10
3
80
60
40
20
0
G
a
in

d
B
10
1
10
0
10
1
10
2
10
3
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Motor and load time
constants:

m
=1.0,
e
=0.05 [sec]
G
p
(s) =
K
m
/b
(
m
s +1) (
e
s +1)
G
p
(s) =
2
(s +1)(0.05s +1)
H
y
(s) =
1
0.02s +1
Figure 37: A motor with velocity control.
With the design goals

b
10 [radians/sec]
PO 10%
Tracking accuracy, E
track
2%,
t
= 0.1 [rad/sec]
U
peak
5.0 [Amps]
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 47
EE/ME 574: Intermediate Controls Section 2.4.3
Phase-lag design example #1 (continued), Design:
The PO suggests a damping factor of 0.6, which suggests a phase
margin of at least PM60
o
.
A blow-up of the Bode plot of G
p
is seen in gure 38
The essential concepts for PI or phase-lag compensation are:
1. The phase margin of the plant should be good enough
2. The compensator boosts the LF gain
10
0
10
1
20
10
0
10
G
a
in

d
B
10
0
10
1
150
140
130
120
110
100
90
80
70
60
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]

c
=7.2 [rad/sec]
Figure 38: Blow-up of Bode plot of motor velocity response.
Figure 38 shows we can achieve a phase margin of 70
o
at
c
=7.2 [rad/sec].
A phase margin of 70
o
gives us a little extra PM

c
= 7.2 [rad/sec] should give a closed-loop bandwidth of

b
10 [rad/sec], which gives us a little extra speed
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 48
EE/ME 574: Intermediate Controls Section 2.4.3
Step 1: Determine
c
and K
c
to meet PM requirement
For
c
= 7.2 [rad/sec], K
c
= +12dB = 4.0
Step 2: Draw the Bode plot of the uncompensated system with
c
and K
c
from
step 1.
10
2
10
1
10
0
10
1
10
2
40
20
0
20
40
G
a
in

d
B
Accuracy Requirement
PM = 69.16 at wcp= 7.36 [rad/sec]
10
2
10
1
10
0
10
1
10
2
270
180
90
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 39: Motor velocity control, K = 4.0 .
Step 3: Choose to meet the LF gain requirement.
For a tracking error less than 2%, we need a gain at
t
= 0.1 [rad/sec] of at
least 50.
The current gain is 18 dB or 8.0,
So we need to increase the gain by 50/8=6.25
Choose = 8 (a little extra)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 49
EE/ME 574: Intermediate Controls Section 2.4.3
Step 4: Choose the zero location
We dont want to add very much phase lag at =
c
, set the compensator
zero a full decade below
c
Choose w
z
= 0.72 [rad/sec] , which gives: = 1/0.72 = 1.39 [sec]
Step 5: The pole is located at
p
= 1/ = 1/(81.39) = 0.090 [rad/sec]
Step 6: Verify the design, recall the requirements

b
10 [radians/sec]
PO 10%
Tracking accuracy, E
track
2%,
t
= 0.1 [rad/sec]
U
peak
5.0 [Amps]
%% Plant Model
>> Gp1a = tf(2, poly([-1 -20 -50])/1000)
%% Compensator
>> Tau = 1.39; Alpha = 8; Kc = 4;
>> Gc1a = tf(Alpha*[Tau 1], [Alpha*Tau, 1])
%% Closed Loop TF
>> Try = feedback( Kc*Gc1a*Gp1a, 1)
Transfer function:
88.9 s + 64
---------------------------------------------------
0.0111 s^4 + 0.790 s^3 + 12.0 s^2 + 101.1 s + 65
>> Bandwidth = bandwidth(Try)
Bandwidth = 12.7847 (CHECK)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 50
EE/ME 574: Intermediate Controls Section 2.4.3
Phase-lag design example #1 (continued)
Examining the step response
>> figure(2), clf
>> step(Try)
>> y = step(Try);
>> PO = 100* (max(y)-y(end))/y(end)
PO = 4.2410 %
0 1 2 3 4 5
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 40: Motor velocity control, closed-loop step response
The step response shows about 4.2% overshoot (CHECK)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 51
EE/ME 574: Intermediate Controls Section 2.4.3
Examine the tracking-error Bode plot,
>> Tre = feedback( 1, Kc*Gc1a*Gp1a); %% R->E TF
>> figure(1), clf
>> bode(Tre)
>> Wt = 0.1; MagE1 = bode(Tre, Wt)
MagE1 = 0.0229
10
2
10
1
10
0
10
1
10
2
40
30
20
10
0
10
G
a
in

d
B
10
2
10
1
10
0
10
1
10
2
30
0
30
60
90
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 41: Motor velocity control, frequency response plot of T
re
(s), the error
response.
Requirement:
E
track
2% at
t
= 0.1 [rad/sec]
Actual performance:
T
re
(s = j
t
) = 0.0229
The requirement is not met !
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 52
EE/ME 574: Intermediate Controls Section 2.4.3
Check the U
peak
>> Tru = feedback( Kc*Gc1a, Gp1a); %% R->U TF
>> figure(2),
>> step(Tru)
>> Upeak = ...
max(step(Tru))
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 42: Motor velocity control, closed-loop step response
Considering all of the performance requirements
Requirement 1
st
iteration 2
nd
iteration 3
rd
iteration

b
10 [rad/sec]
b
= 12.78 [rad/s]

P.O. 10% P.O. = 4.2%

E
track
2%, t = 0.1 [rad/s] E
track
2.29% -
U
peak
5.0 [Amps] U
peak
= 4.03

Table 3: Performance requirements of the motor velocity control example.
Step 7: Iterate on the design, make adjustments as needed.
We have plenty of headroom on
b
, P.O. and U
peak
. We need to improve
E
track
by a small amount.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 53
EE/ME 574: Intermediate Controls Section 2.4.3
Phase-lag design example #1 (continued), 2
nd
iteration
We can increase the LF gain by increasing
But the frequency of the pole is already below
t
= 0.1 [rad/sec]

pole
=
1

= 0.090 [rad/sec]
Additional gain below = 0.1 [rad/sec] does not help us.
Figure 43 shows the bode plot of the compensator,
We are introducing a little additional phase lag at
c
Strategy: increase by a small amount, holding constant
(hold the pole location constant, move up the zero).
We will loose some phase margin, but pick up some low-freq gain
10
2
10
1
10
0
10
1
10
2
10
15
20
25
30
35
G
a
in

d
B
zero
pole
PM = 64.01 at wcp= 7.39 [rad/sec]
10
2
10
1
10
0
10
1
10
2
60
40
20
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 43: Motor velocity control, Bode plot of compensator.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 54
EE/ME 574: Intermediate Controls Section 2.4.3
Phase-lag design example #1 (continued), 2
nd
iteration
%% Compensator 2, move up zero by 10%
>> Tau = 1.38/1.1; Alpha = 8*1.1
>> Gc1b = tf(Alpha*[Tau 1], [Alpha*Tau, 1]);
>> Try = feedback(Kc*Gc1b*Gp1a, 1); %% R->Y TF
>> Tre = feedback(1, Kc*Gc1b*Gp1a); %% R->E TF
>> Tru = feedback(Kc*Gc1b, Gp1a); %% R->U TF
>> Bandwidth2 = bandwidth(Try)
Bandwidth2 = 12.8159
>> y = step(Try); PO2 = 100*(max(y)-y(end)) / y(end)
PO2 = 5.4665
>> u = step(Tru); Upeak2 = max(u)
Upeak2 = 4.0272
>> [MagE2, PhaseE] = bode(Tre, Wt)
MagE2 = 0.0209
Requirement 1
st
iteration 2
nd
iteration 3
rd
iteration
b 10 [rad/sec] b = 12.78 [rad/s]

b = 12.82 [rad/s]

P.O. 10% P.O. = 4.2%

P.O. = 5.5%

Etrack 2%, t = 0.1 [rad/s] Etrack 2.29% - Etrack 2.09% -
Upeak 5.0 [Amps] Upeak = 4.03

Upeak = 4.03

Table 4: Performance requirements of the motor velocity control example.
Close, but not quite there. We lost a little on the PO, but we still have room
to make additional adjustment.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 55
EE/ME 574: Intermediate Controls Section 2.4.3
Phase-lag design example #1 (continued), 3
rd
iteration
%% Compensator 3, move up zero by 20%
>> Tau = 1.35/1.2; Alpha = 8*1.2
>> Gc1b = tf(Alpha*[Tau 1], [Alpha*Tau, 1]);
>> Try = feedback(Kc*Gc1b*Gp1a, 1);
>> Tre = feedback(1, Kc*Gc1b*Gp1a);
>> Tru = feedback(Kc*Gc1b, Gp1a);
>> Bandwidth3 = bandwidth(Try)
Bandwidth3 = 12.8495
>> y = step(Try); PO3 = 100*(max(y)-y(end)) / y(end)
PO3 = 5.6338
>> u = step(Tru); Upeak3 = max(u)
Upeak3 = 4.0311
>> [MagE3, PhaseE] = bode(Tre, Wt)
MagE3 = 0.0192
Requirement 1
st
iteration 2
nd
iteration 3
rd
iteration
b 10 [rad/sec] b = 12.78 [rad/s]

b = 12.82

b = 12.85

P.O. 10% P.O. = 4.2%

P.O. = 5.5%

P.O. = 5.6%

Etrack 2%, t = 0.1 [rad/s] Etrack 2.29% - Etrack 2.09% - Etrack 1.92%

Upeak 5.0 [Amps] Upeak = 4.03

Upeak = 4.03

Upeak = 4.03

Table 5: Performance requirements of the motor velocity control example.
Success ! >> Alpha, Alpha = 9.6000
>> Tau, Tau = 1.1583
>> Gc1b/Alpha
Transfer function: (1.158 s + 1) / (11.12 s + 1)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 56
EE/ME 574: Intermediate Controls Section 2.4.3
Summary, phase-lag design example #1
What suggested phase lag, as opposed to phase lead, or some other
compensator ?
Carrying the design through step 2, and
Seeing that the speed and damping were adequate,and that
The challenging requirement is tracking accuracy
Trying a phase-lead compensation, and seeing problems
(Phase-lead would not be good for this application, try it and see !)
Knowing that motor velocity servos are often PI controllers
Why did it take 3 iterations
There is a 73x frequency spread between
c
and
t
, but it was still a little
difcult to get the needed low-frequency gain boost.
Boost needed at
t
Cant tolerate very much added phase lag at
c
Examine the phase lag put in by the compensator
>> [temp, PhaseGc1c] = bode(Kc*Gc1c, wc2)
PhaseGc1b = -5.9657
G
c
(s) has 6.0
o
of phase at
c
(a bit of damage to the phase margin)
If needed, we could have gotten more low-frequency gain by putting in a
double-lag compensator,
Double lag compensation: 2 lag compensators, with the pole repeated and
the zero repeated.
2x as much low-frequency boost
2x as much damage to the phase margin, may need to increase
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 57
EE/ME 574: Intermediate Controls Section 2.4.3
Design process tips:
Notice the code to evaluate each of the performance criteria
Setup the compensator
%% Compensator 3
>> Tau = 1.39/1.2; Alpha = 8*1.2
>> Gc1c = tf(Alpha*[Tau 1], [Alpha*Tau, 1])
Setup the transfer functions that will be needed
>> Try = feedback(Kc*Gc1c*Gp1a, 1);
>> Tre = feedback(1, Kc*Gc1c*Gp1a);
>> Tru = feedback(Kc*Gc1c, Gp1a);
bandwidth() is a routine I wrote (write needed routines)
>> Bandwidth3 = bandwidth(Try)
Directly evaluate the percent overshoot and U
peak
>> y = step(Try);
>> PO3 = 100*(max(y)-y(end)) / y(end)
>> u = step(Tru);
>> Upeak3 = max(u)
Directly evaluate the error magnitude
>> [MagE3, PhaseE] = bode(Tre, Wt)
Pay careful attention to validation, it is the most important step !
If youre not sure how an adjustment will impact the design, try it !
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 58
EE/ME 574: Intermediate Controls Section 2.5.0
2.5 PID compensation
Proportion-Integral-Derivative compensation combines the elements of PI
and PD control
It is very widely used for motion controllers, in the process industry and in
other applications
u(t) = k
d
e(t) +k
p
e(t) +k
I
Z
t
0
e() d (42)
K
c
G
c
(s) = K
c
_
(
D
s +1)
_
1+
1
s
I
__
=
k
d
s
2
+k
p
s +k
i
s
(43)
3.5 3 2.5 2 1.5 1 0.5 0 0.5
0.2
0.15
0.1
0.05
0
0.05
0.1
0.15
0.2
real
im
a
g
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
10
2
10
1
10
0
10
1
10
2
10
0
10
20
30
40
50
G
a
in
d
BHigh LF Gain
10
2
10
1
10
0
10
1
10
2
90
0
90
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Phase Lead
Figure 44: PID Compensator
The PID compensator puts
A pole at the origin, for high LF gain (and to increase the system type)
Two zeros, at 1/
I
and 1/
D
, for phase lead (and improved damping)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 59
EE/ME 574: Intermediate Controls Section 2.5.2
2.5.1 Basics of PID design
Determine desired cross-over frequency,
c
For example, from a speed requirement
Set the zeros to give good phase lead at
c
Often, the zeros will be set to the same speed:

D
=
I
(44)
Dene
z
= 1/
D
= 1/
I
as the speed of the PID zeros, then the phase
lead is given for several ratios
c
/
z

c
/
z
PID
0.5 37
o
1.0 0
0
2.5 45
o
3.8 60
o
90
o
2.5.2 Design procedure
1. Determine the desired value of cross-over,
c
2. Set
z
, determine
D
,
I
3. Determine K
c
to achieve cross-over at
c
4. Validate
5. Iterate
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 60
EE/ME 574: Intermediate Controls Section 2.5.3
2.5.3 Ziegler-Nichols Method 1: Quarter-Cycle Damping Method
Proposed in 1942 by J.G. Ziegler and N. B. Nichols
Provides a systematic approach when no transfer function is available
Widely used in the process industry (cf. Franklin et al. (5
th
Ed.) sec. 4.4.2).
Also called the Process Reaction Curve Method
The rst Ziegler-Nichols method is based on the open-loop step response of
the system.
This method is suitable for over-damped systems, especially with time
delay (examples: mayonnaise processing, heat or ow in an oil renery)
A typical curve is seen in gure 46. The curve denes three values:
A : Amplitude of response
L : Time Delay[seconds]
: Time constant [seconds]
t
y(t)
A
L=t
d

Process
Reaction
Curve
Approximate transfer
function:
G
p
(s) =
Ae
sL
s +1
Reaction Rate:
R = A/
Figure 45: Typical process reaction curve.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 61
EE/ME 574: Intermediate Controls Section 2.5.3
The form for G
c
(s) for Ziegler and Nichols tuning is:
G
c
(s) = k
p
_
1+
1

I
s
+
D
s
_
= k
p

D
s
2
+s +1/
I
s
(45)
With a series of trials on an analog computer, Ziegler and Nichols
determined the following recommended gain values of table 6.
Recommended Gains
k
p

I

D
P-Control 1/RL
PI-Control 0.9/RL L/0.3
PID-Control 1.2/RL 2L 0.5L
Recall,
Reaction Rate:
R = A/
Table 6: Ziegler-Nichols tuning for PID controller, for quarter-cycle damping.
Example, Quarter-Cycle Damping method
0 1 2 3 4 5 6 7 8 9
0
0.5
1
1.5
2
Step Response
Time (sec)
A
m
p
litu
d
e
G
p2
(s) =
2
(s +1) (0.5s +1) (0.2s +1)
A = 2
L = 0.3 [seconds]
= 2.2 [seconds]
Figure 46: Process reaction curve for G
p2
(s)
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 62
EE/ME 574: Intermediate Controls Section 2.5.4
The calculation gives:
>> A=2; L=0.3; tau = 2.2;
>> R = A/tau R = 0.9091
>> kp = 1.2/(R*L) kp = 4.4000
>> tauI = 2*L tauI = 0.6000
>> tauD = 0.5*L tauD = 0.1500
>> Gc2 = tf(kp*[tauD, 1, 1/tauI], [1 0])
Transfer function: (0.66 s^2 + 4.4 s + 7.333) / s
0 2 4 6 8 10 12 14
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
P
1
P
2
Step Response
Time (sec)
A
m
p
litu
d
e
For Quarter-Cycle Damping:
(P
2
1) =
1
4
(P
1
1) (46)
Figure 47: Closed-loop step response for system tuned by the Quarter-Cycle
Damping method.
The objective is Quarter-Cycle Damping, which means that each
successive peak is reduced to 1/4
th
the amplitude of the previous peak.
In this example, we dont quite get quarter-cycle damping,
But the parameters give a starting point for nal tuning.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 63
EE/ME 574: Intermediate Controls Section 2.5.4
2.5.4 Ziegler-Nichols Method 2: Ultimate Sensitivity Method
The ultimate sensitivity method is based on performing a test in which the
closed-loop system is driven to marginal stability.
Wrap a loop around the process, with proportional gain, as shown in
gure 48.
Increase the gain until marginal stability is reached (gure 49), this
determines two values
K
u
: Ultimate Gain
P
u
: Ultimate Period
K Process
y(t)
r(t) e(t)
Figure 48: Feedback for the ultimate sensitivity method. K
c
is the proprotional
feedback gain.
0 5 10 15 20
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
time [seconds]
y
(
t)
Pu
Figure 49: Output of the system at marginal stability.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 64
EE/ME 574: Intermediate Controls Section 2.5.4
Recommended Gains
k
p

I

D
P-Control 0.5K
u
PI-Control 0.45K
u
P
u
/1.2
PID-Control 0.6K
u
1
2
P
u
1
8
P
u
Table 7: Ziegler-Nichols tuning for PID controller, for ultimate sensitivity
method.
Example, Ultimate Sensitivity Method
Example plant TF:
G
p
(s) =
2
s
2
+2s +5
Test values of gain until marginal sensitivity is reached
0 2 4 6 8 10
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
Kc = 1.0000
Time (sec)
A
m
plitude
0 2 4 6 8 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Kc = 2.0000
Time (sec)
A
m
plitude
0 2 4 6 8 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
Kc = 5.0000
Time (sec)
A
m
plitude
0 2 4 6 8 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
Kc = 6.0000
Time (sec)
A
m
plitude
K
u
= 6
P
u
= 1.533[s]
Figure 50: Step response for K = 1, 2, 5, 6
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 65
EE/ME 574: Intermediate Controls Section 2.5.4
Applying the Ultimate Sensitivity method
>> Ku = 6; Pu = 4.6/3; %% Raw measurements
>> kp = 0.6*Ku %% Determine compensator
>> tauI = Pu/2
>> tauD = Pu/8
>> Gc = kp * tf( [tauD, 1, 1/tauI], [1 0] )
Transfer function:
0.69 s^2 + 4.5 s + 4.696 kd s^2 + kp s + ki
------------------------ = -------------------
s s
>> figure(2), clf %% Plot CL step response
>> step( Gc*Gp2a) ; grid on
0 2 4 6 8 10 12
0
0.5
1
1.5
SSE(step): 0.00
SSE(ramp): 0.11
Step response of system, by ZieglerNichols UC tuning
Time (sec)
A
m
p
litu
d
e
Figure 51: Controller tuned by the Ultimate Sensitivity method.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 66
EE/ME 574: Intermediate Controls Section 2.5.5
2.5.5 Tyreus-Luyben Tuning Chart (TLC tuning rules)
An alternate set of rules due to B.D. Tyreus and W.L. Luyben gives:
Recommended Gains
k
p

I

D
PI-Control K
u
/3.2 2.2P
u
PID-Control K
u
/2.2 2.2P
u
P
u
/6.3
Table 8: Tyreus-Luyben alternate tuning for PID controller. K
u
and P
u
determined as for the ultimate sensitivity method.
Relative to the ultimate sensitivity method, TLC tuning gives:
Slightly lower gain
Slightly longer

s
Will give a slightly slower, more damped response
0 2 4 6 8 10 12
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
SSE(step): 0.00
SSE(ramp): 0.47
Bandwidth: 6.81
Step response of system, by frequency response design
Time (sec)
A
m
p
litu
d
e
Figure 52: Controller tuned by TLC tuning rules.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 67
EE/ME 574: Intermediate Controls Section 2.5.6
2.5.6 PID design by frequency response
The Bode plot for a PID controller with
I
=
D
is seen in gure 53.
10
2
10
1
10
0
10
1
10
2
10
20
30
40
50
60
G
a
in

d
B
High gain for accuracy
in this region
10
2
10
1
10
0
10
1
10
2
90
60
30
0
30
60
90
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Crossover
in this region
Figure 53: PID controller tuned by frequency response.
Frequency response design of PID control comprises two main ideas:
1. Determine cross-over, to get adequate speed and stability
Boosting the phase margin with phase lead, if necessary
2. Boost the low frequency gain, as needed, to meet accuracy requirements
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 68
EE/ME 574: Intermediate Controls Section 2.5.6
2.5.6 PID design by frequency response (continued)
Consider the uncompensated plant, G
p2
(s)
Gp2 (s) =
2
(s +1) (0.5s +1) (0.2s +1)
10
2
10
1
10
0
10
1
10
2
100
50
0
50
G
a
in

d
B
10
2
10
1
10
0
10
1
10
2
270
180
90
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 54: The uncompensated plant, G
p2
(s).
Phase cross-over ( =180
o
) occurs at 4.1 [rad/sec]
With effective phase boost (the phase-lead portion of the PID) we can get
60
o
of phase margin at
c
= 4.0 [rad/sec]
For comparison, the compensation given by Ziegler-Nichols Quarter-Cycle
Damping type tuning is seen gure 47.
ZN tuning gives about 25
o
of phase lead around 4 [rad/sec],
Certainly not as much as possible
90
o
of phase lead would be the maximum possible
This is why the Z-N tuned controller looks lightly damped
Z-N is a coarse tuning, a starting point for ne tuning !
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 69
EE/ME 574: Intermediate Controls Section 2.5.6
2.5.6 PID design by frequency response (continued)
Lets set
c
= 4.1 [rad/sec] (this determines k
p
)
To get good phase margin
Both compensator zeros at
z
=
c
/5 [rad/sec] = 0.8 [rad/sec]

D
=
I
= 1/
z
(47)
Including G
c
(s) in the bode plot, k
p
for
c
= 4.1[rad/sec] comes out to 1.3
Writing the compensator transfer function as:
G
c
(s) = k
p
(
D
s +1) (s +1/
I
)
s
(48)
= k
p
_

D
s
2
+(1+
D
/
I
) s +1/
I
_
s
(49)
We nd
G
c3
(s) = 1.3
1.22s
2
+2s +0.82
s
(50)
0 2 4 6 8 10 12
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
SSE(step): 0.00
SSE(ramp): 0.47
Bandwidth: 6.81
Step response of system, by frequency response design
Time (sec)
A
m
p
litu
d
e
10
2
10
1
10
0
10
1
10
2
50
0
50
G
a
in
d
B
Gm = NaN dB (at NaN rad/sec), Pm = 65.0 deg (at 4.38 rad/sec)
SSE(step): 0.00
SSE(ramp): 0.47
10
2
10
1
10
0
10
1
10
2
180
150
120
90
60
30
0
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Figure 55: Step response (closed-loop) and Bode plot (open-loop), G
c3
G
p2
.
Steady state error for a ramp input is 47%.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 70
EE/ME 574: Intermediate Controls Section 2.5.7
2.5.6 PID design by frequency response (continued)
Study questions, for the previous example
What would we change to increase the bandwidth of the system ?
What would be the side effects ?
What would we change to increase the accuracy of the system ?
What would be the other consequences ?
What would we change to increase the damping of the system ?
What would be the other consequences ?
2.5.7 Realizable form for PD and PID controllers
The transfer function for the PID controller of the last example is
G
c3
(s) = 1.3
1.22s
2
+2s +0.82
s
(51)
A PD controller might have a TF of the form
G
c
(s) = 3s +7 (52)
Neither of these transfer functions is implementable (innite gain at innite
frequency)
>> step(Gc3)
??? Error using ==> ltipack.ltidata.utCheckComputability at 13
Not supported for models with more zeros than poles.
That is, G
c3
(s) is not proper.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 71
EE/ME 574: Intermediate Controls Section 2.5.7
Solution:
To make G
c3
(s) proper, we can add one or several poles at frequencies well
above
c
G
c3
(s) 1.3
1.22s
2
+2s +0.82
s (0.01s +1)
1.3
1.22s
2
+2s +0.82
s (0.01s +1) (0.01s +1) ...
(53)
Gc (s) = 3s +7
3s +7
(0.01s +1)

3s +7
(0.01s +1) (0.01s +1)
... (54)
10
2
10
1
10
0
10
1
10
2
0
10
20
30
40
50
G
a
in

d
B

c
10
2
10
1
10
0
10
1
10
2
90
60
30
0
30
60
90
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 56: An additional pole at s =100 has little inuence near
c
.
Additional poles should be at frequencies well above cross-over
They should be put in so that their low-frequency gain is 1, that is:
1/(0.01s +1)
Not
1/(s +100)
These poles are physical, actual controller devices have nite bandwidth !
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 72
EE/ME 574: Intermediate Controls Section 2.6.0
2.6 Lead-Lag compensation
Lead-lag compensation is like PID compensation, except that:
The low-frequency pole is at nite frequency, not the origin
There is an additional high-frequency pole.
G
c
(s) = K
c

1
(
1
s +1)
(
1

1
s +1)
(
2
s +1)
(
2

2
s +1)
with
lag section:
1
> 1,
lead section:
2
< 1.
25 20 15 10 5 0 5
1.5
1
0.5
0
0.5
1
1.5
real
im
a
g
Phase Lead Portion
Phase Lag Portion
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
10
2
10
1
10
0
10
1
10
2
0
10
20
30
40
G
a
in
d
B
High gain for
accuracy in
this region
10
2
10
1
10
0
10
1
10
2
90
60
30
0
30
60
90
Frequency [radians/second]
P
h
a
s
e
[d
e
g
]
Crossover
in this region
Figure 57: Phase Lag Compensator
%% Example Lead-Lag Compensation
>> Alpha1 = 20 Tau1 = 2 %% Lag portion
>> Alpha2 = 0.1 Tau2 = 0.5 %% Lead portion
>> Kc = 2
>> GcLeadLag = Kc* series( ...
tf( Alpha1 * [Tau1 1], [(Alpha1*Tau1) 1]), ... %% Lag Part
tf( [Tau2 1], [(Alpha2*Tau2) 1]) ) %% Lead Part
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 73
EE/ME 574: Intermediate Controls Section 2.6.1
2.6.1 Basics of Lead-Lag compensation
The structure of the lead-lag compensator is illustrated in gure 58.
frequency,
x x oo
Lag Part Lead Part
c somewhere in here
S-plane
Figure 58: Structure of the poles and zeros in a Lead-Lag compensator
Design ideas:
Use the lag part to boost the low-frequency gain
Use the lead part to boost the phase margin
The lag zero should be well below the cross-over frequency
The lead pole should be well above the cross-over frequency
Choose K
c
so that cross-over occurs in the desired region.
Comparing with the PID compensator
The DC gain is nite
The innite DC gain of the PID compensator may not be
advantageous, if, for example, we have a disturbance rejection
requirement, at
d
.
The Lead-Lag compensator has a 2
nd
pole, above the cut off frequency
of the controller.
Weve seen that PID controllers (and everything really) actually have
additional high-frequency poles.
The explicit HF pole of Lead-Lag compensation may be good for
controlling noise sensitivity.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 74
EE/ME 574: Intermediate Controls Section 3.0.0
3 Summary of frequency-response based
compensator design
Broadly speaking, controller design comprises 4 steps:
1. Determining specications
2. Modeling the system to be controlled
3. Choosing a controller structure
4. Tuning the controller parameters
Weve seen a number of different controller structures, these are listed in
table 9, with indications of their virtues.
Compensator
Type:
Speed Damping Accuracy Number of
Parameters:
P-type + - + 1
PD ++ ++ 0 2
Phase-Lead ++ ++ 0 3
PI 0 - ++ 2
Phase-Lag 0 - ++ 3
lag-lead ++ ++ ++ 5
PID ++ ++ ++ 3
State Space ++ ++ ++ n
Notation +: improves, -: makes worse, 0: unchanged.
Table 9: Controller Structures
The most important step of any frequency-domain design is to determine
the cross-over frequency.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 75
EE/ME 574: Intermediate Controls Section 3.0.0
Look at the phase-margin at
c
If the speed and phase margin are adequate,
PI or Phase-Lag control may be suitable
If the speed or phase margin needs boosting
PD, Phase-Lead control may be suitable
Look at the accuracy requirement
If the accuracy is adequate
PD or Phase-lead control may be suitable
If the accuracy needs improving
PI or Phase-Lag control may be suitable
If both (speed or phase margin) and accuracy need a boost
PID or Lead-Lag control may be suitable
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 76
EE/ME 574: Intermediate Controls Section 3.0.0
It is permitted to use multiple compensators.
For example, to get a phase boost of more than about 60
o
we can use a
double-lead compensator
G
c
(s) = K
c
s +1
s +1
s +1
s +1
, < 1 (55)
A double-lag compensator would give greater boost of the low-frequency
gain
A Lag-Lead-Lead compensator would give some accuracy improvement
with considerable phase support
Et cetera for other combinations
Poles at
p
>>
c
(frequency signicantly above
c
) have little inuence
on the closed-loop response of the system.
They can be added to the compensator to make it realizable
They can be added as needed to reduce sensitivity to high-frequency
noise.

The Bode plot reveals many features of the requirements and performance
of feedback control systems, including
The concepts of cross-over frequency, phase and gain margin,
Tools for assessing the speed, stability and accuracy of feedback control,
Aspects to examine, to help select a controller structure, and
Design techniques to realize controllers of many different types.
Part 3: Frequency Response Design (Revised: Mar 26, 2013) Page 77
EE/ME 574: Intermediate Controls
A State-Variable Modeling for
Controller Analysis and Design
Contents
1 Introduction to state-variable models 5
1.1 Voice-coil motor: an example contrasting classical and state-
variable modeling . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.1 Developing a classical model . . . . . . . . . . . . . . . . 7
1.1.2 Some observations on developing the classical model . . . 8
1.1.3 Writing the model in state-variable form . . . . . . . . . 10
1.1.4 Form for the state-variable model . . . . . . . . . . . . . 11
1.1.5 Steps of building a state-variable model, with the voice-
coil motor example . . . . . . . . . . . . . . . . . . . . . 12
1.1.6 Matlab code to set up the voice-coil motor example . . . . 20
1.1.7 Some observations on developing the state-variable model 23
1.2 State-variable modeling, conclusions . . . . . . . . . . . . . . . . 25
2 Review of basics of linear algebra 26
2.1 Scalars, matrices and vectors . . . . . . . . . . . . . . . . . . . . 26
2.2 Transpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3 Basic arithmetic: +, - and * are well dened . . . . . . . . . . . . 27
2.3.1 Multiplication . . . . . . . . . . . . . . . . . . . . . . . . 28
2.4 Commutative, associative, distributive and identity properties . . . 30
2.4.1 Commutative property . . . . . . . . . . . . . . . . . . . 30
2.4.2 Associative property . . . . . . . . . . . . . . . . . . . . 30
2.4.3 Distributive property . . . . . . . . . . . . . . . . . . . . 31
2.4.4 Identity Matrix . . . . . . . . . . . . . . . . . . . . . . . 31
2.4.5 Doing algebra with vectors and matrices . . . . . . . . . 32
2.5 Linear independence and the determinant . . . . . . . . . . . . . 33
2.5.1 Computing the determinant . . . . . . . . . . . . . . . . 34
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 1
EE/ME 574: Intermediate Controls
2.5.2 Some relations involving determinants . . . . . . . . . . 35
2.6 Rank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.7 The norm of a vector . . . . . . . . . . . . . . . . . . . . . . . . 37
2.8 A quick review of eigenvalue and eigenvectors . . . . . . . . . . 38
2.8.1 Some properties of Eigenvectors and Eigenvalues . . . . 40
2.8.2 A few more notes on Eigenvectors and Eigenvalues . . . 43
2.8.3 Positive denite and positive semi-denite matrices . . . 45
2.8.4 One nal fact about the eigensystem: V diagonalizes A . . 46
3 Working with state-variable models 48
3.1 Deriving the transfer function from the state-variable model . . . . 48
3.1.1 Interpreting J
p
. . . . . . . . . . . . . . . . . . . . . . . 50
3.2 Getting a state-space model from a transfer function . . . . . . . . 51
3.2.1 Example, state-space model from a transfer function . . . 55
3.2.2 One more complication . . . . . . . . . . . . . . . . . . 56
3.3 Coordinate transformation of a state-variable model . . . . . . . . 57
3.3.1 Derivation of the state model transformation . . . . . . . 58
3.3.2 Example: transforming a system model into modal
coordinates . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.3.3 Summary of coordinate transformation . . . . . . . . . . 61
4 Introducing state-feedback control 62
4.1 Determination of a new model with state feedback . . . . . . . . 63
4.2 Determining N
f
. . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.2.1 Note on N
f
and SSE(step) = 0 . . . . . . . . . . . . . . . 66
4.3 Example system with state feedback . . . . . . . . . . . . . . . . 66
5 State-space controller design, determine K and N
f
68
5.1 State-Space Controller Design Method #1: Pole Placement . . . 69
5.1.1 Pole placement example . . . . . . . . . . . . . . . . . . 70
5.1.2 Try pole-placement control design, twice as fast . . . . . . 72
5.1.3 Taking a look at the control effort and tracking error . . . 74
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 2
EE/ME 574: Intermediate Controls
5.2 State-Space Controller Design Method #2: The Linear Quadratic
Regulator, an optimal control method . . . . . . . . . . . . . . . 77
5.2.1 The LQR cost function . . . . . . . . . . . . . . . . . . . 78
5.2.2 Designing an LQR controller . . . . . . . . . . . . . . . 81
5.2.3 Tuning an LQR controller . . . . . . . . . . . . . . . . . 83
5.2.4 Procedure for tuning Q and R . . . . . . . . . . . . . . . 85
5.2.5 Further notes on choosing Q and R . . . . . . . . . . . . . 86
5.2.6 Connection between LQR and the Symmetric Root Locus 87
6 State-variable models with various inputs and outputs 88
6.1 Considering various inputs . . . . . . . . . . . . . . . . . . . . . 88
6.1.1 Considering a disturbance input . . . . . . . . . . . . . . 92
6.2 Considering various outputs . . . . . . . . . . . . . . . . . . . . 94
6.3 Determining the Steady-State error for a state-variable model . . . 96
6.3.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . 99
7 Integral control: augmenting the model with an integral control state 102
7.1 Augment the state vector with controller states . . . . . . . . . . . 102
7.2 Block diagram of state-variable controller with
controller states . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
7.3 Example, integral control for the voice-coil motor . . . . . . . . . 107
7.3.1 Now, set N
f
. . . . . . . . . . . . . . . . . . . . . . . . 110
7.4 Summary of integral control . . . . . . . . . . . . . . . . . . . . 112
8 Controllability and observability 113
8.1 Main facts about uncontrollable or unobservable modes: . . . . . 114
8.2 Denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
8.3 Mathematical tests: . . . . . . . . . . . . . . . . . . . . . . . . . 115
8.3.1 Test for controllability . . . . . . . . . . . . . . . . . . . 115
8.3.2 Test for observability . . . . . . . . . . . . . . . . . . . . 116
8.4 Summary Controllability and Observability . . . . . . . . . . . . 117
8.4.1 Uncontrollable and unobservable modes and rocketry . . . 118
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 3
EE/ME 574: Intermediate Controls
9 Summary, state-variable modeling and control 119
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 4
EE/ME 574: Intermediate Controls Section 1.1.0
1 Introduction to state-variable models
To introduce the the subject and advantages of state-variable modeling, we
will consider an example.
We will compare and contrast state-variable modeling with classical
modeling
Classical modeling:
Algebraic simplication of equations to 1 n
th
order differential
equation in 1 variable.
State-variable modeling:
Little algebraic simplication of differential equations required
Represent the model as n rst order differential equations
1.1 Voice-coil motor: an example contrasting classical and
state-variable modeling
The model for voice-coil motor will be used as an example to develop the
ideas of state variable modeling and control.
Voice-coil motors are linear motors used in high speed applications, such as
the hummingbird robot developed by IBM research laboratories (cf. Zai et
al., 1992).
A model for a voice-coil motor is developed in chapter 2 of Franklin et al.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 5
EE/ME 574: Intermediate Controls Section 1.1.0
Figure 1: Voice-coil motor schematic (Example 2.10, Figure 2.19 in Franklin et
al. 5
th
Ed.).
Figure 1 shows a schematic diagram. The a voice-coil motor combines
An electrical side
A mechanical side
The model equations are:
cone : M z(t) =b z(t) +k
s
i
a
(t) (1)
coil current : L
a
d
dt
i
a
(t) =R
a
i
a
(t) e
coil
(t) +v
a
(t) (2)
back emf e
coil
(t) = k
s
z(t) (3)
Eqn (1) comes from the mechanics of the voice coil
Eqn (2) comes from the circuit and the inductor
Eqn (3) reects the back EMF of the coil
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 6
EE/ME 574: Intermediate Controls Section 1.1.1
Signals and parameters are listed in table 1
Signal Description Units Parameter Description Units
z(t) Cone position [m] M Cone mass [kg] =
_
N
m/s
2
_
i
a
(t) Coil current [A] b Cone damping
_
N
m/s
_
v
a
(t) Applied voltage [V] k
s
Coil motor constant
_
N
A

=
_
V
m/s
_
R
a
Coil resistance [] =
_
V
A

L
a
Coil inductance [H]=
_
Vs
A

Table 1: Signals and parameters of the voice coil model.


1.1.1 Developing a classical model
A classical model is developed rst, to show the contrast with state-variable
modeling.
We can see from Eqns (1)-(3) that the system will have a 3
rd
order model.
If the system input is v
a
(t) and the output is z(t), we should eliminate
e
coil
(t) (easy) and i (t) (harder) from the equations
Taking the derivative of Eqn (1) will introduce d i
a
(t)/dt :
M z(t) = b z(t) +k
s

i
a
(t) (4)
The d i
a
(t)/dt term can be eliminated with Eqn (2) :
M z(t) = b z(t) +k
s
_
1
L
a
(R
a
i
a
(t) k
s
z(t) +v
a
(t))
_
(5)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 7
EE/ME 574: Intermediate Controls Section 1.1.2
Now the i
a
(t) term on the right has to be eliminated, use Eqn (1) to write:
i
a
(t) =
1
k
s
(M z(t) +b z(t)) (6)
Plugging (6) back into 5 gives
M z(t) = b z(t) +k
s
_
1
L
a
_
R
a
_
1
k
s
(M z(t) +b z(t))
_
k
s
z(t) +v
a
(t)
__
After a certain amount of algebra, one nds:
LM z(t) +L
a
b z(t) +R
a
M z(t) +R
a
b z(t) +k
2
s
z(t) = k
s
v
a
(t) (7)
Which gives the transfer function:
Z(s)
V
a
(s)
=
k
s
L
a
Ms
3
+(L
a
b+R
a
M)s
2
+(R
a
b+k
2
s
)s
(8)
1.1.2 Some observations on developing the classical model
It requires many algebra steps
Actually, the algebra steps required goes up rapidly in the system order
3
rd
is 45more algebra than 2
nd
order
4
th
order is 1020more algebra than 2
nd
order
Imagine deriving a 6
th
order model !
Imagine deriving a 200
th
order model !
By eliminating the intermediate variables we throw away information
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 8
EE/ME 574: Intermediate Controls Section 1.1.2
Suppose we have an ammeter in the circuit and measure i
a
(t), how do
we relate that to Eqn (5) ?
To solve Eqn (5) we need the initial conditions z(t
0
), z(t
0
), z(t
0
)
What is the physical signicance of z(t
0
)?
What are the mathematical properties of Eqn (5) ?
Is it the simplest form ?
Can we determine the states from measurements of z(t)?
Or from i
a
(t) ?
(i
a
(t) is even in the model !)
By choosing v
a
(t) can we control z(t) ?
What other forms for the model are possible,
For example, we could have developed the model I
a
(s)/V
a
(s)
Can we describe all possible alternative model forms ?
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 9
EE/ME 574: Intermediate Controls Section 1.1.3
1.1.3 Writing the model in state-variable form
A State Variable (SV) model addresses all of the above concerns about
classical models
To construct a n SV model, we need n, 1
st
order differential equations
The form for a state-variable model is
x(t) = F
p
x(t) +G
p
u(t) (9)
y(t) = H
p
x(t) +J
p
u(t) (10)
F
p
, G
p
, H
p
, J
p
x(t)
u(t) y(t)
Figure 2: Basic block diagram of a state-variable model. F
p
, G
p
, H
p
, J
p
are
model matrices. x(t) is the state vector.
Paying attention to details, there are ve steps in writing a state variable
model:
1. Write the relevant relations for the system
2. Identify the differential equations
3. Write the differential equations in state-variable form
4. Write the equation of the output signal (or signals) using the states and
inputs
5. Verify correctness, by verifying the individual rows of the state variable
model, and check units in the state and output equation.

Lets look at each step and break it out into sub-steps, and see an example.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 10
EE/ME 574: Intermediate Controls Section 1.1.4
1.1.4 Form for the state-variable model
The form for a state-variable model is
x(t) = F
p
x(t) +G
p
u(t) (11)
y(t) = H
p
x(t) +J
p
u(t) (12)
F
p
, G
p
, H
p
, J
p
x(t)
u(t) y(t)
Figure 2 (repeated). Basic block diagram of a state-variable model.
Signal name description
x(t) State vector n-element vector
u(t) Input vector m-element vector
y(t) Output vector p-element vector
Parameter name description
F
p
System matrix nn matrix
Gp Input matrix nm matrix
H
p
Output matrix pn matrix
J
p
DT term pm matrix
Table 2: Signals and parameters of the state-variable model.
For a linear model with constant coefcients , F
p
, G
p
, H
p
, J
p
are constant
Matrices F
p
, G
p
, H
p
, J
p
represent the system
Signals x(t), u(t) and y(t) are signals
2
nd
order example (to see what the model looks like):
x(t) =
_
_
z(t)
z(t)
_
_
, x(t) =
_
_
1 3
1 2
_
_
x(t) +
_
_
2
0
_
_
u(t) (13)
y(t) =
_
3 4
_
x(t) +[0] u(t) (14)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 11
EE/ME 574: Intermediate Controls Section 1.1.5
1.1.5 Steps of building a state-variable model, with the voice-coil motor
example
1. Write the relevant relations for the system
(a) Dene symbols for the signals and parameters
(b) Write the equations
i. Constituent relations (for elements)
ii. Continuity constraints (for how elements are linked into a system)
(c) Record the units, verify that units balance in the equations
The equations express laws of physics, the units must balance

For the VCM:
Going back to the basic modeling equations, and dividing through by
any leading constant
cone : z(t) =
b
M
z(t) +
k
s
M
i
a
(t) (15)
coil current :
d
dt
i
a
(t) =
R
a
L
a
i
a
(t)
1
L
a
e
coil
(t) +
1
L
a
v
a
(t) (16)
back emf e
coil
(t) = k
s
z(t) (17)
Re-write Eqn (15) as two rst order equations, dene v(t) = z(t) ,
so v(t) = z(t):
cone : v(t) =
b
M
v(t) +
k
s
M
i
a
(t) (18)
z(t) = v(t) (19)
Table of parameters with units is given in table 1.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 12
EE/ME 574: Intermediate Controls Section 1.1.5
2. Identify the differential equations
(a) Determine the system order
The number of independent storage elements
The system order will almost always be sum of the orders of the
contributing differential equations
Rarely, differential equations may be inter-dependent in a way that
reduces the order
(b) Select the state variables
n state variables for an n
th
order system
State variables must be independent, no state variable can be a linear
combination of other state variables
The choice of state variables is not unique
Often the storage variables are a good choice

For the VCM:
(a) Eqns (16) (18) and (19) are 3 rst-order differential equations,
system order: n = 3.
(b) Select the variables of the state vector
x(t) =
_

_
v(t)
z(t)
i
a
(t)
_

_
for Eqn(18)
for Eqn(19)
for Eqn(16)
Now, for writing x(t) = F
p
x(t) +G
p
u(t) we need x(t), which
is
x(t) =
_

_
v(t)
z(t)

i
a
(t)
_

_
(20)
These are precisely the derivatives
of Eqns (16) (18), and (19)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 13
EE/ME 574: Intermediate Controls Section 1.1.5
3. Write the differential equations in state-variable form
(a) Put derivatives in the left-hand side, these must be the state derivatives
(b) All signals on the right-hand side must be expressed in terms of the states
and inputs
(c) Put the model in state-variable form

(a) From Eqns (15)-(19) we can write:
v(t) = z(t) =
b
M
v(t) +
k
s
M
ia (t) (21)
z(t) = v(t) (22)

i
a
(t) =
1
L
a
e
coil
(t)
R
a
L
a
i
a
(t) +
1
L
a
v
a
(t) (23)
(b) Looking at the right-hand side, all signals must be states or inputs.
Signals v(t) , i
a
(t) are states, v
a
(t) is the input, however e
coil
(t) is not a
state or input. Use the algebraic modeling equations to rewrite e
coil
(t) in
terms of states+inputs:
e
coil
(t) = k
s
z(t)
Giving
v(t) =
b
M
v(t) +0z(t) +
k
s
M
i
a
(t) +0v
a
(t) (24)
z(t) = 1v(t) +0z(t) +0i
a
(t) +0v
a
(t) (25)

i
a
(t) =
k
s
L
a
v(t) +0z(t)
R
a
L
a
i
a
(t) +
1
L
a
v
a
(t) (26)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 14
EE/ME 574: Intermediate Controls Section 1.1.5
(c) Eqns (24)-(26) is written in state-variable form with:
x(t) =

_
v(t)
z(t)
i
a
(t)
_

_
=
_

b
M
0
ks
M
1 0 0

ks
La
0
Ra
La
_

_
_

_
v(t)
z(t)
i
a
(t)
_

_
+
_

_
0
0
1
La
_

_
[v
a
(t)] (27)
Which is the state equation:
x(t) = F
p
x(t) +G
p
u(t)
With matrices
F
p
=
_

b
M
0
ks
M
1 0 0

ks
La
0
Ra
La
_

_
and G
p
=
_

_
0
0
1
La
_

_
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 15
EE/ME 574: Intermediate Controls Section 1.1.5
4. Write the equation of the output signal (or signals) using the states and
inputs

For the VCM, the output is the position, z(t)
y(t) = [z(t)] =
_
0 1 0
_
_

_
v(t)
z(t)
i
a
(t)
_

_
+[0] [v
a
(t)]
Which is the output equation:
y(t) = H
p
x(t) +J
p
u(t)
With
H
p
=
_
0 1 0
_
and J
p
= [0]
5. Verify correctness, by verifying the individual rows of the state variable
model, and check units in the state and output equation.

For the VCM, we can examine the individual rows, and assure that the
correspond to the original modeling equations (from page 6).
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 16
EE/ME 574: Intermediate Controls Section 1.1.5
Keeping in mind the units of the state vector:
x(t) =
_

_
_
m
s

[m]
[A]
_

_
Checking units in the state equation, x(t) = F
p
x(t) +G
p
u(t)
_

_
_
m
s
2

_
m
sec

_
Amp
sec
_
_

_
=
_

_
__
N
m/s
2
_
_
N
m/s
_
_
[]
__
kgm/s
2
A
_
kg
_
1 [] []
__
V
m/s
_
[
Vs
A
]
_
[]
_
[
V
A
]
[
Vs
A
]
_
_

_
_

_
_
m
s

[m]
[A]
_

_
+
_

_
[]
[]
_
A
Vs

_
[volts]
Simplifying the units expression:
_

_
_
m
s
2

_
m
sec

_
Amp
sec
_
_

_
=
_

_
_
s
1

[]
_
m/s
2
A
_
1
_
s
1

[]
_
A
m

[]
_
s
1

_
_

_
_
m
s

[m]
[A]
_

_
+
_

_
[]
[]
_
A
Vs

_
[volts]
Looking at the output equation
[m] =
_
[] 1 []
_
_

_
_
m
s

[m]
[A]
_

_
+[] [volts]
The output signal is one of the states, so H
p
and J
p
are pretty simple
in this example.
In some cases there is more going on in the output equation.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 17
EE/ME 574: Intermediate Controls Section 1.1.5
Some things to notice about the example state variable model
All of the information about the system is in the F
p
, G
p
, H
p
, J
p
matrices.
(any parameter that doesnt showup in the matrices, doesnt inuence the
system).
The middle row of the state equation, Eqn (27), is
z(t) = 1v(t) +0z(t) +0i
a
(t) +0v
a
(t)
Or simply
z(t) = 1v(t)
This derivative equation might seem trivial, since we dened v(t) =
z(t). However, it is needed.
The derivative equation is needed for each state variable, no matter
how simple.
Some essential things to keep in mind for state-variable modeling:
Always distinguish between signals and parameters
Signals are functions of time and change when the input (signals)
change.
Parameters are generally constant (or slowly varying) and are
properties of the system.
Both have physical units
Pay special attention to the states
Systems have many signals, only n signals are states
States correspond to the needed initial condition needed to determine
the output of the system
With experience, it is often quite straight-forward to determine the
states for a state-variable model.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 18
EE/ME 574: Intermediate Controls Section 1.1.5
Further remarks on state-variable models
The state variable model is a very general form.
In fact, any linear, time-invariant constant coefcient system model can
be written as a state variable model.
x(t) = Fp x(t) +Gp u(t)
y(t) = H
p
x(t) +J
p
u(t)
The state variable model can directly handle multi-input, multi-output
systems (like a helicopter)
For a system with m inputs and p outputs:
x(t) R
n1
F
p
R
nn
u(t) R
m1
G
p
R
nm
y(t) R
p1
H
p
R
pn
J
p
R
pm
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 19
EE/ME 574: Intermediate Controls Section 1.1.6
1.1.6 Matlab code to set up the voice-coil motor example
%% Setup the parameters as constants
ks = 0.63; b = 0.03; L = 0.02;
M = 0.2; R = 0.3;
>> Fp = [ -(b/M) 0 (ks/M); %% Define the state equations
1 0 0 ; %% using the constants
-(ks/L) 0 -(R/L) ] %% (not numbers)
>> Gp = [0; 0; (1/L)]
>> Hp = [ 1 0 0 ]; Jp = 0;
Fp = -0.1500 0 3.1500
1.0000 0 0
-31.5000 0 -15.0000
Hp = 0 1 0
Gp = 0
0
50
Jp = 0
%% Build Matlab Sys model, examine poles and zeros
>> Ga_ss = ss(Fp, Gp, Hp, Jp);
Matlab prints
a =
x1 x2 x3
x1 -0.15 0 3.15
x2 1 0 0
x3 -31.5 0 -15
b =
u1
x1 0
x2 0
x3 50
c =
x1 x2 x3
y1 0 1 0
d =
u1
y1 0
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 20
EE/ME 574: Intermediate Controls Section 1.1.6
>> OLPoles = pole(Ga_ss)
OLPoles = 0
-7.5750 + 6.6404i
-7.5750 - 6.6404i
>> OLZeros = zero(Ga_ss)
OLZeros = Empty matrix
>> figure(1), clf %% Examine the system response
>> step(Ga_ss)
>> title(Open Loop Step Response); grid
>> print(-deps2c, FEStepOL)
0 0.5 1 1.5 2
0
0.5
1
1.5
2
2.5
3
Open Loop Step Response, position
Time (sec)
A
m
p
litu
d
e
Figure 3: Open-Loop system step response, note: system is type I.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 21
EE/ME 574: Intermediate Controls Section 1.1.6
By changing the H
p
and J
p
matrices, we can consider the velocity or the
current as the output of the system
>> Hp_v = [1 0 0]; Jp_v = [0]; %% Cone Velocity as output
>> Hp_i = [0 0 1]; Jp_i = [0]; %% Coil current as output
>> figure(1), clf, step(ss(Fp, Gp, Hp_v, Jp_v), 2)
>> figure(2), clf, step(ss(Fp, Gp, Hp_i, Jp_i), 2)
0 0.5 1 1.5 2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
Open Loop Step Response, velocity
Time (sec)
A
m
p
litu
d
e
0 0.5 1 1.5 2
0
0.5
1
1.5
2
2.5
Open Loop Step Response, current
Time (sec)
A
m
p
litu
d
e
Figure 4: Velocity response and current response.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 22
EE/ME 574: Intermediate Controls Section 1.1.7
1.1.7 Some observations on developing the state-variable model
(Compare with section 1.1.2)
Classical modelling: requires many steps of algebra
Writing the state variable model required almost no algebra
For a large model, this would be a signicant advantage
Classical modeling: eliminates intermediate variables
State variables are not thrown out !
Information about the evolution of the states is explicitly available in the
model
Classical modeling: What is the signicance of the initial conditions ?
The initial conditions, x(t = 0) are the states at t = 0 !
The physical signicance of the initial conditions, as well as how to
accurately determine them, is readily apparent.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 23
EE/ME 574: Intermediate Controls Section 1.1.7
Classical modeling: transfer function provides limited mathematical insight
into the system
State-variable modeling brings a wealth of insight into the details of the
physical system
The modes of response
Geometric interpretation of the model and system response (EE/ME
701)
Rigorous denitions of controllability and observability
Very difcult with transfer functions, and a key original motivation
for state-space development
Optimal control design methods
Classical modeling: what other forms for the model are possible ?
Model transformation shows the set of all possible state-variable models
for a system.
And we can get the TF from the SS model !
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 24
EE/ME 574: Intermediate Controls Section 1.2.0
1.2 State-variable modeling, conclusions
An overview of basic system modeling (TF and SS) is found chapter 2 of
Franklin et al.
State variable modeling in 5 steps:
1. Write the relevant relations for the system
2. Identify the differential equations
3. Write the differential equations in state-variable form
4. Write the equation of the output signal (or signals) using the states and
inputs
5. Verify correctness, by verifying the individual rows of the state variable
model, and check units in the state and output equation.
Matlab manipulates state variable-models as a type of LTI model
State variable models carry information (the states) that TF models throw
away.
New control design methods for state-variable models (coming up!)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 25
EE/ME 574: Intermediate Controls Section 2.2.0
2 Review of basics of linear algebra
2.1 Scalars, matrices and vectors
Matrices are rectangular sets of numbers or functions, examples:
Matrices have zero or more rows and columns:
x(t) =
_

_
v(t)
w(t)
z(t)
_

_
, x(t) R
31
A =
_

_
1 0 7
4 5 0
2 3 6
_

_
, A R
33
Vectors are special cases of Matrices, with only one row or column,
x is a column vector,
w =
_
3 4
_
R
12
is a row vector
Scalar values (numbers or functions with one output variable) can also be
treated as matrices or vectors:
3 = [3] R
11
Array is a synonym for Matrix
2.2 Transpose
Transposing an array rearranges each column to a row:
C =
_

_
3 1
4 1
5 2
_

_
C
T
=
_
_
3 4 5
1 1 2
_
_
C R
32
, C
T
R
23
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 26
EE/ME 574: Intermediate Controls Section 2.3.0
2.3 Basic arithmetic: +, - and * are well dened
Dene:
A =
_

_
1 2
3 4
_

_; B =
_

_
1 1
2 3
_

_; C =
_

_
3 1
4 1
5 2
_

_
x =
_

_
2
3
_

_; w =
_
3 4
_
Operations +, - and * are well dened. The dimensions of the operands
must be compatible.
For addition and subtraction, the operation is element-wise, and the
operands must be the same size:
A+B =
_

_
0 3
5 7
_

_ AB =
_

_
2 1
1 1
_

_
If not the same size, there is no dened result (the operation is
impossible)
A+C = undened
We say that A and C are incommensurate for addition.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 27
EE/ME 574: Intermediate Controls Section 2.3.1
2.3.1 Multiplication
For multiplication, the operation is by row on the left and column on the
right.
To produce one element of the result, go across each row on the left and
multiply with elements of the column on the right. With
A =
_

_
1 2
3 4
_

_ , B =
_

_
1 1
2 3
_

_
We get
AB = AB =
_

_
(1(1) +22) (11+23)
(3(1) +42) (31+43)
_

_ =
_

_
3 7
5 15
_

_
A and B dont have to be the same size to multiply
Ax =
_

_
1 2
3 4
_

_
_

_
2
3
_

_ =
_

_
(12+23)
(32+43)
_

_ =
_

_
8
18
_

_
For AB = C , given A R
nm
and B R
jk
The number of columns in A must match the number of rows in B
that is, m = j
The size of the result matrix is determined by the number of rows in
A and columns in B
To multiply A and B, we must have m = j , then C R
nk
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 28
EE/ME 574: Intermediate Controls Section 2.3.1
Examples:
With n = 2, m = 2, j = 3, k = 2 , then m = j :
AC =
_

_
1 2
3 4
_

_
_

_
3 1
4 1
5 2
_

_
= undened
With n = 3, m = 2, j = 2, k = 2 : then m = j :
CA =
_

_
3 1
4 1
5 2
_

_
_

_
1 2
3 4
_

_ =
_

_
6 10
1 4
11 18
_

_
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 29
EE/ME 574: Intermediate Controls Section 2.4.2
2.4 Commutative, associative, distributive and identity
properties
2.4.1 Commutative property
Like scalar algebra, addition commutes: A+B = B+A
Like scalar algebra, subtraction commutes with a - sign:
AB =(BA)
Unlike scalar algebra, multiplication does not generally commute:
AB = BA
Example:
AB =
_

_
3 7
5 15
_

_; BA =
_

_
2 2
11 16
_

_
Generally: There are many properties of linear algebra that are
generally true, but may not be true for some special cases.
Does not generally commute means that most matrices do not commute,
but that perhaps special matrices can be found that do commute.
2.4.2 Associative property
Like scalar algebra, +, - and * have the associative property:
(A+B) +C = A+(B+C)
(A+B) C = A+(BC)
(AB) C = A(BC)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 30
EE/ME 574: Intermediate Controls Section 2.4.4
2.4.3 Distributive property
Like scalar algebra, * distributes over + and - :
(A+B) C = AC+BC
C (AB) = CACB
Note: left-to-right order of multiplications in second example.
2.4.4 Identity Matrix
Like scalar algebra, linear algebra has a multiplicative identity:
I
L
C = CI
R
= C
Examples:
_

_
1 0 0
0 1 0
0 0 1
_

_
_

_
3 1
4 1
5 2
_

_
=
_

_
3 1
4 1
5 2
_

_
_

_
3 1
4 1
5 2
_

_
_

_
1 0
0 1
_

_ =
_

_
3 1
4 1
5 2
_

_
If A is square, then I
L
= I
R
, and we just call it I, the identity matrix:
_

_
1 0
0 1
_

_
_

_
1 2
3 4
_

_ =
_

_
1 2
3 4
_

_
_

_
1 0
0 1
_

_ =
_

_
1 2
3 4
_

_
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 31
EE/ME 574: Intermediate Controls Section 2.4.5
2.4.5 Doing algebra with vectors and matrices
Starting with an equation,
We can add, subtract or multiply on the left or right by any allowed term
and get a new equation.
Examples, given:
A+B = C
Then
(A+B) +D = C+D
E (A+B) = EA+EB = EC
(A+B) F = CF
Where A, B, C, D, E and F are compatible sizes.
Matrices that are the appropriate size for an operation are called
commensurate .
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 32
EE/ME 574: Intermediate Controls Section 2.5.0
2.5 Linear independence and the determinant
The columns (or rows) of a matrix are linearly independent if there are no
coefcients a
1
, a
2
, ... such that
a
1
c
1
+a
2
c
2
+... +a
n1
c
n1
= cn (28)
Or, equivalently, there is no vector x such that Cx =0, where C= [c
1
, c
2
, ...]
is the array of vectors c
i
, and 0 is the null vector (vector of zeros).
The determinant is a scalar measure of the size of a square matrix.
det (A) =|A| R
1
(29)
The determinant is not dened for a non-square matrix.
The determinant of a matrix will be non-zero if and only if the rows (or,
equivalently, columns) of a matrix are linearly independent. Examples:
(a)

1 2 3
4 5 6
10 14 18

= 0 (b)

1 2 3
4 5 6
7 8 9

= 54 (30)
In case (a), the third column is given by 2xCol2 - 1xCol1.
In case (b), the three columns are independent.
Notice that in case (a), the third row is given by 2xRow1 + 2xRow2.
Always for a square matrix, if the columns are dependent, the rows
will be dependent.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 33
EE/ME 574: Intermediate Controls Section 2.5.1
2.5.1 Computing the determinant
The determinant of a square matrix (the only kind !) is dened by Laplaces
expansion (following Franklin et al.):
det A =
n

j=1
a
i j

i j
for anyi = 1, 2, ..., n (31)
where a
i j
is the element from the i
th
row and j
th
column of A; and
i j
is called the
cofactor, given by:

i j
= (1)
i+j
det M
i j
(32)
where Mi j is called a minor. Mi j is the same matrix as A, with the i
th
row and j
th
column removed.
For example, with i = 1,
j = 1 j = 2 j = 3
det
_

_
a b c
d e f
g h i
_

_
= a det
_

_
e f
h i
_

_b det
_

_
d f
g i
_

_+c det
_

_
d e
g h
_

_
Closed-form expressions for 2x2 and 3x3 matrices are sometimes handy.
They are:
det
_

_
a b
c d
_

_ = ad bc
det
_

_
a b c
d e f
g h i
_

_
= aei ah f bd i +bg f +cd gcge
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 34
EE/ME 574: Intermediate Controls Section 2.5.2
2.5.2 Some relations involving determinants
1. det (I) = 1, where I is the identity matrix
2. det (AB) = det (A) det (B)
3. Given M, an invertible matrix,
(a) det
_
M
1
_
= 1/det (M)
(b) det
_
MAM
1
_
= det (M) det (A) 1/det (M) = det (A)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 35
EE/ME 574: Intermediate Controls Section 2.6.0
2.6 Rank
The rank of a matrix is the number of independent rows and columns
r = rank(A) (33)
The number of independent rows is always equal to the number of
independent columns
Example:
A =
_

_
1 2 3 4
5 6 7 8
6 8 10 12
_

_
rank(A) = 2
The third row is the sum of the rst two.
Notice that the 3
rd
column is 2 x Col2 - Col1
And the 4
th
column is 3 x Col2 - 2 x Col1
The rank of a matrix can not be greater than the number of rows or columns
rank(A) min(n, m)
A matrix is said to be full rank if rank(A) takes its maximum value, that is
rank(A) = min(n, m)
Otherwise the matrix is said to be rank decient.
A square matrix is invertible if and only if it is full rank.
The determinant of a square matrix is zero if the matrix is rank decient.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 36
EE/ME 574: Intermediate Controls Section 2.7.0
2.7 The norm of a vector
The norm of a vector, written ||x|| is a measure of the size of the vector.
In mathematics many measures of size are dened for special purposes.
The most common measure by far is the "2-norm", (a.k.a. the Euclidean
norm)
||x||
2
=

i=1
x
2
i
(34)
example:
x =
_

_
2
3
4
_

_
(35)
||x||
2
=
_
_
2
2
+(3)
2
+(4)
2
_
= 5.39 (36)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 37
EE/ME 574: Intermediate Controls Section 2.8.0
2.8 A quick review of eigenvalue and eigenvectors
These are the main properties of eigenvectors and eigenvalues, which are typically
covered more thoroughly and rigorously in a rst course in linear algebra.
A vector has both a direction and a magnitude. Consider
v
1
=
_

_
1
2
_

_ , v
2
=
_

_
1.5
3.0
_

_ , v
3
=
_

_
1.58
1.58
_

_
v
1
has the same direction as v
2
, but has a different magnitude.
v
3
has the same magnitude as v
1
, but has a different direction.
In general, multiplying a vector v by a matrix
y
4
= Av
4
introduces both a change of magnitude and a change of
direction
y
4
= Av
4
=
_

_
2.0 0.5
1.0 0.5
_

_
_

_
1
1
_

_ =
_

_
2.5
0.5
_

_
x1
x2
v1
v2
v3
x1
x2
y4
v4
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 38
EE/ME 574: Intermediate Controls Section 2.8.0
A quick review of eigenvalue and eigenvectors (continued)
For any square matrix A, certain vectors have the property that the matrix
changes magnitude only, not direction.
For A, such vectors are:
_
_
1.5
1.5
_
_
=
_
_
2.0 0.5
1.0 0.5
_
_
_
_
1
1
_
_
;
_
_
1
2
_
_
=
_
_
2.0 0.5
1.0 0.5
_
_
_
_
1
2
_
_
These special vectors are called the eigenvectors
An eigenvector is scaled by the matrix
_
_
1.5
1.5
_
_
=
_
_
2.0 0.5
1.0 0.5
_
_
_
_
1
1
_
_
= 1.5
_
_
1
1
_
_
, so v
1
=
_
_
1
1
_
_
,
1
= 1.5
_
_
1
2
_
_
=
_
_
2.0 0.5
1.0 0.5
_
_
_
_
1
2
_
_
= 1.0
_
_
1
2
_
_
, so v
2
=
_
_
1
2
_
_
,
2
= 1.0
We can write:

i
v
i
= A v
i
, for example 1.5
_
_
1
1
_
_
= A
_
_
1
1
_
_
(37)
where the
i
are the eigenvalues and the v
i
are the eigenvectors.
Notice that in general ax = Ax, because multiplication by matrix A will
rotate a general vector x
(Choosing vectors x at random, what is the probability of selecting an Student
Exercise eigenvector ?)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 39
EE/ME 574: Intermediate Controls Section 2.8.1
2.8.1 Some properties of Eigenvectors and Eigenvalues
1. Only square matrices have an eigensystem
2. The eigenvalues are the solutions to the equation
det (AI) = 0. (38)
Example, using
det
_

_
a b
c d
_

_ = ad bc
This leads to a polynomial equation in
det
_
_
_
_

_
2.0 0.5
1.0 0.5
_

_
_

_
1 0
0 1
_

_
_
_
_= det
_
_
_
_

_
2.0 0.5
1.0 0.5
_

_
_
_
_
= (2.0)(0.5) 1.0(0.5) =
2
2.5+1.5 = 0
3. The polynomial equation given by Eqn (38) is called the characteristic
equation of the matrix A
(a) A 3x3 matrix gives an equation in
3
, a 4x4 gives an equation in
4
, etc.
(b) Abels theorem states: there is no closed-form solution for the roots of
a polynomial of 5
th
order and above, therefore there is no closed-form
solution for the eigenvalues a 5x5 matrix or larger.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 40
EE/ME 574: Intermediate Controls Section 2.8.1
4. A complete set of eigenvectors exists when an n n matrix has n distinct
eigenvectors (so V, the matrix of eigenvectors, is invertible).
For the example matrix
A =
_

_
2.0 0.5
1.0 0.5
_

_
with >> [V, U] = eig(A);
The matrix of eigenvectors is
V =
_

_
1 1
1 2
_

_
and the matrix of eigenvalues is
U =
_

_
1.5 0
0 1
_

_
5. A matrix that lacks a complete set of eigenvectors is said to be defective,
but this name is meaningful only from a mathematical perspective. For
many control systems, some combinations of parameter values will give a
defective system matrix.
This case corresponds to the case of repeated roots in the study of
ordinary differential equations, where solutions of the form y(t) =t e
t
arise.
A defective matrix can only arise when there are repeated eigenvalues.
In this case, a special tool called the Jordan Form is required to solve
the equation x(t) = Ax(x).
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 41
EE/ME 574: Intermediate Controls Section 2.8.1
6. The eigensystem is computed in Matlab with the eig() command,
>> [v,u] = eig(A)
V is the matrix of eigenvectors, U is a matrix with the corresponding
eigenvalues on the main diagonal.
>> A = [ 1 2 3
-2 4 1
5 6 3 ]
>> [v,u] = eig(A)
v =
0.5276 0.5267 - 0.0250i 0.5267 + 0.0250i
0.2873 -0.1294 + 0.1030i -0.1294 - 0.1030i
-0.7994 0.8335 0.8335
u =
-2.4563 0 0
0 5.2282 + 0.5919i 0
0 0 5.2282 - 0.5919i
7. Notice that eigenvalues can be real or complex.
>> Poly = poly(diag(u))
Poly = 1.0000 -8.0000 2.0000 68.0000
The characteristic equation corresponding to 33 matrix A is

3
8
2
+2+68 = 0 (39)
As with many things, wikipedia has a very nice article on eigenvectors and
eigenvalues:
Everything you wanted to know about the eigensystem of A, in 3 pages.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 42
EE/ME 574: Intermediate Controls Section 2.8.2
2.8.2 A few more notes on Eigenvectors and Eigenvalues
1. Dont use the determinant equation to determine the characteristic equation
to nd eigenvalues. Dont solve:
det (AI) = 0 (40)
to get

n
+a
n1

n1
+ +a
1
+a
0
= 0 (41)
and then solve Eqn (41) to nd the eigenvalues
i
Some reasons to avoid the determinant are:
(a) Going from Eqn (40) to Eqn (41) by solving the determinant involves
symbolic manipulation of matrix A. It is a lot of work.
(b) The determinant does not give the eigenvectors
(c) Once you get Eqn (41), how are you going to nd the roots of the
polynomial ? (Answer on the next page)
(d) Working with the determinant does not lead to a numerically stable
algorithm.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 43
EE/ME 574: Intermediate Controls Section 2.8.2
2. Matlab does not create the characteristic equation using det (AI) = 0,
and then solving for the polynomial roots.
Matlab actually goes the other way, and solves for the roots of a polynomial
by forming a matrix and nding the eigenvalues of that ! The polynomial

3
8
2
+2+68 = 0
is represented in Matlab as the vector
Poly = [ 1, -8, 2, 68]
and the command roots() nds the roots:
>> roots(Poly) ans = [ 5.2282 + 0.5919i
5.2282 - 0.5919i
-2.4563
Actually under the hood Matlab forms a matrix (called the companion
matrix) and applies the eigenvalue routine to that:
>> compan(Poly) ans = 8.0000 -2.0000 -68.0000
1.0000 0 0
0 1.0000 0
>> eig(compan(Poly))
ans = [ 5.2282 + 0.5919i
5.2282 - 0.5919i
-2.4563 ]

3
+a
2

2
+a
1
+a
0
= 0
C =
_

_
a
2
a
1
a
0
1 0 0
0 1 0
_

_
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 44
EE/ME 574: Intermediate Controls Section 2.8.3
Relationship:
Roots of Characteristic Equation Eigenvalues of the Companion Matrix
For a state-variable model, the poles of the system are the eigenvalues of the
F matrix
If the F matrix has poles in the right half plane, the system is unstable.
Note: I havent told you an algorithm for eig(F).
The algorithm is: Use Matlab !
2.8.3 Positive denite and positive semi-denite matrices
A matrix is positive denite if
x
T
Ax > 0 x R
n
A symmetric matrix A is positive denite (PD) if all eigenvalues
i
> 0
For diagonal matrices, A is positive denite if each diagonal element is
greater than zero.
A matrix is positive semi-denite if
x
T
Ax 0 x R
n
A symmetric matrix A is positive semi-denite if all eigenvalues i 0
For diagonal matrices, A is positive denite if each diagonal element is
greater than or equal to zero.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 45
EE/ME 574: Intermediate Controls Section 2.8.4
2.8.4 One nal fact about the eigensystem: V diagonalizes A
When a complete set of eigenvectors exists, the matrix of the eigenvectors
which is an nn matrix
can be used to transform A into a diagonal matrix, by similarity transform
General form for the similarity transform:

A = T AT
1
(42)
Properties of a similarity transform:
T must be invertible
The similarity transform preserves eigenvalues
eig(A) = eig(

A)
The equations for V diagonalizing A are, with V the array of eigenvectors,
and U with the eigenvalues on the diagonal:
Diagonalizing A : U = V
1
AV (43)
Recovering A from [V, U] : A = VUV
1
(44)
Eqns (43) and (44) are both similarity transforms
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 46
EE/ME 574: Intermediate Controls Section 2.8.4
V diagonalizes A (continued)
A numerical example:
A =
_

_
1 2 3
4 5 6
7 8 9
_

_
[V, ] = eig(A)
V =
_

_
0.2320 0.7858 0.4082
0.5253 0.0868 0.8165
0.8187 0.6123 0.4082
_

_
U =
_

_
16.1168 0 0
0 1.1168 0
0 0 0.0000
_

_
We have:
V
1
AV =
_

_
16.1168 0 0
0 1.1168 0
0 0 0.0000
_

_
= U
VUV
1
=
_

_
1 2 3
4 5 6
7 8 9
_

_
= A
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 47
EE/ME 574: Intermediate Controls Section 3.1.0
3 Working with state-variable models
3.1 Deriving the transfer function from the state-variable
model
It is straight forward to get the transfer function from a state variable model.
Starting with the state equation
x(t) = F
p
x(t) +G
p
u(t)
Considering the Laplace transform of the state equation:
sX(s) = F
p
X(s) +G
p
U(s) (45)
Y (s) = Hp X(s) +Jp U(s) (46)
Eqn (45) leads to:
(sI F
p
) X(s) = G
p
U(s)
or
X(s) = (sI F
p
)
1
G
p
U(s) (47)
With (47), Eqn (46) leads to:
Y(s) = H
p
(sI F
p
)
1
G
p
U(s) +J
p
U(s) (48)
If m =1 (one input) and p = 1 (one output), then Eqn (48) gives the transfer
function:
Y (s)
U (s)
= H
p
(sI F
p
)
1
G
p
+J
p
(49)
Eqn (49) can be solved symbolically by Cramers rule, to give the symbolic
transfer function.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 48
EE/ME 574: Intermediate Controls Section 3.1.0
Or we can use Matlab !
>> [Np, Dp] = ss2tf(Fp, Gp, Hp, Jp); %% One method (old fashioned)
Or, using LTI models
>> SSp = ss(Fp, Gp, Hp, Jp); %% Create a state variable model object
>> Gps = tf(SSp); %% Second method (uses tf object)
Transfer function:
157.5 s - 1.553e-29 (Note round-off error)
--------------------------------
s^3 + 15.15 s^2 + 101.5 s
Returning to Eqn (49)
Y (s)
U (s)
= H
p
(sI F
p
)
1
G
p
+J
p
(49, repeated)
From Eqn (49) we can determine the DC Gain of a state-variable model,
K
DC
= lim
s0
Y (s)
U(s)
= lim
s0
H
p
(sI F
p
)
1
G
p
+J
p
= H
p
(F
p
)
1
G
p
+J
p
(50)
If the system is a Type 0 system, Eqn (50) will give a nite result.
If the system is a Type I system, (F
p
)
1
will blow up, giving gain.
lim
0
G(s = j) does go to for a Type 1 system
More on this later .
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 49
EE/ME 574: Intermediate Controls Section 3.1.1
If (F
p
)
1
is undened, Matlab can still determine the transfer function (by
carrying out the calculation of Eqn (49) symbolically, and canceling terms
that go to zero).
>> Fp
Fp = -0.1500 0 3.1500
1.0000 0 0
-31.5000 0 -15.0000
>> inv(-Fp)
Warning: Matrix is singular to working precision.
ans = Inf Inf Inf
Inf Inf Inf %% ss() gives an SS object
Inf Inf Inf %% tf() converts to tf object
>> Gtf = tf( ss(Fp, Gp, Hp, Jp) )
Transfer function: 157.5
-------------------------
s^3 + 15.15 s^2 + 101.5 s
3.1.1 Interpreting J
p
A direct transmission term corresponds to a transfer function that is not
strictly proper.
If J
p
=0, then
the number of zeros equals the number of poles.
In many controls situations,
J
p
= 0
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 50
EE/ME 574: Intermediate Controls Section 3.2.0
3.2 Getting a state-space model from a transfer function
The usual way to derive a state-variable model is from the basic modeling
equations of the system
But it can be desirable to obtain a state variable model directly from the
transfer function. One approach (used by the Matlab tf2ss() command)
is to express the model in controllable canonical form.
Given a system with a transfer function
B(s)
A(s)
u(t) y(t)
It can be considered a poles lter, A(s), and a zeros lter B(s). The two
components can be arranged
B(s)
A(s)
1
u(t) y(t) x
n
(t)
Figure 5: Transfer function with zeros in the output path.
If we build
A system matrix that produces 1/A(s), and
An output matrix that produces B(s)
= Then we will have a state-variable model corresponding to the
transfer function B(s)/A(s).
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 51
EE/ME 574: Intermediate Controls Section 3.2.0
Consider the strictly proper transfer function
T (s) =
b
m1
s
m1
+ +b
1
s +b
0
a
n
s
n
+a
n1
s
n1
+ +a
1
s +a
0
(51)
For example,
T (s) =
b
2
s
2
+b
1
s +b
0
s
3
+a
2
s
2
+a
1
s +a
0
, note : a
3
= 1
The transfer function denominator corresponds to the differential equation
x
3
(t) +a
2
x
3
(t) +a
1
x
3
(t) +a
0
x
3
(t) = u(t)
Which can be written:
x
3
(t) =a
2
x
3
(t) a
1
x
3
(t) a
0
x
3
(t) +u(t) (52)
Eqn (52) comes from 1/A(s), and can be implemented on an analog
computer as shown in gure 6

-a2

-a1 -a0
u(t) x
3
x
2
x
1
x
3
x
2
. .
x
1
.
(Notation follows Bay)
x
3
(t)
x
3
(t) x
3
(t) x
3
(t) x
3
(t)
... .. .
Signal:
Figure 6: Realization of controllable canonical form, incorporates Phase
Variable Feedback.
The states in gure 6, x(t) =
_
x
1
x
2
x
3
_
T
, are called the phase
variables because they are successive derivatives of x
n
(t).
x
2
(t) = x
3
(t) , x
1
(t) = x
2
(t) = x
3
(t) , and x
1
(t) = x
2
(t) = x
3
(t)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 52
EE/ME 574: Intermediate Controls Section 3.2.0

-a2

-a1 -a0
u(t) x
3
x
2
x
1
x
3
x
2
. .
x
1
.
(Notation follows Bay)
x
3
(t)
x
3
(t) x
3
(t) x
3
(t) x
3
(t)
... .. .
Signal:
Figure 6 (repeated). 1/A(s) constructed in phase-variable form. A TF
denominator of any order can be constructed by chaining n integrators,
introducing n states.
The state equation for the realization of gure 6 may be written:
x(t) =
_

_
x
1
(t)
x
2
(t)
x
3
(t)
_

_
=
_

_
a
2
a
1
a
0
1 0 0
0 1 0
_

_
_

_
x
1
(t)
x
2
(t)
x
3
(t)
_

_
+
_

_
1
0
0
_

_
u(t) (53)

B(s)
A(s)
1
u(t) y(t) x
n
(t)
Figure 5 (repeated). x
n
(t) is generated by Eqn (53).
Looking back to gure 5, the numerator term corresponds to
B(s) =
Y (s)
X
n
(s)
= b
2
s
2
+b
1
s +b
0
(54)
for the m = 2 case. Converting the TF, Eqn (54), back to a diff. eq.,
y(t) = b
2
d
2
x
3
(t)
dt
2
+b
1
d
1
x
3
(t)
dt
+ b
0
x
3
(t) (55)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 53
EE/ME 574: Intermediate Controls Section 3.2.0
The output equation can be built from Eqn (55)
If the system is strictly proper, then b
3
=0, and
y(t) = b
2
x
3
(t) +b
1
x
3
(t) + b
0
x
3
(t) (55, repeated)
But recall the state vector in phase-variable form:
x(t) =
_

_
x
1
(t)
x
2
(t)
x
3
(t)
_

_
=
_

_
x
3
(t)
x
3
(t)
x
3
(t)
_

_
So Eqn (55) can be written:
y(t) =
_
b
2
b
1
b
0
_
x(t) =
_
b
2
b
1
b
0
_
_

_
x
1
(t)
x
2
(t)
x
3
(t)
_

_
=
_
b
2
b
1
b
0
_
_

_
x
3
(t)
x
3
(t)
x
3
(t)
_

_
And the state model can be written:
x(t) =
_

_
a
2
a
1
a
0
1 0 0
0 1 0
_

_
x(t) +
_

_
1
0
0
_

_
u(t) (56)
y(t) =
_
b
2
b
1
b
0
_
x(t) +[0] u(t) (57)

-a2

-a0
b0 b1 b2
u(t)
y(t)
x3 x2 x1 x3 x2
. .
x1
.
+
-a1
T(s) =
b
2
s
2
+ b
1
s + b
0
s
3
+ a
2
s
2
+ a
1
s + a
0
Figure 7: Strictly proper system in controllable canonical form.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 54
EE/ME 574: Intermediate Controls Section 3.2.1
3.2.1 Example, state-space model from a transfer function
Example
>> num = [2 3 4]
>> den = [1 6 7 8] %% Note a0 = 1
>> TF = tf(num, den) %% Obtain the tf model
Transfer function: 2 s^2 + 3 s + 4
---------------------
s^3 + 6 s^2 + 7 s + 8
%% Generate the state-variable model
%% in Controllable Canonical Form
>> [Fp, Gp, Hp, Jp] = tf2ss(num, den)
Fp = -6 -7 -8 Gp = 1
1 0 0 0
0 1 0 0
Hp = 2 3 4 Jp = 0
Compare with:
x(t) =
_

_
a
2
a
1
a
0
1 0 0
0 1 0
_

_
x(t) +
_

_
1
0
0
_

_
u(t)
y(t) =
_
b
2
b
1
b
0
_
x(t) +[0] u(t) (58)
The coefcients of A(s) and B(s) are simply plugged into F
p
and H
p
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 55
EE/ME 574: Intermediate Controls Section 3.2.2
3.2.2 One more complication
To reduce sensitivity in certain numerical computations, the ss() routine
balances the state-space realization when converting from a TF
This results in modied numerical values
>> TF1 = tf( num, den)
>> SS1 = ss( TF1 )
a = x1 x2 x3
x1 -6 -1.75 -2
x2 4 0 0
x3 0 1 0
c =
x1 x2 x3
y1 1 0.375 0.5
Continuous-time model.
b = u1
x1 2
x2 0
x3 0
d =
u1
y1 0
Compare with controllable canonical form (given by tf2ss()):
Structurally the same, but with balanced values
For EE/ME 574, the take home points are:
1. The state variable model is not unique.
2. tf2ss() gives the model in standard controllable canonical form.
3. ss() gives the model in balanced controllable canonical form.
4. tf2ss() is used in the EE/ME 574 project.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 56
EE/ME 574: Intermediate Controls Section 3.3.0
3.3 Coordinate transformation of a state-variable model
Question: given a state variable model of a system
F
p
, G
p
, H
p
, J
p
x(t)
u(t) y(t)
Is it possible to nd a different realization of the model for the same
system ?
F
p
, G
p
, H
p
, J
p
z(t)
u(t) y(t)
Is it possible to nd all possible alternative realizations ?
Example of two model realizations of a given system:
>> SSuy1=ss(Fp, Gp, Hp, Jp)
Fp= x1 x2 Gp= u1
x1 -4 0 5
x2 1 -3 0
Hp= x1 x2 Jp= u1
y1 0 2 0
>> tf(SSuy1)
Transfer function:
10
--------------
s^2 + 7 s + 12
>> SSuy2 = ss(Fp2, Gp2, Hp2, Jp2)
Fp2= x1 x2 Gp2= u1
x1 -4 0 5
x2 0 -3 5
Hp2= x1 x2 Jp2= u1
y1 2 -2 0
>> tf(SSuy2)
Transfer function:
10
--------------
s^2 + 7 s + 12
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 57
EE/ME 574: Intermediate Controls Section 3.3.1
3.3.1 Derivation of the state model transformation
Starting with the state model based on state vector x(t)
x(t) = Fp x(t) +Gp u(t) (59)
y(t) = H
p
x(t) +J
p
u(t) (60)
The new state vector z(t) is related to the original by a transformation
matrix T:
z(t) = T x(t) (61)
We can derive a new state model based on z(t). From Eqn (61) we can solve
for x(t):
x(t) = T
1
z(t) (62)
x(t) = T
1
z(t) (63)
Plugging (61)-(63) into Eqns (59) and (60) gives the state model
T
1
z(t) = F
p
T
1
z(t) +G
p
u(t) (64)
y(t) = Hp T
1
z(t) +Jp u(t)
Left-multiplying Eqn (64) by T gives:
z(t) = T F
p
T
1
z(t) +T G
p
u(t) (65)
y(t) = H
p
T
1
z(t) +J
p
u(t)
which can be rewritten as: With:
z(t) =

F
p
z(t) +

G
p
u(t) (66)
y(t) =

H
p
z(t) +J
p
u(t) (67)

F
p
= T F
p
T
1
(68)

G
p
= T G
p
(69)

H
p
= H
p
T
1
(70)
J
p
: unchanged (71)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 58
EE/ME 574: Intermediate Controls Section 3.3.2
3.3.2 Example: transforming a system model into modal coordinates
Starting with the voice-coil motor system model (R
a
increased to have real
poles in the example, method works for real or complex poles).
Fp = -0.1500 0 3.1500
1.0000 0 0
-31.5000 0 -25.0000
Hp = 0 1 0
>> SSuy1 = ss( Fp, Gp, Hp, Jp)
>> Guy1 = tf( SSuy1 )
Transfer function: 157.5
-----------------------
s^3 + 25.15 s^2 + 103 s
Gp = 0
0
50
Jp = 0
Find the eigensystem of F
p
>> [V, U] = eig(Fp)
V = 0 0.5303 -0.1567
1.0000 -0.1030 0.0078
0 -0.8415 0.9876
U = 0 0 0
0 -5.1483 0
0 0 -20.0017
Choose (Recall:

Fp = T Fp T
1
and U = V
1
AV)
>> T = inv(V)
T = 0.2428 1.0000 0.0306
2.5201 0 0.3999
2.1473 0 1.3533
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 59
EE/ME 574: Intermediate Controls Section 3.3.2
Form the new model matrices:
>> Fphat = T*Fp*inv(T)
Fphat = 0 -0.0000 0.0000
0 -5.1483 0.0000
0 -0.0000 -20.0017
>> Hphat = Hp*inv(T)
Hphat = 1.0000 -0.1030 0.0078
>> Gphat = T*Gp
Gphat = 1.5295
19.9945
67.6637
>> SSuy2 = ss( Fphat, Gphat, Hphat, Jp)
>> Guy2 = tf( SSuy2 )
Transfer function: 157.5
-----------------------
s^3 + 25.15 s^2 + 103 s
0 0.5 1 1.5 2 2.5
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
0 0.5 1 1.5 2 2.5
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
_
x(t) , F
p
, G
p
, H
p
, J
p
_
_
z(t) ,

F
p
,

G
p
,

H
p
, J
p
_
Figure 8: Step response of two realizations of the voice-coil motor.
The model above and on page 59 are two model realizations for one system.
Look at the

F
p
matrix. The states are decoupled.
The elements of the state vector z(t) are called the modes of the system.
The state model in the form using

F
p
is called the model in modal
coordinates.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 60
EE/ME 574: Intermediate Controls Section 3.3.3
3.3.3 Summary of coordinate transformation
Given a model
x(t) = F
p
x(t) +G
p
u(t)
y(t) = H
p
x(t) +J
p
u(t)
And any invertible matrix T
We can construct a new realization of the system model with
z(t) =

F
p
z(t) +

G
p
u(t)
y(t) =

H
p
z(t) +J
p
u(t)

F
p
= T F
p
T
1

G
p
= T G
p

H
p
= H
p
T
1
J
p
: unchanged
The set of all possible forms for the system model is given by the set of all
possible invertible matrices T.
Some forms have particular theoretical or practical interest, such as modal
coordinates.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 61
EE/ME 574: Intermediate Controls Section 4.0.0
4 Introducing state-feedback control
Put in State Feedback control
u(t) =Kx(t) +N
f
r (t) (72)
The control signal depends on the state vector and a reference input.
Putting in feedback control is illustrated in gures 9, 10 and 11.
F
p
, G
p
, H
p
, J
p
x(t)
u(t) y(t)
Figure 9: State-variable model of the open-loop system (the plant). This is the
plant before feedback control is applied, u(t) as input, and y(t) as
output.
Fp, Gp, Hp, Jp
x(t)
u(t)
y(t)
x(t)
-K
+
+
Nf
r(t)
r(t)
New System
Figure 10: State-variable model of the closed-loop system with feed-forward gain
in input. The closed-loop system has r (t) as input and y(t) as output.
F
cl
, G
cl
, H
cl
, J
cl
x(t)
r(t) y(t)
New System
Figure 11: State-space model of the closed-loop system, with r (t)as input and
y(t) as output.
Feedback control fundamentally transforms the system. Changing the state-
variable model from gure 9 to 11.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 62
EE/ME 574: Intermediate Controls Section 4.1.0
4.1 Determination of a new model with state feedback
To determine the state-variable model of the system with feedback, start
with the open-loop model (gure 9)
x(t) = Fp x(t) +Gp u(t) (11, repeated)
y(t) = H
p
x(t) +J
p
u(t) (12, repeated)
Plugging the control law
u(t) =Kx(t) +N
f
r (t) (72, repeated)
into the state equation, we nd
x(t) = F
p
x(t) +G
p
_
Kx(t) +N
f
r (t)
_
= F
p
x(t) G
p
Kx(t) +G
p
N
f
r (t)
= (F
p
G
p
K) x(t) +G
p
N
f
r (t)
So we can write
x(t) = F
cl
x(t) +G
cl
u(t) (73)
with
F
cl
= F
p
G
p
K (74)
G
cl
= G
p
N
f
(75)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 63
EE/ME 574: Intermediate Controls Section 4.1.0
Plugging the control law into the output equation, we nd
y(t) = H
p
x(t) +J
p
_
Kx(t) +N
f
r (t)
_
= H
p
x(t) J
p
Kx(t) +J
p
N
f
r (t)
= (Hp Jp K) x(t) +Jp N
f
r (t)
So we can write
y(t) = H
cl
x(t) +J
cl
r (t) (76)
with
H
cl
= H
p
J
p
K (77)
J
cl
= Jp N
f
(78)
Eqns (73)-(78) describe how we determine the state-variable model of the
system with feedback control.
State feedback control is fundamentally different from single-loop,
compensated feedback:
Feedback is based on the state vector
There is no compensator transfer function G
c
(s)
The control gains form a vector, K R
mn
m is the number of inputs
n is the number of states
For the voice-coil motor introduced in section 1.1:
u(t) = Kx(t) +N
f
r (t) (79)
K =
_
k
1
k
2
k
3
_
(80)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 64
EE/ME 574: Intermediate Controls Section 4.2.1
4.2 Determining N
f
With state-feedback control, the model is given as:
x(t) = F
cl
x(t) +G
cl
u(t) (81)
y(t) = H
cl
x(t) +J
cl
r (t) (82)
with
F
cl
= F
p
G
p
K, G
cl
= G
p
N
f
H
cl
= H
p
J
p
K, J
cl
= J
p
N
f
The transfer function for a state variable model was derived in Eqn (49).
Applying Eqn (49) to the closed-loop system gives:
T
ry
(s) = H
cl
, (sI F
cl
)
1
G
cl
+J
cl
= H
cl
(sI F
cl
)
1
G
p
N
f
+J
p
N
f
Evaluating T
ry
(s = 0), the DC gain is given as:
Try(s = 0) =
_
H
cl
(F
cl
)
1
G
p
+J
p
_
N
f
(83)
We can make the DC gain of T
ry
(s) = 1.0 by choosing
N
f
=
1
_
H
cl
(F
cl
)
1
G
p
+J
p
_ (84)
Eqn (84) looks a bit complicated. But as we will see, it is straight forward
to calculate. In the common case that J
p
= 0, Eqn (84) simplies to
N
f
=
1
H
p
(F
cl
)
1
G
p
(85)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 65
EE/ME 574: Intermediate Controls Section 4.3.0
4.2.1 Note on N
f
and SSE(step) = 0
When the model knowledge is ideal, the choice for N
f
will give zero steady
state error for step input.
Practically: if the DC gain is an approximation, N
f
will be an
approximation, and the steady state error will be greater than zero, and
depend on the loop gain in the usual way.
4.3 Example system with state feedback
For a rst experiment, try K =
_
2 5 1
_
,
Which corresponds to u(t) =2.0v(t) 5.0z(t) 1.0i (t) +N
f
r (t)
>> K1 = [ 2 5 1]
%% Determine Fcl and Hcl from K1
>> Fcl1 = Fp - Gp * K1
Fcl1 = -0.1500 0 3.1500
1.0000 0 0
-131.5000 -250.0000 -65.0000
>> Hcl = Hp - Jp*K1
Hcl = 0 1 0
%% Determine Nf1
>> Nf1 = 1 / (Hcl * inv(-Fcl1) * Gp + Jp), Nf1 = 5
%% Determine the rest of the CL model
>> Gcl = Gp * Nf1 >> Jcl = Jp * Nf1
Jcl = 0
Gcl = 0
0
250
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 66
EE/ME 574: Intermediate Controls Section 4.3.0
>> figure(1), clf
>> step(ss(Fcl1, Gcl1,...
Hcl, Jcl), 2)
0 0.5 1 1.5 2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
ClosedLoop Step Response, current
Time (sec)
A
m
p
litu
d
e
Figure 12: Closed-Loop system step response.
Looking at the closed-loop poles
First, the eigenvalues of the system matrix
>> CLPoles = eig(Fcl1) %% Poles are eigenvalues
CLPoles = -58.0841 %% of the system matrix
-3.5330 + 1.0374i
-3.5330 - 1.0374i
Now using the pole command, applied to the CL system model
>> SSry1 = ss(Fcl1, Gcl1, Hcl, Jcl);
>> CLPoles = pole(SSry1) %% Poles from state model
CLPoles = -58.0841
-3.5330 + 1.0374i
-3.5330 - 1.0374i
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 67
EE/ME 574: Intermediate Controls Section 5.0.0
5 State-space controller design, determine K and N
f
State feedback design is fundamentally different from frequency-response
or root-locus design
We will see the two most common methods for state-space controller design:
1. Pole placement
Design procedure:
(a) Choose the desired pole locations
(b) Calculate K to give the desired closed-loop poles
%% Pd is a vector of desired pole locations
>> Pd = [p1, p2, p3]
>> K = place(Fp, Gp, Pd);
(c) Calculate N
f
for y(t) = r (t) in steady state
2. Linear Quadratic Regulator (LQR) design, a form of optimal control
Design procedure:
(a) Specify a cost function
(b) Calculate the K to minimize the cost function
(c) Calculate N
f
for y(t) = r (t) in steady state
Pole placement and LQR design determine K. N
f
is given by Eqn (85).
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 68
EE/ME 574: Intermediate Controls Section 5.1.0
5.1 State-Space Controller Design Method #1: Pole Placement
(See Franklin et al. 5
th
ed. section 7.5)
Under very general conditions, the poles of the closed-loop system can be
arbitrarily placed by proper choice of K
System has n poles (n degrees of freedom)
K has n elements (n degrees of freedom)
Original system matrix, F
p
System matrix with feedback, F
cl
= F
p
G
p
K
Design procedure:
1. Choose the desired pole locations, S =
_
s
1
s
2
s
n
_
2. Calculate K to give the desired closed-loop poles
>> K = place(Fp, Gp, S) %% Kautsky-Nichols algorithm
>> K = acker(Fp, Gp, S) %% Ackermans formula
Mathworks recommends the Kautsky-Nichols algorithm, place(),
for most cases.
Ackermans formula may succeed for repeated roots where the
Kautsky-Nichols algorithm fails.
3. Calculate N
f
for y(t) = r (t) in steady state
>> Fcl = Fp - Gp * K %% Form closed-loop Syst. Mat.
>> Hcl = Hp - Jp * K %% Form closed-loop Output
>> Nf = 1/(Hcl*inv(-Fcl)*Gp+Jp) %% Nf for CL DC Gain = 1.0
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 69
EE/ME 574: Intermediate Controls Section 5.1.1
5.1.1 Pole placement example
Steps:
1. Select the desired pole locations
Suggestion: do not choose repeated poles.
2. Compute the needed K using pole placement
3. Compute the needed N
f
using Eqn (85)
Example:
>> DesiredPoles0 = [ -2, -2+0.2*j, -2-0.2*j] %% Desired poles
>> K2 = place(Fp, Gp, DesiredPoles0) %% K by K-N algorithm
K2 = -0.5591 0.0513 -0.1830
>> K3 = acker(Fp, Gp, DesiredPoles0) %% K by Ack. formula
K3 = -0.5591 0.0513 -0.1830
>> Fcl2 = Fp - Gp * K2 %% Form the CL Syst. Mat.
Fcl2 = -0.1500 0 3.1500
1.0000 0 0
-3.5437 -2.5651 -5.8500
%% Determine Nf2
>> KDC0 = Hcl2 * inv(-Fcl2) * Gp + Jp
KDC0 = 19.4926
%% Determine Gcl
>> Gcl2 = Gp*Nf2
Gcl2 = 0
0
2.5651
>> Nf2 = 1/KDC0
Nf2 = 0.0513
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 70
EE/ME 574: Intermediate Controls Section 5.1.1
Examine the closed-loop poles to be sure we got the desired poles.
%% Check the CL Poles
>> CLPoles2 = eig(Fcl2) %% Determine CL Poles
CLPoles2 = -2.0000 + 0.2000i
-2.0000 - 0.2000i
-2.0000
Form a state-variable model of the closed-loop system:
>> SSry2 = ss(Fcl2, Gp*Nf2, Hp-Jp*K2, Jp*Nf2)
%% The ss command pretty prints the model
a = x1 x2 x3
x1 -0.15 0 3.15
x2 1 0 0
x3 -3.544 -2.565 -5.85
c = x1 x2 x3
y1 0 1 0
b = u1
x1 0
x2 0
x3 2.565
d = u1
y1 0
>> figure(4), clf ; step(SSry2, 4)
0 0.5 1 1.5 2 2.5 3 3.5 4
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 13: Closed-Loop system with K = K
2
, step response.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 71
EE/ME 574: Intermediate Controls Section 5.1.2
5.1.2 Try pole-placement control design, twice as fast
>> DesiredPoles2b = [ -4, -4+0.2*j, -4-0.2*j]
>> K2b = place(Fp, Gp, DesiredPoles2b)
K2b = -0.3363 0.4074 -0.0630
>> Fcl2b = Fp - Gp * K2b
Fcl2b = -0.1500 0 3.1500
1.0000 0 0
-14.6865 -20.3683 -11.8500
>> CLPoles2 = eig(Fcl2b) %% CL poles are eigenvalues of CL SS model
CLPoles2 = -4.0000 + 0.2000i
-4.0000 - 0.2000i
-4.0000
>> KDC0 = Hcl * inv( -Fcl2b ) * Gp %% Determine DC gain (with Nf=1)
KDC0 = 2.4548
>> step( ss(Fcl2b, Gp, Hcl, Jp) )
0 0.5 1 1.5 2 2.5 3 3.5 4
0
0.5
1
1.5
2
2.5
Step Response
Time (sec)
A
m
p
litu
d
e
K
DC0
= 2.4548
Figure 14: Step response of closed-loop system with K
2b
, real part of poles
increased 2X. Note change in DCgain, N
f
must be re-computed
whenever K is changed.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 72
EE/ME 574: Intermediate Controls Section 5.1.2
Notes:
Pole placement will be successful, except for uncontrollable or
unobservable systems
Uncontrollable or unobservable systems often require modication of the
system hardware, see section 8.
Pole placement can be sensitive to small variations in parameters
The pole locations relate directly to speed and damping, but not so directly
to accuracy. The desired pole locations may not be obvious.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 73
EE/ME 574: Intermediate Controls Section 5.1.3
5.1.3 Taking a look at the control effort and tracking error
With Matlab and transfer-function modelling, we could easily set up various
transfer function models
>> Try = feedback( Gc*Gp, Hy) %% TF: Input -> Output
>> Tre = feedback( 1, Gc*Gp*Hy) %% TF: Input -> Error
>> Tru = feedback(Gc, Gp*Hy) %% TF: Input -> Control
Similarly, we can build state models with various outputs.
For each of these models,
The state equation remains the same
x(t) = F
cl
x(t) +G
cl
r (t)
Only the output equation changes.
For output y(t)
y(t) = H
p
x(t) +J
p
u(t) = (H
p
J
p
K) x(t) +J
p
N
f
r (t)
>> SSry = ss(Fcl2b, Gcl2b, Hp-Jp*K2b, Jp*Nf2b)
For control signal u(t)
u(t) =Kx(t) +N
f
r (t)
>> SSru = ss(Fcl2b, Gcl2b, -K2b, Nf2b)
For error signal e(t)
e(t) = r (t) y(t) = r (t) (H
cl
x(t) +J
cl
u(t))
= H
cl
x(t) +(1J
cl
) r (t)
>> SSre = ss(Fcl2b, Gcl2b, -Hcl, 1-Jcl)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 74
EE/ME 574: Intermediate Controls Section 5.1.3
>> step(SSry)
>> step(SSru)
>> step(SSre)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Step Response, y(t)
Time (sec)
A
m
p
litu
d
e
Figure 15: Plot of control effort during a step response.
0 0.5 1 1.5 2 2.5 3 3.5
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
U
peak
Step Response, u(t)
Time (sec)
A
m
p
litu
d
e
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Step Response, e(t)
Time (sec)
A
m
p
litu
d
e
Figure 16: Plot of control effort during a step response.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 75
EE/ME 574: Intermediate Controls Section 5.1.3
We can also use the step() command to generate the response data.
Determine U
peak
from a state-variable model
>> uu = step(SSru); %% Determine the u(t) signal
>> Upeak = max(uu) %% Determine the max of u(t)
Upeak = 0.7016
Determine y
ss
and P.O. from a state-variable model
>> yy = step(SSry); %% Determine the y(t) signal
>> Yss = yy(end) %% Determine the steady-state value
Yss = 1.0000
>> PO = 100 * (max(yy)-Yss)/Yss %% Determine the PO
PO = 0
Determine the steady-state error to a step input from a state-variable
model
>> ee = step(SSre); %% Determine the e(t) signal
>> Ess = ee(end) %% Determine e(t) at the end
Ess = 1.1576e-05 %% of the transient
And we can use the bode() command to address questions of frequency
response
>> bode(SSre)
>> Etrack = 100 * bode(SSre, Wt)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 76
EE/ME 574: Intermediate Controls Section 5.2.0
5.2 State-Space Controller Design Method #2: The Linear
Quadratic Regulator, an optimal control method
With other control design methods, the controls engineer selects closed-
loop pole locations (root locus, or pole placement) or other response
characteristics (e.g,
c
and PM in frequency domain design).
The pole locations or other characteristics determine the control gains
and thus the nal, closed-loop performance.
Designing an LQR controller is completely different, for an LQR design,
the controls engineer selects a cost function.
Linear Quadratic Regulator (LQR) controller design determines the
controller gains which will minimize the cost function.
The cost function determines the control gains and the thus nal, closed-
loop performance.
The controls engineer selects the cost function to achieve the design goals
(more on this later).
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 77
EE/ME 574: Intermediate Controls Section 5.2.1
5.2.1 The LQR cost function
A general quadratic cost function has the form:
J (x, u) =
Z

0
_
x
T
(t)Qx(t) +u
T
(t)Ru(t) +2x
T
(t) Nu(t)
_
dt (86)
shapes :
_
x(t)
T
_
_

_
Q
_

_
_

_
x(t)
_

_
+
_
u(t)
T
_
[ R] [ u(t)] +2
_
x(t)
T
_
_

_
N
_

_
[ u(t)]
where: J (x, u) is a cost function, to be minimized.
x(t) R
n
and u(t) R
m
are the state and input signals.
Q R
nn
and R R
mm
are square matrices that put weights the state
and input signals, determining their contributions to the total cost.
N R
nm
determines a contribution to the cost from a product of x and
u. This term is often zero.
First, the regulator case is considered, that is
u(t) =Kx(t)
with no reference input.
In this case, for any stable system the state and output go to zero,
The control signal goes to zero
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 78
EE/ME 574: Intermediate Controls Section 5.2.1
An example is seen in gure 17.
%% Zero-input response of LQR design
>> Q = eye(3); R = eye(1)
>> K4 = lqr(Fp, Gp, Q, R) %% LQR Design
K4 = [ 0.7711 1.0000 0.7896 ]
>> Fcl4 = (Fp - Gp*K4); %% Build CL model
>> Sys = ss(Fcl4, [0;0;0], Hp, Jp)
lsim() command simulates response of the system with initial cond. x(0).
>> tt = 0:0.01:10; X0 = [0;1;0];
>> [y, t, x] = lsim(Sys, zeros(size(tt)), tt, X0);
>> u = - K4 * x; %% Calculate u(t)
0 2 4 6 8 10
0
0.2
0.4
0.6
0.8
1
y
(
t
)
0 2 4 6 8 10
1.5
1
0.5
0
u
(
t
)
t [sec]
Figure 17: Response of the voice-coil motor to initial condition
x(0) =
_
0 1 0
_
T
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 79
EE/ME 574: Intermediate Controls Section 5.2.1
It turns out that for the quadratic cost function
J (x, u) =
Z

0
_
x
T
(t)Qx(t) +u
T
(t)Ru(t) +2x
T
(t) Nu(t)
_
dt
There is a unique value of K that minimizes the cost function for any initial
condition.
This is the K given by the LQR method !
The details of how K is computed is a subject in optimal control
The LQR method gives K, N
f
can be computed in the usual way
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 80
EE/ME 574: Intermediate Controls Section 5.2.2
5.2.2 Designing an LQR controller
Using Matlabs lqr() function
Example, starting with the voice-coil motor model:
F
p
=
_

_
0.15 0 3.15
1 0 0
31.5 0 15
_

_
G
p
=
_

_
0
0
50
_

_
(87)
H
p
=
_
0 1 0
_
J
p
= [0]
Choose the state-error cost matrix (the identity matrix is a good place to
start):
Q = diag
__
1 1 1
__
=
_

_
1 0 0
0 1 0
0 0 1
_

_
Choose the control-effort cost matrix:
R = [1]
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 81
EE/ME 574: Intermediate Controls Section 5.2.2
In Matlab:
>> K4a = lqr(Fp, Gp, Q, R);
K4a = [ 0.7711 1.0000 0.7896 ]
>> Fcl4a = Fp - Gp*K4a; Hcl4a = Hp - Jp * K4a
>> KDC = Hcl4a*inv(-Fcl4a)*Gp + Jp;
>> Nf4a = 1/KDC; %% Determine Nf
Nf4a = 1.0000
>> Gcl4a = Gp*Nf4a; Jcl4a = Jp*Nf4a; %% Define Gcl and Jcl
>> SSry = ss(Fcl4a, Gcl4a, Hcl4a, Jcl4a) %% Define SS object
Verify the response:
>> subplot(2,1,1) %% Plot step response of output
>> step(Fcl4a, Gcl4a, Hcl4a, Jcl4a)
>> subplot(2,1,2) %% Plot step response of control effort
>> step(Fcl4a, Gcl4a, -K4a, Nf4a)
0 1 2 3 4 5 6 7
0
0.2
0.4
0.6
0.8
1
(A)
0 1 2 3 4 5 6 7
0
0.2
0.4
0.6
0.8
1
(B)
Step Response
Time (sec)
A
m
p
litu
d
e
Step Response
Time (sec)
A
m
p
litu
d
e
Characteristics:
Settling time: t
s
5.0 [sec]
Damping: over damped
ISE =0.85
U
peak
= 1.0
Figure 18: Step response of the closed-loop system with rst LQR controller.
(A) Output, (B) Control effort.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 82
EE/ME 574: Intermediate Controls Section 5.2.3
5.2.3 Tuning an LQR controller
For the moment, lets just try a different Q matrix. Lets increase the cost on
position error by 100
Recall that the state vector is:
x(t) =
_

_
v(t)
z(t)
i
a
(t)
_

_
_

_
Cone velocity
Cone position
Winding current
_

_
So choose:
Q
b
=
_

_
1 0 0
0 100 0
0 0 1
_

_
, R=1
>> K4b = lqr(Fp, Gp, Qb, R)
K4b = [ 2.2962 10.0000 0.8744 ]
Nf4b = 10.0
0 1 2 3 4 5 6 7
0
0.5
1
1.5
(A)
Step Response
Time (sec)
A
m
p
litu
d
e
0 1 2 3 4 5 6 7
5
0
5
10
(B)
Step Response
Time (sec)
A
m
p
litu
d
e
Characteristics:
Settling time: t
s
0.46 [sec]
(much faster)
Damping:
slightly under damped
(PO ~ 2%, damping reduced)
ISE =0.0022
(much lower ISE)
Figure 19: Step response of the closed-loop system with second LQR controller.
(A) Output, (B) Control effort.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 83
EE/ME 574: Intermediate Controls Section 5.2.3
By increasing the cost on the position variable, we made
The position error go to zero more quickly
At the expense of a larger velocity transient and greater use of control.
LQR design is really pretty simple:
1. Work with diagonal matrices
2. All values must be non-negative
R matrix must be positive denite
Q matrix must be positive semi-denite
(Often some diagonal elements of Q can be zero)
General idea of LQR design:
Increase cost on states or input that should be reduced or converge to
steady state quickly
Reduce cost on states or input that can be increased
Make large adjustments of Q and R terms, of 10x or 100x (not 20%)
Examples:
If the system is too slow, increase cost on the position element of x.
If the system has too much overshoot, increase cost on the velocity
element of x
If U
peak
is too high, increase R
Use trial and error (a.k.a. Iterative Design)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 84
EE/ME 574: Intermediate Controls Section 5.2.4
5.2.4 Procedure for tuning Q and R
1. Set up the system in state space.
2. Choose initial values for Q and R:
Identity matrices are often a good starting point
(Note: R will be a 1x1 matrix for a single input system)
3. Adjust cost on elements of Q and R matrices to achieve design goals
If error is too large, increase the cost on error
If overshoot is too large, increase the cost on velocity
If control use is too large, increase R

LQR design often gives a desirable controller:
Well damped (we have seen)
Low to moderate control usage
Low to moderate controller gains
LQR-designed controllers tend to be quite robust to variations in plant
parameters
By switching from tuning compensator poles and zeros and loop gain to
tuning Q and R elements, one is trading one set of adjustments for another.
Which is more suitable will depend on the application and on the
experience of the controls designer.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 85
EE/ME 574: Intermediate Controls Section 5.2.5
5.2.5 Further notes on choosing Q and R
1. R R
mm
will be a scalar if the system is single-input
(m is the number of inputs).
2. Often choose Q and R to be diagonal matrices with positive values on the
main diagonal
Zero is OK for some diagonal elements of Q.
It is possible for Q and R to have non-zero off-diagonal elements. The
requirements are:
Q and R must be symmetric, that is Q = Q
T
, R = R
T
All eigenvalues of R must be positive
All eigenvalues of Q must be non-negative
3. The relative values of Q and R matter, not the absolute magnitude
If Q
0
and R
0
give K
0
then Q = 10Q
0
and R = 10R
0
also give K = K
0
(no change).
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 86
EE/ME 574: Intermediate Controls Section 5.2.6
5.2.6 Connection between LQR and the Symmetric Root Locus
In section 7.6 (5
th
ed.) Franklin et al. give a method of LQR based on the
symmetric root locus
The method uses the cost function
J
F
(x, u) =
Z

0
_
y
2
(t) +u
2
(t)
_
dt (88)
which is equivalent to the general LQR cost function, Eqn (86), with the
special choice:
Q =H
T
p
H
p
, R = 1 (89)
(Student activity: prove this, use J
p
= [0].)
The Symmetric Root Locus (SRL) theoretical result is a neat mathematical
result which gives the CL poles when Q is chosen by Eqn (89).
LQR K can be found using the SRL by
1. Determine the CL poles by the SRL method,
2. Determine K by pole placement.
However, there is no real need to use the SRL, since we can nd K directly
with the lqr() command
1. Choose Q and R (possibly set Q and R by Eqn (89))
2. Call K = lqr (F
p
, G
p
, Q, R)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 87
EE/ME 574: Intermediate Controls Section 6.1.0
6 State-variable models with various inputs and
outputs
State space models give the controls engineer the freedom to make many
changes or examine the model in many different ways.
6.1 Considering various inputs
We can add an input just be adding either a new column on the G matrix, or
adding more G matrices.
Consider the voice-coil motor, the original modeling equations are:
M z(t) +b z(t) = k
s
i
a
(t)
L
a
d i (t)
dt
+R
a
i
a
(t) = v
a
(t) k
s
z(t)
We wrote the SS model as:
x(t) = F
p
x(t) +G
p
u(t)
y(t) = H
p
x(t) +J
p
u(t)
with
State vector : x(t) =
_

_
v(t)
z(t)
i (t)
_

_
_

_
Cone velocity
Cone position
Winding current
_

_
Input vector : u(t) = [v
a
(t)] [Applied Voltage]
Output vector : y(t) = [z(t)] [Cone position]
In the original model there is a single input and a single output.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 88
EE/ME 574: Intermediate Controls Section 6.1.0
The model matrices are:
F
p
=
_

b
M
0
ks
M
1 0 0

ks
La
0
Ra
La
_

_
, G
p
=
_

_
0
0
1
La
_

_
H
p
=
_
0 1 0
_
, J
p
= [0] (position output)
Lets suppose there are some additional inputs. As an example, well
consider f
c
(t), an external disturbance force acting on the speaker cone;
and v
n
(t), voltage noise pickup in the wiring.
1. Determine how the new input signals enter into the original model (as
always, be sure units balance). In this case:
f
c
(t) enters the equation for z(t) ,
M z(t) +b z(t) = k
s
i (t) + f
c
(t) (90)
And v
n
(t) enters the equation for d i
a
(t)/dt,
L
d i (t)
dt
+Ri (t) = v
a
(t) k
s
x(t) +v
n
(t) (91)
2. Introduce the signals into the state-variable model. Considering Eqns (90)
and (91), we can write the model as:
x(t) =
_

_
z(t)
z(t)

ia (t)
_

_
=
_

b
M
0
ks
M
1 0 0

ks
La
0
Ra
La
_

_
_

_
z(t)
z(t)
ia (t)
_

_
+
_

_
0
0
1
La
_

_
v
a
(t)+
_

_
1
M
0
0
_

_
f
c
(t)+
_

_
0
0
1
La
_

_
v
n
(t)
(92)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 89
EE/ME 574: Intermediate Controls Section 6.1.0
Eqn (92) has the form
x(t) = F
p
x(t) +G
va
v
a
(t) +G
fc
f
c
(t) +G
vn
v
n
(t) (93)
G
va
reects how control input v
a
(t) enters the dynamic model,
G
fc
reects how disturbance f
c
(t) enters the dynamic model,
G
vn
reects how noise v
n
(t) enters the dynamic model,
G
va
=
_

_
0
0
1
La
_

_
, G
fc
=
_

_
1
M
0
0
_

_
, G
vn
=
_

_
0
0
1
La
_

_
For the model in standard form, we put all input signals on u(t) and the
three G
x
vectors in one, 33 G
p
matrix. x = F
p
x+G
p
u(t) becomes:
_

_
z(t)
z(t)

i
a
(t)
_

_
=
_

b
M
0
ks
M
1 0 0

ks
La
0
Ra
La
_

_
_

_
z(t)
z(t)
i
a
(t)
_

_
+
_

_
0
1
M
0
0 0 0
1
La
0
1
La
_

_
_

_
v
a
(t)
f
c
(t)
v
n
(t)
_

_
where
G
p
=
_

_
0
1
M
0
0 0 0
1
La
0
1
La
_

_
, and u(t) =
_

_
v
a
(t)
f
c
(t)
v
n
(t)
_

_
The system has n states and m inputs, and G
p
R
nm
.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 90
EE/ME 574: Intermediate Controls Section 6.1.0
Now:
The system matrix for feedback control is constructed:
F
cl
= (F
p
G
va
K) (94)
because the control signal is applied on the v
a
(t) input.
Notice the physics of the system determining the modeling.
If we want to consider the response of the closed-loop system to a unit step
of the disturbance force fc (t), then y(t) = H
cl
x(t) +J
d
d (t), so use
>> SSdy = ss(Fcl, Gfc, Hcl, Jd); step( SSdy )
If we want to consider the frequency response to voltage noise v
n
(t), then
y(t) = H
cl
x(t) +J
vn
v
n
(t), so use
>> SSvy = ss(Fcl, Gvn, Hcl, Jvn) ; bode( SSvy )
If we want the transfer function of the open-loop system for a disturbance
force input, setup
Gdy = tf( ss(Fp, Gfc, Hp, Jd) )
If we want the transfer function of the closed-loop systemfor a voltage noise
input and control effort output, then u(t) =Kx(t) +0v
n
(t), so use
>> SSvu = ss(Fcl, Gvn, -K, 0) ; Tvu = tf( SSvu )
And many other input/output combinations can be considered.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 91
EE/ME 574: Intermediate Controls Section 6.1.1
6.1.1 Considering a disturbance input
The most general model for a disturbance input is seen in gure 20, with
x(t) = (F
p
G
p
K) x(t) +G
p
N
f
r (t) +G
d
d (t) (95)
y(t) = H
cl
x(t) +J
cl
r (t) +J
d
d (t) (96)
where G
d
reects the impact of disturbance d (t) on the state derivative, and will
come from considering the basic physical modeling equations of the system, and
J
d
is the direct-transfer term between the disturbance input and the output.
F
p
, G
a
, H
p
, J
p
x(t) u(t)
y(t)
x(t)
-K
+
+
N
f
r(t)
r(t)
New System
d(t)
Figure 20: General disturbance input.
Considering r (t) and d (t) together, one can write Eqns (95) and (96) in a
single, standard state-variable model with:
x(t) = F
cl
x(t) +G
a
u(t) (97)
y(t) = H
cl
x(t) +J
a
u(t) (98)
where
u(t) =
_
_
r (t)
d (t)
_
_
, G
a
=
_

_
| |
G
p
N
f
G
d
| |
_

_
, J
a
=
_
J
cl
J
d
_
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 92
EE/ME 574: Intermediate Controls Section 6.1.1
In the special case that the disturbance is a signal added to the plant input
signal, u(t), then the block diagram looks as in gure 21. And for equations (95)
to (98)
G
d
= G
p
, J
d
= J
p
.
F
p
, G
p
, H
p
, J
p
x(t) u(t)
y(t)
x(t)
-K
+
+
N
f
r(t)
r(t)
New System
d(t)
+
Figure 21: Control additive disturbance input.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 93
EE/ME 574: Intermediate Controls Section 6.2.0
6.2 Considering various outputs
To consider various signals the as output, adjust the H and J matrices accordingly.
For example:
u(t) =Kx(t) +N
f
r (t) so to consider the control effort as output use:
H
u
=K; J
u
= N
f
then
>> SSru = ss( Fcl, Gcl, -K, Nf )
>> bode( SSru ) %% Frequency response of u(t) to input r(t)
Given the state vector, if we want to consider the winding current, then use:
H
i
=
_
0 0 1
_
J
i
= [0]
>> SSri = ss( Fcl, Gcl, Hi, Ji ) %% Closed-loop system, r(t)->i(t)
For example, to plot the step response of the winding current of the
open-loop voice-coil motor to an input step of applied voltage, use:
%% Note open loop system matrix.
>> SSvi_ol = ss(Fp, Gva, Hi, Ji) ; step( SSvi_ol) ;
To plot the step response of the winding current of the closed-loop voice-coil
motor to a unit step disturbance force, use:
%% Note disturbance input, Gfc, and current output
>> SSfi = ss(Fcl, Gfc, Hi, Ji) ; step( SSfi )
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 94
EE/ME 574: Intermediate Controls Section 6.2.0
6.2 Considering various outputs (continued)
If we want to consider the cone velocity, then use:
H
cv
=
_
1 0 0
_
J
cv
= [0]
For example, to plot the step response of the cone velocity of the closed-loop
voice-coil motor to an input step of an external disturbance force applied to
the speaker cone, use:
>> step( ss(Fcl, Gfc, Hcv, Jcv) )
Important fact of state-variable modeling:
Any signal in a linear system can be expressed as a linear combination
of states and inputs.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 95
EE/ME 574: Intermediate Controls Section 6.3.0
6.3 Determining the Steady-State error for a state-variable
model
Steady-state error is given by the nal value theorem as:
e
ss
= lim
t
e(t) = lim
s0
sE (s) = lim
s0
s
E (s)
R(s)
R(s) (99)
For e
ss
, what is needed is the Laplace transform of the error signal.
With a state variable model, F
cl
, G
cl
, H
cl
, J
cl
reecting the closed-loop
system, we can determine E (s)/R(s).
since : e(t) = r (t) y(t) = r (t) (H
cl
x(t) +J
cl
r (t))
>> SSre = ss( Fcl, Gcl, -Hcl, (1-Jcl) ) %% Model r(t) -> e(t)
>> Tre = tf( SSre ) %% E(s) / R(s)
Writing the transfer function E (s)/R(s) as
Tre (s) =
b
m
s
m
+ +b
2
s
2
+b
1
s +b
0
s
n
+a
n1
s
n1
+a
n2
s
n2
+ +a
1
s +a
0
(100)
Then we can plug Eqn (100) into (99) and nd e
ss
.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 96
EE/ME 574: Intermediate Controls Section 6.3.0
System Type using Eqn (100)
For the state variable model, there is not a direct analog to the loop gain.
We can determine the system type by one of two methods:
1. Count the open loop poles at the origin, that is the number of eigenvalues
of F
p
that are equal to zero.
2. Count the number of zeros of the closed-loop error transfer function at
the origin.
For example:
Type 0 system might give the TF
T
re
(s) =
b
m
s
m
+ +b
2
s
2
+b
1
s +b
0
s
n
+a
n1
s
n1
+a
n2
s
n2
+ +a
1
s +a
0
(101)
Type I system might give the TF
T
re
(s) =
b
m
s
m
+ +b
2
s
2
+b
1
s +0
s
n
+a
n1
s
n1
+a
n2
s
n2
+ +a
1
s +a
0
(102)
Type II system might give the TF
T
re
(s) =
b
m
s
m
+ +b
2
s
2
+0s +0
s
n
+a
n1
s
n1
+a
n2
s
n2
+ +a
1
s +a
0
(103)
Just by looking at T
re
(s), we can determine the system type.
Notice Eqns (101)-(103) have a
0
= 0
a
0
= 0 corresponds to a pole of the closed-loop system at the origin.
Such a system would be marginally stable, and is rarely (if ever)
encountered in practice
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 97
EE/ME 574: Intermediate Controls Section 6.3.0
Determining the steady-state error from T
re
(s)
For a Type 0 system, b
0
= 0 , so
lim
s0
s T
re
(s) R(s) = lim
s0
s
b
m
s
m
+ +b
2
s
2
+b
1
s +b
0
s
n
+a
n1
s
n1
+ +a
1
s +a
0
R(s)
= lim
s0
s
b
0
a
0
R(s)
For a step input, R(s) = 1/s, so
e
ss
=
b
0
a
0
(104)
This is logical, b
0
/a
0
is the DC gain of T
re
(s)
For a ramp input, R(s) = 1/s
2
, so
ess = lim
s0
s
b
0
a
0
1
s
2
= (105)
For a Type I system, b
0
= 0 , so
lim
s0
sT
re
(s) R(s) = lim
s0
s
b
m
s
m
+ +b
2
s
2
+b
1
s +0
s
n
+a
n1
s
n1
+ +a
1
s +a
0
R(s)
= lim
s0
s
b
1
s +0
a
0
R(s) = lim
s0
s
b
1
s
a
0
R(s)
For a step input, R(s) = 1/s, so
e
ss
= lim
s0
s
b
1
s
a
0
1
s
= 0 (106)
For a ramp input, R(s) = 1/s
2
, so
e
ss
= lim
s0
s
sb
1
a
0
1
s
2
=
b
1
a
0
(107)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 98
EE/ME 574: Intermediate Controls Section 6.3.1
6.3.1 Example
Considering the voice-coil motor and controller K
4a
, developed in section
5.2.2
Fp = -0.1500 0 3.1500
1.0000 0 0
-31.5000 0 -15.0000
Hp = 0 1 0
Gp = 0
0
50
Jp = 0
K4a = [ 0.7711 1.0000 0.7896 ]
Nf4a = 1.0000
The model r (t)> e(t) is obtained
>> Fcl4a = Fp - Gp*K4a; Gcl4a = Gp*Nf4a ;
>> Hcl4a = Hp - Jp*K4a; Jcl4a = Jp*Nf4a;
%% Consider SSre for K4a
>> SSre = ss(Fcl4a, Gcl4a, -Hcl4a, (1-Jcl4a))
Determine T
re
(s)
>> Tre=tf(SSre)
Transfer function:
s^3 + 54.63 s^2 + 228.8 s - 1.192e-13
-------------------------------------
s^3 + 54.63 s^2 + 228.8 s + 157.5
1.19210
13
0 , system is type I
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 99
EE/ME 574: Intermediate Controls Section 6.3.1
Note the round-off error:
The TF is given as
T
re
(s) = (H
cl
)(sI F
cl
)
1
G
cl
(108)
which evaluates to give
s^3 + 54.63 s^2 + 228.8 s - 1.192e-13
Tre(s) = -------------------------------------
s^3 + 54.63 s^2 + 228.8 s + 157.5
With innite precision arithmetic, the calculation would give
s^3 + 54.63 s^2 + 228.8 s - 0
Tre(s) = -------------------------------------
s^3 + 54.63 s^2 + 228.8 s + 157.5
In the calculation of Eqn (108), round-off error produces the
b
0
=1.192 10
13
term.
b
0
=1.192 10
13
is effectively zero.
The system is Type I
SSE(ramp) = 228.8/157.5=145%
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 100
EE/ME 574: Intermediate Controls Section 6.3.1
Conclusions
For series compensation, we have a short cut for steady-state error based on
the System Type and DC gain.
But SSE is dened in terms of the nal value theorem, based on T
re
(s),
which is easily determined from the state-variable model.
For state-space systems, go back to the basics, and use T
re
(s) to determine
SSE.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 101
EE/ME 574: Intermediate Controls Section 7.1.0
7 Integral control: augmenting the model with an
integral control state
The PID control law is:
u(t) = k
p
e(t) +k
d
e(t) +k
i
Z
t
0
e()d (109)
Integral control has an internal state (the integral of error)
=To introduce integral control, we must add a state to the state vector
Dene
i
e
(t) =
Z
t
0
e()d , or
d
dt
i
e
(t) = y(t) r (t) (110)
If i
e
(t) were in the state vector, we could put k
i
in the control vector, and we
would have integral control !
Adding a controller state, such as i
e
(t), results in an augmented state vector.
7.1 Augment the state vector with controller states
We can augment the state vector with controller states,
x
a
(t) =
_

_
.
.
.
x
p
(t)
.
.
.

x
c
(t)
_

_
(111)
where
x
a
(t) is the augmented state vector (the state vector of the complete
system)
x
p
(t) are the original plant states, and
x
c
(t) is the controller states, such as x
c
(t) = [i
e
(t)]
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 102
EE/ME 574: Intermediate Controls Section 7.1.0
Augmenting the state vector increases the size of the F, G, H and J matrices
x
a
(t) =

_
x
p
(t)

x
c
(t)
_

_
=
_

_
F
p
.
.
. 0

F
cp
.
.
. F
cc
_

_
_

_
x
p
(t)

x
c
(t)
_

_
+
_

_
G
p

G
cu
_

_
u(t) +
_

_
0

G
cr
_

_
r (t)
y(t) =
_
H
p
.
.
. 0
_
x
a
(t) +[J
p
] u(t) (112)
The control signal can be written
u(t) =K
p
x
p
(t) K
c
x
c
(t) +N
f
r (t) =K
a
x
a
(t) +N
f
r (t) (113)
where K
a
=
_
K
p
.
.
. K
c
_
is the controller gains designed for the augmented
system.
Writing out the individual equations, we nd
x
p
(t) = F
p
x
p
(t) +G
p
u(t) (unchanged)
y(t) = H
p
x
p
(t) +J
p
u(t) (unchanged)
Controller state equation is:
x
c
(t) = F
cp
x
p
(t) +F
cc
x
c
(t) +G
cu
u(t) +G
cr
r (t) (114)
F
cp
determines how the controller state(s) depend on x
p
(t)
F
cc
determines in internal dynamics of the controller state(s)
G
cu
is a coupling of u(t) to x
c
(t), internal to the controller
G
cr
is a coupling of r (t) to x
c
(t), internal to the controller
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 103
EE/ME 574: Intermediate Controls Section 7.1.0
Returning to the augmented state model, and dening
F
a
=
_

_
F
p
.
.
. 0

F
cp
.
.
. F
cc
_

_
is the augmented state transition matrix ;
G
au
=
_

_
G
p

G
cu
_

_
, G
rr
=
_

_
0

G
cr
_

_
are the augmented input matrices;
H
a
= [H
p
, 0] is the augmented output vector
J
p
is unchanged
The augmented state model becomes:
x
a
(t) = F
a
x
a
(t) +G
au
u(t) +G
rr
r (t) (115)
y(t) = H
a
x
a
(t) +J
p
u(t)
Using the control law:
u(t) =K
a
x
a
(t) +N
f
r (t) (116)
gives the closed-loop model is given as
x
a
(t) = (F
a
G
au
K
a
)x
a
(t) +
_
G
au
N
f
+G
rr
_
r (t) (117)
y(t) = (H
a
J
p
K
a
) x
a
(t) +J
p
N
f
r (t)
Notes
All matrices and matrix components are the appropriate size,
e.g., F
cp
R
1np
if there is 1 controller state, and n
p
plant states.
Student
Exercise Student exercise: determine the sizes of each element in F
a
, G
a
, H
a
, J
a
.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 104
EE/ME 574: Intermediate Controls Section 7.1.0
Writing:
G
ar
=
_
G
au
N
f
+G
rr
_
=
_

_
N
f
G
p

Gcu N
f
+Gcr
_

_
(118)
Putting together Eqns (117), (116) and (118) gives the closed-loop model:
x
a
(t) = F
cl
x
a
(t) +G
ar
r (t) (119)
y(t) = H
cl
x
a
(t) +J
cl
r (t)
where
F
cl
= F
a
G
au
K (120)
G
ar
= G
au
N
f
+G
rr
H
cl
= H
a
J
p
K
J
cl
= J
p
N
f
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 105
EE/ME 574: Intermediate Controls Section 7.2.0
7.2 Block diagram of state-variable controller with
controller states
Plant
F
p
, G
p
, H
p
, J
p
x
p
(t)
Controller
F
cc
, G
x
, 0, 0
x
c
(t)
+
u(t) y(t)
G
cu
-K
a
N
f
r(t)
G
cr
x
a x
c
x
p
x
c
(t)
x
p
(t)
x
p
Figure 22: Block diagram of a state-space model with controller states, such as
integral control.
A block diagram for integral control is seen in gure 22.
Everything outside the plant is implemented as equations in the controller
(typically a program in an embedded micro processor)
The control vector K
a
processes both x
p
(t) and x
c
(t) terms:
u(t) =K
a
_

_
x
p
(t)

x
c
(t)
_

_
+N
f
r (t)
The controller has internal state x
c
(t) (values inside the control CPU). These
are updated according to Eqn (114)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 106
EE/ME 574: Intermediate Controls Section 7.3.0
The complete system of gure 22 is encapsulated as a single state-variable
model with input r (t) and output y(t) and governed by:
x
a
(t) = F
cl
x
a
(t) +G
ar
r (t) (119, repeated)
y(t) = H
cl
x
a
(t) +J
cl
r (t)
Plant + Controller
F
cl
, G
ar
, H
a
, J
p
x
a
(t)
r(t)
y(t)
x
a
(t)
Figure 23: Block diagram of the complete Plant + Controller system.
7.3 Example, integral control for the voice-coil motor
Add the error integrator state (note sign, could be done either way):
x
c
(t) = [i
e
(t)] =
Z
t
0
e(t) d =
Z
t
0
(y() r ()) d , n
c
= 1
Assuming J
p
=0, so that y(t) =H
p
x
p
(t) , determine the derivative equation
for the new controller state
x
c
(t) =

i
e
(t) =e(t)
x
c
(t) = e(t) = y(t) r (t) = (H
p
x
p
(t) +J
p
u(t)) r (t)
=
_
(H
p
J
p
K
p
) x
p
(t) J
p
K
c
x
c
(t) +J
p
N
f
r (t)
_
r (t)
= (H
p
J
p
K
p
) x
p
(t) J
p
K
c
x
c
(t) +
_
1+J
p
N
f
_
r (t) (121)
Comparing with Eqn (114)
x
c
(t) = F
cp
x
p
(t) +F
cc
x
c
(t) +G
cu
u(t) +G
cr
r (t) (114, repeated)
we nd:
Fcp = Hp Jp Kp , Fcc =Jp Kc , Gcu = 0, Gcr = (1+J
cl
)
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 107
EE/ME 574: Intermediate Controls Section 7.3.0
Voice-coil motor example
. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Voice Coil with Integral Control
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Setup Model open-loop model (Ka = [Kp, Kc] = Null)
>> Fcp = Hp;
>> Fcc = 0; %% Controller state terms
>> Gcu = 0;
>> Gcr = (-1 + Jp);
%% Augmented model terms
>> Fa = [Fp , [0;0;0] ;
Fcp, Fcc ]
>> Gau = [Gp; Gcu]
>> Ha = [Hp, 0]
The augmented model is
Fa = -0.1500 0 3.1500 0
1.0000 0 0 0
-31.5000 0 -15.0000 0
0 1.0000 0 0
Ha = 0 1 0 0
Gau = 0
0
50
0
Jp = 0
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 108
EE/ME 574: Intermediate Controls Section 7.3.0
%% Now design Ka (needed to determine Nf)
>> Q = diag([ 1 100 1 2]); R = 1;
>> K5a = lqr(Fa, Gau, Q, R)
K5a = 2.3484 10.4203 0.8772 1.4142
%% For initial analysis, set Nf to 0
>> Nf0 = 0
>> Gar0 = [Nf0 * Gp; Nf0*Gcu + Gcr]
>> SSry0 = ss( (Fa-Gau*K5a), Gar0, Ha, Jp)
Build the error model from e(t) = r (t) y(t) = r (t) (H
a
x
a
(t) +J
a
r (t))
>> SSre0 = ss( (Fa-Gau*K5a), Gar0, -Ha, (1-Jp))
200
150
100
50
0
M
a
g
n
itu
d
e
(d
B
)
10
3
10
2
10
1
10
0
10
1
10
2
10
3
360
270
180
90
0
P
h
a
s
e
(d
e
g
)
Bode SSry0
Frequency (rad/sec)
0 10 20 30 40 50
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Step SSry0
Time (sec)
A
m
p
litu
d
e
Figure 24: r (t) y(t) Bode plot and step response, SSry0
60
40
20
0
20
M
a
g
n
itu
d
e
(
d
B
)
10
3
10
2
10
1
10
0
10
1
10
2
45
0
45
90
P
h
a
s
e
(
d
e
g
)
Bode SSry0
Frequency (rad/sec)
0 10 20 30 40 50
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Step SSre0
Time (sec)
A
m
p
litu
d
e
Figure 25: r (t) e(t) Bode plot and step response of error, SSre0
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 109
EE/ME 574: Intermediate Controls Section 7.3.1
7.3.1 Now, set N
f
With integral control, the closed-loop DC gain of SS
ry
is 1.0, no matter what
the value of N
f
(including N
f
= 0!)
One method to choose N
f
: choose N
f
so that i
e
(t) goes to zero
Examining the response of i
e
(t) for N
f
= 0
>> SSri0 = ss( (Fa-Gau*K5a), Gar0, [0 0 0 1], 0)
40
20
0
20
M
a
g
n
itu
d
e
(
d
B
)
10
3
10
2
10
1
10
0
10
1
10
2
45
90
135
180
P
h
a
s
e
(
d
e
g
)
Bode SSri0
Frequency (rad/sec)
0 5 10 15 20 25 30 35 40 45
8
7
6
5
4
3
2
1
0
Step SSri0
Time (sec)
A
m
p
litu
d
e
Figure 26: r (t) i
e
(t) Bode plot and step response of error, SSre0
Choose N
f
to make i
e
(t) 0 by canceling the contributions due G
p
and
G
cr
, with H
ie
=
_
0 0 0 1
_
%% DC gain from r(t) input to ie(t), through Gcr
>> iss1 = [0 0 0 1] * inv( -Fcl ) * [0*Gp; 0*Gcu+1*Gcr]
%% DC gain from r(t) input to ie(t), through Gp
>> iss2 = [0 0 0 1] * inv( -Fcl ) * [1*Gp; 1*Gcu+0*Gcr]
%% Choose Nf so that Nf iss2 + iss1 = 0;
>> Nf5a = - iss1/ iss2
Nf5a = 10.2975
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 110
EE/ME 574: Intermediate Controls Section 7.3.1
%% Final Closed loop system
>> Gar = [Nf5a * Gp; Nf5a*Gcu+Gcr]
>> SSry = ss( (Fa-Gau*K5a), Gar, Ha, Jp)
>> SSre = ss( (Fa-Gau*K5a), Gar, -Ha, 1-Jp)
150
100
50
0
50
M
a
g
n
itu
d
e
(d
B
)
10
1
10
0
10
1
10
2
10
3
270
180
90
0
P
h
a
s
e
(d
e
g
)
Bode SSry
Frequency (rad/sec)
0 1 2 3 4 5 6 7 8
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step SSry
Time (sec)
A
m
p
litu
d
e
Figure 27: r (t) y(t) Bode plot and step response, SSry
100
50
0
50
M
a
g
n
itu
d
e
(d
B
)
10
3
10
2
10
1
10
0
10
1
10
2
45
0
45
90
135
P
h
a
s
e
(d
e
g
)
Bode SSry
Frequency (rad/sec)
0 1 2 3 4 5 6 7 8
0.2
0
0.2
0.4
0.6
0.8
1
1.2
Step SSre
Time (sec)
A
m
p
litu
d
e
Figure 28: r (t) e(t) Bode plot and step response of error, SSre
Comparing gures 24 and 27, changing N
f
from 0 to 10.2975
1. Enormously accelerates the system
2. Introduces some overshoot.
Like any controller parameter, N
f
can be tuned to meet systemrequirements.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 111
EE/ME 574: Intermediate Controls Section 7.4.0
7.4 Summary of integral control
To use a controller design with internal state(s), we augment the state vector
with the controller state(s), using Eqn (115).
Specically, to put in integral control introduce
i
e
(t) =
Z
t
0
e()d, which gives
d
dt
i
e
(t) =
d
dt
x
c
(t) = y(t) r (t)
by choosing
F
cp
= H
p
J
p
K
p
, F
cc
=J
p
K
p
, G
cu
= 0, G
cr
=1+J
cl
which leads to:
F
a
=
_

_
F
p
.
.
. 0

H
p
J
p
K
p
.
.
. J
p
K
p
_

_
, G
au
=
_

_
G
p

0
_

_
, G
ar
=
_

_
N
f
G
p

1+J
cl
_

_
Control can then be designed by:
1. Determine the K
a
vector by
(a) LQR
(b) Pole placement
2. Select N
f
for good transient response (as given in example 7.3.1, or by
trial and error, or other method)
Integral control can signicantly improve performance, especially accuracy.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 112
EE/ME 574: Intermediate Controls Section 8.0.0
8 Controllability and observability
No discussion of State-Variable models would be complete without a
discussion of observability and controllability (R. E. Kalman [1960, 1962]).
Modes correspond to energy storage elements in the system
When a pole and a zero cancel, the mode remains in the system:
Example: a pole-zero cancellation (g 29(A)).
The mode disappears from the transfer function.
The mode - and energy storage element - remains in the system:
Either the signal of the mode does not appear in the output
(Unobservable, g 29(B));
Or the input signal cant reach the mode (Uncontrollable, g 29(C)).
s+3
(s+3) (s+4)
u(t)
y(t)
(A) System with pole-zero cancellation.
s+3
(s+3) (s+4)
u(t)
y(t)
(B) Unobservable system (state hidden from output)
1
s+3
(s+3) (s+4)
u(t)
y(t)
(C) Uncontrollable system (state untouched by input)
1
B(s)
A(s)
u(t)
y(t)
Figure 29: A pole-zero cancellation can physically occur in either the input or
output path.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 113
EE/ME 574: Intermediate Controls Section 8.2.0
8.1 Main facts about uncontrollable or unobservable modes:
Even if a pole and zero cancel, the system still has that mode in its response.
Challenge: if a pole and zero cancel, it means that feedback control can do
nothing about the mode:
If the mode is unstable, feedback control cannot stabilize the system.
If the mode is slow or lightly damped, it will remain slow or lightly
damped.
If the mode is fast and well damped: uncontrollability or
unobservability is often not a problem.
How do uncontrollable or unobservable modes get excited:
Disturbances (dont go through zeros of control input path),
Initial conditions,
Non-linearities, etc.
8.2 Denitions
Controllable System: The system can be driven from any state, x
0
, to any state,
x
1
, by suitable choice of input signal. Equivalently, the input signal reaches
each mode.
Figure 29(C) shows an uncontrollable system.
Observable System: The state x(t = 0) can be determined by observing y(t).
Equivalently, the response of each mode reaches the output signal.
Figure 29(B) shows an unobservable system.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 114
EE/ME 574: Intermediate Controls Section 8.3.1
8.3 Mathematical tests:
8.3.1 Test for controllability
Test 1: If the controllability matrix is full rank, then the system is controllable:
C =
_
G
p
F
p
G
p
F
2
p
G
p
F
(n1)
p G
p
_
(122)
System is controllable if C is full rank.
Example:
F
p
=
_

_
1 0
1 1
_

_ , G
p
=
_

_
2
1
_

_
C =
_
G
p
, F
p
G
p
_
=
_

_
_

_
2
1
_

_,
_

_
1 0
1 1
_

_
_

_
2
1
_

_
_

_ =
_

_
2 2
1 1
_

_
since the rank of C is 1 (not 2), the system is uncontrollable.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 115
EE/ME 574: Intermediate Controls Section 8.3.2
8.3.2 Test for observability
Test 1: If the observability matrix is full rank, then the system is observable:
O =
_

_
H
p
H
p
F
p
H
p
F
2
p
.
.
.
H
p
F
(n2)
p
_

_
(123)
System is observable if O is full rank.
Example:
F =
_

_
1 0
1 1
_

_ H =
_
0 1
_
O =
_

_
H
HF
_

_ =
_

_
_
0 1
_
_
0 1
_
_

_
1 0
1 1
_

_
_

_
=
_

_
0 1
1 1
_

_
since the rank of O is 2, the system is observable.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 116
EE/ME 574: Intermediate Controls Section 8.4.0
8.4 Summary Controllability and Observability
The order of the system is based on the number of storage elements (or 1
st
order differential equations).
If a pole and zero cancel, it does not remove an energy storage element
from the system: the mode is still in there.
Controllability and observability are properties of the system, not the
controller.
There is no way to x a controllability or observability problem by
choosing a different controller.
Most often controllability or observability problems are xed by changing
(or adding) an actuator; or changing (or adding) a sensor.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 117
EE/ME 574: Intermediate Controls Section 8.4.1
8.4.1 Uncontrollable and unobservable modes and rocketry
Space launch vehicles are one type of system where controllability and
observability problems arise:
Flexible structures
Restricted freedom to place sensors or actuators
The poles and zeros move around vigorously during launch, as the
aerodynamic condition changes and mass changes.
Uncontrollable or unobservable modes must be very carefully considered
for rocketry
Open-loop unstable mode (without control, the rocket will fall over)
Lightly damped structural modes:
Can be excited by vibrations during launch
Moderate oscillations can (and did!) exceed structural limits.
Controllability and observability make no sense with transfer functions.
State variable models were needed to see what was going on (R.E. Kalman
[1960, 1962])
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 118
EE/ME 574: Intermediate Controls Section 9.0.0
9 Summary, state-variable modeling and control
State space models can be written down directly from system equations.
Often easier than transfer function modeling, since internal variables do
not need to be eliminated.
When numerical values are available, the plant TF can be obtained from
from the SS model
>> SSuy = ss(Fp, Gp, Hp, Jp)
>> Guy = tf(SSuy)
State-variable modeling
A state-variable model is nothing other than a collection of modeling
equations stacked up in matrix-vector form.
State-variable models have units.
We can easily represent a variety of different input or output
congurations, by writing the corresponding G
x
(for inputs) and H
x
and
J
x
(for outputs).
Controller Design
We have seen two state feedback control design methods:
1. Pole placement
2. The linear quadratic regulator (LQR design)
Pole placement design may result in very high controller gains.
LQR design gives fast, well damped control in many situations.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 119
EE/ME 574: Intermediate Controls Section 9.0.0
Integral control
Any linear system can be modeled in state-variable form, including a
linear plant with PID control.
Control states are appended to the state vector, giving the augmented
state vector.
The F
a
, G
a
and H
a
matrices are produced as expected.
Integral control can be designed with standard tools, e.g., the lqr()
command.
Observability and Controllability
Unobservable and uncontrollable modes arise when poles and zeros
cancel.
The cancellation is mathematical, the energy storage elements remain in
the system.
Observability and controllability are intrinsic properties of the system,
independent of the way it is modelled.
Observability and controllability are easily determined with a state-
variable model.
Part 4: State-Space Control (Revised: Mar 06, 2013) Page 120
EE/ME 574: Intermediate Controls
Discrete-Time Control Systems,
the basis of Computer Control
Contents
1 Introduction, big picture of discrete control 3
1.1 Doing signal processing with sampled signals . . . . . . . . . . . 6
1.2 Connecting a controller computer to the continuous-time world . 10
1.2.1 Converting from an analog signal to a sampled signal . . . 11
1.2.2 Converting a sampled signal back to an analog signal . . . 13
1.3 Building a control system with a discrete-time controller . . . . . 14
1.4 Terminology and synonyms . . . . . . . . . . . . . . . . . . . . . 15
2 Introduction to the Z-transform 16
2.1 Recall, for continuous-time systems: . . . . . . . . . . . . . . . . 16
2.2 The Z-transform . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.2.1 Denition of the Z-transform and table of Z-transform pairs 19
2.2.2 Z-transform gives transfer function of a difference equation 20
2.2.3 Essential properties of a Z-domain transfer function . . . . 21
2.2.4 Discrete nal value theorem . . . . . . . . . . . . . . . . 22
2.2.5 Time shifting, one extra bit of nuisance: . . . . . . . . . . 23
2.3 Discrete system / Z-transform example . . . . . . . . . . . . . . . 25
2.3.1 Nyquist frequency . . . . . . . . . . . . . . . . . . . . . 27
2.3.2 Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.4 Conclusions on z-transform . . . . . . . . . . . . . . . . . . . . . 29
3 Interpretation of pole locations on the Z-plane 30
3.1 Examining Z-domain poles by example . . . . . . . . . . . . . . 30
3.1.1 Real poles . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.2 Complex pole pairs . . . . . . . . . . . . . . . . . . . . 32
3.2 Determining the frequency and damping of Z-plane poles . . . . . 34
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 1
EE/ME 574: Intermediate Controls
3.2.1 Matched s-plane and Z-plane poles . . . . . . . . . . . . 34
3.2.2 Pictoral examples of matched pole pairs . . . . . . . . . 35
3.2.3 Example, determining
n
and for Z-plane poles . . . . . 39
4 Converting between continuous and discrete systems 40
4.1 Determining G
pz
(z) , the z-transform of G
p
(s) . . . . . . . . . . 40
4.1.1 Discrete control example . . . . . . . . . . . . . . . . . 42
5 Compensator design by discrete equivalent TF 48
5.1 Matlabs c2d() command . . . . . . . . . . . . . . . . . . . . . 50
5.1.1 Why 6 different design methods . . . . . . . . . . . . . . 52
5.2 Tustins rule to nd G
cz
(z) that approximates G
cs
(s) . . . . . . . 53
5.2.1 Deriving Tustins rule . . . . . . . . . . . . . . . . . . . 53
5.2.2 Example with Tustins rule . . . . . . . . . . . . . . . . 55
5.2.3 Example controller design by discrete equivalent, done by
hand . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.2.4 Example controller design by discrete equivalent, using
Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6 DC Gain, Steady State Error and Complex Gain 65
6.1 DC Gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.2 Steady-State error . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.2.1 Determining steady-state error from T
rez
(z) (or T
re
(s)) . . 67
6.3 Complex gain from a discrete TF . . . . . . . . . . . . . . . . . 71
7 Conclusion 72
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 2
EE/ME 574: Intermediate Controls Section 1.0.0
1 Introduction, big picture of discrete control
A basic control loop is illustrated in gure 1.
The controller is represented by G
c
(s). So far we havent talked about how
controllers are actually built.
G
p
(s)
Plant
y(t)
H
y
(s)
Sensor
G
c
(s)
Controller
-
+
u(t) e(t)
r(t)
Controller Process under control
Trajectory
Generation
Figure 1: Basic control loop. The Controller comprises the compensator, G
c
(s),
and may include trajectory generation, generating r (t), and other
elements.
How controllers are actually built
There are two broad approaches
1. Analog (e.g., Op Amps, capacitors and inductors, or pneumatics)
2. Discrete or sampled (by computer)
Today the vast majority of controllers are sampled
Process control, oil reneries, computer controlled in the 1960s with
mini computers
Machine tools / robotics, computer controlled in the 1970s
Aviation, computer controlled in the 1980s
Today, virtually all control (car engines, building environment, ...)
is implemented by computer
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 3
EE/ME 574: Intermediate Controls Section 1.0.0
Computer control brings a fundamental change to the nature of signals
Analog control (Op Amps, capacitors, etc). operate on analog signals
0 2 4 6 8 10
0.5
0
0.5
1
t [sec]
f(t)
Figure 2: An analog signal, f (t) = e
t
sin(t).
Computers operate on discrete sequences of numbers, or samples, of
sampled signals
k =
_

_
0
1
2
.
.
.
_

_
f (k) =
_

_
0.0000
0.6113
0.7258
.
.
.
_

_
t
k
=
_

_
0.0
0.8
1.6
.
.
.
_

_
=
_

_
0
s
1
s
2s
.
.
.
_

_
When a sampled system is connected to a continuous system, two special
pieces of hardware are needed,
An A/D converter, and a D/A converter
f(k) f(t)
Continuous
Signal
Sampled
Signal
Sampled
Signal
g(k)
(A/D Converter)
ZOH
g(t)
(D/A Converter)
t
k
= k T
s
Continuous
Signal
Figure 3: Block diagrams for A/D and D/A converts.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 4
EE/ME 574: Intermediate Controls Section 1.0.0
A sampled signal can be represented graphically by a stem plot, as seen in
gure 4.
>> Ts = 0.8
>> td = 0:Ts:10;
>> fd = exp(-alpha*td) .* sin(omega*td);
>> stem(td, fd)
0 2 4 6 8 10 12 14
0.5
0
0.5
1
k [sample]
f(k
)
0 2 4 6 8 10
0.5
0
0.5
1
t [sec]
f(k
T
s
)
(a) f (k) (b) f (kT
s
)
Figure 4: A stem plot showing a sampled signal, (a) versus k (which is what the
computer knows), (b) versus t
k
(which relates to the analog world).
Figure 4 shows something basic about sampled signals:
A sampled signal is only dened at the sample instants.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 5
EE/ME 574: Intermediate Controls Section 1.1.0
1.1 Doing signal processing with sampled signals
Controller e(k) u(k)
G
c
(z)
Figure 5: Block implementing G
c
(z), the compensator in a computer.
A continuous signal is a wave-form, such as u(t). A sampled signal is a
sequence of numbers, such as u(k). Examples:
t (k) =
_

_
0
1T
s
2T
s
.
.
.
_

_
, e(k) =
_

_
0.0000
0.6113
0.7258
.
.
.
_

_
, u(k) =
_

_
?
.
.
.
_

_
how can we do signal processing to create a new sampled signal ?
Sampled signals are processed using difference equations.
In a difference equation, the output is given by sums and differences of
samples. For example:
u(k) =a
1
u(k 1)a
2
u(k 2)+b
0
e(k)+b
1
e(k 1)+
(1)
At each sample k, the output is calculated as a combination of
The input, e(k)
Past inputs, e(k 1) , e(k 2)...
Past output, u(k 1) , u(k 2) ...
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 6
EE/ME 574: Intermediate Controls Section 1.1.0
Difference equation example:
u(k) = 0.8u(k 1) +0.1e(k) +0.1e(k 1) (2)
Impulse response, an digital impulsive signal has e(0) = 1 , e(1, 2...) = 0
. k e(k-1) e(k) u(k-1) u(k)
1 0 1 0 0.100
2 1 0 0.1 0.180
3 0 0 0.180 0.144
4 0 0 0.144 0.115
0 5 10 15
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
u
(
k
)
k
Figure 6: Stem plot of the impulse response of difference Eqn (2).
Notice the exponential decay.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 7
EE/ME 574: Intermediate Controls Section 1.1.0
A difference equation is linear.
For example, if e(k) is doubled, u(k) is doubled.
u(k) = 0.8u(k 1) +0.1e(k) +0.1e(k 1) (2, repeated)
. k e(k-1) e(k) u(k-1) u(k)
1 0 2 0 0.200
2 2 0 0.2 0.360
...
Since difference equations are linear, a sampled sinusoidal input gives a
sampled sinusoidal output. For example,
t (k) = kT
s
= 0.8k , e(k) = 1.0 sin(0.75t (k))
(T
s
= 0.8seconds) u(k) = 0.338 sin(0.75t (k) 70.2
o
)
0 5 10 15 20
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
t [seconds]
e
(k
)
0 5 10 15 20
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
t [seconds]
u
(k
)
(a) Signal e(k) = 1.0 sin(0.75t) (b) u(k): output of G
c1
(z)
The new magnitude and phase are determined by:
>> Ts = 0.8;
>> Num = [0.1 0.1]; Den = [1 -0.8]; %% Setup model
>> Gc1z = tf(Num, Den, Ts)
>> [Mag, Phase] = bode(Gc1z, 0.75) %% Calc Mag and Phase
Mag = 0.3380 Phase = -70.2421 %% With bode command
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 8
EE/ME 574: Intermediate Controls Section 1.1.0
Since the difference equation is linear
Specically, since a sinusoidal input gives a sinusoidal output
We can make a bode plot of G
c1
(z), which plots the magnitude and phase
of the output for sinusoidal inputs.
10
2
10
1
10
0
10
1
50
40
30
20
10
0
10
G
a
i
n

d
B
10
2
10
1
10
0
10
1
90
60
30
0
Frequency [radians/second]
P
h
a
s
e

[
d
e
g
]
Figure 7: Bode plot for difference equation (2). Eqn (2) gives a low-pass lter.
>> Gc1z = tf(Num, Den, Ts)
>> bode(Gc1z)
%% Ts = 0.8 [seconds]
%% Fs = 1.25 [Hz]
%% Fnyquist = Fs/2 = 0.625 [Hz]
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 9
EE/ME 574: Intermediate Controls Section 1.2.0
1.2 Connecting a controller computer to the continuous-time
world
To use digital control, the controller computer has to receive inputs from
sensors, and supply outputs to actuators.
A typical conguration is seen in gure 8.
The sensor itself is analog (such as a pressure sensor). The analog sensor
signal y(t) is converted to a digital signal y(k) by an A/D converter. (An
Analog To Digital converter)
The computer command, u(k), is converted from a digital signal by a
D/A converter. (A Digital To Analog converter)
The D/A converter implements a Zero-Order Hold (ZOH), which
must be modelled in the control loop (more later).
y
s
(k) y
s
(t)
u(k)
(A/D Conv.)
ZOH
u(t)
(D/A
Conv.)
t=kT
s
G
p
(s)
Plant
y(t)
H
y
(s)
Sensor
-
+
e(k)
r(k)
Analog part
Trajectory
Generator
Discrete part, Computer Controller
K
c
G
c
(z)
Figure 8: Conguration of basic computer control. Sensor signals are prepared
for the computer by
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 10
EE/ME 574: Intermediate Controls Section 1.2.1
1.2.1 Converting from an analog signal to a sampled signal
This is the job of the A/D converter. The sampled signal is dened only at
the sampling instants.
y(k) y(t)
(A/D Converter)
t
k
= k T
s
0 2 4 6 8 10
0.5
0
0.5
1
t [sec]
f
(
k

T
s
)
Figure 9: Sampling, converting from y(t) to y(k).
A/D converters are dened by
A range, such as e(t) =10..10 [volts]
A resolution, normally in bits, such as 8 bit, 10 bit, 16 bit.
A maximum speed, such as 100k samples/second, up to 1
GSamples/second
Example: telephone
Today essentially all telephone exchanges are digital
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 11
EE/ME 574: Intermediate Controls Section 1.2.1
Voice is sampled at 8 bits, 8,000 samples per second
One voice channel on a telephone trunk line is 64,000 bits per second
(uncompressed)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 12
EE/ME 574: Intermediate Controls Section 1.2.2
1.2.2 Converting a sampled signal back to an analog signal
If we are going to control continuous-time equipment, we need to convert
u(k) back into u(t)
This is the job of the D/A converter. The output signal is u(t), dened at all
instants.
u(k)
ZOH
u(t)
(D/A Converter)
0 2 4 6 8 10
0.5
0
0.5
1
t [sec]
f
(
t
)
Figure 10: Sampling, converting a signal from u(k) to u(t) with zero-order hold.
The Zero-Order-Hold (ZOH)
A level u(k) is given at t = t
k
= kT
s
The ZOH has a hold circuit (Op Amp + capacitor) that holds the signal
until u(k +1) arrives.
D/A converters are dened by
A range, such as u(k) =10..10 [volts]
A resolution, normally in bits, such as 8 bit, 10 bit, 16 bit.
A maximum speed, such as 100 kS/sec, up to 1 GS/second
Example: telephone
At the phone switch, a D/A converter converts 8,000 8-bit samples per
second to an analog signal, which goes out on the local subscriber line.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 13
EE/ME 574: Intermediate Controls Section 1.3.0
1.3 Building a control system with a discrete-time controller
Most control systems comprise a discrete-time part (the controller) and a
continuous-time part (the thing being controlled), gure 11.
The computer controller implements G
c
(z), a difference equation
The plant is governed by differential equations
The two pieces are joined together by an A/D and a D/A
y
s
(k) y
s
(t)
u(k)
(A/D Conv.)
ZOH
u(t)
(D/A
Conv.)
t=kT
s
G
p
(s)
Plant
y(t)
H
y
(s)
Sensor
-
+
e(k)
r(k)
Analog part
Trajectory
Generator
Discrete part, Computer Controller
K
c
G
c
(z)
Figure 11: System with sampled control.
Broad approach to design and analysis:
1. Develop transform method to analyze discrete-time system, the
Z-transform. (Analogous to the Laplace transform)
2. Convert Y
s
(s)/U(s) to discrete-time (including the zero-order hold), to
analyze the complete discrete-time system.
3. Obtain the digital compensator, G
c
(z) by:
(a) Discrete Equivalent Design: design Gc (s), convert to discrete-time, or
(b) Direct Digital Design: directly design G
c
(z) based on discrete-time
analysis.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 14
EE/ME 574: Intermediate Controls Section 1.4.0
1.4 Terminology and synonyms
Discrete-time systems
Digital control
Discrete system
Sampled system
z-domain system
Sampled signals
Discrete-time signal
Discrete signal
Digital signal
z-domain signal
Continuous-time systems
Analog system
s-domain system
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 15
EE/ME 574: Intermediate Controls Section 2.1.0
2 Introduction to the Z-transform
The Z-transform can be understood by analogy with the Laplace transform
for continuous-time systems.
2.1 Recall, for continuous-time systems:
Consider a controller with an input e(t) and an output u(t)
Controller
input e(t) output u(t)
Figure 12: System with input and output.
Continuous signals are functions of time, such as e(t) and u(t).
Continuous time systems are governed by differential equations, such as
u(t) +a
1
u(t) +a
2
u(t) = b
o
e(t) +b
1
e(t) +b
2
e(t) (3)
For continuous equations, the highest derivative of the output is given by:
The lower derivatives of the output, and
The input and derivatives of the input
u(t) =a
1
u(t) a
2
u(t) +b
o
e(t) +b
1
e(t) +b
2
e(t) (4)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 16
EE/ME 574: Intermediate Controls Section 2.1.0
2.1 Recall, for continuous-time systems (continued)
The Laplace transform is a transform between a time-domain signal and a
function of s
u(t)
L
=
L{u(t)} =
Z

0

e
st
u(t) dt =U (s) (5)
The essential properties of the Laplace Transform are:
1. Scaling if v(t) = 3y(t) V (s) = 3Y (s)
2. Superposition if v(t) = y(t) +u(t) V (s) =Y (s) +U (s)
3. It handles derivatives nicely:
Given: y(t)
L
=
Y (s) then y(t)
L
=
sY (s)
Properties 1, 2 and 3 enable us to dene the transfer function, given
u(t) +a
1
u(t) +a
2
u(t) = b
o
e(t) +b
1
e(t) +b
2
e(t)
We can form the Laplace transform of the left and right sides
U (s)
_
s
2
+a
1
s +a
2
_
= E (s)
_
b
0
s
2
+b
1
s +b
2
_
(6)
And obtain the transfer function
U (s)
E (s)
=
b
0
s
2
+b
1
s +b
2
s
2
+a
1
s +a
2
(7)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 17
EE/ME 574: Intermediate Controls Section 2.2.0
2.1 Recall, for continuous-time systems (continued)
For the controls engineer, the transfer function is the value proposition
As weve seen, the controls engineer rarely forms the Laplace transform
of a signal, or inverse Laplace Transform of U (s)
The transfer function enables us to study the properties of systems
without solving differential equations.
The transfer function is the reason we use Laplace transforms in the
analysis of control systems.
2.2 The Z-transform
The Z-transform is a transformation between a sampled time-domain signal
and a function of z :
y(k)
Z

Z{y(k)} =

k=0
u(k)z
k
=Y (z) (8)
As one would expect, the important properties of the Z-transform are:
1. Scaling if v(k) = 3y(k) V (z) = 3Y (z)
2. Superposition if v(k) = y(k) +u(k) V (z) =Y (z) +U (z)
3. It handles time shifts:
Forward : Z{y(k +1)} = z Z{y(k)} = zY (z)
and
Backward : Z{y(k 1)} = z
1
Z{y(k)} = z
1
Y (z)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 18
EE/ME 574: Intermediate Controls Section 2.2.1
2.2.1 Denition of the Z-transform and table of Z-transform pairs
The one-sided Z-transform is dened by:
Z{ f (k)} = F (z) =

k=0
f (k) z
k
(9)
Like the Laplace transform integrals, Eqn (9) is not often used directly
by the controls engineer.
What is important is properties (1) - (3) above, because they allow one to
dene the transfer function of a difference equation.
Some Z-transform pairs are given in table 1.
Signal Laplace transform Z-transform, t (k) = kT
s
Impulse f (t) =(t) F (s) = 1 f (k) = 1 F (z) = 1
0, otherwise
Step f (t) = 1
+
(t) F (s) =
1
s
f (k) = 1, k 0 F (z) =
z
z1
Ramp f (t) =t F (s) =
1
s
2
f (k) = kT
s
, k 0 F (z) =
Ts z
(z1)
2
Exp. Decay f (t) = e
at
F (s) =
1
s+a
f (k) = e
akTs
F (z) =
z
ze
aTs
Sine f (t) = sin(t) F (s) =
a
s
2
+a
2
f (k) = sin(kT
s
) F (z) =
z sin(Ts)
z
2
2cos(Ts)z+1
Cosine f (t) = cos(t) F (s) =
s
s
2
+a
2
f (k) = cos(kT
s
) F (z) =
z(zcos(Ts))
z
2
2cos(Ts)z+1
Table 1: Laplace and Z-transform transform pairs
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 19
EE/ME 574: Intermediate Controls Section 2.2.2
2.2.2 Z-transform gives transfer function of a difference equation
1. Starting with difference equation (10)
u(k) +a
1
u(k 1) +a
2
u(k 2) = (10)
b
o
e(k) +b
1
e(k 1) +b
2
e(k 2)
2. Taking the Z-transform of the each term gives:
Z{u(k)}+Z{a
1
u(k 1)}+Z{a
2
u(k 2)} = (11)
Z{b
o
e(k)}+Z{b
1
e(k 1)}+Z{b
2
e(k 2)}
3. Now applying the scaling and time-shift properties of the Z-transform:
Z{u(k)}+a
1
z
1
Z{u(k)}+a
2
z
2
Z{u(k)} = (12)
b
0
Z{e(k)}+b
1
z
1
Z{e(k)}+b
2
z
2
Z{e(k)}
which gives:
U (z)
_
1+a
1
z
1
+a
2
z
2
_
= E (z)
_
b
0
+b
1
z
1
+b
2
z
2
_
(13)
and nally:
U(z)
E(z)
=
b
0
+b
1
z
1
+b
2
z
2
1+a
1
z
1
+a
2
z
2
=
b
o
z
2
+b
1
z +b
2
z
2
+a
1
z +a
2
(14)
Eqn (14) is the Transfer Function of Eqn (10)
The steps of forming a discrete transfer function, Eqns (10) to (14), are
entirely analogous to the steps of forming a continuous transfer function.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 20
EE/ME 574: Intermediate Controls Section 2.2.3
2.2.3 Essential properties of a Z-domain transfer function
The essential properties of a discrete transfer function are also analogous to the
properties of the continuous transfer function. Given:
G
c
(z) =
U (z)
E (z)
=
b
o
z
2
+b
1
z +b
2
z
2
+a
1
z +a
2
(15)
All information about the system is captured in the transfer function, G
c
(z)
G
c
(z) is a rational polynomial of constants,
It is independent of the particular input and output signals.
The Discrete Transfer Function has poles and zeros
They are the roots of the denominator and numerator polynomials
The poles correspond to the modes.
We can test the poles for stability
Root locus applies !
(But special interpretation is needed for pole locations on the Z-plane)
Example, considering the difference equation (2),
u(k) = 0.8u(k 1) +0.1e(k) +0.1e(k 1) (2, repeated)
Then
G
c1
(z) =
U(z)
E(z)
=
0.1+0.1z
1
10.8z
1
=
0.1z +0.1
z 0.8
Pole: z = 0.8 , Zero: z =1.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 21
EE/ME 574: Intermediate Controls Section 2.2.4
2.2.4 Discrete nal value theorem
The nal value theorem for the z-transform is:
lim
k
x(k) = x
ss
= lim
z1
_
1z
1
_
X (z) (16)
Steady-state error applies !
Example, nal value of u(k) with G
c1
(z) and e(k) given by a unit step
lim
k
u(k) = lim
z1
_
1z
1
_
U (z) = lim
z1
_
1z
1
_
U (z)
E (z)
E (z) (17)
Since e(k) is a unit step, E (z) = z/(z 1) , and so
lim
k
u(k) = lim
z1
_
1z
1
_
0.1z +0.1
z 0.8
z
z 1
Notice that
_
1z
1
_
=
_
1
1
z
_
=
_
z 1
z
_
(18)
Giving
lim
k
u(k) = lim
z1
_
z 1
z
_
0.1z +0.1
z 0.8
z
z 1
= lim
z1
0.1z +0.1
z 0.8
(19)
Finally
lim
k
u(k) = lim
z1
0.1z +0.1
z 0.8
= 1.0
The nal value of u(k) with e(k) = 1
+
(k) is u(k) = 1.0
Notice the analogy between the cancellation in Eqn (19) and the
cancellation in:
lim
t
u(t) = lim
s0
s
U (s)
E (s)
1
s
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 22
EE/ME 574: Intermediate Controls Section 2.2.5
2.2.5 Time shifting, one extra bit of nuisance:
Consider the difference equation
u(k) = +1.6u(k 1) 0.68u(k 2) +0.4e(k) 0.28e(k 1) +0.048e(k 2)
(20)
Gives the Z-transform:
U (z) 1.6z
1
U (z) +0.68z
2
U (z) = 0.4E (z) 0.28z
1
E (z) +0.048z
2
E (z)
U (z)
_
11.6z
1
+0.68z
2
_
= E (z)
_
0.4 0.28z
1
+0.048z
2
_
And so:
U (z)
E (z)
=
0.4 0.28z
1
+0.048z
2
11.6z
1
+0.68z
2
= G
euz
(z)
But we work with poles and zeros of the TF written with z, so clear the z
n
:
U (z)
E (z)
=
b
0
+b
1
z
1
+b
2
z
2
1+a
1
z
1
+a
2
z
2
z
2
z
2
=
b
o
z
2
+b
1
z +b
2
z
2
+a
1
z +a
2
(21)
So we have to shift back and forth between two forms of the TF:
G
c
(z) =
0.4z
2
0.28z +0.048
z
2
1.6z +0.68
For analysis (22)
G
c
(z) =
0.40.28z
1
+0.048z
2
11.6z
1
+0.68z
2
For implementation (23)
Eqns (22) and (23) are the two forms of the same TF.
The TF in the form of Eqn (23) gives the Diff Eqn (20)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 23
EE/ME 574: Intermediate Controls Section 2.2.5
Conclusion on time shifting
u(k) = +1.6u(k 1) 0.68u(k 2) +0.4e(k) 0.28e(k 1) +0.048e(k 2)
(Eqn20, repeated)
We can also write the difference equation directly from Eqn (22)
Remembering that z
2
U (z)
Z
1

= u(k +2), Eqn (22) becomes:


u(k +2) = +1.6u(k +1) 0.68u(k) +0.4e(k +2) 0.28e(k +1) +0.048e(k)
(24)
If difference Eqn (20) is true for all k, then difference Eqn (24) is likewise
true for all k.
This is analogous to saying,
G
c
(z) =
z
2
z
2
G
c
(z)
In a sense, the distinction between Eqns (20) and (24) lies is the denition
of k.
We normally set up the difference equation to compute u(k),
In some cases we might compute u(k +1). For example, if output u(k)
depends only on values up to e(k 1), in this case we might set up the
the difference equation
To compute u(k +1) based on e(k) (pre-computing)
Rather than computing u(k) based on e(k 1).
In general, we can time-shift the difference equation as needed
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 24
EE/ME 574: Intermediate Controls Section 2.3.0
2.3 Discrete system / Z-transform example
A TF model of the difference equation is setup with the tf() command,
including a value for t
s
.
Starting with the difference equation, and F
s
= 20 [samples/second]
u(k) = +1.6u(k 1)0.68u(k 2)+0.4e(k)0.28e(k 1)+0.048e(k 2)
Setup the TF with the Matlab code:
>> Fs = 20; Ts = 1/Fs; %% Set the sample rate,
>> Num = [0.4 -0.28 0.048] %% often convenient to set Fs
>> Den = [1 -1.6 +0.68] %% Set the Num and Den polynomials
>> Geuz = tf(Num, Den, Ts) %% Setup the TF
Transfer function: 0.4 z^2 - 0.28 z + 0.048
------------------------
z^2 - 1.6 z + 0.68
Sampling time: 0.05
Printing Sample time indicates that the TF is discrete-time.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 25
EE/ME 574: Intermediate Controls Section 2.3.0
>> figure(1), clf
>> step(Guez);
>> grid on
0 0.5 1 1.5
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
2.2
2.4
Step response from Eqn ()
Time (sec)
A
m
p
litu
d
e
Figure 13: Discrete step response of rst example system.
We can also determine the frequency response
+
>> figure(2), clf
>> bode(Geuz)
0
5
10
15
20
M
a
g
n
itu
d
e
(d
B
)
10
2
10
1
10
0
10
1
10
2
180
135
90
45
0
45
90
P
h
a
s
e
(d
e
g
)
Bode Diagram
Frequency (rad/sec)
Figure 14: Discrete step response. Note the Nyquist frequency limit at 10 Hz
(62.8 [rad/sec]), from F
s
= 20 [samples/sec].
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 26
EE/ME 574: Intermediate Controls Section 2.3.2
2.3.1 Nyquist frequency
In a sampled system, the Nyquist frequency highest frequency sinusoidal
signal that can be uniquely determined. It is given by:
FNyquist =
1
2
Fs (25)
Example: CD music format:
F
s
= 44, 000 [samples/sec]
F
Nyq
= 22, 000 [Hz]
Matlab draws the discrete Bode plot up to the Nyquist frequency.
2.3.2 Tips
Notice the - signs in the denominator
The difference equation
u(k) = +1.6u(k 1) 0.68u(k 2)
+0.4e(k) 0.28e(k 1) +0.048e(k 2)
Gives the TF
G
euz
(z) =
0.4z
2
0.28z +0.048
z
2
1.6z +0.68
=
U (z)
E (z)
Pay attention to the minus signs in the denominator; the +a
i
terms in the TF
are a
i
terms in the implementation equation.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 27
EE/ME 574: Intermediate Controls Section 2.3.2
Pay attention to get the numerator powers correct, when multiplying by
z
n
/z
n
to convert between analysis form and implementation form.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 28
EE/ME 574: Intermediate Controls Section 2.4.0
2.4 Conclusions on z-transform
Discrete time systems are implemented as difference equations
The z-transform gives us the z-domain transfer function, such as G
c
(z)
G
c
(z) can be obtained directly from the difference equation
G
c
(z) is a rational polynomial, and has poles and zeros
Commands such as tf(), step(), and bode() operate with discrete as well
as continuous transfer functions.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 29
EE/ME 574: Intermediate Controls Section 3.1.1
3 Interpretation of pole locations on the Z-plane
Starting with the difference equation
u(k) =a
1
u(k 1) a
2
u(k 2) (26)
+b
o
e(k) +b
1
e(k 1) +b
2
e(k 2)
We get the TF
G
euz
(z) =
U (z)
E (z)
=
bo z
2
+b
1
z +b
2
z
2
+a
1
z +a
2
(27)
The poles are the roots of
z
2
+a
1
z +a
2
= 0
It is the feedback of past outputs to the current output that determines
stability, that is, the poles of G(z).
3.1 Examining Z-domain poles by example
3.1.1 Real poles
Consider
u(k) = 0.8u(k 1) +e(k) , G
c
(z) =
z
z 0.8
0 2 4 6 8 10 12
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
k [sample]
u
(k
)
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
Real
Im
a
g
in
a
ry
Unit Circle
Figure 15: Impulse response and pole-zero map.
Pole at z
1
= +0.8 , yet the system is stable.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 30
EE/ME 574: Intermediate Controls Section 3.1.1
Now consider
u(k) = 1.1u(k 1) +e(k) , G
c
(z) =
z
z 1.1
0 2 4 6 8 10 12
0
0.5
1
1.5
2
2.5
3
3.5
k [sample]
u
(k
)
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
Real
Im
a
g
in
a
ry
Unit Circle
Figure 16: Impulse response and pole-zero map.
Pole at z
1
= +1.1 , System unstable.
Intuitively, with
u(k) = a
1
u(k 1) +b
0
e(k)
If |a
1
| < 1.0 , the successive values of u(k) will get smaller.
If a
1
= 1.0 , the successive values of u(k) will remain a constant size.
If |a
1
| > 1.0, the successive values of u(k) will grow larger
Mathematically, from table 1, we have the Z-transform pair:
f (k) = e
kTs
, F (z) =
z
z e
Ts
(28)
Pole at z
1
= e
Ts
.
If < 0, |z
1
| < 1.0 , (stable)
If = 0, |z
1
| = 1.0 , (marginally stable)
If > 0, |z
1
| > 1.0 , (unstable)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 31
EE/ME 574: Intermediate Controls Section 3.1.2
3.1.2 Complex pole pairs
Consider a system with a complex pole pair
u(k) = 1.6u(k 1) 0.8u(k 2) +e(k) , G
c
(z) =
z
2
z
2
1.6z +0.8
This system has pole pair at:
z
1,2
= 0.8 j 0.4 = 0.8926.6
o
0 2 4 6 8 10 12
1
0.5
0
0.5
1
1.5
2
k [sample]
u
(k
)
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
Real
Im
a
g
in
a
ry
Unit Circle
Figure 17: Impulse response and pole-zero map. The system is stable.
The difference equation with a complex pole pair:
Gives a damped sinusoidal impulse response,
If we write:
z
1,2
= A (29)
Then the envelop evolves by a factor of A with each sample,
And the sinusoid rotates by an angle with each sample.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 32
EE/ME 574: Intermediate Controls Section 3.1.2
Finally, consider another complex pole pair
u(k) = 2.0u(k 1) 1.8u(k 2) +e(k) , G
c
(z) =
z
2
z
2
2.0z +1.8
This system has pole pair at: z
1,2
= 1.0 j 0.89 = 1.3441.8
o
Rotation per sample: 41.8
o
Magnitude change per sample: 1.34 .
0 2 4 6 8 10 12
10
5
0
5
10
15
20
25
30
k [sample]
u
(k
)
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
Real
Im
a
g
in
a
ry
Unit Circle
Figure 18: Impulse response and pole-zero map. The system is unstable.
The difference equation with a complex pole pair with |z
i
| > 1.0
Gives an unstable oscillatory response, as with real (s
i
) > 0 .
Conclusions
Poles that lie within the unit disk give stable modes
A stable complex pole pair gives a damped oscillatory response
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 33
EE/ME 574: Intermediate Controls Section 3.2.1
3.2 Determining the frequency and damping of Z-plane poles
There are two ways to think about frequency and damping on the Z-plane
1. Matching Z-plane and s-plane poles, and interpreting the s-plane pole
locations
2. Directly considering pole locations on the z-plane.
3.2.1 Matched s-plane and Z-plane poles
The relationship between an s-plane s
i
and a Z-plane pole z
i
is:
z
i
= e
si Ts
, s
i
=
ln(z
i
)
T
s
(30)
Eqn (30) leads to a couple of useful forms:
s plane z plane
s
1,2
= j z
1,2
= e
Ts
Ts (31)
s
1,2
=
ln(A)
T
s
j

T
s
z
1,2
= A (32)
In Eqns (31) and (32), the s-plane poles are in rectuangar coordinates,
while the z-plane poles are in polar coordinates.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 34
EE/ME 574: Intermediate Controls Section 3.2.2
3.2.2 Pictoral examples of matched pole pairs
5 0 5
5
4
3
2
1
0
1
2
3
4
5
real
im
a
g
in
a
r
y
splane
Figure 19: s-plane pole locations, + and x are stable, is marginally stable,
and are unstable.
2 1 0 1 2
2
1.5
1
0.5
0
0.5
1
1.5
2
real
im
a
g
in
a
r
y
Zplane
Figure 20: Corresponding Z-plane pole locations, + and x are stable, is
marginally stable, and are unstable.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 35
EE/ME 574: Intermediate Controls Section 3.2.2
1. Consider contours of constant decay rate on the s and Z-planes
Lines of constant decay rate are circles in the Z-plane.
The smaller the radius, the faster the decay.
4 3 2 1 0 1 2 3
4
3
2
1
0
1
2
3
4
splane
real
im
a
g
in
a
ry
Faster Decay
1 0.5 0 0.5 1
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
real
im
a
g
in
a
ry
Zplane
Faster Decay
(a) s-plane (b) Z-plane
Figure 21: s and Z-plane, contours of constant decay rate,
=1, 2, 3, 4
_
sec
1

, T
s
= 0.2 [sec].
2. Consider contours of constant oscillatory frequency,
Angle of pole gives oscillation frequency.
Negative real axis corresponds to the Nyquist frequency.
4 3 2 1 0 1 2 3
4
3
2
1
0
1
2
3
4
splane
real
im
a
g
in
a
ryFaster
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
real
im
a
g
in
a
ry
Zplane
Faster
Nyquist
Freq
(a) s-plane (b) Z-plane
Figure 22: s and Z-plane, contours of constant , = 1, 2, 3 [r/s], T
s
= 0.2 [s].
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 36
EE/ME 574: Intermediate Controls Section 3.2.2
3. Consider contours of constant damping,
On the s-plane, damping corresponds to angle
On the Z-plane, contours of constant damping correspond to complex
curves
Generally, the nearer the pole lies to the real axis, the greater the damping
The character of the contours near z = 1.0 match the character of the
contours near s = 0
4 3 2 1 0 1 2 3
4
3
2
1
0
1
2
3
4
splane
real
im
a
g
in
a
r
y
Increasing
Damping
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
real
im
a
g
in
a
r
y
Zplane
Increasing
Damping
(a) s-plane (b) Z-plane
Figure 23: s and Z-plane, contours of constant ,
= 0.24, 0.44, 0.71, 0.89, 0.97[], T
s
= 0.2 [sec].
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 37
EE/ME 574: Intermediate Controls Section 3.2.2
4. Consider contours of constant natural frequency,
n
On the s-plane,
n
corresponds to radius.
On the Z-plane, contours of constant
n
correspond to complex curves
The character of the contours near z = 1.0 match the character of the
contours near s = 0
4 2 0 2
4
3
2
1
0
1
2
3
4
splane
real
im
a
g
in
a
r
y
Increasing
Wn
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
real
im
a
g
in
a
ry
Zplane
Increasing
Wn
(a) s-plane (b) Z-plane
Figure 24: s and Z-plane, contours of constant
n
,
n
= 1, 2, 3, 4[rad/sec],
T
s
= 0.2 [sec].
Units of the s-plane:
Decay or rotation per second,
_
seconds
1

Units of the Z-plane:


Decay or rotation per sample (dimensionless)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 38
EE/ME 574: Intermediate Controls Section 3.2.3
3.2.3 Example, determining
n
and for Z-plane poles
Given T
s
=0.15 [seconds], and z
1,2
=0.80.2 j, nd the equivalent s-plane
poles, and nd , ,
n
and for the poles.
Answer: The decay rate, , and oscillatory frequency, , can be found
directly from z
i
. Writing
z
1,2
= A = 0.824614.03
o
The decay rate is given by the pole radius, we have A = e
Ts
, so
=
ln(A)
T
s
=
ln(0.8246)
0.15
= 1.2855 [sec
1
]
The oscillatory frequency is given by the angle of the z-plane pole
=

T
s
_
degrees/sample
seconds/sample
_
=

T
s
_
degrees
second
_
= 14.03/0.15 = 93.57[degrees/second]
= 1.633[radians/second]
We can also directly nd the equivalent s-plane pole
s
1,2
= j =
ln
_
z
1,2
_
T
s
=
0.1928+ j 0.2450
0.15
=1.2855+ j 1.6332 [sec
1
]

n
and can be found from and

n
=
_

2
+
2
= 2.0784[radians/second]
= /
n
= 1.2855/2.0784 = 0.6185 []
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 39
EE/ME 574: Intermediate Controls Section 4.1.0
4 Converting between continuous and discrete
systems
We need to convert between discrete and continuous systems for two
reasons:
1. Analysis of the complete system using z-transforms
2. To implement compensators, G
c
(s) design in continuous-time and
implemented in discrete-time.
4.1 Determining G
pz
(z) , the z-transform of G
p
(s)
y
s
(k) y
s
(t)
u(k)
(A/D Conv.)
ZOH
u(t)
(D/A
Conv.)
t=kT
s
G
p
(s)
Plant
y(t)
H
y
(s)
Sensor
-
+
e(k)
r(k)
Analog part, u(t)->y(t)
Trajectory
Generator
Discrete part, Computer Controller
G
c
(z)
Discrete signal path, u(k)->y
s
(k)
Figure 25: Build a discrete model of the system.
The plant is itself is modelled as a continuous-time system, G
p
(s)
But if we combined the plant with the D/A and A/D, we have a true discrete
system.
G
pz
(z) : u(k)> y
s
(k) (33)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 40
EE/ME 574: Intermediate Controls Section 4.1.0
By converting G
p
(s) to G
pz
(z), including the Zero-Order-Hold of the D/A
converter, we can form Gpz (z) and put together an all-discrete model.
r(k) y
s
(k)
+
-
y
s
(k)
K
c
G
cz
(z) G
pz
(z)
e(k) u(k) u(k)
d(k)
+
+
Figure 26: Block of all-discrete model.
Standard transfer-function analysis applies, using the z-transform.
T
ryz
(z) =
K
c
G
cz
G
pz
1+K
c
G
cz
G
pz
(34)
T
rez
(z) =
1
1+K
c
G
cz
G
pz
(35)
T
dyz
(z) = =
G
pz
1+K
c
G
cz
G
pz
(36)
Etc.
The discrete TF G
pz
(z) is given by
G
pz
(z) =
_
1z
1
_
Z
_
G
p
(s)
s
_
(37)
Where Z{F (s)} is the z-transform of the sampled time series whose
Laplace transform is F (s) (see Franklin et al., section 6.8).
Practically, G
pz
(z) is determined using Matlabs c2d() command.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 41
EE/ME 574: Intermediate Controls Section 4.1.1
4.1.1 Discrete control example
Consider a system governed by
G
p
(s) =
0.2
s +1
Implement a discrete controller according to (more on discrete design in the
next section):
T
s
= 1/20 [sec]
u(k) = 0.9u(k 1) +1.0e(k) 0.5e(k 1) (38)
Find G
pz
(z)
>> Gps = tf(0.2, [1 1]) %% Gps from physics of system
>> Fs = 20; Ts = 1/Fs %% Setup Ts
>> Gpz = c2d(Gps, Ts, zoh) %% Find Gpz
Transfer function: 0.009754
----------
z - 0.9512
Sampling time: 0.05
Find G
cz
(z) from the controller implementation, Eqn (38),
>> Kc = 10
>> Gcz = tf([1 -0.5], [1 -.9], Ts)
Transfer function: z - 0.5
-------
z - 0.9
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 42
EE/ME 574: Intermediate Controls Section 4.1.1
Find the closed-loop transfer function
>> Tryz = feedback(Kc*Gcz*Gpz, 1)
Transfer function: 0.09754 z - 0.04877
----------------------
z^2 - 1.754 z + 0.8073
Sampling time: 0.05
Plot step response. The step() command recognizes that T
ryz
is a
z-transform.
>> figure(1), clf
>> step(Tryz)
0 0.5 1 1.5 2 2.5 3 3.5
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 27: Step response of T
ryz
(z).
Find step-response properties (overshoot, settling time, rise time) from the
discrete step response.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 43
EE/ME 574: Intermediate Controls Section 4.1.1
Find the equivalent s-plane pole locations
1. By converting the z-plane poles directly
>> CLPolesz = pole(Tryz) %% Find z-plane poles
CLPolesz =
0.8768 + 0.1962i
0.8768 - 0.1962i
>> CLPoless = log(CLPolesz)/Ts %% Convert to s-plane
CLPoless =
-2.1402 + 4.4018i
-2.1402 - 4.4018i
2. By converting T
ryz
(z) to T
rys
(s)
>> Trys = d2c(Tryz) %% Convert Tryz to Trys
Transfer function:
1.622 s + 21.78
--------------------
s^2 + 4.28 s + 23.96
>> pole(Trys)
ans =
-2.1402 + 4.4018i
-2.1402 - 4.4018i
Find , ,
n
from s-plane poles
>> alpha = -real(CLPoless(1))
>> omegan = abs(CLPoless(1))
>> rho = alpha / omegan
>> omega = omegan * sqrt(1-rho^2)
alpha = 2.1402
omegan = 4.8945
rho = 0.4373
omega = 4.4018
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 44
EE/ME 574: Intermediate Controls Section 4.1.1
Take a look at the Bode plot for the loop, with margins
>> margin(Kc*Gcz*Gpz); grid on
30
20
10
0
10
20
M
a
g
n
itu
d
e
(
d
B
)
10
2
10
1
10
0
10
1
10
2
225
180
135
90
45
0
P
h
a
s
e
(
d
e
g
)
Bode Diagram
Gm = 28.1 dB (at 62.8 rad/sec) , Pm = 50.2 deg (at 4.42 rad/sec)
Frequency (rad/sec)
Figure 28: Bode response of T
rez
(z).
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 45
EE/ME 574: Intermediate Controls Section 4.1.1
Take a look at the frequency response of the compensator
>> bode(Kc*Gcz); grid on
15
20
25
30
35
M
a
g
n
itu
d
e
(
d
B
)
10
1
10
0
10
1
10
2
60
30
0
P
h
a
s
e
(
d
e
g
)
Bode Diagram
Frequency (rad/sec)
Figure 29: Frequency response of G
cz
(z).
Questions:
What type of controller is implemented by G
cz
(z)
What are the approximate frequencies of the pole and zero ?
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 46
EE/ME 574: Intermediate Controls Section 4.1.1
Take a look at the error response
>> Trez = feedback(1, Kc*Gcz*Gpz)
Transfer function: z^2 - 1.851 z + 0.8561
----------------------
z^2 - 1.754 z + 0.8073
Sampling time: 0.05
>> bode(Trez); grid on
System will meet a tracking error requirement of E
track
10% with
t
below about 0.3 [rad/sec].
30
25
20
15
10
5
0
5
10
M
a
g
n
itu
d
e
(
d
B
)
10
2
10
1
10
0
10
1
10
2
0
45
90
P
h
a
s
e
(
d
e
g
)
Bode Diagram
Frequency (rad/sec)
Figure 30: Bode response of T
rez
(z).
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 47
EE/ME 574: Intermediate Controls Section 5.0.0
5 Compensator design by discrete equivalent TF
One way to design a compensator for computer-based control is by
emulating a continuous-time controller.
1. Design
Design a continuous-time, G
cs
(s), by any suitable method
2. Implementation
(a) Select the sample rate F
s
[samples/second]. T
s
= 1/F
s
.
(b) Convert G
cs
(s) to a discrete-time compensator, G
cz
(z)
3. Analysis
(a) Done in the z-domain
To correctly consider sampling effects.
(b) Convert the continuous-time model for the plant, Gps (s) to discrete
time, G
pz
(z)
(c) Analyze the complete discrete time system
Many discrete controllers (compute-based controllers) are designed in this
fashion, because the tools and understanding of continuous-time can be
brought to bear.
Synonyms
Design by discrete equivalent
Design by emulation
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 48
EE/ME 574: Intermediate Controls Section 5.0.0
Block diagrams for 3 steps, designing a discrete compensator by emulation
1. Design
Gp(s)
Plant
y(t)
Hy(s)
Sensor
Gc(s)
Controller
-
+
u(t) e(t)
r(t)
Controller Process under control
Trajectory
Generation
Figure 31: Block diagram for design.
2. Implementation
ys(k) ys(t)
u(k)
(A/D Conv.)
ZOH
u(t)
(D/A
Conv.)
t=kTs
Gp(s)
Plant
y(t)
Hy(s)
Sensor
-
+
e(k)
r(k)
Analog part
Trajectory
Generator
Discrete part, Computer Controller
Kc Gc(z)
Figure 32: Block diagram for implementation.
3. Analysis
u(k) Computer
Controller
Gp(z)
ZOH + Plant
y(k)
Hy(z)
Sensor
-
+
e(k)
r(k)
Discrete Model of Plant
Trajectory
Generator
Discrete Controller
Gc(k)
ys(k)
ys(k)
Figure 33: Block diagram for analysis.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 49
EE/ME 574: Intermediate Controls Section 5.1.0
Design by discrete equivalent:
1. Design G
cs
(s) by standard methods
2. Select T
s
and convert G
cs
(s) to G
cz
(z)
3. Analyze K
c
G
cz
(z) G
pz
(z)
For step 2, we must use a method to nd G
cz
(z) that approximates G
cs
(s)

5.1 Matlabs c2d() command
Matlabs c2d() command as six possible methods converting a continuous-
time TF into a discrete-time TF
>> help c2d
C2D Conversion of continuous-time models to discrete time.
SYSD = C2D(SYSC,Ts,METHOD) converts the continuous-time LTI
model SYSC to a discrete-time model SYSD with sample time Ts.
The string METHOD selects the discretization method among the
following:
zoh Zero-order hold on the inputs
foh Linear interpolation of inputs (triangle appx.)
imp Impulse-invariant discretization
tustin Bilinear (Tustin) approximation
prewarp Tustin approximation with frequency prewarping.
The critical frequency Wc (in rad/sec) is specified
as fourth input by
SYSD = C2D(SYSC,Ts,prewarp,Wc)
matched Matched pole-zero method (for SISO systems only).
The default is zoh when METHOD is omitted.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 50
EE/ME 574: Intermediate Controls Section 5.1.1
ZOH
The Zero-Order Hold conversion models a zero-order-hold in the input
path of the continuous time system. This option exactly models G
p
(s) in
gure 32.
FOH
Models a rst-order-hold, correct for signal processing applications where
a FOH is used.
imp
Matches the impulse response of the transfer function. Note that a
continuous-time input is not the same signal as a discrete-time input
Impulse type: Height Width
Continuous-time Innite Innitesimal
Discrete-time
1
Ts
T
s
Tustins method
See the next section.
prewarp
Used for digital lters design, adjusts the conversion to give a more accurate
match in a critical frequency range.
matched
Transforms poles and zeros according to z = e
sTs
.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 51
EE/ME 574: Intermediate Controls Section 5.1.1
5.1.1 Why 6 different design methods
When the physical system incorporates a zero-order hold, we can nd a
G(z) that exactly matches G(s).
This is the case for converting G
ps
(s) to G
pz
(z)
When we matching transfer functions (no ZOH in the physical system) there
is not an exact match
This is the case for converting G
cs
(s) to G
cz
(z)
The reason the conversion is approximate lies with the difference
between the continuous and discrete input signal. When this is modelled
exactly (e.g., ZOH) the correspondence is exact.
Tustins rule gives a good approximation for controller design.

Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 52
EE/ME 574: Intermediate Controls Section 5.2.1
5.2 Tustins rule to nd G
cz
(z) that approximates G
cs
(s)
5.2.1 Deriving Tustins rule
Consider
u(t) =
Z
t
o
e() d or G
c
(s) =
1
s
(39)
Then
u(k) = u(k 1) +
Z
kTs
kTsTs
e() d (40)
Eqns (39) and (40) are exact, but with knowledge of e(t) only at sample
instants, there is no exact way to integrate e(t) in Eqn (40).
One approximate method to integrate e(t) is the trapezoidal-rule.
e(k-1) e(k)
e(t)
t
Figure 34: The trapezoidal rule of Tustins method approximates
R
e(t).
The trapezoidal approximation gives:

Z
kTs
kTsTs
e() d
[e(k 1) +e(k)] T
s
2
Plugging this into Eqn (40) gives:
u(k) = u(k 1) +
[e(k 1) +e(k)] T
s
2
(41)
= u(k 1) +
T
s
2
[e(k 1) +e(k)]
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 53
EE/ME 574: Intermediate Controls Section 5.2.1
Rearranging to derive the transfer function
u(k) u(k 1) =
T
s
2
e(k) +
T
s
2
e(k 1)
U (z)
_
1z
1
_
= E (z)
T
s
2
_
1+z
1
_
From which we get the TF
G
c
(z) =
U (z)
E (z)
=
Ts
2
_
1+z
1
1z
1
_
(42)
Comparing G
c
(z) with G
c
(s), one nds an approximation for s:
G
c
(s) =
1
s
G
c
(z) =
T
s
2
_
1+z
1
1z
1
_
1
s

T
s
2
_
1+z
1
1z
1
_
so s
2
T
s
_
1z
1
1+z
1
_
=
2
T
s
_
z 1
z +1
_
(43)
Tustins rule, to form G
z
(z) from G
s
(s):
1. Replace s in G
s
(s) by
2
T
s
_
z 1
z +1
_
2. Simplify G
z
(z), and express it in rational polynomial form .
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 54
EE/ME 574: Intermediate Controls Section 5.2.2
5.2.2 Example with Tustins rule
Example
G
c
(s) =
4s +5
s +2
(phase lead compensator)
Using T
s
= 0.8 and
s
2
Ts
z 1
z +1
, Gives Gc (z) =
4
_
2
0.8
_
z1
z+1
__
+5
_
2
0.8
_
z1
z+1
__
+2
With some re-arrangement we get:
Gc (z) =
10(z 1) +5 (z +1)
2.5 (z 1) +2 (z +1)
=
15z 5
4.5z 0.5
Putting in monic form
G
c
(z) =
3.333z 1.111
z 0.1111
With Matlab c2d() command
>> Gcs = tf( [4 5], [ 1 2])
>> Ts = 0.8
>> Gcz = c2d(Gcs, Ts, tustin)
Transfer function: 3.333 z - 1.111
---------------
z - 0.1111
Sampling time: 0.8
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 55
EE/ME 574: Intermediate Controls Section 5.2.2
For implementation, rst rearrange into past-sample form:
G
c
(z) =
3.3331.111z
1
10.1111z
1
(44)
Next, form the difference equation
1.0u(k) 0.1111u(k 1) = 3.333e(k) 1.111e(k 1) (45)
Which is implemented in the controller as
1.0u(k) = +0.1111u(k 1) +3.333e(k) 1.111e(k 1) (46)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 56
EE/ME 574: Intermediate Controls Section 5.2.3
5.2.3 Example controller design by discrete equivalent, done by hand
Consider example 6.17 in Franklin, et al., where
G
ps
(s) =
9
_
1
0.5
s +1
_
(s +1)
_
1
2
s +1
_ , G
cs
(s) = 3
5s +1
15s +1
(47)
Find G
cz
(z), plug in the Tustins rule approximation for s:
s
2
T
s
z 1
z +1
, G
c
(z) = 3
5
_
2
Ts
_
1z
1
1+z
1
__
+1
15
_
2
Ts
_
1z
1
1+z
1
__
+1
(48)
Put expression in rational polynomial form:
G
c
(z) = 3
5
2
Ts
_
1z
1
_
+1
_
1+z
1
_
15
2
Ts
(1z
1
) +1(1+z
1
)
(49)
= 3
_
10
Ts
+1
_
+
_
1
10
Ts
_
z
1
_
30
Ts
+1
_
+
_
1
30
Ts
_
z
1
=
c
0
+c
1
z
1
d
0
+d
1
z
1
=
c
0
/d
0
+c
1
/d
0
z
1
1 + d
1
/d
0
z
1
(50)
c
0
= 3
_
10
T
s
+1
_
, c
1
= 3
_
1
10
T
s
_
, d
0
=
_
30
T
s
+1
_
, d
1
=
_
1
30
T
s
_
where the last express is to put coefcient a
0
= 1 (the standard form).
Notice: that the expressions for terms c
0
.. d
1
depend on T
s
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 57
EE/ME 574: Intermediate Controls Section 5.2.3
Thus, if T
s
changes, the discrete transfer functions change.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 58
EE/ME 574: Intermediate Controls Section 5.2.3
5.2.3 Example controller design using emulation (continued)
Using T
s
= 0.5[seconds], gives
c
0
= 3
_
10
Ts
+1
_
= 63
c
1
= 3
_
1
10
Ts
_
=57
d
0
=
_
30
Ts
+1
_
= 61
d
1
=
_
1
30
Ts
_
=59
And nally:
G
c
(z) =
63/6157/61z
1
159/61z
1
=
1.033 0.9344z
1
10.9672z
1
(51)
Which gives the implementation equation
u(k) = 0.9672u(k 1) +1.033e(k) 0.9344e(k 1) (52)
Equations (47) - (51) can be a bit of algebra, especially for higher-order
G
c
(s), but fortunately there is an easier way to make this calculation.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 59
EE/ME 574: Intermediate Controls Section 5.2.4
5.2.4 Example controller design by discrete equivalent, using Matlab
>> Kc = 3;
>> Gc_617_s = tf([5 1], [15 1])
Transfer function: 5 s + 1
--------
15 s + 1
%% Form the discrete-time TF by Tustins rule
>> Fs = 2; Ts = 1/Fs;
>> Gc_617_z = c2d(Gc_617_s, Ts, tustin)
Transfer function: 0.3443 z - 0.3115
----------------
z - 0.9672
Sampling time: 0.5
Examine the step response of the system
Write down the continuous-time model of the plant (still from example
Franklin et al. 6.17)
>> Nps = K = 3
>> Dps = [ 1.0000 3.5000 3.5000 1.0000 ]
>> Guy_617_s = tf(Nps, Dps)
Transfer function: 3
Gp(s) = -------------------------
s^3 + 3.5 s^2 + 3.5 s + 1
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 60
EE/ME 574: Intermediate Controls Section 5.2.4
Convert the plant to discrete
%% Convert plant to discrete, using zero order hold method
>> Fs = 2; Ts = 1/Fs;
>> Guy_617_z = c2d(Guy_617_s, Ts, zoh)
Transfer function: 0.0409 z^2 + 0.1071 z + 0.01706
----------------------------------
z^3 - 1.753 z^2 + 0.982 z - 0.1738
Form the closed-loop TF and plot the step response
>> TStepfinal = 20;
>> Try_617_z = feedback(Kc*Gc_617_z*Guy_617_z, 1)
Transfer function:
0.04224 z^3 + 0.07239 z^2 - 0.08246 z - 0.01594
-----------------------------------------------
z^4 - 2.678 z^3 + 2.75 z^2 - 1.206 z + 0.1521
>> figure(3)
>> step(Try_617_z, TStepfinal)
0 2 4 6 8 10 12 14 16 18 20
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 35: Step response of discrete model for example 6.17, T
s
= 0.5 [sec].
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 61
EE/ME 574: Intermediate Controls Section 5.2.4
Lets look at the discrete and continuous system responses
>> [Ycont, Tcont] = step(Try_617_s, TStepfinal);
>> hold on; plot(Tcont, Ycont, --); hold off
0 2 4 6 8 10 12 14 16 18 20
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 36: Step response of discrete model for example 6.17; with continuous
model and control in - - , T
s
= 0.5.
It is seen that the discrete system is a bit slower and with more overshoot.
The loss of speed and damping is due delay introduced by the ZOH.
The added delay introduces phase lag, it subtracts from the phase margin
The added delay is approximately
d
= T
s
/2,
The lost phase margin depends on the delay and the period of one cycle
at the cross-over frequency

lost
360

d

cycle
= 360
T
s
/2
2/
c
= 360
0.25
6.9
= 13
o
(53)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 62
EE/ME 574: Intermediate Controls Section 5.2.4
In this case, about 13
o
of phase margin are lost through discrete
implementation.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 63
EE/ME 574: Intermediate Controls Section 5.2.4
The lost phase margin can be reduced by increasing the sample rate.
Try accelerated sampling the sample with F
s
= 8 [samples/second]
0 2 4 6 8 10 12 14 16 18 20
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
Changed F
s
Was: F
s
= 2 [samples/sec]
Now: Fs = 8 [samples/sec]
Figure 37: Step response of discrete model for example 6.17; with continuous
model and control in - - , T
s
= 0.125 [sec].
Response is quite a lot better. Check the closed-loop bandwidth, to compare
with the sampling rate:
%% CL bandwidth, in Hz
>> CLWb = (bandwidth(Try_617_z) / (2*pi))
CLWb = 0.2491 [Hz]
The rst try, F
s
= 1/T
s
= 2 [Hertz] was about 8x
b
, pretty slow.
Second try, F
s
=1/T
s
=8 [Hertz] was about 32x
b
, and shows much better
performance.
Performance can also be improved by adding phase lead to Gc (s)
Notes: Pay attention to distinguish [cycles/sec] and [rad/sec].
The limit for the project is F
s
50
b
/2 [samples/sec].
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 64
EE/ME 574: Intermediate Controls Section 6.1.0
6 DC Gain, Steady State Error and Complex Gain
6.1 DC Gain
The DC gain of a discrete system is given as
K
DC
= T (z)
z1
(54)
For example, the compensator above had the transfer function
G
c
(z) =
1.0333z 0.9344
z 0.9672
(55)
So the DC gain of the compensator is:
K
DC
= G
c
(z = +1) =
1.03330.9344
10.9672
=
0.0984
0.0328
= 3 (56)
Recall that for the example, the original G
c
(s) was
G
c
(s) = 3
5s +1
15s +1
Notice in Eqn (56) that it is not easy to examine G
c
(z) and determine the
DC gain.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 65
EE/ME 574: Intermediate Controls Section 6.1.0
If we have numerator and denominator polynomials, with can use
Polynomial evaluation, evaluating with z = 1, or
The sum of the numerator and denominator
>> num = Gcz.num{1}
num = 1.0328 -0.9344
>> den = Gcz.den{1}
den = 1.0000 -0.9672
>> KDC = polyval(num, 1) / polyval(den, 1)
KDC = 3
>> KDC = sum(num) / sum(den)
KDC = 3
The bode() command also works
>> [Mag, Phase] = bode(Gcz, 0) %% bode(TF, omega)
Mag = 3
Phase = 0
Notice that bode() is evaluated with omega, not z
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 66
EE/ME 574: Intermediate Controls Section 6.2.1
6.2 Steady-State error
The analysis of discrete-time steady-state error is analogous to the
continuous-time case.
This can be done from either the open-loop loop gain, or the closed-loop
T
rez
(z)
Methods
1. Apply the nal value theorem from theory (see section 2.2.4)
2. Determine the Bode form for the discrete loop-gain transfer function
(open-loop), and determine the systemtype and SSE fromthe Bode form.
Bode form for discrete TFs:
K
c
G
c
(z) G
p
(z) = K
Bode
_
z 1
T
s
_
no
G
lz
(z) (57)
where all poles and zeros at z = +1 are placed in the term (z 1)
no
,
and G
lz
(z) has a DC gain of 1.0.
6.2.1 Determining steady-state error from T
rez
(z) (or T
re
(s))
We can determine steady state error for step or ramp inputs from the bode
plot of T
rez
(z) (or T
re
(s))
Consider the example plant of section 5.2.4
>> Guy_617_z= c2d(Guy_617_s, Ts, zoh)
Transfer function: 0.0409 z^2 + 0.1071 z + 0.01706
----------------------------------
z^3 - 1.753 z^2 + 0.982 z - 0.1738
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 67
EE/ME 574: Intermediate Controls Section 6.2.1
Build two systems
1. Type 0 system: with phase-lag control
G
c1
(s) = 3
5s +1
15s +1
>> Gc_617_PhaseLag_z = c2d(Gc_617_PhaseLag_s, Ts, tustin)
Transfer function: 0.3443 z - 0.3115
-----------------
z - 0.9672 Sampling time: 0.5
>> Trez1 = feedback(1, Kc*Gc_617_PhaseLag_z*Guy_617_z)
Transfer function: z^4 - 2.72 z^3 + 2.678 z^2 - 1.124 z + 0.1681
---------------------------------------------
z^4 - 2.678 z^3 + 2.75 z^2 - 1.206 z + 0.1521
Sampling time: 0.5
2. Type I system: with PI control
G
c2
(s) = 0.1
5s +1
s
>> Gc_617_PI_z = c2d(Gc_617_PI_s, Ts, tustin)
Transfer function: 5.25 z - 4.75
-------------
z - 1 Sampling time: 0.5
>> Trez2 = feedback(1, Kc*Gc_617_PI_z*Guy_617_z)
Transfer function:
z^4 - 2.753 z^3 + 2.735 z^2 - 1.156 z + 0.1738
----------------------------------------------
z^4 - 2.732 z^3 + 2.772 z^2 - 1.198 z + 0.1657
Sampling time: 0.5
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 68
EE/ME 574: Intermediate Controls Section 6.2.1
Looking at Bode plots of the two transfer functions:
30
20
10
0
10
M
a
g
n
itu
d
e
(d
B
)
10
3
10
2
10
1
10
0
10
1
45
0
45
90
P
h
a
s
e
(d
e
g
)
Bode: Trez1
Frequency (rad/sec)
60
40
20
0
20
M
a
g
n
itu
d
e
(d
B
)
10
3
10
2
10
1
10
0
10
1
45
0
45
90
P
h
a
s
e
(d
e
g
)
Bode: Trez2
Frequency (rad/sec)
(a) T
rez1
(z) (Type 0 system) (b) T
rez2
(z) (Type I system)
Figure 38: Bode plots of T
rez1
(z) and T
rez2
(z).
Type 0 system:
The lim
0
T
erz
_
z = e
j Ts
_
is evident in gure 1. For the Type 0 system,
the steady-state error for a step input is given as:
>> SSEstep1 = bode(Trez1, 0)
SSEstep1 = 0.1000
Simply evaluate the DCgain of T
rez
(z) (or T
re
(s)) to determine SSE(step)
Type I system
We can recognize fromthe Bode plot of T
rez2
(z) that the system is Type I.
The T
rez2
(z) increases 20 dB per decade in the low-frequency region,
and
The angle is +90
o
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 69
EE/ME 574: Intermediate Controls Section 6.2.1
Type I system (continued)
At low frequencies, the Bode plot of gure 38.b is approximated as:
T
rez
_
z = e
j Ts
_

1
K
Bode
j (58)
Where K
Bode
is K
Bode
of the loop gain in Bode form.
Evaluating T
rez
(z) at a low frequency
a
, K
Bode
is given by:
K
Bode


a
|T
rez
(z = e
j a Ts
)|
(59)
The the steady-state error works out to be (for T
rez2
(z)):
SSE(ramp) =
1
k
v
, withk
v
= K
Bode
so SSE(ramp)
|T
rez
(z)|

a
(60)
Example:
>> wa = 0.001
>> KBode = wa / bode(Trez2, wa), KBode = 0.3000
>> SSEramp = bode(Trez2, wa)/wa, SSEramp = 3.3333
K
Bode
is not sensitive to changes in
a
, so long as
a
is sufciently small
>> wa = 0.0001
>> SSE = bode(Trez2, wa)/wa
SSE = 3.3333
>> wa = 0.01
>> SSE = bode(Trez2, wa)/wa
SSE = 3.3333
The method of Eqns (59)-(60) works equally well with continuous time
systems,
SSE(ramp)
|T
re
(s = j
a
)|

a
(61)
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 70
EE/ME 574: Intermediate Controls Section 6.3.0
6.3 Complex gain from a discrete TF
An important idea that underlies frequency-domain analysis and the Bode
plot is complex gain.
A sinusoidal input gives a sinusoidal output, with a changed magnitude
and phase
The complex gain is given as:

U
= G(z)
z=1(Ts)
Example:
0.3443 z - 0.3115
Sys167_cz = -----------------
z - 0.9672
Sampling time: 0.5
>> Nz = Sys617_cz.num{1}
Nz = 0.3443 -0.3115
>> Dz = Sys617_cz.den{1}
Dz = 1.0000 -0.9672
>> w = 2;
>> z = 1.0*exp(j*w*Ts), z = 0.5403 + 0.8415i
>> Gain0 = polyval(Nz, z) / polyval(Dz, z)
Gain0 = 0.3340 - 0.0203i
%% Determine Gcz at w=2 with bode command, and convert to complex val.
>> [Mag1, Th1] = bode( Sys617_cz, 2 );
>> Gain2 = Mag1*exp(j*(Th1*pi/180))
Gain2 = 0.3340 - 0.0203i
The calculations above underlie the bode plot for discrete systems.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 71
EE/ME 574: Intermediate Controls Section 7.0.0
7 Conclusion
The vast majority of controllers are actually implemented in
microprocessors, as discrete-time systems.
Discrete-time systems are implemented as difference equations, such as
u(k) =a
1
u(k 1) a
2
u(k 2) +b
o
e(k) +b
1
e(k 1) +
Outputs are governed by a sum of:
Current input and past inputs, and
Past outputs
We have seen the z-transform, which
Gives us many of the methods we use with Laplace transforms
Has certain differences with the Laplace transform, such as the region on
the z-plane for stable poles.
Discrete controller design
Can be done by designing G
cs
(s) and converting it to G
cz
(z)
Can be done directly in the discrete domain
Analyze the Bode plot and root locus of z-transforms
Controller performance is analyzed entirely in the z-domain.
Part 5: Z-Transform and discrete control (Revised: Feb 13, 2013) Page 72
EE/ME 574: Intermediate Controls
Discrete State Space Methods
Contents
1 Building a discrete state-space model 2
1.1 Finding B
p
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Converting continuous state space models to discrete . . . . . . . 4
1.2.1 The output equation . . . . . . . . . . . . . . . . . . . . 6
1.3 Discrete Transfer Function from a discrete state-space model . . . 6
2 Control of discrete state-space systems 9
2.1 Pole placement . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Linear Quadratic Regulator . . . . . . . . . . . . . . . . . . . . . 14
2.2.1 Try with new Q . . . . . . . . . . . . . . . . . . . . . . 16
2.2.2 Try another new Q . . . . . . . . . . . . . . . . . . . . . 17
3 Controllability and Observability 18
4 Conclusions, Discrete State-variable model formulation and control 20
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 1
EE/ME 574: Intermediate Controls Section 1.0.0
1 Building a discrete state-space model
The discrete state-space model takes the form:
x(k +1) = Ap x(k) +Bp u(k) (1)
y(k) = C
p
x(k) +D
p
u(k)
Notes: well use F
p
, G
p
, H
p
, J
p
for the continuous time model, and
A
p
, B
p
, C
p
, D
p
for the discrete (sampled) model.
Starting with the continuous model, the discrete model is computed by
solving the differential equation for one sample interval:
Starting with:
x(t) = F
p
x(t) +G
p
u(t) (2)
y(t) = H
p
x(t) +J
p
u(t)
And integrating the differential equation, gives:
x(t) = e
Fp (tt0)
x(t
0
) +
Z
t
t0
e
Fp (t)
G
p
u() d (3)
By letting t
0
= kT
s
and t =t
0
+T
s
, Eqn (3) becomes:
x((k +1)T
s
) = e
Fp Ts
x(kT
s
) +
Z
(k+1)Ts
kTs
e
Fp ((k+1)Ts)
G
p
u() d (4)
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 2
EE/ME 574: Intermediate Controls Section 1.1.0
Which can be put in the discrete form:
x(k +1) = A
p
x(k) +B
p
u(k)
where
A
p
= e
Fp Ts
(5)
1.1 Finding B
p
To nd B
p
, the integral of Eqn (4) must be solved.
An assumption must be made about the input signal u(t) over the sample
interval.
Assuming that the input to the continuous system is a Zero Order Hold
(ZOH),
Term u() is constant over the integration interval in Eqn (3), and G
p
and
u() come out of the integral.
Assuming ZOH, the integral of the input becomes:
Z
(k+1)Ts
kTs
e
Fp ((k+1)Ts)
G
p
u() d =

Z
Ts
0
e
Fp
d

G
p
u(kT
s
) (6)
so
B
p
=

Z
Ts
0
e
Fp
d

G
p
(7)
The integral of Eqn (7) can be solved numerically, giving Bp.
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 3
EE/ME 574: Intermediate Controls Section 1.2.0
1.2 Converting continuous state space models to discrete
Referring to Franklin et al. example 2.14, the voice-coil motor, with
F
p
, G
p
, H
p
, J
p
as given previously, then the discrete model is obtaned by
starting with the continuous time state-space model, and converting it to
discrete:
>> SSuys = ss(Fp, Gp, Hp, Jp) %% First define the
a = x1 x2 x3 %% continuous-time model
x1 -0.15 0 3.15
x2 1 0 0
x3 -31.5 0 -15
b = u1 c = x1 x2 x3 d = u1
x1 0 y1 0 1 0 y1 0
x2 0
x3 50 Continuous-time model.
%% Build the discrete SS model, set the sample rate to 6/second
>> Fs = 6; Ts = 1/Fs Ts = 0.1667
>> SSuyz = c2d(SSuys, Ts, zoh)
a = x1 x2 x3
x1 0.4096 0 0.12
x2 0.1245 1 0.01815
x3 -1.2 -0 -0.1563
c =
x1 x2 x3
y1 0 1 0
b = u1
x1 0.9076
x2 0.06405
x3 1.948
d =
u1
y1 0
Sampling time: 0.16667
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 4
EE/ME 574: Intermediate Controls Section 1.2.0
Discrete-time model.
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 5
EE/ME 574: Intermediate Controls Section 1.3.0
1.2.1 The output equation
Since
y(t) = H
p
x(t) +J
p
u(t)
the sampled y(k) is given (simply) by:
y(k) = H
p
x(k) +J
p
u(k)
In other words
The output equation does not change, C
p
= H
p
, D
p
= J
p
.
1.3 Discrete Transfer Function from a discrete state-space
model
Starting with
x(k +1) = A
p
x(k) +B
p
u(k) (1, repeated)
y(k) = C
p
x(k) +D
p
u(k)
We get:
z Z{x(k)} = A
p
Z{x(k)}+B
p
Z{u(k)} (8)
This gives:
(z I A
p
) x(z) = B
p
U(z) (9)
x(z) = (z I A
p
)
1
B
p
U (z) (10)
Y (z) = C
p
x(z) +D
p
U (z) (11)
Which gives the discrete transfer function
Y (z)
U(z)
=Cp (z I Ap)
1
Bp +Dp (12)
Eqn (12) has precisely the form of Y (s)/U (s) for continuous systems.
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 6
EE/ME 574: Intermediate Controls Section 1.3.0
Obtaining the discrete transfer function of the plant
1. Approach one, discretize the State-variable model, then obtain the TF
. %% Use SSuyz from above
>> Guyz = tf(SSuyz)
Transfer function: 0.06405 z^2 + 0.1322 z + 0.01766
------------------------------------
z^3 - 1.253 z^2 + 0.3333 z - 0.08006
Sampling time: 0.16667
Note: The Discrete SS model and Discrete TF model have the sample
period, T
s
recorded, so the tf() command knows T
s
.
2. Approach two, Convert the continuous-time state-variable model to a
continuous-time TF, the discretize that
>> Guys = tf(SSuys)
Transfer function: 157.5
-------------------------
s^3 + 15.15 s^2 + 101.5 s
>> Guyz2 = c2d(Guys, Ts, zoh)
Transfer function: 0.06405 z^2 + 0.1322 z + 0.01766
------------------------------------
z^3 - 1.253 z^2 + 0.3333 z - 0.08006
Sampling time: 0.16667
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 7
EE/ME 574: Intermediate Controls Section 1.3.0
We can work directly with the discrete state-variable model to investigate
the characteristics of the open-loop system
>> OLPolesz = pole(SSuyz)
OLPolesz = 1.0000
0.1266 + 0.2530i
0.1266 - 0.2530i
Note pole at z = +1.0, the system is Type1
Examining the pole-zero map and bode plot of the OL system
>> figure(1), clf
>> bode(SSuyz)
>> figure(2), clf
>> pzmap(SSuyz)
2 1.5 1 0.5 0 0.5 1
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
PoleZero Map
Real Axis
Im
a
g
in
a
ry
A
x
is
40
20
0
20
40
M
a
g
n
itu
d
e
(d
B
)
10
1
10
0
10
1
10
2
450
360
270
180
90
P
h
a
s
e
(d
e
g
)
Bode Diagram
Frequency (rad/sec)
Figure 1: PZ Map and Bode plot for SSuyz.
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 8
EE/ME 574: Intermediate Controls Section 2.1.0
2 Control of discrete state-space systems
2.1 Pole placement
Pole-placement design is carried out exactly as with continuous-time, state-
variable model,
Except that the poles must make sense on the Z-plane
1. Select S-plane closed-loop poles, s
i
>> DesiredPoless = [-2, -8+j*2, -8-j*2]
2. Convert the poles to the z-plane
zi = e
si Ts
(13)
>> DesiredPolesz = exp(DesiredPoless * Ts)
DesiredPolesz = [0.7165, 0.2491 + 0.0862i, 0.2491 - 0.0862i]
Examining the PZ map
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
real
im
a
g
in
a
r
y
Figure 2: Pole-Zero map showing x open-loop and desired CL poles.
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 9
EE/ME 574: Intermediate Controls Section 2.1.0
3. Design the controller by pole-placement
>> Ap = SSuyz.a; %% Extract the Ap and Bp matrices
>> Bp = SSuyz.b;
>> Cp = SSuyz.c; Dp = SSuyz.d;
>> Kz = place(Ap, Bp, DesiredPolesz)
Kz = [ -0.0211 0.7572 0.0047 ]
>> Acl = (Ap - Bp*Kz)
Acl = 0.4287 -0.6872 0.1157
0.1259 0.9515 0.0178
-1.1591 -1.4754 -0.1655
%% Determine the DCGain, and Nf. Notice the discrete-time form
>> Nfz = 1 / (Ccl*inv(eye(3)-Acl)*Bp + Dp)
Nfz = 0.7572
>> Bcl = Nfz * Bp
Bcl = 0.6872
0.0485
1.4754
>> Ccl = Cp - Dp*Kz
Ccl = 0 1 0
>> Dcl = Dp*Nfz
Dcl = 0
%% Form the closed-loop system
%% Notice Ts on each line, this is what tells
%% the ss() command to build a discrete-time system model
>> SSryz = ss(Acl, Bcl, Ccl, Dcl, Ts);
>> SSrez = ss(Acl, Bcl, -Ccl, (1-Dcl), Ts);
>> SSruz = ss(Acl, Bcl, -Kz, Nfz, Ts )
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 10
EE/ME 574: Intermediate Controls Section 2.1.0
Examine the step response, output and error
>> figure(1), clf >> figure(3), clf
>> step(SSryz) >> step(SSruz)
>> figure(2), clf
>> step(SSrez)
0 0.5 1 1.5 2 2.5 3 3.5 4
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Step Response
Time (sec)
A
m
p
litu
d
e
0 0.5 1 1.5 2 2.5 3 3.5 4
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Step Response
Time (sec)
A
m
p
litu
d
e
(a) Step response (b) Error response to a step input
Figure 3: Step and error response
0 0.5 1 1.5 2 2.5 3 3.5 4
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 4: Control effort response to a step input.
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 11
EE/ME 574: Intermediate Controls Section 2.1.0
Continuous controller given for comparison
>> Ks = place(Fp, Gp, DesiredPoless)
Ks = [ -0.0121 0.8635 0.0570 ]
>> Fcl = (Fp - Gp*Ks)
Fcl = -0.1500 0 3.1500
1.0000 0 0
-30.8960 -43.1746 -17.8500
>> Nfs = 1 / (Hcl*inv(-Fcl)*Gp + Jp)
Nfs = 0.8635
>> Gcl = Nfs * Gp
Gcl = 0
0
43.1746
>> Hcl = Hp - Jp*Ks
Hcl = 0 1 0
>> Jcl = Jp*Nfs
jcl = 0
>> SSrys = ss(Fcl, Gcl, Hp, Jp);
%% Plot both continuous and discrete system response
>> [Yz, Tz] = step(SSryz); step(SSrys);
>> hold on, stem(Tz, Yz); hold off
0 0.5 1 1.5 2 2.5 3
0
0.2
0.4
0.6
0.8
1
Step Response
Time (sec)
A
m
p
litu
d
e
The continuous
and discrete systems agree
quite well at the sample
instants.
They do not exactly
agree
The control signals are
not quite the same.
Figure 5: Continuous and discrete system response.
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 12
EE/ME 574: Intermediate Controls Section 2.1.0
Notice that K
s
is comparable to K
z
>> Kz = place(Ap, Bp, DesiredPolesz)
Kz = [ -0.0211 0.7572 0.0047 ]
>> Ks = place(Fp, Gp, DesiredPoless)
Ks = [ -0.0121 0.8635 0.0570 ]
In the limit as T
s
0 , K
z
K
s
Looking at N
f
>> Nfz
Nfz = 0.7572
>> Nfs
Nfs = 0.8635
Again comparable, but not identical.
Notice the difference in calculation to determine N
f
:
Continuous
N
f
= 1/

H
cl
(sI F
cl
)
1
G
p
+J
p

s=0
= 1/

H
cl
(F
cl
)
1
G
p
+J
p

Discrete
N
f
=1/

D
cl
(zI A
cl
)
1
B
p
+D
p

z=+1
=1/

D
cl
(I F
cl
)
1
B
p
+D
p

Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 13
EE/ME 574: Intermediate Controls Section 2.2.0
2.2 Linear Quadratic Regulator
To determine the LQR controller of a discrete system,
Choose Q and R (identical to continuous-time Q and R)
Matlabs lqr() command automatically determines whether the system
is discrete or continuous from the LTI model.
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> %% LQR Example
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>
>> Q = diag([1 1 1]); R = 1;
>> Ks = lqr(SSuys, Q, R) %% Continuous lqr
Ks = [ 0.7711 1.0000 0.7896 ]
>> Fcl = Fp-Gp*Ks; Hcl = Hp - Jp*Ks
>> Kz =lqr(SSuyz, Q, R) %% Discrete lqr
Kz = [ -0.1314 0.3369 0.0083 ]
>> Acl = Ap-Bp*Kz; Ccl = Cp - Dp*Kz
%% Set up correct feed-forward gain, continuous
>> Nfs = 1/(Hcl*inv(-Fcl)*Gp+Jp) %% Note (0*I - Fcl)
Nfs = 1.0000 %% Continuous: DC = lim s -> 0
>> Gcl = Nfs * Gp;
%%Set up correct feed-forward gain, discrete
>> Nfz = 1/(Ccl*inv(eye(3)-Acl)*Bp+Dp) %% Note (Eye - Acl)
Nfz = 0.3369 %% Discrete: DC = lim z -> 1
>> Bcl = Nfz * Bp;
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 14
EE/ME 574: Intermediate Controls Section 2.2.0
Determine closed-loop poles and build system models
>> CLPoless = eig(Fcl) %% Continuous
CLPoless = -50.1257
-0.8634
-3.6392
>> CLPolesz = eig(Acl) %% Discrete
CLPolesz = 0.8673
0.4440
0.0236
>> SSrys = ss(Fcl, Gcl, Hp-Jp*Ks, Jp*Nfs);
>> SSryz = ss(Acl, Bcl, Cp-Dp*Kz, Dp*Nfz, Ts) %% Note Ts
0 1 2 3 4 5 6 7
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
PO: 0%,
T
r
: 2.50,
T
s
: 5.00,
ISE: 0.8383
Q = [ 1.00 0.00 0.00]
[ 0.00 1.00 0.00]
[ 0.00 0.00 1.00]
Discrete LQR, with continuous
Time (sec)
A
m
p
litu
d
e
Figure 6: LQR response for the sampled system,T
s
= 1/6 [seconds.
Dashed line: continuous-time system response.
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 15
EE/ME 574: Intermediate Controls Section 2.2.1
2.2.1 Try with new Q
Q
2
= 100C
T
p
C
p
=

0 0 0
0 100 0
0 0 0

, R = [1]
>> K2z = lqr(SSuyz, Q2, R)
>> ...
>> figure(4), clf
>> step(SSryz, 7)
0 1 2 3 4 5 6 7
0
0.2
0.4
0.6
0.8
1
1.2
1.4
PO: 5.54%,
T
r
: 0.17,
T
s
: 0.67,
ISE: 0.1677
Q = [ 0.00 0.00 0.00]
[ 0.00 100.00 0.00]
[ 0.00 0.00 0.00]
Discrete LQR, with continuous
Time (sec)
A
m
p
litu
d
e
Figure 7: LQR design, response with a large cost on output error.
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 16
EE/ME 574: Intermediate Controls Section 2.2.2
2.2.2 Try another new Q
Q =

1 0 0
0 100 0
0 0 0

, R = [1]
>> K3z = lqr(SSuyz, Q3, R)
>> ...
>> figure(4), clf
>> step(SSryz, 7)
0 1 2 3 4 5 6 7
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
PO: 0.00%,
T
r
: 0.33,
T
s
: 0.50,
ISE: 0.1785
Q = [ 1.00 0.00 0.00]
[ 0.00 100.00 0.00]
[ 0.00 0.00 0.00]
Discrete LQR, with continuous
Time (sec)
A
m
p
litu
d
e
Figure 8: LQR design, response with a modest additional cost on rate.
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 17
EE/ME 574: Intermediate Controls Section 3.0.0
3 Controllability and Observability
The concepts of controllability and observability carry over to discrete
systems.
The mathematical foundations are somewhat different
The equations for controllability and observability are the same.
C =

B AB A
2
B A
(n1)
B

(14)
O =

C
CA
CA
2
.
.
.
CA
(n2)

(15)
Considering the voice coil motor:
Controllability
>> CCntl = [Bp, Ap*Bp, Ap*Ap*Bp]
CCntl =
0.9076 0.6056 0.0807
0.0640 0.2124 0.2626
1.9484 -1.3938 -0.5090
>> rank(CCntl)
ans = 3
The system is controllable
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 18
EE/ME 574: Intermediate Controls Section 3.0.0
Observability:
>> OObsvr = [Cp; Cp*Ap; Cp*Ap*Ap]
OObsvr =
0 1.0000 0
0.1245 1.0000 0.0182
0.1538 1.0000 0.0303
>> rank(OObsvr)
ans = 3
The system is observable
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 19
EE/ME 574: Intermediate Controls Section 4.0.0
4 Conclusions, Discrete State-variable model
formulation and control
Discrete state-variable models can be obtained by
Converting a continuous-time state-variable model
Converting a discrete transfer-function model, with tf2ss()
Some systems are naturally discrete (e.g., an inventory control system,
or message queues in the controls of a communication network)
Poles are the eigenvalues of the system matrix, A
p
in the notation used here
Poles must be interpreted on the z-plane, or
Converted to equivalent s-plane poles and interpreted.
Controller design can be done in several ways
Pole placement, by determining the desired z-plane poles
By the Linear-Quadratic-Regulator algorithm
Matlabs tools make it straight forward to generate various models, to
address
Output response
Error response
Control response
Disturbance response
Part 6: Discrete State Space Methods (Revised: Jan 15, 2013) Page 20
EE/ME 574: Intermediate Controls
Direct Digital Design
or
The Discrete Root Locus
Contents
1 Introduction 2
1.1 Illustration of the effects of rapid sampling . . . . . . . . . . . . . 3
1.1.1 High noise sensitivity . . . . . . . . . . . . . . . . . . . 3
1.1.2 High sensitivity to parameter variation . . . . . . . . . . 4
2 Direct Digital Control Design (section 8.6 in Franklin et al. (5
th
edition)) 10
2.1 Direct digital design, example 1 . . . . . . . . . . . . . . . . . . 12
2.1.1 Example: apply PI compensation . . . . . . . . . . . . . 16
2.2 A more complex example . . . . . . . . . . . . . . . . . . . . . . 21
3 Conclusions 27
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 1
EE/ME 574: Intermediate Controls Section 1.0.0
1 Introduction
As weve seen, the digital equivalent of an S-plane controller design can
break down if the sample rate is not 20 - 50 times faster than the closed-
loop bandwidth.
Sampling with 20F
BW
F
s
50F
BW
is sometimes called rapid
sampling
Advantages of rapid sampling:
Minimal phase lag introduced by the Zero-Order-Hold
More accurately implement the discrete equivalent of G
c
(s)
Rapid sampling, however, has some disadvantages. Disadvantages of rapid
sampling:
Sensitivity to sensor and round-off noise can increase with the sample
rate (especially for PD, PID control)
Rapid sampling gives high sensitivity to small variations in gain.
Variations in gain arise through component variations, and also
through round-off error
Direct digital design can permit slow sampling, 5F
BW
F
s
< 20F
BW
which
avoids the disadvantages of rapid sampling
In direct digital design all design work is done in the Z-domain
Phase lag introduced by the Zero-Order-Hold is explicitly considered,
and compensated by phase lead
There is no Gc (s)
Sensitivity to sensor noise and round-off error can be lower with slower
sampling
Sensitivity to coefcient variations is lower with slower sampling
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 2
EE/ME 574: Intermediate Controls Section 1.1.1
1.1 Illustration of the effects of rapid sampling
1.1.1 High noise sensitivity
Consider the PD compensator:
G
c
(s) = k
d
s +k
p
(1)
with k
d
= k
p
= 1
G
c
(z), with F
s
= 10 [samples/second]
>> Ts=1/Fs
Ts = 0.1000
>> GPDz = c2d(GPDs, Ts, tustin)
Transfer function: 21 z - 19
Gc(z) = ---------
z + 1,
The implementation equation is
u(k) =u(k 1) +21e(k) 19e(k 1)
G
c
(z), with F
s
= 100 [samples/second]
>> Ts=1/Fs
Ts = 0.0100
>> GPDz = c2d(GPDs, Ts, tustin)
Transfer function: 201 z - 199
Gc(z) = -----------
The implementation equation is
u(k) =u(k 1) +201e(k) 199e(k 1)
Changing F
s
from 10 to 100, the numerator terms (coefcients multiplying
e(k)and e(k 1)) have become 10x larger.
If there is noise on the e(k) signal, it will have a 10x larger impact on u(k) !
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 3
EE/ME 574: Intermediate Controls Section 1.1.2
1.1.2 High sensitivity to parameter variation
Consider the plant given by:
G
p
(s) =
1
s
2
+s +0.1
, H
y
(s) =
1
0.02s +1
, G
c
(s) =6
3s +1
0.48s +1
3s +1
30s +1
where the compensator is a Lead-Lag compensator chosen for a phase
margin of PM60
0
, with steady-state error, SSE (step) 10%.
The Bode plot and step response are seen in gure 1. F
bw
=0.35 [Hz]
150
100
50
0
50
M
a
g
n
itu
d
e
(d
B
)
10
3
10
2
10
1
10
0
10
1
10
2
10
3
270
180
90
0
P
h
a
s
e
(d
e
g
)
Bode Diagram
Gm = 30.7 dB (at 11.1 rad/sec) , Pm = 67.6 deg (at 1.34 rad/sec)
Frequency (rad/sec)
0 2 4 6 8 10 12 14 16 18
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 1: Bode plot and step response for example system.
The closed-loop bandwidth is 2.2 [rad/second], so we can choose the
sample rate to be as high as 17 samples/second, and stay within the range
F
s
50F
BW
Choosing F
s
= 17 [samples/second] gives
>> Gcz
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 4
EE/ME 574: Intermediate Controls Section 1.1.2
Transfer function: 3.6 z^2 - 7.059 z + 3.461
-------------------------
z^2 - 1.883 z + 0.8828
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 5
EE/ME 574: Intermediate Controls Section 1.1.2
Looking at the closed-loop pole constellation, gure 2(a), the closed-loop
poles seem reasonable.
Figure 2(b) is more worrisome. It shows the constellation of poles given by
a random variation with =0.01 in the compensator parameters.
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
real
im
a
g
in
a
r
y
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
real
im
a
g
in
a
r
y
(a) Pole constellation, ideal parameters (b)
Cluster of poles given with
=0.01 parameter variation
Figure 2: Closed-loop pole constellation for the digitized system, design by
discrete equivalent. F
s
= 17, or 50x F
bw
.
Code to draw gure 2(b)
sigma = 0.01; clear Poles;
for jj = 1:100,
Num = Gcz.num{1}; Den = Gcz.den{1};
Num = Num + sigma*randn(size(Num)); %% Add 0.01 variation
Den = Den + sigma*randn(size(Den)); Den(1) = 1;
Try_z = feedback(tf(Num, Den, Ts)*Gpz, 1);
Poles(:,jj) = pole(Try_z);
end
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 6
EE/ME 574: Intermediate Controls Section 1.1.2
1.1.2 High sensitivity to parameter variation (continued)
Figure 3 shows the range pole locations corresponding to F
s
= 1.4 [Samples
per second], (F
s
4 F
bw
) , and coefcient variations of 0.01 standard
deviation.
While this system has variation in the closed-loop poles, it does not go
unstable for any value with this range of variation.
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
real
im
a
g
in
a
r
y
1.5 1 0.5 0 0.5 1 1.5
1.5
1
0.5
0
0.5
1
1.5
real
im
a
g
in
a
r
y
(a) Pole constellation, ideal parameters (b)
Cluster of poles given with
=0.01 parameter variation
Figure 3: Closed-loop pole constellation for the digitized system, F
s
= 1.4
[samples/second], or 4x F
bw
, with variations with =0.01.
Variation in the effective value of controller parameters can come about
through round-off error in the digital control calculations.
This is especially true because controllers are often implemented with 16
or even 8-bit microprocessors
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 7
EE/ME 574: Intermediate Controls Section 1.1.2
(Although controller parameters have to be at least 16 bit, and preferably
32 or 64 bit).
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 8
EE/ME 574: Intermediate Controls Section 1.1.2
1.1.2 High sensitivity to parameter variation (concluded)
Random variations with = 0.001 and F
s
= 100 [samples/second] are seen
in gure 4.
Many of the cases give poles outside the unit circle
Round-off errors of 0.001 are hard to avoid
(especially with integer arithmetic)
F
s
= 100 will work very nicely in theory, but practically speaking, it is
sampling too fast.
0.7 0.75 0.8 0.85 0.9 0.95 1 1.05
0.15
0.1
0.05
0
0.05
0.1
0.15
0.2
real
im
a
g
in
a
r
y
Figure 4: Closed-loop pole constellation for the digitized system, F
s
= 100
[samples/second], or 290x F
bw
, with variations with =0.001.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 9
EE/ME 574: Intermediate Controls Section 2.0.0
2 Direct Digital Control Design (section 8.6 in
Franklin et al. (5
th
edition))
The design process bears a strong relationship to continuous-time design:
Analysis tools:
* Root locus * Bode plot * Step response
Compensators:
* Phase - lead
* Phase - lag
* Lead - Lag
* PD
* PI
* PID
For continuous design, learning to interpret pole-locations on the S-plane is
essential.
For discrete design it is essential to learn to interpret pole locations on the
Z-plane.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 10
EE/ME 574: Intermediate Controls Section 2.0.0
Direct digital design proceeds by these three steps
1. Select sample rate, convert the models of continuous-time system
elements to discrete-time (Z-transform) models.
2. Design the control, using, for example
Root locus
Frequency response / Bode plot
Discrete Final Value Theorem
3. Analyze the resulting discrete time system in discrete-time
4. Iteratively adjust the design parameters to achieve performance goals.
Direct digital design has the advantages:
It is exact, the sampled model obtained in step 1 is exact.
Generally speaking, lower sample rates are possible
Something that some people may consider a disadvantage is that pole-zero
maps in the Z-plane must be considered; requiring a developed sense of how
to interpret the Z-plane.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 11
EE/ME 574: Intermediate Controls Section 2.1.0
2.1 Direct digital design, example 1
A typical control loop is seen in gure 5.
ys(k) ys(t)
u(k)
(A/D Conv.)
ZOH
u(t)
(D/A
Conv.)
t=kTs
Gp(s)
Plant
y(t)
Hy(s)
Sensor
-
+
e(k)
r(k)
Analog part
Trajectory
Generator
Discrete part, Computer Controller
Kc Gc(z)
Figure 5: Basic sampled control loop.
Consider the example system
G
p1s
(s) =
1
s +1
, H
y1
(s) = 1 (2)
Performance Requirements:

b
1 [rad/sec]
PO 20%
SSE(step) 10%
The performance requirements translate to:

c
0.5 [rad/sec]
PM50
o
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 12
EE/ME 574: Intermediate Controls Section 2.1.0
As a rst selection, choose T
s
= 0.25 [seconds] (we can revise T
s
later)
>> Gp1s = tf(1, [1 1]) ; Ts = 0.25
>> Gp1z = c2d(Gp1s, Ts, zoh)
Transfer function:
0.2212
----------
z - 0.7788
The root locus indicates pole-location for proportional control
>> rlocus(Gp1z)
1.5 1 0.5 0 0.5 1
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
Figure 6: Root locus for plant Eqn (2).
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 13
EE/ME 574: Intermediate Controls Section 2.1.0
Looking at CL poles and response with proportional feedback K
c
>> jj=0;
>> for Kc = [0.5, 2, 5, 9],
>> jj=jj+1;
>> Try =feedback(Kc*Gp1z, 1)
>> Poles(:,jj) =pole(Try);
>> end
1.5 1 0.5 0 0.5 1
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
0.5 2.0 5.0 9.0
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
Figure 7: Root locus for plant Eqn (2).
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Kc = 0.50
y
(k
)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Kc = 2.00
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0
0.2
0.4
0.6
0.8
1
1.2
Kc = 5.00
y
(k
)
k [sample]
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
50
40
30
20
10
0
10
20
30
40
Kc = 9.00
k [sample]
Figure 8: Step responses for four values of K.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 14
EE/ME 574: Intermediate Controls Section 2.1.0
K
c
= 2 is the largest tested value for smooth proportional control.
Consider the steady state error with K
c
= 2.0. The discrete FVT:
lim
k
e(k) = lim
z1

1z
1

E (z) = lim
z1

z 1
z

T
rez
(z) R(z) (3)
Note that

1z
1

=
z 1
z
, and E (z) = Trez (z) R(z)
with
R(z) =
z
z 1
step input
R(z) =
T
s
z
(z 1)
2
ramp input
Forming the TF T
rez
(z)
>> Trez = feedback(1, K*Gp1z)
Transfer function: z - 0.7788
-------------
z - 0.3364
Forming the right-hand side of Eqn (3)
SSE(step) = lim
z1

z 1
z

z 0.7788
z 0.3364

z
z 1

Cancel the zero and pole at z = +1


SSE(step) = lim
z1
z 0.7788
z 0.3364
=
0.2212
0.6636
= 33%
SSE(step) is much too large.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 15
EE/ME 574: Intermediate Controls Section 2.1.1
2.1.1 Example: apply PI compensation
Since the speed and damping are adequate, but SSE is too large, consider PI
control. Discrete PI control has the structure:
Kc G
c1z
(z) = Kc
z +b
1
z 1
(4)
Initial choice for b
1
, b
1
=0.2 (placing the zero on the real axis)
1.5 1 0.5 0 0.5 1
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
Real
Im
a
g
in
a
r
y
>> Gc1z= tf([1 -0.2], [1 -1], Ts)
Transfer function:
z - 0.2
Gc1z(a) = -------
z - 1
Figure 9: PZ map with PI compensator. : compensator pole, o: comp. zero.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 16
EE/ME 574: Intermediate Controls Section 2.1.1
Consider the Bode plot and root-locus for G
c1z
(z) G
p1z
(z) ,
(initially set Kc = 1.0)
>> Kc = 1.0;
>> figure(1), clf
>> margin(Kc*Gc1z*Gp1z)
>> Tryz = feedback(Kc*Gc1z*Gp1z, 1)
>> Axis1 = [ -1.5 1.2 1.2*[-1 1]]; tt = 0:0.01:(2*pi);
>> figure(3), clf
>> rlocus(Kc*Gc1z*Gp1z)
>> axis(Axis1); set(gca, DataAspectRatio, [1 1 1])
>> hold on
>> plot(cos(tt), sin(tt), k:, linewidth, 2); %% plot unit circle
>> plot(real(pole(Tryz)), imag(pole(Tryz)), rd) %% plot closed-loop poles
>> hold off
40
20
0
20
40
60
M
a
g
n
itu
d
e
(
d
B
)
10
2
10
1
10
0
10
1
10
2
180
135
90
P
h
a
s
e
(
d
e
g
)
Bode Diagram
Gm = 22.5 dB (at 12.6 rad/sec) , Pm = 35.8 deg (at 1.7 rad/sec)
Frequency (rad/sec)
1.5 1 0.5 0 0.5 1
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
Figure 10: Margins plot and root locus for G
c1
(z) and CL poles with K = 1.0 .
The Bode plot shows more than adequate
c
The phase margin is insufcient, but can be increased by reducing K
c
.
Since the control is PI, SSE(step) will be 0.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 17
EE/ME 574: Intermediate Controls Section 2.1.1
Consider the step response:
>> figure(3), clf
>> step(Tryz)
0 2 4 6 8 10 12
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 11: Step response with K = 1 and PZ map of gure 10.
Consider the bandwidth
>> Wb = bandwidth(Tryz)
Wb = 2.7175
Consider the steady-state error
>> SSEStep = bode(Trez, 0),
SSEStep = 8.8818e-16
SSEstep is effectively 0, corresponding to the Type I system.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 18
EE/ME 574: Intermediate Controls Section 2.1.1
Considering SSE for the ramp input (since the system is Type I)
Method 1: Final value theorem
lim
k
e(k) = e
ss
= lim
z1

1z
1

T
re
(z) R(z) (5)
= lim
z1
(z 1)
1
z
2
1.779z 0.7788
z
2
1.558z +0.7346
T
s
z
(z 1)
2
(6)
= lim
z1
(z 1)
1
(z 1) (z 0.7788)
z
2
1.558z +0.7346
T
s
z
(z 1)
2
(7)
= T
s
(10.7788) 1
11.558+0.7346
= 0.3125 (8)
Method 2: use matlab bode command:
Setup the Z-transform of Eqn (6) directly for Matlabs bode command:
>> SSE_ramp = bode( tf([1 -1], 1, Ts) ...
* Trez ...
* tf(Ts*[1 0], [1 -2 1], Ts), 0)
SSE_ramp = 0.3125
Note that the transfer function given the bode() command has three
parts, corresponding to the three terms in Eqn (6)
1. The
(z1)
z
term
2. The T
re
(z) term
3. The
Ts z
(z1)
2
term
1
st
PI controller:

b
OK,
SSE(step) OK,
PO too large.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 19
EE/ME 574: Intermediate Controls Section 2.1.1
Returning to the root locus, we know that if we move the zero closer to the
poles, it will bring the root-locus branches closer to the real axis.
Moving the compensator zero to z = 0.5
20
0
20
40
60
M
a
g
n
itu
d
e
(
d
B
)
10
2
10
1
10
0
10
1
10
2
180
135
90
P
h
a
s
e
(
d
e
g
)
Bode Diagram
Gm = 11.1 dB (at 12.6 rad/sec) , Pm = 46.1 deg (at 2.9 rad/sec)
Frequency (rad/sec)
1.5 1 0.5 0 0.5 1
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
Figure 12: Margins plot and root locus for G
c2
(z) and CL Poles for K
c
= 1.0 .
0 1 2 3 4 5 6 7 8 9
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
>> Gc2z= tf([1 -0.5], [1 -1], Ts)
Transfer function:
z - 0.5
-------
z - 1
SSEStep = 0
Wb = 2.04 [rad/sec]
PO = 15.6%
Design Complete !
Figure 13: Step response with K
c
= 1 and G
c2z
(z).
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 20
EE/ME 574: Intermediate Controls Section 2.2.0
2.2 A more complex example
Consider the Boeing 777 pitch control example from CTM:
>> num=[1.151 0.1774];
>> den=[1 0.739 0.921 0];
>> Guy = tf(num,den)
Transfer function: 1.151 s + 0.1774
Guy(s) = -------------------------
s^3 + 0.739 s^2 + 0.921 s
100
50
0
50
M
a
g
n
itu
d
e
(
d
B
)
10
2
10
1
10
0
10
1
10
2
180
135
90
45
0
P
h
a
s
e
(
d
e
g
)
Bode Diagram
Frequency (rad/sec)
Figure 14: Bode plot for Boeing 777 pitch control.
Design goals:
Put cross-over above the resonance, increase accuracy and avoid a very
low
b
Plan:
Apply phase-lead compensation to boost phase margin around
c
= 5.0
[rad/sec]
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 21
EE/ME 574: Intermediate Controls Section 2.2.0
Phase-lead compensation, rst engineered in continuous-time
>> Kcs = 2.0; tau = 0.5; alpha = 0.2;
>> Gcs = tf([tau 1], [tau*alpha 1])
Transfer function: 0.5 s + 1
Gcs(s) = ---------
0.1 s + 1
100
50
0
50
100
M
a
g
n
itu
d
e
(
d
B
)
10
3
10
2
10
1
10
0
10
1
10
2
10
3
180
135
90
45
0
P
h
a
s
e
(
d
e
g
)
Bode Diagram
Gm = Inf dB (at Inf rad/sec) , Pm = 55.4 deg (at 1.93 rad/sec)
Frequency (rad/sec)
20 10 0 10
20
15
10
5
0
5
10
15
20
Splane
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
Figure 15: Margins plot and root locus for G
c
(s) G
p
(s).
0 10 20 30 40 50
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 16: Continuous system step response with K
c
= 10 and PZ map of Fig. 15.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 22
EE/ME 574: Intermediate Controls Section 2.2.0
First iteration: design by discrete equivalent
Start with rapid sampling, F
BW
= 0.43 , choose F
s
= 20 or 47x F
BW
>> Fs = 20; Ts = 1/Fs;
>> Gcz = c2d(Gcs, Ts, tustin)
Transfer function: 4.2 z - 3.8
Gcz(z) = -----------
z - 0.6
Sampling time: 0.05
Taking a look at the margins and step response of the discrete system
The response of the discrete implementation looks very
comparable to the continuous system response.
100
50
0
50
100
M
a
g
n
itu
d
e
(
d
B
)
10
3
10
2
10
1
10
0
10
1
10
2
270
180
90
0
P
h
a
s
e
(
d
e
g
)
Bode Diagram
Gm = 29.4 dB (at 17.1 rad/sec) , Pm = 52.7 deg (at 1.93 rad/sec)
Frequency (rad/sec)
0 5 10 15 20 25 30 35 40 45
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 17: Margins plot and step response for G
cz
(z) G
pz
(z).
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 23
EE/ME 574: Intermediate Controls Section 2.2.0
Look at the root locus.
Notice many poles and zeros in a small region near z = +1.0 .
This will lead to the condition where small variations in parameters make
large variations in closed-loop pole locations.
Several poles and zeros crowded into the region near z = +1 indicates that
the sample rate is too high.
3.5 3 2.5 2 1.5 1 0.5 0 0.5 1 1.5
2
1.5
1
0.5
0
0.5
1
1.5
2
Zplane
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
0 0.5 1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
Figure 18: Root locus corresponding to gure 17.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 24
EE/ME 574: Intermediate Controls Section 2.2.0
Second design iteration. Reduce the sample rate, F
s
=2.4 [Hz], or 5.6xF
BW
.
>> Gcz = c2d(Gcs, Ts, tustin)
Transfer function: 2.297 z - 0.9459
----------------
z + 0.3514
Sampling time: 0.41667
From Bode plot, choose K
c
= 1.5 (
c
above resonance, reasonable PM)
40
20
0
20
40
60
M
a
g
n
itu
d
e
(d
B
)
10
3
10
2
10
1
10
0
10
1
270
180
90
0
P
h
a
s
e
(d
e
g
)
Bode Diagram
Gm = 13 dB (at 4.19 rad/sec) , Pm = 39.6 deg (at 1.66 rad/sec)
Frequency (rad/sec)
0 10 20 30 40 50 60 70
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
A
m
p
litu
d
e
Figure 19: Margins plot and step response for G
c
(z) G
p
(z).
3.5 3 2.5 2 1.5 1 0.5 0 0.5 1 1.5
2
1.5
1
0.5
0
0.5
1
1.5
2
Zplane
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
0 0.5 1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
Root Locus
Real Axis
Im
a
g
in
a
ry
A
x
is
Figure 20: Root locus corresponding to gure 19.
Result of reduced F
s
: 3 poles have been moved away fromthe z = +1 region.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 25
EE/ME 574: Intermediate Controls Section 2.2.0
Examine loop-gain poles, to determine system Type
>> OLPoles = pole( Kcz*Gcz*Guyz)
OLPoles = 1.0000
0.7996 + 0.3093i
0.7996 - 0.3093i
-0.3514
Steady-state error
>> Trez = feedback(1, Kz*Gcz*Guyz)
Transfer function:
z^4 - 2.248 z^3 + 1.421 z^2 + 0.08513 z - 0.2582
------------------------------------------------
z^4 - 1.934 z^3 + 1.286 z^2 - 0.1843 z - 0.1464
One OL Pole at z = +1, system is Type I
Check SSE(step)
>> SSEStep = bode(Trez, 0)
SSEStep = 3.8733e-14 (0 to within round-off error)
Check SSE(ramp)
>> Wa = 0.001;
>> SSE_ramp = 100/bode( Wa* Kcz*Gcz*Guyz , Wa)
SSE_ramp = 346.10
346% SSE(ramp) appears large, but does not violate the specication.
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 26
EE/ME 574: Intermediate Controls Section 3.0.0
3 Conclusions
Design can combine a variety of processes
Direct Digital Design
Design by Discrete Emulation + Iteration based on Direct Digital Design
Direct Digital Design
Direct analysis of the discrete domain Bode plot and root locus needed
to understand behavior of the discrete system.
Especially when Fs is only a little greater than the bandwidth.
Analysis of system response is done in the discrete domain
Step response
Margins
Bode plot
Steady-state error
Root locus
Part 7: Direct Digital Design (Revised: May 09, 2013) Page 27

Das könnte Ihnen auch gefallen