P01-06 - Control Loop - V8.1 - S0915 - EN
P01-06 - Control Loop - V8.1 - S0915 - EN
PA Module P01-06
SIMATIC PCS 7 –
Control Loop and Other Control Functions
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved.
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
Please note that these trainer packages may be replaced with subsequent packages.
An overview of the available SCE packages is provided at: siemens.com/sce/tp
Continuing education
For regional Siemens SCE continuing education, contact your regional SCE contact partner.
siemens.com/sce/contact
Note on Usage
The training curriculum for the integrated automation solution Totally Integrated Automation (TIA) was
prepared for the program "Siemens Automation Cooperates with Education (SCE)“ specifically for training
purposes at public educational and R&D facilities. Siemens AG is not liable for the contents.
This document may only be used for initial training on Siemens products/systems. This means it may be
copied entirely or partially and handed to trainees for use within the scope of their training. Passing on or
copying this document and communicating its contents is permitted within public training and continuing
education facilities for training purposes.
Exceptions require written permission by Siemens AG. Contact person: Roland Scheuerer
[email protected].
Violators are subject to damages. All rights including translation rights are reserved, particularly in the
event a patent is granted or a utility model or design is registered.
Usage for industrial customer courses is explicitly not permitted. We do not agree to the commercial
utilization of these documents.
We would like to thank the Technical University Dresden, particularly Prof. Dr. Leon Urbas and Annett
Krause, MS, as well as the Michael Dziallas Engineering Corporation and those who provided support in
preparing this SCE training document.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 2
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
THEORY IN BRIEF
In the process industry, certain process variables will have to be kept at a certain value
despite interferences (disturbance characteristics), and process variables have to be
set in a stable mode to specified setpoints (command behavior). To this end, control
loops are used as shown in Figure 1.
Disturbance
variables z
System Manipulated
deviation e variable y Process variable =
Loop controlled variable
Setpoint w System x
controller
+
-
For the plant in this training manual, the reactor temperature has to be set to a certain
value for a specification-oriented response control. Disturbance variables are the ambient
temperature and the materials used with different temperatures. For the temperature to be
controlled, it first has to be determined through measurement. This measured value that
corresponds to the actual value of the process variable is then compared with the
desired value (setpoint). The difference between actual value and setpoint is called
(system) deviation.
If the system deviation is known, counter measures can be derived. In the case of
temperature control, the heater is switched on when the measured actual value is less than
the specified setpoint. For the process to react automatically, a closed loop controller is
needed. A closed loop controller that calculates the manipulated variable based on the
current deviation is called proportional controller (P-controller for short).
In practice, controllers that can be used for a wide variety of processes using only a few
parameters have prevailed. These are referred to as PID controllers.
The PCS 7 Advanced Process Library V81 includes well-tried blocks that implement
this functionality. Below, the block PIDConL is used.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 3
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
THEORY
INTRODUCTION
The above mentioned P-controller represents the simplest controller. It processes
according to the principle: the larger the current deviation, the larger the manipulated
variable. This means its behavior is derived directly from the current system deviation–
which makes it fast and relatively dynamic. However, certain disturbances are not
completely adjusted, which means there is a permanent system deviation.
Not every process tolerates a permanent system deviation and additional steps have to be
taken. One possibility consists of connecting an integral component; this turns the P-
controller into a PI controller. The effect of the integral component consists of adding up a
continuous system deviation. This means the manipulated variable increases even though
the system deviation does not change.
If abrupt disturbances occur in a system, they can be counteracted quickly with an
additionally differentiating component. The D-component calculates the manipulated
variable from the time deviation of the system deviation. However, this behavior causes the
stochastic interferences (noise) to be amplified. Here, an effective middle course has to be
found.
A combination of P, I and D- component is called a PID controller. In the process industry,
95% of applications are implemented with these controllers, because the PID controller is
set with only three parameters (gain, integral time and derivative time). These few
parameters allow for a good adaptation to a variety of different dynamic processes.
However, setting the parameters presupposes knowledge of the system that is to be
controlled. Knowledge of the system can be gained by experience, determined
experimentally, or calculated by modeling the system. For a large variety of processes that
are not dominated by dead time and that react in a similar manner to positive as well as
negative changes of the manipulated variable intervention, different setting rules suitable
for application in practice were found. Examples are the settings according to Chien,
Hrones and Reswick [1], the Ziegler and Nichols method [2] as well as the T-Sum Rule [3].
The process control system PCS 7 supports setting the parameters using a PID Tuner.
For the closed loop control block PIDConL the parameter for gain is called GAIN, for the
integral component TI (integral time) and for the differential component TD (derivative
time). The time is specified in time units of seconds. The input variables of the controller
are the controlled variable PV and the setpoint SP whose result is the system deviation ER.
The manipulated value MV is the output variable for the controlled system; it is calculated
according to the following formula:
1 TD s
MV GAIN 1 ER .
TI s TD
1 s
DiffGain
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 4
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 5
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
Disturbance
variables z
Compensation
(1) (2)
System Manipulated
deviation e variable y
- -
Process variable
Loop = Controlled
Setpoint w System
controller variable x
+
-
Figure 2: Feed forward control at the input (1) or the output (2) of the loop controller
If the disturbance variable cannot be measured but in its place another variable in the
system, this auxiliary variable is switched with a controller to the controller input. Auxiliary
variable feed forward reduces the influence of the disturbance variable, but does not
compensate for it completely.
Auxiliarx
variable x2
Compensation
Disturbance
variables z
System Manipulated
deviation e variable y
-
Process variable
Loop
Setpoint w Subsystem Subsystem = controlled
controller
+ variable x1
-
If it is injected at the controller input, compensation and controller are not independent of
each other. This means if the controller parameters are adjusted, the compensation has to
be adjusted as well.
If the feed forward control and the auxiliary feed forward control are not sufficient, if the
point of application of the disturbance variables cannot be determined with sufficient
accuracy, or if the subsystems cannot be modeled sufficiently, a two or multi-loop cascade
control is used.
When designing a cascade control, it is assumed that the lower level control loops (Loop
controller 2 in Figure 4 – a so-called slave controller) react faster than the higher level
control loops (Loop controller 1 in Figure 4 – a so-called master controller). The loop
controller is thus always optimized from the inside to the outside.
Cascade controls reduce the influence of the disturbance variable and speed up controlling
the reference variable. For the cascade control to be used, correspondingly measurable
variables have to exist.
e1 y1 = w2 e2 y2 x2
Loop Loop
w1 Subsytem Subsystem
controller 1 controller 2
+
- - x1
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 6
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
Ratio controls are used if the process variable is determined in dependence on another
variable. For example, the ratio control of two liquid flows that are to be mixed, which
means controlling the composition of the mixture, or the ratio control of combustion gas
and fresh air at a gas burner for optimum combustion. The setpoint of the process variable
w2 is calculated from the ratio Vw and the process variable x1.
rw w2 e2 y2 x2
Loop
System 2
controller 2
-
e1 Loop y1
w1 System 1 x1
controller 1
+ -
CONNECTION TO PROCESSES
The continuous output signal of the loop controller is not always read out directly to the
process. This is not advisable particularly in the case of great forces or large flows so that a
binary connection is implemented. To this end, the analog signal is converted into a binary
signal by means of pulse width modulation. In the CFC Library, the elementary
building block PULSEGEN [4] is provided.
By modulating the pulse width, the function PULSEGEN transforms the input variable INV
(= LMN manipulated value of the PID controller) into a pulse train with a constant period. It
corresponds to the cycle time that is used for updating the input variable and has to be
parameterized in PER_TM.
The duration of a pulse for each period is proportionate to the input variable. However, the
cycle parameterized with PER_TM is not identical with the processing cycle of the function
block PULSEGEN. As shown in Figure 6, the cycle PER_TM consists of several
processing cycles of the function block PULSEGEN. The number of PULSEGEN calls
for each PER_TM cycle represents a measure for the accuracy of pulse width modulation.
Figure 6: Time curve of input INV to output QPOS_P with PULSEGEN [4]
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 7
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
An input variable of 30% at 10 PULSEGEN calls for each PER_TM means the following:
– 1 at output QPOS for the first three calls of PULSEGEN (30% of 10 calls)
– 0 at output QPOS for seven additional calls of PULSEGEN (70% of 10 calls)
The pulse duration is recalculated at the beginning of each period. Through a sampling
ratio of 1:10 (CTRL_PID calls to PULSEGEN calls), the manipulated value accuracy is
limited in this example to 10%. Specified input values INV can be mapped only in a grid of
10% to a pulse length at output QPOS. Correspondingly, the accuracy increases with the
number of PULSEGEN calls for each PIDConL call. If PULSEGEN is called 100 times and
PIDConL only once, a resolution of 1% of the manipulated value range is reached.
!
Note: You have to program the down-scaling of the call frequency yourself.
LITERATURE
[1] Chien, Kun Li; Hrones, J. A.; Reswick, J. B. (1952): On the Automatic Control of
Generalized Passive Systems. In: Transactions of the American Society of Mechanical
Engineers, Vol. 74, Cambridge (Mass.), P. 175-185.
[2] Ziegler, J. G. and Nichols, N. B. (1942): Optimum settings for automatic controllers. In:
Trans. ASME, 64, S. 759-768.
[3] Kuhn, U.: Eine praxisnahe Einstellregel für PID-Regler: Die T-Summen-Regel.
Automatisierungstechnische Praxis, Nr. 5, 1995, S. 10-16. (Practice-Oriented Setting
Rule for PID Controllers: the T-Sum Rule. Automation Engineering Practice, No. 5,
Page 10 to 16)
[4] SIEMENS (2009): Process Control System PCS7: CFC Elementary Blocks.
5E33257529-AA. (http://support.automation.siemens.com/WW/view/en/36964334)
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 8
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
When implementing the temperature control, the following interlock conditions are to be
noted in the CFC.
– An actuator must only be operated if the main switch of the plant is switched on and the
emergency stop switch is enabled.
– The temperatures in the two reactor must not exceed 60°C
– The heaters of both reactors must only be started up if they are covered with liquid
(here: a minimum of 200ml in the reactor).
TRAINING OBJECTIVE
In this chapter, the student acquires:
– Knowledge for programming a continuous loop controller with pulse output and
interlocks
These instructions are based on the project PCS7_SCE_0105_Ueb_R1503_en.zip.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 9
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
PROGRAMMING
1. First, insert a new CFC in the folder Reactor R001. In this CFC, we then implement the
manual control for the heater.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 10
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
3. The A1T2H008 connections differ from those of A1T2H011 only regarding the input
and output signals (Pcs7DiIn and Pcs7DiOu) and in the last two reset conditions
(block ‘Or08‘). The conditions refer on the one hand to the minimum level of 200.0ml
and on the other hand the maximum temperature of 60.0°C.
Block Catalog/Folder
Pcs7DiIn (2x) Blocks/Channel
Or08 Blocks/LogicDi
CompAn02 (2x) Blocks/LogicAn
FlipFlop Blocks/LogicDi
Pcs7DiOu Blocks/Channel
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 11
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
4. Now, a new CFC is set up with the name ‘A1T2T001‘. In this chart, implement the
actual heater control for Reactor R001.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 12
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
Block Catalog/Folder
Pcs7AnIn Blocks/Channel
PIDConL Libraries/PCS7 APL V81/Blocks+Templates\Blocks/Control
PULSEGEN Libraries/CFC Library/ELEM400\Blocks/CONTROL
Pcs7DiOu Blocks/Channel
6. Now, implement the basic interconnections as shown in the table below. Compare
your result with the display.
Table 6: Input Interconnections in Chart ‘A1T2T001’
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 13
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 14
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
7. Now, we parameterize the gains and the integral time of the PID controller by setting
PIDConL.Gain = 2 and TI = 10.0.
Block Catalog/Folder
Or04 Blocks/LogicDi
CompAn02 (2x) Blocks/LogicDi
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 15
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
9. Now, connect output ‘Out‘ of block ‘Or04‘ to input ‘MV_ForOn‘ of block ‘PIDConL‘ and
check that ‘MV_Force‘ = 0.0. This sets up the value ‘MV_Force‘ at output ‘MV‘ of the
PID controller (manipulated value of controller) as soon as the interlocking conditions
are met.
10. Next, we parameterize local operation. To this end, we are utilizing the programming
mode. The programming mode is enabled by means of the input ‘AdvCoEn‘ and
activated by means of ‘AdvCoMst‘. Parameter ‘AdvCoMod‘ is set to ‘0‘ so that in the
local mode, the input ‘AdvCoMV‘ (invisible in the standard) is interpreted as
manipulated value and not as setpoint. Then switch ‘AdvCoMV‘ visible and set it to
100. This starts the heater in the local mode without control. .
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 16
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 17
P01-06_Control Loop_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P01-06, Edition 09/2015 | Digital Factory, DF FA
EXERCISES
The exercises implement what we learned from Theory and the Step By Step Instructions.
We will be using and expanding the existing multi-project from the step by step instructions
(PCS7_SCE_0106_R1503_en.zip).
To prepare for the next chapter, we are implementing the last missing function of reactor
R001 – the stirrer and the manual operation of the stirrer. The interlocking conditions are
as follows:
– An actuator must be operated only if the main switch of the plant is switched on and the
emergency stop switch is enabled.
– The stirrers of the two reactors should be started up only when they come into contact
with a liquid (here: 300ml minimum in the reactor).
In addition, further information about the PID controller, how it works and what parameters
can be set is available. However, it is not necessary for the control functionality.
TASKS
1. Implement stirrer A1T2S001 in the chart folder ‘Reactor R001‘. Use the same process
tag type for the stirrer as for the pumps. Connect the feedback and actuating signal.
Assign appropriate names to the blocks. Then add the interlocks as explained above.
2. Implement the manual control A1T2H007 for the stirrer you just created. Here,
implement the interlocking conditions as reset conditions.
3. Inform yourself about the inputs ‘ModLiOp‘, ‘AutModLi‘, ‘ManModLi‘ of the block
‘PIDConL‘. To this end, with the function key ‘F1‘ call Help for block ‘PIDConL‘. Select
‘PIDConL operating modes‘ and then the manual or automatic mode.
4. If you want to learn more about the inputs ‘SP_LiOp‘, ‘SP_ExtLi‘, ‘SP_IntLi‘, etc., in
Help under tab ‘Search‘ enter the word Setpoint Input. Under the suggested title
‘Setpoint Input – Internal/External‘ information is provided.
5. What is the purpose of the parameters MV_HiLim and MV_LoLim? On your own,
search Help for information regarding these inputs.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 18
P01-06_Control Loop_V8.1_S0915_EN.docx