PidTemp MultiZone DOC V11 en
PidTemp MultiZone DOC V11 en
PidTemp MultiZone DOC V11 en
with "PID_Temp”
Siemens
SIMATIC S7-1200/S7-1500 and STEP 7 (TIA Portal) Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/109740463 Support
Legal information
Legal information
Use of application examples
Application examples illustrate the solution of automation tasks through an interaction of several
components in the form of text, graphics and/or software modules. The application examples are
a free service by Siemens AG and/or a subsidiary of Siemens AG (“Siemens”). They are non-
binding and make no claim to completeness or functionality regarding configuration and
equipment. The application examples merely offer help with typical tasks; they do not constitute
customer-specific solutions. You yourself are responsible for the proper and safe operation of the
products in accordance with applicable regulations and must also check the function of the
respective application example and customize it for your system.
Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have the
application examples used by technically trained personnel. Any change to the application
examples is your responsibility. Sharing the application examples with third parties or copying the
application examples or excerpts thereof is permitted only in combination with your own products.
The application examples are not required to undergo the customary tests and quality inspections
of a chargeable product; they may have functional and performance defects as well as errors. It is
your responsibility to use them in such a manner that any malfunctions that may occur do not
result in property damage or injury to persons.
Disclaimer of liability
Siemens shall not assume any liability, for any legal reason whatsoever, including, without
limitation, liability for the usability, availability, completeness and freedom from defects of the
application examples as well as for related information, configuration and performance data and
any damage caused thereby. This shall not apply in cases of mandatory liability, for example
under the German Product Liability Act, or in cases of intent, gross negligence, or culpable loss of
life, bodily injury or damage to health, non-compliance with a guarantee, fraudulent
non-disclosure of a defect, or culpable breach of material contractual obligations. Claims for
damages arising from a breach of material contractual obligations shall however be limited to the
© Siemens AG 2019 All rights reserved
foreseeable damage typical of the type of agreement, unless liability arises from intent or gross
negligence or is based on loss of life, bodily injury or damage to health. The foregoing provisions
do not imply any change in the burden of proof to your detriment. You shall indemnify Siemens
against existing or future claims of third parties in this connection except where Siemens is
mandatorily liable.
By using the application examples you acknowledge that Siemens cannot be held liable for any
damage beyond the liability provisions described.
Other information
Siemens reserves the right to make changes to the application examples at any time without
notice. In case of discrepancies between the suggestions in the application examples and other
Siemens publications such as catalogs, the content of the other documentation shall have
precedence.
The Siemens terms of use (https://support.industry.siemens.com) shall also apply.
Security information
Siemens provides products and solutions with industrial security functions that support the secure
operation of plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is necessary
to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept.
Siemens’ products and solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems, machines
and networks. Such systems, machines and components should only be connected to an
enterprise network or the Internet if and to the extent such a connection is necessary and only
when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.
For additional information on industrial security measures that may be implemented, please visit
https://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure.
Siemens strongly recommends that product updates are applied as soon as they are available
and that the latest product versions are used. Use of product versions that are no longer
supported, and failure to apply the latest updates may increase customer’s exposure to cyber
threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed
at: https://www.siemens.com/industrialsecurity.
Table of contents
Legal information ..................................................................................................... 2
1 Task................................................................................................................. 5
1.1 Overview ........................................................................................... 5
2 Solution........................................................................................................... 6
2.1 Overview ........................................................................................... 6
2.2 Hardware and software components .................................................. 8
2.2.1 Validity .............................................................................................. 8
2.2.2 Components used.............................................................................. 8
3 Basics ........................................................................................................... 10
3.1 Pretuning ......................................................................................... 10
3.1.1 Adjusting the delay time ................................................................... 10
3.1.2 Temporarily switching off cooling ..................................................... 10
3.1.3 Procedure........................................................................................ 10
3.2 Fine tuning....................................................................................... 12
3.2.1 Temporary tuning offset for heating/cooling controller ...................... 12
3.2.2 Synchronizing several fine tunings ................................................... 12
Procedure........................................................................................ 12
4 Mode of Operation ........................................................................................ 14
4.1 General overview ............................................................................. 14
© Siemens AG 2019 All rights reserved
1 Task
1.1 Overview
Introduction
For a multi-zone control several subsections, so called zones, of a plant are
simultaneously controlled at different temperatures. The mutual impact on the
temperature zones by thermal coupling is characteristic for multi-zone control. This
means that the actual value of a zone can influence the actual value in another
zone by heat coupling. It depends on the structure of the plant and the selected
operating points of the zones how heavily the zones influence each other.
An example of a multi-zone control is an extrusion plant, as it used in plastics
processing, among others.
Mode of Operation
The material is filled in with the help of a funnel (for example, plastic granulate).
The screw conveyor transports the material through the heated and/or cooled
screw cylinder. The material is melted via different temperature zones (by heating,
friction and shearing). In parts, this creates so much heat that the material has to
be cooled. A forming aperture at the end of the extruder (outlet nozzle) presses the
melt into shape. Before shaping, the material has to be cooled.
© Siemens AG 2019 All rights reserved
The control parameters of the individual zone controllers in the application example
are determined simultaneously, despite the temperature influence on the zones.
2 Solution
2.1 Overview
Schematic layout
The figure below shows you a schematic illustration of the main components of this
solution.
Figure 2-1
SP1 PID_Temp
1
SP3 PID_Temp
3
SP2 PID_Temp
© Siemens AG 2019 All rights reserved
Configuration
In order to control the individual zones, the technology object "PID_Temp” of the
SIMATIC S7-1200 controller family or SIMATIC S7-1500 is used.
This technology object presents a continuous PID controller with integrated tuning
and is designed especially for temperature control. "PID_Temp” is suitable for
heating or heating/cooling applications. Two outputs are available for this purpose,
one for heating and one for cooling.
When using the technology object "PID_Temp” in multi-zone controllers, each
temperature zone is controlled by its own "PID_Temp” instance.
To keep the influence of neighboring zones as low as possible, you can
synchronize the individual "PID_Temp” controller instances in the two tuning types
"pretuning” and "fine tuning”.
Note Pure cooling control is realized with the technology object "PID_Compact” and
the "inverting the control direction” option.
More information on the control types can be found in the function manual
"SIMATIC S7-1200, S7-1500 PID control” \3\.
https://support.industry.siemens.com/cs/ww/en/view/108210036
Advantages
The solution presented here offers the following advantages:
• Overview of factors you have to observe for a multi-zone control.
• Overview of options to use the technology object "PID_Temp” and to determine
the control parameters.
• Time and cost savings through synchronized tuning.
• Expandability: The solution is introduced on the example of a multi-zone
controller with three zones. However, you can expand the application as
desired.
These blocks are designed for three zones. Chapter 5.2 and the comments in the
program code show you how to expand zones.
Zone 1 in the present example is designed as pure heating controllers.
With the configuration, you can select whether the technology object "PID_Temp”
is used as heating or as heating/cooling controller.
The program code included can be used for both controller designs.
For the real operation, you have to adjust the application example to your actuators
used and the actual value sensors. Basic knowledge is assumed.
Assumed knowledge
The following basic knowledge is required and is not explicitly discussed in this
description:
• Control engineering
• STEP 7 (TIA Portal)
• The SCL/LAD/FBD programming languages.
The application example has been created with the following components.
Hardware components
Table 2-1
Component Qty. Article number Note
SIMATIC S7-1200 1 6EP1332-1SH71 Any other SIMATIC power
POWER MODULE supply with 24V DC can be
PM1207 CONTROLLED used.
POWER SUPPLY INPUT:
120/230 V AC OUTPUT:
© Siemens AG 2019 All rights reserved
24V/2.5 A DC
SIMATIC S7-1200, CPU 1 6ES7215-1AG40- As of firmware V4.2.
1215C, compact CPU, 0XB0 Alternatively, any other S7-
DC/DC/DC, 2 PROFINET 1200 CPU as of firmware
Port, onboard I/O: 14 DI V4.2 can also be used.
24VDC; 10 DO 24VDC;
0,5A; 2 AI 0-10V DC, 2
AO 0-20mA DC, power
supply: 20.4-28.8V DC,
125 kB program/data
storage
SIMATIC S7-1500 1 6ES7511-1CK00- As of firmware V2.0.
compact CPU 1511C-1 0AB0 Alternatively, any other S7-
PN, central module with 1500 CPU as of firmware
175 kB main memory for V2.0 can also be used.
program and 1 MByte for
data, 16 digital inputs, 16
digital outputs, 5 analog
inputs, 2 analog outputs,
6 fast counter, 1 interface:
PROFINET IRT with 2
port switch, 60 NS bit
performance, incl. push-in
front plug, SIMATIC
memory card required
SIMATIC S7, memory 1 6ES7954-8LF02-0AA0 Required when using a S7-
card for S7-1x 00 1500 CPU.
CPU/SINAMICS, 3, 3 V
flash, 24 MByte
Note Other hardware components for controlling real actuators and temperature
acquisition can be found in:
• System Manual "SIMATIC S7 S7-1200 Programmable controller” in
Chapter A "Technical data” (\4\)
https://support.industry.siemens.com/cs/ww/en/view/109764129
• Manual "SIMATIC S7-1500/ET 200MP Automation system In a nutshell” (\10\)
https://support.industry.siemens.com/cs/ww/en/view/109481357
• TIA Selection Tool (\5\)
http://w3.siemens.com/mcms/topics/en/simatic/tia-selection-tool/Pages/tab.aspx
• Hardware catalog in the TIA Portal
Software components
Table 2-2
Component Qty. Article number Note
STEP 7 Basic V15.1 1 6ES7822-0A.05-.. Minimal license for configuring
the S7-1200
STEP 7 1 6ES7822-1..05-.. Enables configuration of S7-
Professional V15.1 1200 and S7-1500
The following table contains all files and projects used in this example.
Table 2-3
Component Note
109740463_PidTemp_MultiZone_PROJ_v11.zip This zip file contains the STEP 7
project.
109740463_PidTemp_MultiZone_DOC_v11_en.pdf This document.
3 Basics
This chapter discusses the tuning types of the technology object "PID_Temp” and
how to use them, in order to achieve a stable setting of your multi-zone controller
on the basis of the function manual "SIMATIC S7-1200, S7-1500 PID control (\3\),
chapter "Multi-zone controlling with PID_Temp”.
3.1 Pretuning
The initial commissioning of a plant usually starts by carrying out a pretuning to
perform a first setting of the PID parameters and to control the operating point. The
pretuning for multi-zone controllers is often done simultaneously for all zones.
Carry out the pretuning for heating separate from the pretuning for cooling in order
to decrease the mutual influence of thermal coupling between the zones during the
tuning.
Only start the pretuning for cooling the controllers with active cooling and PID
parameter switching when all zones have completed the pretuning for heating and
their operating point has been reached.
With the pretuning for heating, a jump on the output value heating is returned, the
© Siemens AG 2019 All rights reserved
PID parameters for heating are calculated and afterwards the setpoint is controlled
in automatic mode.
The "AdaptDelayTime” tag determines the adjustment of the delay time for heating
on the operating point.
With the "AdaptDelayTime” = 0 default, the delay time is only determined during
the step "Determine turning point heating ("PIDSelfTune.SUT.State” = 300).
Only for "AdaptDelayTime” = 1 the delay time is additionally checked by
temporarily switching off the heating on the operating point and, if necessary,
adjusted ("PIDSelfTune.SUT.State” = 1000).
This is not desired for the multi-zone control because the adjustment of the delay
time in this phase may be false due to the thermal coupling of neighboring zones.
This is why you have to make sure that the adjustment of the delay time is disabled
for all PID_Temp instances ("PIDSelfTune.SUT.AdaptDelayTime” = 0).
3.1.3 Procedure
Note The heating or cooling actuator is too weak, if the setpoint cannot be reached
permanently for a zone!
Before starting the tuning, specify a negative tuning offset cooling that is
smaller than that of the PID output value ("PidOutputSum”) on the setpoint in
the stationary state.
• Offset for heating output ("PIDSelfTune.TIR.OutputOffsetHeat”) for fine tuning
cooling
Before starting the tuning, specify a positive tuning offset heating that is larger
than that of the PID output value ("PidOutputSum”) in the stationary state.
The specified offset is than balanced out by the PID algorithm so that the actual
value on the setpoint remains. For the PID output value to fulfil the above
mentioned prerequisites, you can increase the offset. With the level of the offset,
the PID output value can therefore be adjusted accordingly so that it fulfils the
above mentioned prerequisites.
In order to avoid larger overshoots of the actual value when the offset is specified,
it can also be increased in several steps.
If "PID_Temp” leaves the "Fine tuning” mode, the tuning offset is reset.
Procedure
This is how you can make sure that all controllers have reached their setpoint
before the actual tuning steps start. This prevents mutual influence of thermal
coupling between the zones during the tuning.
For controllers, where you want to carry out the fine tuning of their zones
simultaneously, proceed as follows:
1. Set "PIDSelfTune.TIR.WaitForControlIn” = TRUE for all controllers. These
controllers have to be in automatic mode with "PIDSelfTune.TIR.RunIn” =
FALSE.
2. Set the desired setpoints with the "Setpoint” parameter and start the fine tuning
for all controllers.
3. Wait until "PIDSelfTune.TIR.ControlInReady” = TRUE is set for all controllers.
4. Set "PIDSelfTune.TIR.FinishControlIn” = TRUE for all controllers.
Thus, all controllers start the actual tuning simultaneously with the calculation of
the standard deviation (filtering of noise of actual value signal).
© Siemens AG 2019 All rights reserved
4 Mode of Operation
4.1 General overview
Figure 4-1 shows the block diagram of a multi-zone controller with three zones.
Each zone is controlled by an individual instance of the technology object
"PID_Temp”. The individual zone controller "PID_Temp” in the application example
is configured as follows:
• Zone 1: Heating controller
• Zone 2: Heating/cooling controller
• Zone 3: Heating/cooling controller
The application example includes the simulation of the controlled system that
replicates the thermal coupling of the zones. The controlled system simulation is
described in more detail in chapter 4.2.
Figure 4-1
TempAmbient
PT1
2 Kint
KFw
KBw
heat2 PT1
SP2 PID_Temp Temp2
cool2 - + - PT2 +
2
PT1
2 Kint
KFw
KBw
heat3
PT1
SP3 PID_Temp Temp3
cool3 - + - PT2 +
3
PT1
2 Kint
Program overview
Figure 4-2 shows the call structure of the blocks for a multi-zone controller with
three zones, a controlled system simulation and a synchronized sequence for
pretuning and fine tuning.
Figure 4-2
Organization Controller Instance data blocks
blocks
Inst
PID_Temp
PidTemp1
Inst
PID_Temp
PidTemp2
Cyclic
Inst
Interrupt PID_Temp
PidTemp3
[OB 30]
© Siemens AG 2019 All rights reserved
Sim
Multizone
Multizone
Waiting
Sut
ModeDe
activate
Multizone
Waiting
Tir
TirOffset
TirTuning
Tags
User program Mode
ModeDe
activate
All instructions and functions are called in the interval of the "CyclicInterrupt”
interrupt OB. For each controller zone the technology object "PID_Temp” with
individual instance DB ("InstPidTempX”) is called.
Note The configuration and commissioning interface is only available to you when you
call the technology object "PID_Temp” as individual instance.
The FB "SimMultizone” simulates the temperature curves of the coupled zones and
is switched according to the specification of Figure 4-1 with the calls of
"PID_Temp”.
As of STEP 7 the instance DBs of the "PID_Temp” are transferred to the InOut
interface of the function blocks as parameter instance.
This feature is used for the synchronized tuning processes:
• FB "MultizoneSut” starts a simultaneous pretuning heating for all zones,
followed by a simultaneous pretuning cooling (if configured).
• FB "MultizoneTir” synchronizes the fine tuning of all selected zones (according
to energy type specification heating or cooling, depending on zone).
4.2 FB "SimMultizone”
The FB "SimMultizone” simulates the temperature curves of the coupled zones and
is switched according to the specification of Figure 4-1 with the calls of
"PID_Temp”.
+
TAmbient +
+
Heat conductor model
y1 y2 y3
+ + +
uInp1 uInp2 uInp3
+ + +
-1 -1 -1
Actuators
The model can be expanded to any number of zones by copying the pattern
(Figure 4-3).
In equation 4.2.3 it has to be observed that for the peripheral zones, the previous
zone or the following zone is omitted and the terms are therefore to be set to z-1 or
z+1 here = 0.
Through the coupling factors K FW and KBW (0 to 1), the thermal influence to
neighboring zones can be varied.
You can vary the static end value of the zone temperatures through the internal
coupling factors Kint (0 to 1) and the gain factors of the PTx delay elements.
Chronological sequence
In terms of time, a test jump of 100% in zone 2, for example, is divided according to
t seconds to the neighboring zones as follows:
Wie schaut
Figure 4-4 es zeitlich aus?
Heizsprung Zone2 100
schwache Vorwärts- und Rückwärtskopplung
250
200
GainPT2 = 5,0
t=15s
150 Kint = 0,2
t=30s
100 t=45s
KFW = 0,2
t=60s
KBW = 0,2
50
0
Zone1 Zone2 Zone3
150
t=30s KFW = 0,3
100 t=45s KBW = 0,1
50 t=60s
0
Zone1 Zone2 Zone3
SimMultizone
© Siemens AG 2019 All rights reserved
minReached Bool
zones
Array[1..#MAX] of "typeZone" Array[1..#MAX] of "typeZone"
1
The local constant “MAX” has to match the number of zones of the multi-zone controller.
Transport velocity
The coupling factors in the application example depend on the transport "velocity”
(0..100%) of the extruder granulate.
Due to the increase of the transport velocity, an increase of the forward coupling
and a reduction of the backward coupling is assumed.
Figure 4-5
K_FOR_MAX KFW
0,3
0,2 K_INT KInt
100 v[%]
© Siemens AG 2019 All rights reserved
25 50 75
Through the constants "K_BACK_MIN”, "K_INT” and "K_FOR_MAX” the influence
of the transport velocity to coupling factors and therefore the energy flow, can be
changed accordingly.
The controlled system properties of the simulated coupled temperature curves can
be adjusted via the local constants of the FB "SimMultizone”.
Table 4-2
Name Data type Default Comment
value
MAX DInt 3 Number of the zones
TMLAG_HEATER Real 5.0 Time constant of the actuator delay heating (PT1) in
seconds
TMLAG_COOLER Real 10.0 Time constant of the actuator delay cooling (PT1) in
seconds
GAIN_ZONE Real 5.0 Gain factor temperature curve (PT2)
TMLAG1_ZONE Real 20.0 Time constant 1 temperature curve (PT2)
TMLAG2_ZONE Real 3.0 Time constant 2 temperature curve (PT2)
K_BACK_MIN Real 0.1 Minimum coupling factor backward (to previous zone)
K_FOR_MAX Real 0.3 Maximum coupling factor forward (to next zone)
K_INT Real 0.2 Internal coupling factor (feedback)
PT2_MAX_OUT Real 1000.0 Maximum output limit temperature curve (PT2)
PT2_MIN_OUT Real -1000.0 Minimum output limit temperature curve (PT2)
4.3 FB "MultizoneSut”
The FB "MultizoneSut” enables the simultaneous pretuning of all zones (first
heating, then cooling with heating/cooling controllers).
It is called in the interrupt OB in which the controllers "PID_Temp” are also called.
Table 4-3: Parameters of MultizoneSut
Name P type Data type Comment
done OUT Bool Error free processing of the block
busy OUT Bool Block being processed
error OUT Bool FALSE: No errors
TRUE: Error in block, "status” specifies the error code.
status OUT Word Error code:
0: no error
16#8000: At least for one zone controller the pretuning
heating cannot be enabled.
16#8001: At least one zone controller has completed
the pretuning heating with error.
16#8002: At least one zone controller has completed
the pretuning cooling with error.
start IN_OUT Bool Starts the processing and is reset after completion.
© Siemens AG 2019 All rights reserved
reset IN_OUT Bool Resets the block and is set to FALSE after completion.
zones IN_OUT Array[*] of PLC data type with the required interface parameters for
"typeZone" each temperature zone
(the size of the field is read.)
Only the parameters "*[x].pidTemp” are accessed.
instPidTemp1 IN_OUT PID_Temp Technology instance transfer for zone 1
instPidTemp2 IN_OUT PID_Temp Technology instance transfer for zone 2
instPidTemp3 IN_OUT PID_Temp Technology instance transfer for zone 3
MultizoneSut
done Bool
busy Bool
error Bool
status Word
start
Bool Bool
reset
Bool Bool
zones
© Siemens AG 2019 All rights reserved
instPidTemp1
PID_Temp PID_Temp
instPidTemp2
PID_Temp PID_Temp
instPidTemp3
PID_Temp PID_Temp
Figure 4-6
Start/Stop
#start ?
Ja
Disable determination of delay time PIDSelfTune.SUT.AdaptDelayTime := 0;
Pretuning DisableCooling = TRUE;
Disable cooling of contdrollers Heating Heat.EnableTuning := TRUE;Cool. EnableTuning := FALSE;
simulateous pretuning heating Mode := 1; ModeActivate := TRUE;
No
Are all controllers in „pretuning“ error = TRUE;
#state = 1 ?
mode? status := 16#8000;
Yes
1
Wait until all zones have successfully completed #SUT.state ? error = TRUE;
the pretuning heating status := 16#8001;
9900
controller?
Heat.EnableTuning := FALSE;
Simultaneous pretuning cooling Pretuning Cool.EnableTuning := TRUE;
(for all heating/cooling controllers) Cooling Mode := 1; ModeActivate := TRUE;
1
Wait until all zones have successfully error = TRUE;
#SUT.state ?
completed the pretuning cooling status := 16#8002;
9900
Start/Stop
Prerequisite for the pretuning heating is that the actual value is not too near the
setpoint. This is why it is a good idea to start FB "MultizoneSut" when all controller
instances "PID_Temp” are in the "inactive” operating state.
When setting the "start” input the simultaneous pretuning heating of the multi-zone
controller is started with the required preconditions from chapter 3.1:
• Disabling the specification of the delay time
PIDSelfTune.SUT.AdaptDelayTime:= 0
• Disabling the cooling of the controller: "DisableCooling” = TRUE
• Simultaneous pretuning for heating:
Heat.EnableTuning := TRUE; Cool.EnableTuning := FALSE;
Mode := 1; ModeActivate := TRUE;
When the controller instances do not report an error and the pretuning of all zones
has been completed successfully, the cooling for all heating/cooling controllers is
re-enabled ("DisableCooling” = FALSE).
Now it is waited until all zones have reached their operating point.
For all heating/cooling controllers the synchronous pretuning cooling is then
started.
The synchronized pretuning of the multi-zone controller is stopped when it is
successfully completed. This is continuously signaled by the "done” bit, until "start”
is reset or the message is deleted with "reset”.
4.4 FB "MultizoneTir”
The FB "MultizoneTir” enables the synchronized fine tuning of selected zones with
energy type specification (heating or cooling).
It is called in the interrupt OB in which the controllers "PID_Temp” are also called.
Table 4-4: Parameters of MultizoneTir
start IN_OUT Bool starts the processing and is reset after completion.
reset IN_OUT Bool resets the block and is set to FALSE after completion
zones IN_OUT Array[*] of PLC data type with the required interface parameters for
"typeZone" controller calls
instPidTemp1 IN_OUT PID_Temp Technology instance transfer for zone 1
instPidTemp2 IN_OUT PID_Temp Technology instance transfer for zone 2
instPidTemp3 IN_OUT PID_Temp Technology instance transfer for zone 3
MultizoneTir
done Bool
busy Bool
error Bool
status Word
start
Bool Bool
reset
Bool Bool
zones
© Siemens AG 2019 All rights reserved
instPidTemp1
PID_Temp PID_Temp
instPidTemp2
PID_Temp PID_Temp
instPidTemp3
PID_Temp PID_Temp
Figure 4-7
Start/Stop
#start ?
Yes
Controlling the setpoint with the existing PID parameters PIDSelfTune.TIR.RunIn := FALSE;
Preperation
Wait until the operating point has reached the zones to be PIDSelfTune.TIR.WaitForControlIn := TRUE;
synchronized
No
error = TRUE;
Automatic mode? #state = 3 ?
status := 16#8000;
Yes
OutputOffsetCool <0
Determining tuning := 2 * PidOutputSum?
>0 OutputOffsetHeat
PidOutputSum? := 2 *
offset PidOutputSum PidOutputSum
>0 <0
Simultaneous Heat.EnableTuning := TRUE; Heat.EnableTuning := FALSE;
TIR (heating) Cool.EnableTuning := FALSE; TIR (cooling) Cool.EnableTuning := TRUE;
fine tuning of all zones Mode := 2; ModeActivate := TRUE; Mode := 2; ModeActivate := TRUE;
PIDSelfTune.TIR.FinishControlIn
Synchronize all zones Synchronization
:= TRUE;
1
Wait until all zones have successfully completed #TIR.state ?
error = TRUE;
the fine tuning status := 16#8002;
9900
Start/Stop
Before starting the synchronous fine tuning, specify the energy type to be
optimized for each zone controller via the InOut tag "zones[x].tuningMode”:
• 0: No fine tuning
• 1: Heating
• 2: Cooling
All controllers where fine tuning ("tuningMode” = 1 or 2) is to be performed have to
be in automatic mode as a precondition.
Setting the "start” input creates the required preconditions for synchronizing
several fine tunings from chapter 3.2.2:
• It is controlled to the setpoint with the exiting PID parameters:
"PIDSelfTune.TIR.RunIn” = FALSE
• During the fine tuning it is waited that the setpoints of the other controllers to
be optimized are reached before the standard deviation is calculated:
"PIDSelfTune.TIR.WaitForControlIn” = TRUE
When the controllers to be optimized are in automatic mode, it is waited until they
have reached their operating point. This is required to determine the energy type of
the controller in the operating point.
If a controller is not in the selected energy type, an according offset is calculated
and output on the opposite output of the controller in order to get to the selected
energy type.
Example:
The controller is in heating mode, but it is to carry out the fine tuning cooling.
Therefore an additional offset is set on the controller’s heating output so that the
controller has to cool to reach the setpoint.
Afterwards the fine tunings for each zone are started.
When all controllers to be optimized have reached their setpoint, the actual fine
tuning of all zones start synchronously with the respective calculation of the
standard deviation.
The synchronized fine tuning of the multi-zone controller is concluded when it is
successfully completed. This is continuously signaled by the "done” bit, until "start”
is reset or the message is deleted with "reset”.
4.5 FB "Waiting”
When the specified controller difference tolerance of the "PID_Temp” instances is
maintained, the FB "Waiting” waits for a specified time (number of cycles).
It is used in FB "MultizoneSut” and in FB "MultizoneTir”.
Table 4-5: Parameters of waiting
Name P type Data type Comment
tolerance IN Real Tolerance specification of the control differences in %
© Siemens AG 2019 All rights reserved
2
The local constant “MAX” has to match the number of zones of the multi-zone controller.
Waiting
done Bool
busy Bool
start
Bool Bool
pidTemp1
PID_Temp PID_Temp
pidTemp2
© Siemens AG 2019 All rights reserved
PID_Temp PID_Temp
pidTemp3
PID_Temp PID_Temp
Figure 4-8
Start/Stop
start ?
yes
#done := FALSE;
Initialization #busy := TRUE;
#statCounter := 0.0;
no
Check cycles counter > cycles ?
ja
#busy := FALSE;
#done := TRUE;
Ready
#start := FALSE;
#statCounter := 0.0;
© Siemens AG 2019 All rights reserved
Start/Stop
4.6 FC "TirOffset”
The FC "TirOffset” calculates the tuning offset for heating/cooling controller
"PID_Temp” to enable fine tuning for the opposite energy type (heating or cooling).
It is called in FB "MultizoneTir” for each zone.
Table 4-6: Parameters of TirOffset
TirOffset
USInt tuningMode
© Siemens AG 2019 All rights reserved
Real factor
pidTemp
PID_Temp PID_Temp
Figure 4-9
Start/Stop
Example:
The controller is to carry out the fine tuning heating, but is in cooling mode. This is
why a higher offset is returned in the cooling output so that the controller has to
heat in order to reach the setpoint and to determine the parameters for heating
from the oscillation.
The offset on the controller is reset after completing the fine tuning.
4.7 FC "TirTuningMode”
FC "TirTuningMode” sets the tuning bits according to the desired energy type of
the fine tuning according to Table 4-8.
It is called in FB "MultizoneTir” for each zone.
Table 4-7: Parameter of TirTuningMode
TirTuningMode
USInt tuningMode
pidTemp
PID_Temp PID_Temp
© Siemens AG 2019 All rights reserved
Table 4-8
tuningMode Heat.EnableTuning Cool.EnableTuning
0 (none) FALSE FALSE
1 (heating) TRUE FALSE
2 (cooling) FALSE TRUE
4.8 FC "DeactivateMode”
FC "DeactivateMode” resets the input bit "ModeActivate” of all "PID_Temp” calls.
It is used in FB "MultizoneSut” as well as in FB "MultizoneTir”.
Table 4-9: Parameters of DeactivateMode
DeactivateMode
DInt max
zones
Array[*] of "typeZone" Array[*] of "typeZone"
© Siemens AG 2019 All rights reserved
4.9 FB "StopWatch”
The auxiliary function FB "StopWatch” measures the recovery time of disturbance
variables.
It is called in the interrupt OB in which the controller "PID_Temp” is also called.
Table 4-10: Parameters of StopWatch
StopWatch
start
Bool Bool
instPidTemp
PID_Temp PID_Temp
After starting the FB "StopWatch” the block will wait until the proportional control
deviation leaves the tolerance band "tolerance”. From this time on the
"recoveryCycles” are counted until the control deviation is again within the
tolerance band for the number of cycles waited after presenting the FB "Waiting”.
As a result, the recovery time "time” is calculated:
𝑡𝑖𝑚𝑒 = (𝑟𝑒𝑐𝑜𝑣𝑒𝑟𝑦𝐶𝑦𝑐𝑙𝑒𝑠 − 𝑐𝑦𝑐𝑙𝑒𝑠) ∗ 𝑐𝑦𝑐𝑙𝑒
The data block "Tags” includes the parameters to transfer the block interfaces and
looks as follows:
Table 4-11
Name Data type Description
simMultizone "typeSimMultizoneIn" Includes the individual parameters for transferring the
interface to the FB "SimMultizone”
multizoneSut "typeMultizoneIn" Includes the input parameters for the pretuning of the
multi-zone controller (FB "MultizoneSut")
multizoneTir "typeMultizoneIn" Includes the input parameters for the fine tuning of the
multi-zone controller (FB "MultizoneTir")
zones Array[1..3] 3 of "typeZone" Includes interface parameters for the transfer to the
block calls, depending on the number of zones.
stopWatch "typeWaitingIn" Includes the interface parameters for the recovery time
calculation
© Siemens AG 2019 All rights reserved
4.10.2 "typeSimMultizoneIn"
The PLC data type "typeSimMultizoneIn” includes the individual parameters for the
interface transfer to the FB "SimMultizone” (independent from the number of
zones).
Table 4-12
Name Data type Description
velocity SInt Transport velocity of the extruder screw in %
ambTemp Real Ambient temperature
reset Bool Resets all relevant parameters
4.10.3 "typeMultizoneIn"
The PLC data type "typeMultizoneIn” includes the input parameters for transferring
the interface to the FB "MultizoneSut” or FB "MultizoneTir”.
Table 4-13
Name Data type Description
start Bool Starts the processing and is reset after completion.
reset Bool Resets the block and is set to FALSE after completion.
3
The upper limit of the field has to match the number of zones of the multi-zone controller.
4.10.4 "typeZone”
PLC data type "typeZone" includes the parameters of the block interfaces for each
temperature zone.
Table 4-14
Name Data type Description
pidTemp "typePidTemp" PLC data type with the required interface parameters
for the "PID_Temp” controller call.
simMultizone "typeSimMultizoneArray" PLC data type with the input parameters for
temperature simulation (FB "SimMultizone”).
tuningMode USInt Energy type specification for fine tuning
(0 = none, 1 = heating, 2 = cooling).
4.10.5 "typePidTemp"
PLC data type "typePidTemp” includes the required interface parameters for the
"PID_Temp” controller call.
Table 4-15
Name Data type Description
© Siemens AG 2019 All rights reserved
4.10.6 "typeSimMultizoneArray"
4.10.7 "typeWaitingIn”
PLC data type "typeWaitingIn" includes the input parameters for the FBs "Waiting”
and "StopWatch”.
Table 4-17
Name Data type Description
start Bool Starts the processing and is reset after completion.
tolerance Real Tolerance specification of the control differences in %
cycles UInt Specification of the number of waiting cycles
2. Open the "Controller type” menu in the basic settings and select the temperature
© Siemens AG 2019 All rights reserved
Enable the specification of the mode for the first start und select "Inactive”.
3. Open the input/output parameter and specify whether the controller is a heating or
heating/cooling controller ("Activate cooling”).
Select the signal course for each interface (floating-point number/analog/PWM).
For more information see Input or Output Value Heating or Cooling (\3\).
Function Manual: SIMATIC S7-1200, S7-1500 PID control
https://support.industry.siemens.com/cs/ww/en/view/108210036
When using the simulation block "SimMultizone” use input as floating-point number
("Input”). The manipulated variable as floating-point number is also output when
selecting "OutputX_PWM” or "OutputX_PER (analog)”.
No. Action
4. Specify the actual value limits in the actual value settings in such a way that they
are not violated. Otherwise, in the event of a violation, the tuning is cancelled.
Specify the actual value scaling if you are using the analog input signal
"Input_PER”.
5. Open the Basic settings of output and select the "Switch PID parameter for
heating/cooling” as method for heating/cooling controllers.
Only when this method is selected, is pretuning and fine tuning for cooling made
available.
© Siemens AG 2019 All rights reserved
Make the settings for PWM limits in the advanced settings if you have selected the
pulse width modulation output signal "OutputX_PWM”.
Table 5-2
No. Action
1. Call the technology instruction "PID_Temp” V1.1 in the interrupt.
No. Action
3. Adjust the upper limit of the "zones” tag in DB "Tags”.
6. Adjust the local constant "MAX” of the FBs "Waiting” and "SimMultizone” to the
number of zones.
7. Update the block call and switch the newly created individual instance of the
"PID_Temp” to the InOut parameter of the FBs "MultizoneSut” and "MultizoneTir”
© Siemens AG 2019 All rights reserved
and loop through the call of the FB "Waiting” to the FBs "MultizoneSut” and
"MultizoneTir”.
Furthermore, you have to expand the program code by the added zone, according
to the comments in the FBs "MultizoneSut”, "MultizoneTir” and "Waiting”.
IP-Adresse: 192.168.0.2
IP-Adresse: 192.168.0.242 Subnetz: 255.255.255.0
IP-Adresse: 192.168.0.1 Subnetz: 255.255.255.0
Subnetz: 255.255.255.0 S7-1500
PC/PG
24 V DC
S7-1200
L+ M
STEP 7
(TIA Portal)
© Siemens AG 2019 All rights reserved
L+ M
PROFINET IE
24 V DC
Note Always follow the installation guidelines in order to connect all the components.
• Manual SIMATIC S7-1200 (\4\)
• Manual SIMATIC S7-1500 (\8\)
Table 6-1
No. Action Remark
8. Wire and connect the SIMATIC S7-1200 or See S7-1200 manual (\4\)
S7-1500 as described. or S7-1500 manual (\8\)
9. Plug the empty memory card into the S7-1500 See Chapter "Plug/Pull SIMATIC Memory
CPU (Table 2-1). Card on the CPU” (S7-1500 manual \8\)
10. Connect the SIMATIC PM 1207 power supply -
module to the low voltage network (230 V).
6.2 Commissioning
This chapter describes the steps for installing the sample code.
The LAN network card of the programming device requires a static IP address to
configure the controller.
The configuration of the LAN connection is described below.
Table 6-2
No. Action Remark
11. Click "Start > Control Panel > Network and
Sharing Center > Change adapter settings”
to open the network connections.
• Select your network connection.
• Right-click to open the properties.
© Siemens AG 2019 All rights reserved
Below, the successful installation of STEP 7 (minimum "Basic” license for SIMATIC
S7-1200 or "Professional” license for SIMATIC S7-1500) is assumed.
Table 6-4
No. Action Remark
15. Set the IP address via the display if using the See Figure 6-1 or "Display of CPU” (\8\)
S7-1500 CPU. When using the S7-1200, the IP address is
transferred with the project.
16. Unzip the application example from Siemens -
Industry Online Support (\2\) and open the
project.
17. In order to compile the configuration of the
S7-1200 or S7-1500 CPU, right-click on the
CPU and click on the "Compile > Hardware
and software (only changes)” command.
© Siemens AG 2019 All rights reserved
Note For more information on the "Loading blocks for S7-1200/1500” topic, please
refer to the STEP 7 manual (see \9\).
Note You can also simulate the controller part of the S7-1500 of the application
example with PLCSIM. To do this, follow the notes in the function manual (\3\),
chapter "Simulating PID_Temp with PLCSIM".
7.1 Preparation
Selecting the technology objects "PID_Temp” as individual instance enables you
can to use the commissioning wizard and to watch the courses of the curves.
Table 7-1
No. Action Remark
19. Open the commissioning window of
the respective "PID_Temp” instance
in "Technology objects’”.
© Siemens AG 2019 All rights reserved
Note You get to the state before the first commissioning with the start values of all PID
parameters, by selecting the controller and via the "Online > Download and reset
PLC program (\3\).
7.2 Pretuning
Carry out the following steps for the synchronous pretuning (first heating, then
cooling for heating/cooling controllers) of multi-zone controllers.
Table 7-2
No. Action Remark
22. Open the "WatchTable” in "Watch and force -
tables”.
23. Click on the "Watch all” button.
Figure 7-1
are reached
The pretuning heating is started with the calculations of the standard deviation,
followed by simultaneous setpoint jumps heating with the determination of the
turning points of the temperature curves. Afterwards the automatic mode of the
controllers waits that the respective operating point is reached, before the
pretuning cooling is carried for the heating/cooling controllers (zone 2 and 3).
During this time the controller of zone 1 remains in automatic mode. With the
completion of the last pretuning cooling (zone 2) the FB "MultizoneSut” is
successfully processed.
A statement regarding quality of the parameters found can be made through the
compensation of disturbance variables.
This can take place in real operation, for example, through the switching on of a hot
air blower on the extruder housing.
To do this in the simulated application example, proceed as follows:
Table 7-3
No. Action Remark
28. Remove all ticks in the option boxes for the
selection of the tags to be controlled in the
"WatchTable”.
Figure 7-2
Δt ≈ 59 s
Δt ≈ 75 s
Δt ≈ 68 s
For the disturbance variable compensation in the opposite energy type, the
controller has to change into this energy type first. Proceed as follows:
Table 7-4
No. Action Remark
33. Remove all ticks in the option boxes for the
selection of the tags to be controlled in the
"WatchTable”.
34. Select a higher tuning offset heating than
the stationary setpoint heating
("OutputHeat”) for each zone of the
heating/cooling controller in automatic
mode (for example, 2 x "OutputHeat”), in
order to force the cooling mode.
35. Watch the course of the curve.
Now wait until all zones have reached their
stationary operating point.
36. Start the measurement of the recovery
times via "Tags”.stopWatch.start tag.
"Tags"zones[x].simMultizone.disturbance =
10.0 for each zone.
Click on the "Modify now” button.
38. Monitor the course of the curve and the
watch table.
After compensation of the disturbance
variables, the required times are displayed
via the "instStopWatchX".time.
You can also stop the course of the curve
Figure 7-3
Δt ≈ 56 s
Δt ≈ 49 s
Δt ≈ 46 s
© Siemens AG 2019 All rights reserved
Since the controller for zone 1 is a pure heating controller, the previously
determined disturbance variable recovery time is confirmed here.
Figure 7-4
Oszillation
The FB "MultizoneTir” waits until all operating points have been reached (only
required if the opposite energy type is to be fine-tuned).
Afterwards it is tried to reach the setpoints with the existing PID parameters as part
of the fine tuning, in order to calculate the standard deviation synchronously and to
initiate the oscillation of the actual values via variation of the manipulated variables.
The PID parameters for each zone are recalculated from amplitude and frequency
of the actual value oscillations.
With the completion of the last fine tuning (zone 2) the FB "MultizoneTir” is
successfully processed.
Figure 7-5
Δt ≈ 12 s
Δt ≈ 22 s
Δt ≈ 11 s
© Siemens AG 2019 All rights reserved
With the FB "MultizoneTir” you can also fine tune the other energy type (other than
the present one) for heating/cooling controllers. In the present example this is the
energy type cooling for zone 2 and 3.
Table 7-6
No. Action Remark
44. Before fine tuning is started, it is waited with
FB "Waiting” until all zones are located in
the operating point.
This procedure guarantees that the
calculation of the tuning offset happens in
the steady-state control loop.
If required, adjust the percentage of the
"tolerance” and/or the number of waited
"cycles”.
45. Check the setpoints "setpoint” of the
individual zone controllers and make sure
that all controllers are in "Automatic” (State
= 3) mode.
Figure 7-6
Wait unitl operating points are reached
The FB "MultizoneTir” waits until all operating points have been reached before the
FCs "TirOffset” calculate and output the heating tuning offsets.
This increase of the heating manipulated variables forces the zone controllers 2
and 3 to energy type cooling, in order to maintain the setpoint.
Afterwards it is tried to reach the setpoints with the existing PID parameters as part
of the fine tuning, in order to calculate the standard deviation synchronously and to
initiate the oscillation of the actual values via variation of the manipulated variables.
The PID parameters for each zone are recalculated from amplitude and frequency
of the actual value oscillations.
With the completion of the last fine tuning (zone 2) the FB "MultizoneTir” is
successfully processed.
Figure 7-7
© Siemens AG 2019 All rights reserved
Δt ≈ 13 s
Δt ≈ 35 s
Δt ≈ 25 s
Since the controller for zone 1 is a pure heating controller, the previously
determined disturbance variable recovery time is confirmed here.
Table 7-7 shows that the fine tuning leads to a faster compensation of manipulated
variables then the pretuning.
© Siemens AG 2019 All rights reserved
49. Enter
"Tags"zones[2].simMultizone.disturbance =
40.0 as control value of the disturbance
value for zone 2.
Click on the "Modify now” button.
50. Follow step 1 and 2 from Table 7-5. -
51. Select the following energy types for the
fine tuning:
• Zone 1: Heating
("Tags".zones[1].tuningMode = 1)
• Zone 2: Cooling
("Tags".zones[1].tuningMode = 2)
• Zone 3: Heating
("Tags".zones[1].tuningMode = 1)
Start the synchronized fine tuning with
these specifications by setting the bit
”Tags".multizoneTir.start.
Figure 8-1
© Siemens AG 2019 All rights reserved
Oszillation
Figure 8-2
Automatic mode
Oszillation
Try to reach setpoint heating with PID control
Wait until operating points are reached
Manual mode
© Siemens AG 2019 All rights reserved
Oszillation
Automatic mode
Fine tuning heating
\10\ Manual
SIMATIC S7-1500/ET 200MP Automation system In a nutshell
https://support.industry.siemens.com/cs/ww/en/view/109481357
10 History
Table 10-1
Version Date Modifications
V1.0 12/2016 First version
V1.1 07/2019 Update TIA Portal V15.1