You are on page 1of 9

Control of an industrial process using PID control

blocks in automation controller


by Michel Van Dessel 1

Abstract

Many continuous industrial processes can be controlled using programmable automation controllers for digital implementation of classical PID control. For this type of applications, a PID
control block has been developed for use in the programming environment PCWorx. Two
types of PID control of tank level are discussed: single point control and cascade control. The
single point control uses a single PID controller to regulate tank level using a single measurement for feedback being tank level itself. The PID controller output determines the state of the
feed valve. The system has limitations in reacting to variations in output flow, which is to be
regarded as a system disturbance. The cascade control uses two PID controllers for a better
performance of the level control. The master controller is the level controller using the level
setpoint and measurement to determine the setpoint for the slave controller driving the input
flow valve. Measurements of input and output flow are taken into account, enabling the system
to faster respond to output flow disturbances. Both types of control have been implemented
using the PID control block in PCWorx for programming a Phoenix Contact PLC. The physical
system, tank level control, was simulated in the process simulation environment ProcesSim
running on the host PC. This virtual process environment enables the automation engineer to
implement and test a PLC program controlling a process without having the actual installation
physically available. Results of the PID controllers implemented within a Phoenix Contact PLC
type ILC 150 ETH, linked to the simulated process in ProcesSim are presented.

PID control with automation controllers

Many continuous industrial processes can be controlled using automation controllers for digital
implementation of classical PID control (e.g. level control of tanks, flow control). The majority
of installations use separate digital PID controllers for the control loops and PLCs for control
of the processing sequence, monitoring of system variables, logging and alarms. For this type
of applications, a programmable PID control function block has been developed for use in the
programming environment PCWorx for implementation in Phoenix Contact PLCs [1]. The PID
control is integrated in the PLC program and separate controllers are not needed, saving costs
in hardware and installation space.

dr.ir. Michel Van Dessel, Lessius Mechelen Campus De Nayer, St.-Katelijne-Waver, Belgium

2.1

Basic PID control function block

The internal block structure of the PID controller, as found in the standard library of PCWorx is
shown in Fig.1.

Fig. 1: Basic PID control function block

The signals for this controller are Sp: setpoint, Pv: measured process value, Xout: controller
output. The parameters of the PID controller are Kp: proportional constant, Tr: reset time constant, Td: derivative time constant. Kp is normally a positive amplification constant. It can also
be negative, if the gain of the process to be controlled is negative.
Since the PID controller is implemented as a function block of a digital PLC, special attention
has to be paid to the sampling period Ts or Cycle time. All function blocks having a Cycle input
must not be executed in the default task of the PLC. The cycle time of the default task
changes permanently according to the utilisation of the PLC. Therefore it is necessary to execute the corresponding function blocks in a CYCLE-task. The sampling time Ts is set in a
way, that it approximately corresponds to maximally one tenth of the equivalent process time
constant TETC:
Ts < 1/ 10 * TETC

2.2

Advanced PID control function block

The advanced PID control function block is found in the PCWorx Control technology library
version 1_08. The function block, internal structure and main parameters are given in Fig 2.
The function block realises a PID-type controller with a delayed D portion, including all possible sub variants (PI, PD, P and I) [2]. The transfer functions that are equivalent to continuousaction controllers are given in Table 1.

Fig. 2: Advanced PID control function block

Table 1: Continuous-action PID controller transfer functions

Process simulation environment ProcesSim

Fig. 3: Process simulation environment ProcesSim

The process simulation environment ProcesSim has been developed by the Institution for industrial higher education of Mons (I.S.I.Ms, Belgium) in co-operation with Campus De Nayer.
The software has been developed for use with the Windows operating system to simulate an
industrial process or machine and to test, improve and maintain the PLC program that controls
this process based on this simulation. This simulation environment enables the automation
engineer to implement and test a PLC program controlling a process without having the actual
installation physically available [3]. The consisting elements of the virtual process environment
are depicted in Fig. 3. From a library of virtual process elements, the process simulation is built
up. The program contains a range of industrial pneumatic and electric components, digital or
analogue inputs and outputs, displays, product generators, ... that can be used to simulate the
industrial process. Dynamic visualisation generates a realistic simulation of both continuous as
well as discrete components of the process. A local control program describes the way the
simulated process elements interact and behave in time. The ProcesSim process environment
runs on the host PC. Communication and exchange of variables between the PLC executing
the control program and ProcesSim is performed using Modbus TCP.

Application: single point level control

Two types of PID control of tank level are discussed: single point control and cascade control.
Both types can be implemented using the PID control block in PCWorx for programming a
Phoenix Contact PLC. The single point control uses a single PID controller LC to regulate tank
level h using a single variable for feedback being tank level measurement provided by the
level transmitter LT. The PID controller output determines the state x of the feed control valve
CV, as shown in the process diagram. The input flow mi is proportional to the valve state x
through valve constant Vc:
mi = Vc . x
Vc

mi

x
CV

LT
At
h

Pv
hset

Sp

LC

mu

rY

Fig. 4: Process diagram for single point level control [4].

The ProcesSim virtual process environment simulates the plant, while the PLC ILC 150 ETH
performs the control using the advanced PID control function block. The user interface for the
PID controller is a part of the ProcesSim GUI, as seen in Fig. 5.
The results for the PID control of the tank level are plotted in Fig. 6, which shows the level
('Process value') and the level controller output. The system starts with a tank level of 50%,
that is maintained at a constant value. After 18 seconds the output valve is fully opened, causing a drop in the level. This deviation is only corrected by a dramatic increase in the controller
output, causing the input valve to be opened to almost 100%. Then follows an oscillation in the
controller output and thus in the input valve state x. At 85 seconds the controller output is
switched to manual mode and output 0, closing the input feed valve. Since the output valve is
still open, the tank level gradually drops to zero. The system with single point level control has
limitations in reacting to variations in output flow mu, which is to be regarded as a system disturbance.

Fig. 5: ProcesSim user interface for single point level control.

120

100

80
Controller
output
60
Process
value
40

20

0
0

20

40

Opening valve

Fig. 6: Results of single point level control

60

80
Activate manual

100

120

Application: cascade level control

The cascade control uses two PID controllers for a better performance of the level control. The
process diagram is shown in Fig. 7. The master controller is the level controller LC using the
level setpoint and measurement LT to determine the signal b, that contributes to setpoint u for
the slave flow controller FC driving the input flow valve CV. Measurements of input flow mi and
output flow mu are taken into account (FiT and FuT), enabling the system to react to output
flow disturbances. The setpoint for the flow controller is calculated by a computing relay CR:
u = a + b - k = mu + master output load factor
Vc

mi
x

CV

FiT

LT
u

At
FC

Pv

k
CR

hset

LC

Sp

mu

rY
a
FuT
b

Fig. 7: Process diagram for cascade level control [4].

The virtual process for cascade level control in ProcesSim is shown in Fig. 8. The results of
cascade level control are shown in Fig 9. The test starts with a tank level of 50%. The valve1,
without flow measurement is opened first, causing a limited decrease in the level. The master
controller reacts to this change and sends a signal b to the computing relay CR in the process
diagram, increasing the input u for the flow controller FC. The output variation of the slave controller controls the feed valve to restore tank level to 50%. Valve 2, with output flow measurement is opened at 19 s. In this case the input a of the computing relay asks for an increase in
the input for the flow controller, without the master controller having to intervene. The valve 1
is closed at 32 seconds and valve 2 is closed at 39 seconds. Since there is no output flow
possible in this situation, the input feed valve has to be closed by the slave controller whose
output drops to zero. This is under command of the master controller that measures tank level,
controlling it to stabilise at 50%.

Fig. 8: ProcesSim user interface for cascade level control.

80

70

60

50

Tank level

40

Master out
Slave out
30

20

10

0
0

Valve 1 open

9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69
Valve 2 open

Valve 1 closed

Fig. 9: Results of cascade level control.

Valve 2 closed

6
[1]
[2]
[3]
[4]

References
PCWorx IEC61131-Programming, Phoenix Contact GmbH & Co, Blomberg, Germany.
CLC library for the Control System PCWorx, Phoenix Contact GmbH & Co, Blomberg,
Germany.
ProcesSim version 9.2, I.S.I.M., Mons, Belgium, http://processim.hecfh.be
Simulatie van technische systemen met MATLAB/Simulink, T. Van der Veen, Academic
Service, ISBN 90 395 0584 5.