Você está na página 1de 43

1

Analog and Digital


Control 1
Lecture 3

Kirsten Mlgaard Nielsen

Based on lecture notes by Jesper Sandberg Thomsen

2
Outline
Discrete equivalents
Overview (emulation finding a discrete equivalent to
the continuous system)
Numerical integration
Zero-Pole matching (mapping)
Hold equivalents
Design by emulation
Evaluation of design
Nyquist stability criterion
Continuous case
Discrete case
3
Discrete Equivalents - Overview
controller
D(s)
plant
G(s)
r(t) u(t) y(t) e(t)
+
-
Translation to discrete controller (emulation)
Numerical Integration
Forward rectangular rule
Backward rectangular rule
Trapeziod rule (Tustins method, bilinear transformation)
Bilinear with prewarping
Zero-Pole Matching
Hold Equivalents
Zero order hold (ZOH)
Triangle hold (FOH)
Translation to
discrete plant
Zero order hold (ZOH)
Emulation
Purpose: Find a discrete transfer function which
approximately has the same characteristics over
the frequency range of interest.
Digital implementation: Control part constant between samples. Plant is not constant between samples.
4
Numerical Integration
Fundamental concept
Represent H(s) as a differential equation.
Derive an approximate difference equation.
We will use the following example
Notice, by partial expansion of a transfer function this
example covers all real poles.
ae au u
a s
a
s H
s E
s U
= +
+
= =

) (
) (
) (
Example
Transfer function Differential equation
5
Numerical Integration
( )
( ) ( )
( ) | | { } kT T kT ae au T kT u
d ae au d ae au kT u
continous d ae au t u
ae au u
a s
a
s H
s E
s U
T kT kT
T kT
t
, over of area ) (
) (
) ( ) ( ) ( ) (
Equation al Differenti
) (
) (
) (
Function Transfer
0
0
+ + =
+ + + =
+ =
= +
+
= =
} }
}

t t
t t t

6
Numerical Integration
Now, three simple ways to
approximate the area.
Forward rectangle
approx. by looking forward
from kT-T
Backward rectangle
approx. by looking backward
from kT
Trapezoid
approx. by average
kT-T kT
kT-T kT
kT-T kT
7
Numerical Integration
Forward rectangular rule (Eulers rule)
(Approximation kT-T)
| |
a
T
z
a
aT z
aT
z aT
aTz
z E
z U
z H
z E aTz z U z aT z U
T kT aTe T kT u aT
T kT ae T kT au T T kT u kT u
F
+

=
+
=

= =
+ =
+ =
+ + =


1
1 ) 1 ( 1 ) (
) (
) (
) ( ) ( ) 1 ( ) (
unction Transfer F
) ( ) ( ) 1 (
) ( ) ( ) ( ) (
Equation Difference
1
1
1
1
1
1
1
1
1 1 1
8
Numerical Integration
Backward rectangular rule (app kT)
| |
a
Tz
z
a
z aT
aTz
aT
aT
z aT
z E
z U
z H
z E
aT
aT
z U
z aT
z U
kT e
aT
aT
T kT u
aT
kT u
kT aTe T kT u kT aTu kT u
kT ae kT au T T kT u kT u
B
+

=
+
=
+
+

= =
+
+
+
=
+
+
+
=
+ = +
+ + =
1
1 ) 1 ( ) 1 (
) 1 (
1
1
1
) (
) (
) (
) (
1
) (
) 1 (
1
) (
unction Transfer F
) (
1
) (
1
1
) (
) ( ) ( ) ( ) (
) ( ) ( ) ( ) (
Equation Difference
2
2 2
2 2
2 2 2
2 2 2
9
Numerical Integration
Trapezoid rule (Tustins Method, bilinear trans.)
(app (old value + new value))
| |
| |
a
z
z
T
a
aT z aT
z aT
z E
z U
z H
kT e T kT e
aT
aT
T kT u
aT
aT
kT ae kT au T kT ae T kT au
T
T kT u kT u
T
+
+

=
+ +
+
= =
+
+
+
+

=
+ + + =
) 1 (
) 1 ( 2
2 ) 2 (
) 1 (
) (
) (
) (
unction Transfer F
) ( ) (
) 2 / ( 1
2 /
) (
) 2 / ( 1
) 2 / ( 1
) ( ) ( ) ( ) (
2
) ( ) (
Equation Difference
3
3
3 3 3 3
10
Numerical Integration
Comparison with H(s)
a
z
z
T
a
z H
a s
a
a
Tz
z
a
z H
a s
a
a
T
z
a
z H
a s
a
s H
T
B
F
+
+

=
+
+

=
+
+

=
+
) 1 (
) 1 ( 2
) ( rule Trapezoid
1
) ( rule Backward
1
) ( rule Forward
function Transfer Method ) (
11
Numerical Integration
Transform s z
s T
s T
z
z
z
T
s
Ts
z
Tz
z
s
Ts z
T
z
s
) 2 / ( 1
) 2 / ( 1
or
) 1 (
) 1 ( 2
rule Trapezoid
1
1
or
1
rule Backward
1 or
1
rule Forward
ion Approximat Method

+
=
+

=

=

=
+ =

=
Comparison with respect to stability
In the s-plane, s = je is the boundary between stability
and instability.
12
Numerical Integration - stability
e
e
e
j s
s T
s T
z
j s
Ts
z
j s Ts z
=

+
=
=

=
= + =
for
) 2 / ( 1
) 2 / ( 1
Trapezoid
for
1
1
Backward
for 1 Forward
(Forward)
Region of
s-LHP
(Backward)
Region of
s-LHP
(Trapezoid)
Region of
s-LHP
13
Numerical Integration
Some conclusions
Higher distortion with the forward and backward rule.
The forward rectangular rule could cause a stable
continuous filter to be mapped into an unstable digital
filter.
The trapezoid rule maps the stable region in the s-
plane exactly into the stable region of the z-plane.
Though, the je-axis is compressed into the unit circle
with length 2t.
The trapezoid rule appears superior. But, let us make
some further investigations..... let us calculate the
power |H(je)|
2
at, for example, e = a the change in
frequency response.
14
Numerical Integration
2
1
) (
) (
1 ) / (
1
) (
) (
2
2 2 2 2
2
2
=
=
+
=
+
=

+
=
ja H
a
a a
a
j H
a j
a
j H
e
e e
e
e
e
What about H
T
(z) ?
at which frequency is |H
T
(z)|
2
= 0.5 ?
15
Numerical Integration
1 2 / , )
2
(
2
Notice,
)
2
arctan(
2
or ) 2 / tan(
2
2
1
1 ) 2 / tan(
2 1
1
) (
en Power wh . with
1 ) 2 / tan(
2 1
1
) 2 / tan(
2
) (
1
1 1
2
2
1
2
2
1
1
1
<< = ~
= =

=
+
|
.
|

\
|
=
= =
+
=
+
=
aT a
aT
T
aT
T
T
T
a
T
T a
z H
e z e z
T j
T a
a T j
T
a
z H
T
T j T j
T
e
e e
e
e e
e e
H
T
(z) as
before but re-
formulated
(page 194)
I.e. high
sampling
frequency
16
Numerical Integration
Trapezoid with pre-warping
maintain the power at some specified frequency
1. Choose a critical frequency e
1
2. Replace e
1
by a such that new a = a,
3. and insert in H(s). a = (2/T) tan(e
1
T/2)
4. Find the discrete filter H(z) based on the modified
continuous transfer function H(s).

1
1
) 2 / tan(
1
) ( ) (
1
1
1
+

-
=
=
z
z
T
s
s
H z H
e
e
e
) 1 ( ) ( 1 j H z H = =e e
17
Numerical Integration
1 /
at Prewarping
2
1
1 . 0
with
1 2 2
1
) (
filter order 3th Example,
2 3
=

=
+ + +
=
b
T
s s s
s H
e e
Plots for T = 0.1
e
s
60 e
b
18
Numerical Integration
Plots for T = 1
e
s
6 wb
Notice,
prewarp
19
Numerical Integration
Plots for T = 2
e
s
3 e
b
Notice,
prewarp
20
Zero-Pole Matching
Exact map between poles (z = e
sT
) exists.
Basic idea, simply use same map for zeros.
Rules
1. All poles are mapped by z = e
sT
.
For example, s = -a maps to z = e
-aT

2. All finite zeros are mapped by z = e
sT
.
For example, s = -b maps to z = e
-bT

3. Basically, zeros at je = infinity maps to z = e
jt
= -1
(representing the highest frequency)
4. Identical gain at some critical freq. (typically, s=0)
H(s) at s=0 = H(z) at z=1
21
Zero-Pole Matching
o
o

+
=

= =
+
=

+
= =
= = =
+
=

=
=

z
z
K z H
e
K
a s
a
e z
z
K
z s H
e z a s
a s
a
H(s)
aT
s
z
aT
s
aT
1
) (
2
1
1
1
4) (rule Gain
1 0 ) ( 3) (rule Zero
1) (rule Pole
0
1
Example (1)
Compute the discrete equivalent by zero-pole matching
22
Zero-Pole Matching
s-plane z-plane
o
+
=
+
=
z
z
K z H
a s
a
H(s)
1
) (
match - zp
23
Zero-Pole Matching
) 1 ( ) ( ) 1 ( ) (
1
1 1
) (
) (
) (
1
1
+ + =

+
=

+
= =

k Ke k Ke k u k u
z
z
K
z
z
K z H
z E
z U
o
o
o
Including delay in computer
Notice, u(k) depends on e(k). This comes from rule 3
Solution, first zero for s=infinity is mapped to z=infinity
(as in Matlab). This gives
) 1 ( ) 1 ( ) (
1
1
) (
) (
1
1
+ =

=

k Ke k u k u
z
z
K
z
K
z E
z U
o
o
o
24
Hold Equivalents
Purpose, design a discrete filter H(z), such that
input e(k) is samples of e(t)
H(z) has an output u(k)
u(k) approximates the output of the continuous filter
H(s) whose input is the continuous signal e(t).
Zero order hold (ZOH) (step invariant), approach below
Hold Sampler H(s)
e(t) e(k) u(k)
Sampler
e
h
(t) u(t)
25
Hold Equivalents
Hold operation
( )
gain a is ) (
) ( ) ( ) (
1
1
) (
) ( 1 ) ( 1 ) (
k e
k e s Q s E
e
s
s Q
T t t t q
h
Ts
=
=
=

Q(s)
Hold Sampler H(s)
e(t) e(k) u(k)
Sampler
e
h
(t) u(t)
26
Hold Equivalents
ZOH transformation
Notice, we can find H(z) by
Take inverse Laplace to find a continuous signal.
Sample this continuous signal to find a discrete signal.
k
k e t t e o o = = ) ( ) ( ) (
{ } ( ) ) ( 1
1
) ( ) ( ) ( ) ( ) (
) ( ) ( ) ( ) ( ) ( ) ( ) (
1 1
k e
s
s H L k s Q s H L t u
k s Q s H k e s Q s H s U
Ts
o o
o
)
`

= =
= =

Hold Sampler H(s)
e(t) e(k) u(k)
Sampler
e
h
(t) u(t)
27
Hold Equivalents
( ) ( ) ) (
) (
) ( 1 ) ( 1 ) ( 1
1
) ( ) (
1 1
k
s
s H
L T t t k e
s
s H L t u
Ts
o o
)
`

=
)
`

=

| |
{ }
)
`

)
`

)
`

)
`

= = =
=

=
s
s H
L Z
s
s H
Z
s
s H
Z z z H z U k u Z
t u k u
t kT
) ( ) (
where
) (
) 1 ( ) ( ) ( ) (
) ( ) (
1
1
Continuous output signal
Discrete output signal and transfer function H(z)
28
Hold Equivalents
Triangle hold equivalent
Extrapolate the samples to connect
sample to sample in a straight line.
Impulse response for triangle hold
T
Hold System
2
2
Ts
e e
Ts Ts
+
) (s H
) (k e ) (t u
)
`

=
2
) ( ) 1 (
) (
Result
s
s H
Z
Tz
z
z H
T
0 . 1
29
Hold Equivalents
Same third
order filter
as before

+ Zero-pole
o ZOH
x Triangle

T = 1
(next T=2)
30
Hold Equivalents
Same filter
as before

+ Zero-pole
o ZOH
x Triangle

T = 2
31
Hold Equivalents
Concluding remarks
Methods, we have looked at
Numerical integration methods
Zero-pole matching (mapping)
Hold equivalents
All methods works fine for high sample frequency
Matlab
32
Evaluation of Design
Discrete controller by emulation
Can be calculated using one of several techniques.
Evaluation discrete equivalent (design)
We need to analyze in the z-domain.
Process expressed in z-domain (ZOH)
Notice, other eval. might be necessary (simulation)
33
Evaluation of Design
Example, using Matlab
sysD_c = tf([10 1],[1 1]);
T = 0.2; % around 30*wn. Also use, T = 1
sysD_d = c2d(sysD_c,T,matched); % zero-pole matched
sysG_c = tf([1],[10 1 0]);
sysG_d = c2d(sysG_c,T,zoh); % zero order hold
sysCL_c = feedback(sysD_c*sysG_c,1);
sysCL_d = feedback(sysD_d*sysG_d,1);
step(sysCL_c); hold on;
step(sysCL_d);
) 1 10 (
1
) (
(antenna) sys. Cont.
+
=
s s
s G
1
) 1 10 (
) (
controller Cont.
+
+
=
s
s
s D
34
Evaluation of Design
T = 0.2
(e
s
30 e
n
)
35
Evaluation of Design
T = 1
(e
s
6 e
n
)
The sample
delay gives
phase lag.
Thus, less PM
which gives
higher
overshoot
36
Nyquist Stability Criterion
Check closed loop stability
with controller KD(s) and plant G(s)
) (
) (
) ( ) ( ,
) ( ) ( 1
) ( ) (
) (
) (
s a
s b
s G s D
s G s D K
s G s D K
s R
s Y
=
+
=
Characteristic equation (CE)
0
) (
) ( ) (
0 ) ( ) ( 1 =
+
= +
s a
s Kb s a
s G s D K
Notice, number of poles in CE equals number of open-
loop poles in D(s)G(S). (known)
Notice, zeros in CE are closed-loop poles! (unknown)
37
Nyquist Stability Criterion
Approach, check characteristic equation
Let us follow a contour encircling the RHP.
Basic idea: Evaluate CE = 1+KD(s)G(s) at the
contour, and draw image. (We can just as well
evaluate KD(s)G(s) and look at -1 )
) ( ) ( s G s D K
Notice, poles or
zeros gives
encirclements
38
Nyquist Stability Criterion
Criterion (continuous case)

Z = P + N

Z = number of unstable closed-loop poles. Thus, for
stability we want Z=0. (unknown)
P = number of unstable open-loop poles of KDG
(known).
N = total number of encirclements of the point -1 by
evaluation of KDG (taken in same direction as s.
Thus, N might be negative).
39
Nyquist Stability Criterion
Interpretations and explanations
If the s-plane contour encircles a zero of 1+KDG in a
certain direction, the image contour will encircle the
origin in the same direction. (related to Z)
If the s-plane contour encircles a pole of 1+KDG in a
certain direction, the image contour will encircle the
origin in the opposite direction. (related to P)
The net number of same-direction encirclements, N,
equals the difference N = Z- P.
Actually, we should investigate 1+KDG and
encirclements around the origin, but easier to
investigate KDG and encirclements around -1.
40
Nyquist Stability Criterion
Discrete case
Same approach,
almost...
Unstable region is
outside the unit
circle.
Easier to evaluate
using the stable
region.
41
Nyquist Stability Criterion
Discrete case
CE: 0 = 1+KD(z)G(z)
Total number of poles = n
Number of stable zeros of 1+KD(z)G(z) is n-Z
Number of stable poles of 1+KD(z)G(z) is n-P

Criterion (discrete case)
Z = (n-Z) (n-P) or Z = P N
42
Nyquist Stability Criterion
Discrete case
Determin the number P of unstable poles of KDG
Plot KD(z)G(z) for the unit circle. This is the counter-
clockwise path around the unit circle.
Set N equal to the number of Counter-clockwise
encirclements of the point -1 on the plot
Compute Z=P-N.
The system is stable if and only if Z=0


43
Nyquist Stability Criterion
Example (7.9)
Evaluate the stability of the
unity feedback discrete system
with the plant G(s) with
sampling time T=2 and ZOH.
Use controller KD(z) = K.
) 1 (
1
) (
+
=
s s
s G
Solution (matlab)
sysC = tf([1],[1 1 0]);
sysD = c2d(sysC,2);
nyquist(sysD);
K=1
The system is openloop stable and there are no encirkelments of -1
=> the system is closed loop stable for K=1

Você também pode gostar