43
http://support.automation.siemens.com/WW/view/en/98860357 Application Description 09/2014 Valve Control with the ET 200S 2 PULSE Module ET 200S / IM151-8 / 2 PULSE

Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

  • Upload
    trinhtu

  • View
    217

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

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

Application Description 09/2014

Valve Control with theET 200S 2 PULSE ModuleET 200S / IM151-8 / 2 PULSE

Page 2: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

Warranty and Liability

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 2

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Warranty and Liability

Note The Application Examples are not binding and do not claim to be completeregarding the circuits shown, equipping and any eventuality. The ApplicationExamples do not represent customer-specific solutions. They are only intendedto provide support for typical applications. You are responsible for ensuring thatthe described products are used correctly. These application examples do notrelieve you of the responsibility to use safe practices in application, installation,operation and maintenance. When using these Application Examples, yourecognize that we cannot be made liable for any damage/claims beyond theliability clause described. We reserve the right to make changes to theseApplication Examples at any time without prior notice.If there are any deviations between the recommendations provided in theseapplication examples and other Siemens publications – e.g. Catalogs – thecontents of the other documents have priority.

We do not accept any liability for the information contained in this document.

Any claims against us – based on whatever legal reason – resulting from the use ofthe examples, information, programs, engineering and performance data etc.,described in this Application Example shall be excluded. Such an exclusion shallnot apply in the case of mandatory liability, e.g. under the German Product LiabilityAct (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life,body or health, guarantee for the quality of a product, fraudulent concealment of adeficiency or breach of a condition which goes to the root of the contract(“wesentliche Vertragspflichten”). The damages for a breach of a substantialcontractual obligation are, however, limited to the foreseeable damage, typical forthe type of contract, except in the event of intent or gross negligence or injury tolife, body or health. The above provisions do not imply a change of the burden ofproof to your detriment.

Any form of duplication or distribution of these Application Examples or excerptshereof is prohibited without the expressed consent of Siemens Industry Sector.

Securityinforma-tion

Siemens provides products and solutions with industrial security functions thatsupport the secure operation of plants, solutions, machines, equipment and/ornetworks. They are important components in a holistic industrial securityconcept. With this in mind, Siemens’ products and solutions undergo continuousdevelopment. Siemens recommends strongly that you regularly check forproduct updates.

For the secure operation of Siemens products and solutions, it is necessary totake suitable preventive action (e.g. cell protection concept) and integrate eachcomponent into a holistic, state-of-the-art industrial security concept. Third-partyproducts that may be in use should also be considered. For more informationabout industrial security, visit http://www.siemens.com/industrialsecurity.

To stay informed about product updates as they occur, sign up for a product-specific newsletter. For more information, visithttp://support.automation.siemens.com.

Page 3: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

Table of Contents

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 3

Siem

ens

AG20

14Al

lrig

hts

rese

rved

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

1 Task ..................................................................................................................... 4

2 Solution............................................................................................................... 5

2.1 Overview............................................................................................... 52.2 Hardware and software components ................................................... 62.2.1 Validity .................................................................................................. 62.2.2 Components used ................................................................................ 6

3 Function Principle ............................................................................................. 8

3.1 Pulse width modulation ........................................................................ 83.2 Dithering ............................................................................................... 93.3 Valve characteristic ............................................................................ 103.4 Program blocks .................................................................................. 113.4.1 Program overview .............................................................................. 113.4.2 FB valve_control functionality ........................................................... 123.4.3 FB valve_characteristic functionality ................................................. 183.4.4 FC linear_equation functionality ......................................................... 193.4.5 FB CONT_C functionality .................................................................. 20

4 Device and Network Configuration ................................................................ 21

5 Installation and Commissioning .................................................................... 26

5.1 Installing the hardware ....................................................................... 265.2 Configuration of the current controller ................................................ 275.3 Loading the example project .............................................................. 305.4 Optimization of the current controller ................................................. 32

6 Operating the Application ............................................................................... 34

6.1 Overview............................................................................................. 346.2 Operating the valve control ................................................................ 356.2.1 Entering the maximal valve control current ........................................ 356.2.2 Entering the period duration factor ..................................................... 376.2.3 Controlling the valve ........................................................................... 376.2.4 Controlling the valve directly .............................................................. 386.3 Changing the controller parameters ................................................... 396.4 Changing the characteristic ................................................................ 40

7 Further Notes ................................................................................................... 41

7.1 Using FB valve_control in own projects ............................................. 41

8 Related Literature ............................................................................................ 43

9 History............................................................................................................... 43

Page 4: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

1 Task

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 4

Siem

ens

AG20

14Al

lrig

hts

rese

rved

1 TaskIntroduction

The pressure in a tank shall be controlled with a proportional valve. To balancethermal effects in the valve, the valve is switched with a controlled current.Together with a higher-level control circuit (pressure control) a cascade controlresults for which the current control of the valve forms the inner link. This examplefocuses on the lower-level current control. The manipulated value of the pressurecontroller, which in a real application represents the setpoint for the lower-levelcurrent controller, is in the example given via an HMI panel.While the valve is powered, i.e. controlled, it should always perform a minimaljittering motion (dither frequency, common practice) to prevent the static frictionfrom taking effect, hence improving the control behavior.

Overview of the automation taskThe figure below provides an overview of the automation task.

Figure 1-1: Overview of the automation task

Page 5: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

2 Solution2.1 Overview

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 5

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2 Solution2.1 Overview

Schematic layoutThe figure below shows a schematic illustration of the main components of thissolution. The valve is directly controlled via the 24 V control signal of the 2 PULSEmodule. The configured operating mode is pulse width modulation (PWM). Thepower measurement necessary for the control runs integrated in the 2 PULSEmodule.

Figure 2-1: Overview

2PU

LSE

puls

ege

nera

tor

Pow

erm

odul

ePM

-ED

C24

V

IM15

1-8

CPU

PN/D

P

Proportional valve

PG

KTP700

24V supply

PWM

Ethernet

Ethernet

Programming/configuration is performed in the TIA Portal. The application exampleis operated conveniently via the simulation of a basic panel in the TIA Portal.

AdvantagesThe solution presented here offers you the following advantages: Controlling and control options for a proportional valve is performed exclusively

via a control output of the ET 200S 2 PULSE module. You neither requireadditional hardware for dithering, nor for the current measurement required forlower-level current control.

The example project contains well documented, reusable functions andfunction blocks which you can use directly, or modified according to yourrequirements, for your applications.

Page 6: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

2 Solution2.2 Hardware and software components

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 6

Siem

ens

AG20

14Al

lrig

hts

rese

rved

DelimitationThis application... is not an example for a complete pressure control. It only discusses the lower-

level current controller whose manipulated value directly controls the magnetvalve.

does not discuss the optimization of the current control loop

Assumed knowledgeThe following basic knowledge is assumed: PLC programming with STEP 7 in TIA Portal distributed I/O system ET 200S control technology, cascaded control loops, control of magnet valves, dithering

2.2 Hardware and software components

2.2.1 Validity

This application is valid for STEP 7 from TIA Portal V13 ET 200S with IM 151-8 CPU and 2 PULSE function module

2.2.2 Components used

The application was created with the following components:

Hardware componentsTable 2-1: Hardware components

Component Qty Article number Note

IM 151-8 CPUPN/DP withPROFINETcontroller

1 6ES7151-8AB01-0AB0 You can also use an interfacemodule without CPU andoperate the ET 200S asPROFINET IO device at aPROFINET IO controller (anySIMATIC S7 CPU withPROFINET connection), forexample.

Micro Memory Card2MB for theIM 151-8

1 6ES7953-8LL31-0AA0 Storage capacity from 64kB to8MB possible

Power module PM-E24 V DC

1 6ES7138-4CA01-0AA0

Terminal module forthe power module

1 6ES7193-4CE00-0AA0 Terminal module without accessto AUX1, screw-type connection

2 PULSE electronicmodule

1 6ES7138-4DD01-0AB0

Terminal module forthe 2 PULSE

1 6ES7193-4CB20-0AA0 Terminal module, screw-typeconnection

Page 7: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

2 Solution2.2 Hardware and software components

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 7

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Component Qty Article number NotemoduleDIN rail 35mm,length 483mm, for19‘‘ cabinets

1 6ES5710-8MA11

Current-controlledproportional valve

1-2 - Imax < 2A:One valve can be operated foreach channel of the 2 PULSEmodule.2A <I max 4A:When both channels areswitched parallel, a valve canbe operated at channel 1.

Note When composing your ET 200S system, use the free of charge TIA SelectionTool. It facilitates the consistent configuration of the system. Further informationand a download link are available in /3/.

Software componentsTable 2-2: Software components

Component Qty Article number Note

SIMATIC STEP 7PROFESSIONALV13 FLOATINGLICENSE

1 6ES7822-1AA03-0YA5 runnable on WINDOWS 7(32/64 BIT), WINDOWS 8 SP1(64 BIT)

Latest update forSTEP 7 / WinCCV13

1 free download see /4/;always use the latest update.

Sample files and projectsThe following list includes all files and projects that are used in this example.Table 2-3: Sample files and projects

Component

98860357_valve_regulation_ET200S_2PULSE_CODE_v1d0.zip(This zip file contains the STEP 7 project.)

98860357_valve_regulation_ET200S_2PULSE_DOCU_v1d0_en.pdf(This document)

Page 8: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.1 Pulse width modulation

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 8

Siem

ens

AG20

14Al

lrig

hts

rese

rved

3 Function Principle3.1 Pulse width modulation

The proportional valve is controlled by a pulse width modulated 24V signal. Thefollowing four examples of valve positions are meant to illustrate the correlationbetween control signal and valve position.

Valve closed completelyThe valve is closed until a control voltage of 0V is applied. The valve current IValve is0A.

Figure 3-1: Pulse width modulation, valve closed completely

M

L+

10 20 30 40 500

10ms

U

t [ms]

L+

Valve controlledThe 2 PULSE module controls the valve with a pulse width modulated voltage,which results in a valve current corresponding to the manipulated value of thepressure controller due to the lower-level current control (see Figure 1-1).

Figure 3-2: Pulse width modulation, control 25 %U

t[ms]10 20 30 40 500

10ms

2,5ms

L+

M

L+

Page 9: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.2 Dithering

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 9

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Figure 3-3: Pulse width modulation, control 75 %

M

L+

10 20 30 40 500

10ms

7,5ms

U

t [ms]

L+

Due to a possible non-linearity of the valve characteristic, the piston hubpercentage of the valve needs not correspond to the pulse width percentage of thecontrol voltage. For improving the control dynamics, however, this non-linearity inthe control program is partially equalized (see Chapter 3.3).

Valve opened completelyThe 2 PULSE module controls the valve with its rated voltage (not pulsed).

Figure 3-4: Pulse width modulation, valve opened completely

M

L+

10 20 30 40 500

10ms

U

t [ms]

L+

3.2 Dithering

Explanation of termsThe continuously high slippage of the valve piston is the decisive factor for thecontrol performance. To guarantee this, the valve should, when controlled, performa permanent jittering motion – called dithering. This ... prevents the static friction at the start of a motion which is much higher than

the sliding friction. prevents the adherence of the valve due to residuals from the medium.

Page 10: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.3 Valve characteristic

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 10

Siem

ens

AG20

14Al

lrig

hts

rese

rved

prevents stick-slip effects.(This refers to the stick-slipping of solid bodies moving against each other.Common examples are creaking doors and clattering wind-screen wipers.)

Hysteresis effects can be minimized with dithering.

Realization for pulse width modulationParameters for the jittering motion are the dither frequency and the ditheramplitude. The dither frequency is generally in the range of 60…400Hz. Optimalvalues depend on the mechanism of the valve and the application. Jittering mustnot affect the controlled flow of the medium too much. There are basically tworealization options:1. Pulse width modulation is operated directly with the dither frequency. This

comes with the advantage that no additional workload is required regardingdithering. For certain applications it may be a disadvantage that ditherfrequency and dither amplitude cannot be set separately.

2. The frequency of the pulse width modulation is in a range where the valvepiston can no longer keep up with the frequency. Dithering is additionallymodulated to the PWM signal where pulse width or amplitude is changed at alow frequency.

The application on hand is realized with option 1. The PWM/dither frequency in theexample is 100Hz.

3.3 Valve characteristic

LinearizationFor pressure control by means of a proportional valve there is not necessarily alinear correlation between pressure and control current. Equal pressure changesare hence not matched by equal control current changes or valve hubs across theentire pressure range and vice versa. This results in a pressure-independentcontrol behavior. This makes control circuit optimization more difficult.In order to improve the above behavior, a linearization was installed into thecontrolled system.

Figure 3-5: Linearization of the valve characteristic.

Usually, the data sheets for the valve characteristic represent the pressure as afunction of the control current p=f(I). The linearization in Figure 3-5 is realized as aqualitative reverse function of the valve characteristic.

Approximation of the characteristic curveThe characteristic y=f(x) is approximated by five curve sections (area 0… area 4)and characterized by three points to be defined by the user. X-coordinates (X[1..3])and y-coordinates (Y[1..3]) of the points are stored in a data block. Thecharacteristic is realized in a function block. Input as well as output is standardizedas ‰.

Page 11: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.4 Program blocks

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 11

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Figure 3-6: Valve characteristic

3.4 Program blocks

3.4.1 Program overview

Figure 3-7: Block overview / call structure

User program System blocks Data blocks

CYC_INT5[OB 35]

valve_control[FB1]

valve_characteristic_ch0_DB[DB2]

LIMIT[FC22]

valve_characteristic[FB2]

valve_control_DB[DB1]

valve_characteristic_ch1_DB[DB5]

linear_equation[FC1]

CONT_C[FB41]

CONT_C_ch0_DB[DB3]

CONT_C_ch1_DB[DB4]

Page 12: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.4 Program blocks

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 12

Siem

ens

AG20

14Al

lrig

hts

rese

rved

OB CYC_INT5The entire program runs as cyclic interrupt in CYC_INT5 [OB35]. This is necessarysince the CONT_C [FB41] controller requires a fixed time grid for its function. OB35is called up every 100ms.

FB valve_controlFor two valves (channels 0 and 1), the entire control of the valve control current isrealized in user function blockvalve_control [FB1] which includes instance DBvalve_control_DB [DB1].

FC LIMITThe LIMIT [FC22] function appears in the figure above for completeness since it islisted as system block in the project navigation. However, it must be treated like allother instructions from the group of mathematical functions which do not generatea system block. LIMIT [FC22] is used for limiting the setpoint current value to beentered as ‰, which in a real application is given by the pressure controller(master controller), to the range 0..1000.

FB valve_characteristicIn function block valve_characteristic [FB2], the possible non linearity of the valvecharacteristic is compensated (see Chapter 3.3). The block is called twice – oncefor each channel – using the respective instance DB valve_characteristic_chn_DB[n=0: DB2, n=1: DB5] . FB2 manipulates the setpoint current value given by thepressure controller (master controller) according to the characteristic curveapproximated by five curve sections.

FC linear_equationFB valve_characteristic [FB2] uses the sub-function linear_equation [FC1], whichrealizes a linear curve equation in two-point form and is applied to each curvesection of the characteristic.

FB CONT_CThe valve current is controlled with PID controller CONT_C [FB41] (system block).It is called twice – once for each channel – with the respective instance DBCONT_C_chn_DB [n=0: DB3, n=1: DB4]. The controller was created astechnology object which makes convenient masks available for configuration andcommissioning. The setpoint current value is provided to the controller by theoutput of the valve_characteristic [FB2] block. The actual current value is read fromthe 2 PULSE module. The manipulated value is written to the 2 PULSE module –standardized as ‰.

3.4.2 FB valve_control functionality

Naming convention for variablesThe block serves two equal channels (channel 0 and channel 1). For the channel-related differentiation of parameters and static variables these are indexed in theprogram with _ch0 or _ch1 (example: I_setpoint_mil_ch1). Since the channels inthe block are processed successively, using temporary variables with identicalnames for both channels was also possible. These are marked by a precedingunderscore (example: _I_setpoint_mil).If an explanation in the following sections of this document refers to both channels,block parameters and static variables are listed channel neutral with ending _ch.

Page 13: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.4 Program blocks

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 13

Siem

ens

AG20

14Al

lrig

hts

rese

rved

ParameterFigure 3-8: Calling valve_control [FB1]

Page 14: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.4 Program blocks

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 14

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Table 3-1: Parameters of valve_control [FB1]

Name Type Explanation

InputIN_addr_2PULSE Int Module input address of the 2 PULSE module

Enter the address you have entered in the deviceconfiguration of the 2 PULSE module in its properties atGeneral > I/O address as input start address.

OUT_addr_2PULSE Int Module output address of the 2 PULSE moduleEnter the address you have entered as the output startaddress in the device configuration of the 2 PULSE modulein its properties at General > I/O address.

I_max_A_valve_ch Real Maximal valve control current in ASee data sheet of the valve.

period_duration_factor_ch Int Period duration factorThe effective period duration of the PWM output signalresults as follows:

= _ _ _ × × 0.1;Here, is the period duration entered in the deviceconfiguration of the 2 PULSE module in its properties atGeneral > Parameter > Channel n.

I_setpoint_mil_ch Int Setpoint specification for the valve control current in ‰The reference value is the maximal valve control current(I_max_A_valve_ch). In the application, this parameter issupplied by the HMI, in reality by the pressure controller(master controller).

I_setpoint_mil_min_ch Int Adjustable minimum for the valve control current in ‰The reference value is the maximal valve control current(I_max_A_valve_ch).

I_setpoint_mil_max_ch Int Adjustable maximum for the valve control current in ‰The reference value is the maximal valve control current(I_max_A_valve_ch).

MANUAL_DO_ch Bool Manual output controlThe parameter corresponds to bit 1 of the control byte1. If(SW_ENABLE = false) the MANUAL_DO_ch bit is set whilethe enable has not been given, the output can be set to 24Vwith the SET_DO bit.

SET_DO_ch Bool Set outputThe parameter corresponds to bit 2 of the control byte1. If(SW_ENABLE = false) the MANUAL_DO_ch bit is set whilethe enable has not been given, the output can be set to 24Vwith the SET_DO bit.

1 Control byte of the 2 PULSE module, see chapter 5.9 of the operating instructions “ET 200Stechnological functions” (\10\).

Page 15: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.4 Program blocks

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 15

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Name Type Explanation

InOutSW_ENABLE_ch2 Bool Enable valve controller

For SW_ENABLE_ch = TRUE, bit 0 of the control byte3 isset, which starts the pulse output at the output of the2 PULSE module. Furthermore, the setpoint value of thevalve control current is switched to the controller (forSW_ENABLE_ch = false, setpoint current value 0 is givenfor the controller).

OutputI_actual_A_ch Real Actual value of the valve control current in A

This is the valve current read from the 2 PULSE module.channels_parallel Bool Parallel connection of both channels

Note that a maximal valve control current >2A wasconfigured for channel 0. A valve control current of2A<Imax 4A at channel 0 is only permitted for a parallelconnection of both channels. In this case, please checkwhether ... the parallel connection in the device configuration of the

2 PULSE module has been selected in its properties atGeneral > Parameter by setting the checkmark atParallel connection channels 1 and 2.

whether terminal 3 is bridged with 7 and 4 with 8 at theterminal module of the 2 PULSE module.

(At the HMI of the application example the message“Channel not available due to parallel connection” is outputfor channel 1.)

current_limit_ch Bool Parameter value for I_max_A_valve_ch too highChannel 0: you have entered a value >4A. This is not permitted. (At the HMI of the application example thefollowing message is output for

(channel 0:(“Max. valve control current >4A”)

Channel 1: you have entered a value >2A. This is not permitted. (At the HMI of the application example thefollowing message is output for

(channel 1:(“Max. valve control current >2A”)

Pulse enable for the respective channel is not possible.Static (user-relevant variables)

I_manipulated_mil_ch Int Manipulated valueManipulated value [‰], written to the control interface of the2 PULSE module (e. g. for the HMI display).

Function description

2 Used as INOUT parameter for formal reasons. In the block there is also write access toSW_ENABLE_ch. Write access to an IN parameter would cause a (harmless) warning duringcompilation.3 Control byte of the 2 PULSE module, see chapter 5.9 of the operating instructions “ET 200Stechnological functions” (\10\).

Page 16: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.4 Program blocks

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 16

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Programming is performed mainly in FBD representation. Only those networksusing indirect addressing – those who realize the data exchange with the 2 PULSEmodule – use STL.Table 3-2: Functioning of valve_control [FB1]

NetworksExplanationChannel

0Channel

1

1 -It is polled whether a parallel connection of both channels isnecessary. This is the case for I_max_A_valve_ch0 >2A and anoutput bit is set (channels_parallel).

2 12

The maximal permitted valve control currents are polled(I_max_A_valve_ch).Channel 0:If I_max_A_valve_ch0 >4A, an output bit (current_limit_ch0) isset, manipulated value and control byte are reset and branched toNW 11Channel 1:If I_max_A_valve_ch0 >4A or I_max_A_valve_ch1 >2A, an outputbit is set (current_limit_ch1). If this is the case, or if a parallelconnection is requested (_channels_parallel=true), manipulatedvalue and control byte are reset and branched to NW 22.

3 13

The setpoint value for the valve control current (I_setpoint_mil_ch)is restricted by upper and lower limits (I_setpoint_mil_min_ch andI_setpoint_mil_max_ch) using system function LIMIT [FC22].These can be changed by the user in the static data ofvalve_control [FB1].

4 14The control byte (control_byte_ch) transferred to the 2 PULSEmodule in NW11/21 is composed of the input bits(SW_ENABLE_ch, MANUAL_DO_ch, SET_DO_ch).

5 15

Calling the block for linearization of the valve characteristic(valve_characteristic [FB2]) manipulates the setpoint of the valvecontrol current (I_setpoint_mil_ch). If you do not wish anylinearization in your application, you may delete the networkwithout substitution. Then the setpoint value created as INOUTparameter of the valve_characteristic [FB2] will not be changed byit.

6 16

When a pulse enable is given (SW_ENABLE_ch), the setpoint ofthe valve control current (_I_setpoint_mil) is standardized andtype-converted in such a way that it can be used as setpoint forthe current controller in NW9/19 (_I_setpoint_percent)._I_setpoint_mil:‰, referring to the maximal permittedvalve control current (I_max_A_valve_ch0)_I_setpoint_percent:%, referring to Imax

* of the respective channel of the 2 PULSEmodule

Without pulse enable, the controller receives a setpoint of 0%.

*) For channel 0 the following applies: Imax=2A, ifchannels_parallel = false;

Imax=4A, if channels_parallel = true; For channel 1 the following applies: Imax=2A;

Page 17: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.4 Program blocks

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 17

Siem

ens

AG20

14Al

lrig

hts

rese

rved

NetworksExplanationChannel

0Channel

1

7 17

The actual current value (_I_actual_analog), which is given as ananalog value*, is read by the feedback interface of the 2 PULSEmodule. The input word is indirectly addressed in the feedbackinterface via address register. The network is created in STL.

*) Channel 0: 0..27648 0..2A, if channels_parallel = false; 0..27648 0..4A, if channels_parallel = true; Channel 1: 0..27648 0..2A;

8 18

The actual current value (_I_actual_analog) is standardized andtype-converted in such a way, that it can be used as setpoint forthe current controller (I_actual_percent) in NW9/19. For channel 1it is taken into account whether there is a parallel connection._I_actual_analog:analog value 0..27648_I_actual_percent:%, referring to Imax of the 2 PULSE moduleAdditionally, the actual current value is output as real parameter(I_actual_A_ch) in A(mpere) and for a possible HMI display it issaved to the static data as ‰.

9 19

The PID controller CONT_C is now called. Its configuration andcommissioning is now performed in the technology object (in theproject navigation at PLC_1 [...] > Technology objects >CONT_C_ch_DB). The following parameters must be supplied ordisposed of: Setpoint valve control current [%] (_I_setpoint_percent)SP_INT

Actual current value [%] (_I_actual_percent) PV_IN Manipulated value [%] (_I_manipulated_percent) LMN Initialization of the I fraction* I_ITL_ON Initialization value for the I fraction* I_ITLVAL

*) For I_ITL_ON = true the output of the integrator (I fraction) is setto I_ITLVAL. In this example, this is performed at setpointspecification 0. I_ITLVAL retains its default value 0. This ensuresthat after switching on the controller with the HMI interface“Enable”, the current is controlled from 0 up to the setpoint currentvalue.

10 20

The manipulated value (_I_manipulated_percent) output by thecontroller in % is type-converted and converted to ‰, so it can bewritten to the control interface of the 2 PULSE module as a fixedpoint value (I_manipulated_mil_ch) in NW11/21.

11 21

The following data ... manipulated value (I_manipulated_mil_ch), control byte (control_byte_ch), factor for the period duration (period_duration_factor_ch)

are written to the control interface of the 2 PULSE module.The data in the control interface is addressed indirectly viaaddress register. The network is created in STL.

Page 18: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.4 Program blocks

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 18

Siem

ens

AG20

14Al

lrig

hts

rese

rved

3.4.3 FB valve_characteristic functionality

ParameterFigure 3-9: Calling the valve_characteristic [FB2]

Table 3-3: Parameters of the valve_characteristic [FB2]

Name Type Explanation

InOutINOUT_mil Int Value to be manipulated / manipulated value

The input range is restricted to 0...1000. Values outside thisrange will be restricted to this range. After the block hasbeen executed without errors, INOUT_mil takes on the valuespecified by the characteristic.

Outputerror Bool Error

The block outputs an error bit error= true if a curve sectioncould not be defined due to a faulty configuration. This errorthen also causes the reset of the ENO output. The formalparameter INOUT_mil to be manipulated via thecharacteristic is not changed.

Static (user-relevant variables)X Array[1..3]

of IntX-coordinatesValues X[1], X[2] and X[3] (see Figure 3-6);the following boundary conditions must apply for the value:X[1] > 0, X[2] > X[1], X[3] > X[2], X[3] 1000;If the limits are not met, output error is set (see errorbehavior for error = true).

Y Array[1..3]of Int

Y-coordinatesValues Y[1], Y[2] and Y[3] (see Figure 3-6);the following boundary conditions must apply for the value:Y[1] > 0, Y[2] > Y[1], Y[3] > Y[2], Y[3] 1000;If the limits are not met, output error is set (see errorbehavior for error = true).

IN_mil Int Saved input valueInput value to be manipulated, e.g. usable for the HMIdisplay

OUT_mil Int Saved output valueManipulated output value, e.g. usable for the HMI display

Page 19: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.4 Program blocks

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 19

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Function descriptionProgramming is performed in FBD representation.Table 3-4: Function of the valve_characteristic [FB2]

NW Explanation

1 Input value INOUT_mil is saved to the statistic data on IN_mil for later use inthe block and for a possible HMI display.

2 Used temporary data bits are initialized (reset).

3A plausibility check is performed regarding the points X[1]..X[3], Y[1]..Y[3]defining the five curve sections (areas) (criteria see Table 3-3). Whenplausibility is not given, it is branched to NW14.

4-8

Each characteristic is represented by a temporary field variable_area[1]..._area[5] . It is now determined in which of the five characteristiccurve sections the input value INOUT_mil is located and the respective fieldvariable _area[..] is set to true.

9-13

In the active characteristic curve section (_area[..] = true), the output value iswritten to INOUT_mil .In the areas 0 and 4 (NW9 and NW13) the characteristic curve runshorizontally. In this case, only the values 0 and 1000 are written toINOUT_mil.In the areas 1 to 3 (NW10 to NW12), linear_equation [FC1] is called as sub-function with the respective configuration for the area and the result of thefunction is written to INOUT_mil.For error indication, the ENO outputs of the FC1 function calls or the MOVEinstructions are assigned to temporary data bits (_ENO[..]).

14

The temporary data bits (_ENO[..]) which represent the ENO outputs of theFC1 function calls or MOVE instructions in the networks 9-13 are polled. If atleast one has the status true, the error output is set and assigned to outputvalue INOUT_mil of the saved input value IN_mil.Subsequently, output value INOUT_mil is saved to the static data onOUT_mil, independent of the errors, so it becomes available for HMI display.

15

If no error exists (no_error = true), the bock is exited via the “Return” functionwith VKE=1 and the ENO output is set. In the case of an error (no_error =false) the “Return” function is not executed and the block exited with VKE=0.In this case, the ENO output is reset.

3.4.4 FC linear_equation functionality

ParameterFigure 3-10: Calling the linear_equation [FC1]

Page 20: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

3 Function Principle3.4 Program blocks

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 20

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Table 3-5: Parameters of the linear_equation [FC1]

Name Type

Explanation

Inputx Int Function argument of curve y=f(x)x1 Int x-coordinate of point 1x2 Int x-coordinate of point 2y1 Int y-coordinate of point 1y2 Int y-coordinate of point 2

Outputy Int Function value of curve y=f(x)

y =y2 y1x2 x1

(x x1) + y1 ;

In the case of overflows in the in the arithmetic operation chain duethe configuration, ENO is reset and the following applies to thefunction value: y=x.

Function descriptionProgramming is performed in FBD representation.Table 3-6: Function of the linear_equation [FC1]

NW Explanation

1

Function value y is preassigned with function argument x. In the case ofoverflows in the arithmetic operation chain due to the configuration of theblock, processing the function is cancelled while retaining the then validfunction value y=x and returning to called block with ENO=0.

2-6 The input parameters available as integers are transformed into floating-point values for the arithmetic operations.

7 The function calculation y=f(x) of the curve is performed here in two-pointform (equation see Table 3-5).

3.4.5 FB CONT_C functionality

The PID controller CONT_C [FB41] is a system block. It is described in detail inliterature. See for example ... STEP 7 Professional V13.0 - System Manual (\5\)

– Section 9.8.2.4 Technology– Chapter 11.3 PID control

Online help of TIA Portal V13– Search term “PID Control”– Search term “CONT_C (S7-300, S7-400, S7-1500)”

Page 21: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

4 Device and Network Configuration

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 21

Siem

ens

AG20

14Al

lrig

hts

rese

rved

4 Device and Network ConfigurationAfter you have already installed the TIA Portal on your development systemaccording to Table 2-2, please proceed with the device and network configuration.This is not necessary when using the example project provided as a download. Inthis case you proceed with Chapter 5.Table 4-1: Operating instructions for the configuration

No. Action

1. Start the TIA Portal

2. Create a new project.

(portal view) (project view)Assign a filing location and assign a project name.

3. Go to the network view of the “Devices & networks” editor and draw PLC IM151-8and operator panel KTP700 Basic into the work area via “drag & drop”.

Page 22: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

4 Device and Network Configuration

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 22

Siem

ens

AG20

14Al

lrig

hts

rese

rved

No. Action

4. Create the HMI connection with the operator panel. Select “HMI connection” andconnect the Ethernet ports of both devices graphically with the mouse. To displaythe IP addresses, press .

If necessary, the Ethernet addresses can be changed by clicking on the IPaddress of the respective device. Then select menu item “Ethernet addresses” inthe “Properties” of the inspector window.

Page 23: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

4 Device and Network Configuration

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 23

Siem

ens

AG20

14Al

lrig

hts

rese

rved

No. Action

5. Go to the device view of the IM151-8 and draw the PM_E DC24V power moduleand the 2 PULSE module to slots 4 and 5 of the ET 200S via “drag & drop”.

Then click on the 2 PULSE module and select its properties.

Page 24: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

4 Device and Network Configuration

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 24

Siem

ens

AG20

14Al

lrig

hts

rese

rved

No. Action

6. In “General” you configure the 2 PULSE module according to the requirements ofyour application (see Chapter 5 “2PULSE” in \10\). The configuration of thesupplied application example is listed below:

Note The 2 PULSE module with article number 6ES7138-4DD01-0AB0 alternatively offers a short or a long control interface(Chapter 5.9 in \10\). However, the ET 200S CPU onlyoperates the short interface. In “Operating mode:”, theselection option between 2 Pulse and 2 Pulse ext. controlinterface is therefore not available and grayed.When using an ET 200S interface module, whichcommunicates with a SIMATIC S7-300 CPU, for example, youcan use the extended interface. This however then requireschanges at the example code of this application.

In the application example, channel 1 has the same configuration as channel 0.

Page 25: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

4 Device and Network Configuration

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 25

Siem

ens

AG20

14Al

lrig

hts

rese

rved

No. Action

7. Save the device configuration in the project.

Page 26: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

5 Installation and Commissioning5.1 Installing the hardware

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 26

Siem

ens

AG20

14Al

lrig

hts

rese

rved

5 Installation and Commissioning5.1 Installing the hardwareFigure 5-1: Hardware setup of the application example

Note Note the setup guidelines according to the manuals of the installed components.

NOTICE Please ensure that the electrical data of the valve fits the output data of the2 PULSE module (Chapter 5.8 in \10\).

Note If at first a suitable proportional valve is not available, you can also use otherinductive or ohm-type consumers as load for qualitative test purposes, providingtheir connection values correspond to the output data of the 2 PULSE module.When using light bulbs, a maximal lamp load of 10W per output channel shouldnot be exceeded.

After the wiring has been completed, switch on the 24V power supply.

Page 27: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

5 Installation and Commissioning5.2 Configuration of the current controller

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 27

Siem

ens

AG20

14Al

lrig

hts

rese

rved

5.2 Configuration of the current controllerPID controller CONT_C [FB41] was created as technology object. Its configurationis stored in the instance DBs CONT_C_ch1_DB for channel 1 andCONT_C_ch2_DB for channel 2 and contained in the example project. When usingthe example project and no specific requirements result from the type of valveused, you initially need not change the controller configuration and may skip thefollowing instructions in Table 5-1. For the purpose of offline backup4 thedetermined control parameters must only be secured into the respective DB via theconfiguration mask after controller optimization (see Chapter 5.4).

Table 5-1: Controller configuration

No. Action

1. Create a new technology object.

4 The control parameters changed in the course of controller optimization via the commissioningmask of the technology object or via the watch table are stored retentively in the CPU.

Specify a name

Page 28: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

5 Installation and Commissioning5.2 Configuration of the current controller

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 28

Siem

ens

AG20

14Al

lrig

hts

rese

rved

No. Action

2. Go to “System deviation creation” in the Functional view of the controllerconfiguration mask.

Do not set a checkmark at “Periphery process value on” since in the exampleproject the actual value is used in floating point format at the input parameterPV_IN.A noisy actual current value is not assumed. Therefore, leave the dead bandwidth on default value 0.

3. Go to “Controller”.

The controller structure PI controller (default value) is suitable for current control.Proportional gain (gain) and Integral action time (reset time) entered in theexample project are 0.3 and 0.1s.The I fraction is assigned with an initialization value via the program. Therefore,do not set a checkmark here (default setting). In the program, initialization value0 is given for setpoint current value 0. This ensures that after switching on thecontroller (pulse enable and specification Isetpoint >0), the current is controlled from0 up to the setpoint current value.Freezing the I fraction in the course of the application example is not necessary(default setting).

Page 29: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

5 Installation and Commissioning5.2 Configuration of the current controller

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 29

Siem

ens

AG20

14Al

lrig

hts

rese

rved

No. Action

4. Go to “Manipulated value”.

Remove the checkmark at “Activate manual mode” (manual mode is the defaultsetting) so the controller works in automatic mode (engaging).Adopt the default values for the limits (0..100%) and the standardization(factor=1.0, offset=0.0).

5. The scan time, i.e. the time between the block calls, must be introduced to thecontroller for the internal calculations. This is performed with parameter CYCLE.Go to All parameters > Other parameters in the Parameter view of the controllerconfiguration mask.

For CYCLE, you enter the scan time in seconds in the “Start value project”column. It should correspond to the call interval of the cyclic interrupt OB, inwhich the controller is running. For the example project, the value must be 0.1s,since the controller is called in the 100ms cyclic interrupt OB.

6. Save the controller configuration in the project.

Page 30: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

5 Installation and Commissioning5.3 Loading the example project

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 30

Siem

ens

AG20

14Al

lrig

hts

rese

rved

5.3 Loading the example project

After completing the wiring works, proceed with loading the example project.

Table 5-2: Loading the example project

No. Action

1. Unzip the example project provided as zip-file (see Table 2-3) into a folder onyour development system.

2. Open the project in the TIA Portal:

TIA Portal still closed:Open the project folder valve_regulation and double-click on thevalve_regulation.ap13 file. The TIA Portal opens with the desired project.

TIA Portal already opened:

In the “Open project” window you open the example project (if displayed) byclicking on Open or use Browse to search for the project in the Explorer.

3. Load the program into the controller.

Page 31: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

5 Installation and Commissioning5.3 Loading the example project

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 31

Siem

ens

AG20

14Al

lrig

hts

rese

rved

No. Action

4. When loading the project into the used controller for the first time, the mask for“Extended download to device” opens.

Enter the data for your interface, have all compatible nodes displayed and startthe search. When the CPU has responded, exit the mask with “Load”.

5. After compiling the program prior to starting the download you will receiveinformation on the loading process in the “Load preview” window. Exit the maskby pressing the “Load” button.

6. At the end of the loading process you receive information on the completeddownload in the “Load results” window. Checkmark “Start all (modules)”. Exit themask by pressing the “Finish” button.

7. Let the KTP700 operator panel run on your development system as a simulation.The PG/PC interface in the system controller of your development system mustbe set to the interface card which you use to communicate with the controller(see point 4 of this table). The access point of the application is S7ONLINE(STEP 7).

Navigate to the Windows® system controller

and make the respectivesetting.

Page 32: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

5 Installation and Commissioning5.4 Optimization of the current controller

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 32

Siem

ens

AG20

14Al

lrig

hts

rese

rved

No. Action

8. Start the simulation of the operator panel.

5.4 Optimization of the current controller

For optimization of the controller, the technology object provides a comfortablecommissioning mask. While monitoring the time curves of setpoint, actual valueand manipulated value, you can change the control parameters.Figure 5-2: Mask for commissioning the controller

Page 33: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

5 Installation and Commissioning5.4 Optimization of the current controller

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 33

Siem

ens

AG20

14Al

lrig

hts

rese

rved

For optimizing the controller, proceed as follows:

Table 5-3: Controller optimization

No. Action

1. Open the commissioning mask of the respective controller.

2. Select a suitable scan time from the dropdown list and click on Start.

If an online connection does not yet exist, it will be established. The recentvalues for setpoint, actual value and manipulated value are recorded.

3. In the fields “P” and “I” you enter new values for proportional gain and integralaction time.

Then click on the “Send parameters to CPU” icon.

4. Enter a setpoint jump via the configured KTP700 simulation.5 In the HMI startscreen at the respective channel you enter a setpoint and give the enable orchange the setpoint after the enable has been given (for operation see Chapter6).

5. Use the curves to check the quality of the PI parameters.6. Repeat steps 3 to 5 until you get the desired control result.7. Terminate the online connection

Enter the optimal controller parameters in the configuration mask (functionalview) in “Controller” and save the project offline (see Table 5-1, points 3 and 6).Your optimized values remain in the CPU since they are configured as retentive.

5 Since the controller already exists in the program, the setpoint specification available in thecommissioning mask cannot be used. The program would overwrite the setpoint.

Page 34: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

6 Operating the Application6.1 Overview

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 34

Siem

ens

AG20

14Al

lrig

hts

rese

rved

6 Operating the Application6.1 Overview

Figure 6-1: HMI screens

Start picture

Click here for further informativesites about the Siemens IndustryOnline Support.

Back to start picture

Language setting

Page 35: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

6 Operating the Application6.2 Operating the valve control

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 35

Siem

ens

AG20

14Al

lrig

hts

rese

rved

6.2 Operating the valve controlFigure 6-2: Operating the valve control

This screen represents the user interface for both connectable valves.

Note In the application example, only data concerning controller configuration andsettings as well as the valve characteristic are declared retentive. The values entered inFigure 6-2 and operating modes produced via buttons are at each restartoverwritten by the start values stored in the valve_control_DB. The followingapplies for them:

setpoint = 0 ‰, max. valve control current = 1.7A, period duration factor = 10Operating states “Enable”, “Manual” and “Set” are not active.

6.2.1 Entering the maximal valve control current

Enter den maximal valve control current Imax (from the data sheet of the valve). In areal application it is configured as default.

Maximal valve control current of each channel is smaller than 2ABoth channels can be controlled independent of each other.

Page 36: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

6 Operating the Application6.2 Operating the valve control

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 36

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Maximal valve control current in channel 0 is between 2A and 4AIf 2 < 4 applies for channel 0, both channels of the 2 PULSE modulemust be switched parallel. This is indicated by the following message:

Figure 6-3: Message “Parallel connection”

In this case, only channel 0 can be used and the configuration of channel 0applies.For parallel connection, proceed as follows:

Table 6-1

No. Action

1. Go to the device configuration of the 2 PULSE module in your project and set thecheckmark at “Parallel connection channels 1 and 2” (see Table 4-1, point 6).

2. Save (see Table 4-1, point 3).3. At the terminal module of the PULSE module you bridge terminals 3 with 7 and 4

with 8 (see Figure 5-1).

Maximal valve control current in channel 0 is larger than 4AIf > 4 applies for channel 0, operation with the 2 PULSE module is notpossible. This is indicated by the following message:

Figure 6-4: Message “Imax-ch0 >4A”

The control interface of the 2 PULSE module is for both channels overwritten withdefault setpoint 0 ‰ and control byte 00Hex (no enable).

Page 37: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

6 Operating the Application6.2 Operating the valve control

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 37

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Maximal valve control current in channel 1 is larger than 2AIf > 2 applies for channel 1, operation with the channel is not possible. Thisis indicated by the following message:

Figure 6-5: Message “Imax-ch1 >2A”

In this case, only channel 0 can be used. The control interface of channel 1 isoverwritten with default setpoint 0 ‰ and control byte 00Hex (no enable).

6.2.2 Entering the period duration factor

Specify the period duration factor. In a real application it can be configured asdefault since the frequency of the pulse width modulation is not changed atruntime.

Effective PWM period duration = Period duration factor x configured period duration x0.1;

For period duration factor 10, the effective period duration hence corresponds tothe period duration set in the device configuration of the 2 PULSE module.

6.2.3 Controlling the valve

After a controller restart you can immediately start with controlling the valves.

Page 38: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

6 Operating the Application6.2 Operating the valve control

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 38

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Figure 6-6: Controlling the valve

Enter a setpoint current value in ‰ which relates to the previously set maximalvalve control current and press “Enable”. For an entered setpoint of 500 ‰ – forexample – and a maximal valve control current of 1.7A an actual current value of0.85A must result (Figure 6-6). The manipulated value marks the pulse-pause ratioof the output current of the 2 PULSE module in the respective channel. It is alsostandardized as ‰ and also refers to the maximal valve control current. If – as inthe picture above – the manipulated value deviates from the setpoint, this is due tothe non-linearity of the controlled system (of the valve). For the linearization of thevalve characteristic via HMI operation see chapter 6.4.The valve hub is animated in the above picture. Since there is no positionfeedback, the actual current value was used for the display in the HMI screen.

In order for you to recognize that the controller which you can set to “Manual” inanother HMI screen (see Figure 6-7) or via the commissioning mask, is not set onmanual mode, status “Manual value active” is displayed in Figure 6-6.

6.2.4 Controlling the valve directly

For commissioning purposes you can control the output of a channel with pulsewidth modulation 1000 ‰, i.e. continuously with 24V.

Page 39: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

6 Operating the Application6.3 Changing the controller parameters

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 39

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Table 6-2: Controlling the valve directly

No. Action

1. Remove the “Enable”.2. Press the “Direct” button.3. The “Set” button now enables you to set the respective output to 24V and reset it

to 0V by pressing the button again.

The three buttons correspond to the respective bit in the control byte of the viewedchannel.

6.3 Changing the controller parametersFigure 6-7: Controller parameter

When working with a real operator panel (no simulation) and the TIA Portal is notavailable to you, you can monitor and change the controller parameters via theHMI. You can in this case also switch to manual mode and specify a manipulatedvalue. Don’t forget to adopt the changes in your offline project afterwards (in theconfiguration of the technology object).

Page 40: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

6 Operating the Application6.4 Changing the characteristic

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 40

Siem

ens

AG20

14Al

lrig

hts

rese

rved

6.4 Changing the characteristicFigure 6-8: Changing the valve characteristic

The above screen gives you the option to define the three points of thecharacteristic (see Chapter 3.3). The animated graphic shall give you animpression of the characteristic curve. The x-values represent the setpoint prior tothe manipulation, the y-values the setpoint afterwards. Specify the points to bestcompensate the non-linearity of the valve characteristic.The current setpoint entered in Figure 6-6 is given as original value and as valuemanipulated by the characteristic.

Figure 6-9: Manipulation of the current setpoint value by the characteristic

In the case value inputs with no resulting sensible characteristic or occurringcalculation errors, an error message is displayed and continued withoutcharacteristic curve manipulation (y=x).

Figure 6-10: Error in the characteristic

Page 41: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

7 Further Notes7.1 Using FB valve_control in own projects

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 41

Siem

ens

AG20

14Al

lrig

hts

rese

rved

7 Further Notes7.1 Using FB valve_control in own projects

To integrate FB valve_control into your own projects, proceed as follows:

Table 7-1: Using FB valve_control in own projects

No. Action

1. Copy FB valve_control from the STEP 7program of this example application or from alibrary (if you have already saved into such alibrary) into your user program in the projectnavigation at “Program blocks”.

2. If you wish to use the emulation of the valve characteristic from the example project,copy the blocks valve_characteristic and linear_equation into your own project aswell. Otherwise, replace the blocks for manipulating the valve characteristic innetworks 5 and 15 of FBs valve_control with your own blocks6 or, if not used, deletenetworks 5 and 15 without substitution.

6 For your own blocks, make sure they also use an integer-type INOUT parameter for the valvecontrol current. Please note that the HMI of the application example accesses instance data ofFB valve_characteristic. If there is another or no characteristic block, the HMI must also beadjusted respectively.

Page 42: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

7 Further Notes7.1 Using FB valve_control in own projects

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 42

Siem

ens

AG20

14Al

lrig

hts

rese

rved

No. Action

3. Compile FBvalve_control.

With the compilation, therequired system blocksLIMIT and CONT_C aswell as both technologyobjectsCONT_C_ch0_DB andCONT_C_ch1_DB arealso created.

If you have copied FBvalve_characteristic intoyour project, its instancedatavalve_characteristic_ch0_DBvalve_characteristic_ch1_DBare also created.

4. Call FB valve_control in a cyclic interrupt OB and supply/dispose of its formalparameter if necessary.

5. Perform controller optimization according to Chapter 5.4.

Page 43: Application Description y 09/2014 Valve Control with the ET 200S 2 PULSE …€¦ ·  · 2015-01-20Application Descriptiony 09/2014 Valve Control with the ET 200S 2 PULSE Module

8 Related Literature

Ventilregelung mit dem ET200S 2PULSE-ModulEntry-ID: 98860357, V1.0, 09/2014 43

Siem

ens

AG20

14Al

lrig

hts

rese

rved

8 Related Literature

Table 8-1

Topic Title

\1\ Siemens IndustryOnline Support

http://support.automation.siemens.com

\2\ Download page ofthe entry

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

\3\

STEP 7,TIA Portal

TIA Selection Toolwww.siemens.de/tia-selection-tool

\4\ Latest update on STEP 7 / WinCC V13http://support.automation.siemens.com/WW/view/en/90466591

\5\ STEP 7 Professional V13.0 - System Manualhttp://support.automation.siemens.com/WW/view/en/89515142

\6\ Automating with SIMATIC S7-300 inside TIA PortalISBN: 978-3-89578-382-1Automating with STEP 7 in LAD and FBDISBN: 978-3-89578-410-1Automating with STEP 7 in STL and SCLISBN: 978-3-89578-412-5

Author: Hans BergerPublisher: Publicis Publishing

\7\

Distributed I/Osystem ET 200S

SIMATIC Distributed I/O System ET 200SOperating instructionshttp://support.automation.siemens.com/WW/view/en/1144348

\8\ SIMATIC ET 200S distributed I/O IM 151-8 PN/DP CPUinterface module - Operating Instructionshttp://support.automation.siemens.com/WW/view/en/47409312

\9\ ET 200S Terminal modules – Manualhttp://support.automation.siemens.com/WW/view/en/25390457

\10\ SIMATIC ET 200S Technological FunctionsOperating instructionshttp://support.automation.siemens.com/WW/view/en/45977588

9 History

Table 9-1

Version Date Modifications

V1.0 09/2014 First version