Chapter 15. The PID functions
15-13
15.2.2 Realization of PID control on the PLC
In this chapter, it will described that how to get the digitized formula of the P, I, and D
terms. Then, the pseudo code of PID control will be shown.
15.2.2.1
P control
The digitized formula of P control is as following;
[
]
)
(
)
(
)
(
n
PV
n
SV
b
K
n
P
−
×
=
n : sampling number
K : proportional gain constant
b : reference value
SV : set value
PV : present value
15.2.2.2
I control
The continuous formula of I control is as following;
∫
=
t
ds
s
e
Ti
K
t
I
0
)
(
)
(
I(t) : integral term
K : proportional gain constant
Ti : integral time
e(s) : deviation value
By deviation about t, we can obtain;
e
Ti
K
dt
dI
=
e = (SV – PV) : deviation value
The digitized formula is as following;
)
(
)
(
)
1
(
n
e
Ti
K
h
n
I
n
I
=
−
+
h : sampling period
)
(
)
(
)
1
(
n
e
Ti
Kh
n
I
n
I
+
=
+