79047707 Regeln Pid Compactv2 Doku v1 0 En

Embed Size (px)

DESCRIPTION

PID siemens

Citation preview

  • Applications & Tools

    Answers for industry.

    Controlling with PID_Compact V2

    SIMATIC S7-1500

    Application Description y September 2013

  • Warranty and Liability

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 2

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Warranty and Liability

    Note The Application Examples are not binding and do not claim to be complete withregard to configuration, equipment or any contingencies. The applicationexamples do not represent customer-specific solutions; they are only intended toprovide support for typical applications. You are solely responsible for the correctoperation of the described products. These Application Examples do not relieveyou of the responsibility to use safe practices in application, installation,operation and maintenance. Through using these Application Examples, youacknowledge that we will not be liable for any damage/claims beyond the liabilityclause described. We reserve the right to make changes to these ApplicationExamples at any time without prior notice. If there are any deviations betweenthe recommendations provided in these Application Examples and otherSiemens publications e.g. Catalogs the contents of the other documentshave priority.

    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 ofthe examples, information, programs, engineering and performance data etc.,described in this Application Example shall be excluded. Such an exclusion shallnot apply in the case of mandatory liability, e.g. under the German Product LiabilityAct (Produkthaftungsgesetz), in case of intent, gross negligence, or injury of life,body or health, guarantee for the quality of a product, fraudulent concealment of adeficiency or breach of a condition which goes to the root of the contract(wesentliche Vertragspflichten). The damages for a breach of a substantialcontractual obligation are, however, limited to the foreseeable damage, typical forthe type of contract, except in the event of intent or gross negligence or injury tolife, body or health. The above provisions do not imply a change in the burden ofproof to your disadvantage.Any form of duplication or distribution of these Application Examples or excerptshereof is prohibited without the express consent of Siemens Industry Sector.

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

  • 1 Task Description

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 3

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Table of ContentsWarranty and Liability ................................................................................................. 2

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

    2 Solution............................................................................................................... 6

    2.1 Overview............................................................................................... 62.2 Scenarios of the application ................................................................. 72.3 Visualization user interface .................................................................. 92.4 Hardware and software components ................................................. 102.4.1 Validity ................................................................................................ 102.4.2 Components used .............................................................................. 10

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

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

    4.1 Structure of the example project ........................................................ 134.2 Scenario 1: Calling up and commissioning PID_Compact .............. 164.2.1 Task: controlling a simulated PT3 system .......................................... 164.2.2 Procedure ........................................................................................... 164.2.3 Controlled system: Scenario1 ............................................................ 174.3 Scenario 2: temperature control with split-range block ...................... 194.3.1 Task: controlling a simulated asymmetrical temperature system ...... 194.3.2 Procedure ........................................................................................... 204.3.3 FB Scenario2_SplitRange (FB201) ................................................. 244.4 Scenario 3: simulation and control of a complex controlled

    system ................................................................................................ 294.4.1 Task: controlling a simulated complex controlled system .................. 294.4.2 Procedure ........................................................................................... 31

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

    5.1 Inserting FB PID_Compact (FB1130) .............................................. 335.2 Configuration of FB PID_Compact (FB1130) .................................. 355.3 Commisisoning FB PID_Compact (FB1130) ................................... 375.3.1 Commissioning with pre- and fine tuning ........................................... 375.3.2 Commissioning with given PID parameters ....................................... 395.4 Inserting a function block of the simulation library ............................. 415.5 Simulation of a controlled system with several elements ................... 42

    6 Commissioning ................................................................................................ 45

    6.1 Commissioning with entire hardware ................................................. 456.1.1 Hardware installation .......................................................................... 456.1.2 Installation of the software.................................................................. 466.1.3 Configuring the hardware ................................................................... 476.1.4 Opening and downloading the TIA Portal project .............................. 486.2 Commissioning with PLCSIM V12 ..................................................... 496.2.1 Installation of the software.................................................................. 496.2.2 Configuring the engineering station ................................................... 496.2.3 Opening and downloading the TIA Portal project .............................. 51

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

    7.1 Overview............................................................................................. 527.2 Operation via WinCC Runtime ........................................................... 527.2.1 Operating units ................................................................................... 527.2.2 Monitoring scenario 3 with WinCC ..................................................... 547.3 Operator control and monitoring via the online access ...................... 55

  • 1 Task Description

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 4

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

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

    9 History............................................................................................................... 56

  • 1 Task Description

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 5

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    1 Task DescriptionIntroduction

    Influencing technical variables in systems requires controlling these variables.There are miscellaneous uses for controllers in automation technology, forexample, for controlling temperatures in processes.In the SIMATIC world, the PID_Compact block of version 2.0 is provided for theS7-1500 CPUs for controlling processes.

    Overview of the automation taskThe automation task consists of setting up a control loop for influencing physicalparameters in a technological process. The control loop shall consist of thefollowing elements here:x PID_Compact as controller.x Simulated technological processes as controlled system.

    Figure 1-1

    Simulation LibrarySim_controlprocess

    PID_CompactController

    Controlledsystem

    Step response

    The following requirements are posed to the application:x Configuration and settings of the software controller (PID_Compact block)

    should be explained.x Optimization options of the PID_Compact shall be illustrated.x The usage of the Sim_controlprocess simulation library and simulation of

    technological processes shall be illustrated.x A split-range controller shall be programmed for controlling a temperature

    system.

  • 2 Solution2.1 Overview

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 6

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    2 Solution2.1 Overview

    Schematic layoutThe following scheme shows the most important components of the solution:

    Figure 2-1

    PC station:HMI visualization ofthe scenarios

    PC station:HMI visualization ofthe scenarios

    Industrial Ethernet

    Field PG

    CPU 1516-3 PN/DP

    PC station

    TIA V12

    S7-1500 CPU:Program withPID_Compact andsystem simulation

    PC-Station:HMI visualizationof the scenarios(WinCC Runtime)

    Field PG:Configuration andStartup

    Simulation librarySIM_controlprocess

    PID_Compactcontroller

    Controlledsystem

    For demonstrating the application task, a controller is realized by the S7-1500using 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.

    AdvantagesThis application offers you the following advantages:x Step by step description for the initial commissioning of a PID_Compact

    controller.x Fast introduction into handling the functions of the PID_Compact.x Time and cost reduction by simulating controlled systems using the controlled

    system library Sim_controlprocess.x Adjustable split-range block for controlling with PID_Compact.

  • 2 Solution2.2 Scenarios of the application

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 7

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Topics not coveredThis application does not include a description ofx STEP 7 V12x WinCC Runtime Professional V12x SCL programming languageBasic knowledge of these topics is assumed.

    2.2 Scenarios of the application

    Structure of the applicationThe STEP 7 project is divided into three scenarios, which are used for explainingvarious aspects of handling the PID_Compact function and theSim_controlprocess simulation library for controlled systems.

    ScenariosThe following scenarios are realized for a clearer understanding:

    Table 2-1

    No. Scenario Content of the scenario

    1 Controlling of a PT3 system simulationwith the help of PID_Compact.

    x Configuring the PT3 systemsimulation.

    x Configuration and settings ofPID_Compact.

    x Commissioning the PID_Compactwith pretuning and fine tuning

    2 Controlling of an asymmetricaltemperature system simulation. Thecontrolled system simulates heating andcooling processes with different timeconstants.

    x Calling the asymmetricaltemperature system simulation.

    x Experimental determination of thecontrol parameters forPID_Compact.

    x Commissioning the PID_Compactas split-range controller with givenparameters (without pre- and finetuning).

    3 Controlling a complex controlled systemconsisting of PT1, PDT1, lagging, andPT2 element.

    x Interconnecting the individualsystem simulations.

    x Commissioning the PID_Compactwith pretuning and fine tuning

  • 2 Solution2.2 Scenarios of the application

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 8

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Thematic content of the scenariosThe following table provides an overview of the tasks existing in the scenarios. Theright column contains the reference to the step-by-step instruction of the task in thedocumentation.

    Table 2-2

    Task Scenario Descriptionin chapter (link)1 2 3

    PID_Compact configuration X X X Chapter 5.1 and chapter 5.2Commissioning (pre- and fine tuning) X X Chapter 5.3.1.Commissioning without pre- and finetuning

    X Chapter 5.3.2.

    Changing the control parameters duringoperation.

    X Chapter 4.3.3.

    Inserting a single simulation element. X X X Chapter 5.4.Interconnecting several controlledsystems.

    X Chapter 5.5.

  • 2 Solution2.3 Visualization user interface

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 9

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    2.3 Visualization user interface

    WinCC RuntimeIn the PC station of the TIA project, a visualization interface (WinCC Runtime) isprovided for operating the examples.Using WinCC Runtime enables:x monitoring the state of the scenarios of the projectx modifying individual tags of the scenarios.

    Overview screenThe figure below shows the visualization interface of WinCC Runtime: a detaileddescription of WinCC Runtime is available in chapter 7.2.

    Figure 2-2 Overview screen WinCC Runtime scenario 1

  • 2 Solution2.4 Hardware and software components

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 10

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    2.4 Hardware and software components

    2.4.1 Validity

    This application is valid forx STEP 7 as of V12x S7-1500 as of FW 1.0

    2.4.2 Components used

    This application has been generated using the following components:

    Hardware componentsTable 2-3

    Component No. Order number Note

    PS 25W 24VDC 1 6ES7 505-0KA00-0AB0 Alternatively, other powersupplies can also be used.

    CPU 1516-3 PN/DP 1 6ES7 516-3AN00-0AB0 Alternatively, other CPUs fromthe S7-1500 spectrum canalso be used.

    PC station 1 e.g. 6ES7647-6C...-.... Here, any PC station withappropriate software can beused.

    Software componentsTable 2-4

    Component No. Order number Note

    STEP 7 V12 SP1(TIA Portal V12)

    1 6ES78221AE02-0YA5 Component for programmingthe S7-1500.

    WinCC V12 SP1Professional(TIA Portal V12)

    1 6AV2103-0DA02-0AA5 Component for configuring thevisualization.

    Sample files and projectsThe 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 theSTEP7 project.

    79047707_Sim_controlprocess_lib.zip Controlled systemsimulation librarySim_controlprocess

    79047707_Regeln_PID_CompactV2_DOKU_v1_0_en.pdf This document.79047707_Description_RegelSimBib_DOKU_V1_0_en.pdf Description of the

    controlled systemsimulation librarySim_controlprocess

  • 3 Basics on Control Engineering

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 11

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    3 Basics on Control EngineeringOverview

    Control engineering is an engineering science researching how to influencespecific given parameters in technological systems, with the aim of reaching andmaintaining 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 withbasics on control technology in chapter 11.3 (\4\).

    Controlled systemA controlled system contains the parameter to be controlled, such as thetemperature of a room. In order to identify the type of a system and thendynamically controlling it in an optimal way requires a precise analysis of thesystem to be controlled.One possibility of identification is to look at the step response of a controlledsystem. The picture below depicts the example of a PTn system (temperature in aroom, for example).The time behavior can be defined approximately by the parametersx Delay time Tux Compensation time Tgx Maximal value XmaxFigure 3-1 Step response PTn system

    Tu Delay timeTg Compensation timey Output valuex Actual value

  • 3 Basics on Control Engineering

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 12

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    ControllerThe controller controls an actuator to bring the controlled system to a desirablestate. The simplest controllers are two-point controllers, which only know the statesON and OFF and control the controlled system via the actuator.The frequently used PID controllers consist of three parts:x The P-part creates an output signal proportional to the control deviation:x The I-part integrates the control deviation over time and affects the controlled

    system due to this integration.x 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 coefficientsproportional gain, reset time and rate time.With the PID_Compact and PID_3Step blocks, SIMATIC S7-1500 already offersa possibility integrated into the firmware of the software control.

    Note In this application, PID_Compact is used. Further information on PID_3Step isavailable in the manual \3\ and in the help of the TIA Portal.

    Control loopThe control deviation between setpoint and actual value is determined and amanipulated variable derived from it. The manipulated variable acts on thecontrolled system via an actuator (see Figure 3-2).

    Figure 3-2 Control loop, single-loop

    A simple example for a control loop is the control of the room temperature througha 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 calculatesan output value (control value) for controlling the heater.

    Controller Controlledsystem

    Control deviation ControlvariableSetpoint

    Actualvalue

    -

  • 4 Mode of Operation4.1 Structure of the example project

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 13

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    4 Mode of OperationStructure

    This chapter introduces the individual scenarios of the STEP 7 program anddescribes the individual blocks in greater detail.The exact behavior of the three scenarios is described and a picture of the entirecontrol loop provided.

    ConfigurationThis chapter does not describe the configuration, commissioning and optimizationof PID_Compact. For respective step-by-step instructions please refer tochapter 5.

    4.1 Structure of the example project

    ScenariosThe example project consists of the scenarios which are named in chapter 2.2 andare independent of each other.

    Program overviewThe S7 program of the CPU 1516-3 PN/DP is set up as follows:Figure 4-1

    OB100Startup

    OB30Scenario1

    OB31Scenario2

    OB32Scenario3

    FBSim_PT3

    FBPID_Compact

    FBSim_PT3

    FBPID_Compact

    FBSim_PT3

    FBScenario2_Split

    Range

    FBSim_TempProc

    ess

    FBSim_PT3

    FBSim_PT3

    FBSim_PT3

    Initiali-zation

    Scenario1

    Scenario2

    Scenario3

  • 4 Mode of Operation4.1 Structure of the example project

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 14

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    AssignmentWith 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 theexisting scenarios.

    User blocksTable 4-1 Blocks and instructions of the simulation library

    Element Symbolic name Description

    OB100 Startup Startup OB:Initializes the program

    OB30 Scenario1 Cyclic OB. Realizes the scenariodescribed in chapter 4.2:Controlling a PT3 system with a PIDcontroller

    Sce

    nario

    1

    DB2 PID_Scenario1 Instance DB for the PID_Compactblock

    DB100 Param_Scenario1 Block with parameters for supplying theblock 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 scenariodescribed in chapter 4.3:Control of a simulated controlledtemperature system using a split-rangeblock.

    Sce

    nario

    2

    DB7 PID_Scenario2 Instance DB for the PID_Compactblock

    DB200 Param_Scenario2 Block with parameters for supplying theblock 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 FBScenario2_SplitRange (FB201)

    FB58 Sim_TempProcess Simulation of an asymmetricaltemperature system.

    DB202 Sim_TempProcess_DB Instance DB of the FBSim_TempProcess (FB58)

    OB32 Scenario3 Cyclic OB. Realizes the scenariodescribed in chapter 4.4:Controlling a simulated controlledsystem consisting of PT1, PDT1,lagging, and PT2 element using thePID_Compact block.

    Sce

    nario

    3

    DB6 PID_Scenario3 Instance DB for the PID_Compactblock

    DB300 Param_Scenario3 Block with parameters for supplying theblock call in scenario 3.

  • 4 Mode of Operation4.1 Structure of the example project

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 15

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    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; calledup in each scenario.In this application, it is always used as PIDand not as PI controller.

    Blocks of simulation library Sim_controlprocessIn the project, blocks from the Sim_controlprocess simulation library are alsoused which are provided on the same HTML page as this document.The following blocksx Sim_PT3x Sim_TempProcessx Sim_PT1x Sim_PDT1x Sim_Laggingx Sim_PT2oszoriginate from the library. The simulation library offers you further simulation blocksfor the simulation of controlled systems.An exact description of the individual simulation blocks is available in the document79047707_Beschreibung_RegelSimBib_ DOKU_V1_0_en.pdf

    Software controller FB PID_Compact (FB1130)System block PID_Compact (FB1130) realizes a PID software controller with thefollowing interface:Figure 4-2

    For a detailed description of FB PID_Compact (FB1130) and its parameters,please use the help of the TIA Portal.

  • 4 Mode of Operation4.2 Scenario 1: Calling up and commissioning PID_Compact

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 16

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    4.2 Scenario 1: Calling up and commissioningPID_Compact

    4.2.1 Task: controlling a simulated PT3 system

    TaskThe task is to illustrate how to simulate a controlled PT3 system with the simulationlibrary.The controlled PT3 system shall be controlled with the PID_Compact block.

    Principle schemeFigure 4-3

    PIDController

    Controlled PT3system

    Controlparameter

    Feedback

    Controlvariable

    Step responseThe figure below shows the step response of the controlled PT3 system at a jumpof the input from 050:Figure 4-4

    Setpoint valueActual value(step response)

    4.2.2 Procedure

    OverviewThe following tasks need to be implemented for realizing the user program:x Inserting and configuring the PT3 system simulation into the user program.x Adding the PID_Compact block in the user program.x Configuring the PID_Compact block.x Commissioning the software controller with pretuning and fine tuning.

    Step-by-step instructionThe respective step-by-step description for the individual processes is available inchapter 5.

  • 4 Mode of Operation4.2 Scenario 1: Calling up and commissioning PID_Compact

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 17

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Note If you do not wish to individually reprogram the processes as described inchapter 5, you can also access the example project directly. The example projectcontains the already commissioned scenario1.

    4.2.3 Controlled system: Scenario1

    OverviewAfter commissioning the example project, as described in chapter 6, you candirectly monitor the behavior of the controlled system.

    Parameters and formula for PID_CompactThe following parameters are active in the PID_Compact software controller afterthe fine tuning:Table 4-2 Symbols and parameters

    Symbol Description Value

    GAIN,Kp

    Proportional gain 10.770338

    TI Integration time 21.10933TD Derivative time 5.337515a Derivative time lag coefficient 0.1b Weighing of P component 0.2586402c Weighting of D component 0.0y Output value of the PID algorithm -s Laplace operator -w Setpoint value -x Actual value -

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

  • 4 Mode of Operation4.2 Scenario 1: Calling up and commissioning PID_Compact

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 18

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Monitoring the controlled systemChapter 7 describes how to monitor and control the controlled system via WinCCRuntime Advanced using the provided visualization.

    Control behavior of the systemAfter commissioning Scenario1, the following behavior results for a setpoint jumpfrom 050%:

    Figure 4-5

  • 4 Mode of Operation4.3 Scenario 2: temperature control with split-range block

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 19

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    4.3 Scenario 2: temperature control with split-range block

    4.3.1 Task: controlling a simulated asymmetrical temperature system

    TaskA simulated temperature process shall be controlled with different characteristicvalues for heating and cooling using a PID controller.Processes controlled by two different actuators (heating and cooling) can becontrolled by a split-range controller. A split-range controller divides its outputbetween two different actuators.A block shall be developed for realizing the PID_Compact as a split-rangecontroller.

    Principle schemeThe simulated temperature process internally consists of two asymmetrical PT1elements.Figure 4-6

    PIDController Temp_Process

    Command

    variable

    Feedback

    Parameter setHeating

    Heating

    Cooling

    Controlvariable

    Parameter setCooling

  • 4 Mode of Operation4.3 Scenario 2: temperature control with split-range block

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 20

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    The developed split-range block FB Scenario2_SplitRange (FB201) scales theinput 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 temperaturesystem.The output of the PID controller is split according to the following principle:

    Figure 4-7

    Outputcontroller (%)

    25 50 75

    Heating output(in %)

    50

    100

    50

    100

    0

    Heating

    Cooling

    Cooling output(in %)

    A detailed description of FB Scenario2_SplitRange (FB201) is available inchapter 4.3.3.

    4.3.2 Procedure

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

  • 4 Mode of Operation4.3 Scenario 2: temperature control with split-range block

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 21

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Simulation of the subsystemTo obtain the parameter records for the PID controller, heating and cooling isrespectively simulated as PT1 system.The actions described in Table 5-2 are performed with the following frameconditions:x Ambient temperature: 22Cx Maximum heating power: 50 (Watt)x Maximum cooling power: 50 (Watt)x 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

    No. Action

    1. As described in chapter 5.4, the controlled Sim_TempProcess system from theLib_controlprocess library is inserted.

    2. The characteristic value readings for heating and cooling the system are determined byexperiment.

    Procedure:x Creating a jump of the heating/cooling power at the input of the simulation block.x Reading the characteristic values from the respective jump response

    Readings for characteristic heating values:x k = 0.28x T = 28.6s (for 0.63*end value)

    Readings for characteristic cooling values:x k = 0.53x T = 16.6s (for 0.63*end value)

  • 4 Mode of Operation4.3 Scenario 2: temperature control with split-range block

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 22

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    No. Action

    3. 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:x Inserting a PT1 system with the parameters from 2.x Inserting PID_Compact.x Configuring PID_Compact.x Commissioning PID_Compact.The parameters received after the fine tuning are read (see Table 4-4) and used for the split-rangecontroller.

    PID parametersThe following parameter sets for the PID controller were determined by experiment(see Table 4-3):Table 4-4 Parameter sets heating and cooling

    PT1 system:heating

    PT1 system:cooling

    GAIN 20.48825 11.07108TI [s] 2.595915 2.630034TD [s] 0.6573617 0.6651893a 0.1 0.1b 0.2560457 0.2581466c 0.0 0.0

    The determined parameters are used for controlling using the split-range blockScenario2_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 inchapter 5, you can also access the example project directly. The example projectcontains the already started scenario2.

  • 4 Mode of Operation4.3 Scenario 2: temperature control with split-range block

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 23

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Step-by-step descriptionStep-by-step instructions for commissioning the controlled temperature system areavailable in chapter 5.

    Monitoring the controlled systemChapter 7 describes how to monitor and control the controlled system via WinCCRuntime Advanced using the provided visualization.

    Control behavior of the systemYou receive the following behavior at the inputs and outputs of the controller if thesetpoint value at FB Scenario2_SplitRange (FB201) is reduced from 22C to10C.Figure 4-8

  • 4 Mode of Operation4.3 Scenario 2: temperature control with split-range block

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 24

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    4.3.3 FB Scenario2_SplitRange (FB201)

    FunctionUsing a call of PID_Compact, FB Scenario2_SplitRange (FB201) realizes asplit-range control which controls two actuators (heating and cooling).For a certain output range of the software controller (0-50%), the cooling iscontrolled from 100-0% of its maximal cooling power. For the output range between50-100% at the controller, the heating is controlled to 0-100% of the maximalheating output (see Figure 4-7).

    ParameterThe interface of FB Scenario2_SplitRange (FB201) looks as follows: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 thePID_Compact output to the temperature system.

    max_Cool IN:Real

    Maximum cooling power. Parameter for scaling thePID_Compact output to the temperature system.

    Output_rel OUT:Real

    Output of the PID controller; value between 0% and100%.

    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).

  • 4 Mode of Operation4.3 Scenario 2: temperature control with split-range block

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 25

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Mode of OperationFB Scenario2_SplitRange (FB201) can be divided into the following steps:Figure 4-10

    StartScenario2_SplitRange

    Loading PIDparameters from DB

    noCorrect PID parameters

    loaded?

    Reset all outputs to 0

    yes

    no yes

    PID_Compact call

    Calculation andscaling of the

    output valuesOutput

    1

    2

    5

    3

    6

    PID_Compact inautomatic mode

    ?

    4

    Nextcycle

    Nex

    tcyc

    le

    Table 4-6

    Step Action Note

    1 Query, whether the required parametershave already been loaded.

    The parameters to be loaded depend onthe last output of PID_Compact.50% Parameters for heating

    2 From the storage in the data block, theparameters are first loaded into thebackup parameters and then adopted toPID_Compact withLoadBackUp:=TRUE.

    As a standard, the parameters are usedfrom the following storage:x Param_Scenario2".Sets.Set1

    (heating)x Param_Scenario2".Sets.Set2

    (cooling)3 The software controller PID_Compact

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

    4 Query, whether the PID_Compactblock is in automatic mode.

    5 If PID_Compact is not operated inautomatic mode, then all outputs are setto 0.

    6 The outputs are calculated,standardized, scaled and then output.The relative output of PID_Compact

    Figure 4-7 shows this stepschematically.

  • 4 Mode of Operation4.3 Scenario 2: temperature control with split-range block

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 26

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Step Action Note(between 0-100%) is output.

    CommissioningCommissioning the FB Scenario2_SplitRange (FB201) is not possible via pre-and 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.Table 4-6 shows the commissioning of FB Scenario2_SplitRange (FB201). Thefunction block has already been inserted in the example project.

  • 4 Mode of Operation4.3 Scenario 2: temperature control with split-range block

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 27

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Table 4-7

    No. Action

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

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

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

  • 4 Mode of Operation4.3 Scenario 2: temperature control with split-range block

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 28

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    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, thenyou 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.

    AlternativeYou can also control an asymmetrical temperature system through other methodsthen a split-range controller.One possibility is the application of two separate PID_Compact controllers withdefault parameter sets which only control the respective actuator heating orcooling.

  • 4 Mode of Operation4.4 Scenario 3: simulation and control of a complex controlled system

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 29

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    4.4 Scenario 3: simulation and control of a complexcontrolled system

    4.4.1 Task: controlling a simulated complex controlled system

    TaskUsing the controlled system simulation library Sim_controlprocess, a morecomplex controlled system shall be simulated and controlled by the PID_Compactblock. Commissioning shall be performed via the pretuning and fine tuningfunction.

    The controlled system shall consist of the following elements:Table 4-8

    Type Schematic step response Example:real process

    PT1 element Controlled system speed,inverter

    PDT1 element Application for jump-capablesystems

    Lagging element (lagg) Conveying system, drive

    PT2 element (periodically)Vibration-capablemechanical system,lifting/rotary motions

    Note Simulating a real controlled system can help save time and costs duringcommissioning!

  • 4 Mode of Operation4.4 Scenario 3: simulation and control of a complex controlled system

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 30

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Principle schemeThe more complex controlled system consists of the following elements:Figure 4-11

    PIDController

    Command

    variable

    Feedback

    PT1 PDT1

    Lagg PT2osz

    Controlvariable

    Controlled system

    Step responseThe step response of the combined controlled system is displayed below:Figure 4-12

    JumpStep 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 - - - 15Periodic PT2 0.4 0.2 1.0 -

  • 4 Mode of Operation4.4 Scenario 3: simulation and control of a complex controlled system

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 31

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    4.4.2 Procedure

    OverviewThe procedure for this scenario corresponds to that in scenario 1:x Inserting and configuring the individual elements of the controlled system into

    the program.x Adding the PID_Compact software controller, configuring and starting up.

    Note If you do not wish to individually reprogram the processes as described inchapter 5, you can also access the example project directly. The example projectcontains the already commisioned PID_Compact.

    Step-by-step descriptionFor the step-by-step description, please refer to chapter 5.

    Monitoring the controlled systemChapter 7 describes how to monitor and control the controlled system via WinCCRuntime Advanced using the provided visualization.

    PID_Compact parameterThe following fine-tuned parameters result for the PID_Compact block:Table 4-10 Parameter set of a complex controlled system

    PID_Compact

    GAIN 0.2142379TI [s] 4.044378TD [s] 0.8554038a 0.1b 1.0c 0.0

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

  • 5 Configuration and Settings4.4 Scenario 3: simulation and control of a complex controlled system

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 32

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    5 Configuration and SettingsContent

    This chapter discusses the configuration and settings in the79047707_PID_CompactV2 project realized on the S7-1500 CPU side.Step-by-step instructions illustrate how to set up and optimize a simulated controlloop.

    StructureThe following chapters are available for handling FB PID_Compact (FB1130):x Inserting FB PID_Compact (FB1130).x Configuring FB PID_Compact (FB1130).x Commissioning FB PID_Compact (FB1130).Handling the Lib_controlprocess simulation library is described in the followingchapter:x Inserting a function block of the simulation library.x 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 Descriptionin chapter (link)1 2 3

    PID_Compact configuration X X X Chapter 5.1 and chapter 5.2Commissioning (pre- and fine tuning) X X Chapter 5.3.1.Commissioning without pre- and finetuning

    X Chapter 5.3.2.

    Changing the control parameters duringoperation.

    X Chapter 4.3.3.

    Inserting a single simulation element. X X X Chapter 5.4.Interconnecting several controlledsystems.

    X Chapter 5.5.

  • 5 Configuration and Settings5.1 Inserting FB PID_Compact (FB1130)

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 33

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    5.1 Inserting FB PID_Compact (FB1130)

    VariantsThere are several options of inserting FB PID_Compact into a project astechnology object.Please note that calling PID_Compact as multi-instance does not generate atechnology object. You can keep using the FB further, however, without graphicsupport of the technology object.

    ProcedureThe table below gives you and option of adding the PID_Compact technologyobject to a project.

    Table 5-2

    No. Action

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

    1

    2

    .

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

  • 5 Configuration and Settings5.1 Inserting FB PID_Compact (FB1130)

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 34

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    No. Action

    3. 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.

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

    4. The FB has now been integrated in the user program.

  • 5 Configuration and Settings5.2 Configuration of FB PID_Compact (FB1130)

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 35

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    5.2 Configuration of FB PID_Compact (FB1130)

    ParametersFB PID_Compact already contains many settable parameters in the technologyobject.If you do not wish to use parameters not listed in the technology object (such asbackup parameters, see Table 4-6, step 2), then the help of TIA V12 offers yousupport.

    ProcedureTable 5-3

    No Action

    1. 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 drop-down menu Input you define whether you wish to use a floating point number or the hexadecimalvalue of an analog input as actual value. The Output drop-down list furthermore offers the optionof using a PWM output as manipulated variable.Furthermore, you define the start behavior of the controller at a CPU new start here. You canchoose between inactive, pretuning, fine tuning, manual or automatic mode.In addition, you can invert the control direction here. This is necessary, for example, for coolingsince 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 beinterconnected in the configuration view of the technology object.

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

  • 5 Configuration and Settings5.2 Configuration of FB PID_Compact (FB1130)

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 36

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    No Action

    4. In Advanced Settings you can also read the current PID parameters and change them, ifnecessary. However, you do not need to manually enter these parameters since they are adjustedduring the optimization.Output value contains the settings for the reaction to errors. You can chose whether the controllershall 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 PLCprogram.

  • 5 Configuration and Settings5.3 Commisisoning FB PID_Compact (FB1130)

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 37

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    A detailed list of the individual parameters including a description is available in theSTEP 7 Professional V12.0 manual in chapter 11.3.3.1 of the SIMATIC STEP 7Professional V12.0 SP1 manual (\3\). Further help is available by pressing the F1button, 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, thecontroller can be started up.You can:x use the existing commission tool and have STEP 7 calculate the control

    parameters via the pre- and fine tuning (chapter5.3.1).x 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. Action Note

    1. Check whether the correct controller structure(PI or PID parameters) has been set.

    In the individual scenarios, the PID controllerstructure is used exclusively.

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

    2. Via the MOVE command, for example, youinterconnectx the output of the PID controller with the

    input of the controlled system.x 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 onCommissioning.In Measurement you click on Start.

    In the graphical representation you now seethe values for Setpoint, Input and Output.

  • 5 Configuration and Settings5.3 Commisisoning FB PID_Compact (FB1130)

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 38

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    No. Action Note

    5. Clicking on Start in Pretuning starts thepretuning under the following preconditions:x PID_Compact is called up in a cyclic

    interrupt OB.x ManualEnable = FALSE.x Reset = FALSE.x PID_Compact is in Manual, Inactive

    or Automatic modex Setpoint and actual value are within the

    configured limits.x The difference between setpoint and

    actual value is larger than 30% of thedifference between actual value upperlimit and the actual value lower limit.

    x The distance between setpoint and actualvalue is >50% of the setpoint

    NoteYou can, for example, control the setpointvalue via the watch table:

    Possible pretuning curve:

    6. If the pretuning does not start, an error code oran error message is output via the Tooltip.Help for the interpretation of the message isavailable in the Online Help of TIA Portal.

    7. After successful pretuning, a fine tuning canalso be performed.A fine tuning can also be started withoutprevious pretuning.

    The parameters of the fine tuning mostly showa better command and disturbance behaviorthan the parameters of the pretuning.

    Precondition for a fine tuning:x PID_Compact is called up in a cyclic

    interrupt OB.x ManualEnable = FALSE.x Reset = FALSE.x Setpoint and actual value are within the

    configured limits.x The control loop is in steady-state at the

    operating point.x No failures are expected.x PID_Compact is in Inactive,

    Automatic or Manual mode

    Possible fine tuning curve:

  • 5 Configuration and Settings5.3 Commisisoning FB PID_Compact (FB1130)

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 39

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    5.3.2 Commissioning with given PID parameters

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

    Table 5-5

    No. Action

    1. In the Technology objects of the Project view you open the configuration window of thecontroller 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 andselect the Automatic mode entry in the drop-down menu.

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

  • 5 Configuration and Settings5.3 Commisisoning FB PID_Compact (FB1130)

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 40

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    No. Action

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

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

  • 5 Configuration and Settings5.4 Inserting a function block of the simulation library

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 41

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    5.4 Inserting a function block of the simulation library

    DocumentationDocument 79047707_Description_RegelSimBib_DOKU_V1_0_en.pdf contains adescription of the STEP 7 V12 library provided with the project.

    ProcedureThe table below shows, how simulation block FB Sim_PT3 (FB54) is inserted andconfigured in a user program. The integration of the other simulation elements isperformed the same way.

    Table 5-6 Inserting the system simulation

    No. Action Note

    1. Unzip the Sim_controlprocess file into adirectory of your choice on the engineeringstation.

    2. Open the TIA Portal in the project view.Open the Libraries tab in the right-hand paneand click on Open global library.

    Navigate to the storage location of theextracted folder and double-click to open theSim_controlprocess file.

    2

    3. Create a cyclic OB with a cycle time of300 ms, for example.

    4. Drag the Sim_PT3 block from the Mastercopies to the cyclic OB. Create an instancedata block for the function block.It is necessary that the simulation blocks arecalled in a cyclic OB.

  • 5 Configuration and Settings5.5 Simulation of a controlled system with several elements

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 42

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    No. Action Note

    5. Call the block in the already created cyclic OBand interconnect the parameters, for example,as follows:x GAIN = 1.0x TM_LAG1 = 29.0x TM_LAG2 = 17.5x TM_LAG3 = 3.1x CYCLE = 0.3Also interconnect the Reset input with acontrollable Boolean variable.

    NoteParameter CYCLE must correspond to thecycle time of the calling OB.

    5.5 Simulation of a controlled system with severalelements

    Interconnecting controlled systemsThe serial or parallel interconnection of controlled systems allows mapping morecomplex real processes using the controlled system simulation library.The process for inserting a control element is analog to the procedure for insertinga PT3 system described in Table 5-6.

    Serial interconnectionAs an example, the realization of a controlled system of four serial simulationelements is described here.Figure 5-1

    Command

    variable

    Feedback

    PIDController

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

  • 5 Configuration and Settings5.5 Simulation of a controlled system with several elements

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 43

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Table 5-7

    No. Action Note

    1. Add the control elements you wish to use asdescribed in Table 5-6. In Scenario3 these arethe control elements.x PT1 (FB Sim_PT1)x PDT1 (FB Sim_PDT1)x Lagging element (FB Sim_Lagging)x PT2 in the periodical case.

    (FB Sim_PT2osz)2. Use MOVE commands to interconnect the

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

    3. As described in The table below gives you andoption of adding the PID_Compacttechnology object to a project., you add PID_Compact into your project andinterconnect (also via MOVE command) theoutput of the controller with the input of the firstcontrol element.Interconnect the input of the controller with theoutput 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 theCPU.

    NoteIf you wish to view the step response of thecontrolled system without a controller, (5) clickon Start (1) in the commissioning window[Your_CPU] > Technology objects >[Your_PID] > Commissioning (1). Then setthe PID controller to manual mode (2) and seta jump for the controlled system (setting theoutput to a fixed value (3+4)).

    2

    3 4

    5

    1

  • 5 Configuration and Settings5.5 Simulation of a controlled system with several elements

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 44

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Parallel interconnectionAs an example, the realization of a controlled system consisting of two parallelsimulation elements is described here.Figure 5-2

    Command

    variable

    PIDController

    Feedback

    PT1

    PDT1+

    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

    No. Action

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

    2. With two Move commands you interconnect the output of the PID controller withthe inputx of the PT1 element.x 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.

  • 6 Commissioning6.1 Commissioning with entire hardware

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 45

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    6 CommissioningThis chapter describes how to start up the attached TIA Portal project.You can either use the hardware described in chapter 2.4.2 (commissioning seechapter 6.1) or completely simulate the project with PLCSIM (commissioning seechapter 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 setupwithout the intermediate switch is also possible.Figure 6-1

    IndustrialEthernet

    Field PG CPU 1516-3 PN/DP

    PC station

    230V

    230V

    Switch

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

  • 6 Commissioning6.1 Commissioning with entire hardware

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 46

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Table 6-1

    No. Action Note

    1. Fix the switch, the S7-1500 CPU and thepower supply to a DIN rail.

    2. Connect the S7-1500 CPU and the switch tothe power supply.

    3. Connect your engineering PC and the S7-1500CPU via the X1 interface with the switch viaEthernet cable.

    4. Supply the power supply with 230V AC.5. Set the IP address of the X1 port of the S7-

    1500 via the display to the IP address used inthe example (192.168.0.1).The IP address can be adjusted in the displayvia Settings > Addresses >X1 (IE/PN).

    NoteFor loading into the CPU the engineeringstation should be located in the same subnet.

    Note Here, the application of a field PGs is described as engineering station and PCstation at the same time.

    Alternatively, the application of a rack PC, for example, for visualization ispossible.

    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 the79047707_PID_CompactV2_CODE_v10.zip example project from theSiemens Online Support page.

    You can find the entry under the following link:http://support.automation.siemens.com/WW/view/en/79047707

  • 6 Commissioning6.1 Commissioning with entire hardware

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 47

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    6.1.3 Configuring the hardware

    Renaming the engineering stationThe following table shows the procedure for changing the PC name in Windows 7:

    Table 6-3 Renaming the engineering station

    No. Action Note

    1. To download WinCC Runtime into yourengineering station, the engineering stationmust have the PC name used in the project(VisuPC).

    Alternatively, you can also adjust the name toyour engineering station in the project.

    2. Click on Start. Go the Computer contextmenu and click on Properties. In thefollowing window you click on Changesettings below Computer name, domain andworkgroup settings.

    3. In the System properties you selectChange and then enter the new computername VisuPC in the respective field.

    4. Acknowledge and restart your engineeringstation to adopt the computer name.

    Setting the IP address of the engineering stationWhen using the engineering station simultaneously as PC station for thevisualization, you need to assign the IP address given in the project to theengineering station:

    Table 6-4 Assigning the IP addresses

    No. Action Note

    1. Open Start > Control Panel > Network andSharing Center

    2. Click on Change Adapter Settings and thenselect Properties in the context menu of yourEthernet adapter.

    3. Select Internet Protocol Version 4 andchange the IP address as follows:IP address: 192.168.0.251Subnet mask: 255.255.255.0

    4. Confirm the change with OK.Now your engineering station has the same IPaddress as assigned in the79047707_PID_CompactV2 project.

    5. Also set your PG/PC interface Start > ControlPanel > Set PG/PC Interface to TCP/IP andthe network adapter assigned by you.

  • 6 Commissioning6.1 Commissioning with entire hardware

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 48

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    6.1.4 Opening and downloading the TIA Portal project

    Table 6-5

    No. Action Note

    1. Download the79047707_PID_CompactV2_CODE_v1_0.zipfile to your engineering station and unzip thefolder.

    2. In the program folder you double-click on the79047707_PID_CompactV2.ap12 icon.Now the project opens in TIA V12.

    3. Go to the project view. Click on CPUPID_Compact_CPU1516 and load the userprogram into the CPU via Online > Downloadand Reset PLC program.

    4. When downloading the program for the firsttime, you need to specify your interface andthe subnet for the download. Then select theCPU to be downloaded.

    5. Compile the visualization by clicking on thecontext menu of WinCC RT Advanced >Compile > Software (Rebuild all)

    6. Click on the VisuPC PC station and startWinCC Runtime via the respective icon for agraphic representation of the scenarios.

    7. Now you can monitor the individual tags andthe course of the setpoint / actual / and outputvalues of the PID controllers.

    A description of the WinCC interface isavailable in chapter 7.

  • 6 Commissioning6.2 Commissioning with PLCSIM V12

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 49

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    6.2 Commissioning with PLCSIM V12

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

    6.2.1 Installation of the software

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

    Table 6-6 Installation of the software components

    No. Action Note

    1. Install STEP 7 Professional V12SP1

    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

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

    4. Download the79047707_PID_CompactV2_CODE_v10.zip example project fromthe Siemens Online Support page.

    You can find the entry under the following link:http://support.automation.siemens.com/WW/view/en/79047707

    6.2.2 Configuring the engineering station

    Changing the PG/PC interfaceTable 6-7

    No.

    Action Note

    1. Go to Control Panel via Start> Control Panel and selectthe Set PG/PC Interfaceicon.

    2. Set your PG/PC interface toS7ONLINE (STEP7)PLCSIM S7-1200/S7-1500(TCP/IP).

    3. Confirm the interface byclicking OK. Alsoacknowledge the followingwarning messages.

  • 6 Commissioning6.2 Commissioning with PLCSIM V12

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 50

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    Starting PLCSIM V12Table 6-8

    No. Action Note

    1. Start by double-clicking on the PLCSIM V12icon.

    2. Generate a new project and save it on yourlocal hard drive.After selecting a name, the new project iscreated by clicking on Create.

    3. This makes the simulated CPU ready tooperate.Clicking on the button for the compact viewgives you a good overview of the currentoperating state of the simulated CPU.

  • 6 Commissioning6.2 Commissioning with PLCSIM V12

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 51

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    6.2.3 Opening and downloading the TIA Portal project

    Table 6-9

    No. Action Note

    1. Unzipping the79047707_PID_CompactV2_CODE_v10.zipfile in any folder of your engineering station.

    2. Double-click on the79047707_PID_CompactV2.ap12 icon.The TIA V12 project opens.

    3. Click on CPU PID_Compact_CPU1516 andload 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/IEPG/PC interface: PLCSIM S7-1200/S7-1500Connection to subnet: PN/IE_1

    4. Click on the VisuPC PC station and startWinCC Runtime via the respective icon for agraphic representation of the scenarios.

    5. Now you can monitor the individual tags andthe course of the setpoint / actual / and outputvalues of the PID controllers.

    A description of the WinCC interface isavailable in chapter 7.

  • 7 Operating the Application7.1 Overview

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 52

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    7 Operating the Application7.1 Overview

    For a better overview regarding the behavior of the implemented scenarios, severaloptions are available to the user:x Insight into the behavior of the control loops via the HMI system WinCC

    Runtime Advanced.x 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 Runtimesystem running in PC station VisuPC.The pictures of WinCC-Runtime contain the following elements: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.

  • 7 Operating the Application7.2 Operation via WinCC Runtime

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 53

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    No. 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. Theoutput 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.

  • 7 Operating the Application7.2 Operation via WinCC Runtime

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 54

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    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

    No. 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 ( ).

    1

    2

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

  • 7 Operating the Application7.3 Operator control and monitoring via the online access

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 55

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    No. Action

    3. For monitoring the control behavior, you select the automatic mode ( ) and define a setpointvalue ( ).

    1

    2

    Now you can monitor the behavior of the control loop:

    7.3 Operator control and monitoring via the online access

    OverviewYou can analyze the S7 program of the CPU via the online access on the CPU andthe monitoring of blocks.

    Watch tablesThree watch tables have already been inserted into the project as a support, whichrespectively contain important parameters of the individual blocks on the individualscenarios. You reach the watch table via 79047707_PID_CompactV2 >PID_Compact_CPU1516 > Watch and force tables):x WatchTable_Scenario1x WatchTable_Scenario2x WatchTable_Scenario3

  • 8 Related Literature

    Controlling with PID_CompactVersion V1.0 , Entry ID: 79047707 56

    Cop

    yrig

    ht

    Siem

    ens

    AG20

    13Al

    lrig

    hts

    rese

    rved

    8 Related LiteratureBook directoryTable 8-1

    Topics Title

    \1\ Controlling with SIMATIC Practice book for SIMATIC S7 and SIMATIC PCS7 controlsystemsAuthors: Mller/ Pfeiffer/ WieserPublicis Publishing, ErlangenISBN: 978-3-89578-340-1

    Link directoryTable 8-2

    Topics Title

    \1\ Reference to this document http://support.automation.siemens.com/WW/view/en/79047707

    \2\ Siemens Industry OnlineSupport

    http://support.automation.siemens.com

    \3\ SIMATICSTEP 7 Professional V12.0SP1System manual

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

    \4\ SIMATIC STEP 7 ProfessionalV12.0System manualChapter 11.3 PID control

    https://www.automation.siemens.com/mdm/default.aspx?DocVersionId=51499858571&Language=de-DE&TopicId=49233574283&guiLanguage=en

    \5\ SIMATICS7-1500 Automation systemS7-1500System manual

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

    \6\ SIMATICInstalling the assemblyGetting Started

    http://www.automation.siemens.com/salesmaterial-as/interactive-manuals/getting-started_simatic-s7-1500/documents/EN/mount_en.pdf

    \7\ SIMATICWiringGetting Started

    http://www.automation.siemens.com/salesmaterial-as/interactive-manuals/getting-started_simatic-s7-1500/documents/EN/wire_en.pdf

    \8\ WinCC Professional V12 SP1System manual

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

    9 HistoryTable 9-1

    Version Date Modifications

    V1.0 09/2013 First version

    Controlling with PID_Compact V2Table of ContentsWarranty and Liability2 Solution2.1 Overview2.2 Scenarios of the application2.3 Visualization user interface2.4 Hardware and software components2.4.1 Validity2.4.2 Components used

    3 Basics on Control Engineering4 Mode of Operation4.1 Structure of the example project4.2 Scenario 1: Calling up and commissioning PID_Compact4.2.1 Task: controlling a simulated PT3 system4.2.2 Procedure4.2.3 Controlled system: Scenario1

    4.3 Scenario 2: temperature control with split-range block4.3.1 Task: controlling a simulated asymmetrical temperature system4.3.2 Procedure4.3.3 FB Scenario2_SplitRange (FB201)

    4.4 Scenario 3: simulation and control of a complex controlled system4.4.1 Task: controlling a simulated complex controlled system4.4.2 Procedure

    5 Configuration and Settings5.1 Inserting FB PID_Compact (FB1130)5.2 Configuration of FB PID_Compact (FB1130)5.3 Commisisoning FB PID_Compact (FB1130)5.3.1 Commissioning with pre- and fine tuning5.3.2 Commissioning with given PID parameters

    5.4 Inserting a function block of the simulation library5.5 Simulation of a controlled system with several elements

    6 Commissioning6.1 Commissioning with entire hardware6.1.1 Hardware installation6.1.2 Installation of the software6.1.3 Configuring the hardware6.1.4 Opening and downloading the TIA Portal project

    6.2 Commissioning with PLCSIM V126.2.1 Installation of the software6.2.2 Configuring the engineering station6.2.3 Opening and downloading the TIA Portal project

    7 Operating the Application7.1 Overview7.2 Operation via WinCC Runtime7.2.1 Operating units7.2.2 Monitoring scenario 3 with WinCC

    7.3 Operator control and monitoring via the online access

    8 Related Literature9 History