Professional Documents
Culture Documents
Controllers
l The digital controller and its design
l Discrete PID controllers from the
continuous domain
l Discrete controllers based on discrete
domain strategies
l Digital multivariable controllers
u( z ) = gc ( z )e ( z )
Y( z -1 ) = 1 +y 1 z -1 +y 2 z -2 + ... +y q z - q = 0
( )
Q z -1 = θ0 + θ1 z -1 + θ2 z -2 + ... + θr z - r = 0
l Example 26.1 a)
The digital controller pulse transfer function :
3 + 2 z -1 + 3z -2
gc ( z ) =
1 + 4 z -1
the highest power of numerator : 0
the highest power of denumerator : 0
u (k ) = -4u (k - 1) + 3e (k ) + 2e (k - 1) + 3e (k - 2)
l Example 26.1 b)
The digital controller pulse transfer function :
z + 3 + 2 z -1 + 3z -2
GC ( z ) =
1 + 4 z -1
the highest power of numerator : 1
the highest power of denumerator : 0
u (k ) = -4u (k - 1) + e (k + 1) + 3e (k ) + 2e (k - 1) + 3e (k - 2)
unrealizable
l Example 26.1 c)
The digital controller pulse transfer function :
2 z -1 + 3z -2
GC ( z ) =
1 + 4 z -1
the highest power of numerator : -1
the highest power of denumerator : 0
u (k ) = -4u (k - 1) + 2e (k - 1) + 3e (k - 2)
l Example 26.1 d)
The digital controller pulse transfer function :
z 2 + z + 3 + 2 z -1 + 3z -2
GC ( z ) =
z 2 + 1 + 4 z -1
the highest power of numerator : 2
the highest power of denumerator : 2
A Time domain realization :
u (k + 2) + u (k ) = -4u (k - 1) + e (k + 2) + e (k + 1) + 3e (k ) + 2e (k - 1) + 3e (k - 2)
l Indirect
• Carry out the familiar continuous domain
design and then discretize the resulting
continuous controller
l Direct
• Carry out the design directly in discrete time
and obtain the discrete controller directly
l Direct Design
• Primary focus is the discrete controller
+ all the effects of sampling and discretization are
already directly incorporated into the design
+ resulting controllers are only limited in form by
realizability conditions
- fundamentally continuous nature of the process is
not easily taken into account
l In s-domain
u( s ) = g c ( s )e ( s )
æ 1 ö
= KC çç1 + + t D s ÷÷ × e ( s )
è tIs ø
de e (k ) - e (k - 1)
Derivative : »
dt Dt
l In time-domain
æ Dt k tD ö
u (k ) = K c ç e (k ) + å e (i) +
ç ( )
e (k ) - e (k - 1) ÷÷
è t I i =1 Dt ø
l In z-domain
æ Dt æ 1 ö t D -1 ö
u( z ) = Kc çç1 + ç -1 ÷
+ (1 - z )÷÷e ( z )
è t I è 1 - z ø Dt ø
l In time-domain
æ æ Dt t D ö æ 2t D ö tD ö
ç
Du (k ) = K c ç ç1 + + ÷e (k ) - ç
ç ÷ + 1÷e (k - 1) + e (k - 2) ÷÷
è è t I Dt ø è Dt ø Dt ø
l In z-domain
æ æ Dt t D ö æ 2t D ö -1 t D -2 ö
Du( z ) = Kc çç çç1 + + ÷÷ - ç + 1÷ z + z ÷÷e ( z )
è è t I Dt ø è Dt ø Dt ø
1 1
gc ( s) =
t r s g ( s)
l Example 26.2 g ( s) =
K
s»
1 - z -1
ts + 1 Dt
KDt
g ( s) = t + Dt
æ 1- z -1 ö
s =çç ÷ æ t ö -1
è Dt ø
÷ 1- ç ÷z
è t + Dt ø
æ æ t ö -1 ö
ç1- ç ÷z ÷
t + Dt ç è t + Dt ø ÷
gc ( z ) = PI-controller
trK ç 1 - z -1 ÷
ç ÷
è ø
æ gC ö 1 1 - z -1
ç
u( s ) = ç ÷e ( s)
-as ÷ gg c = s»
è 1 + gc g (1 - e ) ø t rs Dt
l Digital form is simply obtained by replacing s
in the continuous controller transfer function,
gc PI controller
l For the system of type first-order-process-
plus-time-delay(D), controller would be
æ t r + Dt ö t r -1 (t + Dt ) t -1
÷u ( z ) - z u ( z ) - z u ( z ) = e (z ) - z e (z )
-D
ç
è Dt ø Dt (KDt ) KDt
æ tr ö æ Dt ö é t + Dt ù
u (k ) = çç ÷÷u (k - 1) + çç ÷÷u (k - D) + ê úe (k )
è t r + Dt ø è t r + Dt ø ë K (t r + Dt ) û
é t ù
-ê úe (k - 1)
ë K (t r + Dt ) û
1 q( z )
l The digital controller is obtained gc ( z) =
g ( z ) 1 - q( z )
Part IVC: Computer Process
Control
Direct Synthesis in the z-
domain: Deadbeat Controller
l Solution:
• The closed loop system is required to
follow the setpoint exactly at each
sampling point with unit sampling delay
y ( z ) = z -1 yd ( z )
y( z)
= q( z ) = z -1
yd ( z )
1 q( z ) 1 z -1
gc ( z ) = =
g ( z ) 1 - q( z ) g ( z ) 1 - z -1
y ( z ) = z - D -1 yd ( z )
y( z)
= q( z ) = z - D -1
yd ( z )
1 q( z ) 1 z - D-1
gc ( z ) = =
g ( z ) 1 - q( z ) g ( z ) 1 - z - D-1
Example 26.3
>> Hp=c2d(Gp,0.3)
l Transfer function:
0.04052 z + 0.03665
1 ----------------------
g ( s) =
z^2 - 1.664 z + 0.7408
>>set(Hp,’Variable’,’z^-1’), Hp
Transfer function:
-1 -2
0.04052z + 0.03665z 0.04052 z^-1 + 0.03665 z^-2
g( z) = ----------------------------
1 - 1.664 z^-1 + 0.7408 z^-2
1 - 1.664 z -1 + 0.7408z -2 Sampling time: 0.3
>> pole(Hp)
ans =
ans =
-0.9046
æ z öæ 0.04052z + 0.03665z
-1 -1 -2
ö ans =
= çç ÷ç
-1 ֍ -1 -2
÷÷ 1.0000
è 1 - z øè 1 - 1.664 z + 0.7408 z ø -0.9046
poles 1 Ù -0.9046
l Example 26.3
u
To Workspace2
Gc Gp y_continuous
y_sampled
To Workspace
>>subplot(2,1,1),plot([0:0.3:10],y_sampled,'rx','MarkerSize',10)
>> hold on
>>plot(tout,y_continuous,'-b'),title('Intersample rippling')
>>plot([0 10],[1,1],'-k'),ylabel('y','Rotation',0),hold off
>>subplot(2,1,2),stairs([0:0.3:10],u,'-k')
>>title('Controller ringing')
>>ylabel('u','Rotation',0), xlabel('t')
æ æ - ö
Dt
ö
ç ç1 - e ÷ z
t r - M - 1 ÷
1 q( z ) 1 ç ç ÷ ÷
qc ( z ) = = ç è ø ÷
g ( z ) 1 - q( z ) g ( z ) ç -
Dt
æ - ö
Dt
t r ÷ - M -1 ÷
t r -1 ç
çç 1 - e z - ç1 - e ÷ z ÷÷
è è ø ø
l Example 26.4
0.04052z -1 + 0.03665z -2
g( z) =
1 - 1.664 z -1 + 0.7408z -2
æ - ö
Dt
æ 0.3
ö
ç1 - e t r ÷ z -n -1 -
çç1 - e 0.3 ÷÷ z -0-1
ç ÷
q( z ) = è ø = è ø
Dt 0.3
- -
0.3 -1
1 - e t r z -1 1- e z
(1 - e -1 ) z -1 0.6321z -1
= »
1 - e -1 z -1 1 - 0.3679 z -1
1 ç ç ÷ ÷ 1.0000
= ç è ø ÷ -0.9046
g ( z) ç -
Dt
æ - ö
Dt
t r ÷ - M -1 ÷
1 - e t r -1
z - ç 1 - e z
çç ç ÷ ÷÷
è è ø ø
æ 1 - 1.664 z -1 + 0.7408 z -2 öæ 0.6321z -1 ö
= çç -1
֍
- 2 ֍ -1
÷÷
è 0.04052 z + 0.03665 z øè 1 - z ø
l Example 26.4
u
To Workspace2
Gc Gp y_continuous
y_sampled
To Workspace
>>subplot(2,1,1),plot([0:0.3:10],y_sampled,'rx','MarkerSize',10)
>> hold on
>>plot(tout,y_continuous,'-b'),title('Intersample rippling')
>>plot([0 10],[1,1],'-k'),ylabel('y','Rotation',0),hold off
>>subplot(2,1,2),stairs([0:0.3:10],u,'-k')
>>title('Controller ringing')
>>ylabel('u','Rotation',0), xlabel('t')
1 - e t r ÷ z - M -1
1 q( z ) 1 B(1) çè ÷
ø
gc ( z ) = =
g ( z ) 1 - q( z ) g ( z ) -
Dt
tr -1 B( z -1 ) æç - ö
Dt
t r ÷ - M -1
1- e z - 1- e z
B(1) çè ÷
ø
Transfer function:
l Example 26.3 0.6321 z^-1
---------------
1 - 0.3679 z^-1
æ - ö
Dt Transfer function:
ç1 - e t r ÷ z - M -1 0.04052 + 0.03665 z^-1
B( z -1 ) çè ÷ ---------------------------
q( z ) = ø 0.07717
Dt
B(1) - Sampling time: 0.3
1 - e t r z -1 >> q=minreal(q1*q2)
Transfer function:
0.04052 + 0.03665 z -1 0.6321z -1 0.02561 z^-1 + 0.02317 z^-2
= ---------------------------
0.07717 1 - 0.3679 z -1 0.07717 - 0.02839 z^-1
Sampling time: 0.3
>> Gc=minreal(inv(Hp)*feedback(q,-1))
1 - e t r z -1 - ç1 - e t r ÷ z - M -1
B(1) çè ÷
ø
=
A( z -1 ) (1 - e ) -1
=
8.191 - 13.63 z -1 + 6.068z -2
B( z -1 ) 1 - 0.6998 z -1 - 0.3002 z -2
B(1)
1- e z - -1 -1
B(1)
(1 - e -1 )z -1
l Example 26.4
u
To Workspace2
Gc Gp y_continuous
y_sampled
To Workspace
>>subplot(2,1,1),plot([0:0.3:10],y_sampled,'rx','MarkerSize',10)
>> hold on
>>plot(tout,y_continuous,'-b’)
>>plot([0 10],[1,1],'-k'),ylabel('y','Rotation',0),hold off
>>subplot(2,1,2),stairs([0:0.3:10],u,'-k')
>>ylabel('u','Rotation',0), xlabel('t')
No ringing!