Siemens SIMATIC S7-1200 Function Manual

Siemens SIMATIC S7-1200 Function Manual

Pid control
Hide thumbs Also See for SIMATIC S7-1200:
Table of Contents

Advertisement

Advertisement

Table of Contents
loading

Summary of Contents for Siemens SIMATIC S7-1200

  • Page 2 ___________________ Preface ___________________ Documentation guide ___________________ SIMATIC Principles for control ___________________ Configuring a software controller S7-1200, S7-1500 PID control ___________________ Using PID_Compact ___________________ Using PID_3Step Function Manual ___________________ Using PID_Temp ___________________ Using PID basic functions ___________________ Auxiliary functions ___________________ Instructions ___________________ Service &...
  • Page 3 Note the following: WARNING Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems.
  • Page 4: Preface

    ● Information on the offers of our Technical Support are available in the appendix Service & Support (Page 523). ● The range of technical documentation for the individual SIMATIC products and automation systems is available on the Internet (http://www.siemens.com/simatic-tech-doku-portal). ● The online catalog and the ordering system are available on the Internet (http://mall.automation.siemens.com). PID control...
  • Page 5: Table Of Contents

    Table of contents Preface ..............................4 Documentation guide ..........................12 Principles for control..........................16 Controlled system and actuators .................... 16 Controlled systems ......................... 18 Characteristic values of the control section ................20 Pulse controller ........................23 Response to setpoint changes and disturbances ..............27 Control Response at Different Feedback Structures ..............
  • Page 6 Table of contents 3.10.5.5 Indicating errors ........................60 3.10.5.6 Editing start values in the project ................... 60 3.10.5.7 Status of configuration (offline) ....................62 3.10.5.8 Monitoring values online in the parameter view ..............63 3.10.5.9 Change display format of value ..................... 64 3.10.5.10 Create snapshot of monitor values ..................
  • Page 7 Table of contents 5.2.3 Simulating PID_3Step V2 with PLCSIM ................137 PID_3Step V1 ........................138 5.3.1 Configuring PID_3Step V1 ....................138 5.3.1.1 Basic settings V1 ........................138 5.3.1.2 Process value settings V1 ....................143 5.3.1.3 V1 final controlling element setting ..................144 5.3.1.4 Advanced settings V1 ......................
  • Page 8 Table of contents Multi-zone controlling with PID_Temp ................. 199 Override control with PID_Temp ..................202 Simulating PID_Temp with PLCSIM ..................206 Using PID basic functions ........................207 CONT_C ..........................207 7.1.1 Technology object CONT_C ....................207 7.1.2 Configure controller difference CONT_C ................208 7.1.3 Configure the controller algorithm CONT_C ................
  • Page 9 Table of contents Auxiliary functions ..........................240 Polyline ..........................240 Instructions ............................241 PID_Compact ........................241 9.1.1 New features of PID_Compact ..................... 241 9.1.2 Compatibility with CPU and FW .................... 244 9.1.3 CPU processing time and memory requirement PID_Compact V2.x ........245 9.1.4 PID_Compact V2 ........................
  • Page 10 Table of contents 9.2.5 PID_3Step V1 ........................341 9.2.5.1 Description PID_3Step V1 ....................341 9.2.5.2 Operating principle PID_3Step V1 ..................347 9.2.5.3 PID_3Step V1 input parameters ..................350 9.2.5.4 PID_3Step V1 output parameters ..................352 9.2.5.5 PID_3Step V1 static tags ..................... 354 9.2.5.6 Parameter State and Retain.Mode V1 .................
  • Page 11 Table of contents 9.4.4 TCONT_CP ........................... 471 9.4.4.1 Description TCONT_CP ......................471 9.4.4.2 Mode of operation TCONT_CP ..................... 472 9.4.4.3 Operating principle of the pulse generator ................481 9.4.4.4 Block diagram TCONT_CP ....................484 9.4.4.5 Input parameters TCONT_CP ....................486 9.4.4.6 Output parameters TCONT_CP ....................
  • Page 12: Documentation Guide

    Documentation guide The documentation for the SIMATIC S7-1500 automation system, for CPU 1516pro-2 PN based on SIMATIC S7-1500, and for the distributed I/O systems SIMATIC ET 200MP, ET 200SP and ET 200AL is divided into three areas. This division allows you easier access to the specific information you require. Basic information System manuals and Getting Started manuals describe in detail the configuration, installation, wiring and commissioning of the SIMATIC S7-1500, ET 200MP, ET 200SP and...
  • Page 13 You must register once to use the full functionality of "mySupport". You can find "mySupport" on the Internet (https://support.industry.siemens.com/My/ww/en). "mySupport" - Documentation In the Documentation area in "mySupport" you can combine entire manuals or only parts of these to your own manual.
  • Page 14 ● Manuals, characteristics, operating manuals, certificates ● Product master data You can find "mySupport" - CAx data on the Internet (http://support.industry.siemens.com/my/ww/en/CAxOnline). Application examples The application examples support you with various tools and examples for solving your automation tasks. Solutions are shown in interplay with multiple components in the system - separated from the focus on individual products.
  • Page 15 You can find the SIMATIC Automation Tool on the Internet (https://support.industry.siemens.com/cs/ww/en/view/98161300). PRONETA With SIEMENS PRONETA (PROFINET network analysis), you analyze the plant network during commissioning. PRONETA features two core functions: ● The topology overview independently scans PROFINET and all connected components.
  • Page 16: Principles For Control

    Principles for control Controlled system and actuators Controlled system Room temperature control by means of a heating system is a simple example of a controlled system. A sensor measures the room temperature and transfers the value to a controller. The controller compares the current room temperature with a setpoint and calculates an output value (manipulated variable) for heating control.
  • Page 17 Principles for control 2.1 Controlled system and actuators Actuators are distinguished as follows: ● Proportional actuators with constant actuating signal These elements set degrees of opening, angular positions or positions in proportion to the output value. The output value has an analog effect on the process within the control range.
  • Page 18: Controlled Systems

    Principles for control 2.2 Controlled systems Controlled systems The properties of a controlled system can hardly be influenced as these are determined by the technical requirements of the process and machinery. Acceptable control results can only be achieved by selecting a suitable controller type for the specific controlled system and adapting the controller to the time response of the controlled system.
  • Page 19 Principles for control 2.2 Controlled systems PT2 controlled systems In a PT2 controlled system, the process value does not immediately follow a step change of the output value, i.e., it increases in proportion to the positive rate of rise and then approaches the setpoint at a decreasing rate of rise.
  • Page 20: Characteristic Values Of The Control Section

    Principles for control 2.3 Characteristic values of the control section Characteristic values of the control section Determining the time response from the step response Time response of the controlled system can be determined based on the time characteristic of process value x following a step change of output value y. Most controlled systems are self-regulating controlled systems.
  • Page 21 Principles for control 2.3 Characteristic values of the control section The controllability of the controlled system can be estimated based on the ratio T , or T × . Rule: Process type Suitability of the controlled system for controlling < 0,1 can be controlled well 0.1 to 0.3 can still be controlled...
  • Page 22 Principles for control 2.3 Characteristic values of the control section Response rate of controlled systems Controlled systems can be judged on the basis of the following values: < 0.5 min, T < 5 min = fast controlled system > 0.5 min, T >...
  • Page 23: Pulse Controller

    Principles for control 2.4 Pulse controller Pulse controller Two-step controllers without feedback Two-step controllers have the state "ON" and "OFF" as the switching function. This corresponds to 100% or 0% output. This behavior generates a sustained oscillation of process value x around setpoint w. The amplitude and duration of the oscillation increase in proportion to the ratio between the delay time T and recovery time T...
  • Page 24 Principles for control 2.4 Pulse controller The following diagram shows the control function of a two-step controller ① Response characteristic without controller ② Response characteristic with two-step controller Delay time Recovery time Switching difference PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 25 Principles for control 2.4 Pulse controller Two-step controllers with feedback The behavior of two-step controllers in the case of controlled systems with larger delay times, such as furnaces where the functional space is separated from the heating, can be improved by the use of electronic feedback. The feedback is used to increase the switching frequency of the controller, which reduces the amplitude of the process value.
  • Page 26 Principles for control 2.4 Pulse controller Three-step controllers Three-step controllers are used for heating / cooling. These controllers have two switching points as their output. The control-action results are optimized through electronic feedback structures. Fields of applications for such controllers are heating, low-temperature, climatic chambers and tool heating units for plastic-processing machines.
  • Page 27: Response To Setpoint Changes And Disturbances

    Principles for control 2.5 Response to setpoint changes and disturbances Response to setpoint changes and disturbances Response to setpoint changes The process value should follow a setpoint change as quickly as possible. The response to setpoint changes is improved by minimizing fluctuation of the process value and the time required to reach the new setpoint.
  • Page 28: Control Response At Different Feedback Structures

    Principles for control 2.6 Control Response at Different Feedback Structures Response to disturbances The setpoint is influenced by disturbance variables. The controller has to eliminate the resulting control deviations in the shortest time possible. The response to disturbances is improved by minimizing fluctuation of the process value and the time required to reach the new setpoint.
  • Page 29 Principles for control 2.6 Control Response at Different Feedback Structures Step response of a proportional action controller ① Control deviation ② Output value of a continuous controller ③ Output value of a pulse controller Equation for proportional action controller Output value and control deviation are directly proportional, meaning: Output value = proportional gain ×...
  • Page 30 Principles for control 2.6 Control Response at Different Feedback Structures Step response of a PD-action controller ① Control deviation ② Output value of a continuous controller ③ Output value of a pulse controller TM_LAG Delay of the Derivative action PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 31 Principles for control 2.6 Control Response at Different Feedback Structures Equation for PD-action controller The following applies for the step response of the PD-action controller in the time range: t = time interval since the step of the control deviation The derivative action generates a output value as a function of the rate of change of the process value.
  • Page 32 Principles for control 2.6 Control Response at Different Feedback Structures Step response of a PI-action controller ① Control deviation ② Output value of a continuous controller ③ Output value of a pulse controller An integral action in the controller adds the control deviation as a function of the time. This means that the controller corrects the system until the control deviation is eliminated.
  • Page 33 Principles for control 2.6 Control Response at Different Feedback Structures Equation for PI-action controller The following applies for the step response of the PI-action controller in the time range: t = time interval since the step of the control deviation PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 34 Principles for control 2.6 Control Response at Different Feedback Structures Step response of a PID controller ① Control deviation ② Output value of a continuous controller ③ Output value of a pulse controller TM_LAG Delay of the Derivative action Integral action time PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 35 Principles for control 2.6 Control Response at Different Feedback Structures Equation for PID controller The following applies for the step response of the PID controller in the time range: t = time interval since the step of the control deviation Response of a controlled system with different controller structures Most of the controller systems occurring in process engineering can be controlled by means of a controller with PI-action response.
  • Page 36: Selection Of The Controller Structure For Specified Controlled Systems

    Principles for control 2.7 Selection of the controller structure for specified controlled systems Selection of the controller structure for specified controlled systems Selection of the Suitable Controller Structures To achieve optimum control results, select a controller structure that is suitable for the controlled system and that you can adapt to the controlled system within specific limits.
  • Page 37: Pid Parameter Settings

    Principles for control 2.8 PID parameter settings PID parameter settings Rule of Thumb for the Parameter Setting Controller structure Setting GAIN ≈ v × T [° C ] GAIN ≈ 1.2 × v × T [° C ] TI ≈ 4 × T [ min ] GAIN ≈...
  • Page 38: Configuring A Software Controller

    Configuring a software controller Overview of software controller For the configuration of a software controller, you need an instruction with the control algorithm and a technology object. The technology object for a software controller corresponds with the instance DB of the instruction. The configuration of the controller is saved in the technology object.
  • Page 39 Configuring a software controller 3.1 Overview of software controller Library Instruction Technology object Description S7-300/400 Standard PID PID_CP PID_CP Continuous controller with pulse genera- Control (PID Profes- S7-300/400 PID_ES PID_ES Step controller for actuators with inte- sional optional grating behavior package) S7-300/400 LP_SCHED...
  • Page 40: Steps For The Configuration Of A Software Controller

    Configuring a software controller 3.2 Steps for the configuration of a software controller Steps for the configuration of a software controller All SW-controllers are configured according to the same scheme: Step Description Add technology object (Page 40) Configure technology object (Page 42) Call instruction in the user program (Page 43) Download technology object to device (Page 44) Commission software controller (Page 45)
  • Page 41 Configuring a software controller 3.3 Add technology objects Result The new technology object has been created and stored in the project tree in the "Technology objects" folder. The technology object is used if the instruction for this technology object is called in a cyclic interrupt OB. Note You can select the "Add new and open"...
  • Page 42: Configure Technology Objects

    Configuring a software controller 3.4 Configure technology objects Configure technology objects The properties of a technology object on a S7-1200 CPU can be configured in two ways. ● In the Inspector window of the programming editor ● In the configuration editor The properties of a technology object on a S7-300/400 CPU can only be configured in the configuration editor.
  • Page 43: Call Instruction In The User Program

    Configuring a software controller 3.5 Call instruction in the user program Call instruction in the user program The instruction of the software controller must be called in a cyclic interrupt OB. The sampling time of the software controller is determined by the interval between the calls in the cyclic interrupt OB.
  • Page 44: Downloading Technology Objects To Device

    Configuring a software controller 3.6 Downloading technology objects to device Downloading technology objects to device A new or modified configuration of the technology object must be downloaded to the CPU for the online mode. The following characteristics apply when downloading retentive data: ●...
  • Page 45: Commissioning Software Controller

    Configuring a software controller 3.7 Commissioning software controller Result The complete PLC program is downloaded to the device. Blocks that only exist online in the device are deleted. By downloading all affected blocks and by deleting any blocks in the device that are not required, you avoid inconsistencies between the blocks in the user program.
  • Page 46: Comparing Values

    Configuring a software controller 3.9 Comparing values Comparing values 3.9.1 Comparison display and boundary conditions The "Compare values" function provides the following options: ● Comparison of configured start values of the project with the start values in the CPU and the actual values ●...
  • Page 47: Comparing Values

    Configuring a software controller 3.9 Comparing values 3.9.2 Comparing values The procedure is shown in the following using "PID Parameters" as an example. Requirements ● A project with a software controller is configured. ● The project is downloaded to the CPU. ●...
  • Page 48 Configuring a software controller 3.9 Comparing values NOTICE Malfunctions of the controller Values incorrect for the process can result in controller malfunctions. Backing up actual values Click the icon to transfer the actual controller values to the start values of your configured project.
  • Page 49: Parameter View

    Configuring a software controller 3.10 Parameter view 3.10 Parameter view 3.10.1 Introduction to the parameter view The Parameter view provides you with a general overview of all relevant parameters of a technology object. You obtain an overview of the parameter settings and can easily change them in offline and online mode.
  • Page 50 Configuring a software controller 3.10 Parameter view ● Display of all memory values of a parameter: Start value PLC, Start value project, Monitor value ● Display of the parameter comparison of the memory values of a parameter Operator control functions: ●...
  • Page 51: Structure Of The Parameter View

    Configuring a software controller 3.10 Parameter view 3.10.2 Structure of the parameter view 3.10.2.1 Toolbar The following functions can be selected in the toolbar of the parameter view. Icon Function Explanation Monitor all Starts the monitoring of visible parameters in the active Parameter view (online mode).
  • Page 52: Navigation

    Configuring a software controller 3.10 Parameter view 3.10.2.2 Navigation Within the "Parameter view" tab, the following alternative navigation structures can be selected. Navigation Explanation Functional navi- In the functional navigation, the structure of the parameters is gation based on the structure in the configuration dialog ("Functional view"...
  • Page 53 Configuring a software controller 3.10 Parameter view Column Explanation Offline Online Default value Value that is pre-assigned to the parameter. The display field is empty for parameters that are not contained in the instance DB / technology DB. Snapshot Snapshot of the current values in the CPU (monitor values). Error indication if values have a process-related error.
  • Page 54: Opening The Parameter View

    Configuring a software controller 3.10 Parameter view 3.10.3 Opening the parameter view Requirement The technology object has been added in the project tree, i.e., the associated instance DB / technology DB of the instruction has been created. Procedure 1. Open the "Technology objects" folder in the project tree. 2.
  • Page 55: Default Setting Of The Parameter View

    Configuring a software controller 3.10 Parameter view 3.10.4 Default setting of the parameter view Default settings To enable you to work efficiently with the Parameter view, you can customize the parameter display and save your settings. The following customizations are possible and can be saved: ●...
  • Page 56 Configuring a software controller 3.10 Parameter view Change column width To customize the width of a column so that all texts in the rows can be read, follow these steps: 1. Position the cursor in the header of the parameter table to the right of the column to be customized until the shape of the cursor changes to a cross.
  • Page 57: Working With The Parameter View

    Configuring a software controller 3.10 Parameter view Selection of compare values (online) To set the compare values for the “Compare values” function, follow these steps: 1. Select the desired compare values in the “Selection of compare values” drop-down list. – Start value project / Start value PLC –...
  • Page 58: Filtering The Parameter Table

    Configuring a software controller 3.10 Parameter view 3.10.5.2 Filtering the parameter table You can filter the parameters in the parameter table in the following ways: ● With the text filter ● With the subgroups of the navigation Both filter methods can be used simultaneously. With the text filter Texts that are visible in the parameter table can be filtered.
  • Page 59: Sorting The Parameter Table

    Configuring a software controller 3.10 Parameter view 3.10.5.3 Sorting the parameter table The values of the parameters are arranged in rows. The parameter table can be sorted by any displayed column. ● In columns containing numerical values, sorting is based on the magnitude of the numerical value.
  • Page 60: Indicating Errors

    Configuring a software controller 3.10 Parameter view 3.10.5.5 Indicating errors Error indication Parameter assignment errors that result in compilation errors (e.g., limit violation) are indicated in the Parameter view. Every time a value is input in the Parameter view, a check is made for process-related and syntax errors and the result is indicated.
  • Page 61 Configuring a software controller 3.10 Parameter view Defining new start values To define start values for parameters in the Parameter view, follow these steps: 1. Open the Parameter view of the technology object. 2. Enter the desired start values in the "Start value project" column. The value must match the data type of the parameter and must not exceed the value range of the parameter.
  • Page 62: Status Of Configuration (Offline)

    Configuring a software controller 3.10 Parameter view 3.10.5.7 Status of configuration (offline) The status of the configuration is indicated by icons: ● In the “Status of configuration” column in the parameter table ● In the navigation structure of the functional navigation and data navigation Symbol in “Status of configuration”...
  • Page 63: Monitoring Values Online In The Parameter View

    Configuring a software controller 3.10 Parameter view 3.10.5.8 Monitoring values online in the parameter view You can monitor the values currently taken by the parameters of the technology object in the CPU (monitor values) directly in the Parameter view. Requirements ●...
  • Page 64: Change Display Format Of Value

    Configuring a software controller 3.10 Parameter view 3.10.5.9 Change display format of value The display format of the value can be selected via the shortcut menu of a table row in the Parameter view of the technology object. The display format of the following values can be changed both in online mode and in offline mode: ●...
  • Page 65: Create Snapshot Of Monitor Values

    Configuring a software controller 3.10 Parameter view 3.10.5.10 Create snapshot of monitor values You can back up the current values of the technology object on the CPU (monitor values) and display them in the Parameter view. Requirements ● There is an online connection. ●...
  • Page 66 Configuring a software controller 3.10 Parameter view Requirements ● There is an online connection. ● The technology object is downloaded to the CPU. ● The program execution is active (CPU in "RUN"). ● The Parameter view of the technology object is open. ●...
  • Page 67: Comparing Values

    Configuring a software controller 3.10 Parameter view 3.10.5.12 Comparing values You can use comparison functions to compare the following memory values of a parameter: ● Start value project ● Start value PLC ● Snapshot Requirements ● There is an online connection. ●...
  • Page 68: Applying Values From The Online Program As Start Values

    Configuring a software controller 3.10 Parameter view Symbol in "Compare result" column Symbol Meaning The compare values are equal and error-free. The compare values are not equal and error-free. At least one of the two compare values has a process-related or syntax error. The comparison cannot be performed.
  • Page 69 Configuring a software controller 3.10 Parameter view Result The current monitor values are applied to the "Snapshot" column and their setpoints are copied to the "Start value project" column as new start values. Note Applying values of individual parameters You can also apply the values of individual parameters that are not marked as a setpoint from the "Snapshot"...
  • Page 70: Initializing Setpoints In The Online Program

    Configuring a software controller 3.10 Parameter view 3.10.5.14 Initializing setpoints in the online program You can initialize all parameters that are marked as a "Setpoint" in the Parameter view with new values in the CPU in one step. In so doing, the start values are downloaded from the project to the CPU.
  • Page 71: Display Instance Db Of A Technology Object

    Configuring a software controller 3.11 Display instance DB of a technology object. 3.11 Display instance DB of a technology object. An instance DB, in which the parameter and static variables are saved, is created for each technology object. Procedure To display the instance DB of a technology object, proceed as follows: 1.
  • Page 72: Using Pid_Compact

    ● Configure technology objects (Page 42) ● Configuring PID_Compact V2 (Page 73) ● Configuring PID_Compact V1 (Page 96) For more information, see the following FAQs in the Siemens Industry Online Support: ● Entry ID 79047707 (https://support.industry.siemens.com/cs/ww/en/view/79047707) PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 73: Pid_Compact V2

    Using PID_Compact 4.2 PID_Compact V2 PID_Compact V2 4.2.1 Configuring PID_Compact V2 4.2.1.1 Basic settings V2 Introduction V2 Configure the following properties of the "PID_Compact" technology object under "Basic settings" in the Inspector window or in the configuration window: ● Physical quantity ●...
  • Page 74 Using PID_Compact 4.2 PID_Compact V2 Control mode V2 Physical quantity Select the physical quantity and unit of measurement for setpoint, process value, and disturbance variable in the "Controller type" group. Setpoint, process value, and disturbance variable is displayed in this unit of measurement. Control logic An increase of the output value is generally intended to cause an increase in the process value.
  • Page 75 Using PID_Compact 4.2 PID_Compact V2 Setpoint V2 Procedure Proceed as follows to define a fixed setpoint: 1. Select "Instance DB". 2. Enter a setpoint, e.g. 80° C. 3. Delete any entry in the instruction. Proceed as follows to define a variable setpoint: 1.
  • Page 76 Using PID_Compact 4.2 PID_Compact V2 Output value V2 PID_Compact offers three output values. Your actuator will determine which output value you use. ● Output_PER The actuator is triggered via an analog output and controlled with a continuous signal, e.g. 0...10V, 4...20mA. ●...
  • Page 77: Process Value Settings V2

    Using PID_Compact 4.2 PID_Compact V2 4.2.1.2 Process value settings V2 Process value scaling V2 If you have configured the use of Input_PER in the basic setting, you must convert the value of the analog input to the physical quantity of the process value. The current configuration is displayed in the Input_PER display.
  • Page 78: Advanced Settings V2

    Using PID_Compact 4.2 PID_Compact V2 4.2.1.3 Advanced settings V2 Process value monitoring V2 Configure a warning high and low limit for the process value in the "Process value monitoring" configuration window. If one of the warning limits is exceeded or undershot during operation, a warning will be displayed at the PID_Compact instruction: ●...
  • Page 79 Using PID_Compact 4.2 PID_Compact V2 PWM limits V2 The value at the output parameter Output is transformed into a pulse sequence that is output at output parameter Output_PWM by means of a pulse width modulation. Output is calculated in the PID algorithm sampling time, Output_PWM is output in the PID_Compact sampling time.
  • Page 80 Using PID_Compact 4.2 PID_Compact V2 Example PID_Compact sampling time = 100 ms PID algorithm sampling time = 1000 ms Minimum ON time = 200 ms Output is a constant 15%. The smallest pulse that PID_Compact can output is 20%. In the first cycle, no pulse is output.
  • Page 81 Using PID_Compact 4.2 PID_Compact V2 Output value V2 Output value limits In the "Output value limits" configuration window, configure the absolute limits of your output value in percent. Absolute output value limits are not violated in neither manual mode nor automatic mode.
  • Page 82 Using PID_Compact 4.2 PID_Compact V2 If one or more of the following errors occur in automatic mode, PID_Compact switches to "Substitute output value with error monitoring" mode and outputs the last valid output value: – 0002h: Invalid value at Input_PER parameter. –...
  • Page 83 Using PID_Compact 4.2 PID_Compact V2 PID parameters V2 The PID parameters are displayed in the "PID Parameters" configuration window. The PID parameters will be adapted to your controlled system during controller tuning. You do not need to enter the PID parameters manually. The PID algorithm operates according to the following equation: Symbol Description...
  • Page 84 Using PID_Compact 4.2 PID_Compact V2 Proportional gain The value specifies the proportional gain of the controller. PID_Compact does not work with a negative proportional gain. Control logic is inverted under Basic settings > Controller type. Integral action time The integral action time determines the time behavior of the integral action. The integral action is deactivated with integral action time = 0.0.
  • Page 85 Using PID_Compact 4.2 PID_Compact V2 PID algorithm sampling time The controlled system needs a certain amount of time to respond to changes in the output value. It is therefore not advisable to calculate the output value in every cycle. The sampling time of the PID algorithm represents the time between two calculations of the output value.
  • Page 86: Commissioning Pid_Compact V2

    Using PID_Compact 4.2 PID_Compact V2 4.2.2 Commissioning PID_Compact V2 4.2.2.1 Pretuning V2 The pretuning determines the process response to a jump change of the output value and searches for the point of inflection. The PID parameters are calculated from the maximum rate of rise and dead time of the controlled system.
  • Page 87 Using PID_Compact 4.2 PID_Compact V2 Procedure To perform pretuning, follow these steps: 1. Double-click the "PID_Compact > Commissioning" entry in the project tree. 2. Select the entry "Pretuning" in the "Tuning mode" drop-down list. 3. Click the "Start" icon. – An online connection will be established. –...
  • Page 88: Fine Tuning V2

    Using PID_Compact 4.2 PID_Compact V2 4.2.2.2 Fine tuning V2 Fine tuning generates a constant, limited oscillation of the process value. The PID parameters are tuned for the operating point from the amplitude and frequency of this oscillation. All PID parameters are recalculated from the results. PID parameters from fine tuning usually have better master control and disturbance characteristics than PID parameters from pretuning.
  • Page 89 Using PID_Compact 4.2 PID_Compact V2 Procedure To perform fine tuning, follow these steps: 1. Select the entry "Fine tuning" in the "Tuning mode" drop-down list. 2. Click the "Start" icon. – An online connection will be established. – Value recording is started. –...
  • Page 90: Manual" Mode V1

    Using PID_Compact 4.2 PID_Compact V2 4.2.2.3 "Manual" mode V1 The following section describes how you can use the "manual mode" operating mode in the commissioning window of the "PID_Compact" technology object. Manual mode is also possible when an error is pending. Requirement ●...
  • Page 91: Override Control With Pid_Compact V2

    Using PID_Compact 4.2 PID_Compact V2 4.2.3 Override control with PID_Compact V2 Override control In case of override control, two or more controllers share one actuator. Only one controller has access to the actuator at any time and influences the process. A logic operation decides which controller has access to the actuator.
  • Page 92 Using PID_Compact 4.2 PID_Compact V2 Requirements ● PIDCtrl.PIDInit is only effective if the integral action is activated (Retain.CtrlParams.Ti tag > 0.0). ● You must assign PIDCtrl.PIDInit and OverwriteInitialOutputValue in your user program yourself (see example below). PID_Compact does not automatically change these tags. ●...
  • Page 93 Using PID_Compact 4.2 PID_Compact V2 Example: Control of a gas pipeline PID_Compact is used for control of a gas pipeline. The main goal is to control the flow rate Input1. The controller PID_Compact_1 is used for this purpose. In addition, the pressure Input2 (measured in flow direction in front of the valve) is to be kept below the high limit with the limiting controller PID_Compact_2.
  • Page 94 Using PID_Compact 4.2 PID_Compact V2 Both controllers must share one valve as shared actuator. The logic that decides which controller gets access to the actuator is implemented by a maximum selection of the output value (in Real format, parameter Output) in this case. Because the output value corresponds to the opening of the valve, the controller that requires the larger valve opening gets the control.
  • Page 95: Simulating Pid_Compact V2 With Plcsim

    Using PID_Compact 4.2 PID_Compact V2 This example can be implemented with the following SCL program code: "PID Compact 1"(Input := "Input1"); "PID Compact 2"(Input := "Input2"); IF "PID Compact 1".Output >= "PID Compact 2".Output THEN "ActuatorInput" := "PID_Compact_1".Output_PER; "PID_Compact_1".PIDCtrl.PIDInit := FALSE; "PID_Compact_2".PIDCtrl.PIDInit := TRUE;...
  • Page 96: Pid_Compact V1

    Using PID_Compact 4.3 PID_Compact V1 PID_Compact V1 4.3.1 Configuring PID_Compact V1 4.3.1.1 Basic settings V1 Introduction V1 Configure the following properties of the "PID_Compact" technology object under "Basic settings" in the Inspector window or in the configuration window: ● Physical quantity ●...
  • Page 97 Using PID_Compact 4.3 PID_Compact V1 Control mode V1 Physical quantity Select the unit of measurement and physical quantity for the setpoint and process value in the "Controller type" group. The setpoint and process value will be displayed in this unit. Control logic An increase of the output value is generally intended to cause an increase in the process value.
  • Page 98 Using PID_Compact 4.3 PID_Compact V1 Process value V1 PID_Compact will scale the value of the analog input to the physical quantity if you use the analog input value directly. You will need to write a program for processing if you wish first to process the analog input value.
  • Page 99 Using PID_Compact 4.3 PID_Compact V1 Procedure Proceed as follows to use the analog output value: 1. Select the entry "Output_PER (analog)" in the drop-down list "Output". 2. Select "Instruction". 3. Enter the address of the analog output. Proceed as follows to process the output value using the user program: 1.
  • Page 100: Process Value Settings V1

    Using PID_Compact 4.3 PID_Compact V1 4.3.1.2 Process value settings V1 Configure the scaling of your process value and specify the process value absolute limits In the "Process value settings" configuration window. Scaling the process value If you have configured the use of Input_PER in the basic settings, you will need to convert the value of the analog input into the physical quantity of the process value.
  • Page 101: Advanced Settings V1

    Using PID_Compact 4.3 PID_Compact V1 4.3.1.3 Advanced settings V1 Process value monitoring V1 Configure a warning high and low limit for the process value in the "Process value monitoring" configuration window. If one of the warning limits is exceeded or undershot during operation, a warning will be displayed at the PID_Compact instruction: ●...
  • Page 102 Using PID_Compact 4.3 PID_Compact V1 PWM limits V1 The value at the output parameter Output is transformed into a pulse sequence that is output at output parameter Output_PWM by means of a pulse width modulation. Output is calculated in the PID algorithm sampling time, Output_PWM is output in the PID_Compact sampling time.
  • Page 103 Using PID_Compact 4.3 PID_Compact V1 Example PID_Compact sampling time = 100 ms PID algorithm sampling time = 1000 ms Minimum ON time = 200 ms Output is a constant 15%. The smallest pulse that PID_Compact can output is 20%. In the first cycle, no pulse is output.
  • Page 104 Using PID_Compact 4.3 PID_Compact V1 Output value limits V1 In the "Output value limits" configuration window, configure the absolute limits of your output value in percent. Absolute output value limits are not violated in neither manual mode nor in automatic mode. If a output value outside the limits is specified in manual mode, the effective value is limited in the CPU to the configured limits.
  • Page 105 Using PID_Compact 4.3 PID_Compact V1 The diagram below illustrates the integration of the parameters into the PID algorithm: All PID parameters are retentive. If you enter the PID parameters manually, you must completely download PID_Compact. Auto-Hotspot Proportional gain The value specifies the proportional gain of the controller. PID_Compact does not work with a negative proportional gain.
  • Page 106 Using PID_Compact 4.3 PID_Compact V1 Derivative delay coefficient The derivative delay coefficient delays the effect of the derivative action. Derivative delay = derivative action time × derivative delay coefficient ● 0.0: Derivative action is effective for one cycle only and therefore almost not effective. ●...
  • Page 107 Using PID_Compact 4.3 PID_Compact V1 Rule for tuning Select whether PI or PID parameters are to be calculated in the "Controller structure" drop- down list. ● PID Calculates PID parameters during pretuning and fine tuning. ● PI Calculates PI parameters during pretuning and fine tuning. ●...
  • Page 108: Commissioning Pid_Compact V1

    Using PID_Compact 4.3 PID_Compact V1 4.3.2 Commissioning PID_Compact V1 4.3.2.1 Commissioning V1 The commissioning window helps you commission the PID controller. You can monitor the values for the setpoint, process value and output value along the time axis in the trend view. The following functions are supported in the commissioning window: ●...
  • Page 109: Pretuning V1

    Using PID_Compact 4.3 PID_Compact V1 4.3.2.2 Pretuning V1 The pretuning determines the process response to a jump change of the output value and searches for the point of inflection. The tuned PID parameters are calculated as a function of the maximum slope and dead time of the controlled system. The more stable the process value is, the easier it is to calculate the PID parameters and the more precise the result will be.
  • Page 110 Using PID_Compact 4.3 PID_Compact V1 Result If pretuning was performed without an error message, the PID parameters have been tuned. PID_Compact switches to automatic mode and uses the tuned parameters. The tuned PID parameters will be retained during power OFF and a restart of the CPU. If pretuning is not possible, PID_Compact will change to "Inactive"...
  • Page 111: Fine Tuning V1

    Using PID_Compact 4.3 PID_Compact V1 4.3.2.3 Fine tuning V1 Fine tuning generates a constant, limited oscillation of the process value. The PID parameters are optimized for the operating point from the amplitude and frequency of this oscillation. All PID parameters are recalculated on the basis of the findings. PID parameters from fine tuning usually have better master control and disturbance behavior than PID parameters from pretuning.
  • Page 112 Using PID_Compact 4.3 PID_Compact V1 Procedure Proceed as follows to carry out "fine tuning": 1. Select the entry "Fine tuning" in the "Tuning mode" drop-down list. 2. Click the "Start" icon. – An online connection will be established. – Value recording is started. –...
  • Page 113: Manual" Mode V1

    Using PID_Compact 4.3 PID_Compact V1 4.3.2.4 "Manual" mode V1 The following section describes how you can use the "Manual" operating mode in the commissioning window of the "PID Compact" technology object. Requirement ● The "PID_Compact" instruction is called in a cyclic interrupt OB. ●...
  • Page 114: Simulating Pid_Compact V1 With Plcsim

    Using PID_Compact 4.3 PID_Compact V1 4.3.3 Simulating PID_Compact V1 with PLCSIM Note Simulation with PLCSIM For the simulation with PLCSIM, the time behavior of the simulated PLC is not exactly identical to that of a "real" PLC. The actual cycle clock of a cyclic interrupt OB can have larger fluctuations with a simulated PLC than with "real"...
  • Page 115: Using Pid_3Step

    ● Configure technology objects (Page 42) ● Configuring PID_3Step V2 (Page 116) ● Configuring PID_3Step V1 (Page 138) Principle For more information, see the following FAQs in the Siemens Industry Online Support: ● Entry ID 68011827 (https://support.industry.siemens.com/cs/ww/en/view/68011827) PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 116: Pid_3Step V2

    Using PID_3Step 5.2 PID_3Step V2 PID_3Step V2 5.2.1 Configuring PID_3Step V2 5.2.1.1 Basic settings V2 Introduction V2 Configure the following properties of the "PID_3Step" technology object under "Basic settings" in the Inspector window or in the configuration window: ● Physical quantity ●...
  • Page 117 Using PID_3Step 5.2 PID_3Step V2 Control mode V2 Physical quantity Select the physical quantity and unit of measurement for setpoint, process value, and disturbance variable in the "Controller type" group. Setpoint, process value, and disturbance variable is displayed in this unit of measurement. Control logic An increase of the output value is generally intended to cause an increase in the process value.
  • Page 118 Using PID_3Step 5.2 PID_3Step V2 Setpoint V2 Procedure Proceed as follows to define a fixed setpoint: 1. Select "Instance DB". 2. Enter a setpoint, e.g. 80° C. 3. Delete any entry in the instruction. Proceed as follows to define a variable setpoint: 1.
  • Page 119 Using PID_3Step 5.2 PID_3Step V2 Actuator without position feedback Proceed as follows to configure PID_3Step for an actuator without position feedback: 1. Select the entry "No Feedback" in the drop-down list "Feedback". Actuator with digital endstop signals Proceed as follows to configure PID_3Step for an actuator with endstop signals: 1.
  • Page 120 Using PID_3Step 5.2 PID_3Step V2 Output value V2 PID_3Step offers an analog output value (Output_PER) and digital output values (Output_UP, Output_DN). Your actuator will determine which output value you use. ● Output_PER The actuator has a relevant motor transition time and is triggered via an analog output and controlled with a continuous signal, e.g.
  • Page 121: Process Value Settings V2

    Using PID_3Step 5.2 PID_3Step V2 5.2.1.2 Process value settings V2 Process value scaling V2 If you have configured the use of Input_PER in the basic setting, you must convert the value of the analog input to the physical quantity of the process value. The current configuration is displayed in the Input_PER display.
  • Page 122: Final Controlling Element Settings V2

    Using PID_3Step 5.2 PID_3Step V2 5.2.1.3 Final controlling element settings V2 Final controlling element V2 Actuator-specific times Configure the motor transition time and the minimum ON and OFF times to prevent damage to the actuator. You can find the specifications in the actuator data sheet. The motor transition time is the time in seconds the motor requires to move the actuator from the closed to the opened state.
  • Page 123 Using PID_3Step 5.2 PID_3Step V2 PID_3Step generates a programmable output value in the case of an error: ● Current value PID_3Step is switched off and no longer modifies the actuator position. ● Current value for error while error is pending The controller functions of PID_3Step are switched off and the position of the actuator is no longer changed.
  • Page 124 Using PID_3Step 5.2 PID_3Step V2 Scaling V2 position feedback Scaling position feedback If you have configured the use of Feedback_PER in the basic settings, you will need to convert the value of the analog input into %. The current configuration will be displayed in the "Feedback"...
  • Page 125: Advanced Settings V2

    Using PID_3Step 5.2 PID_3Step V2 5.2.1.4 Advanced settings V2 Actual value monitoring V2 Configure a warning high and low limit for the process value in the "Process value monitoring" configuration window. If one of the warning limits is exceeded or undershot during operation, a warning will be displayed at the PID_3Step instruction: ●...
  • Page 126 Using PID_3Step 5.2 PID_3Step V2 PID parameters V2 The PID parameters are displayed in the "PID Parameters" configuration window. The PID parameters will be adapted to your controlled system during controller tuning. You do not need to enter the PID parameters manually. The PID algorithm operates according to the following equation: Symbol Description...
  • Page 127 Using PID_3Step 5.2 PID_3Step V2 Proportional gain The value specifies the proportional gain of the controller. PID_3Step does not work with a negative proportional gain. Control logic is inverted under Basic settings > Controller type. Integration time The integration time determines the time behavior of the integral action. The integral action is deactivated with integration time = 0.0.
  • Page 128 Using PID_3Step 5.2 PID_3Step V2 PID algorithm sampling time The controlled system needs a certain amount of time to respond to changes in the output value. It is therefore not advisable to calculate the output value in every cycle. The sampling time of the PID algorithm represents the time between two calculations of the output value.
  • Page 129: Commissioning Pid_3Step V2

    Using PID_3Step 5.2 PID_3Step V2 5.2.2 Commissioning PID_3Step V2 5.2.2.1 Pretuning V2 The pretuning determines the process response to a pulse of the output value and searches for the point of inflection. The tuned PID parameters are calculated as a function of the maximum slope and dead time of the controlled system.
  • Page 130 Using PID_3Step 5.2 PID_3Step V2 Procedure To perform pretuning, follow these steps: 1. Double-click the "PID_3Step > Commissioning" entry in the project tree. 2. Select the entry "Pretuning" in the "Tuning mode" drop-down list in the working area "Tuning". 3. Click the "Start" icon. –...
  • Page 131: Fine Tuning V2

    Using PID_3Step 5.2 PID_3Step V2 5.2.2.2 Fine tuning V2 Fine tuning generates a constant, limited oscillation of the process value. The PID parameters are tuned for the operating point from the amplitude and frequency of this oscillation. All PID parameters are recalculated from the results. PID parameters from fine tuning usually have better master control and disturbance characteristics than PID parameters from pretuning.
  • Page 132 Using PID_3Step 5.2 PID_3Step V2 Procedure To perform fine tuning, follow these steps: 1. Select the entry "Fine tuning" in the "Tuning mode" drop-down list. 2. Click the "Start" icon. – An online connection will be established. – Value recording is started. –...
  • Page 133: Commissioning With Manual Pid Parameters V2

    Using PID_3Step 5.2 PID_3Step V2 5.2.2.3 Commissioning with manual PID parameters V2 Requirement ● The PID_3Step instruction is called in a cyclic interrupt OB. ● ManualEnable = FALSE ● Reset = FALSE ● The motor transition time has been configured or measured. ●...
  • Page 134: Measuring The Motor Transition Time V2

    Using PID_3Step 5.2 PID_3Step V2 5.2.2.4 Measuring the motor transition time V2 Introduction PID_3Step requires the motor transition time to be as accurate as possible for good controller results. The data in the actuator documentation contains average values for this type of actuator.
  • Page 135 Using PID_3Step 5.2 PID_3Step V2 Result The actuator is moved from the starting position to the target position. Time measurement starts immediately and ends when the actuator reaches the target position. The motor transition time is calculated according to the following equation: Motor transition time = (output value high limit –...
  • Page 136 Using PID_3Step 5.2 PID_3Step V2 Result The actuator is moved in the selected direction. Time measurement will start once the actuator has reached the first endstop and will end when the actuator reaches this endstop for the second time. The motor transition time is equal to the time measured divided by two. The progress and status of transition time measurement are displayed.
  • Page 137: Simulating Pid_3Step V2 With Plcsim

    Using PID_3Step 5.2 PID_3Step V2 5.2.3 Simulating PID_3Step V2 with PLCSIM Note Simulation with PLCSIM The simulation of PID_3Step V2.x with PLCSIM for CPU S7-1200 is not supported. PID_3Step V2.x can only be simulated for CPU S7-1500 with PLCSIM. For the simulation with PLCSIM, the time behavior of the simulated PLC is not exactly identical to that of a "real"...
  • Page 138: Pid_3Step V1

    Using PID_3Step 5.3 PID_3Step V1 PID_3Step V1 5.3.1 Configuring PID_3Step V1 5.3.1.1 Basic settings V1 Introduction V1 Configure the following properties of the "PID_3Step" technology object under "Basic settings" in the Inspector window or in the configuration window: ● Physical quantity ●...
  • Page 139 Using PID_3Step 5.3 PID_3Step V1 Control mode V1 Physical quantity Select the unit of measurement and physical quantity for the setpoint and process value in the "Controller type" group. The setpoint and process value will be displayed in this unit. Control logic An increase of the output value is generally intended to cause an increase in the process value.
  • Page 140 Using PID_3Step 5.3 PID_3Step V1 Procedure Proceed as follows to use the analog input value without processing: 1. Select the entry "Input_PER" in the drop-down list "Input". 2. Select "Instruction" as source. 3. Enter the address of the analog input. Proceed as follows to use the processed process value in floating point format: 1.
  • Page 141 Using PID_3Step 5.3 PID_3Step V1 Actuator with analog position feedback and endstop signals Proceed as follows to configure PID_3Step for an actuator with analog position feedback and endstop signals: 1. Select the entry "Feedback" or "Feedback_PER" in the drop-down list "Feedback". 2.
  • Page 142 Using PID_3Step 5.3 PID_3Step V1 Procedure Proceed as follows to use the analog output value: 1. Select the entry "Output (analog)" in the drop-down list "Output". 2. Select "Instruction". 3. Enter the address of the analog output. Proceed as follows to use the digital output value: 1.
  • Page 143: Process Value Settings V1

    Using PID_3Step 5.3 PID_3Step V1 5.3.1.2 Process value settings V1 Configure the scaling of your process value and specify the process value absolute limits In the "Process value settings" configuration window. Scaling the process value If you have configured the use of Input_PER in the basic settings, you will need to convert the value of the analog input into the physical quantity of the process value.
  • Page 144: V1 Final Controlling Element Setting

    Using PID_3Step 5.3 PID_3Step V1 5.3.1.3 V1 final controlling element setting Actuator-specific times Configure the motor transition time and the minimum ON and OFF times to prevent damage to the actuator. You can find the specifications in the actuator data sheet. The motor transition time is the time in seconds the motor requires to move the actuator from the closed to the opened state.
  • Page 145 Using PID_3Step 5.3 PID_3Step V1 If one of these error occurs in manual mode, PID_3Step remains in manual mode. If an error occurs during the tuning or transition time measurement, PID_3Step is switched off. ● Substitute output value PID_3Step moves the actuator to the substitute output value and then switches off. ●...
  • Page 146 Using PID_3Step 5.3 PID_3Step V1 Limiting the output value You can only exceed or undershoot the output value limits during the transition time measurement. The output value is limited to these values in all other modes. Enter the absolute output value limits in the "Output value high limit" and "Output value low limit"...
  • Page 147: Advanced Settings V1

    Using PID_3Step 5.3 PID_3Step V1 5.3.1.4 Advanced settings V1 Actual value monitoring V1 Configure a warning high and low limit for the process value in the "Process value monitoring" configuration window. If one of the warning limits is exceeded or undershot during operation, a warning will be displayed at the PID_3Step instruction: ●...
  • Page 148 Using PID_3Step 5.3 PID_3Step V1 Integration time Derivative delay coefficient (derivative delay T1 = a × T Derivative action time Derivative action weighting The diagram below illustrates the integration of the parameters into the PID algorithm: All PID parameters are retentive. If you enter the PID parameters manually, you must completely download PID_3Step.
  • Page 149 Using PID_3Step 5.3 PID_3Step V1 Derivative delay = derivative action time × derivative delay coefficient ● 0.0: Derivative action is effective for one cycle only and therefore almost not effective. ● 0.5: This value has proved useful in practice for controlled systems with one dominant time constant.
  • Page 150: Commissioning Pid_3Step V1

    Using PID_3Step 5.3 PID_3Step V1 5.3.2 Commissioning PID_3Step V1 5.3.2.1 Commissioning V1 You can monitor the setpoint, process value and output value over time in the "Tuning" working area. The following commissioning functions are supported in the curve plotter: ● Controller pretuning ●...
  • Page 151: Pretuning V1

    Using PID_3Step 5.3 PID_3Step V1 5.3.2.2 Pretuning V1 The pretuning determines the process response to a pulse of the output value and searches for the point of inflection. The tuned PID parameters are calculated as a function of the maximum slope and dead time of the controlled system. The more stable the process value is, the easier it is to calculate the PID parameters and the more precise the result will be.
  • Page 152: Fine Tuning V1

    Using PID_3Step 5.3 PID_3Step V1 5.3.2.3 Fine tuning V1 Fine tuning generates a constant, limited oscillation of the process value. The PID parameters are optimized for the operating point from the amplitude and frequency of this oscillation. All PID parameters are recalculated on the basis of the findings. PID parameters from fine tuning usually have better master control and disturbance behavior than PID parameters from pretuning.
  • Page 153: Commissioning With Manual Pid Parameters V1

    Using PID_3Step 5.3 PID_3Step V1 Procedure Proceed as follows to carry out "fine tuning": 1. Select the entry "Fine tuning" in the "Tuning mode" drop-down list. 2. Click the "Start" icon. – An online connection will be established. – Value recording is started. –...
  • Page 154: Measuring The Motor Transition Time V1

    Using PID_3Step 5.3 PID_3Step V1 5.3.2.5 Measuring the motor transition time V1 Introduction PID_3Step requires the motor transition time to be as accurate as possible for good controller results. The data in the actuator documentation contains average values for this type of actuator.
  • Page 155 Using PID_3Step 5.3 PID_3Step V1 Actuators with endstop signals Proceed as follows to measure the transition time of actuators with endstop signals: Requirement ● The "Endstop signals" check box in the basic settings has been selected and Actuator_H and Actuator_L are connected. ●...
  • Page 156: Simulating Pid_3Step V1 With Plcsim

    Using PID_3Step 5.3 PID_3Step V1 5.3.3 Simulating PID_3Step V1 with PLCSIM Note Simulation with PLCSIM For the simulation with PLCSIM, the time behavior of the simulated PLC is not exactly identical to that of a "real" PLC. The actual cycle clock of a cyclic interrupt OB can have larger fluctuations with a simulated PLC than with "real"...
  • Page 157: Using Pid_Temp

    Using PID_Temp Technology object PID_Temp The PID_Temp technology object provides a continuous PID controller with integrated tuning. PID_Temp is especially designed for temperature control and is suited for heating or heating/cooling applications. Two outputs are available for this purpose, one each for heating and cooling.
  • Page 158: Configuring Pid_Temp

    Using PID_Temp 6.2 Configuring PID_Temp Configuring PID_Temp 6.2.1 Basic settings 6.2.1.1 Introduction Configure the following properties of the "PID_Temp" technology object under "Basic settings" in the Inspector window or in the configuration window: ● Physical quantity ● Start-up behavior after reset ●...
  • Page 159: Controller Type

    Using PID_Temp 6.2 Configuring PID_Temp 6.2.1.2 Controller type Physical quantity Select the unit of measurement and physical quantity for the setpoint and the process value in the "Controller type" group. The setpoint and the process value are displayed in this unit. Startup characteristics 1.
  • Page 160: Process Value

    Using PID_Temp 6.2 Configuring PID_Temp 6.2.1.4 Process value PID_Temp will scale the value of the analog input to the physical quantity if you use the analog input value directly. You will need to write a program for processing if you wish first to process the analog input value.
  • Page 161 Using PID_Temp 6.2 Configuring PID_Temp The cooling output is only available if it was activated via the "Activate cooling" check box. ● If the check box is cleared, the output value of the PID algorithm (PidOutputSum) is scaled and output at the outputs for heating. ●...
  • Page 162: Cascade

    Using PID_Temp 6.2 Configuring PID_Temp 6.2.1.6 Cascade If a PID_Temp instance receives its setpoint from a higher-level master controller and outputs its output value in turn to a subordinate slave controller, this PID_Temp instance is both a master controller and a slave controller simultaneously. Both configurations listed below then have to be carried out for such a PID_Temp instance.
  • Page 163: Process Value Settings

    Using PID_Temp 6.2 Configuring PID_Temp 6.2.2 Process value settings 6.2.2.1 Process value limits You must specify an appropriate absolute high limit and low limit for the process value as limit values for your controlled system. As soon as the process value violates these limits, an error occurs (ErrorBits = 0001h).
  • Page 164: Output Settings

    Using PID_Temp 6.2 Configuring PID_Temp 6.2.3 Output settings 6.2.3.1 Basic settings of output Method for heating and cooling If cooling is activated in the basic settings, two methods are available for calculating the PID output value: ● PID parameter switching (Config.AdvancedCooling = TRUE): The output value calculation for cooling takes place by means of a separate PID parameter set.
  • Page 165 Using PID_Temp 6.2 Configuring PID_Temp Reaction to error NOTICE Your system may be damaged. If you output "Current value while error is pending " or "Substitute output value while error is pending" in the event of an error, PID_Temp remains in automatic mode or in manual mode.
  • Page 166 Using PID_Temp 6.2 Configuring PID_Temp If one or more of the following errors occur in automatic mode, PID_Temp switches to "Substitute output value with error monitoring" mode and outputs the last valid PID output value (PidOutputSum): – 0000002h: Invalid value at Input_PER parameter. –...
  • Page 167: Output Value Limits And Scaling

    Using PID_Temp 6.2 Configuring PID_Temp 6.2.3.2 Output value limits and scaling Depending on the operating mode, the PID output value (PidOutputSum) is calculated automatically by the PID algorithm or by the manual value (ManualValue) or the configured substitute output value (SubstituteOutput). The PID output value is limited depending on the configuration: ●...
  • Page 168 Using PID_Temp 6.2 Configuring PID_Temp Output Value pair Parameter OutputHeat_PER Value pair 1 PID output value high limit (heating) Config.Output.Heat.PidUpperLimit, Scaled high analog output value (heating) Config.Output.Heat.PerUpperScaling Value pair 2 PID output value low limit (heating) Config.Output.Heat.PidLowerLimit, Scaled low analog output value (heating) Config.Output.Heat.PerLowerScaling OutputCool Value pair 1...
  • Page 169 Using PID_Temp 6.2 Configuring PID_Temp Example: Output scaling when the OutputHeat output is used (cooling deactivated. The low limit of PID output value (heating) (Config.Output.Heat.PidLowerLimit) may be unequal to 0.0): Example: Output scaling when the OutputHeat_PWM and OutputCool_PER outputs are used (cooling activated.
  • Page 170: Advanced Settings

    Using PID_Temp 6.2 Configuring PID_Temp 6.2.4 Advanced settings 6.2.4.1 Process value monitoring Configure a warning high and low limit for the process value in the "Process value monitoring" configuration window. If one of the warning limits is exceeded or undershot during operation, a warning is displayed at the PID_Temp instruction: ●...
  • Page 171: Pwm Limits

    Using PID_Temp 6.2 Configuring PID_Temp 6.2.4.2 PWM limits The PID output value PidOutputSum is scaled and transformed via a pulse width modulation into a pulse train that is output at the output parameter OutputHeat_PWM or OutputCool_PWM. The "Sampling time of PID algorithm" represents the time between two calculations of the PID output value.
  • Page 172 Using PID_Temp 6.2 Configuring PID_Temp The "Minimum ON time" and the "Minimum OFF time" can be set separately for heating and cooling, rounded to an integer multiple of the PID_Temp sampling time. A pulse or a break is never shorter than the minimum ON or OFF time. The inaccuracies this causes are added up and compensated in the next cycle.
  • Page 173 Using PID_Temp 6.2 Configuring PID_Temp If the "Sampling time of PID algorithm" (Retain.CtrlParams.Heat.Cycle or Retain.CtrlParams.Cool.Cycle) and thus the period duration of the pulse width modulation is very high when OutputHeat_PWM or OutputCool_PWM is used, you can specify a deviating shorter period duration at the parameters Config.Output.Heat.PwmPeriode or Config.Output.Cool.PwmPeriode in order to improve smoothness of the process value (see also PwmPeriode tag (Page 445)).
  • Page 174: Pid Parameters

    Using PID_Temp 6.2 Configuring PID_Temp 6.2.4.3 PID parameters The PID parameters are displayed in the "PID Parameters" configuration window. If cooling is activated in the basic settings and PID parameter switching is selected as the method for heating/cooling in the output settings, two parameter sets are available: One for heating and one for cooling.
  • Page 175 Using PID_Temp 6.2 Configuring PID_Temp The diagram below illustrates the integration of the parameters into the PID algorithm: All PID parameters are retentive. If you enter the PID parameters manually, you must completely download PID_Temp (Downloading technology objects to device (Page 44)). PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 176 Using PID_Temp 6.2 Configuring PID_Temp PID_Temp block diagram The following block diagram shows how the PID algorithm is integrated in the PID_Temp. PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 177 Using PID_Temp 6.2 Configuring PID_Temp Proportional gain The value specifies the proportional gain of the controller. PID_Temp does not operate with a negative proportional gain and only supports the normal control direction, meaning that an increase in the process value is achieved by an increase in the PID output value (PidOutputSum).
  • Page 178 Using PID_Temp 6.2 Configuring PID_Temp PID algorithm sampling time The controlled system needs a certain amount of time to respond to changes in the output value. It is therefore not advisable to calculate the output value in every cycle. The sampling time of "PID algorithm"...
  • Page 179 Using PID_Temp 6.2 Configuring PID_Temp If values not equal to 1.0 are configured for the proportional action weighting or the derivative action weighting, setpoint changes even within the dead zone affect the output value. Process value changes within the dead zone do not affect the output value, regardless of the weighting.
  • Page 180 Using PID_Temp 6.2 Configuring PID_Temp Control zone with deactivated cooling or cooling factor. Control zone with activated cooling and PID parameter switching. Rule for tuning Select whether PI or PID parameters are to be calculated in the "Controller structure" drop- down list.
  • Page 181: Commissioning Pid_Temp

    Using PID_Temp 6.3 Commissioning PID_Temp Commissioning PID_Temp 6.3.1 Commissioning The commissioning window helps you commission the PID controller. You can monitor the values for the setpoint, process value and the output values for heating and cooling along the time axis in the trend view. The following functions are supported in the commissioning window: ●...
  • Page 182: Pretuning

    Using PID_Temp 6.3 Commissioning PID_Temp 6.3.2 Pretuning The pretuning determines the process response to a jump change of the output value and searches for the point of inflection. The tuned PID parameters are calculated as a function of the maximum slope and dead time of the controlled system. You obtain the best PID parameters when you perform pretuning and fine tuning.
  • Page 183 Using PID_Temp 6.3 Commissioning PID_Temp Requirements for pretuning heating ● The difference between setpoint and process value is greater than 30% of the difference between process value high limit and process value low limit. ● The distance between the setpoint and the process value is greater than 50% of the setpoint.
  • Page 184 Using PID_Temp 6.3 Commissioning PID_Temp Procedure To perform pretuning, follow these steps: 1. Double-click the "PID_Temp > Commissioning" entry in the project tree. 2. Activate the "Monitor all" button or start the trend view. An online connection will be established. 3.
  • Page 185: Fine Tuning

    Using PID_Temp 6.3 Commissioning PID_Temp 6.3.3 Fine tuning Fine tuning generates a constant, limited oscillation of the process value. The PID parameters are tuned for the operating point from the amplitude and frequency of this oscillation. The PID parameters are recalculated from the results. PID parameters from fine tuning usually have better master control and disturbance characteristics than PID parameters from pretuning.
  • Page 186 Using PID_Temp 6.3 Commissioning PID_Temp Example: Specification of an offset for fine tuning cooling ● Without offset – Setpoint = Process value (ScaledInput) = 80 °C – PID output value (PidOutputSum) = 30.0 – Output value heating (OutputHeat) = 30.0 –...
  • Page 187 Using PID_Temp 6.3 Commissioning PID_Temp Requirements for fine tuning cooling ● Heat.EnableTuning = FALSE ● Cool.EnableTuning = TRUE ● The cooling output is activated (Config.ActivateCooling = TRUE). ● The PID parameter switching is activated (Config.AdvancedCooling = TRUE). ● The cooling output has to be active at the operating point where tuning is to be carried out.
  • Page 188 Using PID_Temp 6.3 Commissioning PID_Temp Procedure To perform fine tuning, follow these steps: 1. Double-click the "PID_Temp > Commissioning" entry in the project tree. 2. Activate the "Monitor all" button or start the trend view. An online connection will be established. 3.
  • Page 189: Manual" Mode

    Using PID_Temp 6.3 Commissioning PID_Temp 6.3.4 "Manual" mode The following section describes how you can use "Manual mode" in the commissioning window of the "PID_Temp" technology object. Manual mode is also possible when an error is pending. Requirement ● The "PID_Temp" instruction is called in a cyclic interrupt OB. ●...
  • Page 190: Substitute Setpoint

    Using PID_Temp 6.3 Commissioning PID_Temp 6.3.5 Substitute setpoint The following section describes how you can use the substitute setpoint in the commissioning window of the "PID_Temp" technology object. Requirement ● The "PID_Temp" instruction is called in a cyclic interrupt OB. ●...
  • Page 191: Cascade Control With Pid_Temp

    Using PID_Temp 6.4 Cascade control with PID_Temp Cascade control with PID_Temp 6.4.1 Introduction In cascade control, several control loops are nested within each other. In the process, slaves receive their setpoint (Setpoint) from the output value (OutputHeat) of the respective higher- level master.
  • Page 192 (heating of the water bath) and thus influences the water-bath temperature. The water-bath temperature in turn has an effect on the chocolate temperature. For more information, see the following FAQs in the Siemens Industry Online Support: ● Entry ID 103526819 (https://support.industry.siemens.com/cs/ww/en/view/103526819)
  • Page 193: Program Creation

    Using PID_Temp 6.4 Cascade control with PID_Temp 6.4.2 Program creation Observe the following points during program creation: ● Number of PID_Temp instances The number of different PID_Temp instances called up in a cyclic interrupt OB has to agree with the number of concatenated measured variables in the process. There are two concatenated measured variables in the example: TempChocolate and TempWater.
  • Page 194 Using PID_Temp 6.4 Cascade control with PID_Temp ● Interconnection of the interface for information exchange between master and slave The "Slave" parameter of a master has to be assigned to the "Master" parameter of all its directly subordinate slaves (which receive their setpoint from this master). The assignment should be carried out via the interface of the slave in order to allow the interconnection of a master with multiple slaves and the display of the interconnection in the Inspector window of the slave in the basic settings.
  • Page 195: Configuration

    Using PID_Temp 6.4 Cascade control with PID_Temp 6.4.3 Configuration You can carry out the configuration via your user program, the configuration editor or the Inspector window of the PID_Temp call. When using PID_Temp in a cascade control system, ensure the correct configuration of the settings specified below.
  • Page 196 Using PID_Temp 6.4 Cascade control with PID_Temp Setting in the configuration editor or DB parameter Explanation Inspector window Output settings → Output limits and Config.Output.Heat.PidLowe- If no own scaling function is used when assign- scaling → OutputHeat / OutputCool: rLimit, ing OutputHeat of the master to Setpoint of the slave, it may be necessary to adapt the output PID output value low limit (heating),...
  • Page 197: Commissioning

    Using PID_Temp 6.4 Cascade control with PID_Temp 6.4.4 Commissioning After compiling and loading of the program, you can start commissioning of the cascade control system. Begin with the innermost slave at commissioning (implementation of tuning or change to automatic mode with existing PID parameters) and continue outwards until the outermost master has been reached.
  • Page 198: Substitute Setpoint

    Using PID_Temp 6.4 Cascade control with PID_Temp 6.4.5 Substitute setpoint In order to specify a setpoint, PID_Temp offers a substitute setpoint at the SubstituteSetpoint tag in addition to the Setpoint parameter. This can be activated by setting SubstituteSetpointOn = TRUE or by selecting the corresponding check box in the commissioning editor.
  • Page 199: Multi-Zone Controlling With Pid_Temp

    Using PID_Temp 6.5 Multi-zone controlling with PID_Temp Multi-zone controlling with PID_Temp Introduction In a multi-zone control system, several sections, so-called zones, of a plant are controlled simultaneously to different temperatures. A multi-zone control system is characterized by the mutual influence of the temperature zones through thermal coupling, i.e. the process value of one zone can influence the process value of a different zone through thermal coupling.
  • Page 200 Using PID_Temp 6.5 Multi-zone controlling with PID_Temp Temporary deactivation of cooling PID_Temp offers the possibility of deactivating cooling temporarily in automatic mode for controllers with active cooling (Config.ActivateCooling = TRUE) by setting DisableCooling = TRUE. This ensures that this controller does not cool in automatic mode during commissioning while the controllers of other zones have not yet completed tuning of heating.
  • Page 201 Using PID_Temp 6.5 Multi-zone controlling with PID_Temp Synchronization of several fine tuning processes If fine tuning is started from automatic mode with PIDSelfTune.TIR.RunIn = FALSE, PID_Temp tries to reach the setpoint with PID controlling and the current PID parameters. The actual tuning does not start until the setpoint is reached. The time required to reach the setpoint can be different for the individual zones of a multi-zone control system.
  • Page 202: Override Control With Pid_Temp

    Using PID_Temp 6.6 Override control with PID_Temp Override control with PID_Temp Override control In case of override control, two or more controllers share one actuator. Only one controller has access to the actuator at any time and influences the process. A logic operation decides which controller has access to the actuator.
  • Page 203 Using PID_Temp 6.6 Override control with PID_Temp Note Constant adaptation of the output value limits Instead of the active updating of the controllers without access to the actuator described here, this is implemented alternatively by constant adaptation of the output value limits in other controller systems.
  • Page 204 Using PID_Temp 6.6 Override control with PID_Temp The heater is controlled with the pulse-width modulated output value of PID_Temp (parameter OutputHeat_PWM) by writing the program tag ActuatorInput. The setpoint for the temperature Input1 is specified at the parameter PID_Temp_1.Setpoint. The temperature high limit for the additional measuring point is specified as setpoint at the parameter PID_Temp_2.Setpoint.
  • Page 205 Using PID_Temp 6.6 Override control with PID_Temp The temperature at the additional measuring point Input2 drops. The temperature of the main controlled variable Input1 drops as well and cannot be held at the setpoint any longer. Once the fault has been remedied, the Input2 will continue to drop and the heating power is further increased by the limiting controller.
  • Page 206: Simulating Pid_Temp With Plcsim

    Using PID_Temp 6.7 Simulating PID_Temp with PLCSIM Simulating PID_Temp with PLCSIM Note Simulation with PLCSIM The simulation of PID_Temp with PLCSIM for CPU S7-1200 is not supported. PID_TEMP can be simulated only for CPU S7-1500 with PLCSIM. For the simulation with PLCSIM, the time behavior of the simulated PLC is not exactly identical to that of a "real"...
  • Page 207: Using Pid Basic Functions

    Using PID basic functions CONT_C 7.1.1 Technology object CONT_C The technology object CONT_C provides a continual PID-controller for automatic and manual mode. It corresponds to the instance data block of the instruction CONT_C. You can configure a pulse controller using the PULSEGEN instruction. The proportional, integral (INT) and differential components (DIF) are switched parallel to each other and can be turned on and off individually.
  • Page 208: Configure Controller Difference Cont_C

    Using PID basic functions 7.1 CONT_C 7.1.2 Configure controller difference CONT_C Use process value periphery To use the process value in the periphery format at the PV_PER input parameter, follow these steps: 1. Select the "Enable I/O" check box. 2. If the process value is available as a physical size, enter the factor and offset for the scaling in percent.
  • Page 209: Configure The Controller Algorithm Cont_C

    Using PID basic functions 7.1 CONT_C 7.1.3 Configure the controller algorithm CONT_C General To determine which components of the control algorithm are activated, proceed as follows: 1. Select an entry from the "Controller structure" list. You can only specify required parameters for the selected controller structure. Proportional action 1.
  • Page 210: Configure The Output Value Cont_C

    Using PID basic functions 7.1 CONT_C 7.1.4 Configure the output value CONT_C General You can set CONT_C in the manual or automatic mode. 1. To set a manual manipulated value, activate the option "Activate manual mode" option check box. You can specify a manual manipulated value on the input parameter MAN. Manipulated value limits The manipulated value is limited at the top and bottom so that it can only accept valid values.
  • Page 211: Programming A Pulse Controller

    Using PID basic functions 7.1 CONT_C 7.1.5 Programming a pulse controller With the continuous controller CONT_C and the pulse shaper PULSEGEN, you can implement a fixed setpoint controller with a switching output for proportional actuators. The following figure shows the signal flow of the control loop. The continuous controller CONT_C forms the output value LMN that is converted by the pulse shaper PULSEGEN into pulse/break signals QPOS_P or QNEG_P.
  • Page 212: Commissioning Cont_C

    Using PID basic functions 7.1 CONT_C 7.1.6 Commissioning CONT_C Requirements ● The instruction and the technology object are loaded on the CPU. Procedure In order to manually determine the optimal PID parameter, proceed as follows: 1. Click the "Start" icon. If there is no online connection, this will be established.
  • Page 213: Cont_S

    Using PID basic functions 7.2 CONT_S CONT_S 7.2.1 Technology object CONT_S The technology object CONT_S provides a step controller for actuators with integrating behavior and is used to control technical temperature processes with binary output value output signals. The technology object corresponds to the instance data block of the CONT_S instruction.
  • Page 214: Configure Controller Difference Cont_S

    Using PID basic functions 7.2 CONT_S 7.2.2 Configure controller difference CONT_S Use process value periphery To use the process value in the periphery format at the PV_PER input parameter, follow these steps: 1. Select the "Enable I/O" check box. 2. If the process value is available as a physical quantity, enter the factor and offset for the scaling in percent.
  • Page 215: Configure Manipulated Value Cont_S

    Using PID basic functions 7.2 CONT_S 7.2.4 Configure manipulated value CONT_S General You can set CONT_S in the manual or automatic mode. 1. To set a manual manipulated value, activate the "Activate manual mode" option check box. Enter a manual manipulated value for the input parameters LMNUP and LMNDN. Pulse generator 1.
  • Page 216: Tcont_Cp

    Using PID basic functions 7.3 TCONT_CP TCONT_CP 7.3.1 Technology object TCONT_CP The technology object TCONT_CP provides a continual temperature controller with pulse generator. It corresponds to the instance data block of the instruction TCONT_CP. The operation is based on the PID control algorithm of the sampling controller. Both manual and automatic mode are possible.
  • Page 217: Configure Tcont_Cp

    Using PID basic functions 7.3 TCONT_CP 7.3.2 Configure TCONT_CP 7.3.2.1 Controller difference Use process value periphery To use the input parameter PV_PER, proceed as follows: 1. Select the entry "Periphery" from the "Source" list. 2. Select the "sensor type". Depending on the sensor type, the process value is scaled according to different formulas.
  • Page 218: Controlling Algorithm

    Using PID basic functions 7.3 TCONT_CP 7.3.2.2 Controlling algorithm General 1. Enter the "Sampling time PID algorithm". A controller sampling time should not exceed 10 % of the determined integratl action time of the controller (TI). 2. If the controller structure contains a proportional action, enter the "proportional gain". A negative proportional gain inverts the rule meaning.
  • Page 219: Manipulated Value Continual Controller

    Using PID basic functions 7.3 TCONT_CP Set P-controller with operating point 1. Set a PD-controller with an operating point. 2. Enter the derivative action time 0.0. The derivative action is disabled. Control zone The control zone limits the value range of the control deviation. If the control deviation is outside of this value range, the manipulated value limits are used.
  • Page 220: Manipulated Value Pulse Controller

    Using PID basic functions 7.3 TCONT_CP 7.3.2.4 Manipulated value pulse controller Pulse generator The analog manipulated value (LmnN) can be emitted through pulse-duration modulation on the output parameter QPULSE as an impulse sequence. To use the pulse generator, proceed as follows: 1.
  • Page 221 Using PID basic functions 7.3 TCONT_CP Sampling time pulse generator The sampling time pulse generator must agree with the time tact of the cyclic interrupt OB being called. The duration of the created impulse is always a whole number factor of this value.
  • Page 222: Commissioning Tcont_Cp

    Using PID basic functions 7.3 TCONT_CP 7.3.3 Commissioning TCONT_CP 7.3.3.1 Optimization of TCONT_CP Application possibilities The controller optimization for heating or cooling processes from process type I is applicable. But you can use the block for processes with higher levels like process type II or III. The PI/PID parameters are automatically determined and set.
  • Page 223 Using PID basic functions 7.3 TCONT_CP PHASE = 2 In phase 2, the process value attempts to detect the point of inflection with a constant manipulated variable. This method prevents the point of inflection from being found too early as a result of process variable noise. With the pulse controller, the process variable is averaged over N pulse cycles and then made available to the controller stage.
  • Page 224: Requirements For An Optimization

    Using PID basic functions 7.3 TCONT_CP 7.3.3.2 Requirements for an optimization Transient response The process must have a stable, asymptotic transient response with time lag. The process value must settle to steady state after a step change of the manipulated variable.
  • Page 225 Using PID basic functions 7.3 TCONT_CP In the following image, the transient oscillation is illustrated in the stationary state: Linearity and operating range The process response must be linear across the operating range. Non-linear response occurs, for example, when an aggregation state changes. Tuning must take place in a linear part of the operating range.
  • Page 226: Possibilities For Optimization

    Using PID basic functions 7.3 TCONT_CP 7.3.3.3 Possibilities for optimization The following possibilities for tuning exist: ● Pretuning ● Fine tuning ● Manual fine-tuning in control mode Pretuning During this tuning, the working point is approached from the cold state through a setpoint jump.
  • Page 227 Using PID basic functions 7.3 TCONT_CP Remedy: Reduce the setpoint value during the inflection point search. Note If processes are extremely sluggish, it is advisable during tuning to specify a target setpoint that is somewhat lower than the desired operating point and to monitor the status bits and PV closely (risk of overshooting).
  • Page 228 Using PID basic functions 7.3 TCONT_CP The tuning manipulated variable (LMN0 + TUN_DLMN) is activated by setting the start bit TUN_ST (transition from phase 1 -> 2). When you modify the setpoint value, the new value will not take effect until the point of inflection has been reached (automatic mode will not be enabled until this point has been reached).
  • Page 229: Tuning Result

    Using PID basic functions 7.3 TCONT_CP 7.3.3.4 Tuning result The left cipher of STATUS_H displays the tuning status STATUS_H Result Default, i.e., new controller parameters have not (yet) been found. 10000 Suitable control parameters found. 2xxxx Control parameters have been found via estimated values; check the control response or check the STATUS_H diagnostic message and repeat controller tuning.
  • Page 230: Parallel Tuning Of Controller Channels

    Using PID basic functions 7.3 TCONT_CP 7.3.3.5 Parallel tuning of controller channels Adjacent zones (strong heat coupling) If two or more controllers are controlling the temperature, on a plate, for example (in other words, there are two heaters and two measured process values with strong heat coupling), proceed as follows: 1.
  • Page 231: Fault Descriptions And Corrective Measures

    Using PID basic functions 7.3 TCONT_CP 7.3.3.6 Fault descriptions and corrective measures Compensating operator errors Operator error STATUS and action Comment TUN_ON and setpoint step Transition to phase 1; how- The setpoint change is canceled. change or TUN_ST are set sim- ever, tuning is not started.
  • Page 232 Using PID basic functions 7.3 TCONT_CP The following schematic illustrates the overshoot of the process variable when the excitation is too strong (process type III): In typical temperature processes, cancelation shortly before reaching the point of inflection is not critical in terms of the controller parameters. If you repeat the attempt, reduce TUN_DLMN or increase the setpoint step change.
  • Page 233 Using PID basic functions 7.3 TCONT_CP Quality of measuring signals (measurement noise, low-frequency interference) The results of tuning can be distorted by measurement noise or by low-frequency interference. Note the following: ● If you encounter measurement noise, set the sampling frequency higher rather than lower.
  • Page 234: Performing Pretuning

    Using PID basic functions 7.3 TCONT_CP 7.3.3.7 Performing pretuning Requirements ● The instruction and the technology object are loaded on the CPU. Procedure To manually determine the optimum PID parameters for initial commissioning, follow these steps: 1. Click the "Start" icon. If there is no online connection, this will be established.
  • Page 235: Cancelling Pretuning Or Fine Tuning

    Using PID basic functions 7.3 TCONT_CP 7.3.3.9 Cancelling pretuning or fine tuning To cancel pretuning or fine tuning, click on the icon, "Stop tuning". If the PID parameters have not yet been calculated and stored, TCONT_CP starts in automatic mode LMN = LMN0 + TUN_DLMN. If the controller was in manual mode before the tuning, the old manual manipulated variable is output.
  • Page 236: Performing Fine Tuning Manually

    Using PID basic functions 7.3 TCONT_CP Adjust the default factor (0.8) in the following situations, in particular: ● Process type I with PID (0.8 →0.6): Setpoint step changes within the control zone still lead to approximately 18% overshoot with PFAC_SP = 0.8. ●...
  • Page 237: Tcont_S

    Using PID basic functions 7.4 TCONT_S TCONT_S 7.4.1 Technology object TCONT_S The technology object TCONT_S provides a step controller for actuators with integrating behavior and is used to control technical temperature processes with binary output value output signals. The technology object corresponds to the instance data block of the TCONT_S instruction.
  • Page 238: Configure Controller Algorithm Tcont_S

    Using PID basic functions 7.4 TCONT_S Use internal process values To use the input parameter PV_IN, proceed as follows: 1. Select the entry "Internal" from the "Source" list. Control deviation Set a dead zone range under the following requirement: ● The process value signal is noisy. ●...
  • Page 239: Configure Manipulated Value Tcont_S

    Using PID basic functions 7.4 TCONT_S 7.4.4 Configure manipulated value TCONT_S Pulse generator 1. Enter the minimum impulse duration and minimum pause duration. The values must be greater than or equal to the cycle time for the input parameter CYCLE. The frequency of operation is reduced through this. 2.
  • Page 240: Auxiliary Functions

    Auxiliary functions Polyline Polyline The Polyline instruction provides a function with the characteristic curve of the polyline whose points can be used, for example, to linearize the behavior of non-linear sensors. The Polyline instruction can be used with an S7-1500 CPU Firmware 2.0 and higher and an S7-1200 CPU Firmware 4.2 and higher.
  • Page 241: Instructions

    Instructions PID_Compact 9.1.1 New features of PID_Compact PID_Compact V2.3 ● Response of the output value when switching from "Inactive" operating mode to "Automatic mode" The new option IntegralResetMode = 4 was added and defined as default. With IntegralResetMode = 4, the integral action is automatically pre-assigned when switching from "Inactive"...
  • Page 242 Instructions 9.1 PID_Compact The Error parameter indicates if an error is pending. When the error is no longer pending, Error = FALSE. The ErrorBits parameter shows which errors have occurred. Use ErrorAck to acknowledge the errors and warnings without restarting the controller or clearing the integral action.
  • Page 243 Instructions 9.1 PID_Compact ● Default value of PID parameters The following default settings have been changed: – Proportional action weighting (PWeighting) from 0.0 to 1.0 – Derivative action weighting (DWeighting) from 0.0 to 1.0 – Coefficient for derivative delay (TdFiltRatio) from 0.0 to 0.2 ●...
  • Page 244: Compatibility With Cpu And Fw

    Instructions 9.1 PID_Compact ● Access to tags The following tags can now be used in the user program. – i_Event_SUT – i_Event_TIR – r_Ctrl_Ioutv ● Troubleshooting PID_Compact now outputs the correct pulses when the shortest ON time is not equal to the shortest OFF time.
  • Page 245: Cpu Processing Time And Memory Requirement Pid_Compact V2.X

    Instructions 9.1 PID_Compact 9.1.3 CPU processing time and memory requirement PID_Compact V2.x CPU processing time Typical CPU processing times of the PID_Compact technology object as of Version V2.0, depending on CPU type. Typ. CPU processing time PID_Compact V2.x CPU 1211C ≥ V4.0 300 µs CPU 1215C ≥...
  • Page 246: Pid_Compact V2

    Instructions 9.1 PID_Compact 9.1.4 PID_Compact V2 9.1.4.1 Description of PID_Compact V2 Description The PID_Compact instruction provides a PID controller with integrated tuning for actuators with proportional action. The following operating modes are possible: ● Inactive ● Pretuning ● Fine tuning ●...
  • Page 247 Instructions 9.1 PID_Compact Block diagram of PID_Compact Block diagram of PIDT1 with anti-windup PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 248 Instructions 9.1 PID_Compact Call PID_Compact is called in the constant time scale of a cycle interrupt OB. If you call PID_Compact as a multi-instance DB, no technology object is created. No parameter assignment interface or commissioning interface is available. You must assign parameters for PID_Compact directly in the multi-instance DB and commission it via a watch table.
  • Page 249: Mode Of Operation Of Pid_Compact V2

    Instructions 9.1 PID_Compact 9.1.4.2 Mode of operation of PID_Compact V2 Monitoring process value limits You specify the high limit and low limit of the process value in the Config.InputUpperLimit and Config.InputLowerLimit tags. If the process value is outside these limits, an error occurs (ErrorBits = 0001h).
  • Page 250 Instructions 9.1 PID_Compact Substitute output value In the event of an error, PID_Compact can output a substitute output value that you define at the SubstituteOutput tag. The substitute output value must be within the output value limits. Monitoring signal validity The values of the following parameters are monitored for validity when used: ●...
  • Page 251: Input Parameters Of Pid_Compact V2

    Instructions 9.1 PID_Compact Sampling time of the PID algorithm The controlled system needs a certain amount of time to respond to changes in the output value. It is therefore not advisable to calculate the output value in every cycle. The sampling time of the PID algorithm represents the time between two calculations of the output value.
  • Page 252 Instructions 9.1 PID_Compact Parameter Data type Default Description ManualValue REAL Manual value This value is used as the output value in manual mode. Values from Config.OutputLowerLimit to Con- fig.OutputUpperLimit are permitted. ErrorAck BOOL FALSE FALSE -> TRUE edge • ErrorBits and Warning are reset. Reset BOOL FALSE...
  • Page 253: Output Parameters Of Pid_Compact V2

    Instructions 9.1 PID_Compact 9.1.4.4 Output parameters of PID_Compact V2 Table 9- 2 Output parameters of PID_Compact V2 Parameter Data type Default Description ScaledInput REAL Scaled process value The "Output", "Output_PER", and "Output_PWM" outputs can be used concurrently. Output REAL Output value in REAL format Output_PER Analog output value Output_PWM...
  • Page 254: In/Out Parameters Of Pid_Compact V2

    Instructions 9.1 PID_Compact 9.1.4.5 In/out parameters of PID_Compact V2 Table 9- 3 In/out parameters of PID_Compact V2 Parameter Data type Default Description Mode At Mode, specify the operating mode to which PID_Compact is to switch. Options are: Mode = 0: Inactive •...
  • Page 255: Static Tags Of Pid_Compact V2

    Instructions 9.1 PID_Compact 9.1.4.6 Static tags of PID_Compact V2 You must not change tags that are not listed. These are used for internal purposes only. Data type Default Description IntegralResetMode Up to V2.2: 1, The IntegralResetMode V2 tag (Page 274) determines how the integral actionPIDCtrl.IntegralSum is pre- V2.3 or high- assigned when switching from "Inactive"...
  • Page 256 Instructions 9.1 PID_Compact Data type Default Description CancelTuningLevel REAL 10.0 Permissible fluctuation of setpoint during tuning. Tun- ing is not canceled until: Setpoint > CurrentSetpoint + CancelTuningLevel • Setpoint < CurrentSetpoint - CancelTuningLevel • SubstituteOutput REAL Substitute output value When the following conditions are met, the substitute output value is used: An error has occurred in automatic mode.
  • Page 257 Instructions 9.1 PID_Compact Data type Default Description Config.InputUpperWarning REAL 3.402822e+38 Warning high limit of the process value If you set InputUpperWarning outside the process value limits, the configured absolute process value high limit is used as the warning high limit. If you configure InputUpperWarning within the process value limits, this value is used as the warning high limit.
  • Page 258 Instructions 9.1 PID_Compact Data type Default Description Config.InputScaling.UpperPointIn REAL 27648.0 Scaling Input_PER high Input_PER is converted to percent based on the two value pairs UpperPointOut, UpperPointIn and Lower- PointOut, LowerPointIn. Config.InputScaling.LowerPointIn REAL Scaling Input_PER low Input_PER is converted to percent based on the two value pairs UpperPointOut, UpperPointIn and Lower- PointOut, LowerPointIn.
  • Page 259 Instructions 9.1 PID_Compact Data type Default Description PIDSelfTune.SUT.CalculateParams BOOL FALSE The properties of the controlled system are saved during tuning. If SUT.CalculateParams = TRUE, the parameters for pretuning are recalculated according to these properties. This enables you to change the pa- rameter calculation method without having to repeat controller tuning.
  • Page 260 Instructions 9.1 PID_Compact Data type Default Description PIDSelfTune.TIR.CalculateParams BOOL FALSE The properties of the controlled system are saved during tuning. If TIR.CalculateParams = TRUE, the parameters for fine tuning are recalculated according to these properties. This enables you to change the parameter calculation method without having to repeat controller tuning.
  • Page 261 Instructions 9.1 PID_Compact Data type Default Description Retain.CtrlParams.Ti REAL 20.0 CtrlParams.Ti > 0.0: Active integral action time • CtrlParams.Ti = 0.0: Integral action is deactivated • Ti is retentive. Retain.CtrlParams.Td REAL CtrlParams.Td > 0.0: Active derivative action time • CtrlParams.Td = 0.0: Derivative action is deac- •...
  • Page 262 Instructions 9.1 PID_Compact Data type Default Description Retain.CtrlParams.DWeighting REAL Active derivative action weighting The derivative action may weaken with changes to the setpoint. Values from 0.0 to 1.0 are applicable. 1.0: Derivative action is fully effective upon setpoint • change 0.0: Derivative action is not effective upon setpoint •...
  • Page 263: Changing The Pid_Compact V2 Interface

    Instructions 9.1 PID_Compact 9.1.4.7 Changing the PID_Compact V2 interface The following table shows what has changed in the PID_Compact instruction interface. PID_Compact V1 PID_Compact V2 Change Input_PER Input_PER Data type from Word to Int Disturbance ErrorAck ModeActivate Output_PER Output_PER Data type from Word to Int Error ErrorBits Renamed...
  • Page 264 Instructions 9.1 PID_Compact PID_Compact V1.x PID_Compact V2 sPid_Cmpt.r_Sp_Hlm Config.SetpointUpperLimit sPid_Cmpt.r_Sp_Llm Config.SetpointLowerLimit sPid_Cmpt.r_Pv_Norm_IN_1 Config.InputScaling.LowerPointIn sPid_Cmpt.r_Pv_Norm_IN_2 Config.InputScaling.UpperPointIn sPid_Cmpt.r_Pv_Norm_OUT_1 Config.InputScaling.LowerPointOut sPid_Cmpt.r_Pv_Norm_OUT_2 Config.InputScaling.UpperPointOut sPid_Cmpt.r_Lmn_Hlm Config.OutputUpperLimit sPid_Cmpt.r_Lmn_Llm Config.OutputLowerLimit sPid_Cmpt.b_Input_PER_On Config.InputPerOn sPid_Cmpt.b_LoadBackUp LoadBackUp sPid_Cmpt.b_InvCtrl Config.InvertControl sPid_Cmpt.r_Lmn_Pwm_PPTm Config.MinimumOnTime sPid_Cmpt.r_Lmn_Pwm_PBTm Config.MinimumOffTime sPid_Cmpt.r_Pv_Hlm Config.InputUpperLimit sPid_Cmpt.r_Pv_Llm Config.InputLowerLimit sPid_Cmpt.r_Pv_HWrn Config.InputUpperWarning sPid_Cmpt.r_Pv_LWrn Config.InputLowerWarning sParamCalc.i_Event_SUT PIDSelfTune.SUT.State...
  • Page 265: Parameters State And Mode V2

    Instructions 9.1 PID_Compact 9.1.4.8 Parameters State and Mode V2 Correlation of the parameters The State parameter shows the current operating mode of the PID controller. You cannot change the State parameter. With a rising edge at ModeActivate, PID_Compact switches to the operating mode saved in the Mode in-out parameter.
  • Page 266 Instructions 9.1 PID_Compact State / Mode Description of operating mode Fine tuning Fine tuning generates a constant, limited oscillation of the process value. The PID parameters are recalcu- lated based on the amplitude and frequency of this oscillation. PID parameters from fine tuning usually have better master control and disturbance characteristics than PID parameters from pretuning.
  • Page 267 Instructions 9.1 PID_Compact State / Mode Description of operating mode Manual mode In manual mode, you specify a manual output value in the ManualValue parameter. You can also activate this operating mode using ManualEnable = TRUE. We recommend that you change the operating mode using Mode and ModeActivate only.
  • Page 268 Instructions 9.1 PID_Compact The following table shows how Mode and State change during pretuning with errors. Cycle no. Mode State Action Set Mode = 1 Set ModeActivate = TRUE Value of State is saved in Mode parameter Pretuning is started Pretuning canceled Manual mode is started If ActivateRecoverMode = TRUE, the operating mode that is saved in the Mode parameter is...
  • Page 269: Parameter Errorbits V2

    Instructions 9.1 PID_Compact 9.1.4.9 Parameter ErrorBits V2 If several errors are pending simultaneously, the values of the ErrorBits are displayed with binary addition. The display of ErrorBits = 0003h, for example, indicates that the errors 0001h and 0002h are pending simultaneously. In manual mode, PID_Compact uses ManualValue as output value.
  • Page 270 Instructions 9.1 PID_Compact ErrorBits Description 
 ( DW#16#...) 0200 Invalid value at "Input" parameter: Value has an invalid number format. If automatic mode was active before the error occurred and ActivateRecoverMode = TRUE, PID_Compact outputs the configured substitute output value. As soon as the error is no longer pending, PID_Compact switches back to automatic mode.
  • Page 271: Tag Activaterecovermode V2

    Instructions 9.1 PID_Compact 9.1.4.10 Tag ActivateRecoverMode V2 The ActivateRecoverMode tag determines the reaction to error. The Error parameter indicates if an error is pending. When the error is no longer pending, Error = FALSE. The ErrorBits parameter shows which errors have occurred. Automatic mode NOTICE Your system may be damaged.
  • Page 272 Instructions 9.1 PID_Compact Pretuning and fine tuning ActivateRecov- Description erMode FALSE PID_Compact automatically switches to "Inactive" mode in the event of an error. The controller is only activated by a falling edge at Reset or a rising edge at ModeActivate. TRUE If the following error occurs, PID_Compact remains in the active mode: 0020h: Pretuning is not permitted during fine tuning.
  • Page 273: Tag Warning V2

    Instructions 9.1 PID_Compact 9.1.4.11 Tag Warning V2 If several warnings are pending simultaneously, the values of the Warning tag are displayed with binary addition. The display of warning 0003h, for example, indicates that the warnings 0001h and 0002h are pending simultaneously. Warning Description (DW#16#..)
  • Page 274: Integralresetmode V2 Tag

    Instructions 9.1 PID_Compact 9.1.4.12 IntegralResetMode V2 tag The IntegralResetMode tag determines how the integral action PIDCtrl.IntegralSum is pre- assigned: ● When switching from "Inactive" operating mode to "Automatic mode" ● With edge TRUE -> FALSE at parameter Reset and parameter Mode = 3 This setting only works for one cycle and is only effective if the integral action is activated (Retain.CtrlParams.Ti >...
  • Page 275 Instructions 9.1 PID_Compact IntegralReset- Description Mode Pre-assign The value of PIDCtrl.IntegralSum is automatically pre-assigned as if Output = OverwriteInitialOutput- Value in the last cycle. Like setpoint change (only for PID_Compact with version ≥ 2.3) The value of PIDCtrl.IntegralSum is automatically pre-assigned so that a similar output value jump re- sults as for a PI controller in automatic mode in case of a setpoint change from the current actual value to the current setpoint.
  • Page 276: Sample Program For Pid_Compact

    Instructions 9.1 PID_Compact 9.1.4.13 Sample program for PID_Compact In the following example, you are controlling temperature values with the technology object of the instruction "PID_Compact". The temperature values are simulated based on a block which simulates a delay element of the third order (PT3 element). The PID parameters of the technology object can be set automatically via the pretuning.
  • Page 277 Instructions 9.1 PID_Compact Interconnection of the parameters You call the following interconnections in a cyclic interrupt OB. Network 1: You interconnect the parameters of the instruction "PID_Compact" as follows. Network 2: You interconnect the parameters of the block simulating the temperature values "SLI_PROC_C"...
  • Page 278 Instructions 9.1 PID_Compact Technology object You configure the technology object with the properties of the instruction "PID_Compact" or by using the path Technology object > Configuration. The controller type and the input/output parameters are important for the example. With the controller type, you make a preselection for the unit of the value to the controlled.
  • Page 279 Instructions 9.1 PID_Compact Procedure for starting the control After the download to the CPU the PID_Compact is in manual mode with manual value 0.0. To start the control, follow these steps: 1. Open the Commissioning of the technology object "SLI_Tech_PID_Compact". 2.
  • Page 280 Instructions 9.1 PID_Compact Procedure for stopping control To stop and exit PID_Compact and the program, follow these steps: 1. Click the "Stop PID_Compact" button in the technology object "SLI_Tech_PID_Compact" in the "Online status of controller" area. The instruction "PID_Compact" exits the control and outputs the value "0.0" as manipulated variable.
  • Page 281 Instructions 9.1 PID_Compact "SLI_PROC_C" block The "SLI_PROC_C" block simulates the process value ("inputValue") of the rising temperature of a plant. The block "SLI_PROC_C" contains the manipulated variable of the controller ("outputValue) and simulates the temperature behavior of the process. This temperature is fed as process value ("inputValue") into the controller.
  • Page 282 Instructions 9.1 PID_Compact Program code You can find additional information about the program code for the above-named example under the keyword "Sample Library for Instructions". PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 283: Pid_Compact V1

    Instructions 9.1 PID_Compact 9.1.5 PID_Compact V1 9.1.5.1 Description of PID_Compact V1 Description The PID_Compact instruction provides a PID controller with integrated tuning for automatic and manual mode. Call PID_Compact is called in the constant interval of the cycle time of the calling OB (preferably in a cyclic interrupt OB).
  • Page 284 Instructions 9.1 PID_Compact During controller tuning and in automatic mode, PID_Compact 1.0 is set to "Inactive" operating mode under the following conditions: ● New mean value >= 1.1 x old mean value ● New mean value <= 0.9 x old mean value ●...
  • Page 285 Instructions 9.1 PID_Compact Block diagram of PID_Compact Block diagram of PIDT1 with anti-windup PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 286: Input Parameters Of Pid_Compact V1

    Instructions 9.1 PID_Compact Reaction to error If errors occur, they are output in parameter Error, and PID_Compact changes to "Inactive" mode. Reset the errors using the Reset parameter. Control logic An increase of the output value is generally intended to cause an increase in the process value.
  • Page 287: Output Parameters Of Pid_Compact V1

    Instructions 9.1 PID_Compact 9.1.5.3 Output parameters of PID_Compact V1 Table 9- 5 Output parameters of PID_Compact V1 Parameter Data type Default Description ScaledInput REAL Output of the scaled process value Outputs "Output", "Output_PER", and "Output_PWM" can be used concurrently. Output REAL Output value in REAL format Output_PER...
  • Page 288: Static Tags Of Pid_Compact V1

    Instructions 9.1 PID_Compact 9.1.5.4 Static tags of PID_Compact V1 You must not change tags that are not listed. These are used for internal purposes only. Table 9- 6 Static tags of PID_Compact V1 Data type Default Description sb_GetCycleTime BOOL TRUE If sb_GetCycleTime = TRUE, the automatic determi- nation of the cycle time is started.
  • Page 289 Instructions 9.1 PID_Compact Data type Default Description sPid_Calc.b_RunIn BOOL FALSE b_RunIn = FALSE • Pretuning is started when fine tuning is started from inactive or manual mode. If the requirements for pretuning are not met, PID_Compact reacts as if b_RunIn = TRUE. If fine tuning is started from automatic mode, the system uses the existing PID parameters to con- trol to the setpoint.
  • Page 290 Instructions 9.1 PID_Compact Data type Default Description sPid_Cmpt.r_Sp_Hlm REAL +3.402822e+ High limit of setpoint If you configure sPid_Cmpt.r_Sp_Hlm outside the process value limits, the configured process value absolute high limit is used as the setpoint high limit. If you set sPid_Cmpt.r_Sp_Hlm within the process value limits, this value is used as the setpoint high limit.
  • Page 291 Instructions 9.1 PID_Compact Data type Default Description sPid_Cmpt.r_Lmn_Pwm_PBTm REAL The minimum OFF time of the pulse width modulation in seconds is rounded to r_Lmn_Pwm_PBTm = r_Cycle or r_Lmn_Pwm_PBTm = n*r_Cycle sPid_Cmpt.r_Pv_Hlm REAL 120.0 High limit of the process value At the I/O input, the process value can be a maxi- mum of 18% higher than the standard range (over- range).
  • Page 292 Instructions 9.1 PID_Compact Data type Default Description sRet.r_Ctrl_Ti REAL 20.0 r_Ctrl_Ti > 0.0: Active integral action time • r_Ctrl_Ti = 0.0: Integral action is deactivated • r_Ctrl_Ti is retentive. sRet.r_Ctrl_Td REAL r_Ctrl_Td > 0.0: Active derivative action time • r_Ctrl_Td = 0.0: Derivative action is deactivated •...
  • Page 293: Parameters State And Sret.i_Mode V1

    Instructions 9.1 PID_Compact 9.1.5.5 Parameters State and sRet.i_Mode V1 Correlation of the parameters The State parameter indicates the current operating mode of the PID controller. You cannot modify the State parameter. You need to modify the sRet.i_Mode tag to change the operating mode. This also applies when the value for the new operating mode is already in sRet.i_Mode.
  • Page 294 Instructions 9.1 PID_Compact Meaning of values State / Description of the operating mode sRet.i_Mode Inactive The controller is switched off. The controller was in "inactive" mode before pretuning was performed. The PID controller will change to "inactive" mode when running if an error occurs or if the "Deactivate con- troller"...
  • Page 295 Instructions 9.1 PID_Compact State / Description of the operating mode sRet.i_Mode Fine tuning Fine tuning generates a constant, limited oscillation of the process value. The PID parameters are opti- mized based on the amplitude and frequency of this oscillation. The differences between the process re- sponse during pretuning and fine tuning are analyzed.
  • Page 296 Instructions 9.1 PID_Compact State / Description of the operating mode sRet.i_Mode Automatic mode In automatic mode, PID_Compact corrects the controlled system in accordance with the parameters speci- fied. The controller changes to automatic mode if one the following conditions is fulfilled: Pretuning successfully completed •...
  • Page 297: Parameter Error V1

    Instructions 9.1 PID_Compact 9.1.5.6 Parameter Error V1 If several errors are pending simultaneously, the values of the error codes are displayed with binary addition. The display of error code 0003, for example, indicates that the errors 0001 and 0002 are pending simultaneously. Error Description 
...
  • Page 298: Parameter Reset V1

    Instructions 9.1 PID_Compact 9.1.5.7 Parameter Reset V1 The response to Reset = TRUE depends on the version of the PID_Compact instruction. Reset response PID_Compact V.1.1 or higher A rising edge at Reset triggers a change to "Inactive" mode; errors and warnings are reset and the integral action is deleted.
  • Page 299 Instructions 9.1 PID_Compact Reset response PID_Compact V.1.0 A rising edge at Reset triggers a change to "Inactive" mode; errors and warnings are reset and the integral action is deleted. The controller is not reactivated until the next edge at i_Mode. ①...
  • Page 300: Tag Sd_Warning V1

    Instructions 9.1 PID_Compact 9.1.5.8 Tag sd_warning V1 If several warnings are pending, the values of variable sd_warning are displayed by means of binary addition. The display of warning 0003, for example, indicates that the warnings 0001 and 0002 are also pending. sd_warning Description (DW#16#..)
  • Page 301: Tag I_Event_Tir V1

    Instructions 9.1 PID_Compact 9.1.5.10 Tag i_Event_TIR V1 i_Event_TIR Name Description -100 TIR_FIRST_SUT Fine tuning is not possible. Pretuning will be executed first. 0 TIR_INIT Initialize fine tuning 200 TIR_STDABW Calculate the standard deviation 300 TIR_RUN_IN Attempt to reach the setpoint 400 TIR_CTRLN Attempt to reach the setpoint with the existing PID parameters (if pretuning has been successful)
  • Page 302: Pid_3Step

    Instructions 9.2 PID_3Step PID_3Step 9.2.1 New features of PID_3Step PID_3Step V2.3 ● As of PID_3Step Version 2.3 the monitoring and limiting of the travel time can be deactivated with Config.VirtualActuatorLimit = 0.0. PID_3Step V2.2 ● Use with S7-1200 As of PID_3Step V2.2, the instruction with V2 functionality can also be used on S7-1200 with firmware version 4.0 or higher.
  • Page 303 Instructions 9.2 PID_3Step ● Startup characteristics The operating mode specified at the Mode parameter is also started on a negative edge at Reset and during a CPU cold restart, if RunModeByStartup = TRUE. ● ENO characteristics ENO is set depending on the operating mode. If State = 0, then ENO = FALSE.
  • Page 304: Compatibility With Cpu And Fw

    Instructions 9.2 PID_3Step 9.2.2 Compatibility with CPU and FW The following table shows which version of PID_3Step can be used on which CPU. PID_3Step S7-1200 V4.2 or higher V2.3 V2.2 V1.1 V4.0 to V4.1 V2.2 V1.1 V3.x V1.1 V1.0 V2.x V1.1 V1.0 V1.x...
  • Page 305: Cpu Processing Time And Memory Requirement Pid_3Step V2.X

    Instructions 9.2 PID_3Step 9.2.3 CPU processing time and memory requirement PID_3Step V2.x CPU processing time Typical CPU processing times of the PID_3Step technology object as of Version V2.0, depending on CPU type. Typ. CPU processing time PID_3Step V2.x CPU 1211C ≥ V4.0 410 µs CPU 1215C ≥...
  • Page 306: Pid_3Step V2

    Instructions 9.2 PID_3Step 9.2.4 PID_3Step V2 9.2.4.1 Description of PID_3Step V2 Description You use the PID_3Step instruction to configure a PID controller with self tuning for valves or actuators with integrating behavior. The following operating modes are possible: ● Inactive ●...
  • Page 307 Instructions 9.2 PID_3Step PID algorithm PID_3Step is a PIDT1 controller with anti-windup and weighting of the proportional and derivative actions. The PID algorithm operates according to the following equation: Symbol Description Δy Output value of the PID algorithm Proportional gain Laplace operator Proportional action weighting Setpoint...
  • Page 308 Instructions 9.2 PID_3Step Block diagram without position feedback PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 309 Instructions 9.2 PID_3Step Block diagram with position feedback PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 310 Instructions 9.2 PID_3Step Block diagram of PIDT1 with anti-windup Call PID_3Step is called in the constant time scale of a cycle interrupt OB. If you call PID_3Step as a multi-instance DB, no technology object is created. No parameter assignment interface or commissioning interface is available. You must assign parameters for PID_3Step directly in the multi-instance DB and commission it via a watch table.
  • Page 311 Instructions 9.2 PID_3Step Reaction to error In automatic mode and during commissioning, the reaction to error depends on the ErrorBehaviour and ActivateRecoverMode tags. In manual mode, the reaction is independent of ErrorBehaviour and ActivateRecoverMode. If ActivateRecoverMode = TRUE, the reaction additionally depends on the error that occurred. ErrorBe- Acti- Configuration editor...
  • Page 312: Mode Of Operation Of Pid_3Step V2

    Instructions 9.2 PID_3Step 9.2.4.2 Mode of operation of PID_3Step V2 Monitoring process value limits You specify the high limit and low limit of the process value in the Config.InputUpperLimit and Config.InputLowerLimit tags. If the process value is outside these limits, an error occurs (ErrorBits = 0001h).
  • Page 313 Instructions 9.2 PID_3Step If OutputPerOn = FALSE and FeedbackOn = FALSE, you cannot limit the output value. Output_UP and Output_DN are then reset upon Actuator_H = TRUE or Actuator_L = TRUE. If endstop signals are also not present, Output_UP and Output_DN are reset after a travel time of Config.VirtualActuatorLimit ×...
  • Page 314 Instructions 9.2 PID_3Step Monitoring the PID_3Step sampling time Ideally, the sampling time is equivalent to the cycle time of the calling OB. The PID_3Step instruction measures the time interval between two calls. This is the current sampling time. On every switchover of operating mode and during the initial startup, the mean value is formed from the first 10 sampling times.
  • Page 315: Changing The Pid_3Step V2 Interface

    Instructions 9.2 PID_3Step Control logic An increase of the output value is generally intended to cause an increase in the process value. This is referred to as a normal control logic. For cooling and discharge control systems, it may be necessary to invert the control logic. PID_3Step does not work with negative proportional gain.
  • Page 316: Input Parameters Of Pid_3Step V2

    Instructions 9.2 PID_3Step 9.2.4.4 Input parameters of PID_3Step V2 Table 9- 7 Input parameters of PID_3Step V2 Parameter Data type Default Description Setpoint REAL Setpoint of the PID controller in automatic mode Input REAL A tag of the user program is used as source for the process value.
  • Page 317 Instructions 9.2 PID_3Step Parameter Data type Default Description Manual_UP BOOL FALSE Manual_UP = TRUE • The valve is opened even if you are using Output_PER or a position feedback. The valve is no longer moved if the high endstop has been reached. See also Config.VirtualActuatorLimit Manual_UP = FALSE •...
  • Page 318: Output Parameters Of Pid_3Step V2

    Instructions 9.2 PID_3Step 9.2.4.5 Output parameters of PID_3Step V2 Table 9- 8 Output parameters of PID_3Step V2 Parameter Data type Default Description ScaledInput REAL Scaled process value ScaledFeedback REAL Scaled position feedback For an actuator without position feedback, the position of the actuator indicated by ScaledFeedback is very imprecise.
  • Page 319 Instructions 9.2 PID_3Step Parameter Data type Default Description State The State parameter (Page 330) shows the current operating mode of the PID controller. You can change the operating mode using the input parameter Mode and a rising edge at ModeActivate. State = 0: Inactive •...
  • Page 320: In/Out Parameters Of Pid-3Step V2

    Instructions 9.2 PID_3Step 9.2.4.6 In/out parameters of PID-3Step V2 Table 9- 9 In/out parameters of PID-3Step V2 Parameter Data type Default Description Mode At the Mode parameter, you specify the operating mode to which PID_3Step is to switch. Options are: Mode = 0: Inactive •...
  • Page 321: Static Tags Of Pid_3Step V2

    Instructions 9.2 PID_3Step 9.2.4.7 Static tags of PID_3Step V2 You must not change tags that are not listed. These are used for internal purposes only. Data type Default Description ManualUpInternal BOOL FALSE In manual mode, each rising edge opens the valve by 5% of the total control range or for the duration of the minimum motor transition time.
  • Page 322 Instructions 9.2 PID_3Step Data type Default Description SavePosition REAL Substitute output value If ErrorBehaviour = TRUE, the actuator is moved to a posi- tion that is safe for the plant when an error occurs. As soon as the substitute output value has been reached, PID_3Step switches the operating mode according to ActivateRecov- erMode.
  • Page 323 Instructions 9.2 PID_3Step Data type Default Description Config.InputUpperWarning REAL +3.402822e+38 Warning high limit of the process value If you set InputUpperWarning outside the process value limits, the configured absolute process value high limit is used as the warning high limit. If you configure InputUpperWarning within the process value limits, this value is used as the warning high limit.
  • Page 324 Instructions 9.2 PID_3Step Data type Default Description Config.VirtualActuatorLimit REAL 150.0 If all the following conditions have been satisfied, the actua- tor is moved in one direction for the maximum period of VirtualActuatorLimit × Retain.TransitTime/100 and the warn- ing 2000h is output: Config.OutputPerOn = FALSE •...
  • Page 325 Instructions 9.2 PID_3Step Data type Default Description GetTransitTime.InvertDirection BOOL FALSE If InvertDirection = FALSE, the valve is fully opened, closed, and then reopened in order to determine the valve transition time. If InvertDirection = TRUE, the valve is fully closed, opened, and then closed again.
  • Page 326 Instructions 9.2 PID_3Step Data type Default Description CtrlParamsBackUp.Gain REAL Saved proportional gain CtrlParamsBackUp.Ti REAL 20.0 Saved integration time in seconds CtrlParamsBackUp.Td REAL Saved derivative action time in seconds CtrlParamsBackUp.TdFiltRatio REAL Saved derivative delay coefficient CtrlParamsBack- REAL Saved proportional action weighting Up.PWeighting CtrlParamsBack- REAL...
  • Page 327 Instructions 9.2 PID_3Step Data type Default Description PIDSelfTune.TIR.RunIn BOOL FALSE With the RunIn tag, you can specify that fine tuning can also be performed without pretuning. RunIn = FALSE • Pretuning is started when fine tuning is started from in- active or manual mode.
  • Page 328 Instructions 9.2 PID_3Step Data type Default Description Retain.TransitTime REAL 30.0 Motor transition time in seconds Time in seconds the actuating drive requires to move the valve from the closed to the opened state. TransitTime is retentive. Retain.CtrlParams.SetByUser BOOL FALSE If SetByUser = FALSE, the PID parameters are determined automatically and PID_3Step operates with a dead zone at the output value.
  • Page 329 Instructions 9.2 PID_3Step Data type Default Description Retain.CtrlParams.PWeighting REAL Active proportional action weighting The proportional action may weaken with changes to the setpoint. Values from 0.0 to 1.0 are applicable. 1.0: Proportional action for setpoint change is fully effec- • tive 0.0: Proportional action for setpoint change is not effec- •...
  • Page 330: Parameters State And Mode V2

    Instructions 9.2 PID_3Step 9.2.4.8 Parameters State and Mode V2 Correlation of the parameters The State parameter shows the current operating mode of the PID controller. You cannot change the State parameter. With a rising edge at ModeActivate, PID_3Step switches to the operating mode saved in the Mode in-out parameter.
  • Page 331 Instructions 9.2 PID_3Step State Description of operating mode Fine tuning Fine tuning generates a constant, limited oscillation of the process value. The PID parameters are recalcu- lated based on the amplitude and frequency of this oscillation. PID parameters from fine tuning usually have better master control and disturbance characteristics than PID parameters from pretuning.
  • Page 332 Instructions 9.2 PID_3Step State Description of operating mode Manual mode In manual mode, you specify manual output values in the Manual_UP and Manual_DN parameters or Man- ualValue parameter. Whether or not the actuator can be moved to the output value in the event of an error is described in the ErrorBits parameter.
  • Page 333 Instructions 9.2 PID_3Step ENO characteristics If State = 0, then ENO = FALSE. If State ≠ 0, then ENO = TRUE. Automatic switchover of operating mode during commissioning Automatic mode is activated following successful pretuning or fine tuning. The following table shows how Mode and State change during successful pretuning.
  • Page 334 Instructions 9.2 PID_3Step Automatic switchover of operating mode in automatic mode PID_3Step automatically switches the operating mode in the event of an error. The following diagram illustrates the influence of ErrorBehaviour and ActivateRecoverMode on this switchover of operating mode. Automatic switchover of operating mode in the event of an error Automatic switchover of operating mode once the current operation has been completed.
  • Page 335: Parameter Errorbits V2

    Instructions 9.2 PID_3Step 9.2.4.9 Parameter ErrorBits V2 If several errors are pending simultaneously, the values of the ErrorBits are displayed with binary addition. The display of ErrorBits = 0003h, for example, indicates that the errors 0001h and 0002h are pending simultaneously. If there is a position feedback, PID_3Step uses ManualValue as output value in manual mode.
  • Page 336 Instructions 9.2 PID_3Step ErrorBits Description 
 ( DW#16#...) 0200 Invalid value at "Input" parameter: Value has an invalid number format. If automatic mode was active before the error occurred and ActivateRecoverMode = TRUE, PID_3Step switches to "Approach substitute output value with error monitoring" or "Error monitoring" mode. As soon as the error is no longer pending, PID_3Step switches back to automatic mode.
  • Page 337 Instructions 9.2 PID_3Step ErrorBits Description 
 ( DW#16#...) 8000 Error during digital position feedback. Actuator_H = TRUE and Actuator_L = TRUE. The actuator cannot be moved to the substitute output value and remains in its current position. Manual mode is not possible in this state. In order to move the actuator from this state, you must deactivate the "Actuator endstop"...
  • Page 338: Tag Activaterecovermode V2

    Instructions 9.2 PID_3Step 9.2.4.10 Tag ActivateRecoverMode V2 The ActivateRecoverMode tag determines the reaction to error. The Error parameter indicates if an error is pending. When the error is no longer pending, Error = FALSE. The ErrorBits parameter shows which errors have occurred. NOTICE Your system may be damaged.
  • Page 339 Instructions 9.2 PID_3Step Pretuning, fine tuning, and transition time measurement ActivateRecov- Description erMode FALSE In the event of an error, PID_3Step switches to "Inactive" or "Approach substitute output value" mode. The controller is only activated by a falling edge at Reset or a rising edge at ModeActivate. The controller changes to "Inactive"...
  • Page 340: Tag Warning V2

    Instructions 9.2 PID_3Step 9.2.4.11 Tag Warning V2 If several warnings are pending simultaneously, their values are displayed with binary addition. The display of warning 0005h, for example, indicates that the warnings 0001h and 0004h are pending simultaneously. Warning Description (DW#16#...) 0000 No warning pending.
  • Page 341: Pid_3Step V1

    Instructions 9.2 PID_3Step 9.2.5 PID_3Step V1 9.2.5.1 Description PID_3Step V1 Description You use the PID_3Step instruction to configure a PID controller with self tuning for valves or actuators with integrating behavior. The following operating modes are possible: ● Inactive ● Pretuning ●...
  • Page 342 Instructions 9.2 PID_3Step PID algorithm PID_3Step is a PIDT1 controller with anti-windup and weighting of the proportional and derivative actions. The following equation is used to calculate the output value. Symbol Description Output value Proportional gain Laplace operator Proportional action weighting Setpoint Process value Integral action time...
  • Page 343 Instructions 9.2 PID_3Step Block diagram without position feedback PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 344 Instructions 9.2 PID_3Step Block diagram with position feedback PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 345 Instructions 9.2 PID_3Step Block diagram of PIDT1 with anti-windup Call PID_3Step is called in a constant time interval of the cycle time of the calling OB (preferably in a cyclic interrupt OB). Download to device The actual values of retentive tags are only updated when you download PID_3Step completely.
  • Page 346 Instructions 9.2 PID_3Step Reaction to error If errors occur, these are output in the Error parameter. You configure the reaction of PID_3Step using the ErrorBehaviour and ActivateRecoverMode tags. ErrorBe- Acti- Actuator setting configuration Reaction haviour vateRecover- Set Output to Mode FALSE Current output value Switch to "Inactive"...
  • Page 347: Operating Principle Pid_3Step V1

    Instructions 9.2 PID_3Step 9.2.5.2 Operating principle PID_3Step V1 Monitoring process value limits You specify the high limit and low limit of the process value in the Config.InputUpperLimit and Config.InputLowerLimit tags. If the process value is outside these limits, an error occurs (ErrorBits = 0001hex).
  • Page 348 Instructions 9.2 PID_3Step If OutputPerOn = FALSE and FeedbackOn = FALSE, you cannot limit the output value. The digital outputs are reset with Actuator_H = TRUE or Actuator_L = TRUE, or after a travel time amounting to 110% of the motor transition time. The output value is 27648 at 100% and -27648 at -100%.
  • Page 349 Instructions 9.2 PID_3Step Sampling time of the PID algorithm The controlled system needs a certain amount of time to respond to changes in the output value. It is therefore not advisable to calculate the output value in every cycle. The sampling time of the PID algorithm represents the time between two calculations of the output value.
  • Page 350: Pid_3Step V1 Input Parameters

    Instructions 9.2 PID_3Step 9.2.5.3 PID_3Step V1 input parameters Table 9- 10 PID_3Step V1 input parameters Parameters Data type Default Description Setpoint REAL Setpoint of the PID controller in automatic mode Input REAL A tag of the user program is used as source for the process value.
  • Page 351 Instructions 9.2 PID_3Step Parameters Data type Default Description Manual_UP BOOL FALSE In manual mode, every rising edge opens the valve by 5% of the total control range, or for the duration of the minimum motor transition time. Manual_UP is evaluated only if you are not using Output_PER and there is no position feedback available.
  • Page 352: Pid_3Step V1 Output Parameters

    Instructions 9.2 PID_3Step 9.2.5.4 PID_3Step V1 output parameters Table 9- 11 PID_3Step V1 output parameters Parameter Data type Default Description ScaledInput REAL Scaled process value ScaledFeedback REAL Scaled position feedback For an actuator without position feedback, the position of the actuator indicated by ScaledFeedback is very imprecise.
  • Page 353 Instructions 9.2 PID_3Step Parameter Data type Default Description State The State parameter (Page 361) shows the current operating mode of the PID controller. You change the operating mode with the Retain.Mode tag. State = 0: Inactive • State = 1: Pretuning •...
  • Page 354: Pid_3Step V1 Static Tags

    Instructions 9.2 PID_3Step 9.2.5.5 PID_3Step V1 static tags You must not change tags that are not listed. These are used for internal purposes only. Table 9- 12 PID_3Step V1 static tags Data type Default Description ActivateRecoverMode BOOL TRUE The ActivateRecoverMode tag (Page 372) determines the reaction to error.
  • Page 355 Instructions 9.2 PID_3Step Data type Default Description Config.InvertControl BOOL FALSE Invert control logic If InvertControl = TRUE, an increasing control deviation causes a reduction in the output value. Config.FeedbackOn BOOL FALSE If FeedbackOn = FALSE, a position feedback is simulated. Position feedback is generally activated when Feed- backOn = TRUE.
  • Page 356 Instructions 9.2 PID_3Step Data type Default Description Config.SetpointUpperLimit REAL +3.40282 High limit of setpoint 2e+38 If you set SetpointUpperLimit outside the process value limits, the configured absolute process value high limit is preassigned as the setpoint high limit. If you configure SetpointUpperLimit within the process value limits, this value is used as the setpoint high limit.
  • Page 357 Instructions 9.2 PID_3Step Data type Default Description Config.FeedbackScaling REAL Scaling Feedback_PER low .LowerPointIn Feedback_PER is converted to a percentage based on the two value pairs UpperPointOut, UpperPointIn and LowerPointOut, LowerPointIn of the FeedbackScaling structure. Config.FeedbackScaling REAL 100.0 High endstop .UpperPointOut Feedback_PER is converted to a percentage based on the two value pairs UpperPointOut, UpperPointIn and LowerPointOut, LowerPointIn of the FeedbackScaling structure.
  • Page 358 Instructions 9.2 PID_3Step Data type Default Description CycleTime.Value REAL PID_3Step sampling time in seconds CycleTime.Value is determined automatically and is usually equiv- alent to the cycle time of the calling OB. CtrlParamsBackUp.SetByUser BOOL FALSE Saved value of Retain.CtrlParams.SetByUser. You can reload values from the CtrlParamsBackUp structure with Config.LoadBackUp = TRUE.
  • Page 359 Instructions 9.2 PID_3Step Data type Default Description PIDSelf- BOOL FALSE The properties of the controlled system are saved during tuning. If Tune.TIR.CalculateTIR- CalculateTIRParams = TRUE, the PID parameters are recalculat- Params ed on the basis of these properties. The PID parameters are calcu- lated using the method set in TuneRuleTIR.
  • Page 360 Instructions 9.2 PID_3Step Data type Default Description Retain.CtrlParams.Td REAL Td > 0.0: Active derivative action time • Td = 0.0: Derivative action is deactivated • Td is retentive. Retain.CtrlParams.TdFiltRatio REAL Active derivative delay coefficient TdFiltRatio is retentive. Retain.CtrlParams.PWeighting REAL Active proportional action weighting PWeighting is retentive.
  • Page 361: Parameter State And Retain.mode V1

    Instructions 9.2 PID_3Step 9.2.5.6 Parameter State and Retain.Mode V1 Correlation of the parameters The State parameter shows the current operating mode of the PID controller. You cannot change the State parameter. To switch from one operating mode to another, you must change the Retain.Mode tag. This also applies when the value for the new operating mode is already in Retain.Mode.
  • Page 362 Instructions 9.2 PID_3Step Meaning of values State / Re- Description tain.Mode Inactive The controller is switched off and no longer changes the valve position. Pretuning The pretuning determines the process response to a pulse of the output value and searches for the point of inflection.
  • Page 363 Instructions 9.2 PID_3Step State / Re- Description tain.Mode Fine tuning Fine tuning generates a constant, limited oscillation of the process value. The PID parameters are tuned based on the amplitude and frequency of this oscillation. The differences between the process response during pretuning and fine tuning are analyzed.
  • Page 364 Instructions 9.2 PID_3Step State / Re- Description tain.Mode Manual mode In manual mode, you specify manual output values in the Manual_UP and Manual_DN parameters or Man- ualValue parameter. Whether or not the actuator can be moved to the output value in the event of an error is described in the ErrorBits parameter.
  • Page 365 Instructions 9.2 PID_3Step State / Re- Description tain.Mode Error monitoring The control algorithm is switched off and no longer changes the valve position. This operating mode is activated instead of "Inactive" mode in the event of an error. All the following conditions must be met: Mode = 3 (automatic mode) •...
  • Page 366 Instructions 9.2 PID_3Step Automatic switchover of operating mode during commissioning PID_3Step automatically switches the operating mode in the event of an error. The following diagram illustrates the influence of ErrorBehaviour on the switchover of operating mode from transition time measurement, pretuning, and fine tuning modes. Automatic switchover of operating mode in the event of an error Automatic switchover of operating mode once the current operation has been completed.
  • Page 367 Instructions 9.2 PID_3Step Automatic switchover of operating mode in automatic mode (PID_3Step V1.1) PID_3Step automatically switches the operating mode in the event of an error. The following diagram illustrates the influence of ErrorBehaviour and ActivateRecoverMode on this switchover of operating mode. Automatic switchover of operating mode in the event of an error Automatic switchover of operating mode once the current operation has been completed.
  • Page 368 Instructions 9.2 PID_3Step Automatic switchover of operating mode in automatic and manual modes (PID_3Step V1.0) PID_3Step automatically switches the operating mode in the event of an error. The following diagram illustrates the influence of ErrorBehaviour and ActivateRecoverMode on this switchover of operating mode. Automatic switchover of operating mode in the event of an error Automatic switchover of operating mode once the current operation has been completed.
  • Page 369: Parameter Errorbits V1

    Instructions 9.2 PID_3Step 9.2.5.7 Parameter ErrorBits V1 If several errors are pending simultaneously, the values of the error codes are displayed with binary addition. The display of error code 0003, for example, indicates that the errors 0001 and 0002 are pending simultaneously. ErrorBits Description 
...
  • Page 370 Instructions 9.2 PID_3Step ErrorBits Description 
 ( DW#16#...) 2000 Invalid value at Feedback_PER parameter. Check whether an error is pending at the analog input. The actuator cannot be moved to the substitute output value and remains in its current position. Manual mode is not possible in this state.
  • Page 371: Parameter Reset V1

    Instructions 9.2 PID_3Step 9.2.5.8 Parameter Reset V1 A rising edge at Reset triggers a change to "Inactive" mode, and errors and warnings are reset. A falling edge at Reset triggers a change to the most recently active operating mode. If automatic mode was active before, switchover to automatic mode is bumpless.
  • Page 372: Tag Activaterecovermode V1

    Instructions 9.2 PID_3Step 9.2.5.9 Tag ActivateRecoverMode V1 The effect of the ActivateRecoverMode variable depends on the version of the PID_3Step. Behavior in version 1.1 The ActivateRecoverMode variable determines the behavior in the event of an error in automatic mode. ActivateRecoverMode is not effective during pretuning, fine tuning and transition time measurement.
  • Page 373 Instructions 9.2 PID_3Step Behavior in version 1.0 The ActivateRecoverMode variable determines the behavior in the event of an error in automatic and manual mode. ActivateRecoverMode is not effective during pretuning, fine tuning and transition time measurement. ActivateRecov- Description erMode FALSE In the event of an error, PID_3Step switches to "Inactive"...
  • Page 374: Tag Warning V1

    Instructions 9.2 PID_3Step 9.2.5.10 Tag Warning V1 If several warnings are pending simultaneously, their values are displayed with binary addition. The display of warning 0003, for example, indicates that the warnings 0001 and 0002 are pending simultaneously. Warning Description (DW#16#...) 0000 No warning pending.
  • Page 375: Tag Sut.state V1

    Instructions 9.3 PID_Temp 9.2.5.11 Tag SUT.State V1 SUT.State Name Description 0 SUT_INIT Initialize pretuning 50 SUT_TPDN Determine start position without position feedback 100 SUT_STDABW Calculate the standard deviation 200 SUT_GET_POI Find the point of inflection 300 SUT_GET_RISETM Determine the rise time 9900 SUT_IO Pretuning successful 1 SUT_NIO...
  • Page 376: Pid_Temp

    Instructions 9.3 PID_Temp PID_Temp 9.3.1 New features of PID_Temp PID_Temp V1.1 ● Response of the output value on switchover from "Inactive" operating mode to "Automatic mode" The new option IntegralResetMode = 4 was added and defined as default. With IntegralResetMode = 4, the integral action is automatically pre-assigned when switching from "Inactive"...
  • Page 377: Cpu Processing Time And Memory Requirement Pid_Temp V1

    Instructions 9.3 PID_Temp 9.3.3 CPU processing time and memory requirement PID_Temp V1 CPU processing time Typical CPU processing times of the PID_Temp technology object as of Version 1.0, depending on CPU type. Typ. CPU processing time PID_Temp V1 CPU 1211C ≥ V4.1 580 µs CPU 1215C ≥...
  • Page 378: Pid_Temp

    Instructions 9.3 PID_Temp 9.3.4 PID_Temp 9.3.4.1 Description of PID_Temp Description The PID_Temp instruction provides a PID controller with integrated tuning for temperature processes. PID_Temp can be used for pure heating or heating/cooling applications. The following operating modes are possible: ● Inactive ●...
  • Page 379 Instructions 9.3 PID_Temp Icon Description Associated parameters of the PID_Temp instruction Derivative action time Retain.CtrlParams.Heat.Td Retain.CtrlParams.Cool.Td Derivative delay coefficient (derivative Retain.CtrlParams.Heat.TdFiltRatio delay T1 = a × T Retain.CtrlParams.Cool.TdFiltRatio Derivative action weighting Retain.CtrlParams.Heat.DWeighting Retain.CtrlParams.Cool.DWeighting DeadZone Dead zone width Retain.CtrlParams.Heat.DeadZone Retain.CtrlParams.Cool.DeadZone ControlZone Control zone width Retain.CtrlParams.Heat.ControlZone Retain.CtrlParams.Cool.ControlZone...
  • Page 380 Instructions 9.3 PID_Temp PID_Temp block diagram PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 381 Instructions 9.3 PID_Temp Block diagram of PIDT1 with anti-windup Call PID_Temp is called in the constant time scale of a cyclic interrupt OB. If you call PID_Temp as a multi-instance DB, no technology object is created. No parameter assignment interface or commissioning interface is available. You must assign parameters for PID_Temp directly in the multi-instance DB and commission it via a watch table.
  • Page 382 Instructions 9.3 PID_Temp Reaction to error The behavior in the case of an error is determined by the tags SetSubstituteOutput and ActivateRecoverMode. If ActivateRecoverMode = TRUE, the behavior also depends on the error that occurred. SetSubstitute- Acti- Configuration editor Reaction Output vateRecov- >...
  • Page 383: Mode Of Operation Of Pid_Temp

    Instructions 9.3 PID_Temp 9.3.4.2 Mode of operation of PID_Temp Monitoring process value limits You specify the high limit and low limit of the process value in the Config.InputUpperLimit and Config.InputLowerLimit tags. If the process value is outside these limits, an error occurs (ErrorBits = 0000001h).
  • Page 384 Instructions 9.3 PID_Temp Two methods are available to calculate the PID output value with activated cooling: ● Cooling factor (Config.AdvancedCooling = FALSE): The output value calculation for cooling takes place with the PID parameters for heating, taking into consideration the configurable cooling factor Config.CoolFactor. This method is suitable if the heating and cooling actuators have a similar time response but different gains.
  • Page 385 Instructions 9.3 PID_Temp Output Value pair Parameter OutputHeat_PWM Value pair 1 PID output value high limit (heating) Config.Output.Heat.PidUpperLimit, Scaled high PWM output value (heating) Config.Output.Heat.PwmUpperScaling Value pair 2 PID output value low limit (heating) Config.Output.Heat.PidLowerLimit, Scaled low PWM output value (heating) Config.Output.Heat.PwmLowerScaling OutputHeat_PER Value pair 1...
  • Page 386 Instructions 9.3 PID_Temp Example: Output scaling when using output OutputHeat (cooling deactivated; Config.Output.Heat.PidLowerLimit may be unequal to 0.0): Example: Output scaling when using output OutputHeat_PWM and OutputCool_PER (cooling activated; Config.Output.Heat.PidLowerLimit must be 0.0): With the exception of the "Inactive" operating mode, the value at an output is always located between its scaled high output value and scaled low output value, for example, for OutputHeat always between Config.Output.Heat.UpperScaling and Config.Output.Heat.LowerScaling.
  • Page 387 Instructions 9.3 PID_Temp Monitoring signal validity The values of the following parameters are monitored for validity when used: ● Setpoint ● SubstituteSetpoint ● Input ● Input_PER ● Disturbance ● ManualValue ● SubstituteOutput ● PID parameters in the structures Retain.CtrlParams.Heat and Retain.CtrlParams.Cool. Monitoring the sampling time PID_Temp Ideally, the sampling time is equivalent to the cycle time of the cyclic interrupt OB.
  • Page 388 Instructions 9.3 PID_Temp Sampling time of the PID algorithm The controlled system needs a certain amount of time to respond to changes in the output value. It is therefore not advisable to calculate the output value in every cycle. The sampling time of the PID algorithm represents the time between two calculations of the output value.
  • Page 389: Input Parameters Of Pid_Temp

    Instructions 9.3 PID_Temp 9.3.4.3 Input parameters of PID_Temp Parameter Data type Default Description Setpoint REAL Setpoint of the PID controller in automatic mode Valid range of values: Config.SetpointUpperLimit ≥ Setpoint ≥ Config.SetpointLowerLimit Config.InputUpperLimit ≥ Setpoint ≥ Config.InputLowerLimit Input REAL A tag of the user program is used as source for the process value. If you are using the Input parameter, Config.InputPerOn = FALSE must be set.
  • Page 390 Instructions 9.3 PID_Temp Parameter Data type Default Description Reset BOOL FALSE Restarts the controller. FALSE -> TRUE edge • – Switch to "Inactive" mode – ErrorBits and Warning are reset. As long as Reset = TRUE, • – PID_Temp remains in "Inactive" mode (State = 0). –...
  • Page 391: Output Parameters Of Pid_Temp

    Instructions 9.3 PID_Temp 9.3.4.4 Output parameters of PID_Temp Parameter Data type Default Description ScaledInput REAL Scaled process value OutputHeat REAL Output value (heating) in REAL format The PID output value (PidOutputSum) is scaled with the two value pairs Config.Output.Heat.PidUpperLimit, Config.Output.Heat.UpperScaling and Config.Output.Heat.PidLowerLimit, Config.Output.Heat.LowerScaling and output in REAL format at OutputHeat.
  • Page 392 Instructions 9.3 PID_Temp Parameter Data type Default Description SetpointLimit_L BOOL FALSE If SetpointLimit_L = TRUE, the absolute setpoint low limit is reached (Set- point ≤ Config.SetpointLowerLimit) or Setpoint ≤ Config.InputLowerLimit. The setpoint low limit is the maximum of Config.SetpointLowerLimit and Con- fig.InputLowerLimit.
  • Page 393: In/Out Parameters Of Pid_Temp V2

    Instructions 9.3 PID_Temp 9.3.4.5 In/out parameters of PID_Temp V2 Parameter Data type Default Description Mode At Mode, specify the operating mode to which PID_Temp is to switch. Options are: Mode = 0: Inactive • Mode = 1: Pretuning • Mode = 2: Fine tuning •...
  • Page 394 Instructions 9.3 PID_Temp See also PID_Temp state and mode parameters (Page 430) Program creation (Page 193) Cascade control with PID_Temp (Page 191) PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 395: Pid_Temp Static Tags

    Instructions 9.3 PID_Temp 9.3.4.6 PID_Temp static tags You must not change tags that are not listed. These are used for internal purposes only. Data type Default Description IntegralResetMode V1.0: 1, The IntegralResetMode tag (Page 447) determines how the integral action PIDCtrl.IOutputOld is pre-assigned V1.1 or higher: when switching from "Inactive"...
  • Page 396 Instructions 9.3 PID_Temp Data type Default Description SetSubstituteOutput BOOL TRUE Selection of the output value while an error is pending (State = 5): If SetSubstituteOutput = TRUE and ActivateRecover- • Mode = TRUE, the configured substitute output value SubstituteOutput is output as PID output value as long as an error is pending.
  • Page 397 Instructions 9.3 PID_Temp Data type Default Description SubstituteOutput REAL The substitute output value is used as PID output value as long as the following conditions are met: One or more errors are pending in automatic mode for • which ActivateRecoverMode is in effect SetSubstituteOutput = TRUE •...
  • Page 398 Instructions 9.3 PID_Temp Data type Default Description PidOutputOffsetHeat REAL Offset of the PID output value heating PidOutputOffsetHeat is added to the value that results from PidOutputSum for the heating branch. Enter a posi- tive value for PidOutputOffsetHeat to receive a positive offset at the outputs for heating.
  • Page 399 Instructions 9.3 PID_Temp Data type Default Description AllSlaveAutomaticState BOOL FALSE If this PID_Temp instance is used as master controller in a cascade (Config.Cascade.IsMaster = TRUE), All- SlaveAutomaticState = TRUE indicates that all slave con- trollers are in automatic mode. Tuning, manual mode or automatic mode of the master controller can only be executed accurately if all slave con- trollers are in automatic mode.
  • Page 400 Instructions 9.3 PID_Temp Data type Default Description Config.InputUpperLimit REAL 120.0 High limit of the process value Input and Input_PER are monitored to ensure adherence to this limit. If the limit is exceeded, an error is output and the reaction is determined by ActivateRecoverMode. At the I/O input, the process value can be a maximum of 18% higher than the nominal range (overrange).
  • Page 401 Instructions 9.3 PID_Temp Data type Default Description Config.SetpointUpperLimit REAL 3.402822e+38 High limit of setpoint Setpoint and SubstituteSetpoint are monitored to ensure adherence to this limit. If the limit is exceeded, a warning is output at the Warning parameter. If you configure SetpointUpperLimit outside the pro- •...
  • Page 402 Instructions 9.3 PID_Temp Data type Default Description Config.AdvancedCooling BOOL TRUE Method for heating/cooling Cooling factor (Config.AdvancedCooling = FALSE) • The output value calculation for cooling takes place with the PID parameters for heating (Re- tain.CtrlParams.Heat structure) taking into considera- tion the configurable cooling factor Config.CoolFactor. This method is suitable if the heating and cooling actu- ators have a similar time response but different gains.
  • Page 403 Instructions 9.3 PID_Temp Data type Default Description Config.InputScaling.Lower- REAL Scaling Input_PER low PointIn Input_PER is scaled based on the two value pairs Upper- PointOut, UpperPointIn and LowerPointOut, LowerPointIn. Only effective if Input_PER is used for process value de- tection (Config.InputPerOn = TRUE). LowerPointIn <...
  • Page 404 Instructions 9.3 PID_Temp Data type Default Description Config.Output.Heat.Pwm- REAL Period duration of the pulse width modulation (PWM) for Periode heating (OutputHeat_PWM output) in seconds: Heat.PwmPeriode = 0.0 • The sampling time of the PID algorithm for heating (Retain.CtrlParams.Heat.Cycle) is used as period du- ration of the PWM.
  • Page 405 Instructions 9.3 PID_Temp Data type Default Description Config.Output.Heat.PidLower- REAL Low limit of the PID output value for heating Limit For controllers with deactivated cooling output (Con- fig.ActivateCooling = FALSE), the PID output value (Pid- OutputSum) is limited to this low limit. For controllers with activated cooling output (Config .ActivateCooling = TRUE), the value must be 0.0.
  • Page 406 Instructions 9.3 PID_Temp Data type Default Description Config.Output.Heat.PwmUpper- REAL 100.0 Scaled high PWM output value for heating Scaling Heat.PwmUpperScaling and Heat.PidUpperLimit form a value pair for scaling of the PID output value (PidOut- putSum) to the pulse-width modulated output value for heating (OutputHeat_PWM).
  • Page 407 Instructions 9.3 PID_Temp Data type Default Description Config.Output.Heat.Minimum- REAL Minimum on time of the pulse width modulation for heating OnTime (OutputHeat_PWM output) A PWM pulse is never shorter than this value. The value is rounded off to: Heat.MinimumOnTime = n × CycleTime.Value Heat.MinimumOnTime is only effective if the output for heating OutputHeat_PWM is selected (Heat.Select = 1)".
  • Page 408 Instructions 9.3 PID_Temp Data type Default Description Config.Output.Cool.Pwm- REAL Period duration of the pulse width modulation for cooling Periode (OutputCool_PWM output) in seconds: Cool.PwmPeriode = 0.0 and Config.AdvancedCooling • = FALSE: sampling time of the PID algorithm for heating (Retain.CtrlParams.Heat.Cycle) is used as period du- ration of the PWM.
  • Page 409 Instructions 9.3 PID_Temp Data type Default Description Config.Output.Cool.PidLower- REAL -100.0 Low limit of the PID output value for cooling Limit For controllers with activated cooling output (Con- fig.ActivateCooling = TRUE), the PID output value (Pi- dOutputSum) is limited to this low limit. Cool.PidLowerLimit forms a value pair together with the following parameters for scaling of the PID output value (PidOutputSum) to the outputs for cooling:...
  • Page 410 Instructions 9.3 PID_Temp Data type Default Description Config.Output.Cool.PwmLower- REAL Scaled low PWM output value for cooling Scaling Cool.PwmLowerScaling and Cool.PidUpperLimit form a value pair for scaling of the PID output value (PidOut- putSum) to the pulse-width modulated output value for cooling (OutputCool_PWM).
  • Page 411 Instructions 9.3 PID_Temp Data type Default Description Config.Output.Cool.Minimum- REAL Minimum off time of the pulse width modulation for cooling OffTime (OutputCool_PWM output) A PWM pause is never shorter than this value. The value is rounded off to: Cool.MinimumOffTime = n × CycleTime.Value Cool.MinimumOffTime is only effective if the output for cooling OutputCool_PWM is selected (Cool.Select = 1).
  • Page 412 Instructions 9.3 PID_Temp Data type Default Description Config.Cascade.CountSlaves Number of subordinate slaves Here you enter the number of directly subordinate slave controllers which receive their setpoint from this master controller. Only effective if the controller is configured as master controller (Config.Cascade.IsMaster = TRUE). 255 ≥...
  • Page 413 Instructions 9.3 PID_Temp Data type Default Description CtrlParamsBackUp REAL Saved derivative delay coefficient for cooling .Cool.TdFiltRatio CtrlParamsBackUp REAL Saved proportional action weighting factor for cooling .Cool.PWeighting CtrlParamsBackUp REAL Saved derivative action weighting factor for cooling .Cool.DWeighting CtrlParamsBackUp.Cool.Cycle REAL Saved sampling time of the PID algorithm for cooling in seconds CtrlParamsBackUp REAL...
  • Page 414 Instructions 9.3 PID_Temp Data type Default Description PIDSelfTune.SUT.TuneRule- Method for PID parameter calculation with pretuning for Heat heating Options are: SUT.TuneRuleHeat = 0: PID according to CHR • SUT.TuneRuleHeat = 1: PI according to CHR • SUT.TuneRuleHeat = 2: PID for temperature process- •...
  • Page 415 Instructions 9.3 PID_Temp Data type Default Description PIDSelfTune.SUT.State The SUT.State tag indicates the current phase of pretun- ing: State = 0: Initialize pretuning • State = 100: Calculate standard deviation for heating • State = 200: Calculate standard deviation for cooling •...
  • Page 416 Instructions 9.3 PID_Temp Data type Default Description PIDSelfTune.SUT.AdaptDelay- The AdaptDelayTime tag determines the adaptation of the Time delay time for heating at the operating point (for "Pretuning heating" and "Pretuning heating and cooling"). Options are: SUT.AdaptDelayTime = 0: • No adaptation of delay time. The SUT.State = 1000 phase is skipped.
  • Page 417 Instructions 9.3 PID_Temp Data type Default Description PIDSelfTune.SUT.CoolingMode INT The CoolingMode tag determines the manipulated variable output to determine the cooling parameters (for pretuning heating and cooling). Options are: SUT.CoolingMode = 0: • Switch off heating and switch on cooling after reaching the setpoint.
  • Page 418 Instructions 9.3 PID_Temp Data type Default Description PIDSelfTune.TIR.RunIn BOOL FALSE Use the RunIn tag to specify the sequence of fine tuning during start from automatic mode. RunIn = FALSE • If fine tuning is started from automatic mode, the sys- tem uses the existing PID parameters to control to the setpoint (TIR.State = 500 or 600).
  • Page 419 Instructions 9.3 PID_Temp Data type Default Description PIDSelfTune.TIR.TuneRule- Method for parameter calculation during fine tuning for Heat heating Options are: TIR.TuneRuleHeat = 0: PID automatic • TIR.TuneRuleHeat = 1: PID fast (faster control re- • sponse with higher amplitudes of the output value than with TIR.TuneRuleHeat = 2) TIR.TuneRuleHeat = 2: PID slow (slower control re- •...
  • Page 420 Instructions 9.3 PID_Temp Data type Default Description PIDSelfTune.TIR.TuneRule- Method for parameter calculation during fine tuning for Cool cooling Options are: TIR.TuneRuleCool = 0: PID automatic • TIR.TuneRuleCool = 1: PID fast (faster control re- • sponse with higher amplitudes of the output value than with TIR.TuneRuleCool = 2) TIR.TuneRuleCool = 2: PID slow (slower control re- •...
  • Page 421 Instructions 9.3 PID_Temp Data type Default Description PIDSelfTune.TIR.State The TIR.State tag indicates the current phase of "fine tuning": State = 0: Initialize fine tuning • State = 100: Calculate standard deviation for heating • State = 200: Calculate standard deviation for cooling •...
  • Page 422 Instructions 9.3 PID_Temp Data type Default Description PIDSelfTune.TIR.Output- REAL Tuning offset heating of the PID output value OffsetHeat TIR.OutputOffsetHeat is added to the value that results from PidOutputSum for the heating branch. To receive a positive offset at the outputs for heating, define a positive value for TIR.OutputOffsetHeat.
  • Page 423 Instructions 9.3 PID_Temp Data type Default Description PIDSelfTune.TIR.Output- REAL Tuning offset cooling of the PID output value OffsetCool TIR.OutputOffsetCool is added to the value that results from PidOutputSum for the cooling branch. To receive a positive offset at the outputs for cooling, define a negative value for TIR.OutputOffsetCool.
  • Page 424 Instructions 9.3 PID_Temp Data type Default Description PIDCtrl.PIDInit BOOL FALSE PIDCtrl.PIDInit is available as of PID_Temp version 1.1. If PIDCtrl.PIDInit = TRUE in "Automatic mode", the integral action PIDCtrl.IOutputOld is pre-assigned automatically as if PidOutputSum = OverwriteInitialOutputValue in the pre- vious cycle.
  • Page 425 Instructions 9.3 PID_Temp Data type Default Description Retain.CtrlParams.Heat REAL Active weighting of the proportional action for heating .PWeighting The proportional action may weaken with changes to the setpoint. Values from 0.0 to 1.0 are applicable. 1.0: Proportional action for setpoint change is fully •...
  • Page 426 Instructions 9.3 PID_Temp Data type Default Description Retain.CtrlParams.Heat REAL 3.402822e+38 Active control zone width for heating .ControlZone The control zone for heating is switched off with Heat.ControlZone = 3.402822e+38. Heat.ControlZone is only set automatically during pretun- ing heating or pretuning heating and cooling if PIDSelf- Tune.SUT.TuneRuleHeat = 2 is selected as method of the parameter calculation.
  • Page 427 Instructions 9.3 PID_Temp Data type Default Description Retain.CtrlParams.Cool.Ti REAL 20.0 Active integral action time for cooling in seconds The integral action for cooling is switched off with Cool.CtrlParams.Ti = 0.0. Cool.Ti is retentive. Only effective if the cooling output and PID parameter switching are activated (Config.ActivateCooling = TRUE and Config.AdvancedCooling = TRUE).
  • Page 428 Instructions 9.3 PID_Temp Data type Default Description Retain.CtrlParams.Cool REAL Active weighting of the derivative action for cooling .DWeighting The derivative action may weaken with changes to the setpoint. Values from 0.0 to 1.0 are applicable. 1.0: Derivative action is fully effective upon setpoint •...
  • Page 429 Instructions 9.3 PID_Temp Data type Default Description Retain.CtrlParams.Cool REAL 3.402822e+38 Active control zone width for cooling .ControlZone The control zone for cooling is switched off with Cool.ControlZone = 3.402822e+38. Cool.ControlZone is only set automatically during pretun- ing cooling or pretuning heating and cooling if PIDSelf- Tune.SUT.TuneRuleCool = 2 is selected as method of the parameter calculation.
  • Page 430: Pid_Temp State And Mode Parameters

    Instructions 9.3 PID_Temp 9.3.4.7 PID_Temp state and mode parameters Correlation of the parameters The State parameter shows the current operating mode of the PID controller. You cannot change the State parameter. With a rising edge at ModeActivate, PID_Temp switches to the operating mode saved in the Mode in-out parameter.
  • Page 431 Instructions 9.3 PID_Temp State / Mode Description of operating mode Pretuning The pretuning determines the process response to a jump change of the output value and searches for the point of inflection. The PID parameters are calculated from the maximum rate of rise and dead time of the controlled system.
  • Page 432 Instructions 9.3 PID_Temp State / Mode Description of operating mode Requirements for pretuning heating: Heat.EnableTuning = TRUE • Cool.EnableTuning = FALSE • The process value must not be too close to the setpoint. • |Setpoint - Input| > 0.3 * |Config.InputUpperLimit - Config.InputLowerLimit| and |Setpoint - Input| >...
  • Page 433 Instructions 9.3 PID_Temp State / Mode Description of operating mode The more stable the process value is, the easier it is to calculate the PID parameters and the more precise the result will be. Noise on the process value can be tolerated as long as the rate of rise of the process value is significantly higher compared to the noise.
  • Page 434 Instructions 9.3 PID_Temp State / Mode Description of operating mode Fine tuning Fine tuning generates a constant, limited oscillation of the process value. The PID parameters are tuned for the operating point from the amplitude and frequency of this oscillation. PID parameters from fine tuning usually have better master control and disturbance characteristics than PID parameters from pretuning.
  • Page 435 Instructions 9.3 PID_Temp State / Mode Description of operating mode Example for definition of an offset for fine tuning cooling: Without offset: • – Setpoint = Process value (ScaledInput) = 80°C – PID output value (PidOutputSum) = 30.0 – Output value heating (OutputHeat) = 30.0 –...
  • Page 436 Instructions 9.3 PID_Temp State / Mode Description of operating mode Requirements for fine tuning cooling: Heat.EnableTuning = FALSE • Cool.EnableTuning = TRUE • The cooling output is activated (Config.ActivateCooling = TRUE). • The PID parameter switching is activated (Config.AdvancedCooling = TRUE) •...
  • Page 437 Instructions 9.3 PID_Temp State / Mode Description of operating mode Manual mode In manual mode, you specify a manual PID output value in the ManualValue parameter. The values at the outputs for heating and cooling resulting from this manual value are the result of the configured output scal- ing.
  • Page 438 Instructions 9.3 PID_Temp The following table shows how Mode and State change during pretuning with errors. Cycle no. Mode State Action Set Mode = 1 Set ModeActivate = TRUE Value of State is saved in Mode parameter Pretuning is started Pretuning canceled Manual mode is started If ActivateRecoverMode = TRUE, the operating mode that is saved in the Mode parameter is...
  • Page 439: Pid_Temp Errorbits Parameter

    Instructions 9.3 PID_Temp 9.3.4.8 PID_Temp ErrorBits parameter If several errors are pending simultaneously, the values of the ErrorBits are displayed with binary addition. The display of ErrorBits = 0000003h, for example, indicates that the errors 0000001h and 0000002h are pending simultaneously. ErrorBits Description 
...
  • Page 440 Instructions 9.3 PID_Temp ErrorBits Description 
 ( DW#16#...) 0000100 Error during fine tuning resulted in invalid parameters. If ActivateRecoverMode = TRUE before the error occurred, PID_Temp cancels the tuning and switches to the operating mode that is saved in the Mode parameter. 0000200 Invalid value at "Input"...
  • Page 441 Instructions 9.3 PID_Temp ErrorBits Description 
 ( DW#16#...) 0040000 Invalid value at Disturbance parameter. Value has an invalid number format. If automatic mode was active and ActivateRecoverMode = TRUE before the error occurred, Disturbance is set to zero. PID_Temp remains in automatic mode. If pretuning or fine tuning mode was active before the error occurred and ActivateRecoverMode = TRUE, PID_Temp switches to the operating mode that is saved in the Mode parameter.
  • Page 442: Pid_Temp Activaterecovermode Tag

    Instructions 9.3 PID_Temp 9.3.4.9 PID_Temp ActivateRecoverMode tag The ActivateRecoverMode tag determines the reaction to error. The Error parameter indicates if an error is pending. When the error is no longer pending, Error = FALSE. The ErrorBits parameter shows which errors have occurred. Automatic mode and manual mode NOTICE Your system may be damaged.
  • Page 443 Instructions 9.3 PID_Temp ActivateRecov- Description erMode TRUE Manual mode If one or several errors occur and manual mode was active before the error occurred, PID_Temp re- mains in manual mode. If the following error occurs in manual mode, as long as this error is pending, PID_Temp sets the PID output value to SubstituteOutput: 0010000h: Invalid value at ManualValue parameter.
  • Page 444: Pid_Temp Warning Tag

    Instructions 9.3 PID_Temp 9.3.4.10 PID_Temp Warning tag If several warnings are pending simultaneously, the values of the Warning tag are displayed with binary addition. If the warning 0000003h is displayed, for example, the warnings 0000001h and 0000002h are pending simultaneously. Warning Description (DW#16#..)
  • Page 445: Pwmperiode Tag

    Instructions 9.3 PID_Temp 9.3.4.11 PwmPeriode tag If the PID algorithm sampling time (Retain.CtrlParams.Heat.Cycle or Retain.CtrlParams.Heat.Cycle) and thus the time period of the pulse width modulation is very high when you use OutputHeat_PWM or OutputCool_PWM, you can define a deviating shorter time period at the Config.Output.Heat.PwmPeriode or Config.Output.Cool.PwmPeriode parameters to improve the smoothness of the process value.
  • Page 446 Instructions 9.3 PID_Temp Config.Output.Cool.PwmPeriode is only effective if the cooling output is activated (Config.ActivateCooling =TRUE). When you use PwmPeriode, the accuracy of the PWM output signal is determined by the relationship of PwmPeriode to the PID_Temp sampling time (cycle time of the OB). PwmPeriode should be at least 10 times the PID_Temp sampling time.
  • Page 447: Integralresetmode Tag

    Instructions 9.3 PID_Temp 9.3.4.12 IntegralResetMode tag The IntegralResetMode tag determines how the integral action PIDCtrl.IOutputOld is pre- assigned: ● When switching from "Inactive" operating mode to "Automatic mode" ● With edge TRUE -> FALSE at parameter Reset and parameter Mode = 3 This setting only works for one cycle and is only effective if the integral action is activated (Retain.CtrlParams.Heat.Ti and Retain.CtrlParams.Cool.Ti >...
  • Page 448 Instructions 9.3 PID_Temp IntegralReset- Description Mode Pre-assign The value of PIDCtrl.IOutputOld is automatically pre-assigned as if PidOutputSum = OverwriteI- nitialOutputValue in the last cycle. Like setpoint change (only for PID_Temp with version ≥ 1.1) The value of PIDCtrl.IOutputOld is automatically pre-assigned so that a similar PID output value jump results as for a PI controller in automatic mode in case of a setpoint change from the current process value to the current setpoint.
  • Page 449: Pid Basic Functions

    Instructions 9.4 PID basic functions PID basic functions 9.4.1 CONT_C 9.4.1.1 Description CONT_C The CONT_C instruction is used on SIMATIC S7 automation systems to control technical processes with continuous input and output variables. You can assign parameters to enable or disable sub-functions of the PID controller and adapt it to the process. In addition to the functions in the setpoint and process value branches, the instruction implements a complete PID controller with continuous output value output and the option of manually influencing the value of the output value.
  • Page 450: How Cont_C Works

    Instructions 9.4 PID basic functions 9.4.1.2 How CONT_C works Setpoint branch The setpoint is entered in floating-point format at the SP_INT input. Process value branch The process value can be input in I/O or floating-point format. The function CRP_IN converts the I/O value PV_PER to a floating-point format -100 to +100 % in accordance with the following rule: Output of CRP_IN = PV_PER * 100 / 27648...
  • Page 451 Instructions 9.4 PID basic functions Manipulated value processing You can use the LMNLIMIT function to limit the manipulated value to selected values. Alarm bits indicate when a limit is exceeded by the input variable. The LMN_NORM function normalizes the output of LMNLIMIT according to the following rule: LMN = (output of LMNLIMIT) * LMN_FAC + LMN_OFF LMN_FAC has a default of 1 and LMN_OFF a default of 0.
  • Page 452: Cont_C Block Diagram

    Instructions 9.4 PID basic functions 9.4.1.3 CONT_C block diagram PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 453: Input Parameter Cont_C

    Instructions 9.4 PID basic functions 9.4.1.4 Input parameter CONT_C Table 9- 13 Input parameter CONT_C Parameters Data Default Description type COM_RST BOOL FALSE 
 T he instruction has an initialization routine that is 
 p rocessed when the "Restart" input is set. MAN_ON BOOL TRUE...
  • Page 454: Output Parameters Cont_C

    Instructions 9.4 PID basic functions Parameters Data Default Description type LMN_HLM REAL 100.0 The manipulated value is always restricted to a high limit and low limit. The "High limit of manipulated value" input specifies the high limit. Permissible are real values starting at LMN_LLM or a physical variable 2). LMN_LLM REAL The manipulated value is always restricted to a high limit and low limit.
  • Page 455: Cont_S

    Instructions 9.4 PID basic functions 9.4.2 CONT_S 9.4.2.1 Description CONT_S The CONT_S instruction is used on SIMATIC S7 automation systems to control technical processes with binary output value output signals for actuators with integrating behavior. During parameter assignment, you can activate or deactivate sub-functions of the PI step controller to adapt the controller to the controlled system.
  • Page 456: Mode Of Operation Cont_S

    Instructions 9.4 PID basic functions 9.4.2.2 Mode of operation CONT_S Setpoint branch The setpoint is entered in floating-point format at the SP_INT input. Process value branch The process value can be input in I/O or floating-point format. The function CRP_IN converts the I/O value PV_PER to a floating-point format -100 to +100 % in accordance with the following rule: Output of CRP_IN = PV_PER * 100 / 27648...
  • Page 457: Block Diagram Cont_S

    Instructions 9.4 PID basic functions 9.4.2.3 Block diagram CONT_S PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 458: Input Parameters Cont_S

    Instructions 9.4 PID basic functions 9.4.2.4 Input parameters CONT_S Table 9- 15 Input parameters CONT_S Parameters Data Default Description type COM_RST BOOL FALSE 
 T he block has an initialization routine that is 
 p rocessed when the "Restart" input is set.
  • Page 459: Output Parameters Cont_S

    Instructions 9.4 PID basic functions Parameters Data Default Description type MTR_TM TIME T#30s 
 T he time required by the actuator to move from 
 l imit stop to limit stop is entered at the "Motor 
 a ctuating time" parameter. MTR_TM >= CYCLE DISV REAL...
  • Page 460: Pulsegen

    Instructions 9.4 PID basic functions 9.4.3 PULSEGEN 9.4.3.1 Description PULSEGEN The instruction PULSEGEN serves as the structure of a PID controller with impulse output for proportional actuators. PULSEGEN transforms the input value INV (= LMN of the PID controller) through modulation of the impulse width in an impulse sequence with a constant period duration, which corresponds with the cycle time with which the input value is updated.
  • Page 461: Mode Of Operation Pulsegen

    Instructions 9.4 PID basic functions 9.4.3.2 Mode of operation PULSEGEN Impulse width modulation The duration of a pulse per period duration is proportional to the input variable. The cycle assigned via PER_TM is not identical to the processing cycle of the PULSEGEN instruction. Rather, a PER_TM cycle is made up of several processing cycles of the PULSEGEN instruction, whereby the number of PULSEGEN calls per PER_TM cycle determines the accuracy of the pulse width.
  • Page 462 Instructions 9.4 PID basic functions Block diagram Accuracy of the manipulated value With a "Sampling ratio" of 1:10 (CONT_C calls to PULSEGEN calls) the accuracy of the manipulated value in this example is restricted to 10%, in other words, set input values INV can only be simulated by a pulse duration at the QPOS_P output in steps of 10 %.
  • Page 463 Instructions 9.4 PID basic functions Automatic synchronization It is possible to automatically synchronize the pulse output with the instruction that updates the input variable INV (e.g. CONT_C). This ensures that a change in the input variable is output as quickly as possible as a pulse. The pulse shaper evaluates the input value INV at intervals corresponding to the period duration PER_TM and converts the value into a pulse signal of corresponding length.
  • Page 464: Mode Of Operation Pulsegen

    Instructions 9.4 PID basic functions 9.4.3.3 Mode of operation PULSEGEN Modes Depending on the parameters assigned to the pulse shaper, PID controllers with a three-step output or with a bipolar or unipolar two-step output can be configured. The following table illustrates the setting of the switch combinations for the possible modes.
  • Page 465: Three-Step Control

    Instructions 9.4 PID basic functions 9.4.3.4 Three-step control Three-step control In "Three-step control" mode, it is possible to generate three statuses of the actuating signal. For this, the status values of the binary output signals QPOS_P and QNEG_P are assigned to the respective operating statuses of the actuator.
  • Page 466 Instructions 9.4 PID basic functions The following figure shows a symmetrical characteristic curve of the three-step controller (ratio factor = 1). PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 467 Instructions 9.4 PID basic functions Asymmetrical three-step control Using the ratio factor RATIOFAC, the ratio of the duration of positive to negative pulses can be changed. In a thermal process, for example, this would allow different system time constants for heating and cooling. Ratio factor <...
  • Page 468: Two-Step Control

    Instructions 9.4 PID basic functions 9.4.3.5 Two-step control In two-step control, only the positive pulse output QPOS_P of PULSEGEN is connected to the on/off actuator. Depending on the manipulated value range used, the two-step controller has a bipolar or a unipolar manipulated value range. Two-step control with bipolar manipulated variable range 
...
  • Page 469: Input Parameters Pulsegen

    Instructions 9.4 PID basic functions 9.4.3.6 Input parameters PULSEGEN The values of the input parameters are not limited in the block. There is no parameter check. Table 9- 17 Input parameters PULSEGEN Parameters Data Default Description type REAL At the input parameter "Input variable" an analog manipulated variable is con- nected.
  • Page 470: Output Parameter Pulsegen

    Instructions 9.4 PID basic functions 9.4.3.7 Output parameter PULSEGEN Table 9- 18 Output parameter PULSEGEN Parameters Data Default Description type QPOS_P BOOL FALSE The output parameter "Output signal positive pulse" is set if a pulse will be out- put. In three-step control, this is 
 a lways the positive pulse. In two-step control, the QNEG_P 
...
  • Page 471: Tcont_Cp

    Instructions 9.4 PID basic functions 9.4.4 TCONT_CP 9.4.4.1 Description TCONT_CP The instruction TCONT_CP is used to control temperature processes with continuous or pulsed control signals. The controller functionality is based on the PID control algorithm with additional functions for temperature processes. To improve the control response with temperature processes, the block includes a control zone and reduction of the proportional component if there is a setpoint step change.
  • Page 472: Mode Of Operation Tcont_Cp

    Instructions 9.4 PID basic functions 9.4.4.2 Mode of operation TCONT_CP Setpoint branch The setpoint is entered at input SP_INT in floating-point format as a physical value or percentage. The setpoint and process value used to form the control deviation must have the same unit.
  • Page 473 Instructions 9.4 PID basic functions Calculation of the parameters: ● PV_FAC = range of PV_NORM/range of CRP_IN; ● PV_OFFS = LL (PV_NORM) - PV_FAC * LL(CRP_IN); where LL: Low limit The scaling is switched off with the default values (PV_FAC = 1.0 and PV_OFFS = 0.0). The effective process value is output at the PV output.
  • Page 474 Instructions 9.4 PID basic functions Dead band (DEADB_W) To suppress a minor sustained oscillation due to the manipulated variable quantization (for example, in pulse width modulation with PULSEGEN) a dead band is applied to the (DEADBAND) control deviation. With DEADB_W = 0.0, the dead band is disabled. The effective control deviation is indicated by the ER parameter.
  • Page 475 Instructions 9.4 PID basic functions PID Algorithm (GAIN, TI, TD, D_F) The PID algorithm operates as a position algorithm. The proportional, integral (INT), and derivative (DIF) actions are connected in parallel and can be activated or deactivated individually. This allows P, PI, PD, and PID controllers to be configured. Controller tuning supports PI and PID controllers.
  • Page 476 Instructions 9.4 PID basic functions Integral action (TI, I_ITL_ON, I_ITLVAL) In manual mode, it is corrected as follows: LMN_I = LMN - LMN_P - DISV. If the output value is limited, the integral action is halted. If the control deviation moves the integral action back in the direction of the output range, the integral action is enabled again.
  • Page 477 Instructions 9.4 PID basic functions Calculating the output value The diagram below is the block diagram of the output value calculation: Parameter configuration interface Instruction call interface Parameter configuration interface, call interface PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 478 Instructions 9.4 PID basic functions Control zone (CONZ_ON, CON_ZONE) If CONZ_ON = TRUE, the controller operates with a control zone. This means that the controller operates according to the following algorithm: ● If process value PV exceeds the setpoint SP_INT by more than CON_ZONE, the value LMN_LLM is output as the manipulated variable.
  • Page 479 Instructions 9.4 PID basic functions Manual value processing (MAN_ON, MAN) You can change over between manual and automatic mode. In manual mode, the manipulated variable is corrected to a manually selected value. The integral action (INT) is set internally to LMN - LMN_P - DISV and the derivative action (DIF) is set to 0 and synchronized internally.
  • Page 480 Instructions 9.4 PID basic functions Save controller parameters SAVE_PAR 
 I f you classify the current controller parameters as utilizable, you can save these before a manual change in structure parameters provided specifically for this in the instance DB of the instruction TCONT_CP.
  • Page 481: Operating Principle Of The Pulse Generator

    Instructions 9.4 PID basic functions 9.4.4.3 Operating principle of the pulse generator The function PULSEGEN transforms the analog manipulated value LmnN through pulse width module into an impulse sequence with the period duration PER_TM. PULSEGEN is switched on with PULSE_ON = TRUE and is processed in the cycle CYCLE_P. A manipulated value of LmnN = 30% and 10 PULSEGEN calls per PER_TM therefore means: ●...
  • Page 482 Instructions 9.4 PID basic functions The following diagram illustrates two-step control with a unipolar manipulated variable range (0% to 100%): Minimum pulse or minimum break time (P_B_TM) Short on or off times hinder the lifespan of actuators and fine controlling units. These can be avoided by setting a minimum pulse duration or minimum break time P_B_TM.
  • Page 483 Instructions 9.4 PID basic functions Accuracy of pulse generation The smaller the pulse generator CYCLE_P is compared to the period duration PER_TM, the more precise the pulse width modulation is. To achieve sufficiently accurate control, the following relationship should apply: CYCLE_P ≤...
  • Page 484: Block Diagram Tcont_Cp

    Instructions 9.4 PID basic functions 9.4.4.4 Block diagram TCONT_CP PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 485 Instructions 9.4 PID basic functions See also Description TCONT_CP (Page 471) Mode of operation TCONT_CP (Page 472) Operating principle of the pulse generator (Page 481) Input parameters TCONT_CP (Page 486) Output parameters TCONT_CP (Page 487) In/out parameters TCONT_CP (Page 488) Static variables TCONT_CP (Page 489) Parameter STATUS_H (Page 494) Parameters STATUS_D (Page 495)
  • Page 486: Input Parameters Tcont_Cp

    Instructions 9.4 PID basic functions 9.4.4.5 Input parameters TCONT_CP Table 9- 19 Input parameters TCONT_CP Parameters Address Data Default Description type PV_IN REAL At the "Process value input" you can assign parameters to a commis- sioning value or you can interconnect an external process value in float- ing-point format.
  • Page 487: Output Parameters Tcont_Cp

    Instructions 9.4 PID basic functions 9.4.4.6 Output parameters TCONT_CP Table 9- 20 Output parameters TCONT_CP Parameter Address Data Default Description type 14.0 REAL The effective process value is output at the "Process value" output. The valid values depend on the sensors used. 18.0 REAL The effective "Manipulated value"...
  • Page 488: In/Out Parameters Tcont_Cp

    Instructions 9.4 PID basic functions 9.4.4.7 In/out parameters TCONT_CP Table 9- 21 In/out parameters TCONT_CP Parameters Address Data Default Description type CYCLE 26.0 REAL 0.1 s Sets the sampling time for the PID algorithm. In phase 1, the tuner calcu- lates the sampling time and enters it in CYCLE.
  • Page 489: Static Variables Tcont_Cp

    Instructions 9.4 PID basic functions 9.4.4.8 Static variables TCONT_CP Table 9- 22 Static variables TCONT_CP Parameters Address Data type Default Description DEADB_W 44.0 REAL A deadband is applied to the control deviation. The "Deadband width" input determines the size of the deadband. The valid values depend on the sensors used.
  • Page 490 Instructions 9.4 PID basic functions Parameters Address Data type Default Description PER_MODE 88.0 You can use this switch to enter the type of I/O module. The process value at input PV_PER is then scaled as follows at the PV output. PER_MODE = 0: Thermoelements;...
  • Page 491 Instructions 9.4 PID basic functions Parameters Address Data type Default Description QTUN_RUN 114.0 BOOL The tuning manipulated tag has been applied, tuning has started and is still in phase 2 (searching for point of inflection). PI_CON 116.0 STRUCT PI controller parameters GAIN +0.0 REAL...
  • Page 492 Instructions 9.4 PID basic functions Parameters Address Data type Default Description CON_ZONE 182.0 REAL 100.0 If the control deviation is greater than the control zone band, the high output value limit is output as output value. If the control deviation is less than the negative control zone band, the low output value limit is output as the output value.
  • Page 493 Instructions 9.4 PID basic functions Parameters Address Data type Default Description PVDT0 228.0 REAL Process value slew rate at start of tuning [1/s] Sign adapted. PVDT 232.0 REAL Current process value slew rate [1/s] Sign adapted. PVDT_MAX 236.0 REAL Max. change in the process value per second [1/s] Maximum derivative of the process value at the point of inflection (sign adapted, always >...
  • Page 494: Parameter Status_H

    Instructions 9.4 PID basic functions 9.4.4.9 Parameter STATUS_H STATUS_H Description Remedy Default, or no/no new controller parameters 10000 Tuning completed + suitable control- ler parameters found 2xxxx Tuning completed + controller pa- rameters uncertain 2xx2x Point of inflection not reached (only If the controller oscillates, weaken the control- if excited via setpoint step-change) ler parameters, or repeat the test with a smaller...
  • Page 495: Parameters Status_D

    Instructions 9.4 PID basic functions 9.4.4.10 Parameters STATUS_D STATUS_D Description No controller parameters were calculated. N_PTN <= 1.5 Process type I fast N_PTN > 1.5 Process type I N_PTN > 1.9 Process type II (transition range) N_PTN >= 2.1 Process type III fast N_PTN >...
  • Page 496: Tcont_S

    Instructions 9.4 PID basic functions 9.4.5 TCONT_S 9.4.5.1 Description TCONT_S The TCONT_S instruction is used on SIMATIC S7 automation systems to control technical temperature processes with binary manipulated value output signals for actuators with integrating behavior. The functionality is based on the PI control algorithm of the sampling controller.
  • Page 497: Mode Of Operation Tcont_S

    Instructions 9.4 PID basic functions 9.4.5.2 Mode of operation TCONT_S Setpoint branch The setpoint is entered at input SP_INT in floating-point format as a physical value or percentage. The setpoint and process value used to form the control deviation must have the same unit.
  • Page 498 Instructions 9.4 PID basic functions Calculation of the parameters: ● PV_FAC = range of PV_NORM/range of CRP_IN; ● PV_OFFS = LL (PV_NORM) - PV_FAC * LL(CRP_IN); where LL: low limit The normalization is switched off with the default values (PV_FAC = 1.0 and PV_OFFS = 0.0).
  • Page 499 Instructions 9.4 PID basic functions Dead band (DEADB_W) To suppress a minor sustained oscillation due to the manipulated variable quantization (for example, in pulse width modulation with PULSEGEN) a dead band is applied to the (DEADBAND) control deviation. With DEADB_W = 0.0, the dead band is switched off. PI step controller algorithm The instruction TCONT_S operates without position feedback.
  • Page 500 Instructions 9.4 PID basic functions Manual value processing (LMNS_ON, LMNUP, LMNDN) With LMNS_ON, you can change between manual and automatic mode. In manual mode, the actuator is halted and the integral action (INT) is set to 0 internally. Using LMNUP and LMNDN, the actuator can be adjusted to OPEN and CLOSED.
  • Page 501: Block Diagram Tcont_S

    Instructions 9.4 PID basic functions 9.4.5.3 Block diagram TCONT_S Parameter configuration interface Instruction call interface Parameter configuration interface, call interface PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 502 Instructions 9.4 PID basic functions See also Description TCONT_S (Page 496) Mode of operation TCONT_S (Page 497) Input paramters TCONT_S (Page 503) Output parameters TCONT_S (Page 504) In/out parameters TCONT_S (Page 504) Static variables TCONT_S (Page 505) PID control Function Manual, 03/2017, A5E35300227-AC...
  • Page 503: Input Paramters Tcont_S

    Instructions 9.4 PID basic functions 9.4.5.4 Input paramters TCONT_S Table 9- 23 Input paramters TCONT_S Parameters Data Default Description dress type CYCLE REAL 0.1 s At this input, you enter the sampling time for the controller. CYCLE ≥ 0.001 SP_INT REAL The input "Internal setpoint"...
  • Page 504: Output Parameters Tcont_S

    Instructions 9.4 PID basic functions 9.4.5.5 Output parameters TCONT_S Table 9- 24 Parameters Data Default Description dress type QLMNUP 20.0 BOOL FALSE If the output "Manipulated value signal up" is set then the control valve should be open. QLMNDN 20.1 BOOL FALSE If the output "Manipulated value signal down"...
  • Page 505: Static Variables Tcont_S

    Instructions 9.4 PID basic functions 9.4.5.7 Static variables TCONT_S Table 9- 26 Static variables TCONT_S Parameters Data Default Description dress type PV_FAC 32.0 REAL The "Process value factor" input is multiplied by the process value. The input is used to scale the process value range. PV_OFFS 36.0 REAL...
  • Page 506: Integrated System Functions

    Instructions 9.4 PID basic functions 9.4.6 Integrated system functions 9.4.6.1 CONT_C_SF CONT_C_SF The instruction CONT_C_SF is integrated in the S7-300 compact CPUs. The instruction must not be transmitted to the S7-300 CPU during loading. The scope of function corresponds with the instruction CONT_C. See also Description CONT_C (Page 449) How CONT_C works (Page 450)
  • Page 507: Pulsegen_Sf

    Instructions 9.4 PID basic functions 9.4.6.3 PULSEGEN_SF PULSEGEN_SF The instruction PULSEGEN_SF is integrated in the S7-300 compact CPUs. The instruction must not be transmitted to the S7-300 CPU during loading. The scope of function corresponds with the instruction PULSEGEN. See also Description PULSEGEN (Page 460) Mode of operation PULSEGEN (Page 461) Mode of operation PULSEGEN (Page 464)
  • Page 508: Polyline

    Instructions 9.5 Polyline Polyline 9.5.1 Compatibility with CPU and FW The following table shows which version of Polyline can be used on which CPU: Polyline S7-1200 V4.2 or higher V1.0 S7-1500 V2.0 or higher V1.0 9.5.2 Description Polyline Description The Polyline instruction maps input value Input onto output value Output using a characteristic curve.
  • Page 509 Instructions 9.5 Polyline Polyline data The value pairs for the polyline are contained in the Static area of the instruction. Note • The minimum number of value pairs to be configured is 2. • The maximum number of value pairs to be configured is 50. •...
  • Page 510 Instructions 9.5 Polyline The following figure shows a polyline with four points. Call Polyline is called as a single-instance DB in an OB. In an FB, Polyline can be called as both a single-instance DB and a multi-instance DB and as a parameter-instance DB. When the instruction is called, no technology object is created.
  • Page 511 Instructions 9.5 Polyline Reaction to error The Polyline instruction detects different errors that may occur during interpolation calculation. The result of the interpolation calculation can be output at the output despite a pending error. If an error prevents correct calculation of the interpolation result, a substitute output value is output at the output.
  • Page 512: Operating Principle Polyline

    Instructions 9.5 Polyline 9.5.3 Operating principle Polyline Polyline data To change the polyline, you edit the values in the UserData structure. The values are then checked for validity and transferred to the WorkingData structure. Only in the WorkingData structure are the values used for the interpolation calculation. The values are checked and transferred when ●...
  • Page 513 Instructions 9.5 Polyline The preassignment of values in the UserData structure does not represent a valid configuration. Change the tags to valid values so that the tags can be used for the interpolation calculation. Note If more than the maximum number of 50 points are needed for your application, use two or more instances of Polyline.
  • Page 514 Instructions 9.5 Polyline Calculating the output value If the input value at the Input parameter is below the first x-value or above the last x-value of the utilized points, configure the preassignment of the Output parameter with the following settings at the OutOfRangeMode tag: ●...
  • Page 515 Instructions 9.5 Polyline Enable behavior EN/ENO If one of the following conditions is met, enable output ENO is set to FALSE. ● Enable input EN is set to TRUE and the Output parameter is specified by a substitute output value in case of error messages ErrorBits ≥ 16#0001_0000. ●...
  • Page 516: Input Parameters Of Polyline

    Instructions 9.5 Polyline 9.5.4 Input parameters of Polyline Parameter Data type Default Description Input REAL Input value Substitute- REAL SubstituteOutput is used as the substitute output value when Output Reset = TRUE • An error with error message ErrorBits ≥ 16#0001_0000 prevents correct •...
  • Page 517: Static Tags Of Polyline

    Instructions 9.5 Polyline 9.5.6 Static tags of Polyline You must not change tags that are not listed. These are used for internal purposes only. Data type Default Description UserData AuxFct_Point- Input are for polyline data Table The polyline data in the UserData structure can be edited.
  • Page 518: Errorbits Parameter

    Instructions 9.5 Polyline Data type Default Description OutOfRangeMode Selection of the output value if the input value lies outside the defined x-values 0 = Maintain slope • 1 = y-value of the first/last point • Permissible value range: 0 to 1 NextXIndex Index of the next x-value Used for monitoring the index of the points that...
  • Page 519 Instructions 9.5 Polyline ErrorBits Description 
 ( DW#16#...) 0000_0000 No error is pending. 0000_0001 The Output parameter was limited to -3.402823e+38 or +3.402823e+38. If the interpolation value is output at the output (Reset = FALSE and ErrorBits < 16#0001_0000), check the following tags used in the interpolation calculation: Input •...
  • Page 520 Instructions 9.5 Polyline Errors with error messages ErrorBits ≥ 16#0001_0000 If one or more errors with error messages ErrorBits ≥ 16#0001_0000 are pending, the output value cannot be determined as expected. The substitute output value is output instead. Enable output ENO is set to FALSE. ErrorBits Description 
...
  • Page 521 Instructions 9.5 Polyline ErrorBits Description 
 ( DW#16#...) 0004_0000 The interpolation calculation yields an invalid REAL value for the Output parameter. Check the REAL values in the WorkingData structure for validity. The Output parameter is assigned the substitute output value that you configure at the ErrorMode tag. If you want to change the polyline data, first edit the UserData structure and then set parameter Validate = TRUE.
  • Page 522 Instructions 9.5 Polyline ErrorBits Description 
 ( DW#16#...) 0008_0000 Note that all tags in the UserData and WorkingData structures are not retentive. These tags are initial- ized with the start values after each change of operating state of the CPU from STOP to RUN. The error bit at the Error parameter is cleared and enable output ENO is set to TRUE again, when The Validate parameter is set to TRUE while the Reset parameter is set to FALSE and the five con- •...
  • Page 523: Service & Support

    Our Service & Support accompanies you worldwide in all matters concerning automation and drive technology from Siemens. We provide direct on-site support in more than 100 countries through all phases of the life cycle of your machines and plants.
  • Page 524 Service & Support Technical Consulting Support in planning and designing your project: From detailed actual-state analysis, definition of the goal and consultation on product and system questions right through to the creation of the automation solution. Technical Support Expert advice on technical questions with a wide range of demand-optimized services for all our products and systems.
  • Page 525 Service & Support Modernization You can also rely on our support when it comes to modernization – with comprehensive services from the planning phase all the way to commissioning. Service programs Our service programs are select service packages for an automation and drives system or product group.
  • Page 526: Index

    Index PULSEGEN Instruction, 460 Mode of operation, 461 CONT_C Block diagram, 452 Input parameters, 453 Mode of operation, 450 Software controller Output parameters, 454 Configuring, 38 CONT_S Symbol Block diagram, 457 For value comparison, 46 Input parameters, 458 Instruction, 455 Mode of operation, 456 Output parameters, 459 TCONT_CP...
  • Page 527 Index PID control Function Manual, 03/2017, A5E35300227-AC...

This manual is also suitable for:

Simatic s7-1500

Table of Contents