Ktl-icon-tai-lieu

Digital PID Controllers

Được đăng lên bởi sonnv-iddc
Số trang: 11 trang   |   Lượt xem: 505 lần   |   Lượt tải: 0 lần
Digital PID Controllers
Dr.Varodom Toochinda

June 2011
Proportional-Integral-Derivative (PID) control is still widely used in industries because of its
simplicity. No need for a plant model. No design to be performed. The user just installs a
controller and adjusts 3 gains to get the best achievable performance. Most PID controllers
nowadays are digital. In this document we discuss digital PID implementation on an embedded
system. We assume the reader has some basic understanding of linear controllers as described in
our other document.

Different forms of PID
A standard “textbook” equation of PID controller is
t

1
de(t ) 

u (t )  K  e(t )   e( )d  Td

T
dt
i
0



(1)

where the error e(t), the difference between command and plant output, is the controller input,
and the control variable u(t) is the controller output. The 3 parameters are K (the proportional
gain), Ti (integral time), and Td (derivative time).
Performing Laplace transform on (1), we get



1
G ( s)  K 1 
 sTd 
 sTi


(2)

Another form of PID that will be discussed further in this document is sometimes called a
parallel form.
t

u (t )  K p e(t )  K i  e( )d  K d
0

d
e(t )
dt

(3)

With its Laplace transform

G( s)  K p 


Ki
 sK d
s

(4)
Page 1

We can easily convert the parameters from one form to another by noting that

Kp  K
K
Ti
K d  KTd
Ki 

(5)

Discrete-time PID Algorithm
For digital implementation, we are more interested in a Z-transform of (3) *

Ki


U ( z)  K p 
 K d (1  z 1 ) E ( z )
1
1 z



(6)

Rearranging gives

 ( K p  K i  K d )  ( K p  2K d ) z 1  K d z 2 
U ( z)  
 E( z)
1  z 1



(7)

Define

K1  K p  K i  K d
K 2   K p  2K d
K3  Kd
(7) can then be rewritten as





U ( z )  z 1U ( z )  K1  K 2 z 1  K 3z 2 E ( z )

(8)

which then converted back to difference equation as

u[k ]  u[k  1]  K1e[k ]  K 2 e[k  1]  K 3e[k  2]

(9)

a form suitable for implementation. Listing 1 shows how to code this algorithm in C. We assume
that the plant output is returned from a function readADC( ), and the control variable u is
outputted using writeDA( ). Note that u must be bounded above and below depending on the
DAC resolution. For instance, UMAX = 2047 and UMIN = -2048 for 12-bit DAC.
* To simplify the discussion, we omit the effect of sampling period on the PID parameters. Also, this particular
form is called backward Euler. Other ...
www.controlsystemslab.com Page 1
Digital PID Controllers
Dr.Varodom Toochinda
http://www.controlsystemslab.com
June 2011
Proportional-Integral-Derivative (PID) control is still widely used in industries because of its
simplicity. No need for a plant model. No design to be performed. The user just installs a
controller and adjusts 3 gains to get the best achievable performance. Most PID controllers
nowadays are digital. In this document we discuss digital PID implementation on an embedded
system. We assume the reader has some basic understanding of linear controllers as described in
our other document.
Different forms of PID
A standard “textbook” equation of PID controller is
t
d
i
dt
tde
Tde
T
teKtu
0
)(
)(
1
)()(
(1)
where the error e(t), the difference between command and plant output, is the controller input,
and the control variable u(t) is the controller output. The 3 parameters are K (the proportional
gain), T
i
(integral time), and T
d
(derivative time).
Performing Laplace transform on (1), we get
d
i
sT
sT
KsG
1
1)(
(2)
Another form of PID that will be discussed further in this document is sometimes called a
parallel form.
)()()()(
0
te
dt
d
KdeKteKtu
d
t
ip
(3)
With its Laplace transform
d
i
p
sK
s
K
KsG )(
(4)
Digital PID Controllers - Trang 2
Để xem tài liệu đầy đủ. Xin vui lòng
Digital PID Controllers - Người đăng: sonnv-iddc
5 Tài liệu rất hay! Được đăng lên bởi - 1 giờ trước Đúng là cái mình đang tìm. Rất hay và bổ ích. Cảm ơn bạn!
11 Vietnamese
Digital PID Controllers 9 10 943