Digital Control System §4 Discrete Equivalence of Analog Controller
§4 Discrete Equivalence of Analog Controller
4.1 Introduction
4.2 Fundamental difficulty in the emulation method
4.3 Emulation by numerical integration method
4.4 Emulation by pole-zero mapping equivalence
4.5 Hold equivalence
4.6 PID control
References:
1. Franklin, Powell, Workman, “Digital Control of Dynamic
Systems”,3rd Ed., Adison-Wesley, 1998
2. R. Isermann, “Digital Control System”, Springer, 1989.
4-1
Digital Control System §4 Discrete Equivalence of Analog Controller
§4.1 Introduction
Consider a digital control system as shown below:
Two methods, including indirect method and direct method, are
introduced.
indirect method: a system consisting of analog sub-systems,
discussed in this chapter
direct method: a system consisting of full digital sub-systems,
discussed in next chapter
indirect method
In this case, our job is to design a digital controller D(z) such that
ADC+D(z)+DAC is a digital equivalence of a given analog
controller.
As a digital controller is designed in this method, it is called
indirect method or emulation technique.
direct method
In this case, our job is to design D(z) directly for the given G(z). When
4-2
Digital Control System §4 Discrete Equivalence of Analog Controller
a digital controller is designed in this method, it is called direct method,
introduced in Chap 5.
§4.2 Fundamental difficulty in the emulation method
Goal: Given r(t) and D(s), solve D(z) such that, if r*(t)=r(t) for all t=kT,
uˆ(t ) u(t ) for all t ∈[0, ∞) .
Problem:
when D(z) receives r*(t), all information of r(t) in the open time
interval kT< t <kT+T has been lost due to sampling, and it is
impossible to recover these lost information.
However, without these information, there is no way to know what
uˆ (t ) should be in the time interval kT< t <kT+T.
4-3
Digital Control System §4 Discrete Equivalence of Analog Controller
Therefore, the best we can do is to make an approximation
regarding the lost information in the open time interval
kT< t <kT+T. As a result, the task of emulation is a work of
approximation.
Ex. consider the system
U ( s) 1
D( s )
E ( s) s 1
It is equivalent to the differential equation
u u e
t
Thus, u(t ) [u( ) e( )]d
0
kT T kT
u(kT ) [u e]d [u e]d
0 kT T
u(kT T ) { area of [ u e] over kT T kT }
To solve the above equation, we need to know u(t) and e(t) in the
open time interval kT-T < t < kT. Since these information has been lost
due to ADC, the best we can do is to make approximations.
The following are two approximation examples:
(1) Backward difference:Assume u(t)=u(kT) and e(t)=e(kT) for the open
time interval kT−T< t < kT. Under this assumption, the above equation
can be reduced to
u(k ) u(k 1) T [e(k ) u (k )],
U ( z) T 1
D( z )
E ( z ) (1 T ) z 1 ( z 1) 1
Tz
4-4
Digital Control System §4 Discrete Equivalence of Analog Controller
(2) Trapezoidal (linear) interpolation:Assume that, in the open time
interval kT-T< t < kT
kT T
kT T
[e(t ) u(t )]dt
2
[e(k ) u(k ) e(k 1) u(k 1)]
T
u(k ) u(k 1) [e(k ) u(k ) e(k 1) u(k 1)]
2
1 (T / 2) T /2
u(k 1) [e(k ) e(k 1)]
1 (T / 2) 1 T / 2
That is,
U ( z)
D( z )
E( z)
T ( z 1) 1
(2 T ) z T 2 [2( z 1) / T ( z 1)] 1
From the above example it is clear that different assumption leads to
different D(z), and both are in their approximation of D(s).
The following emulation methods to be discussed in this chapter are
different in their assumption and/or interpolation on the value of e(t)
and u(t) in the open time interval kT-T < t < kT from the readings at t =
kT.
(a) Numerical integration method
(a-1) forward rectangular integration
(a-2) backward rectangular integration
(a-3) trapezoidal (Tustin’s) rule
(a-4) bilinear transformation with prewarping
(b) Pole-zero mapping equivalence
(c) Hold equivalence
4-5
Digital Control System §4 Discrete Equivalence of Analog Controller
§ 4.3 Emulation by numerical integration method
Let us explore this approach using an example where
U ( s) b
D( s ) (4.1)
E ( s) s a
u(t ) a u(t ) b e(t ) (4.2)
u(t ) b e(t ) a u(t )
Integrate both side of the equation
Let t=kT-T, it reduces to
Therefore,
over kT-T < t < kT (4.3)
kT
To evaluate the area kT T [be( ) au( )]d , we need the values e(τ)
and u(τ) over the time interval kT-T < t < kT .
Three approximations methods are introduced below:
(1) forward rectangular integration;
(2) backward rectangular integration;
(3) trapezoidal (Tustin’s) rule
4-6
Digital Control System §4 Discrete Equivalence of Analog Controller
(1) Forward rectangular integration:
Assume b e( ) a u( ) b e( k T T
) a(u k T ) T
kT
kT T [be( ) au( )]d T [bek 1 auk 1] for kT-T < t < kT ,
then Eq. (4.3) reduces to
4-7
Digital Control System §4 Discrete Equivalence of Analog Controller
z 1
Forward difference rule s , also called Euler operator or
T
δ-operator.
(2) Backward rectangular integration:
Assume be( ) au( ) be(kT ) au(kT )
kT
kT T [be( ) au( )]d T [bek auk ] for kT-T < t < kT ,
then Eq. (4.3) reduces to
z 1
Backward difference rule: s
Tz
(3) Trapezoidal (Tustin’s) rule:Assume
kT T
kT T [be( ) au( )]d 2 [(bek auk ) (bek 1 auk 1)]
for kT-T < t < kT, then Eq. (4.3) reduces to
4-8
Digital Control System §4 Discrete Equivalence of Analog Controller
bT ( z 1) b
D3 ( z ) (4.6b)
(2 aT ) z aT 2 ( 2 z 1) a
T z 1
2 z 1
Tustin’s rule: s
T z 1
Remarks:
※ Tustin’s method is also known as bilinear transformation.
※ The above transformations are applicable to any dynamic
a
controller D(s), and is not limited to D( s )
sa
Ex. G( s) Y ( s) b0
U ( s) s 2 a1s a0
State-space form
x1 y x1 x2
x2 y ' x2 b0u a1 y ' a0 y b0u a1 x2 a0 x1
z 1
(1) Forward rule: Let s
T
z 1
x1 sx1 ( ) x1 x2
T
zx1 x1 Tx2
4-9
Digital Control System §4 Discrete Equivalence of Analog Controller
z 1
同理 sx2 b0u a1x2 a0 x1 , ( ) x2 b0u a1 x2 a0 x1
T
zx2 x2 (b0u a1 x2 a0 x1 )T
x (k 1) x (k ) Tx (k )
1 1 2
x2 (k 1) x2 (k ) [b0u(k ) a1 x2 (k ) a0 x1 (k )]T
z 1
(2) Backward rule: Let s
Tz
z 1
( Tz ) x1 x2
( z 1) x2 b0u a1 x2 a0 x1
Tz
x1 z 1x1 Tx2
x1 (k ) x1 (k 1) Tx2 (k )
x2 (k ) x2 (k 1) T [b0u(k ) a1 x2 (k ) a0 x1 (k )]
(3) Tustin’s rule
2 z 1
(T ) x1 x2
z 1
( 2 z 1
) x2 b0u a1 x2 a0 x1
T z 1
1 T
x1 z x1 ( x2 z 1 x2 )
2
x2 z 1 x2 T (b0u a1 x2 a0 x1 ) T z 1 (b0u a1 x2 a0 x1 )
2 2
T
1x ( k ) x1 ( k 1) [( x2 ( k ) x2 (k 1)]
2
T
x2 ( k ) x2 ( k 1) [b0u(k ) a1 x2 (k ) a0 x1 (k )]
2
T
[(b0u(k 1) a1 x2 (k 1) a0 x1 (k 1))]
2
4-10
Digital Control System §4 Discrete Equivalence of Analog Controller
Remarks: In this example, state-space equations are used because it is
easier to expand the 1st order equations than higher order. However,
direct expansion of high order equation is also realizable if necessary.
Comparison of numerical integration methods
The following shows how the numerical approximation methods map the
LHP poles of s-plane onto the z-plane:
(a) Forward difference method maps the stable region on s-plane into the
whole z-plane, hence a stable D(s) may become an unstable D(z).
Therefore, this approach is not reliable.
(b) Backward difference method maps the stable region on the s-plane
into a small circle inside of the unit circle with relatively small ωN .
Hence it is unable to find an adequate D(z) for either a lightly damped
4-11
Digital Control System §4 Discrete Equivalence of Analog Controller
D(s) or a fast respond D(s). Therefore, this approach is not adequate.
(c) Tustin’s method maps the stable region on the s-plane into the whole
unit circle, hence it is the best among all numerical integration
methods.
Half power point
However, the Tustin’s method suffers from distortion in the frequency
domain which can be improved by prewarping. To see the details, first we
need the concept of half power point.
The frequency spectrum of D(s) a /( s a) , is
a2
|D(jw)| 2
2
(4.12)
w a2
the half power point of D(s) is the frequency ŵ a where |D(jwˆ )|2 1/ 2 .
Since the frequency spectrum of Tustin’s equivalence D3 (z )|ze jwT is
~ of D (jw) is
|D3 (jw)|2 1/ 2 at the half power point w 3
2 aT
If aT / 2 1, tan-1 (aT / 2) aT / 2 , then w a , and for all w w ,
T 2
D3 (jw) becomes
4-12
Digital Control System §4 Discrete Equivalence of Analog Controller
~.
That is, there is no distortion in the frequency range w w
Therefore, if the sampling frequency ws 2 / T a w , then the
warping effect can practically be ignored.
If, however, the sampling frequency is not sufficiently high, we need to
introduce prewarping into the bilinear transform.
Tustin’s method with prewarping
In general, D3 (jw) D(jw) . If we want to achieve D3 (jwp ) D(jwp ) at a
selected frequency point w p (i.e. wC , the crossover frequency of the
control loop transfer function) without increasing the sampling frequency
wS , we can use a prewarped Tustin’s equivalence Dpw (z ) .
Let the prewarped Tustin’s transformation from s-plane to
z-plane be
2 z 1 , let z e jwT 2 e jwT 1 2 wT
S S j tan
T z 1 T e 1 T
jwT
2
at the half power point
wT wT , 2 w
tan
2 2 T tan wT
2
Thus, w z 1
S
wT z 1
tan
2
4-13
Digital Control System §4 Discrete Equivalence of Analog Controller
Then the prewarped Tustin’s equivalence Dpw (z ) is
At the prewarping frequency w wp , we have
no matter how small the sampling frequency is.
Example 4.1:
All equivalence transforms are compared in this example using
1
D(s ) . The prewarping frequency is chosen to be wp w f ,
s 2s 2s 1
3 2
where w f is the bandwidth of D(s), and three sampling frequencies
used are:
(i) ws 20 wp , (ii) ws 2 wp , (iii) ws wp .
(i) Case I: ws / w f 20
Tustin’s method with and without prewarping match D(s) precisely, while
forward and backward difference methods do not yield satisfactory results
at such a high ωs .
4-14
Digital Control System §4 Discrete Equivalence of Analog Controller
ws / w f 20
ws / w f 20
(ii) Case II: ws 2 wp
ws / w f 2
The sampling frequency is still quite high (6 times bandwidth), Tustin’s
method with and without prewarping match D(s) to an acceptable degree,
while forward and backward difference methods yield quite unsatisfactory
results at such a high ωs .
4-15
Digital Control System §4 Discrete Equivalence of Analog Controller
(iii) Case III: ws wp
ws wp
Tustin’s method with prewarping still gives acceptable result up to the
bandwidth, while Tustin’s method without prewarping and finite difference
methods all give terrible results.
Remarks:
All the previous four transformation yields D(z) of the same order, while
Tustin’s method with prewarping gives the best results in all cases.
4-16
Digital Control System §4 Discrete Equivalence of Analog Controller
4.4:Zero-Pole Mapping Equivalence
1
This approximation approach uses the transformation s ln z to map
T
poles and zeros of D(s)=n(s)/d(s) onto poles and zeros of D(z)=q(z)/p(z)
such as to obtain the discrete equivalence.
It consists of three steps:
1
(1) Mapping all poles in D(s) to poles in D(z) by using s ln z (or z=esT).
T
n n
That is, if D( s) ( s 1) , it will be transformed into p(z) ( z 1) ,
i pi i pˆ i
where pˆ i e piT .
(2) Mapping all finite zeros in D(s) to zeros in D(z) using z=esT. That is if
m m
s
n (s ) ( 1) , it will be transformed into q( z ) ( z 1) , where
i zi zˆ
i i
zˆi e ziT .
(3) If D(s) has NP poles and NZ finite zeros, then r (r =NP - NZ -1) infinite
zeros of D(s) are mapped into r zeros at z =-1=e-j∞T=e-jπ
(4) Balance DC gain such that D(s)|s=0= D(z)|z=1.
The resultant D(z) has the following general form
where
Real poles/zeros in D(s) are mapped into real poles/zeros in D(z).
4-17
Digital Control System §4 Discrete Equivalence of Analog Controller
Complex poles/zeros in D(s) are mapped into complex
poles/zeros in D(z) with the same ζ and ωN.
The DC gain in D(s) and D(z) are identical.
D(z) is strictly proper because we choose r=NP - NZ - 1.
a
Example 4.2:Let D( s ) , then pole-zero mapping gives
sa
c( z 1)0 c
(1-3):pole-zero mapping D( z )
z e aT z e aT
c a
(4):dc gain D( z ) z 1 D( s) s 0
1 e aT a
aT
Hence c 1 e
1 e aT
and D( z )
z e aT
This result of pole-zero mapping is compared with results from
hold equivalence methods using ws / wp 2 and ws / wp ,
where ωp is the bandwidth of D(s).
(i) Case I: ws / wp 2
Hold equivalence (will be discussed in the next section) seems to
give better results than pole-zero mapping, and FOH gives the
best phase plot.
For ω/ωp ≤ 1 , prewarped bilinear transform gives results better
than FOH equivalence, but not for ω/ωp > 1 .
4-18
Digital Control System §4 Discrete Equivalence of Analog Controller
(ii) Case II: ws / wp
When ws / wp , all discrete equivalence (including
prewarped bilinear transform and FOH equivalence) give
unacceptable results.
4-19
Digital Control System §4 Discrete Equivalence of Analog Controller
Notice that, they all results in positive gain slope for ω/ωp > 2 ,
which will cause noise saturation to the control system.
In conclusion, to obtain satisfactory digital controller by emulation
method, it is necessary that the sampling rate has to satisfy ωs/ωc
> 2π, where ωc is the crossover frequency.
4.5:Hold equivalence
Goal: Given an analog controller H(s) and e(kT)= e(t), ∀t = kT, assume
samplers are ideal and the Nyquist sampling theorem is satisfied, the
approximation method is to find Hho(z) such that
If the hold element is an ideal lowpass filter, it can be shown that the
resultant Hho(z) will satisfy:
(1) eˆ(t ) e(t ) t [0, ) since the hold is an ideal lowpass
(2) uˆ (t ) u(t ) t [0, ) since eˆ(t ) e(t ) t [0, )
(3) uˆ (kT ) u(t ) t kT since uˆ (t ) u(t ) t [0, )
4-20
Digital Control System §4 Discrete Equivalence of Analog Controller
Therefore the resultant Hho(z) serves our complete need, except that , if
the hold is an ideal lowpass filter, the resultant Hho(z) will be non-causal.
Therefore, in reality, we can use only causal filter in figure (B) to deduce
Hho(z).
ZOH and FOH equivalence
If we assume that the hold element in figure (B) is a ZOH, we
can apply the procedure to convert G(s) into G(z)) to obtain Hho(z) as
H ( s)
H ho ( z ) (1 z 1 )Z{L-1[ ]}
s
The difference between ZOH and an ideal lowpass will lead to
difference between u(t) and uˆ (t ) , and consequently between u(t)
and uˆ (kT ) .
To minimize the difference between u(t) and uˆ (kT ) , it is best to
use a high order Butterworth filter for the hold. This is a thought in
filtering problem, but not suitable for feedback control.
The most popular hold equivalence in digital controller design is
ZOH and FOH.
Example 4.3: ZOH equivalence of D(s)
a
Let D( s ) and assume that ZOH is adopted for the hold element,
sa
then we have
4-21
Digital Control System §4 Discrete Equivalence of Analog Controller
a
D( z ) (1 z 1 )Z{L1[ ]}
s( s a)
1 1
(1 z 1 )Z{L1[ ]}
s sa
(1 z 1 )Z{us (kT ) e akT us (kT )]}
1 1
(1 z 1 ){ }
1 z 1 1 e aT z 1
1 e aT
z e aT
Sampling frequency fs =3Hz
Sampling frequency fs =15Hz
4-22
Digital Control System §4 Discrete Equivalence of Analog Controller
The above two figures compare all discrete equivalence methods for
D(s)=a/(s+a) with bandwidth 1 Hz. Two cases are shown: fs =3Hz and
fs =15Hz.
All methods fail for the case fs =3Hz when ω>2Hz, while prewarped
bilinear transform (line e) gives barely acceptable approximation.
In case fs=15Hz, all methods give satisfactory results except forward
and backward difference methods.
In the following, discrete equivalence of a bandpass filter is shown with
two cases: fs =3Hz and fs =15Hz.
s
D( s )
s 2 s 25
all methods fail for the case fs =3Hz, while prewarped bilinear transform
(line e) gives barely acceptable approximation.
In case fs =15Hz, all methods give satisfactory results except forward and
backward difference methods.
4-23
Digital Control System §4 Discrete Equivalence of Analog Controller
Sampling frequency fs =3Hz
Sampling frequency fs =15Hz
4-24
Digital Control System §4 Discrete Equivalence of Analog Controller
4.6 PID control
Just as in continuous system,there are three basis types of
control:proportional,integral and derivative,so call PID。The
PID is widely used because there are commercially available
modules that have knobs for user to turn the values of each of
the three control types。
4.6.1 Proportional Control
A discrete implementation of proportional control is identical to
continuous:
*continuous:
u(t ) k p e(t ) D( s ) k p
*discrete:
u(k ) k p e(k ) D( z ) k p
where e(t ), e(k ) are error signals.
4.6.2 Derivative Control
For continuous system:
u(t ) k p TD e(t ) u ( s ) D ( s ) e( s )
D( s ) k p TD S
TD : derivative time
4-25
Digital Control System §4 Discrete Equivalence of Analog Controller
For discrete system:
e(k ) e(k 1)
u ( k ) k p TD ( ) u ( z ) D ( z ) e( z )
T
1 z 1 z 1
D ( z ) k p TD k p TD
T Tz
4.6.3 Integral Control
For continuous system:
t
kp
u(t )
TI e(t )dt u( s) D( s)e( s)
t0
kp
D( s )
TI S
For discrete system:
k pT
u(k ) u(k 1) e( k ) u ( z ) D ( z ) e( z )
TI
k pT k p Tz
D( z )
TI (1 z 1 ) TI ( z 1)
reduce or eliminate steady-state error, but also reduce
stability.
4.6.4 PD-control
u(t ) k p e(t ) k pTD e(t )
e(k ) e(k 1)
u(t ) k p e(k ) k pTD [ ]
T
4-26
Digital Control System §4 Discrete Equivalence of Analog Controller
4.6.5 PI-control
t
kp kp
u ( t ) k p e( t )
TI e(t )dt (k p TI S
) e( s )
t0
k pTz
u(k ) ( k p ) e( k )
TI ( z 1)
4.6.6 PID control
t
kp
u(t ) k p e(t ) k pTD e(t )
TI e(t )dt
t0
kp
D( s ) ( k p k pTD S )
TI S
TD ( z 1) Tz
u(k ) k p (1 ) e( k )
Tz TI ( z 1)
4-27
Digital Control System §4 Discrete Equivalence of Analog Controller
4.6.7 Ziegler-Nichols PID Tunning
4-28
Digital Control System §4 Discrete Equivalence of Analog Controller
4-29