Siemens SIMATIC S7-200 System Manual page 160

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

S7-200 Programmable Controller System Manual
Understanding the PID Algorithm
In steady state operation, a PID controller regulates the value of the output so as to drive the error
(e) to zero. A measure of the error is given by the difference between the setpoint (SP) (the
desired operating point) and the process variable (PV) (the actual operating point). The principle
of PID control is based upon the following equation that expresses the output, M(t), as a function
of a proportional term, an integral term, and a differential term:
Output
=
M(t)
=
where:
M
(t)
K
C
e
M
initial
In order to implement this control function in a digital computer, the continuous function must be
quantized into periodic samples of the error value with subsequent calculation of the output. The
corresponding equation that is the basis for the digital computer solution is:
M
=
n
output
=
where:
M
n
K
C
e
n
e
n - - 1
e
x
K
I
M
initial
K
D
From this equation, the integral term is shown to be a function of all the error terms from the first
sample to the current sample. The differential term is a function of the current sample and the
previous sample, while the proportional term is only a function of the current sample. In a digital
computer, it is not practical to store all samples of the error term, nor is it necessary.
Since the digital computer must calculate the output value each time the error is sampled
beginning with the first sample, it is only necessary to store the previous value of the error and the
previous value of the integral term. As a result of the repetitive nature of the digital computer
solution, a simplification in the equation that must be solved at any sample time can be made. The
simplified equation is:
M
=
n
output
=
where:
M
n
K
C
e
n
e
n - - 1
K
I
MX
K
D
146
Proportional term
+
K
* e
+
C
is the loop output as a function of time
is the loop gain
is the loop error (the difference between setpoint and process variable)
is the initial value of the loop output
K
* e
+
c
n
proportional term
+
is the calculated value of the loop output at sample time n
is the loop gain
is the value of the loop error at sample time n
is the previous value of the loop error (at sample time n - - 1)
is the value of the loop error at sample time x
is the proportional constant of the integral term
is the initial value of the loop output
is the proportional constant of the differential term
K
* e
+
c
n
proportional term
+
is the calculated value of the loop output at sample time n
is the loop gain
is the value of the loop error at sample time n
is the previous value of the loop error (at sample time n - - 1)
is the proportional constant of the integral term
is the previous value of the integral term (at sample time n - - 1)
is the proportional constant of the differential term
Integral term
t
K
e dt + M
C
initial
0
n
Σ
K
*
e
+ M
I
x
initial
1
integral term
K
* e
+ MX
I
n
integral term
+
Differential term
+
K
* de/dt
C
K
* (e
- - e
)
+
D
n
n- 1
+
differential term
K
* (e
- - e
)
+
D
n
n- 1
+
differential term

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents