Discrete-Time Controllers Structures and Tuning
Discrete-Time Controllers Structures and Tuning
Š. Kozák 2000,
Department of Automatic Control Systems
Vienna TUniversity
PID regulátory – spätnoväzbové
štruktúry
• Riadenie (CO) u(t) :
Proportional gain
t
de
u( t ) K p e( t ) K I
e( ) d
0
Kd
dt
• Proportional control : u p( t ) K p e( t )
• Faster response
• Too much gain will make the system
unstable
Integral feedback gain KI
t
• Integral control: u ( t ) K e( ) d
i I
0
de
• Derivative control: u D( t ) K D
dt
PID
proportional factor
Ki d
command
error variable
set-point Kp plant
process value d
Kd
dt
derivative
factor measurement
The proportional factor Kp generates an output proportional to the error, it requires a non-
zero error to produce the command variable.
Increasing the amplification Kp decreases the error, but may lead to instability
The integral factor Ki produces a non-zero control variable even when the error is zero,
but makes response slower.
The derivative factor Kd speeds up response by reacting to an error step with a control
variable change proportional to the step.
too much proportional
PID response
factor: unstable
differential factor
increases responsiveness
asymptotic error:
no remaining error, proportional only
but sluggish
response:
integral only
Performance specifications of the closed loop
system (step response)
• Maximum overshoot:
• Delay time:
• Rise time:
• Settling time:
Digital
Digital control
control systems
systems
Digital realisation of an “analogue type” controller
Ts Perturbations
The
Thesampling
samplingfrequency
frequencyisischosen
chosenininaccordance
accordancewith
withthe
thebandwidth
bandwidth
desired
desiredfor
forthe
theclosed-loop
closed-loopsystem
system
Intelligent
Intelligentuse
useof
ofthe
the“computer”
“computer”::high
highsampling
samplingperiod
periodand
andthen
then
implementation
implementationofofcomplex
complexalgorithms
algorithmsrequiring
requiringgreater
greatercomputation
computation
time.
time.
Not
Notonly
onlyaacopy
copyof
ofanalogue
analoguecontrol
control::BRAINWARE
BRAINWARE
Discrete-time system models y(k) = f[y(k-i), u(k-j)]
and or
digital control algorithms G(z-1) = z -d B(z -1)/A(z -1)
Choice
Choice of
of sampling
sampling frequency
frequency
fs = 1/Ts = (6 to 25) * f
fs = 1/Ts = (6 to 25) * fCLBB
CL
No more
fs
fs :: sampling
sampling period
period
ffCL
CL : bandwidth of the closed-loop
BB : bandwidth of the closed-loop
system
system
If fs is fixed => limit for fCLB ( fs /15 )
Diskrétne algoritmy riadenia
1 t de(t )
u (t ) K e(t ) e( )d Td
Ti 0 dt
r0 K
1 r K
GR ( s) K 1 Td ( s) r0 1 r1s r 1
Ti s s Ti
r1 KTd
1 Td s 1 Td de t / Tf
GR ( s ) K 1 u( t ) K( e( t ) e dt e )
T i s 1 Tf s Ti Tf dt
ff =Td*(1/Tf*Dirac(t)-1/Tf2*exp(-t/Tf))
1. 1 U( s ) q 0 q1 z 1 q 2 z 2 U( z )
GR ( s ) K( 1 Td s ) GR ( z )
Ti s E( s ) 1 z 1 E( z )
u( k ) u( k 1 ) q0 e( k ) q1 e( k 1 ) q2 e( k 2 )
2. z 1 GR ( s )
GR( z ) GTC GR( z )
z s
1 Td s U( s ) q 0 q1 z 1 q 2 z 2 U( z )
GR ( s ) K( 1 ) GR ( z )
Ti s 1 Tf s E( s ) 1 p1 z 1 p2 z 2 E( z )
T T T
q 0 K 1 d q 2 K d ( d 1) D1
Tf
p1 D1 1
Tf Ti
T T T
p2 D1
q1 K 1 D1 2 d
Tf T i D1 e Tf
ff =Td*(1/Tf*Dirac(t)-1/Tf2*exp(-t/Tf))
Základné diskrétne formy PID regulátorov (DPID)
- odčítaním
e( k 1 ) e( k 2 )
k 1
k-1 T Td
u( k 1 ) K e( k 1 )
Ti
e( i 1 ) T
i 1
T Td
u( k ) u( k ) u( k 1 ) K e( k ) e( k 1 ) e( k 1 ) e( k ) 2e( k 1 ) e( k 2 )
Ti T
T T
u( k ) u( k ) u( k 1 ) K e( k ) e( k 1 ) e( k 1 ) d e( k ) 2e( k 1 ) e( k 2 )
Ti T
T T T T
K( 1 d ) e( k ) K( 1 2 d ) e( k 1 ) K d e( k 2 )
T T Ti T
q0 q1 q2
u( k ) u( k 1 ) q0 e( k ) q1 e( k 1 ) q2 e( k 2 )
T T T Td
q0 K 1 d q1 K 1 2 d q2 K
T Ti T T
Podmienky ekvivalentnosti :
q0 > 0
q1>- q0
-(q0+q1) < q2< q0
PCH - PID REGULÁTORA-PODM.EKVIVALENTNOSTI
u(k)
q0+q1 + q2
q0
q0 > 0
q1>-q0
2q0+q1 -(q0+q1) < q2< q0
q0-q2
t=kT
PCH - PID REGULÁTORA-PODM.EKVIVALENTNOSTI
u(k)
Kci
K(1+cd)
cd > 0
ci > 0
K c i < cd
K(1+ci)
t=kT
PCH - PI REGULÁTORA-PODM.EKVIVALENTNOSTI
u(k)
q0+q1
q0
t=kT
Iné formy a vyjadrenia diskrétneho PID regulátora
T T
u( k ) u( k ) u( k 1 ) K e( k ) e( k 1 ) e( k 1 ) d e( k ) 2e( k 1 ) e( k 2 )
Ti T
T T T T
K( 1 d ) e( k ) K( 1 2 d ) e( k 1 ) K d e( k 2 )
T T Ti T
w(k)=w(k-1)=w(k-2)
w( k ) y( k ) w( k 1 ) y( k 1 )
T
u( k ) u( k 1 ) K e( k 1 )
Ti
Td
T w( k ) y( k ) 2 w( k 1 ) 2 y( k 1 ) w( k 2 ) y( k 2
T T
u( k 1 ) K [ y( k ) y( k 1 )] K e( k 1 ) K d [ y( k ) 2 y( k 1 ) y( k 2 )]
Ti T
T e( 0 ) e( k ) k 1
T
u( k ) K e( k ) [( ) e( i ) ] d e( k ) e( k 1 )
Ti 2 i 1 T
-
T e( 0 ) e( k 1 ) k 2
Td
u( k 1 ) K e( k 1 ) [( ) e( i )] e( k 1 ) e( k 2 )
Ti 2 i 1 T
T Td Td T Td
u( k ) u( k 1 ) K e( k )( 1 ) e( k 1 )( 1 2 ) e( k 2 )
2Ti T T 2Ti T
q0 q1 q2
u( k ) u( k 1 ) q0 e( k ) q1 e( k 1 ) q2 e( k 2 )
T Td Td T Td
q 0 K 1
q1 K 1 2 q2 K
2Ti T T 2Ti T
Prenosová funkcia diskrétneho PID regulátora
u ( k ) q0 e( k ) q1e( k 1) q2 e( k 2)
U ( z ) z 1U ( z ) q0 E ( z ) q1 z 1 E ( z ) q 2 z 2 E ( z )
U ( z )(1 z 1 ) ( q0 q1 z 1 q 2 z 2 ) E ( z )
q 0 q1 z 1 q 2 z 2 Q( z ) U ( z )
GR ( z ) 1
1 z P( z ) E( z)
Podmienky ekvivalentnosti PID a PSD regulátora
u( k ) u( k 1 ) q 0 e( k ) q1 e( k 1 ) q 2 e( k 2 )
e( k ) 1( k ) 1 pre k 0
0 pre k 0
k 0 u( 0 ) q 0
k 1 u( 1 ) u( 0 ) q 0 q1 2 q 0 q1
k 0
k 2 u( 2 ) uk ( 1) 1q 0 q1 q 2 3 q 0 2 q1 q 2
.......... .......... .......... .......... .......... .......... .......... .......... .......... ..
u( k ) u k 1 q 0 q1 q 2 k 1 q0 kq1 k 1 q 2
u( 1 ) u( 0 ) 2q 0 q1 q 0 q 0 q1 0 q 1 q 0 q0 0
u( k ) u k-1 pre k 2
u( k ) u k 1 pre k 2 q 0 q1 q 2 0 alebo q 2 q 0 q1
Podmienky „ekvivalentnosti“:
q0 0 q1 q0 q0 q1 q2 q0
u(k)
q0+q1 + q2
q0
q0 > 0
q1>-q0
2q0+q1 -(q0+q1) < q2< q0
q0-q2
t=kT
Iná ekvivalentná forma vyjadrenia diskrétneho PID regulátora
K q 0 q2
Td Td
q cd Kd K Kcd
cd 2 T T
K
T Ti
( q0 q1 q 2 ) ci Ki K Kci
ci Ti T
K
GR ( z )
K (1 cd ) (ci 2cd 1) z 1 cd z 2
1 z 1
z 1 1 U ( z ) q0 q1 z 1 q2 z 2
K 1 ci 1
cd (1 z ) (rkoz0)
1 z E ( Z ) 1 z 1
cd 0 ci 0 ci cd
GR ( z )
K (1 cd ci ) (2cd 1) z 1 cd z 2
1 z 1
z 1 1 U ( z ) q0 q1 z 1 q2 z 2
K 1 ci 1
cd (1 z ) 1
1 z E ( Z ) 1 z
Upravený tvar DPID
GR ( z )
K ( 1 c d c i ) ( 2c d 1 ) z 1 c d z 2
K q 0 q2
1z 1 q2
cd
U( z ) q 0 q1 z 1 q 2 z 2 K
1 1
K 1 c i 1
cd( 1 z ) ( q 0 q1 q 2 )
1z E( Z ) 1 z 1 ci
K
u (k ) u p (k) u i (k ) u d (k )
u (k ) u (k 1) q0e(k ) q1e(k 1)
u(k)
q0+q1
q0
t=kT
Iné vyjadrenie PS regulátora je možné pomocou koeficientov K, c i a cd.
Pre q2=0 je zosilnenie K a koeficienty cd a ci vyjadrené
K q0 K0 (q 0 0)
cd 0
ci K (q 0 q1 ) ci 0
GR ( z )
K 1 (ci 1) z 1 U ( Z )
1 z 1 E( z)
Riadiaci zásah
GR ( z ) q0 q2 z 1
U ( z)
E ( z)
K 1 cd (1 z 1 ) K (q0 q 2 )
q2
cd
K
T T
u( k ) u( k ) u( k 1 ) P e( k ) e( k 1 ) e( k 1 ) d e( k 1 ) 2e( k 1 ) e( k 2 )
Ti T
Modifikácia PID regulátorov úpravou derivačného člena
1 T s
z 1 GR ( s ) GR ( s ) K 1 d
GR ( z ) GTC GR ( z ) T i s 1 Tf s
z s
z 1 1 1 T
K L1 2 d K 1 T 1 d z 1
T
GR ( z ) K
z s Ti s 1 Tfi s Ti z 1 Tf z D1
T z 1 Td 1 z 1
K 1 1
1
T i 1 z T f 1 D1 z
T T T T T
K 1 d z 0 1 D1 2 d z 1 d 1 D1 z 2
Tf Tf T i Tf Ti q0 q1 z 1 q 2 z 2 U ( z )
1
1 z 1 D1 z 1
1 p1 z 1
p 2 z 2
E ( z)
T 0 T T T T
K 1 d z 1 D1 2 d z 1 d 1 D1 z 2
T 1 2
Tf Tf T i f Ti q0 q1 z q 2 z U ( z )
GR ( z )
1 z 1 1 D1 z 1 1 p1 z 1 p 2 z 2 E ( z)
T
q 0 K 1 d T T
Tf q 2 K d ( d 1) D1
Tf Ti p1 D1 1
T T
q1 K 1 D1 2 d
T
p2 D1
Tf T i D1 e Tf
qo q1 z 1 q2 z 2 U ( z )
GR ( z ) 1 2
1 p1 z p2 z E( z)
qo q1 z 1 q2 z 2 U ( z )
GR ( z ) 1 2
1 p1 z p2 z E ( z)
Tf T Td p1 4c p1 (1 2c p1 )
c p1 ci1 cd 1
T Ti T 2c p1 1
p2
1 2c p1
1 D1 1 D1
K 1 2(c p1 cd1) ci1 / 2(1 2c p1)
K ci1 4(c p1 cd1 )
K c p1(2 ci1) 2cd 1 ci1 / 2 1
1 2c p1 1 2c p1
PSD 1 2c p1
(4)
1 4c p1 /(1 2c p1) (2c p1 1) /(1 2c p1 )
c p1 T0 / T ci1 T / Ti cd 1 Td / T
Doplnok – kvalita regulácie frekvenčná oblasť
Closed
Closed Loop
Loop
Disturbances
Perturbations
Feed P
Yref Y
+ Reg. System
-
F(s) H(s)
Transducer
G(s)
Perturbation
Perturbationrejection
rejection::
SSyp(0) =0 to
toget getaaperfect
perfectrejection
rejectionofofthe
theperturbation
perturbationin
yp(0) = 0 in
steady
steadystate state(controller
(controllermust
mustcontain
containthe
theclasses
classesof
of
perturbation)
perturbation)
and
and
|S ()| |<<GG ;;
|Sypyp()
[
[Example
Example::|S |Sypyp() (6dB) ;;
()| |<<22(6dB)
IfIfthe
theenergy
energyof
ofthe
theperturbation
perturbationisisconcentrated
concentratedininaagiven
given
frequency
frequencyband,
band,the
the|S
|Sypyp()
()| |should
shouldbe
belimited
limitedin
inthis
thisband.
band.
Controller
Controller Design
Design
In
Inorder
orderto
todesign
designand
andtune
tuneaacontroller
controller::
1)
1)To
Tospecify
specifythe
thedesired
desiredcontrol
controlloop
loopperformances
performances
Regulation
Regulationand
andtracking
tracking::rise
risetime
timeand
andmax
maxovershoot
overshoot
or
orbandwidth
bandwidthand
andresonance
resonance
2)
2)To
Tochoose
chooseaasuitable
suitablecontroller
controllerdesign
designmethod
method
3)
3)To
Toknow
knowthe
thedynamic
dynamicmodel
modelof
ofthe
theplant
plantto
tobe
becontrolled
controlled
=>
=>control
controlmodel
model
Control model :
- Non parametric models : e.g. frequency response, step response,…
- Parametric models : e.g. transfer function, differential eq., state eq.
Linear system
Note:
u(t) = ejt y(t) = G(j) . ejt State Equation
Differential Eq.
System Transfer
u(t) = e st
y(t) = G(s) . est
function
Observability,
Controlablity
20.log(|G|)
Gain
x
or f
x o
deg x
or f
Root locus : poles and zeroes
Phase Nyquist, Nichols,...
Bode Diagram
Continuous
Continuous -- time
time Models
Models :: Time
Time responses
responses
Response of a dynamic system for a step input
tR : Rise Time ; define as the time needed to attain 90% of the final value ;
or as the time needed for the output to pass from 10 to 90% of the final value
tS : Settling Time ; define as the time needed for the output to reach and
remain within a tolerance zone around the final value (±10%, ± 5%, ±1%,…)
FV : Final Value ; a fixed output value obtained for t
M : Maximum Overshoot ; expressed as a percentage of the final value
Continuous
Continuous -- time
time Models
Models :: Frequency
Frequency
responses
responses
20 log[ H(jw) ] Nb of poles
Resonance Nb of zeroes
(p - m) x 20 dB/dec
- 3 dB
N dB
wB wC
w= 2 p f
(fB) (fC)
ffB ::Bandwidth
Bandwidth; ;the thefrequency
frequencyfrom fromwhich
whichthe
thezero-frequency
zero-frequency(steady
(steady
B
state)
state)gain
gainG(0)
G(0)isisattenuated
attenuatedbybymoremorethan
than33dB
dB; ;G(w
G(wBB))==G(0)
G(0)--3dB
3dBor
or
G(w
G(wBB))==0.707
0.707. .G(0)
G(0)
ffC ::Cut-off
Cut-off frequency
frequency; ;the
thefrequency
frequencyfrom
fromwhich
whichthetheattenuation
attenuationisis
C
more
morethanthanNNdBdB; ;
G(w
G(wCC))==G(0)
G(0)--NdB
NdB
QQ :: Resonance
Resonance factor
factor; ;the
theratio
ratiobetween
betweenthe
thegain
gaincorresponding
correspondingtotothe
the
maximum
maximumof ofthe
thefrequency
frequencyresponse
responsecurve
curveand
andthe
thevalue
valueG(0)
G(0)
Reciprocity
Reciprocity :: Time
Time // Frequency
Frequency
- 3 dB
fB = 1/(2 T)
frequency
fB 0.35 / tR
0.9
0.1
time
tR = 2.2 T
Closed
ClosedLoop
Loop:: Margins
Margins
Module
ModuleMargin
Margin:: Gain
Gain Margin
Margin ::
M DG
DG==11//|H(jw )|
M==|1|1++H(j)| ==|S (j)|
-1-1 |H(jw180
H(j)|min |S 180)|
yp(j)|min
yp
for
forF(w
F(w180))==-180
min min
180 -180
Measure
Measureofofperturbation
perturbationrejection
rejectionand
androbustness Typical
robustness Typical: :GG2
2(6dB)
(6dB)[min:
[min:1.6
1.6(4dB)]
(4dB)]
ofofnon
nonlinearity
linearityand
andtime
timevariable
variableparameters
parameters
Typical: :M
Typical 0.5(-6dB)
M0.5 (-6dB)[min:
[min:0.4
0.4(-8dB)]
(-8dB)]
Im H(j)
1/G
-1
Re H(j)
cr
Delay
DelayMargin
Margin:: Phase
PhaseMargin
Margin::
==00.
.crcr 180--(
==180 (crcr))
additional
additionaldelay
delaythat
thatcould
couldbe for
tolerate
be for|(j
|(jcrcr))==11
tolerateby
bythe
theopen
openloop
loopsystem
system
cr ::crossing pulsation
without
withoutinstability
instabilityfor
forthe
theclosed
closed cr crossing pulsation
30
loop system
loop system Typical
Typical: :30 60
60