# Control Systems 2 (FS 2013)

Electronics - Devices

Nov 15, 2013 (4 years and 6 months ago)

133 views

Control Systems 2 (FS 2013)
Lecture 13:Digital controller design
Roy Smith
29 May,2013
2013-5-28
13.1
Digital control system design
Sampled-data closed-loop
G
(
s
)
T
ZOH
K
d
(
z
)
+
r
(
k
)
u
(
k
)
u
(
t
)
y
(
t
)
y
(
k
)

G
ZOH
(
z
)
equivalence
G
ZOH
(
z
)
G
(
s
)
T
ZOH
K
d
(
z
)
+
r
(
k
)
y
(
k
)

2013-5-28
13.2
Zero-order hold equivalence — transfer function
G
(
s
)
T
ZOH
u
(
k
)
u
(
t
)
y
(
t
)
y
(
k
)
|
{z
}
G
ZOH
(
z
)
Input:
u
(
k
) =
(
1
k
= 0
,
0
k
6
= 0
,u
(
t
) = step(
t
)

step(
t

T
)
.
Output:
y
(
s
) =

1

e

Ts

G
(
s
)
s
.
We now sample this,and take the
Z
-transform,
G
ZOH
(
z
) =
Z

1

e

Ts

G
(
s
)
s

= (1

z

1
)
Z

G
(
s
)
s

.
2013-5-28
13.3
Zero-order hold equivalence — state space
G
(
s
)
T
ZOH
u
(
k
)
u
(
t
)
y
(
t
)
y
(
k
)
|
{z
}
G
ZOH
(
z
)
Integrating

(
t
)
over a single sample period (
kT
to
kT
+
T
):
x
(
kT
+
T
) =
e
AT
x
(
kT
) +
Z
kT
+
T
kT
e
A
(
kT
+
T

)
Bu
(

)
d

,

A B
C D

ZOH
-equivalence
=
)
2
4
e
AT
Z
T
0
e
A

Bd

C D
3
5
2013-5-28
13.4
Zero-order hold equivalence
Frequency domain
10
-1
10
0
10
1
10
2
10
3
10
1
10
2
10
3
Magnitude
10
0
10
1
10
2
10
3
-150
-100
-50
0
50
Phase (degrees)
P(j
!
)
P(j
!
)
P(j
!
)
ZOH
equivalent of
P(s)
ZOH
equivalent of
P(s)
Nyquist frequency
Nyquist frequency
e
-j
!
T/
2
P(j
!
)
e
-j
!
T/
2
2013-5-28
13.5
Digital control system design
Sampled-data closed-loop
G
(
s
)
T
ZOH
K
d
(
z
)
+
r
(
k
)
u
(
k
)
u
(
t
)
y
(
t
)
y
(
k
)

K
(
s
)
approximation

K
(
s
)
G
(
s
)
T
ZOH
K
d
(
z
)
+
r
(
k
)
y
(
k
)

2013-5-28
13.6
Design approaches
G
(
s
)
K
(
s
)
G
ZOH
(
z
)
K
d
(
z
)
Continuous-time
design
ZOH
-equivalence
of
G
(
s
)
and
sample/hold
Discrete-time
design
Approximation
of
K
(
s
)
with
K
d
(
z
)
2013-5-28
13.7
Design approaches
G
(
s
)
K
(
s
)
G
ZOH
(
z
)
K
d
(
z
)
Continuous-time
design
ZOH
-equivalence
of
G
(
s
)
and
sample/hold
Discrete-time
design
Approximation
of
K
(
s
)
with
K
d
(
z
)
Sampled-data
design
2013-5-28
13.8
Design by approximation
1.
Design a continuous-time controller,
K
(
s
)
I
Verify stability,performance and bandwidth
I
Verify margins and robustness
2.
Select a sample-rate,
T
3.
Find
K
d
(
z
)
approximating
K
(
s
)
4.
Calculate the
ZOH
-equivalent
G
ZOH
(
z
)
5.
Check the stability of the
G
ZOH
(
z
)
,
K
d
(
z
)
loop
6.
Simulate
K
d
(
z
)
with
G
(
s
)
(including sample/hold).
I
Verify simulated performance
I
Examine intersample behaviour
2013-5-28
13.9
Controller approximation
Approach:
Find a discrete-time approximation,
F
(
z
)
,to the input-output
relationship of the integrator.
1
/s
x
(
t
)
y
(
t
)

F
(
z
)
x
(
k
)
y
(
k
)
If
F
(
z
)

1
/s
,then,
s

F

1
(
z
)
,
Controller approximation:
K
d
(
z
) =
K
(
s
)
|
s
=
F

1
(
z
)
2013-5-28
13.10
Integration
1
/s
x
(
t
)
y
(
t
)
y
(
t
) =
y
( 0 ) +
Z
t
0
x
(

)
d

,
k T
k T + T
t
x ( t )
x ( k T + T )
x ( k T )
y ( k T + T )
- y ( k T )
T h e s i g n a l,
y
(
t
)
,o v e r a s i n g l e
T
s e c o n d s a m p l e p e r i o d i s,
y
(
kT
+
T
) =
y
(
kT
) +
Z
kT
+
T
kT
x
(

)
d

.
2013-5-28
13.11
Trapezoidal approximation
ˆ
y
(
kT
+
T
) = ˆ
y
(
kT
) +
Tx
(
kT
) +(
x
(
kT
+
T
)

x
(
kT
))
T/
2
.
Taking
z
-transforms,
z
ˆ
y
(
z
) = ˆ
y
(
z
) +
Tx
(
z
) +
T
2
(
z

1 )
x
(
z
)
,
A p p r o x i ma t i o n:
ˆ
y
(
z
)
x
(
z
)
=
F
(
z
) =
T
2
z
+1
z

1
.
Th e s u b s t i t u t i o n i s t h e r e f o r e,
s

2
T
z

1
z
+1
.
k T
k T + T
t
x ( t )
x ( k T + T )
x ( k T )
y
b l
( k T + T )
y
b l
( k T )
-
This is known as a bilinear (or Tustin) transform.
2013-5-28
13.12
Frequency mapping
Pole locations under bilinear transform:
{
s
|
real(
s
)
<
0
}
bilinear
!
{
z
| |
z
|
<
1
}
K
(
s
)
stable
()
K
d
(
z
)
stable.
real
imag

/T

/T
s
=
2
T
(
z

1)
(
z
+1)
!
real
imag

1
1
2013-5-28
13.13
Bilinear frequency distortion

:
discrete-frequencies:e
j

T
,

2
(

,

]
.
Frequency mapping:
Continuous frequencies,
!
to discrete frequencies,

.
Substitute
s
=
j
!
and
z
=
e
j

T
into
s
=
2
T
z

1
z
+1
:
j
!
=
2
T

1

e

j

T

(1 +
e

j

T
)
=
2
T
j
sin(

T/
2)
cos(

T/
2)
=
2
T
j
tan(

T/
2)
.
Frequency distortion:

=
2
T
tan

1
(
!
T/
2)
2013-5-28
13.14
Bilinear frequency distortion

=
2
T
tan

1
(
!
T/
2)
0
Cont i nuous f r equency (
!
Di scr et e f r equency (
"
"
=
!
T
#\$
\$
#\$
/
T
\$
/
T
#
2
\$
/
T
2
\$
/
T
#
3
\$
/
T
3
\$
/
T
Tust i n/bi l i near t r ansf or m
The

=
!
T
line is the sampling mapping.
2013-5-28
13.15
Prewarping
s
=

(
z

1)
(
z
+1)
,

2
(0
,

/T
)
,maps
{
r e a l
{
s
}
<
0
}
to
{|
z
|
<
1
}
.
Modifying the frequency distortion
Select a frequency
!
0
.
Solve for

such that
K
(
j
!
0
) =
K
d

e
j
!
0
T

.
T h e “ p r e w a r p e d ” t r a n s f o r m m a k e s
K
(
j
!
) =
K
d
(
e
j
!
T
)
at
!
= 0
and
!
=
!
0
.
j
!
0
=

(
e
j
!
0
T

1)
(
e
j
!
0
T
+1)
=
j

tan(
!
0
T/
2)
,
which implies that:

=
!
0
tan(
!
0
T/
2)
.
2013-5-28
13.16
Prewarping
Frequency distortion (bilinear:)

=
2
T
tan

1
(
!
T/
2)
.
Frequency di storti on (wi th prewarpi ng):

=
2
T
tan

1
(
!
/

)
- 150
- 100
- 50
50
100
150
- 50
0
50
Cont i nuous f r equency: [ r ad/sec]
Di scr et e f r equency: [ r ad/sec]
Bi l i near di st or t i on
Pr ewar pi ng di st or t i on
Pr ewar pi ng
f r equency
!
=
"
T
2013-5-28
13.17
Example
Compare bilinear and prewarped:
!
0
= 50
10
1
10
2
10
0
10
1
10
1
10
2
-100
-50
0
50
100
Phase (degrees)
Magnitude
Prewarping
frequency
Prewarping
frequency
C(j
!
)
C(j
!
)
Bilinear with prewarping
Bilinear with prewarping
Bilinear
Bilinear
C(
e
)
j
!
T
C(
e
)
j
!
T
C(
e
)
j
!
T
C(
e
)
j
!
T
2013-5-28
13.18
Choosing a prewarping frequency
The prewarping frequency must be in the range:
0
<
!
0
<

/T
.
I

= 2
/T
( s t a n d a r d b i l i n e a r ) c o r r e s p o n d s t o
!
0
= 0
.
P o s s i b l e o p t i o n s f o r
!
0
d e p e n d o n t h e p r o b l e m:
I
T h e c r o s s - o v e r f r e q u e n c y ( h e l p s p r e s e r v e t h e p h a s e m a r g i n );
I
T h e f r e q u e n c y o f a c r i t i c a l n o t c h;
I
T h e f r e q u e n c y o f a c r i t i c a l o s c i l l a t o r y m o d e.
T h e b e s t c h o i c e d e p e n d s o n t h e m o s t i m p o r t a n t f e a t u r e s i n y o u r
c o n t r o l d e s i g n.
Remember:
K
(
s
)
stable implies
K
d
(
z
)
stable.
But you
must
check that
(1 +
G
ZOH
(
z
)
K
d
(
z
))

1
is stable!
2013-5-28
13.19
Sample rate selection
Sample rate selection is critical to digital control design.
Main considerations
I
Sampling/ZOH will (approximately) introduce a delay of
T/
2
seconds.
I
Anti - al i asi ng ﬁl ters wi l l need to be desi gned and these wi l l al so
i ntroduce phase l ag.
I
The system runs “open- l oop” between sampl es.
I
Very f ast sampl i ng can i ntroduce addi ti onal noi se.
I
Very f ast sampl i ng makes al l of the pol es appear cl ose to 1.
The control l er desi gn can become numeri cal l y sensi ti ve.
2013-5-28
13.20
Designing for digital implementation
Sampled-data implementation
G
(
s
)
+
G
d
(
s
)
ZOH
F
a
(
s
)
+
K
d
(
z
)
T
r
(
k
)
u
(
k
)
u
(
t
)
d
(
t
)
y
(
t
)
n
(
t
)
y
m
(
t
)
˜
y
m
(
t
)
˜
y
m
(
k
)
Continuous-time design
G
(
s
)
+
G
d
(
s
)
e

sT/
2
F
a
(
s
)
+
K
(
s
)
r
(
t
)
u
(
t
)
d
(
t
)
y
(
t
)
n
(
t
)
y
m
(
t
)
˜
y
m
(
t
)
2013-5-28
13.21
Sensitivity function
We want a similar discrete sensitivity function up to the frequency
where
|
S
(
j
!
)
|
returns to 1.
Magnitude
S
(
j
!
)

+
0
.
01
0
.
1
1
5
log
!
1
10
!
B
S
(
s
) = (
I
+
F
a
(
s
)
G
(
s
)
e

sT/
2
K
(
s
))

1
2013-5-28
13.22
Sensitivity function
In this example,for
!
>
20
|
1

S
(
j
!
)
|

1 =
)

/T
= 2 0
i s a g o o d c h o i c e.
Magnitude
S
(
j
!
)

+
0
.
01
0
.
1
1
5
!
10
20
!
B
S
(
s
) = (
I
+
F
a
(
s
)
G
(
s
)
e

sT/
2
K
(
s
))

1
2013-5-28
13.23
Loop-shaping interpretation
For
!
where
0
.
1
<
|
F
a
(
j
!
)
G
(
j
!
)
K
(
j
!
)
|
<
10
,
we want
F
a
(
j
!
)
G
(
j
!
)
K
(
j
!
)

ˆ
G
ZOH

e
j
!
T

K
d

e
j
!
T

.
(
ˆ
G
ZOH
(
z
)
is the ZOH-equivalent of
F
a
(
s
)
G
(
s
)
)
real
imag

1
1
j

j
L
(
j
!
)
|
1 +
L
(
j
!
)
|
|
S
(
j
!
)
|
>
1
2013-5-28
13.24
Fast sampling
Fast sampliing period:
T
f
.
Control appropriate (slower) sampling period:
T
s
(typically
T
s
=
MT
f
f or i nteger
M >
1
).
F
af
(
s
)
T
f
F
as
(
z
)
T
s
y
(
t
)
˜
y
(
t
)
˜
y
s
(
k
)
Digital
downsampling
Digital
ﬁlter
Fast
sampler
Anti-aliasing
ﬁlter
2013-5-28
13.25