You are on page 1of 56

Controlling with PID_Compact V2

SIMATIC S7-1500
Application Description September 2013

Applications & Tools


Answers for industry.

Warranty and Liability

Warranty and Liability


Note

The Application Examples are not binding and do not claim to be complete with
regard to configuration, equipment or any contingencies. The application
examples do not represent customer-specific solutions; they are only intended to
provide support for typical applications. You are solely responsible for the correct
operation of the described products. These Application Examples do not relieve
you of the responsibility to use safe practices in application, installation,
operation and maintenance. Through using these Application Examples, you
acknowledge that we will not be liable for any damage/claims beyond the liability
clause described. We reserve the right to make changes to these Application
Examples at any time without prior notice. If there are any deviations between
the recommendations provided in these Application Examples and other
Siemens publications e.g. Catalogs the contents of the other documents
have priority.

Copyright

Siemens AG 2013 All rights reserved

We do not accept any liability for the information contained in this document.
Any claims against us based on whatever legal reason resulting from the use of
the examples, information, programs, engineering and performance data etc.,
described in this Application Example shall be excluded. Such an exclusion shall
not apply in the case of mandatory liability, e.g. under the German Product Liability
Act (Produkthaftungsgesetz), in case of intent, gross negligence, or injury of life,
body or health, guarantee for the quality of a product, fraudulent concealment of a
deficiency or breach of a condition which goes to the root of the contract
(wesentliche Vertragspflichten). The damages for a breach of a substantial
contractual obligation are, however, limited to the foreseeable damage, typical for
the type of contract, except in the event of intent or gross negligence or injury to
life, body or health. The above provisions do not imply a change in the burden of
proof to your disadvantage.
Any form of duplication or distribution of these Application Examples or excerpts
hereof is prohibited without the express consent of Siemens Industry Sector.

Siemens Industry Online Support


This entry is from the Siemens Industry Online Support. The following link will take
you directly to the download page of this document:
http://support.automation.siemens.com/WW/view/en/79047707

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

1 Task Description

Table of Contents
Warranty and Liability ................................................................................................. 2
1

Task Description ................................................................................................ 5

Solution............................................................................................................... 6
Overview............................................................................................... 6
Scenarios of the application ................................................................. 7
Visualization user interface .................................................................. 9
Hardware and software components ................................................. 10
Validity ................................................................................................ 10
Components used .............................................................................. 10

Basics on Control Engineering ...................................................................... 11

Mode of Operation ........................................................................................... 13


4.1
4.2
4.2.1
4.2.2
4.2.3
4.3
4.3.1
4.3.2
4.3.3
4.4
4.4.1
4.4.2

Inserting FB PID_Compact (FB1130) .............................................. 33


Configuration of FB PID_Compact (FB1130) .................................. 35
Commisisoning FB PID_Compact (FB1130) ................................... 37
Commissioning with pre- and fine tuning ........................................... 37
Commissioning with given PID parameters ....................................... 39
Inserting a function block of the simulation library ............................. 41
Simulation of a controlled system with several elements................... 42

Commissioning ................................................................................................ 45
6.1
6.1.1
6.1.2
6.1.3
6.1.4
6.2
6.2.1
6.2.2
6.2.3

Structure of the example project ........................................................ 13


Scenario 1: Calling up and commissioning PID_Compact .............. 16
Task: controlling a simulated PT3 system.......................................... 16
Procedure ........................................................................................... 16
Controlled system: Scenario1 ............................................................ 17
Scenario 2: temperature control with split-range block ...................... 19
Task: controlling a simulated asymmetrical temperature system ...... 19
Procedure ........................................................................................... 20
FB Scenario2_SplitRange (FB201) ................................................. 24
Scenario 3: simulation and control of a complex controlled
system ................................................................................................ 29
Task: controlling a simulated complex controlled system .................. 29
Procedure ........................................................................................... 31

Configuration and Settings............................................................................. 32


5.1
5.2
5.3
5.3.1
5.3.2
5.4
5.5

Copyright

Siemens AG 2013 All rights reserved

2.1
2.2
2.3
2.4
2.4.1
2.4.2

Commissioning with entire hardware ................................................. 45


Hardware installation .......................................................................... 45
Installation of the software.................................................................. 46
Configuring the hardware ................................................................... 47
Opening and downloading the TIA Portal project .............................. 48
Commissioning with PLCSIM V12 ..................................................... 49
Installation of the software.................................................................. 49
Configuring the engineering station ................................................... 49
Opening and downloading the TIA Portal project .............................. 51

Operating the Application ............................................................................... 52


7.1
7.2
7.2.1
7.2.2
7.3

Overview............................................................................................. 52
Operation via WinCC Runtime ........................................................... 52
Operating units ................................................................................... 52
Monitoring scenario 3 with WinCC ..................................................... 54
Operator control and monitoring via the online access ...................... 55

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

1 Task Description

Related Literature ............................................................................................ 56

History............................................................................................................... 56

Copyright

Siemens AG 2013 All rights reserved

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

1 Task Description

Task Description

Introduction
Influencing technical variables in systems requires controlling these variables.
There are miscellaneous uses for controllers in automation technology, for
example, for controlling temperatures in processes.
In the SIMATIC world, the PID_Compact block of version 2.0 is provided for the
S7-1500 CPUs for controlling processes.
Overview of the automation task
The automation task consists of setting up a control loop for influencing physical
parameters in a technological process. The control loop shall consist of the
following elements here:
PID_Compact as controller.
Simulated technological processes as controlled system.
Figure 1-1

Siemens AG 2013 All rights reserved

Simulation Library
Sim_controlprocess

Copyright

PID_Compact
Controller

Controlled
system

Step response

The following requirements are posed to the application:


Configuration and settings of the software controller (PID_Compact block)
should be explained.
Optimization options of the PID_Compact shall be illustrated.
The usage of the Sim_controlprocess simulation library and simulation of
technological processes shall be illustrated.
A split-range controller shall be programmed for controlling a temperature
system.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

2 Solution
2.1 Overview

Solution

2.1

Overview

Schematic layout
The following scheme shows the most important components of the solution:
Figure 2-1

Field PG

Field PG:
Configuration and
Startup

PC station

PC-Station:
HMI visualization
of the scenarios
(WinCC Runtime)

TIA V12

PC station:
HMI visualization of
the scenarios

Siemens AG 2013 All rights reserved

Industrial Ethernet

CPU 1516-3 PN/DP

S7-1500 CPU:
Program with
PID_Compact and
system simulation
Controlled
system

PID_Compact
controller

Copyright

PC station:
HMI visualization of
the scenarios

Simulation library
SIM_controlprocess

For demonstrating the application task, a controller is realized by the S7-1500


using the PID_Compact block and the Sim_controlprocess simulation library.
The PC station is used for the visualization of the control loops.
The field PG is used for commissioning the application.
Note

Field PG and PC station can be realized by a PC (see chapter 6). Alternatively,


the example can also be realized completely with PLCSIM.

Advantages
This application offers you the following advantages:
Step by step description for the initial commissioning of a PID_Compact
controller.
Fast introduction into handling the functions of the PID_Compact.
Time and cost reduction by simulating controlled systems using the controlled
system library Sim_controlprocess.
Adjustable split-range block for controlling with PID_Compact.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

2 Solution
2.2 Scenarios of the application
Topics not covered
This application does not include a description of
STEP 7 V12
WinCC Runtime Professional V12
SCL programming language
Basic knowledge of these topics is assumed.

2.2

Scenarios of the application

Structure of the application


The STEP 7 project is divided into three scenarios, which are used for explaining
various aspects of handling the PID_Compact function and the
Sim_controlprocess simulation library for controlled systems.
Scenarios

Copyright

Siemens AG 2013 All rights reserved

The following scenarios are realized for a clearer understanding:


Table 2-1
No.

Scenario

Content of the scenario

Controlling of a PT3 system simulation


with the help of PID_Compact.

Configuring the PT3 system


simulation.
Configuration and settings of
PID_Compact.
Commissioning the PID_Compact
with pretuning and fine tuning

Controlling of an asymmetrical
temperature system simulation. The
controlled system simulates heating and
cooling processes with different time
constants.

Calling the asymmetrical


temperature system simulation.
Experimental determination of the
control parameters for
PID_Compact.
Commissioning the PID_Compact
as split-range controller with given
parameters (without pre- and fine
tuning).

Controlling a complex controlled system


consisting of PT1, PDT1, lagging, and
PT2 element.

Interconnecting the individual


system simulations.
Commissioning the PID_Compact
with pretuning and fine tuning

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

2 Solution
2.2 Scenarios of the application
Thematic content of the scenarios
The following table provides an overview of the tasks existing in the scenarios. The
right column contains the reference to the step-by-step instruction of the task in the
documentation.
Table 2-2
Task

Scenario

Description
in chapter (link)

PID_Compact configuration

Chapter 5.1 and chapter 5.2

Commissioning (pre- and fine tuning)

Chapter 5.3.1.

Commissioning without pre- and fine


tuning

Chapter 5.3.2.

Changing the control parameters during


operation.

Chapter 4.3.3.

Inserting a single simulation element.

Chapter 5.4.

Chapter 5.5.

Copyright

Siemens AG 2013 All rights reserved

Interconnecting several controlled


systems.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

2 Solution
2.3 Visualization user interface

2.3

Visualization user interface

WinCC Runtime
In the PC station of the TIA project, a visualization interface (WinCC Runtime) is
provided for operating the examples.
Using WinCC Runtime enables:
monitoring the state of the scenarios of the project
modifying individual tags of the scenarios.
Overview screen
The figure below shows the visualization interface of WinCC Runtime: a detailed
description of WinCC Runtime is available in chapter 7.2.

Copyright

Siemens AG 2013 All rights reserved

Figure 2-2 Overview screen WinCC Runtime scenario 1

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

2 Solution
2.4 Hardware and software components

2.4

Hardware and software components

2.4.1

Validity
This application is valid for
STEP 7 as of V12
S7-1500 as of FW 1.0

2.4.2

Components used
This application has been generated using the following components:

Hardware components
Table 2-3

Copyright

Siemens AG 2013 All rights reserved

Component

No.

Order number

Note

PS 25W 24VDC

6ES7 505-0KA00-0AB0

Alternatively, other power


supplies can also be used.

CPU 1516-3 PN/DP

6ES7 516-3AN00-0AB0

Alternatively, other CPUs from


the S7-1500 spectrum can
also be used.

PC station

e.g. 6ES7647-6C...-....

Here, any PC station with


appropriate software can be
used.

Software components
Table 2-4
Component

No.

Order number

Note

STEP 7 V12 SP1


(TIA Portal V12)

6ES78221AE02-0YA5

Component for programming


the S7-1500.

WinCC V12 SP1


Professional
(TIA Portal V12)

6AV2103-0DA02-0AA5

Component for configuring the


visualization.

Sample files and projects


The following list includes all files and projects that are used in this example.
Table 2-5
Component

Note

79047707_PID_CompactV2_CODE_v1_0.zip

This zip file contains the


STEP7 project.

79047707_Sim_controlprocess_lib.zip

Controlled system
simulation library
Sim_controlprocess

79047707_Regeln_PID_CompactV2_DOKU_v1_0_en.pdf

This document.

79047707_Description_RegelSimBib_DOKU_V1_0_en.pdf

Description of the
controlled system
simulation library
Sim_controlprocess

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

10

3 Basics on Control Engineering

Basics on Control Engineering

Overview
Control engineering is an engineering science researching how to influence
specific given parameters in technological systems, with the aim of reaching and
maintaining the desired value of this parameter under certain conditions.
This chapter contains a very short extract on the topic of Control technology.
The system manual of STEP 7 Professional V12.0 discusses PID control with
basics on control technology in chapter 11.3 (\4\).
Controlled system
A controlled system contains the parameter to be controlled, such as the
temperature of a room. In order to identify the type of a system and then
dynamically controlling it in an optimal way requires a precise analysis of the
system to be controlled.
One possibility of identification is to look at the step response of a controlled
system. The picture below depicts the example of a PTn system (temperature in a
room, for example).
Delay time Tu
Compensation time Tg
Maximal value Xmax
Figure 3-1 Step response PTn system

Copyright

Siemens AG 2013 All rights reserved

The time behavior can be defined approximately by the parameters

Tu
Tg
y
x

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

Delay time
Compensation time
Output value
Actual value

11

3 Basics on Control Engineering

Controller
The controller controls an actuator to bring the controlled system to a desirable
state. The simplest controllers are two-point controllers, which only know the states
ON and OFF and control the controlled system via the actuator.
The frequently used PID controllers consist of three parts:
The P-part creates an output signal proportional to the control deviation:
The I-part integrates the control deviation over time and affects the controlled
system due to this integration.
The D-part, on the other hand, reacts to the changed control deviation
(temporal deviation of the control deviation).
These three parts of the ideal PID controller are weighted by the coefficients
proportional gain, reset time and rate time.
With the PID_Compact and PID_3Step blocks, SIMATIC S7-1500 already offers
a possibility integrated into the firmware of the software control.
In this application, PID_Compact is used. Further information on PID_3Step is
available in the manual \3\ and in the help of the TIA Portal.

Control loop
The control deviation between setpoint and actual value is determined and a
manipulated variable derived from it. The manipulated variable acts on the
controlled system via an actuator (see Figure 3-2).
Figure 3-2 Control loop, single-loop

Copyright

Siemens AG 2013 All rights reserved

Note

Control deviation
Setpoint

Controller
-

Control
variable

Controlled
system

Actual
value

A simple example for a control loop is the control of the room temperature through
a heater. The room temperature is measured with a sensor and fed to a controller,
which compares the current room temperature with a setpoint value and calculates
an output value (control value) for controlling the heater.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

12

4 Mode of Operation
4.1 Structure of the example project

Mode of Operation

Structure
This chapter introduces the individual scenarios of the STEP 7 program and
describes the individual blocks in greater detail.
The exact behavior of the three scenarios is described and a picture of the entire
control loop provided.
Configuration
This chapter does not describe the configuration, commissioning and optimization
of PID_Compact. For respective step-by-step instructions please refer to
chapter 5.

4.1

Structure of the example project

Scenarios

Copyright

Siemens AG 2013 All rights reserved

The example project consists of the scenarios which are named in chapter 2.2 and
are independent of each other.
Program overview
The S7 program of the CPU 1516-3 PN/DP is set up as follows:
Figure 4-1
OB100
Startup

Initialization
FB
PID_Compact

OB30
Scenario1

Scenario
1

FB
Sim_PT3

FB
Scenario2_Split
Range

OB31
Scenario2

FB
PID_Compact

Scenario
2

FB
Sim_TempProc
ess

FB
Sim_PT3

FB
Sim_PT3
FB
Sim_PT3

OB32
Scenario3
FB
Sim_PT3

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

FB
Sim_PT3

Scenario
3

13

4 Mode of Operation
4.1 Structure of the example project
Assignment
With the exception of FB PID_Compact (FB1130), which is used in all scenarios,
and OB Startup (OB100), the individual blocks can be uniquely assigned to the
existing scenarios.
User blocks
Table 4-1 Blocks and instructions of the simulation library

OB100

Startup

Startup OB:
Initializes the program

OB30

Scenario1

Cyclic OB. Realizes the scenario


described in chapter 4.2:
Controlling a PT3 system with a PID
controller

DB2

PID_Scenario1

Instance DB for the PID_Compact


block

DB100

Param_Scenario1

Block with parameters for supplying the


block call in scenario 1.

FB54

Sim_PT3

Simulation of a PT3 element.

DB101

Sim_PT3_DB

Instance DB of the FB Sim_PT3 (FB54)

OB31

Scenario2

Cyclic OB. Realizes the scenario


described in chapter 4.3:
Control of a simulated controlled
temperature system using a split-range
block.

DB7

PID_Scenario2

Instance DB for the PID_Compact


block

DB200

Param_Scenario2

Block with parameters for supplying the


block call in scenario 2.

FB201

Scenario2_SplitRange

Realizes a PID split-range control.


Calls FB PID_Compact (FB1130)
internally.

DB201

Scenario2_SplitRange_DB

Instance DB of the FB
Scenario2_SplitRange (FB201)

FB58

Sim_TempProcess

Simulation of an asymmetrical
temperature system.

DB202

Sim_TempProcess_DB

Instance DB of the FB
Sim_TempProcess (FB58)

OB32

Scenario3

Cyclic OB. Realizes the scenario


described in chapter 4.4:
Controlling a simulated controlled
system consisting of PT1, PDT1,
lagging, and PT2 element using the
PID_Compact block.

DB6

PID_Scenario3

Instance DB for the PID_Compact


block

DB300

Param_Scenario3

Block with parameters for supplying the


block call in scenario 3.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

Scenario1

Description

Scenario2

Symbolic name

Scenario3

Copyright

Siemens AG 2013 All rights reserved

Element

14

4 Mode of Operation
4.1 Structure of the example project
Element

Symbolic name

Description

FB50

Sim_PT1

Simulation of a PT1 element.

DB303

Sim_PT1_DB

Instance DB of FB Sim_PT1 (FB50).

FB52

Sim_PT2osz

Simulation of a periodical PT2 element.

DB306

Sim_PT2osz_DB

Instance DB of FB Sim_PT2osz (FB52).

FB55

Sim_PDT1

Simulation of a PDT1 element.

DB304

Sim_PDT1_DB

Instance DB of FB Sim_PDT1 (FB55).

FB59

Sim_Lagging

Simulation of a lagging element.

DB305

Sim_Lagging_DB

Instance DB of FB Sim_Lagging
(FB59).

FB1130

PID_Compact

System block: Digital PI/PID controller; called


up in each scenario.
In this application, it is always used as PID
and not as PI controller.

Blocks of simulation library Sim_controlprocess

Copyright

Siemens AG 2013 All rights reserved

In the project, blocks from the Sim_controlprocess simulation library are also
used which are provided on the same HTML page as this document.
The following blocks
Sim_PT3
Sim_TempProcess
Sim_PT1
Sim_PDT1
Sim_Lagging
Sim_PT2osz
originate from the library. The simulation library offers you further simulation blocks
for the simulation of controlled systems.
An exact description of the individual simulation blocks is available in the document
79047707_Beschreibung_RegelSimBib_ DOKU_V1_0_en.pdf
Software controller FB PID_Compact (FB1130)
System block PID_Compact (FB1130) realizes a PID software controller with the
following interface:
Figure 4-2

For a detailed description of FB PID_Compact (FB1130) and its parameters,


please use the help of the TIA Portal.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

15

4 Mode of Operation
4.2 Scenario 1: Calling up and commissioning PID_Compact

4.2

Scenario 1: Calling up and commissioning


PID_Compact

4.2.1

Task: controlling a simulated PT3 system

Task
The task is to illustrate how to simulate a controlled PT3 system with the simulation
library.
The controlled PT3 system shall be controlled with the PID_Compact block.
Principle scheme
Figure 4-3

Control
parameter

PID
Controller

Control
variable

Controlled PT3
system

Feedback

Siemens AG 2013 All rights reserved

Step response
The figure below shows the step response of the controlled PT3 system at a jump
of the input from 0 50:
Figure 4-4

Copyright

Setpoint value
Actual value
(step response)

4.2.2

Procedure

Overview
The following tasks need to be implemented for realizing the user program:
Inserting and configuring the PT3 system simulation into the user program.
Adding the PID_Compact block in the user program.
Configuring the PID_Compact block.
Commissioning the software controller with pretuning and fine tuning.
Step-by-step instruction
The respective step-by-step description for the individual processes is available in
chapter 5.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

16

4 Mode of Operation
4.2 Scenario 1: Calling up and commissioning PID_Compact
Note

4.2.3

If you do not wish to individually reprogram the processes as described in


chapter 5, you can also access the example project directly. The example project
contains the already commissioned scenario1.

Controlled system: Scenario1

Overview
After commissioning the example project, as described in chapter 6, you can
directly monitor the behavior of the controlled system.
Parameters and formula for PID_Compact
The following parameters are active in the PID_Compact software controller after
the fine tuning:
Table 4-2 Symbols and parameters

Copyright

Siemens AG 2013 All rights reserved

Symbol

Description

Value

GAIN,
Kp

Proportional gain

10.770338

TI

Integration time

21.10933

TD

Derivative time

5.337515

Derivative time lag coefficient

0.1

Weighing of P component

0.2586402

Weighting of D component

0.0

Output value of the PID algorithm

Laplace operator

Setpoint value

Actual value

The PID algorithm of PID_Compact (FB1130) works according to the following


formula:

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

17

4 Mode of Operation
4.2 Scenario 1: Calling up and commissioning PID_Compact
Monitoring the controlled system
Chapter 7 describes how to monitor and control the controlled system via WinCC
Runtime Advanced using the provided visualization.
Control behavior of the system
After commissioning Scenario1, the following behavior results for a setpoint jump
from 0 50%:

Copyright

Siemens AG 2013 All rights reserved

Figure 4-5

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

18

4 Mode of Operation
4.3 Scenario 2: temperature control with split-range block

4.3

Scenario 2: temperature control with split-range block

4.3.1

Task: controlling a simulated asymmetrical temperature system

Task
A simulated temperature process shall be controlled with different characteristic
values for heating and cooling using a PID controller.
Processes controlled by two different actuators (heating and cooling) can be
controlled by a split-range controller. A split-range controller divides its output
between two different actuators.
A block shall be developed for realizing the PID_Compact as a split-range
controller.
Principle scheme
The simulated temperature process internally consists of two asymmetrical PT1
elements.
Figure 4-6

Parameter set
Cooling
Control
variable

Command
variable

Heating

PID
Controller

Temp_Process
Cooling

Feedback

Copyright

Siemens AG 2013 All rights reserved

Parameter set
Heating

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

19

4 Mode of Operation
4.3 Scenario 2: temperature control with split-range block
The developed split-range block FB Scenario2_SplitRange (FB201) scales the
input value to the inputs of the PID controller. The produced relative output value
(range: 0-100%) is then prepared accordingly for the inputs of the temperature
system.
The output of the PID controller is split according to the following principle:
Figure 4-7

Heating output
(in %)
100
50

Heating

Cooling output
(in %)
100

Copyright

Siemens AG 2013 All rights reserved

50

Cooling
25

50

75

Output
controller (%)

A detailed description of FB Scenario2_SplitRange (FB201) is available in


chapter 4.3.3.

4.3.2

Procedure

Overview
The controlled temperature system simulation approximately consists of two PT1
systems with different parameters for heating and cooling.
The following tasks are realized in the user program:
Separated simulation of the heating and cooling system.
Determining the suitable PID parameters for heating and cooling.
Programming FB Scenario2_SplitRange (FB201)
Commissioning the temperature system
Commissioning PID_Compact.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

20

4 Mode of Operation
4.3 Scenario 2: temperature control with split-range block
Simulation of the subsystem
To obtain the parameter records for the PID controller, heating and cooling is
respectively simulated as PT1 system.
The actions described in Table 5-2 are performed with the following frame
conditions:
Ambient temperature: 22C
Maximum heating power: 50 (Watt)
Maximum cooling power: 50 (Watt)
Step response to the power jump from 0 to 50 (Watt) (for heating as well as
cooling)
Table 4-3 Specifying the PID parameter sets

Copyright

Siemens AG 2013 All rights reserved

No.

Action

1.

As described in chapter 5.4, the controlled Sim_TempProcess system from the


Lib_controlprocess library is inserted.

2.

The characteristic value readings for heating and cooling the system are determined by
experiment.
Procedure:
Creating a jump of the heating/cooling power at the input of the simulation block.
Reading the characteristic values from the respective jump response
Readings for characteristic heating values:
k = 0.28
T = 28.6s (for 0.63*end value)
Readings for characteristic cooling values:
k = 0.53
T = 16.6s (for 0.63*end value)

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

21

4 Mode of Operation
4.3 Scenario 2: temperature control with split-range block
No.

The simulation of the controlled temperature system consists approximately of two PT1 systems.
The procedure for receiving suitable parameters for the PID controller is the following:
Inserting a PT1 system with the parameters from 2.
Inserting PID_Compact.
Configuring PID_Compact.
Commissioning PID_Compact.
The parameters received after the fine tuning are read (see Table 4-4) and used for the split-range
controller.

PID parameters
The following parameter sets for the PID controller were determined by experiment
(see Table 4-3):

Copyright

Siemens AG 2013 All rights reserved

3.

Action

Table 4-4 Parameter sets heating and cooling


PT1 system:
heating

PT1 system:
cooling

GAIN

20.48825

11.07108

TI [s]

2.595915

2.630034

TD [s]

0.6573617

0.6651893

0.1

0.1

0.2560457

0.2581466

0.0

0.0

The determined parameters are used for controlling using the split-range block
Scenario2_SplitRange (FB201).
Chapter 4.3.3 describes the functioning of FB Scenario2_SplitRange (FB201)
Note

If you do not wish to individually reprogram the processes as described in


chapter 5, you can also access the example project directly. The example project
contains the already started scenario2.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

22

4 Mode of Operation
4.3 Scenario 2: temperature control with split-range block
Step-by-step description
Step-by-step instructions for commissioning the controlled temperature system are
available in chapter 5.
Monitoring the controlled system
Chapter 7 describes how to monitor and control the controlled system via WinCC
Runtime Advanced using the provided visualization.
Control behavior of the system
You receive the following behavior at the inputs and outputs of the controller if the
setpoint value at FB Scenario2_SplitRange (FB201) is reduced from 22C to
10C.

Copyright

Siemens AG 2013 All rights reserved

Figure 4-8

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

23

4 Mode of Operation
4.3 Scenario 2: temperature control with split-range block

4.3.3

FB Scenario2_SplitRange (FB201)

Function
Using a call of PID_Compact, FB Scenario2_SplitRange (FB201) realizes a
split-range control which controls two actuators (heating and cooling).
For a certain output range of the software controller (0-50%), the cooling is
controlled from 100-0% of its maximal cooling power. For the output range between
50-100% at the controller, the heating is controlled to 0-100% of the maximal
heating output (see Figure 4-7).
Parameter
The interface of FB Scenario2_SplitRange (FB201) looks as follows:

Copyright

Siemens AG 2013 All rights reserved

Figure 4-9 FB Scenario2_SplitRange (FB201)

Table 4-5
Parameter

Type

Note

Setpoint

IN:
Real

Setpoint value.

Input

IN:
Real

Input value.

max_Temp

IN:
Real

Maximal input temperature.

min_Temp

IN:
Real

Minimal input temperature.

max_Heat

IN:
Real

Maximum heating power. Parameter for scaling the


PID_Compact output to the temperature system.

max_Cool

IN:
Real

Maximum cooling power. Parameter for scaling the


PID_Compact output to the temperature system.

Output_rel

OUT:
Real

Output of the PID controller; value between 0% and


100%.

Heat_on

OUT:
Bool

Switching on the heating.

Cool_on

OUT:
Bool

Switching on cooling.

HeatPower

OUT:
Real

Scaled heating power (only relevant, if Heat_on =


TRUE).

CoolPower

OUT:
Real

Scaled cooling power (only relevant, if Cool_on =


TRUE).

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

24

4 Mode of Operation
4.3 Scenario 2: temperature control with split-range block
Mode of Operation
FB Scenario2_SplitRange (FB201) can be divided into the following steps:
Figure 4-10

Start
Scenario2_
SplitRange
1

no

Next cycle

2
Loading PID
parameters from DB

yes
3
PID_Compact call

Next cycle

Correct PID parameters


loaded
?

Copyright

Siemens AG 2013 All rights reserved

PID_Compact in
automatic mode
?

no
5
Reset all outputs to 0

yes
6
Calculation and
scaling of the
output values
Output

Table 4-6
Step

Action

Note

Query, whether the required parameters


have already been loaded.

The parameters to be loaded depend on


the last output of PID_Compact.
<50%
Parameters for cooling
>50%
Parameters for heating

From the storage in the data block, the


parameters are first loaded into the
backup parameters and then adopted to
PID_Compact with
LoadBackUp:=TRUE.

As a standard, the parameters are used


from the following storage:
Param_Scenario2".Sets.Set1
(heating)
Param_Scenario2".Sets.Set2
(cooling)

The software controller PID_Compact


is called up.

If FB Scenario2_SplitRange (FB201)
is called up several times in a project, a
separate instance of PID_Compact
must be used for each block call.

Query, whether the PID_Compact


block is in automatic mode.

If PID_Compact is not operated in


automatic mode, then all outputs are set
to 0.

The outputs are calculated,


standardized, scaled and then output.
The relative output of PID_Compact

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

Figure 4-7 shows this step


schematically.

25

4 Mode of Operation
4.3 Scenario 2: temperature control with split-range block
Step

Action

Note

(between 0-100%) is output.

Commissioning
Commissioning the FB Scenario2_SplitRange (FB201) is not possible via preand fine tuning since the parameters need to be specified directly for the controller.
For loading the parameters, the LoadBackUp parameter is used in the FB.

Copyright

Siemens AG 2013 All rights reserved

Table 4-6 shows the commissioning of FB Scenario2_SplitRange (FB201). The


function block has already been inserted in the example project.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

26

4 Mode of Operation
4.3 Scenario 2: temperature control with split-range block
Table 4-7
No.

Action
Add FB Scenario2_SplitRange (FB201) into a cyclic interrupt OB.

2.

Interconnect the inputs of the block with the parameters provided by you.

Copyright

Siemens AG 2013 All rights reserved

1.

If you wish to use several instances of the function block, please ensure that you do not use the
same technology object for PID_Compact in both calls.
You need to change the instance of the block in the SCL code.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

27

4 Mode of Operation
4.3 Scenario 2: temperature control with split-range block

Copyright

Siemens AG 2013 All rights reserved

No.

Action

3.

Open the function block.


If you do not wish to use the standard tags but adjust the parameter sets for PID_Compact, then
you can change the interconnection at the beginning of the block.

4.

Assign values to the tags interconnected in step 3.


For example, the values from Table 4-4 can be used for the temperature system

5.

Interconnect the outputs of the block with controlled system used by you.

6.

Via Online > Download and Reset PLC program you download your user program into the CPU.

Alternative
You can also control an asymmetrical temperature system through other methods
then a split-range controller.
One possibility is the application of two separate PID_Compact controllers with
default parameter sets which only control the respective actuator heating or
cooling.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

28

4 Mode of Operation
4.4 Scenario 3: simulation and control of a complex controlled system

4.4

Scenario 3: simulation and control of a complex


controlled system

4.4.1

Task: controlling a simulated complex controlled system

Task
Using the controlled system simulation library Sim_controlprocess, a more
complex controlled system shall be simulated and controlled by the PID_Compact
block. Commissioning shall be performed via the pretuning and fine tuning
function.
The controlled system shall consist of the following elements:
Table 4-8

Copyright

Siemens AG 2013 All rights reserved

Type

Note

Schematic step response

Example:
real process

PT1 element

Controlled system speed,


inverter

PDT1 element

Application for jump-capable


systems

Lagging element (lagg)

Conveying system, drive

PT2 element (periodically)

Vibration-capable
mechanical system,
lifting/rotary motions

Simulating a real controlled system can help save time and costs during
commissioning!

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

29

4 Mode of Operation
4.4 Scenario 3: simulation and control of a complex controlled system
Principle scheme
The more complex controlled system consists of the following elements:
Figure 4-11

Controlled system

Command
variable

PID
Controller

PT1

PDT1

Lagg

PT2osz

Control
variable

Feedback

Step response
The step response of the combined controlled system is displayed below:

Copyright

Siemens AG 2013 All rights reserved

Figure 4-12

Jump
Step response

The following parameters are used for the individual elements:


Table 4-9
TM_LAG1
(PT2: OMEGA)

TM_LAG2
(PT2: DAMP)

GAIN

delay_cycle

PT1

12.0

1.0

PDT1

3.0

5.0

1.0

Lagging

15

Periodic PT2

0.4

0.2

1.0

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

30

4 Mode of Operation
4.4 Scenario 3: simulation and control of a complex controlled system

4.4.2

Procedure

Overview
The procedure for this scenario corresponds to that in scenario 1:
Inserting and configuring the individual elements of the controlled system into
the program.
Adding the PID_Compact software controller, configuring and starting up.
Note

If you do not wish to individually reprogram the processes as described in


chapter 5, you can also access the example project directly. The example project
contains the already commisioned PID_Compact.

Step-by-step description
For the step-by-step description, please refer to chapter 5.
Monitoring the controlled system

Copyright

Siemens AG 2013 All rights reserved

Chapter 7 describes how to monitor and control the controlled system via WinCC
Runtime Advanced using the provided visualization.
PID_Compact parameter
The following fine-tuned parameters result for the PID_Compact block:
Table 4-10 Parameter set of a complex controlled system
PID_Compact
GAIN

0.2142379

TI [s]

4.044378

TD [s]

0.8554038

0.1

1.0

0.0

Control behavior of the system


The following behavior at the inputs and outputs of the PID_Compact controller
results for a jump of the setpoint value from 0 to 50 in a steady-state control loop.
Figure 4-13

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

31

5 Configuration and Settings


4.4 Scenario 3: simulation and control of a complex controlled system

Configuration and Settings

Content
This chapter discusses the configuration and settings in the
79047707_PID_CompactV2 project realized on the S7-1500 CPU side.
Step-by-step instructions illustrate how to set up and optimize a simulated control
loop.
Structure
The following chapters are available for handling FB PID_Compact (FB1130):
Inserting FB PID_Compact (FB1130).
Configuring FB PID_Compact (FB1130).
Commissioning FB PID_Compact (FB1130).
Handling the Lib_controlprocess simulation library is described in the following
chapter:
Inserting a function block of the simulation library.

Copyright

Siemens AG 2013 All rights reserved

Simulation of a controlled-system with several elements.


The chapters decisive for the various scenarios are shown in the following table:
Table 5-1 Necessary configuration steps in the scenarios
Task

Scenario

Description
in chapter (link)

PID_Compact configuration

Chapter 5.1 and chapter 5.2

Commissioning (pre- and fine tuning)

Chapter 5.3.1.

Commissioning without pre- and fine


tuning

Chapter 5.3.2.

Changing the control parameters during


operation.

Chapter 4.3.3.

Inserting a single simulation element.


Interconnecting several controlled
systems.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

Chapter 5.4.

Chapter 5.5.

32

5 Configuration and Settings


5.1 Inserting FB PID_Compact (FB1130)

5.1

Inserting FB PID_Compact (FB1130)

Variants
There are several options of inserting FB PID_Compact into a project as
technology object.
Please note that calling PID_Compact as multi-instance does not generate a
technology object. You can keep using the FB further, however, without graphic
support of the technology object.
Procedure
The table below gives you and option of adding the PID_Compact technology
object to a project.
Table 5-2
No.

Add a cyclic OB ( ), e.g. with a cycle time of 300 ms ( ). The used cycle time is the scan time
of your controller.
To ensure a constant scan time of the controller calling a PID controller must always be executed
in a cyclic OB

Siemens AG 2013 All rights reserved

1.

Action

Copyright

.
2.

In the instructions you double-click an instance of the PID_Compact to add it to any network of
the OB created in step 2.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

33

5 Configuration and Settings


5.1 Inserting FB PID_Compact (FB1130)
No.
3.

Action
Select a name for the instance data block, respectively the technology object.

Note!
When calling the PID_Compact function as multi-instance, no technology object is created.

4.

The FB has now been integrated in the user program.

Copyright

Siemens AG 2013 All rights reserved

Explanation:
A technology object is the comfortable, graphics supported representation of a data block. The
classic display of the data block is possible by clicking on Open DB Editor in the context menu
of the technology object.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

34

5 Configuration and Settings


5.2 Configuration of FB PID_Compact (FB1130)

5.2

Configuration of FB PID_Compact (FB1130)

Parameters
FB PID_Compact already contains many settable parameters in the technology
object.
If you do not wish to use parameters not listed in the technology object (such as
backup parameters, see Table 4-6, step 2), then the help of TIA V12 offers you
support.
Procedure
Table 5-3
No

Action
In the project navigation you open the object Technology objects > [Your_PID_instance] >
Configuration.

2.

In the Basic Settings window, you select the type of the controller (e.g. Temperature). In dropdown menu Input you define whether you wish to use a floating point number or the hexadecimal
value of an analog input as actual value. The Output drop-down list furthermore offers the option
of using a PWM output as manipulated variable.
Furthermore, you define the start behavior of the controller at a CPU new start here. You can
choose between inactive, pretuning, fine tuning, manual or automatic mode.
In addition, you can invert the control direction here. This is necessary, for example, for cooling
since in this case a higher actuating signal (cooling power) reduces the actual value (temperature).

4.

The input parameters are interconnected directly at the block in the user program and cannot be
interconnected in the configuration view of the technology object.

3.

In Process value settings the limits and scaling of the actual value are set.

Copyright

Siemens AG 2013 All rights reserved

1.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

35

5 Configuration and Settings


5.2 Configuration of FB PID_Compact (FB1130)
Action

4.

In Advanced Settings you can also read the current PID parameters and change them, if
necessary. However, you do not need to manually enter these parameters since they are adjusted
during the optimization.
Output value contains the settings for the reaction to errors. You can chose whether the controller
shall be inactive or output a substitute value, or the last valid value for the duration of the error.

5.

Save your changes and load the user program into the CPU via Online > Download and Reset PLC
program.

Copyright

Siemens AG 2013 All rights reserved

No

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

36

5 Configuration and Settings


5.3 Commisisoning FB PID_Compact (FB1130)
A detailed list of the individual parameters including a description is available in the
STEP 7 Professional V12.0 manual in chapter 11.3.3.1 of the SIMATIC STEP 7
Professional V12.0 SP1 manual (\3\). Further help is available by pressing the F1
button, if the PID_Compact block is in focus.

5.3

Commisisoning FB PID_Compact (FB1130)


After your desired configuration settings have been made at the controller, the
controller can be started up.
You can:
use the existing commission tool and have STEP 7 calculate the control
parameters via the pre- and fine tuning (chapter5.3.1).
transfer a calculated control parameter to the controller (chapter 5.3.2).

5.3.1

Commissioning with pre- and fine tuning

Table 5-4 Pre- and fine tuning


No.

Copyright

Siemens AG 2013 All rights reserved

1.

Action
Check whether the correct controller structure
(PI or PID parameters) has been set.
In the individual scenarios, the PID controller
structure is used exclusively.

2.

Via the MOVE command, for example, you


interconnect
the output of the PID controller with the
input of the controlled system.
the output of the controlled system with
the input of the PID controller.

3.

Download the PLC program to your CPU via


Online > Download and Reset PLC program.

4.

In PID_Scenario1 you double-click on


Commissioning.
In Measurement you click on Start.

Note
In project navigation you navigate to
[Your_CPU] > Technology objects >
[Your_PID_Compact]> Configuration > PID
Parameters > Controller structure.
To find the suitable controller for a controlled
system please refer to the expert literature,
such as \3\, page 8624.

In the graphical representation you now see


the values for Setpoint, Input and Output.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

37

5 Configuration and Settings


5.3 Commisisoning FB PID_Compact (FB1130)

Copyright

Siemens AG 2013 All rights reserved

No.

Action

5.

Clicking on Start in Pretuning starts the


pretuning under the following preconditions:
PID_Compact is called up in a cyclic
interrupt OB.
ManualEnable = FALSE.
Reset = FALSE.
PID_Compact is in Manual, Inactive
or Automatic mode
Setpoint and actual value are within the
configured limits.
The difference between setpoint and
actual value is larger than 30% of the
difference between actual value upper
limit and the actual value lower limit.
The distance between setpoint and actual
value is >50% of the setpoint
Note
You can, for example, control the setpoint
value via the watch table:

6.

If the pretuning does not start, an error code or


an error message is output via the Tooltip.
Help for the interpretation of the message is
available in the Online Help of TIA Portal.

7.

After successful pretuning, a fine tuning can


also be performed.
A fine tuning can also be started without
previous pretuning.

Note
Possible pretuning curve:

Possible fine tuning curve:

The parameters of the fine tuning mostly show


a better command and disturbance behavior
than the parameters of the pretuning.
Precondition for a fine tuning:
PID_Compact is called up in a cyclic
interrupt OB.
ManualEnable = FALSE.
Reset = FALSE.
Setpoint and actual value are within the
configured limits.
The control loop is in steady-state at the
operating point.
No failures are expected.
PID_Compact is in Inactive,
Automatic or Manual mode

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

38

5 Configuration and Settings


5.3 Commisisoning FB PID_Compact (FB1130)

5.3.2

Commissioning with given PID parameters


If you do not wish to use the optimization function but your own parameters for the
PID controller, then follow the instructions of the table below.

Table 5-5
No.

Action
In the Technology objects of the Project view you open the configuration window of the
controller you wish to set.

2.

Navigate to PID Parameter and activate the Enable manual entry checkbox.
Now you can enter your parameters for the PID controller.

3.

Then go to the Basic settings, activate the Activate Mode after CPU restart checkbox and
select the Automatic mode entry in the drop-down menu.

Copyright

Siemens AG 2013 All rights reserved

1.

Note!
After the Mode and ModeActivate entries have been interconnected, ensure that Mode = 3
(corresponds to automatic mode).

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

39

5 Configuration and Settings


5.3 Commisisoning FB PID_Compact (FB1130)
No.
4.

Action
Via Online > Download and reset PLC program you load the user program into the CPU.

Copyright

Siemens AG 2013 All rights reserved

Your manually entered parameters are now adopted and the PID_Compact controls the
system with these parameters.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

40

5 Configuration and Settings


5.4 Inserting a function block of the simulation library

5.4

Inserting a function block of the simulation library

Documentation
Document 79047707_Description_RegelSimBib_DOKU_V1_0_en.pdf contains a
description of the STEP 7 V12 library provided with the project.
Procedure
The table below shows, how simulation block FB Sim_PT3 (FB54) is inserted and
configured in a user program. The integration of the other simulation elements is
performed the same way.
Table 5-6 Inserting the system simulation
No.

Action
Unzip the Sim_controlprocess file into a
directory of your choice on the engineering
station.

2.

Open the TIA Portal in the project view.


Open the Libraries tab in the right-hand pane
and click on Open global library.

Siemens AG 2013 All rights reserved

1.

Note

Copyright

Navigate to the storage location of the


extracted folder and double-click to open the
Sim_controlprocess file.

3.

Create a cyclic OB with a cycle time of


300 ms, for example.

4.

Drag the Sim_PT3 block from the Master


copies to the cyclic OB. Create an instance
data block for the function block.
It is necessary that the simulation blocks are
called in a cyclic OB.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

41

5 Configuration and Settings


5.5 Simulation of a controlled system with several elements
No.
5.

5.5

Action

Note

Call the block in the already created cyclic OB


and interconnect the parameters, for example,
as follows:
GAIN = 1.0
TM_LAG1 = 29.0
TM_LAG2 = 17.5
TM_LAG3 = 3.1
CYCLE = 0.3
Also interconnect the Reset input with a
controllable Boolean variable.

Note
Parameter CYCLE must correspond to the
cycle time of the calling OB.

Simulation of a controlled system with several


elements

Interconnecting controlled systems

Copyright

Siemens AG 2013 All rights reserved

The serial or parallel interconnection of controlled systems allows mapping more


complex real processes using the controlled system simulation library.
The process for inserting a control element is analog to the procedure for inserting
a PT3 system described in Table 5-6.
Serial interconnection
As an example, the realization of a controlled system of four serial simulation
elements is described here.
Figure 5-1

Command
variable

PID
Controller

Feedback

The actions for inserting a controlled system from several elements are described
below. Specifically, this is the example from Scenario3.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

42

5 Configuration and Settings


5.5 Simulation of a controlled system with several elements
Table 5-7

Copyright

Siemens AG 2013 All rights reserved

No.

Action

1.

Add the control elements you wish to use as


described in Table 5-6. In Scenario3 these are
the control elements.
PT1 (FB Sim_PT1)
PDT1 (FB Sim_PDT1)
Lagging element (FB Sim_Lagging)
PT2 in the periodical case.
(FB Sim_PT2osz)

2.

Use MOVE commands to interconnect the


outputs of the control elements with the input
of the subsequent respective control element.

3.

As described in The table below gives you and


option of adding the PID_Compact
technology object to a project.
, you add PID_Compact into your project and
interconnect (also via MOVE command) the
output of the controller with the input of the first
control element.
Interconnect the input of the controller with the
output of the last control element.

4.

Now you have set up a complete control loop.


To load the controlled system into the CPU,
you compile your program and load it into the
CPU.
Note
If you wish to view the step response of the
controlled system without a controller, (5) click
on Start (1) in the commissioning window
[Your_CPU] > Technology objects >
[Your_PID] > Commissioning (1). Then set
the PID controller to manual mode (2) and set
a jump for the controlled system (setting the
output to a fixed value (3+4)).

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

Note

43

5 Configuration and Settings


5.5 Simulation of a controlled system with several elements
Parallel interconnection
As an example, the realization of a controlled system consisting of two parallel
simulation elements is described here.
Figure 5-2

Command
variable

PT1
PID
Controller

+
PDT1
Feedback

The control elements both receive the same input signal from the PID controller.
Your output signals are added and returned to the controller.
Table 5-8

Copyright

Siemens AG 2013 All rights reserved

No.

Action

1.

Add the control elements you wish to use as described in Table 5-6. In this
example, these are the following.
PT1 (FB Sim_PT1)
PDT1 (FB Sim_PDT1)

2.

With two Move commands you interconnect the output of the PID controller with
the input
of the PT1 element.
of the PDT1 element.

3.

Add the output values of both controlled systems.

4.

Direct the added and, if necessary, scaled output signal to the PID controller as
an input.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

44

6 Commissioning
6.1 Commissioning with entire hardware

Commissioning
This chapter describes how to start up the attached TIA Portal project.
You can either use the hardware described in chapter 2.4.2 (commissioning see
chapter 6.1) or completely simulate the project with PLCSIM (commissioning see
chapter 6.2).

6.1

Commissioning with entire hardware

6.1.1

Hardware installation
The figure below shows a possible hardware setup of the application. A setup
without the intermediate switch is also possible.
Figure 6-1

CPU 1516-3 PN/DP

Siemens AG 2013 All rights reserved

Field PG

230V
Industrial
Ethernet

Copyright

Switch

PC station

230V

Note

The setup guidelines for SIMATIC S7 systems must generally be met (see also
\6\ and \7\).

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

45

6 Commissioning
6.1 Commissioning with entire hardware
Table 6-1
No.

Action

1.

Fix the switch, the S7-1500 CPU and the


power supply to a DIN rail.

2.

Connect the S7-1500 CPU and the switch to


the power supply.

3.

Connect your engineering PC and the S7-1500


CPU via the X1 interface with the switch via
Ethernet cable.

4.

Supply the power supply with 230V AC.

5.

Set the IP address of the X1 port of the S71500 via the display to the IP address used in
the example (192.168.0.1).
The IP address can be adjusted in the display
via Settings > Addresses >X1 (IE/PN).

Siemens AG 2013 All rights reserved

Note

Copyright

Note

Note
For loading into the CPU the engineering
station should be located in the same subnet.

Here, the application of a field PGs is described as engineering station and PC


station at the same time.
Alternatively, the application of a rack PC, for example, for visualization is
possible.

6.1.2

Installation of the software


This chapter describes the steps for the installation of the used programs.

Table 6-2 Installation of the software components


No.

Action

Note

1.

Install STEP 7 Professional V12.0

Please follow the notes of the system manual:


\3\

2.

Install WinCC Professional V12

Please follow the notes of the system manual:


\8\

3.

Download the
79047707_PID_CompactV2_CODE_
v10.zip example project from the
Siemens Online Support page.

You can find the entry under the following link:


http://support.automation.siemens.com/WW/view/en/790
47707

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

46

6 Commissioning
6.1 Commissioning with entire hardware

6.1.3

Configuring the hardware

Renaming the engineering station


The following table shows the procedure for changing the PC name in Windows 7:
Table 6-3 Renaming the engineering station
Action

1.

To download WinCC Runtime into your


engineering station, the engineering station
must have the PC name used in the project
(VisuPC).

2.

Click on Start. Go the Computer context


menu and click on Properties. In the
following window you click on Change
settings below Computer name, domain and
workgroup settings.

3.

In the System properties you select


Change and then enter the new computer
name VisuPC in the respective field.

4.

Acknowledge and restart your engineering


station to adopt the computer name.

Note
Alternatively, you can also adjust the name to
your engineering station in the project.

Setting the IP address of the engineering station

Copyright

Siemens AG 2013 All rights reserved

No.

When using the engineering station simultaneously as PC station for the


visualization, you need to assign the IP address given in the project to the
engineering station:
Table 6-4 Assigning the IP addresses
No.

Action

1.

Open Start > Control Panel > Network and


Sharing Center

2.

Click on Change Adapter Settings and then


select Properties in the context menu of your
Ethernet adapter.

3.

Select Internet Protocol Version 4 and


change the IP address as follows:
IP address: 192.168.0.251
Subnet mask: 255.255.255.0

4.

Confirm the change with OK.


Now your engineering station has the same IP
address as assigned in the
79047707_PID_CompactV2 project.

5.

Also set your PG/PC interface Start > Control


Panel > Set PG/PC Interface to TCP/IP and
the network adapter assigned by you.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

Note

47

6 Commissioning
6.1 Commissioning with entire hardware

6.1.4

Opening and downloading the TIA Portal project

Table 6-5
Action

1.

Download the
79047707_PID_CompactV2_CODE_v1_0.zip
file to your engineering station and unzip the
folder.

2.

In the program folder you double-click on the


79047707_PID_CompactV2.ap12 icon.
Now the project opens in TIA V12.

3.

Go to the project view. Click on CPU


PID_Compact_CPU1516 and load the user
program into the CPU via Online > Download
and Reset PLC program.

4.

When downloading the program for the first


time, you need to specify your interface and
the subnet for the download. Then select the
CPU to be downloaded.

5.

Compile the visualization by clicking on the


context menu of WinCC RT Advanced >
Compile > Software (Rebuild all)

6.

Click on the VisuPC PC station and start


WinCC Runtime via the respective icon for a
graphic representation of the scenarios.

7.

Now you can monitor the individual tags and


the course of the setpoint / actual / and output
values of the PID controllers.

Copyright

Siemens AG 2013 All rights reserved

No.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

Note

A description of the WinCC interface is


available in chapter 7.

48

6 Commissioning
6.2 Commissioning with PLCSIM V12

6.2

Commissioning with PLCSIM V12

NOTICE

6.2.1

In order to start up the project with PLCSIM, scenario 2 and hence block FB
Sim_TempProcess (FB58) must be removed from the project. The FB
Sim_TempProcess (FB58) block is know-how protected and can
therefore not be simulated in PLCSIM V12.

Installation of the software


This chapter describes the steps for the installation of the used programs.

Table 6-6 Installation of the software components

Copyright

Siemens AG 2013 All rights reserved

No.

Action

Note

1.

Install STEP 7 Professional V12


SP1

Please follow the notes of the system manual: \3\

2.

Install PLCSIM V12 SP1

Please follow the notes of the system manual: \3\

3.

Install WinCC Professional V12


SP1

Please follow the notes of the system manual:\8\

4.

Download the
79047707_PID_CompactV2_CO
DE_v10.zip example project from
the Siemens Online Support page.

You can find the entry under the following link:

6.2.2

http://support.automation.siemens.com/WW/view/en/7
9047707

Configuring the engineering station

Changing the PG/PC interface


Table 6-7
No
.

Action

1.

Go to Control Panel via Start


> Control Panel and select
the Set PG/PC Interface
icon.

2.

Set your PG/PC interface to


S7ONLINE (STEP7)
PLCSIM S7-1200/S7-1500
(TCP/IP).

3.

Confirm the interface by


clicking OK. Also
acknowledge the following
warning messages.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

Note

49

6 Commissioning
6.2 Commissioning with PLCSIM V12
Starting PLCSIM V12
Table 6-8
No.

Action
Start by double-clicking on the PLCSIM V12
icon.

2.

Generate a new project and save it on your


local hard drive.
After selecting a name, the new project is
created by clicking on Create.

3.

This makes the simulated CPU ready to


operate.
Clicking on the button for the compact view
gives you a good overview of the current
operating state of the simulated CPU.

Copyright

Siemens AG 2013 All rights reserved

1.

Note

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

50

6 Commissioning
6.2 Commissioning with PLCSIM V12

6.2.3

Opening and downloading the TIA Portal project

Table 6-9

Copyright

Siemens AG 2013 All rights reserved

No.

Action

1.

Unzipping the
79047707_PID_CompactV2_CODE_v10.zip
file in any folder of your engineering station.

2.

Double-click on the
79047707_PID_CompactV2.ap12 icon.
The TIA V12 project opens.

3.

Click on CPU PID_Compact_CPU1516 and


load the user program into the CPU via Online
> Extended download to device.
Select the following interface to the download:
Type of PG/PC interface: PN/IE
PG/PC interface: PLCSIM S7-1200/S7-1500
Connection to subnet: PN/IE_1

4.

Click on the VisuPC PC station and start


WinCC Runtime via the respective icon for a
graphic representation of the scenarios.

5.

Now you can monitor the individual tags and


the course of the setpoint / actual / and output
values of the PID controllers.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

Note

A description of the WinCC interface is


available in chapter 7.

51

7 Operating the Application


7.1 Overview

Operating the Application

7.1

Overview
For a better overview regarding the behavior of the implemented scenarios, several
options are available to the user:
Insight into the behavior of the control loops via the HMI system WinCC
Runtime Advanced.
Detailed insight into the current status of the control loop by the watch tables
already prepared in the CPU.

7.2

Operation via WinCC Runtime

7.2.1

Operating units
The various scenarios can be selected from the start screen of the WinCC Runtime
system running in PC station VisuPC.
Table 7-1
No.

Element

1.

Curve display of setpoint, actual value and controller output.

2.

Output of the setpoint value; manual input is possible.

3.

Output of the currently used PID parameters.

Copyright

Siemens AG 2013 All rights reserved

The pictures of WinCC-Runtime contain the following elements:

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

52

7 Operating the Application


7.2 Operation via WinCC Runtime
Element

4.

Output of the PID controller.

5.

Overview screen of the control loop with current values.

6.

Selection switch between manual and automatic mode of the PID controller. The
output value is given in manual mode via Manual value.
In automatic mode, the PID controller controls the output value.

7.

Navigation switch for the overview screen and for stopping WinCC Runtime.

Copyright

Siemens AG 2013 All rights reserved

No.

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

53

7 Operating the Application


7.2 Operation via WinCC Runtime

7.2.2

Monitoring scenario 3 with WinCC


After starting up the project, all three scenarios can be monitored via WinCC.
Table 7-2 describes a possible monitoring scenario for Scenario3.

Table 7-2
Action

1.

Start the visualization and select Scenario3 in the start screen.

2.

In order to initially monitor a step response of the controlled system, select manual mode (
Set the Manual output to any value (

Copyright

Siemens AG 2013 All rights reserved

No.

).

).

Now you can monitor step response of the controlled system for the excitation:

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

54

7 Operating the Application


7.3 Operator control and monitoring via the online access
No.
3.

Action
For monitoring the control behavior, you select the automatic mode (
value (

) and define a setpoint

).

1
2

Copyright

Siemens AG 2013 All rights reserved

Now you can monitor the behavior of the control loop:

7.3

Operator control and monitoring via the online access

Overview
You can analyze the S7 program of the CPU via the online access on the CPU and
the monitoring of blocks.
Watch tables
Three watch tables have already been inserted into the project as a support, which
respectively contain important parameters of the individual blocks on the individual
scenarios. You reach the watch table via 79047707_PID_CompactV2 >
PID_Compact_CPU1516 > Watch and force tables):
WatchTable_Scenario1
WatchTable_Scenario2
WatchTable_Scenario3

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

55

8 Related Literature

Related Literature

Book directory
Table 8-1
Topics
\1\

Title

Controlling with SIMATIC

Practice book for SIMATIC S7 and SIMATIC PCS7 control


systems
Authors: Mller/ Pfeiffer/ Wieser
Publicis Publishing, Erlangen
ISBN: 978-3-89578-340-1

Link directory
Table 8-2
Title

\1\

Reference to this document

http://support.automation.siemens.com/WW/view/en/79047707

\2\

Siemens Industry Online


Support

http://support.automation.siemens.com

\3\

SIMATIC
STEP 7 Professional V12.0
SP1
System manual

http://support.automation.siemens.com/WW/view/en/77991795

\4\

SIMATIC STEP 7 Professional


V12.0
System manual
Chapter 11.3 PID control

https://www.automation.siemens.com/mdm/default.aspx?DocVersi
onId=51499858571&Language=deDE&TopicId=49233574283&guiLanguage=en

\5\

SIMATIC
S7-1500 Automation system
S7-1500
System manual

http://support.automation.siemens.com/WW/view/en/59191792

\6\

SIMATIC
Installing the assembly
Getting Started

http://www.automation.siemens.com/salesmaterial-as/interactivemanuals/getting-started_simatic-s71500/documents/EN/mount_en.pdf

\7\

SIMATIC
Wiring
Getting Started

http://www.automation.siemens.com/salesmaterial-as/interactivemanuals/getting-started_simatic-s71500/documents/EN/wire_en.pdf

\8\

WinCC Professional V12 SP1


System manual

http://support.automation.siemens.com/WW/view/en/78327231

Copyright

Siemens AG 2013 All rights reserved

Topics

History
Table 9-1
Version

Date

V1.0

09/2013

Controlling with PID_Compact


Version V1.0 , Entry ID: 79047707

Modifications
First version

56