Sie sind auf Seite 1von 183

SIMATIC

winding and tension


control
Siemens
S7-1200/S7-1500(T) Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/58565043 Support
Warranty and liability

Warranty and liability

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

We do not accept any liability for the information contained in this document.
Any claims against us – based on whatever legal reason – resulting from the use of
the examples, information, programs, engineering and performance data etc.,
described in this Application Example shall be excluded. Such an exclusion shall
not apply in the case of mandatory liability, e.g. under the German Product Liability
Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life,
body or health, guarantee for the quality of a product, fraudulent concealment of a
© Siemens AG 2019 All rights reserved

deficiency or breach of a condition which goes to the root of the contract


(“wesentliche Vertragspflichten”). The damages for a breach of a substantial
contractual obligation are, however, limited to the foreseeable damage, typical for
the type of contract, except in the event of intent or gross negligence or injury to
life, body or health. The above provisions do not imply a change of the burden of
proof to your detriment.
Any form of duplication or distribution of these Application Examples or excerpts
hereof is prohibited without the expressed consent of the Siemens AG.

Security Siemens provides products and solutions with industrial security functions that
informa- support the secure operation of plants, systems, machines and networks.
tion In order to protect plants, systems, machines and networks against cyber
threats, it is necessary to implement – and continuously maintain – a holistic,
state-of-the-art industrial security concept. Siemens’ products and solutions only
form one element of such a concept.
Customer is responsible to prevent unauthorized access to its plants, systems,
machines and networks. Systems, machines and components should only be
connected to the enterprise network or the internet if and to the extent necessary
and with appropriate security measures (e.g. use of firewalls and network
segmentation) in place.
Additionally, Siemens’ guidance on appropriate security measures should be
taken into account. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them
more secure. Siemens strongly recommends to apply product updates as soon
as available and to always use the latest product versions. Use of product
versions that are no longer supported, and failure to apply latest updates may
increase customer’s exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial
Security RSS Feed under http://www.siemens.com/industrialsecurity.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 2
Table of contents

Table of contents
Warranty and liability ................................................................................................... 2
1 Winding and tension control – Overview ........................................................ 5
1.1 SIMATIC Converting Toolbox .............................................................. 5
1.2 Core functions ...................................................................................... 5
1.3 Additional functions .............................................................................. 7
1.4 Converting Diagnostic Pages (IT-Diag)................................................ 8
2 Basic information about Winding and Tension Control ................................ 9
2.1 General overview of winders ................................................................ 9
2.2 General overview of tension control axis (sectional drive) ................. 11
2.3 Winding/Tension control concepts ..................................................... 12
3 Integration ........................................................................................................ 23
3.1 Integration into user program ............................................................. 23
3.2 Content of the library .......................................................................... 25
3.3 Starter – SINAMICS Configuration ..................................................... 26
3.4 TIA Portal – Hardware part................................................................. 26
4 Example project ............................................................................................... 29
5 Functional description .................................................................................... 31
5.1 General functions ............................................................................... 31
© Siemens AG 2019 All rights reserved

5.1.1 LCon_ReadCycleTimeS71200 ........................................................... 31


5.1.2 LCon_ReadCycleTimeS71500 ........................................................... 32
5.1.3 LCon_Linear ....................................................................................... 33
5.1.4 LCon_TableChar ................................................................................ 35
5.1.5 LCon_RFG – Ramp-function generator ............................................. 38
5.1.6 LCon_RFGJ – Ramp-function generator with rounding-off................ 44
5.1.7 LCon_CalcStopDistance .................................................................... 50
5.1.8 LCon_ModuloIEC ............................................................................... 52
5.2 Logical functions ................................................................................. 54
5.2.1 LCon_TRIG ........................................................................................ 54
5.3 Scaling function blocks ....................................................................... 55
5.3.1 LCon_ScalingDWDRL ........................................................................ 55
5.3.2 LCon_ScalingRLDWD ........................................................................ 56
5.3.3 LCon_ScalingWDRL .......................................................................... 57
5.3.4 LCon_ScalingRLWD .......................................................................... 58
5.3.5 LCon_Scaling ..................................................................................... 59
5.4 Closed-Loop function blocks .............................................................. 60
5.4.1 LCon_PT1 .......................................................................................... 60
5.4.2 LCon_ReadAnalogInput ..................................................................... 63
5.4.3 LCon_Differentiator ............................................................................ 65
5.4.4 LCon_Integrator ................................................................................. 67
5.4.5 LCon_DT1 .......................................................................................... 71
5.4.6 LCon_Limiter ...................................................................................... 74
5.4.7 LCon_LevelControl ............................................................................. 76
5.4.8 LCon_DeadBand ................................................................................ 78
5.4.9 LCon_DeadZone ................................................................................ 80
5.4.10 LCon_AverageValue .......................................................................... 82
5.4.11 LCon_PID ........................................................................................... 84
5.4.12 LCon_TPID – PID-controller with setpoint channel ............................ 90
5.5 Drive related functions ........................................................................ 97
5.5.1 LCon_DriveControl ............................................................................. 97
5.5.2 LCon_SetpointChannel .................................................................... 104
5.5.3 LCon_FrictionMeasuement .............................................................. 108

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 3
Table of contents

5.6 Sectional drive functions .................................................................. 112


5.6.1 LCon_Sectional Drive ....................................................................... 112
5.6.2 LCon_SectionalConfigSetup ............................................................ 119
5.6.3 LCon_TorquePrecontrol ................................................................... 122
5.7 Winder function blocks ..................................................................... 128
5.7.1 LCon_DiamCalcDivision................................................................... 128
5.7.2 LCon_DiamCalcIntegral ................................................................... 131
5.7.3 LCon_DiamCalcAddition .................................................................. 137
5.7.4 LCon_DiamCalcWebLength ............................................................. 140
5.7.5 LCon_WITorquePrecontrol............................................................... 143
5.7.6 LCon_RestLengthCalc ..................................................................... 149
5.7.7 LCon_RestDiameterCalc.................................................................. 151
5.7.8 LCon_Taper ..................................................................................... 153
5.7.9 LCon_WinderConfigSetup................................................................ 158
5.7.10 LCon_Winder ................................................................................... 162
5.7.11 LCon_CalcTargetDiamStopCondition .............................................. 171
5.8 Data Types ....................................................................................... 175
6 Appendix ........................................................................................................ 182
6.1 Service and Support ......................................................................... 182
6.2 Application Support .......................................................................... 183
6.3 Links and Literature .......................................................................... 183
6.4 Change documentation .................................................................... 183
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 4
1 Winding and tension control – Overview

1 Winding and tension control – Overview


1.1 SIMATIC Converting Toolbox
The following library for realizing a winder/ tension control is part oft he SIMATIC
Converting Toolbox:

https://support.industry.siemens.com/cs/ww/en/view/109744606

The SIMATIC Converting Toolbox was developed with the objective to provide a
collection of common standard functions which are necessary for any kind of
converting machines.
Converting describes the process of processing/finishing any kind of material. In
most cases this starts with unwinding a material web which then is processed in
one or several steps in machine types like
• Printing machines
• Coating lines
• Laminating machines
• Slitters
© Siemens AG 2019 All rights reserved

• Web Inspection machines


• Wire drawing machines
• Extrusion lines
• Textile machines
• Diaper machines
• …

The open source library includes tested and documented functions which help the
user during engineering, programming and commissioning. Well-structured
interfaces and documented source code gives the possibility to make adaptions to
user specific requirements.

1.2 Core functions


The core functions of the SIMATIC Converting Toolbox are functions and functions
blocks to control a winding axis respectively tension control axis.
This includes mainly speed and torque setpoint calculations which are necessary
for different selectable control modes.
Further on the Toolbox provides sub-functions used typically in winding and tension
control systems, such as
• Diameter calculation
• Torque pre-control
• Gain adaption
• Tension taper characteristic
• …

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 5
1 Winding and tension control – Overview

Diameter calculator
4 different techniques are available to calculate the diameter of the roll being
wound:
• Thickness addition: The diameter is calculated by adding the material
thickness
• Web length calculation: The diameter is calculated using the length of the
winded material and the material thickness
• v/n calculation: The diameter is calculated using the ratio between the velocity
of the material web and the winder speed
• v/n integral: The diameter is calculated from the ratio between the material
length and the revolutions of the winder (integration)
• External diameter: The diameter comes from extern (sensor)

Torque pre-control
The main component of course, is the motor torque which is necessary to build up
the desired web tension.
Beside of that friction torque, acceleration torque and the torque resulting from a
changing roll diameter can be pre-controlled.
© Siemens AG 2019 All rights reserved

This pre-control signal is transferred to the drive as additive torque, being


calculated inside the Toolbox function blocks.

Controller Adaptation
The gain of the technology controller can be adapted as a function of the diameter.
This permits a higher controller gain at a bigger diameter.

In case of S120 drives, the speed controller gain in the drive can be adapted as a
function of the moment of inertia or the actual diameter of the roll being wound.
This is necessary to guaranty a well optimized and dynamic speed controller even
the diameter ratio (full roll to empty roll) is big.

Tension taper characteristic


A tension taper characteristic might be required at rewinding systems in order to
decrease the rewinding tension as a function of the increasing roll diameter.

5 different techniques are available to calculate the tension taper characteristic:


• No characteristic
• Linear characteristic – the tension is linearly reduced as a function of the actual
diameter
• Hyperbolic characteristic type 1 – the tension decreases according to a
hyperbolic function/characteristic

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 6
1 Winding and tension control – Overview

• Hyperbolic characteristic type 2 – the tension decreases according to a


hyperbolic function/characteristic
• Interpolated characteristic using a table of points – 10 points can be entered to
define the characteristic

1.3 Additional functions


Beside the core functions – winding and tension control – the SIMATIC Converting
Toolbox provides many useful functions and function blocks which are necessary in
converting applications. The following list shows a short overview about some of
them:
• PID controller
• Ramp function generator
• Stop distance calculation
• Logical functions (e.g. Trigger)
• Scaling functions (e.g. data type conversions)
• PT1/DT1 filter
• Integrator/Differentiator
• …
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 7
1 Winding and tension control – Overview

1.4 Converting Diagnostic Pages (IT-Diag)


The Converting Diagnostic pages are available on SIOS:
https://support.industry.siemens.com/cs/ww/en/view/109474896

A separate documentation describes the configuration of the web server as well as


the Converting Diagnostic Pages.

Figure 1-1
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 8
2 Basic information about Winding and Tension Control

2 Basic information about Winding and


Tension Control
2.1 General overview of winders
The function of a winder is to rewind or unwind a material web with a defined
tension. During the winding process the diameter of the roll changes. The diameter
needs to be detected or calculated to adjust the motor speed in order to keep the
tension of the material constant.
If the winding system must fulfill higher demands regarding the performance and
tension accuracy, the actual web tension can be detected my measuring devices
(dancer system or load cell) to use the feedback signal as input of a controller –
here named “technology controller” (TPID).

There are two general possibilities to detect the web tension:

The dancer roll is a position-controlled measuring system. The material web is


threaded through this dancer roll system. A cylinder with a deflection roll presses,
with an adjustable counterforce against the material web. If tension is established
in the material web then this acts against the pressure from the dancer roll. The
© Siemens AG 2019 All rights reserved

dancer roll is at its center position, if pulling force of the material web and
counterforce of the dancer system is in balance.
In order to control (closed-loop) the tension in the material web, the technology
controller must ensure that the dancer roll remains at its center position. If the
tension in the system changes, then the position of the dancer roll also changes –
that is in turn coupled with the technology controller. Web tension variations –
detected by dancer position variations - can either be compensated by changing
the motor speed or by adapting the motor torque.

+
sact
P -
U

The load cell directly measures the tension in the material web and transfers this
signal to the technology controller. Tension variations can either be compensated
by changing the motor speed or by adapting the motor torque.

In general there are two types of winding techniques:

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 9
2 Basic information about Winding and Tension Control

Center Winder
With a center winder, the roll is driven by a central shaft. The diameter range is an
important factor when designing this winder type. The reason for this is that for a
constant web velocity and constant tension, the speed is inversely proportional to
the diameter. This means that the maximum required drive speed is defined by the
minimum roll diameter – whereby the maximum required torque is defined by the
maximum diameter.
The center winder is more complicated and from control perspective more difficult
to handle than the surface winder; however it is still more widely established of the
two winder types.
© Siemens AG 2019 All rights reserved

Surface Winder
For a surface winder, the roll is driven through one or several rolls that are in
contact with the roll being wound. The drive speed and power depends on the
diameter of the roll being wound. From a mechanical design perspective, this
winder technique is more complicated than that of a center winder.
The contact winder (surface winder) is essentially used if there are no special
requirements placed on the surface quality of the material being wound.

Surface winder

M-
n-controlled controlled

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 10
2 Basic information about Winding and Tension Control

2.2 General overview of tension control axis (sectional


drive)
The function of a tension controlled axis (sectional drive) is to transport a material
web with a defined tension.
If the system must fulfill higher demands regarding the performance and tension
accuracy, the actual web tension can be detected my measuring devices (dancer
system or load cell) to use the feedback signal as input of a controller – here
named “technology controller” (TPID).

There are two general possibilities to detect the web tension:

The dancer roll is a position-controlled measuring system. The material web is


threaded through this dancer roll system. A cylinder with a deflection roll presses,
with an adjustable counterforce against the material web. If tension is established
in the material web then this acts against the pressure from the dancer roll. The
dancer roll is at its center position, if pulling force of the material web and
counterforce of the dancer system is in balance.
In order to control (closed-loop) the tension in the material web, the technology
controller must ensure that the dancer roll remains at its center position. If the
tension in the system changes, then the position of the dancer roll also changes –
© Siemens AG 2019 All rights reserved

that is in turn coupled with the technology controller. Web tension variations –
detected by dancer position variations - can either be compensated by changing
the motor speed or by adapting the motor torque.

+
sact
P -
U

The load cell directly measures the tension in the material web and transfers this
signal to the technology controller. Tension variations can either be compensated
by changing the motor speed or by adapting the motor torque.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 11
2 Basic information about Winding and Tension Control

2.3 Winding/Tension control concepts


The following tension control concepts are available for winding and sectional drive
functionality:
Open-loop control modes:
– Draw control (sectional drive only)
– Indirect Tension Control
– V-Constant Control (winder only)
Closed-loop control modes:
– Tension Control Torque Adaption using Load-cell
– Tension Control Speed Adaption using Load-cell
– Dancer Control Speed Adaption

These control concepts will be briefly explained in the following.


© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 12
2 Basic information about Winding and Tension Control

Draw Control
This method is used for simple tension regulation, especially when any additional
measuring system is not available. It does not offer high level tension accuracy.
It can’t be used for center driven winders.
Using this method, the web tension is set by the segments velocity ratio, means
that the velocity of the transport rolls at the segment start is slower than at the
segment end. The velocity difference causes material strain which defines the web
tension. The resulting tension depends on the material type, the friction between
the material and the transport roll (slip) and the transport system itself.

v OUT - v IN
T2 = T1 + C 
v IN

T1 T2

Vline_IN Vline_OUT
n_1 n_2

M M
© Siemens AG 2019 All rights reserved

Motion
Control
System

LTC axis

Master axis

velocity setpoint FTension


position setpoint
Velocity /

Actual speed

Power unit
value
Acceleration
setpoint

x + Auxiliary
torque
Torque limits

Speed setpoint Speed


drawFactor
LTC axis setpoint +
diameter Speed Control
controller loop

LTC drive
Torque
precontrol

Torque pre-control
Torque limiting

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 13
2 Basic information about Winding and Tension Control

Indirect Tension Control


The indirect tension control is very frequently used if a user does not want to use
expensive sensor systems as there is no higher-level tension control necessary.
There is no measuring system necessary, as there is no feedback used to control
the tension - the technology controller is not used.
To set the web tension, the tension setpoint is computed into a torque value which
is based on the roll diameter and the gear ratio. The speed controller in the drive is
overdriven in order to operate the motor at the torque limit. This torque limit is
being adapted as a function of the diameter of the roll being wound or the fix
diameter of the roll in case of sectional drive axis.
To reach an accurate web tension with this control method it is important that the
friction and accelerating torque are precisely compensated in order the pre-
controlled tension torque results in the best possible approximation to the required
material tension.
In this control mode the mechanical losses should be kept as small as possible.
This includes an appropriate motor selection and the selection of a highly efficient
gearbox with low friction losses.

F
© Siemens AG 2019 All rights reserved

Vline
M_1

n_1

Motion
Control
System

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 14
2 Basic information about Winding and Tension Control

Winding axis

Master axis
FTension [N]

velocity setpoint

Velocity setpoint
velocity / position

velocity override
setpoint

Actual speed

Power unit
value
Acceleration setpoint

Auxiliary Torque limit


torque
diameter Speed setpoint speed setpoint
Diameter
calculation
Winding axis
(overridden)
+
speed/position
Speed Control
controller loop

Winding drive
Torque torque precontrol
tension setpoint Setpoint precontrol
preparation tension setpoint
(Ramp generator) after RFG
torque limits
Torque limiting
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 15
2 Basic information about Winding and Tension Control

V-constant control
This method is used for simple tension regulation, especially when any additional
measuring system is not available. It does not offer high level tension accuracy.
In this control mode the winder is controlled to run with constant web speed (web
speed command value). No tension control is active.

Winding axis

line speed actual value

Actual speed

Power unit
value
velocity setpoint (line axis) Auxiliary Torque limit
torque
Speed setpoint speed setpoint
Winding axis +
© Siemens AG 2019 All rights reserved

Speed Current
controller controller

diameter
Diameter Winding drive
calculation

speed/
position

Precontrol torque

Torque
acceleration setpoint (line axis) precontrol

optional

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 16
2 Basic information about Winding and Tension Control

Tension Control Torque Adaption using Load-cell


In this control mode the web tension is directly detect by a measuring device – a
load cell. Its output signal is used inside the technology controller as actual value
signal. The tension control is used if the precision of the open-loop torque control is
no longer sufficient or there are disturbances in the system which needs to be
eliminated.
Just as the same as for indirect tension control, the speed controller in the drive is
overdriven in order to operate the motor at the torque limit. This torque limit is
being adapted by the technology controller.
Supplementary torque setpoints – e.g. from the acceleration torque pre-control or
friction torque pre-control are connected-up so they act additively to the torque
limits.
Using a load cell it is not necessary to interfere the web path, however there is not
the advantage of having a buffer like a dancer provides.

Load cell
F

Vline
© Siemens AG 2019 All rights reserved

n+ M+
M

Motion
Fact
Control
System

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 17
2 Basic information about Winding and Tension Control

Winding axis

Master axis
FTension [N]

setpoint velocity

velocity setpoint
velocity / position

Geschwindigkeits-
Override
setpoint

Actual speed

Power unit
value
acceleration setpoint

Auxiliary Torque limit


torque
Speed setpoint speed setpoint
Diameter
speed / position
calculation
diameter
Winding axis
(overridden)
+
Speed Control
controller loop

tension actual value


Winding drive

Tension
correction value

tension controller
Setpoint
setpoint
preparation (Ramp
generator) precontrol
torque
Torque
tension setpoint precontrol
RFG +
© Siemens AG 2019 All rights reserved

Torque limiting torque limits

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 18
2 Basic information about Winding and Tension Control

Tension Control Speed Adaption using Load-cell


In this control mode the web tension is directly detect by a measuring device – a
load cell. Its output signal is used inside the technology controller as actual value
signal. The tension control is used if the precision of the open-loop torque control is
no longer sufficient or there are disturbances in the system which needs to be
eliminated.
Contrary to the control modes with torque adaption, the output signal of the
technology controller is an additional speed value. The speed controller in the drive
gets the accurate speed setpoint to achieve the desired web tension. The motor is
not operating at the torque limits.
Supplementary torque setpoints – e.g. from the acceleration torque pre-control or
friction torque pre-control are connected-up to the drive.
Using a load cell it is not necessary to interfere the web path, however there is not
the advantage of having a buffer like a dancer provides.

Load cell
F
© Siemens AG 2019 All rights reserved

Vline
n+ M+
M

Motion
Fact
Control
System

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 19
2 Basic information about Winding and Tension Control

Winding axis

Master axis
FTension [N]

Setpoint velocity

Velocity setpoint
Acceleration setpoint

Velocity/position

Actual speed
setpoint

Power unit
value
+ Speed
setpoint
Auxiliary
torque
Torque limit

Diameter Speed setpoint


Speed/position
calculation
diameter
Winding axis +
Speed Current
Correection value controller controller

Winding drive
Tension actual value

Tension
Tension controller
Setpoint
setpoint
preparation
(Rampgenerator)

Precontrol
Torque torque
precontrol
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 20
2 Basic information about Winding and Tension Control

Dancer Control Speed Adaption


In this control mode – contrary to the load cell – it is not the web tension that is
controlled by the technology controller directly, but the dancer position.
If the web tension changes, also the dancer position changes. The position of the
dancer roll is determined using a suitable position encoder, which is then compared
with the position setpoint in the technology controller. The controller output is an
additive velocity setpoint (weighted with the actual diameter) in order to maintain
the setpoint position of the dancer.

Dancer roll
F

Vline
n+ M+
M
© Siemens AG 2019 All rights reserved

Posact Motion
Control
System

The dancer roll attempts to deflect the material web with a defined force. The final
web tension is a result of the pulling force to the dancer and its counterforce.
The counterforce of the dancer – in consequence the web tension can be defined
in different ways, dependent on the mechanical construction of the dancer system.
An easy way is a counterforce generated with spring power. However the spring
force and due to this the web tension can only be adjusted by the dancer angle.
More flexible adjustable counterforce can be achieved with pneumatic or hydraulic
dancer system. These systems can keep the counterforce constant even the
dancer angle changes. To do this, the tension setpoint signal is connected to an
analog output and is used as setpoint for the dancer force.

Often, there are additional factors that influence the tension actual value as a result
of the geometrical arrangement (distance to reversing rollers that may be used)
and the weight of the dancer roll itself. However, with a careful mechanical design,
these effects can be eliminated or sufficiently minimized.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 21
2 Basic information about Winding and Tension Control

The dancer position control has the advantage that brief fluctuations in the web
tension – caused by disturbances - can be absorbed due to the material buffer
function of the dancer roll.
Another advantage of the dancer system is the damping effect on
• Non-round material rolls
• Jumps between layers – e.g. when winding cables
• Influences during flying roll changes (splice)

However, an intervention has to be made in the material web routing as a result of


the mechanical arrangement.

Even though closed-loop dancer roll controls are quite complex, they offer the best
control technique.

dancer counterforce

Winder axis

Master axis
© Siemens AG 2019 All rights reserved

FTension [N]
+
setpoint velocity

-
velocity setpoint
velocity / position
acceleration setpoint

setpoint

Actual speed

Power unit
value

+ speed
setpoint
Auxiliary
torque Torque
limit
Diameter Speed setpoint
speed / position
calculation
diameter
winder axis +
Speed Current
controller controller
correction value

position
Winder drive
setpoint position
Setpoint RFG
setpoint after
RFG Position
controller
position actual value

Torque torque precontrol


Optional precontrol
tension setpoint
Setpoint RFG

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 22
3 Integration

3 Integration
3.1 Integration into user program
The SIMATIC Converting Toolbox is provided as global TIA Portal library LCon.
The following steps need to be done for integration to the user program:

1. Open library in TIA Portal


The library archive can be retrieved to TIA Portal with a right mouse click in the
free area below already existing libraries:

Figure 3-1 Retrieve global TIA library


© Siemens AG 2019 All rights reserved

2. Copy the folders LCon_Blocks and LCon_Types to the user project. All the
content can be copied to the user program by drag and drop. The global TIA
Portal library “LCon” provides the SIMATIC Converting Toolbox functionalities
for the SIMATIC PLCs S7-300/S7-400 and S7-1200/S7-1500(T).Furthermore it
contains program examples (OB’s) how to trigger the function blocks.

NOTE It is recommended to copy the respective sources together with the overlaid
folder “LCon_.....”

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 23
3 Integration

Figure 3-2
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 24
3 Integration

3.2 Content of the library


All source files are located in the folder "Master copies". Within the folder different
winder solutions can be found accoring to the following table:

Content SIMATIC library LCon for winding and tension control in the TIA-Portal
S7-300/S7-400 LCon
Library is not using any motion control functionality of the controller
and is executable on all SIMATIC controllers of the type S7-300
and S7-400.
S7-1200/S7-1500(T) LCon
Library is not using any motion control functionality of the controller
and is executable on all SIMATIC controllers of the type S7-1200,
S7-1500 and S7-1500T.
S7-1500(T) LConSMC – Standard Motion Control
Library is using standard motion control functions of the controller
to realize winding and tension control. It is executable on the
SIMATIC controllers S7-1500 and S7-1500T in combination with a
technology object.

Both solutions for S7-1500 offer the same functionality for winding and tension
© Siemens AG 2019 All rights reserved

control. In case of further technological functions like flying splice, traverser or


general positioning commands the solution S7-1500(T), based on standard motion
control system functions, offers extensive advantages.

NOTE For all of the three solutions exists a separate manual which contains the
description of the functions

S7-1200/S7-1500
The S7-1200/S7-1500 folder contains the Toolbox function blocks and functions
(LCon_Blocks) as well as the required data types (LCon_Types).
Furthermore it contains examples which help to create a machine project with
winding or tension control functionality.

The following examples are available:


• LCon_ExampleBlocks
Contains a global data DB and program blocks to show how line axis, winder
and sectional drive function is called and triggered the right way.
Furthermore an example program for the use of the Converting Diagnostic
Pages, as well as initialization functions for the configuration of different winder
control modes is available.

• LCon_ExamplePLCTags
Contains global user constants used for array length definition of winder and
sectional drive instances.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 25
3 Integration

• LCon_ExampleWatchtable
This folder contains a watchtable to control the state machines and important
variables.

3.3 Starter – SINAMICS Configuration


If a free telegram is used for communication, this can be automatically configured
for the SINAMICS drives with the script "ScriptDriveConfig_V1.4.1" (S120 / G120 /
DCM).

It is also possible to use the standard telegrams 2 or 3 as well as the additional


telegram 750 for communication. However, it must be taken into account that the
Kp adaptation is no longer possible and no error code can be read from the drive. It
must also be noted that the control word G1_STW is overwritten with 16#0 using
telegram 3. Using the standard telegrams allows communication with the
SINAMICS drives S210 (telegram 3), V90PN (telegram 750 only from TIA version
15.1), DCM (no telegram 750).

3.4 TIA Portal – Hardware part


1. The SINAMICS S120 drive can be integrated from the Hardware Catalog to
© Siemens AG 2019 All rights reserved

Devices & Networks.

Figure 3-3

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 26
3 Integration

2. Afterwards the modules (DO Control Unit, DO infeed, DO Servo, etc.) can be
added.

Figure 3-4
© Siemens AG 2019 All rights reserved

NOTE The order of the DO’s must match with the configuration in STARTER!

3. For the DO Servo either a free telegram PZD-8/8 or a standard telegram 2 or 3


and optionally the additional telegram 750 must be used.
a. Free telegram:
This was configured with the help of the script "ScriptDriveConfig_V1.4.1"
from the chapter Starter – SINAMICS Configuration such a way that this is
based on a standard drive telegram and additionally the torquedata and
the Kp adaptation (for S120) are available.
Figure 3-5

b. Standard telegram:
Use telegram 2 (preferred) or telegram 3 and optionally the additional
telegram 750. With this selection the Kp adaptation and the error code are
not available.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 27
3 Integration

4. The resulting HW address must be copied for interconnection in the software


part

The respective variable containing the HW address can be found and copied
by selecting the telegram → properties → System constants
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 28
4 Example project

4 Example project

The example project is combined in the library sub-folder LCon_ExampleBlocks.


The project is based on a S7-1500 PLC, however the same blocks can be used for
S7-1200 PLCs.

NOTE In case the Converting Toolbox blocks (LCon_Blocks) are used in a S7-1200
PLC, the function LCon_ReadCycleTimeS71500 need to be deleted.
Furthermore the function call of this function in the program OBs LineAxis,
SectionalDrive and Winder need to be changed to
LCon_ReadCycleTimeS71200()!

In the following chapters the content of LCon_ExampleBlocks is described.

LCon_Data
© Siemens AG 2019 All rights reserved

The DB contains all data structures which are used in the program blocks.
The data types are defined in PLC data types.

Init
The Init folder contains functions to configure different winder control modes
(Indirect Tension Control, Dancer Control Speed Setpoint Adaption, etc.).
An example startup OB is used to call these functions once during the change of
the operation mode from STOP to RUN.

ITDiag
This folder contains a DB with the variable for the Converting Diagnostic Pages
and an OB to interconnect those variables with the actual values from the program.

LineAxis
The folder LineAxis contains an OB to control a line axis (master axis). The
program shows the necessary function block calls of the Converting Toolbox. A
state machine shows how to trigger the interface variables.
Several line axes can be realized by duplicating the OB and the data block
instances of the function blocks.

SectionalDrive
The folder SectionalDrive contains an OB to control a sectional drive axis (tension
controlled web transport axis). The program shows the necessary function block

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 29
4 Example project

calls of the Converting Toolbox. A state machine shows how to trigger the interface
variables.
Several sectional drive axes can be realized by duplicating the OB and the data
block instances of the function blocks.

Winder
The folder Winder contains an OB to control a winder axis. The program shows the
necessary function block calls of the Converting Toolbox. A state machine shows
how to trigger the interface variables.
The optional function block calls for friction measurement and the stop condition at
a preset diameter are also part of this program OB.
Several winder axes can be realized by duplicating the OB and the data block
instances of the function blocks or using the Winder_ForLoop example OB from the
library LCon.

MainControl
This folder contains the MainSequence OB.
The OB contains a main state machine which controls all sub module state
machines (line axis, winder, sectional drive).
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 30
5 Functional description

5 Functional description
5.1 General functions
5.1.1 LCon_ReadCycleTimeS71200

Determines the cycle time of calling OB, called in cyclic interrupt task.
This function can be used in S7-1200 PLC.
Function ID: 1001

Schematic LAD representation

ReadCycleTime

INT OBNumber RET_VAL REAL


© Siemens AG 2019 All rights reserved

Input & Output parameters

I/O Variable name Data Initial Description


type value
IN OBNumber INT 30 OB number in which the program is called
OUT RET_VAL REAL - [ms] Cycle time of the OB this function is
called in.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 31
5 Functional description

5.1.2 LCon_ReadCycleTimeS71500

Determines the cycle time of calling OB, called in cyclic interrupt or synchronous
operation task.
This function can be used in S7-1500 PLC.
Function ID: 1001

Schematic LAD representation

ReadCycleTime

INT OBNumber RET_VAL REAL

Input & Output parameters

I/O Variable name Data Initial Description


© Siemens AG 2019 All rights reserved

type value
IN OBNumber INT 30 OB number in which the program is called
OUT RET_VAL REAL - [ms] Cycle time of the OB this function is
called in.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 32
5 Functional description

5.1.3 LCon_Linear

Linear interpolation between two breakpoints.


Function ID: 0001

Schematic LAD representation

Linear

REAL x RET_VAL REAL


REAL x1
REAL y1
REAL x2
REAL y2

Input & Output parameters


© Siemens AG 2019 All rights reserved

I/O Variable name Data type Initial value Description


IN X REAL - Input value
IN X1 REAL - First breakpoint, x value
IN Y1 REAL - First breakpoint, y value
IN X2 REAL - Second breakpoint, x-value
IN Y2 REAL - Second breakpoint, y value
OUT Ret_Val REAL - Output value

Functionality

Using the breakpoints entered, this function determines the matching Y coordinate
of the coordinate present at input x. The interpolated Y coordinate is provided as
return value of the function. The input point x is limited by the coordinates X1 and
X2. If the coordinates X1 and X2 are equal, 0.0 is displayed as return value and no
interpolation is carried-out.

𝑋 − 𝑋1
𝑅𝐸𝑇𝑉𝐴𝐿 = (𝑌 − 𝑌1 ) + 𝑌1
𝑋1 − 𝑋2 2

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 33
5 Functional description

Graphical Representation
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 34
5 Functional description

5.1.4 LCon_TableChar

Interpolation from breakpoint table, the function block can be called in any cyclic
task.
Function block ID: 0106

Schematic LAD Representation

TableChar

BOOL enable error BOOL


REAL x errorID DWORD
INT sizeOfArray y REAL
breakPointTable xn busy BOOL
breakPointTable yn
© Siemens AG 2019 All rights reserved

Input & Output parameters

I/O Variable name Data type Initial Description


value
IN enable BOOL - TRUE – FB activated
FALSE- FB deactivated
IN x REAL 0.0 Input value
IN sizeOfArray INT 20 Length of array used out of max
available
IN xn breakPoint - breakpoint table block with REAL
Table elements
IN yn breakPoint - breakpoint table block with REAL
Table elements
OUT error BOOL False FALSE: No error
TRUE: An error has occurred,
refer to error identification
OUT errorID DWORD 16#0000 Error identification, refer to error
_ messages
0000 errorID < 16#0106_8000 : Warning
errorID >= 16#0106_8000 : Error
OUT y REAL - Output value
OUT busy BOOL FALSE TRUE: FB active
FALSE: FB inactive

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 35
5 Functional description

Functionality

The function blocks adapts the output value y corresponding to the input value x
based on a breakpoint table of flexible size. Between the breakpoints the values
are interpolated linearly.

Purpose of the function block is to e.g.:


• Linear characteristic curves
• Simulation of non-linear transfer elements
• Minimum number of breakpoint elements is two.

The x values of the curve have to increase monotonically; the y values have no
limitation. The total number of breakpoints is defined by the size of the data
reference. The data type of the addressed data area has to be REAL. Is x lower
than the x value of the first coordinate, the output y value will maintain the level of
the y value of the first coordinate. The same applies if x is bigger than the last x
coordinate of the table.

Graphical Representation
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 36
5 Functional description

Warning messages
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000

ErrorID Description
16#0000_0000 No warning
16#0106_4005 The table of entered values are not monotonically(steadily) increasing ->no
matching values found
16#0106_4008 The table of entered values are not monotonically(steadily) increasing -> 2
values are identical

Error messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000

ErrorID Description
16# 0000_0000 No error
16# 0106_8003 Number of array elements too small.
© Siemens AG 2019 All rights reserved

16# 0106_8004 Number of array elements too large


16# 0106_8005 Invalid Configuration data: One or more configuration values are invalid

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 37
5 Functional description

5.1.5 LCon_RFG – Ramp-function generator

RFG with MOP and follow-up operation – without rounding.


The function block has to be called in a cyclic interrupt, e.g. OB30.
Function block ID: 1106

Schematic LAD Representation

LCon_RFG

Real x error Bool

Real nominalValue errorID DWord

Real upperLimit y Real

Real lowerLimit ya Real

Real setValue SetpointReached Bool

Real rampupTime upperLimitReached Bool

Real rampdownTime lowerLimitReached Bool


© Siemens AG 2019 All rights reserved

Int rampTimeMode

Bool set

Bool followup

Bool increase

Bool decrease

Int OBnumber

Real tCycle

Input & Output parameters

I/O Variable name Data Initial Description


type value
IN x REAL 0.0 Input quantity
IN nominalValue REAL 1.0 Normalization value
IN upperLimit REAL 0.0 Upper limit value
IN lowerLimit REAL 0.0 Lower limit value
IN setValue REAL 0.0 Setting value
IN rampUpTime REAL 0.0 [ms] ramp up time [sampling time -
MaxTU(1000)]
IN rampDownTime REAL 0.0 [ms] braking time constant [sampling
time - MaxTD(1000)]
IN rampTimeMode INT 0 Selection how ramp times are selected.
0 =DIFF_TO_ZERO: ramp up: output
value Y moves away from zero; ramp

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 38
5 Functional description

I/O Variable name Data Initial Description


type value
down: output value Y approaches zero.
1=DIFF_OF_CHANGE: ramp up: target
value > start value; ramp down: target
value < start value
IN set BOOL FALSE FALSE: normal Ramp Calculation,
TRUE: activate Set value
IN followup BOOL FALSE FALSE: normal Ramp Calculation,
TRUE: Output value is Input value
IN increase BOOL FALSE FALSE: normal Ramp Calculation,
TRUE: higher
IN decrease BOOL FALSE FALSE: normal Ramp Calculation,
TRUE: lower
IN OBNumber INT 30 Calling Cyclic Interrupt OB number
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
OUT error BOOL FALSE FALSE: No error
TRUE: An error has occurred, refer to
error
identification
OUT errorID DWORD 16#000 Error identification, refer to error
0_0000 messages
errorID<16#1106_8000: Warning
errorID>=16#1106_8000: Error
OUT y REAL 0.0 [X] Output value
© Siemens AG 2019 All rights reserved

OUT ya REAL 0.0 [X/cycle] Output Acceleration Value


OUT SetpointReached BOOL FALSE FALSE: Normal RFG Mode,
TRUE: Output value is Input Value
OUT upperLimitReached BOOL FALSE FALSE: upper limit not reached,
TRUE: upper limit reached
OUT lowerLimitReached BOOL FALSE FALSE: lower limit not reached,
TRUE: lower limit reached

Functionality

The function block includes an integrator with two integration time constants that
can be set independently of one another. Output y changes according to the
following algorithm:
Yn = Yn−1 + YAn
The acceleration value YA are separately calculated for the up ramp and down
ramp. Dependent on the input parameter rampTimeMode, rampUpTime and
rampDownTime will be used differently:

rampTimeMode = DIFF_TO_ZERO:
An up ramp is when the output value y moves away from zero. A down ramp is
when the output value y approaches zero. By this the used ramp time will be
switched if the output y crosses zero.

rampTimeMode = DIFF_OF_CHANGE:

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 39
5 Functional description

An up ramp is when the target value is bigger than the output value y. A down
ramp is when the target value is smaller than the output value y. By this there is no
change between rampUpTime and rampDownTime when the output value y moves
through zero.

For the acceleration value during ramping-up the following applies:


𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒
𝑦𝑎 = ⋅ 𝑛𝑜𝑚𝑖𝑛𝑎𝑙𝑉𝑎𝑙𝑢𝑒 𝑓𝑜𝑟 𝑌 > 0
𝑟𝑎𝑚𝑝𝑢𝑝𝑇𝑖𝑚𝑒
𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒
𝑦𝑎 = − ⋅ 𝑛𝑜𝑚𝑖𝑛𝑎𝑙𝑉𝑎𝑙𝑢𝑒 𝑓𝑜𝑟 𝑌 < 0
𝑟𝑎𝑚𝑝𝑢𝑝𝑇𝑖𝑚𝑒

For the acceleration value when ramping-down the following applies:

𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒
𝑦𝑎 = − ⋅ 𝑛𝑜𝑚𝑖𝑛𝑎𝑙𝑉𝑎𝑙𝑢𝑒 𝑓𝑜𝑟 𝑌 > 0
𝑟𝑎𝑚𝑝𝑢𝑝𝑇𝑖𝑚𝑒
𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒
𝑦𝑎 = ⋅ 𝑛𝑜𝑚𝑖𝑛𝑎𝑙𝑉𝑎𝑙𝑢𝑒 𝑓𝑜𝑟 𝑌 < 0
𝑟𝑎𝑚𝑝𝑢𝑝𝑇𝑖𝑚𝑒

TA is the sampling time in which the function block is processed.The changeover


between ramp-up time and ramp-down time is realized when the direction changes
© Siemens AG 2019 All rights reserved

or at the zero crossover of the transfer function. Depending on the logical states of
control inputs set, followup, increase and decrease, the operating mode is specified
by the control logic. The output quantity can be limited using inputs upperLimit and
lowerLimit. When the set limits are reached, through y, binary outputs
upperLimitReached or lowerLimitReached are set to TRUE. Binary output
setpointReached goes TRUE, if y=x.

Ramp-up time and ramp-down times


The ramp-up time rampupTime is the time in which the absolute value of the output
quantity increases by nominalValue.
The ramp-down rampdownTime is the time in which the absolute value of the
output quantity decreases by nominalValue.
The ramp-up time and ramp-down time can be selected to be different. The lower
TA/rampupTime or TA/rampDownTime, the lower the amplitude change at y from
one sampling instant to the next.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 40
5 Functional description

Priority of the control inputs


For the control inputs, the following sequence of priority applies:

set before followup before increase and decrease

Table 5-1: Function of the control inputs

Priority Control input Description


1 set=1 Setting value setValue is loaded into the integrator, non-
integrating
2 followup=1 Output y integrating to setpoint X, tracking
3 increase=1 Output y integrating torques upperLimit, tracking
4 decrease=1 Output y integrating torques lowerLimit, tracking

Operating modes and control of the ramp-function generator

The combination of commands at the control inputs and the possible operating
modes can be taken from the truth tables.
© Siemens AG 2019 All rights reserved

Standard ramp-function generator operation involves lowerLimit ≤ 0 ≤ upperLimit


and lowerLimit < y n < upperLimit. However, other settings are also possible that
are explained in the following.
For the setting with lowerLimit ≥ upperLimit, the following applies: Limit upperLimit
is dominant with respect to limit lowerLimit.
If output y reaches one of the set limits lowerLimit or upperLimit, during the control
sequence, the integrator value is held. Output value y is then kept constant until
the integrator value leaves the limit due to a change of the input quantities.
If the integrator is at the limit and the limit value is changed the integrator behaves
differently depending on the direction in which the limit value was changed.
If the absolute value of a limit value is increased, and if the control logic specifies
that the ramp-function generator should run in the same direction, then the
integrator integrates from the previously defined value according to the selected
ramp-up time until the output again reaches the limit value.
If the absolute value of a limit value is reduced, the integrator integrates from the
previously held value – according to the selected ramp-down time – until the output
again reaches the limit value.
The integrator operates internally with an increased accuracy so that even for small
setpoint-actual value differences it still integrates. However, it should be carefully
noted that the sampling time is sufficiently low referred to the ramp-up or ramp-
down time. rampupTime and rampdownTime are internally limited:
rampupTime ≥ cycleTime, rampdownTime ≥ cycleTime

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 41
5 Functional description

set follow inc. dec. yan yn Mode Comment


up
0 0 0 0 0 yn+1 Stop Y is constant
1 1 1 1 Step setValuen Sets output setValue is any
to value, fixed or
setValue variable
0 1 1 1 cycleTime/ra yn-1+yan Normal rampupTime for [x
mpupTime; > y ⋀ y ≥ 0] ⋁ [x
cycleTime/ra operation
< y ⋀ y ≤ 0]
mpdownTim y→ x
e rampdownTime for
[x > y ⋀ y < 0] ⋁ [x
< y ⋀ y > 0]
0 0 1 0 cycleTime/ra yn-1+yan Approach the rampupTime,
mpupTime
upper limit rampdownTime as
cycleTime/ra
value before, dependent
mpdownTim
on the starting
e y→upperLimi
(initial) position
t
0 0 0 1 cycleTime/ra yn-1+yan Approach the rampupTime,
mpdownTim
e lower limit rampdownTime as
© Siemens AG 2019 All rights reserved

value before, dependent


cycleTime/ra
mpupTime y→lowerLimit on the starting
(initial) position

Timing Diagram - Motor Potentiometer

increase 1
(IN) 0

1
decrease
0
(IN)
1
rampTimeMode
(IN) 0
upperLimit
100 nominalValue

y
(OUT) 0
rampupTime rampdownTime

-100
lowerLimit

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 42
5 Functional description

Timing Diagram – Normal Operation


© Siemens AG 2019 All rights reserved

Nesting Depth: 4 from the time delay interrupt, time-of-day interrupt, cyclic
NOTE
interrupt, hardware interrupt, time error interrupt, or diagnostic error interrupt OB.
Due to this limitation, the called FB’s are re-written in the calling FB so that the
nesting depth reduces by 1.

Error messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000

ErrorID Description

16# 0000_0000 No error


16# 1106_8005 Function block called in wrong task
16#1106_8002 Invalid configuration:
rampTimeMode < 0
rampTimeMode > 1

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 43
5 Functional description

5.1.6 LCon_RFGJ – Ramp-function generator with rounding-off

Ramp-function generator with ramp-up, ramp-down times and rounding-off


The function block has to be called in a cyclic interrupt, e.g. OB30.
Function block ID: 1107

Schematische KOP / FUP-Darstellung

LCon_RFGJ

Bool run busy Bool

Bool enable error Bool

Bool mode errorID DWord

Bool enableRounding setpointReached Bool

Bool hold setpointZero Bool

Bool zeroRounding accelerating Bool


© Siemens AG 2019 All rights reserved

Real x decelerating Bool

Real nominalValue y Real

Real rampupTime ya Real

Real rampdownTime

Int rampTimeMode

Real fastRampdownTime

Real roundingTime

Int OBnumber

Real tCycle

Input & Output parameters

I/O Variable name Data Initial Description


type value
IN run BOOL FALSE FALSE: Disable FB,
TRUE: enable FB
IN enable BOOL FALSE FALSE: Disable RFG, TRUE: enable RFG
IN mode BOOL TRUE FALSE: Emergency stop(Fast stop ramp),
TRUE: Normal operation
IN enableRounding BOOL TRUE FALSE: Disable Rounding, TRUE: enable
Rounding
IN hold BOOL TRUE FALSE: No effect,
TRUE: Hold actual speed (with jerklimit!)
IN zeroRounding BOOL FALSE FALSE: Disable Rounding at crossing 0.0,
TRUE: enable Rounding at crossing 0.0
IN x REAL 0.0 Setpoint

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 44
5 Functional description

I/O Variable name Data Initial Description


type value
IN nominalValue REAL 1000.0 Normalization value
IN rampupTime REAL 1.0 [s] ramp up time [sampling time -
MaxTU(1000)]
IN rampdownTime REAL 1.0 [s] braking time constant [sampling time -
MaxTD(1000)]
IN rampTimeMode INT 0 Selection how ramp times are selected.
0 =DIFF_TO_ZERO: ramp up: output value Y
moves away from zero; ramp down: output
value Y approaches zero.
1=DIFF_OF_CHANGE: ramp up: target value
> start value; ramp down: target value < start
value
IN fastRampdownTime REAL 0.1 [sec] Emergency Ramp-down time
IN roundingTime REAL 0.5 [sec]Rounding time
IN OBNumber INT 30 Calling Cyclic interrupt OB number
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
OUT busy BOOL FALSE FALSE: Functionblock is available
TRUE: Functionblock is busy
OUT error BOOL FALSE FALSE: No error
TRUE: An error has occurred, refer to error
identification
© Siemens AG 2019 All rights reserved

OUT errorID DWORD 16#0000 Error identification, refer to error messages


_0000 errorID<16#1107_8000: Warning
errorID>=16#1107_8000: Error
OUT setpointReached BOOL FALSE FALSE: Setpoint not reached
TRUE: Setpoint reached
OUT setpointZero BOOL FALSE FALSE: Output value <> 0, TRUE: Output
Value = 0
OUT accelerating BOOL FALSE FALSE: not Accelerating,
TRUE: Accelerating
OUT decelerating BOOL FALSE FALSE: not Decelerating, TRUE: Decelerating
OUT y REAL 0.0 [Output of calucated Value
OUT ya REAL 0.0 Actual Acceleration/deceleration value[change
rate] [ /sec]

Functionality

The function block is active with the input run at TRUE and the calculation can be
started or stopped with input enable. Depending on the parameterization of the
inputs, a ramp function is calculated. Various options can be set by selecting the
inputs. If mode is at False, the ramp is braked using a special entered deceleration
time (fastRampdownTime) and without jerk limiting. This means that the ramp can
be effectively decelerated for an Emergency Stop – this is also possible while
accelerating. If mode is at True, then the drive is braked normally with the entered
deceleration time (rampdownTime). The acceleration is always calculated with the
entered acceleration time (rampupTime) independent of mode.
Dependent on the input parameter rampTimeMode, rampUpTime and
rampDownTime will be used differently:

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 45
5 Functional description

rampTimeMode = DIFF_TO_ZERO:
An up ramp is when the output value y moves away from zero. A down ramp is
when the output value y approaches zero. By this the used ramp time will be
switched if the output y crosses zero.

NOTE In case of rampTimeMode=DIFF_TO_ZERO the zero-crossing is always


rounded if the values for rampUpTime and rampDownTime are different.

rampTimeMode = DIFF_OF_CHANGE:
An up ramp is when the target value is bigger than the output value y. A down
ramp is when the target value is smaller than the output value y. By this there is no
change between rampUpTime and rampDownTime when the output value y moves
through zero.

In order to reach the setpoint (x), the appropriate interval values are output (at y)
and the actual change rate is output (at ya). If input enableRounding is set to
TRUE, the ramp is calculated with jerk limiting. The rounding-off is determined by
the rounding-off time (roundingTime). The zero crossing (when the input x changes
direction) can be parameterized with or without rounding. As soon as the output
value is zero this is displayed using the setpointZero output. Further, when
© Siemens AG 2019 All rights reserved

accelerating output acceleration is set, when decelerating, output deceleration is


set and for a constant value setpointReached is set. If the block is in the enable
mode, then output busy is set to TRUE. If the hold input is set to TRUE, the ramp-
function generator is stopped (held) and the actual acceleration is ramped-down to
zero. As long as hold is TRUE, setpoint x is ignored and output ya is set to zero.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 46
5 Functional description

Normal operation with rounding


© Siemens AG 2019 All rights reserved

With and without zero rounding

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 47
5 Functional description

Using different rampTimeModes

100
x
(IN)
0

-100

rampTimeMode 1
(IN)
0

100
y
(OUT) 0

-100

ya
(OUT)
0
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 48
5 Functional description

Operation with fast stop mode


© Siemens AG 2019 All rights reserved

Nesting Depth : 4 from the time delay interrupt, time-of-day interrupt, cyclic
NOTE
interrupt, hardware interrupt, time error interrupt, or diagnostic error interrupt OB.
Due to this limitation, the called FB’s are re-written in the calling FB so that the
nesting depth reduces by 1.

Error messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000

Error ID Description
16# 0000_0000 No error
16# 1107_8001 Function block called in Wrong task
16# 1107_8005 Invalid Configuration data:
nominalValue = 0
rampTimeMode > 1
rampTimeMode < 0

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 49
5 Functional description

5.1.7 LCon_CalcStopDistance

This function calculates the distance remaining for braking and associated time to
ramp down to zero the Unwinder as per the ramp down time, depending upon the
given speed and acceleration.
Function block ID: 0005

Schematic LAD Representation

CalcStopDistance

REAL velocity error BOOL


REAL acceleration errorID DWORD
REAL maxvelocity StopDistance REAL
REAL rampUpTime StopTime REAL
REAL rampDownTime
REAL roundingTime
© Siemens AG 2019 All rights reserved

Input & Output parameters

I/O Variable name Data Initial Description


type value
IN velocity REAL - [LU/min] Actual velocity
IN acceleration REAL - [LU/s2] Actual Acceleration/deceleration
IN maxVelocity REAL - [LU/min] Max velocity
IN rampUpTime REAL - [s] Ramp-up time
IN rampDownTime REAL - [s] Ramp-down time
IN roundingTime REAL - [s] Rounding time
OUT error BOOL - False: No Error,
True: Error occured
OUT errorID DWORD - Error identification
errorID<16#0005_8000: Warning
errorID>=16#0005_8000: Error
OUT StopDistance REAL - [LU] Distance to Stop
OUT StopTime REAL - [s] Time to Stop

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 50
5 Functional description

Functionality
The function calculates the braking time and braking distance taking the actual
motion vector of a drive (velocity, acceleration) as well as the specification of
dynamics (maxVelocity, rampUpTime, rampdownTime, roundingTime) into
account. The length unit of the calculation corresponds to the unit used as input for
the lineSpeed input. The units of the inputs have to be consistent as described.
With roundingTime = 0.0 the rounding (jerk limiting, smoothing) is deactivated

Error messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000

Error ID Description
16#0000_0000 No error
16#0005_8005 Invalid Configuration data
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 51
5 Functional description

5.1.8 LCon_ModuloIEC

This function calculates the modulo division for an input value oft he data type
LREAL.
Function block ID: 000C

Schematic LAD Representation

LCon_ModuloIEC

LReal value LCon_ModuloIEC LReal

LReal moduloValue

Input & Output parameters

Name P-Typ Data type Description


value IN LReal Input value for modulo division
© Siemens AG 2019 All rights reserved

moduloValue IN LReal Modulo value


LCon_ModuloIEC OUT LReal Return value of modulo division

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 52
5 Functional description

Functionality
Definition of the return value
• Positive input value -> positive return value
• Negative input value -> negative return value

The following example describes the functionality of the function:

Value moduloValue LCon_ModuloIEC


180 360 180
362 360 2
-180 360 -180
-362 360 -2
180 0 0

Error messages
© Siemens AG 2019 All rights reserved

The block does not generate any error messages.


If the input parameters are incorrect (moduloValue = 0.0) the return value of the
function is zero.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 53
5 Functional description

5.2 Logical functions


5.2.1 LCon_TRIG

Rising & falling edge detection.


Function block ID: 0103

Schematic LAD Representation

TRIG

BOOL CLK QF BOOL


QR BOOL

Input & Output parameters


© Siemens AG 2019 All rights reserved

I/O Variable name Data Initial Description


type value
IN CLK BOOL FALSE FALSE: QF=TRUE FOR 1 scan on falling edge,
TRUE: QR=TRUE FOR 1 scan on rising edge.
OUT QF BOOL FALSE One pulse signal, when falling edge is detected
OUT QR BOOL FALSE One pulse signal, when rising edge is detected

Functionality
The function block outputs a true signal for a falling & rising edge is detected on
the input signal (CLK). The duration of the output signal is one cycle.

Timing diagram

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 54
5 Functional description

5.3 Scaling function blocks


5.3.1 LCon_ScalingDWDRL

Conversion and scaling of DWORD values into REAL values.


Function ID: 0006

Schematic LAD Representation

ScalingDWDRL

DWORD x RET_VAL REAL


REAL maxValue
REAL base
© Siemens AG 2019 All rights reserved

Input & Output parameters

I/O Variable name Data type Initial Description


value
IN x DWORD - Input value in DWORD format
IN maxValue REAL - Maximum Value for scaling input
IN base REAL - Normalisation Value[Ret_val=0 if
base=0]
OUT Ret_Val REAL - Output value in REAL format
[ −2 ⋅ maxValue − 2 ⋅ maxValue]

Functionality

The function converts a DWORD input (x) using a normalization value (base) and
the maximum reference value (maxValue) into a REAL value. The output value is
limited to −2 ⋅ maxValue − 2 ⋅ maxValue. The DWORD value will be converted to
DINT value and afterwards to REAL value.

𝑥
𝑅𝐸𝑇_𝑉𝐴𝐿 = ⋅ 𝑚𝑎𝑥𝑉𝑎𝑙𝑢𝑒
𝑏𝑎𝑠𝑒

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 55
5 Functional description

5.3.2 LCon_ScalingRLDWD

Conversion and scaling of REAL values into DWORD values


The function can be called in any task.
Function ID: 0007

Schematic LAD Representation

ScalingRLDWD

REAL x RET_VAL DWORD


REAL maxValue
REAL base
© Siemens AG 2019 All rights reserved

Input & Output parameters

I/O Variable name Data type Initial Description


value
IN x DWORD - Input value in REAL format
IN maxValue REAL - Maximum Value for scaling input
IN base REAL - Normalisation Value[Ret_val=0 if
base=0]
OUT Ret_Val REAL - Output value as WORD

Functionality

The function converts a REAL value (x) into a DWORD using a normalization value
(base) and the maximum reference value (maxValue). The input value x is limited
to the values: −2 ⋅ maxValue − 2 ⋅ maxValue

𝑥
𝑅𝐸𝑇_𝑉𝐴𝐿 = ⋅ 𝑏𝑎𝑠𝑒
𝑚𝑎𝑥𝑉𝑎𝑙𝑢𝑒

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 56
5 Functional description

5.3.3 LCon_ScalingWDRL

Conversion and scaling of WORD values into REAL values.


The function can be called in any task.
Functin ID: 0008

Schematic LAD Representation:

ScalingWDRL

WORD x RET_VAL REAL


REAL maxValue
REAL base

Input & Output parameters


© Siemens AG 2019 All rights reserved

I/O Variable name Data Initial Description


type value
IN x WORD - Input value in WORD format
IN maxValue REAL - Maximum Value for scaling input
IN base REAL - Normalisation Value[Ret_val=0 if base=0]
OUT Ret_Val REAL - Output value in REAL format

Functionality

This function converts a WORD value (x) into a REAL value using a normalization
value
(base) and the maximum reference value (maxValue). The output value is limited
between the values −2 ⋅ maxValue − 2 ⋅ maxValue. The WORD value will be
converted to INT value and afterwards to REAL value.

𝑥
𝑅𝐸𝑇_𝑉𝐴𝐿 = ⋅ 𝑚𝑎𝑥𝑉𝑎𝑙𝑢𝑒
𝑏𝑎𝑠𝑒

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 57
5 Functional description

5.3.4 LCon_ScalingRLWD

Conversion and scaling of REAL values into WORD values


The function can be called in any task.
Function ID: 0009

Schematic LAD Representation

ScalingRLWD

REAL x RET_VAL WORD


REAL maxValue
REAL base
© Siemens AG 2019 All rights reserved

Input & Output parameters

I/O Variable name Data Initial Description


type value
IN x REAL - Input value in REAL format
IN maxValue REAL - Maximum Value for scaling input
IN base REAL - Normalisation Value[Ret_val=0 if base=0]
OUT Ret_Val WORD - Output value in WORD format

Functionality

This function converts a REAL value (x) into a WORD value using a normalization
value (base) and the maximum reference value (maxValue). The input value x is
limited between the values −2 ⋅ maxValue − 2 ⋅ maxValue.

𝑥
𝑅𝐸𝑇_𝑉𝐴𝐿 = ⋅ 𝑏𝑎𝑠𝑒
𝑚𝑎𝑥𝑉𝑎𝑙𝑢𝑒

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 58
5 Functional description

5.3.5 LCon_Scaling

Scaling of a value in REAL format


The function can be called in any task.
Functin ID: 000A

Schematic LAD Representation

Scaling

REAL x RET_VAL REAL


REAL maxValue
REAL base
© Siemens AG 2019 All rights reserved

Input & Output parameters

I/O Variable name Data Initial Description


type value
IN x REAL - Input value in REAL format
IN maxValue REAL - Maximum Value for scaling input
IN base REAL - Normalisation Value[Ret_val=0 if base=0]
OUT Ret_Val REAL - Output value in REAL format

Functionality

This function scales an input value (x) using a normalization value (base) and the
maximum reference value (maxValue).

𝑥
𝑅𝐸𝑇_𝑉𝐴𝐿 = ⋅ 𝑚𝑎𝑥𝑉𝑎𝑙𝑢𝑒
𝑏𝑎𝑠𝑒

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 59
5 Functional description

5.4 Closed-Loop function blocks


5.4.1 LCon_PT1

Low-pass filter function block, the function block has to be called in a cyclic
interrupt, e.g. OB30.
Function block ID: 1101

Schematic LAD Representation

PT1

BOOL set error BOOL


REAL x errorID DWORD
REAL setvalue y REAL

REAL smoothingTime
© Siemens AG 2019 All rights reserved

INT OBnumber
REAL tCycle

Input & Output parameters

I/O Variable name Data type Initial Description


value
IN set BOOL FALSE FALSE: FB is working as PT1 Filter,
TRUE: setvalue is set as Output Value
IN x REAL 0.0 Input Value
IN setvalue REAL 0.0 Set Value
IN smoothingTime REAL 100.0 [ms] Smoothing Time Constant [Cycle
Time - 5000]
IN OBnumber INT 30 Calling Cyclic interrupt OB No.
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
OUT error BOOL FALSE FALSE: no Error
TRUE: Error occured
OUT errorID DWORD 16#0000 Error identification
_0000 errorID<16#1101_8000 : Warning
errorID>=16#1101_8000 : Error
OUT y REAL 0.0 Filtered Output value

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 60
5 Functional description

Functionality

This input value x is filtered using the time constant smoothingTime and output at
the output y. To precisely calculate the internal steps, the sampling time in which
the block is processed is internally determined. Further, it is possible to
permanently set the output to the value of the input (setValue) by setting the input
(set).
In order to generate a hold, output y should be connected to the input setValue.
This means that when setting set to TRUE, the output value is maintained until set
is again set to FALSE.
If the time constant is set to zero, the filter is de-activated and the output value is
equal to the input value. 63% of the input value is reached at the output after the
time constant.
95% of the input value is reached at the output after three times of the time
constant. For an appropriately high smoothingTime / cycleTime (smoothingTime /
cycleTime > 10) the transfer function corresponds to the following characteristic:

𝑡

𝑌(𝑡) = 𝑋 ⋅ (1 − 𝑒 𝑠𝑚𝑜𝑜𝑡ℎ𝑖𝑛𝑔𝑡𝑖𝑚𝑒 ) 𝑤𝑖𝑡ℎ 𝑡 = 𝑛 ⋅ (𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒)
© Siemens AG 2019 All rights reserved

The discrete values are calculated using the following algorithm:

𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒
𝑌𝑛 = 𝑌𝑛−1 + ⋅ (𝑋𝑛 − 𝑌𝑛−1 )
𝑠𝑚𝑜𝑜𝑡ℎ𝑖𝑛𝑔𝑡𝑖𝑚𝑒

Timing Diagram

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 61
5 Functional description

Nesting Depth : 4 from the time delay interrupt, time-of-day interrupt, cyclic
NOTE
interrupt, hardware interrupt, time error interrupt, or diagnostic error interrupt OB.
Due to this limitation, the called FB’s are re-written in the calling FB so that the
nesting depth reduces by 1.

Error messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

Error ID Description
16#0000_0000 No error
16#1101_8001 Function called in Wrong task
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 62
5 Functional description

5.4.2 LCon_ReadAnalogInput

Analog input evaluation with PT1 filter, has to be called in cyclic interrupt task i.e.
OB30.
Function block ID: 1109

Schematic LAD Representation:

ReadAnalogInput

BOOL set error BOOL


WORD x errorID DWORD
REAL maxValue y REAL

REAL base

REAL setValue

REAL smoothingTime
© Siemens AG 2019 All rights reserved

INT OBnumber
REAL tCycle

Input & Output parameters

I/O Variable name Data Initial Description


type value
IN set BOOL FASLE FALSE: FB is working as PT1 Filter,
TRUE: setvalue is set as Output Value
IN x WORD - Input Value for Converting
IN maxValue REAL - Maximum Value for Output
IN base REAL 16384.0 Value Base for word to real conversion
IN setValue REAL 0.0 Set Value
IN smoothingTime REAL 100.0 [ms] Smoothing Time Constant [Cycle
Time - 5000]
IN OBnumber INT 30 Calling Cyclic interrupt OB No.
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
OUT error BOOL FALSE FALSE: no Error
TRUE: Error occured
OUT errorID DWOR 16#0000 Error identification
D _0000 errorID<16#1109_8000 : Warning
errorID>=16#1109_8000 : Error
OUT y REAL 0.0 Filtered Output value

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 63
5 Functional description

Functionality

This function converts an analog input signal in WORD format (x) into a REAL
value using a normalization value (base) and the maximum reference value
(maxValue). The output value is limited between the values -2⋅maxValue -
2⋅maxValue. The WORD value will be converted to INT value and afterwards to
REAL value.

𝑥
𝑦= ⋅ 𝑚𝑎𝑥𝑉𝑎𝑙𝑢𝑒
𝑏𝑎𝑠𝑒

Optionally the analog value can be filtered with a settable PT1-filter using the filter
time smoothingTime. If the input parameter smoothingTime = 0, the filter is
disabled. The internal limit for the filter time is 5000 ms. The functionality is
basically a combination of the ScalingWDRL function and the PT1 function block.

Error messages
Error messages are indicated by the status of the outputs error and errorID: error =
© Siemens AG 2019 All rights reserved

TRUE and errorID <> 16#0000_0000.

Error ID Description
16#1109_8001 Function called in wrong task
16#1109_8005 Invalid Configuration data

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 64
5 Functional description

5.4.3 LCon_Differentiator

Numerical differentiator function block has to be called in a cyclic interrupt, e.g.


OB30.
Function block ID: 1103

Schematic LAD Representation

Differentiator

REAL x error BOOL


REAL diffTime errorID DWORD

INT OBnumber y REAL


REAL tCycle

Input & Output parameters


© Siemens AG 2019 All rights reserved

I/O Variable name Data type Initial Description


value
IN x REAL 0.0 Input Value
IN diffTime REAL 0.0 [ ms ] Differentiating time constant
IN OBnumber INT 30 Calling Cyclic interrupt OB No.
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
OUT error BOOL FALSE FALSE: No error
TRUE: An error has occurred, refer to
error identification
OUT errorID DWORD 16#000 Error identification, refer to error
0_0000 messages
errorID < 16#1103_8000: Warning
errorID >= 16#1103_8000: Error
OUT y REAL 0.0 Output value

Functionality

The output value y changes as a function of the rate of change of input value x,
multiplied by the differential time constant diffTime.
The input diffTime is internally limited: cycleTime ≤ diffTime ≤ 1000
Discrete values are calculated using the following algorithm:

𝑑𝑖𝑓𝑓𝑡𝑖𝑚𝑒
𝑌𝑛 = (𝑋𝑛 − 𝑋𝑛−1 ) ⋅
𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 65
5 Functional description

Error messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

Error ID Description
16#0000_0000 No error
16#1103_8001 Function block not called in a cyclic interrupt i.e. OB30
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 66
5 Functional description

5.4.4 LCon_Integrator

Numerical integrator function block has to be called in a cyclic interrupt, e.g. OB30.
Function block ID: 1102

Schematic LAD Representation

Integrator

BOOL set error BOOL


REAL x errorID DWORD
REAL setValue y REAL
REAL upperLimit upperLimitReached BOOL
REAL lowerLimit lowerLimitReached BOOL
REAL integralTime
INT OBNumber
REAL tCycle
© Siemens AG 2019 All rights reserved

Input & Output parameters

I/O Variable name Data type Initial Description


value
IN set BOOL FALSE FALSE: Normal integrator function
TRUE: Output is setValue
IN x REAL 0.0 Input Value
IN setValue REAL 0.0 SetValue for setting function with set =
TRUE
IN upperLimit REAL 1.0 Upper integration limit
IN lowerLimit REAL 0.0 Lower integration limit
IN integralTime REAL 5.0 [ ms ] Integration time Ti
IN OBnumber INT 30 Calling Cyclic interrupt OB No.
IN tCyle REAL 0.0 [ms] Cycle time the FB is called
OUT error BOOL FALSE FALSE: No error
TRUE: An error has occurred, refer to
error
identification
OUT errorID DWORD 16#0000 Error identification, refer to error
_0000 messages
errorID < 16#1102_8000: Warning
errorID >= 16#1102_8000:Error
OUT y REAL 0.0 Output value
OUT upperLimitReached BOOL FALSE FALSE: Upper limit not reached
TRUE: Upper limit reached
OUT lowerLimitReached BOOL FALSE FALSE: Lower limit not reached
TRUE: Lower limit reached

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 67
5 Functional description

Functionality
The function block integrates the input value x with integration time integralTime.
The result is output at y. The integrator is limited by the upper limit upperLimit and
the lower limit lowerLimit. If the integrator reaches one of the limits, then this is
connected to the output.
Further, when the particular limit at the output is reached, this is indicated using
upperLimitReached and lowerLimitReached. Using the setting function, which is
activated with set =True, the output can be set to a pre-defined value (setValue). If
‘set’ input is FALSE, then starting from the set value the integrator continues to
integrate in the direction specified using input value x.
The input integralTime is internally limited: cycleTime ≤ integralTime ≤ 60000

The discrete values are calculated using the following algorithm:

𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒
𝑌𝑛 = 𝑌𝑛−1 + ⋅𝑋
𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑙𝑡𝑖𝑚𝑒 𝑛

Truth Table for lowerlimit < upperlimit


© Siemens AG 2019 All rights reserved

Set Condition Y Upper Limit Lower Limit Mode


reached reached
0 lowerLimit < 𝑌𝑛 0 0 Integrating
𝑌𝑛−1 + 𝑥
𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒

𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑡𝑖𝑜𝑛𝑡𝑖𝑚𝑒
< upperLimit
0 𝑌𝑛−1 + 𝑥 Upper limit 1 0 Integrator at
𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒 the

𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑡𝑖𝑜𝑛𝑡𝑖𝑚𝑒 upper limit
=> upperLimit
0 𝑌𝑛−1 + 𝑥 Lower limit 0 1 Integrator at
𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒 the lower

𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑡𝑖𝑜𝑛𝑡𝑖𝑚𝑒 limit
=< lowerLimit
1 lowerLimit < setValue < set 0 0 Setting
upperLimit Valuen
1 setValue >= upperLimit upper 1 0 Integrator at
Limit the
upper limit
1 setValue =< lowerLimit lower Limit 0 1 Integrator at
the lower
limit

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 68
5 Functional description

Truth table for lowerLimit > upperLimit

Set Condition Y Upper Lower Mode


Limit Limit
reached reached
any lowerLimit < 𝑌𝑛 0 0 Integrator limited by
𝑌𝑛−1 + 𝑥 upper Limit
𝑐𝑦𝑐𝑙𝑒𝑡𝑖𝑚𝑒

𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑡𝑖𝑜𝑛𝑡𝑖𝑚𝑒
< upperLimit

Timing diagram
© Siemens AG 2019 All rights reserved

Nesting Depth : 4 from the time delay interrupt, time-of-day interrupt, cyclic
NOTE
interrupt, hardware interrupt, time error interrupt, or diagnostic error interrupt OB.
Due to this limitation, the called FB’s are re-written in the calling FB so that the
nesting depth reduces by 1.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 69
5 Functional description

Error messages
Error messages are indicated by the status of the outputs error and errorID:
error = TRUE and errorID <> 16#0000_0000.

Error ID Description
16#0000_0000 No error
16#1102_8001 Function block not called in a cyclic interrupt i.e. OB30
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 70
5 Functional description

5.4.5 LCon_DT1

DT1-filter
The function block has to be called in a cyclic interrupt, e.g. OB30.
Function block ID: 1104

Schematic LAD Representation

DT1

BOOL set error BOOL


REAL x errorID DWORD
REAL setvalue y REAL

REAL smoothingTime ypt REAL

REAL diffTime
© Siemens AG 2019 All rights reserved

INT OBnumber

Input & Output parameters

I/O Variable name Data Initial Description


type value
IN set BOOL FALSE FALSE: FB is working as DT1 Filter,
TRUE: setvalue is set as Output Value
IN x REAL 0.0 Input Value
IN setvalue REAL 0.0 Setting Value
IN smoothingTime REAL 0.0 [ms] Smoothing Time Constant [Cycle Time -
5000]
IN diffTime REAL 0.0 [ ms ] Differentiating time constant
IN OBnumber INT 30 Calling Cyclic interrupt OB No.
OUT error BOOL FALSE FALSE: no Error
TRUE: Error occured
OUT errorID DWORD 16#0000 Error identification
_0000 errorID < 16#1104_8000: warning
errorID >= 16#1104_8000: error
OUT y REAL 0.0 Output value
OUT ypt REAL 0.0 Output value of the smoothing element

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 71
5 Functional description

Functionality

Input value x is dynamically delayed and the smoothing time constant


smoothingTime is entered at a differentiating element and at block output YPT. The
output value y of the complete DT1 element is proportional to the change rate of
ypt multiplied with differential time constant diffTime. The input diffTime is internally
limited: cycleTime ≤ diffTime ≤1000. The input smoothingTime defines the gradient
of the down ramp of the output value. This specifies the time after which the
transfer function – after smoothing and differentiation – has dropped to 37% of x-
diffTime/ smoothingTime. For a sufficiently high smoothingTime/cycleTime
(smoothingTime /cycleTime > 10), the transfer function corresponds to a
characteristic of:

𝑑𝑖𝑓𝑓𝑇𝑖𝑚𝑒
𝑌(𝑡) = 𝑥 ( ) ⋅ 𝑒 −𝑡/𝑠𝑚𝑜𝑜𝑡ℎ𝑖𝑛𝑔𝑇𝑖𝑚𝑒 where t=n(cycleTime)
𝑠𝑚𝑜𝑜𝑡ℎ𝑖𝑛𝑔𝑇𝑖𝑚𝑒

The input smoothingTime is internally limited: cycleTime ≤ smoothingTime ≤ 5000.


The discrete values are calculated using the algorithm:

𝑑𝑖𝑓𝑓𝑇𝑖𝑚𝑒
𝑌1𝑛 = ⋅ (𝑥𝑛 − 𝑌𝑃𝑇𝑛−1 )
𝑠𝑚𝑜𝑜𝑡ℎ𝑖𝑛𝑔𝑇𝑖𝑚𝑒
© Siemens AG 2019 All rights reserved

𝑐𝑦𝑐𝑙𝑒𝑇𝑖𝑚𝑒
𝑌𝑃𝑇𝑛 = 𝑌𝑃𝑇𝑛−1 ⋅ (𝑥𝑛 − 𝑌𝑃𝑇𝑛−1 )
𝑠𝑚𝑜𝑜𝑡ℎ𝑖𝑛𝑔𝑇𝑖𝑚𝑒

The higher smoothingTime/cycleTime, the lower the amplitude changes at y and at


ypt from one sampling instant to the next.
The higher the diffTime/cycleTime, the higher the amplitude changes at y from one
sampling instant to the next.

Setting function
When the setting function is active, setting value setValue is transferred to output y;
the output of the smoothing element is obtained as follows:

𝑠𝑚𝑜𝑜𝑡ℎ𝑖𝑛𝑔𝑇𝑖𝑚𝑒
𝑌𝑃𝑇𝑛 = 𝑥𝑛 − ⋅ 𝑠𝑒𝑡𝑉𝑎𝑙𝑢𝑒𝑛 𝑓𝑜𝑟 𝑑𝑖𝑓𝑓𝑇𝑖𝑚𝑒 ≠ 0
𝑑𝑖𝑓𝑓𝑇𝑖𝑚𝑒

In this case, the internal limits for smoothingTime and diffTime apply. For diffTime
= 0, the output values remain unchanged as long as set = TRUE.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 72
5 Functional description

Graphic representation

Error messages
Error messages are indicated by the status of the outputs error and errorID:
error = TRUE and errorID <> 16#0000_0000.
© Siemens AG 2019 All rights reserved

Error ID Description
16#0000_0000 No error
16#1104_8001 Function block not called in a cyclic interrupt i.e. OB30

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 73
5 Functional description

5.4.6 LCon_Limiter

Limiting the input value between specified limits, the function can be called in any
task.
Function block ID: 0004

Schematic LAD Representation:


Limiter

REAL x RET_VAL REAL


REAL UPPER_LIMIT UPPER_LIMIT_REACHED BOOL
REAL LOWER_LIMIT LOWER_LIMIT_REACHED BOOL

Input & Output parameters:

I/O Variable name Data Initial Description


© Siemens AG 2019 All rights reserved

type value
IN x REAL - Input Value
IN UPPER_LIMIT REAL - Input for specifying upper limit
IN LOWER_LIMIT REAL - Input for specifying lowerlimit
OUT RET_VAL REAL - Output value
OUT UPPER_LIMIT_REACHED BOOL - FALSE: Upper limit not reached
TRUE: Upper limit reached
OUT LOWER_LIMIT_REACHED BOOL - FALSE: Lower limit not reached
TRUE: Lower limit reached

Functionality
The function block transfers the input value x to its return value. The input value is
limited dependent on the input parameters upperLimit and lowerLimit.
If the input quantity reaches upper limit upperLimit, output upperLimitReached is
set to
TRUE.
If the input quantity reaches lower limit value lowerLimit, output lowerLimitReached
is set to TRUE.
If the lower limit value is greater or equal to the upper limit value, output y is set to
the upper limit value upperLimit.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 74
5 Functional description

Timing diagram
© Siemens AG 2019 All rights reserved

Error messages
If upperLimitReached and lowerLimitReached are both at TRUE, the lower limit is
greater than upper limit.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 75
5 Functional description

5.4.7 LCon_LevelControl

Limit value monitor


The function block can be called in any cyclic task.
Function block ID: 0104

Schematic LAD Representation:

LevelControl

BOOL run busy BOOL


REAL x alarmUpperLimit BOOL
REAL alarmHigh warningUpperLimit BOOL
REAL warningHigh waningLowerLimit BOOL
REAL warningLow alarmLowerLimit BOOL
INT alarmLow
REAL hyst
© Siemens AG 2019 All rights reserved

TIME delayTime

Input & Output parameters


I/O Variable name Data Initial Description
type value
IN run BOOL FALSE TRUE: Enable function block
FALSE: Disable function block
IN x REAL 0.0 Input Value
IN alarmHigh REAL 100.0 Alarm, upper limit value
IN warningHigh REAL 80.0 Warning, upper limit value
IN warningLow REAL -80.0 Warning, lower limit value
IN alarmLow REAL -100.0 Alarm, lower limit value
IN hyst REAL 0.0 Hysteresis:
This value is taken into account as an
absolute value.
IN delayTime TIME T#3S [ s ] Output delay time
delayTime = 0, signal delay is disabled
OUT busy BOOL FALSE TRUE: Function block is disabled
FALSE: Function block is enabled
OUT alarmUpper BOOL FALSE TRUE: Upper alarm limit value exceeded
Limit FALSE: Upper alarm limit value not
exceeded
OUT warningUpperLimit BOOL FALSE TRUE: upper warn limit value exceeded
FALSE: upper warn limit value not
exceeded

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 76
5 Functional description

I/O Variable name Data Initial Description


type value
OUT warningLower BOOL FALSE TRUE: Lower warn limit value exceeded
Limit FALSE: Lower warn limit value not
exceeded
OUT AlarmLower BOOL FALSE TRUE: Lower alarm limit value exceeded
Limit FALSE: Lower alarm limit value not
exceeded

Functionality
This function block monitors an input value (x) to identify whether it violates
(exceeds, falls below) parameterized limit values as long as it is active with run =
TRUE. If the block is enabled, then this can be identified using the busy output.
When the warningHigh value is exceeded, output warningUpperLimit is set after
the delayTime. The same applies when the alarmHigh value is exceeded with the
associated output alarmUpperLimit. If the input value drops below the limit value
warningHigh or alarmHigh minus the hysteresis value (hyst), the particular output is
reset. The same applies for the lower limit monitoring with the limits warningLow
and alarmLow as well as the associated outputs warningLowerLimit and
alarmLowerLimit. However, in this case, the hysteresis (hyst) is added to the limit
© Siemens AG 2019 All rights reserved

value.
Warnings are not reset as a result of alarms.

Timing diagram

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 77
5 Functional description

5.4.8 LCon_DeadBand

Dead band filter


The function can be called in any task.
Function ID: 0002

Schematic LAD Representation

DeadBand

REAL x RET_VAL REAL


REAL bandborder

Input & Output parameters


© Siemens AG 2019 All rights reserved

I/O Variable name Data type Initial value Description


IN x REAL - Input value
IN bandborder REAL - Border for deadband
OUT Ret_Val REAL - Output value

Functionality
If the input value (x) is located in the dead band range (-bandBorder < x <
+bandBorder), the output value is set to zero. However, if it is at or below (–
bandBorder) the output will be x – bandBorder. If the input value is at or above
+bandBorder, x + bandBorder is set as output value. The dead band – symmetrical
around the zero point – can be set using the bandBorder parameter.

x + bandBorder for x <= -bandBorder


0 for -bandBorder < x < +bandBorder
x – bandBorder for x >= +bandBorder

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 78
5 Functional description

Graphical representation

y
(OUT)

x
bandBorder (IN)
(IN)
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 79
5 Functional description

5.4.9 LCon_DeadZone

Dead zone filter


The function can be called in any task.
Function ID: 0003

Schematic LAD Representation

DeadZone

REAL x RET_VAL REAL


REAL zoneborder

Input & Output parameters


© Siemens AG 2019 All rights reserved

I/O Variable name Data type Initial value Description


IN x REAL - Input value
IN zoneborder REAL - Limit value for deadzone
OUT Ret_Val REAL - Output value

Functionality
If the input value (x) lies in the range of the dead zone (-zoneBorder < x < +
zoneBorder), the output value is set to zero. If the input value lies at / below (–
zoneBorder) or at / above +zoneBorder, input x is the output value. The dead zone
– symmetrical around the zero point – can be set using the value zoneBorder.

x for x<=-zoneborder
0 for -zoneBorder < x < +zoneBorder
x for x>=+zoneborder

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 80
5 Functional description

Graphical representation
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 81
5 Functional description

5.4.10 LCon_AverageValue

Average value filter


The function block must be called in a cyclic task.
Function block ID: 0105

Schematic LAD Representation

AverageValue

BOOL enable busy BOOL


REAL x error BOOL
INT sizeOfArray errorID DWORD
BOOL reset averageValue REAL
maxValueReached BOOL
© Siemens AG 2019 All rights reserved

Input & Output parameters

I/O Variable name Data type Initial Description


value
IN enable BOOL FALSE FALSE: Function block is
deactivated
TRUE: Function block is activated
IN x REAL 0.0 Input value
IN sizeOfArray INT 20 Size of Average Array [1 -
Lenght_of_Array]
IN reset BOOL FALSE FALSE->TRUE reset counter / size
of array
OUT busy BOOL FALSE FALSE: FB is in stop
TRUE: FB is running
OUT error BOOL FALSE FALSE: No Error TRUE: Error
occurred
OUT errorID DWORD 16#0000_ Error identification
0000 errorID < 16#0105_8000: warning
errorID >= 16#0105_8000: error
OUT averageValue REAL 0.0 Actual Average Value
OUT maxValuereached BOOL FALSE TRUE: complete array is in use

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 82
5 Functional description

Functionality
The function block calculates the moving average value (averageValue) of the
input values that are entered. Each time the block is called, the value (x) currently
present is saved in an array. The values stored in the array are deleted upon
deactivation of the function block.
The function block is activated via the input enable and calculates values from that
instant. The output maxValueReached is set if the amount of values in an array
reaches the defined number sizeOfArray

Error messages
Error messages are indicated by the status of the outputs error and errorID:
error = TRUE and errorID <> 16#0000_0000.

Error ID Description
16#0000_0000 No error
16#0105_8003 Entry number too small
16#0105_8004 Entry number too big
16#0105_8005 Invalid configuration data
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 83
5 Functional description

5.4.11 LCon_PID

PID controller with actual value smoothing and optional D component in the actual
value branch, the function block has to be called in a cyclic interrupt, e.g. OB30.
Function block ID: 1105

Schematic LAD Representation

PID

BOOL enable busy BOOL


BOOL reset error BOOL
REAL setpointValue errorID DWORD
REAL actualValue upperLimitReached BOOL
REAL preControl lowerLimitReached BOOL
REAL propGain deviationValue REAL
REAL integTime pOutValue REAL
© Siemens AG 2019 All rights reserved

REAL derivTime iOutValue REAL


REAL filterTime dOutValue REAL
REAL upperLimit outValue REAL
REAL lowerLimit
REAL intSetValue
BOOL holdIntChannel
BOOL setIntChannel
BOOL controlMode
REAL deadBand
REAL actualValueFactor
REAL actualValueOffset
REAL outValueFactor
REAL outValueOffset
INT OBNumber
REAL tCycle

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 84
5 Functional description

Input and output parameter

I/O Variable name Data Initial Description


type value
IN enable BOOL FALSE FALSE: Function block is deactivated
TRUE: Function block is activated
IN reset BOOL FALSE FALSE: Normal operation
TRUE: Function block restart
IN setpointValue REAL 0.0 Setpoint value
IN actualValue REAL 0.0 Actual value
IN preControl REAL 0.0 Pre-control value
IN propGain REAL 2.0 Controller gain
IN integTime REAL 999.0 [ ms ] Integration time constant
With value = 0.0 the integral channel is
deactivated.
IN derivTime REAL 0.0 [ ms ] Derivative time constant
With value = 0.0 the differential channel is
deactivated.
IN filterTime REAL 10.0 [ ms ] Actual value filter time
With values <= 0.0 the smoothing is
deactivated.
IN upperLimit REAL 100.0 Upper limit value of the control output
upperLimit > lowerLimit
IN lowerLimit REAL 0.0 Lower limit value of the control output.
© Siemens AG 2019 All rights reserved

IN intSetValue REAL 0.0 Integrator set value


IN holdIntChannel BOOL FALSE FALSE: Normal operation
TRUE: Hold integral action
IN setIntChannel BOOL FALSE FALSE: Normal operation
TRUE: Set integrator
IN controlMode BOOL FALSE FALSE: D component in controller deviation
TRUE: D component active in actual value
branch
IN deadBand REAL 0.0 Width of the deadband filter, deactivated
with 0.0
IN actualValue REAL 1.0 Scaling factor of the actual value quantity
Factor
IN actualValue REAL 0.0 Offset of the actual value quantity
Offset
IN outValueFactor REAL 1.0 Scaling factor of the output value
IN outValueOffset REAL 0.0 Offset of the output value
IN OBnumber INT 30 Calling Cyclic interrupt OB NO
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
OUT busy BOOL FALSE FALSE: Function block deactivated
TRUE: Function block activated
OUT error BOOL FALSE FALSE: No error
TRUE: An error has occurred, refer to error
identification
OUT errorID DWORD 16#0000 Error identification, refer to error messages
_0000 errorID < 16#1105_8000: warning
errorID >= 16#1105_8000: error
OUT upperLimit BOOL FALSE FALSE: No output limitation
Reached TRUE: Controller output has reached the
upperlimit, the integrator is limited
OUT lowerLimit BOOL FALSE FALSE: No output limitation
Reached TRUE: Controller output has reached the
lower limit,
the integrator is limited
OUT deviationValue REAL 0.0 Controller deviation after the deadband filter
OUT pOutValue REAL 0.0 P component output, unlimited
OUT iOutValue REAL 0.0 I component output, unlimited

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 85
5 Functional description

I/O Variable name Data Initial Description


type value
OUT dOutValue REAL 0.0 D component output, unlimited (if not in the
actual value branch)
OUT outValue REAL 0.0 Controller output, limited and scaled

Functionality

The function block is used to implement a universal PID controller that can be
switched over to the P controller or I controller modes. The D component can either
be calculated in the actual value branch or in the system deviation.
The integrator can be set using the inputs intSetValue (setting value) and
setIntChannel. In addition, the instantaneous value of the integrator can be held
using holdIntChannel (P controller). Internally, the I component is limited, based on
the controller output limits (“anti-windup”). The integrator is set to zero at switch-on.
All of the block parameters can be changed in operation. The scaled and smoothed
actual value (actualValue) is subtracted from the setpoint (setpointValue)
corresponding to the following equation:
© Siemens AG 2019 All rights reserved

𝑡
𝑑𝑒𝑣𝑖𝑎𝑡𝑖𝑜𝑛𝑉𝑎𝑙𝑢𝑒 = ((𝑎𝑐𝑡𝑢𝑎𝑙𝑉𝑎𝑙𝑢𝑒 ⋅ 𝑎𝑐𝑡𝑢𝑎𝑙𝑉𝑎𝑙𝑢𝑒𝐹𝑎𝑐𝑡𝑜𝑟) + 𝑎𝑐𝑡𝑢𝑎𝑙𝑉𝑎𝑙𝑢𝑒𝑂𝑓𝑓𝑠𝑒𝑡) ⋅ (1 − 𝑒 −𝑇 )
− 𝑠𝑒𝑡𝑝𝑜𝑖𝑛𝑡𝑉𝑎𝑙𝑢𝑒

The result is the system deviationValue (after the deadband) and is then multiplied
with the proportional coefficient propGain. The result is transferred to the integrator
– and optionally to the D component. The settable integral time integTime as well
as the time constant of the D component derivTime (optional) define the controller
behavior.

Component Calculation
P component pOutValue[n] = propGain ⋅ deviationValue[n]
I component 𝑖𝑂𝑢𝑡𝑉𝑎𝑙𝑢𝑒[𝑛] = 𝑖𝑂𝑢𝑡𝑉𝑎𝑙𝑢𝑒[𝑛 − 1]
𝑝𝑂𝑢𝑡𝑉𝑎𝑙𝑢𝑒[𝑛] + 𝑝𝑂𝑢𝑡𝑉𝑎𝑙𝑢𝑒[𝑛 − 1]
+( )
2
𝑐𝑦𝑐𝑙𝑒𝑇𝑖𝑚𝑒
⋅( )
𝑖𝑛𝑡𝑒𝑔𝑇𝑖𝑚𝑒
The integrator includes "anti-windup" functionality, i.e. if the controller
output is limited, the integrator cannot continue to integrate in the same
direction.
The inputs setIntChannel and holdIntchannel can be used to set the
integrator (intSetValue) – or manually hold it. The integrator is set to zero
using reset or with a rising edge for enable.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 86
5 Functional description

Component Calculation
D component 𝑑𝑂𝑢𝑡𝑉𝑎𝑙𝑢𝑒[𝑛]
(if activated) = (𝑝𝑂𝑢𝑡𝑉𝑎𝑙𝑢𝑒[𝑛] − 𝑝𝑂𝑢𝑡𝑉𝑎𝑙𝑢𝑒[𝑛 − 1])
𝑑𝑒𝑟𝑖𝑣𝑇𝑖𝑚𝑒
⋅( )
𝑐𝑦𝑐𝑙𝑒𝑇𝑖𝑚𝑒

The controller output is first scaled and is then limited.

Timing Diagram
© Siemens AG 2019 All rights reserved

• Case 1, 6 – Blocked is switched-in with enable = TRUE. Output busy = TRUE,


outValue is activated.
• Case 2, 7 – An error has been detected, error = TRUE, busy = FALSE,
outValue = 0.0 - up to reset = TRUE or restart.
• Case 3 – Block reset – as long as reset = TRUE. Error = FALSE.
• Case 4 – Block has been reset and reset = FALSE, output busy = TRUE,
outValue is activated.
• Case 5 – Block is deactivated with enable = FALSE while busy = TRUE. Busy
changes to FALSE, outValue = 0.0.
• Case 8 – Block is deactivated with enable = FALSE while error = TRUE. Error
changes to FALSE

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 87
5 Functional description

Block Diagram
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 88
5 Functional description

Nesting Depth : 4 from the time delay interrupt, time-of-day interrupt, cyclic
NOTE
interrupt, hardware interrupt, time error interrupt, or diagnostic error interrupt OB.
Due to this limitation, the called FB’s are re-written in the calling FB so that the
nesting depth reduces by 1.

Error messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
16#1105_8001 The function block is not called in a cyclic
interrupt, e.g. OB30.
16#1105_8005 Invalid configuration data:
upperlimit < lowerlimit
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 89
5 Functional description

5.4.12 LCon_TPID – PID-controller with setpoint channel

Technology controller based on a PID controller for use as tension or dancer roll
position controller in closed-loop winder or material web controls
The function block has to be called in a cyclic interrupt, e.g. OB30.
Function block ID: 1108

Schematic LAD Representation

TPID

BOOL enable busy BOOL


BOOL openLoopCtrl error BOOL
REAL setpointValue errorID DWORD
REAL actualValue upperLimitReached BOOL
REAL preControl lowerLimitReached BOOL
REAL adaptionValue RFGLimReached BOOL
© Siemens AG 2019 All rights reserved

BOOL holdIntChannel RFGSetpointReached BOOL


BOOL setIntChannel RFGSetpointValue REAL
REAL x1 outValue REAL
REAL Kp1 effectiveKp REAL
REAL x2
REAL Kp2
REAL limRampTime
REAL setNominalValue
REAL setRampTime
REAL integTime
REAL derivTime
REAL filterTime
REAL intSetValue
BOOL controlMode
REAL deadBand
REAL outValueFactor
REAL upperLimit
REAL lowerLimit
INT OBNumber
REAL tCycle

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 90
5 Functional description

Input and output parameters

I/O Variable name Data Initial Description


type value
IN enable BOOL FALSE FALSE: Falling edge, the controller
output limitation will be ramped to zero
and the controller will be deactiveated
TRUE: Rising edge, RFG will be started
and PID controller activated (if openLoop
= FALSE)
IN openLoopCtrl BOOL FALSE FALSE: PID controller is active
TRUE: PID controller and limiting are
deactivated.
Only setpoint generator is enabled.
IN setpointValue REAL 0.0 Controller setpoint value
IN actualValue REAL 0.0 Actual value
IN preControl REAL 0.0 Pre-control value
IN adaptionValue REAL 0.0 Abscissa value of Kp-adaption
IN holdIntChannel BOOL FALSE FALSE: Normal operation
TRUE: Hold integral action
IN setIntChannel BOOL FALSE FALSE: Normal operation
TRUE: Set integrator
© Siemens AG 2019 All rights reserved

IN x1 REAL 0.0 First breakpoint of Kp-adaption


characteristic, x1
IN Kp1 REAL 1.0 First breakpoint of Kp-adaption
characteristic, Kp1
IN x2 REAL 0.0 Second breakpoint of Kp-adaption
characteristic, x2
IN Kp2 REAL 1.0 Second breakpoint of Kp-adaption
characteristic,
Kp2
IN limRampTime REAL 1000.0 Ramp time for controller output
IN setNominalValue REAL 100.0 Normalisation value for setpoint RFG
IN setRampTime REAL 1000.0 Ramp time for setpoint RFG
IN integTime REAL 2000.0 [ ms ] Integration time constant
With value = 0.0 the integral channel is
deactivated.
IN derivTime REAL 0.0 [ ms ] Derivative time constant
With value = 0.0 the derivative channel is
deactivated.
IN filterTime REAL 10.0 [ ms ] Actual value filter time
With values <= 0.0 the smoothing is
deactivated.
IN intSetValue REAL 0.0 Integrator set value
IN controlMode BOOL FALSE FALSE: D component in controller
deviation
TRUE: D component active in actual
value branch
IN deadBand REAL 0.0 Width of the deadband filter, deactivated
with 0.0
IN outValueFactor REAL 1.0 Scaling factor of the output value
IN upperLimit REAL 20.0 Upper limit value of the control output
upperLimit > lowerLimit
IN lowerLimit REAL -20.0 Lower limit value of the control output.
IN OBnumber INT 30 Calling cyclic interrupt no.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 91
5 Functional description

I/O Variable name Data Initial Description


type value
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
OUT busy BOOL FALSE FALSE: Function block deactivated
TRUE: Function block activated
OUT error BOOL FALSE FALSE: No error
TRUE: An error has occurred, refer to
error
identification
OUT errorID DWOR 16#000 Error identification, refer to error
D 0_0000 messages
errorID <= 16#1108_8000: warning
errorID >= 16#1108_8000: error
OUT upperLimit BOOL FALSE FALSE: No output limitation
Reached TRUE: Controller output has reached
the upper limit, the integrator is limited
OUT lowerLimit BOOL FALSE FALSE: No output limitation
Reached TRUE: Controller output has reached
the lower
limit, the integrator is held
OUT RFGLimReached BOOL FALSE FALSE: RFG output <> setpoint value
TRUE: RFG output reached setpoint
value
© Siemens AG 2019 All rights reserved

OUT RFGSetpoint BOOL FALSE Setpoint after RFG


Reached
OUT RFGSetpoint REAL 0.0 Setpoint after RFG
Value
OUT outValue REAL 0.0 Controller output
OUT effectiveKp REAL 0.0 Effective gain after adaption

Functionality
The block is enabled using the enable input; as a consequence, the setpoint ramp-
function generator and the limiting ramp-function generator are started with their
respective ramp-up times and the PID controller is activated. In addition, for a rising
edge, the setpoint ramp-function generator is set to the actual value that is present
(actualValue). This guarantees a jerk-free and smooth transition into the controlled
mode. When the edge at the enable input falls, the limiting ramp-function generator
is ramped back to zero and therefore the controller output is limited. This results in
a bumpless controller shutdown. As soon as the outValue output is zero and
enable = FALSE, the block is deactivated and the output busy is set to FALSE. The
setpoint is internally ramped to the actual value during the switch-off phase.
If input openLoopCtrl = TRUE, then the block operates in the open control circuit
mode. As a consequence, the setpoint channel remains active and the controller or
the output limits remain inactive. The output busy stays TRUE as long as the
setpoint ramp output is not zero. The input actualValue is 0.0.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 92
5 Functional description

Setpoint ramping
The setpoint ramp-function generator is used to avoid setpoint steps in the setpoint
channel. The setpoint ramp-function generator is configured using the parameters
setRampTime and setNominalValue, whereby setNominalValue defines the
reference value for the ramp-up or ramp-down time. The function is always active,
if enable = TRUE. If openLoopCtrl = FALSE, enable = FALSE and busy = TRUE
(switch-off phase), then the setpoint is internally set to the actual value.
The ramp times are internally limited to the cycle time.

Controller functionality
The controller setpoint is provided via the input setValue, the actual value via the
actValue input. The setpoint channel includes a settable setpoint ramp-function
generator, via which the setpoint is routed; the effective setpoint can be monitored
at output RFGSetpointValue.
The control algorithm used corresponds to that described in function block PID.

Kp adaptation
© Siemens AG 2019 All rights reserved

A linear adaptation is carried out as Kp adaptation. The interpolation line is defined


by the value (x1, kp1) and (x2, kp2).

1st case: (adaptionValue < x1) or (x1 = x2):

𝑒𝑓𝑓𝑒𝑐𝑡𝑖𝑣𝑒𝐾𝑝 = 𝐾𝑝1

2nd case: x1 <= adaptionValue <= x2:

(𝑎𝑑𝑎𝑝𝑡𝑖𝑜𝑛𝑉𝑎𝑙𝑢𝑒 − 𝑥1) ⋅ (𝑘𝑝2 − 𝑘𝑝1)


𝑒𝑓𝑓𝑒𝑐𝑡𝑖𝑣𝑒𝐾𝑝 = 𝑘𝑝1 +
𝑥2 − 𝑥1

3rd case: adaptionValue > x2:

𝑒𝑓𝑓𝑒𝑐𝑡𝑖𝑣𝑒𝐾𝑝 = 𝑘𝑝2

The value kp1 is used as effective Kp if the Kp adaptation is deactivated.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 93
5 Functional description

Timing diagram
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 94
5 Functional description

Block diagram
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 95
5 Functional description

Error Messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
16#1108_8001 The function block is not called in a cyclic interrupt, e.g. OB30.
16#1108_8005 Invalid configuration data:
setNominalValue <= 0.0
upperlimit < lowerlimit
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 96
5 Functional description

5.5 Drive related functions


5.5.1 LCon_DriveControl

The function block is used as an interface between the PLC program and a drive
from the SINAMICS drive family. The function block enables the full control of the
respective drive.
Function block ID: 3101

Schematic LAD Representation


LCon_DriveControl

Bool enable busy Bool

Bool enableTorqueLimits error Bool

Bool onOff1 errorID DWord

Bool noOff2 readyToPowerUp Bool

Bool noOff3 readyForMotion Bool


© Siemens AG 2019 All rights reserved

Bool speedSetpointEnable fault Bool

Bool enableFixedEndstop faultCode DInt

Bool ackFaults speedActual Real

Bool openBrake torqueActual Real

Bool infeedOperation torqueActualFtlbs Real

Real speedSetpoint torqueActualPercent Real

Real additiveTorque

Real upperTorqueLimit

Real lowerTorqueLimit

Real kpAdaption

Real referenceSpeed

Real referenceTorque

HW_SUBMODULE HW_Address_Input

HW_SUBMODULE HW_Address_Output

HW_SUBMODULE HWAddressAdditionalTelIn

HW_SUBMODULE HWAddressAdditionalTelOut

Int baseTelegram

Bool Tel750

Int OBnumber

Real tCycle

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 97
5 Functional description

Input and Output parameters


I/O Variable Data Initial Description
Name Type Value
IN enable Bool FALSE FALSE: deactivation of FB
TRUE: activation of FB
IN enableTorque Bool FALSE FALSE: no torque limiting, torque limitation is set to
Limits +/- 200% of reference torque
TRUE: Torque Limiting by entered values
IN onOff1 Bool FALSE TRUE = DriveStart
FALSE = RampToStop
IN noOff2 Bool FALSE TRUE: NoCoastStop
FALSE: CoastStop
IN noOff3 Bool FALSE TRUE: NoFastStop
FALSE: FastStop
IN speedSetpoint Bool FALSE TRUE: Release Speed Setpoint
Enable FALSE: Speed Setpoint disabled
IN enableFixedEn Bool FALSE enable travel to fixed end stop (control over torque
dstop limits)
IN ackFaults Bool FALSE TRUE: Acknowledge Fault
IN openBrake Bool FALSE If motor has a breake:
© Siemens AG 2019 All rights reserved

TRUE: ReleaseMtrBrake
FALSE: Brake controlled by brake control
IN infeedOperatio Bool FALSE TRUE: Infeed enabled DC bus ready
n
IN speedSetpoint Real 0.0 [rpm] Speed setpoint
IN additiveTorque Real 0.0 [Nm] Torque precontrol, additive torque
IN upperTorqueLi Real 0.0 [Nm] Upper Torque Limit
mit
IN lowerTorqueLi Real 0.0 [Nm] Lower Torque Limit
mit
IN kpAdaption Real 100.0 [%] Speed controller gain adaption value.
At 100% the effective Kp = p1460 in the drive. (only
S120)
IN referenceSpee Real 100.0 [rpm] Normalization speed= (P2000) in the drive
d Value is saved upon rising edge of enable
IN referenceTorq Real 1.0 [Nm] Normalization torque= (P2003) in the drive
ue Value is saved upon rising edge of enable
IN HW_Address_ HW_SUB 16#0000 Drive Logical IO address for reading BaseTel (as read
Input MODULE in the hardware config)
IN HW_Address_ HW_SUB 16#0000 Drive Logical IO address for writing BaseTel (as read
Output MODULE in the hardware config)
IN HWAddressAd HW_SUB 16#0000 Drive Logical IO address for reading AdditionalTel (as
ditionalTelIn MODULE read in the hardware config)
IN HWAddressAd HW_SUB 16#0000 Drive Logical IO address for writing AdditionalTel (as
ditionalTelOut MODULE read in the hardware config)
IN baseTelegram Int 999 999: UserDefTel (8/8). Structure as shown in telegram
structure (compatible with previous version)
2: StandardTel2 is used
3: StandardTel3 is used. Only the PZD of telegram 2
are evaluated! Caution: The STW_G1 could be
overwritten!

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 98
5 Functional description

I/O Variable Data Initial Description


Name Type Value
IN Tel750 Bool FALSE FALSE: Tel 750 is not used (if user def Tel is used or
Tel2or3 and no Torquedata is necessary)
TRUE: Tel 750 is used (use only if standardTel = 2 or
3)
IN OBnumber Int 30 OB number; cyclic interupt or synchronous operation
IN tCycle Real 0.0 [ms] Cycle time the FB is called
OUT busy Bool FALSE FALSE: Function Block disabled, no communication
active
TRUE: Function Block active, valid configuration,
communication active
OUT error Bool FALSE FALSE: No Error
TRUE: Error has occurred
OUT errorID DWord 16#0 Error identification
errorID<16#3101_8000:Warning
errorID>=16#3101_8000:Error
OUT readyToPower Bool FALSE FALSE: Missing enables
Up TRUE: Drive is ready
OUT readyForMotio Bool FALSE FALSE: Missing enables
n TRUE: Drive enabled for motion
OUT fault Bool FALSE FALSE: No drive fault
TRUE: Drive fault present
© Siemens AG 2019 All rights reserved

OUT faultCode DInt 0 Drive fault code, refer to drive manual for more
information
OUT speedActual Real 0.0 [rpm] Speed actual value(r63 from the drive)
OUT torqueActual Real 0.0 [Nm] Total actual torque (r80 from the drive)
OUT torqueActualFt Real 0.0 [ft/lbs] Torque actual torque
lbs
OUT torqueActualP Real 0.0 [%] Torque actual value in percent of nominal torque
ercent

Functionality
This function block is utilized to interface and control the drive from the PLC
program. Through this function block the programmer is able to enable, disable,
open brake (if supplied), adjust speed, adjust torque, adjust the Kp and adjust
torque pre-control if required. The programmer also has access to standard status
bits and values.
If torque limiting is active, the function block monitors the actual speed of the drive
to avoid uncontrolled acceleration in the opposite direction what the set point
specifies. This can happen if the upper limit is negative or lower torque limit is
positive while drive is operating at the torque limit. If the drive accelerates beyond
50 rpm in opposite direction the drive will be stopped with set point zero and the
torque limits will be opened.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 99
5 Functional description

Control interface
This function block interfaces with an electronic drive over PROFIBus or
PROFINet. There are different communication possibilities between the drive and
the PLC:
• If "baseTelegram" = 999, then the communication is based on an 8-word input
and 8-word output telegram. The structure is explained in the next subchapter
"Telegram structure".
• If "baseTelegram" = 2 or 3, then the communication is based on the standard
telegram 2 or 3. This does not send / receive any moment data. If this data is
required, "Tel750" must also be set to TRUE and the hardware address must
be connected via "HWAddressAdditionalTelIn -/out". A Kp adaptation is not
possible.

NOTICE If telegram 3 is used, the encoder data is read out but not
forwarded to the output.
CAUTION when using an encoder:
G1_STW is set to 0!

The function block communicates via SFC14 (DPRD_DAT) and SFC15


(DPWR_DAT) called from within the function block. The user will enter the logical
address of the drive as an input labeled “HW_Adresss” to the function block. It is
required to make the drives input and output logical addresses identical.
© Siemens AG 2019 All rights reserved

Telegram structure “baseTelegram” = 999


The communication telegram is structured to address the requirements of most
demanding converting applications. Additionally spare words are incorporated for
customer specific needs.
The interface must be consistent on the PLC and the drive side.

Control Telegram

Element Offset Data Description Interconnected


(bytes) type to
cw1 0 WORD Control word 1 See Control
Word 1
speedSetpoint 2 DINT Main speed set point P1070 for G120
1073741824=100% of the P1155 for S120
reference speed (p2000)
cw2 6 WORD Control word 2 See Control
Word 2
upperTorqueLimit 8 INT Upper torque limit P1522
16384= 100% of the reference
torque (p2003)
lowerTorqueLimit 10 INT Lower torque limit P1523
16384= 100% of the reference
torque (p2003)
additiveTorque 12 INT Additional torque P1511
16384= 100% of the reference
torque (p2003)
word08 14 WORD not used for G120 drive / Kp P1455 in case of
Adaptation for S120 drive S120 drive

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 100
5 Functional description

Control Word 1

Element Offset Data Description Interconnected


(bytes) type to
onOff1 0 BOOL ON/OFF p840
noOff2 1 BOOL No coast stop request p844
noOff3 2 BOOL No fast stop request p848
enable 3 BOOL Enable controller- enable p852
inverter
enableRFG 4 BOOL Enable RFG p1140
startRFG 5 BOOL Start RFG p1141
enSpeedSet 6 BOOL Enable speed setpoint p1142
acknFault 7 BOOL Acknowledge faults p2103
bit08 8 BOOL not used -
bit09 9 BOOL not used -
controlReq 10 BOOL PLC request control p854
reverseDir 11 BOOL Setpoint Inversion p1113
bit12 12 BOOL not used -
mopRaise 13 BOOL MOP increase value p1035
mopLower 14 BOOL MOP lower value p1036
bit15 15 BOOL not used -
© Siemens AG 2019 All rights reserved

Control Word 2

Element Offset Data Description Interconnected


(bytes) type to
dds0 0 BOOL Drive data set selection 0 p820
dds1 1 BOOL Drive data set selection 1 p821
bit02 2 BOOL not used -
bit03 3 BOOL not used -
bit04 4 BOOL not used -
closeBrake 5 BOOL Close brake p858
infeedOn 6 BOOL Infeed module enabled p864 for S120
parkAxis 7 BOOL Park drive object p897
travToFixStop 8 BOOL Traverse to fixed stop p1545 for S120
bit09 9 BOOL not used -
bit10 10 BOOL not used -
bit11 11 BOOL not used -
bit12 12 BOOL not used -
bit13 13 BOOL not used -
bit14 14 BOOL not used -
openBrake 15 BOOL Open brake p855

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 101
5 Functional description

Status Telegram
Element Offset Data Description Interconnected
(bytes) type to
sw1 0 WORD Status word 1 See status Word
1
actualspeed 2 DINT Actual speed r63
1073741824=100% of the
reference speed (p2000)
sw2 6 WORD Status word 2 See Status
Word 2
actualTorque 8 INT Actual torque r79
faultNum 10 INT Actual fault code r2131
word07 12 WORD not used -
word08 14 WORD not used -

Status Word 1
Element Offset Data Description Interconnected
(bytes) type to
rdyToPwr 0 BOOL Ready to Switch ON r899.0
rdyToOp 1 BOOL Ready to operate r899.1
© Siemens AG 2019 All rights reserved

inOperation 2 BOOL In Operation r899.2


faultPresent 3 BOOL Fault present r2139.3
noOFF2Act 4 BOOL OFF2 inactive r899.4
noOFF3Act 5 BOOL OFF3 inactive r899.5
powerInhibit 6 BOOL Power ON inhibit active r899.6
alarmPresent 7 BOOL Alarm present r2139.7
spdDevOK 8 BOOL Speed setp - act val deviation in r2197.7
tolerance
controlReq 9 BOOL Control requested r899.9
spdValReached 10 BOOL f or n comparison value reached r2199.1
or exceeded
curTrqPwrOK 11 BOOL I,M,P limit not reached r1407.7
brkSetpEN 12 BOOL Enable set point from brake r899.12
control
mtrTempOK 13 BOOL No motor temperature alarm r2135.14
MtrRotDir 14 BOOL Motor rev rotation dir r52.14
pwrUnitTempOK 15 BOOL No power unit temperature over r52.15
load

Status Word 2
Element Offset Data Description Interconnected
(bytes) type to
dds0 0 BOOL DDS select bit 0 r837.0
dds1 1 BOOL DDS select bit 1 r837.1
bit02 2 BOOL not used r837.2 in case of
S120
bit03 3 BOOL not used r837.3 in case of
S120
bit04 4 BOOL not used r837.4 in case of
S120

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 102
5 Functional description

Element Offset Data Description Interconnected


(bytes) type to
almClass0 5 BOOL Alarm class bit0 r2139.11
almClass1 6 BOOL Alarm class bit1 r2139.12
bit07 7 BOOL not used -
bit08 8 BOOL not used -
bit09 9 BOOL not used -
pulsesEnabled 10 BOOL Output pulses enabled r899.11
bit11 11 BOOL not used -
bit12 12 BOOL not used -
bit13 13 BOOL not used -
bit14 14 BOOL not used -
openBrake 15 BOOL Open brake r52.12

Warning Messages
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No warning
16#3101_4009 Communication error while reading from bus system
© Siemens AG 2019 All rights reserved

16#3101_400A Communication error while writing on bus system

Error Messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
16#3101_8005 Invalid configuration data:
logAddr <= 0
referenceSpeed <= 0.0
referenceTorque <= 0.0
16#3101_8065 Torque Limits may not be plausible anymore; web break could cause this
problem. Axis runs in the opposite direction too fast. Reaction: brake with
full
torque.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 103
5 Functional description

5.5.2 LCon_SetpointChannel

The Setpoint Channel Function Block is designed to provide the functionality


required to produce a drive speed setpoint for the DriveControl function block. The
function block has to be called in a cyclic interrupt, e.g. OB30.
Function block ID: 3102

Schematic LAD Representation

SetpointChannel

BOOL jogPos error BOOL


BOOL jogNeg zeroSpeed BOOL
BOOL enableRFG errorID DWORD
BOOL holdRFG setVelocity REAL
BOOL noFastStop actVelocity REAL
BOOL metricUnit acceleration REAL
© Siemens AG 2019 All rights reserved

REAL jogVelocity setdriveSpeed REAL


REAL velocity1 actshaftSpeed REAL
REAL velocity2
REAL velocity3
REAL velocity4
REAL velocityPID
REAL draw
REAL roundingTime
REAL rampUpTime
REAL rampDownTime
REAL fastStopTime
REAL gearRatio
REAL diameter
REAL actDriveSpeed
REAL maxVelocity
INT OBNumber
REAL tCycle

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 104
5 Functional description

Input and output parameters

I/O Variable name Data Initial Description


type value
IN jogPos BOOL FALSE FALSE: No jog operation
TRUE: Start Jog forward at jogVelocity
IN jogNeg BOOL FALSE FALSE: No jog operation
TRUE: Start Jog reverse at jogVelocity
IN enableRFG BOOL FALSE FALSE: Velocity setpoint ramp disabled
TRUE: Enable velocity setpoint ramp
IN holdRFG BOOL FALSE FALSE: No hold operation of the RFG
TRUE: Hold actual velocity with jerk
limit
IN noFastStop BOOL TRUE FALSE: Fast stop with fastStopTime
TRUE: Normal ramp operation
IN metricUnits BOOL TRUE FALSE: Imperial units
TRUE: Metric
IN jogVelocity REAL 0.0 [ LU/min] Jog velocity setpoint
w/o Ramp
IN velocity1 REAL 0.0 [LU/min ] Velocity setpoint w/ Ramp
IN velocity2 REAL 0.0 [LU/min ] Velocity setpoint w/ Ramp
IN velocity3 REAL 0.0 [LU/min ] Velocity setpoint w/ Ramp
© Siemens AG 2019 All rights reserved

IN velocity4 REAL 0.0 [LU/min] Velocity setpoint w/o Ramp


IN velocityPID REAL 0.0 [LU/min ] Tension correction velocity
w/o Ramp
IN draw REAL 1.0 [ % ] Draw ratio [1.00 = 100%]
IN roundingTime REAL 0.5 [ s ] Ramp rounding time
IN rampUpTime REAL 30.0 [ s ] Ramp up time
IN fastStopTime REAL 30.0 [ s ] Ramp down time
IN gearRatio REAL 1.0 Gear ratio, motor : load
IN diameter REAL 0.0 [ m or inch ] Diameter of driven roll
If the input is zero then a standard value
is used which gives 1.0 LU as
circumference.
IN actdriveSpeed REAL 0.0 [ rpm ] Actual speed from drive
IN maxVelocity REAL 0.0 [LU/min ] Max line velocity for
normalization and limiting
IN OBnumber INT 30 Calling cyclic interrupt block number
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
OUT error BOOL FALSE FALSE: No error
TRUE: Error occurred, refer to error
identification
OUT zeroSpeed BOOL FALSE FALSE: Shaft speed not zero
TRUE: Actual shaft speed at zero
OUT errorID DWOR 16#000 Error identification, refer to error
D 0_0000 messages
errorID < 16#3102_8000: Warning
errorID >= 16#3102_8000: Error
OUT setVelocity REAL 0.0 [LU/min] Total velocity setpoint
OUT actVelocity REAL 0.0 [LU/min ] Actual velocity
OUT acceleration REAL 0.0 [ LU/ s 2 ] Set line acceleration
OUT setDriveSpeed REAL 0.0 [ rpm ] Speed setpoint to drive
OUT actShaftSpeed REAL 0.0 [ rpm ] Actual shaft speed

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 105
5 Functional description

Functionality

The block must be configured with the proper total gear ratio, diameter of driven roll
and max velocity. This function block consistently checks for plausible parameters
and will display an error with corresponding errorId should invalid data be entered
at the rising edge of enable.
With the enableRFG set to true, the velocity1, velocity2 and velocity3 are summed
together and sent to the input of the RFGJ with the configuration data and ramp
control functions for holding, rounding, and ramp times entered at this function
block. With a False entered at enableRFG the input is set to zero and the ramp is
kept enabled until the ramped signal is zero. velocity4, Draw (multiplier) and the
tension correction – velocityPID – inputs are alwaysactive unless jog is requested
and the ramp output is zero.
RFG operation has priority over jog. The jog commands must be exclusive
commands. With the enableRFG false, the jogPos set to true and jogNeg is false,
the jogVelocity is set as the velocity setpoint. Additionally, with the enableRFG
false, the jogNeg set to true and jogPos is false, a negative jogVelocity is set as the
velocity setpoint. The jog velocity, summed velocity setpoints 1-4 times the draw
factor are limited to +/- max velocity value. The tension velocity is added after this
limit to allow tension or any other superimposed control even at 100% velocity.
The function block will calculate the correct drive speed setpoint based upon the
diameter (meter or inch) and gear ratio.
© Siemens AG 2019 All rights reserved

𝑠𝑒𝑡𝑉𝑒𝑙𝑜𝑐𝑖𝑡𝑦
𝑠𝑒𝑡𝐷𝑟𝑖𝑣𝑒𝑆𝑝𝑒𝑒𝑑 = ⋅ 𝑔𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜
𝑑𝑖𝑎𝑚𝑒𝑡𝑒𝑟 ⋅ 𝑃𝐼

The function block will calculate the correct Shaft actual speed based upon the
actual motor
speed and gear ratio.

𝑎𝑐𝑡𝐷𝑟𝑖𝑣𝑒𝑆𝑝𝑒𝑒𝑑
𝑎𝑐𝑡𝑆ℎ𝑎𝑓𝑡𝑆𝑝𝑒𝑒𝑑 =
𝑔𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜

The function block will check for zero speed if the absolute actual speed is less
than 0.1 rpm.

Unit of measures

Measure Metric unit Imperial unit


speed revolution per minute (rpm)
velocity meter per minute (m/min) ft per minute (ft/min)
acceleration meter per second squared (m/s 2 ) ft per second squared (ft /s
2)
diameter meter (m) inch (in)
LU m ft
(length unit)

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 106
5 Functional description

Error Messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.
Table 5-2
ErrorID Description
16#0000_0000 No error
16#3102_8001 The function block is not called in a cyclic interrupt, e.g. OB30
16#3102_8005 Invalid configuration data:
maxVelocity <= 0.0
gearRatio = 0.0
The configuration data are checked for plausibility at the rising edge of
enable
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 107
5 Functional description

5.5.3 LCon_FrictionMeasuement

The function block is used to record a friction characteristic of the drive. The
characteristic can then be used as a component of torque precontrol.
The function block has to be called in a cyclic interrupt, e.g. OB30.
Function block ID: 3103

Schematic LAD Representation

FrictionMeasurement

BOOL execute done BOOL


BOOL abort aborted BOOL
TIME warmUpTime busy BOOL
REAL rampTime error BOOL
REAL actualTorque errorID DWORD
INT valueNumber speedSetpoint REAL
© Siemens AG 2019 All rights reserved

INT sizeOfArray torqueOutValues breakPointTable


REAL maxSpeed speedOutValues breakPointTable
breakPointTable speedValues
INT OBNumber
TIME MeasurementDelayTime
REAL tCycle

Input and Output parameters

I/O Variable name Data Initial Description


type value
IN execute BOOL FALSE FALSE: Friction measurement
disabled
TRUE: Rising edge starts
the friction measurement
IN abort BOOL FALSE FALSE: Normal sequence
TRUE: Rising edge interrupts the
sequence and stops the axis
IN warmUpTime TIME - [T#] System warm up time at
maximum speed for reaching
operating conditions
IN rampTime REAL - [msec]Ramping time for speed
setpoint ramping
IN actualTorque REAL - [Nm or ft/lbs] Torque feedback
from the drive
IN valueNumber INT 50 Number of measurement points
per speed

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 108
5 Functional description

I/O Variable name Data Initial Description


type value
step [limited internally to 50-500]
IN sizeOfArray INT 20 size of breakpointtable
IN maxSpeed REAL 0.0 [rpm] Max. speed reference
If specified, the data
block will be preassigned
with the x (speed) values evenly
distributed.
If the input is zero, values for
measurement are taken
directly from the
speedValue array,
the highest x value will be used as
maximum speed reference
IN speedValues breakPoi - [rpm]speed values
ntTable for max speed =0.0
IN OBnumber INT 30 Calling cyclic interrupt
block number
IN measurementDelayTime TIME 1s Hold time for each speed step
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
OUT done BOOL FALSE FALSE: Measurement of friction
characteristic not active
© Siemens AG 2019 All rights reserved

TRUE: Measurement completed,


friction characteristic generated
OUT aborted BOOL FALSE FALSE: Measurement was not
interrupted
TRUE: Measurement
was prematurely interrupted
OUT busy BOOL FALSE FALSE: Function Block inactive
TRUE: Function Block active
OUT error BOOL FALSE FALSE: No Error
TRUE: Error has occurred
OUT errorId DWORD 16#000 Error identification
0_0000 errorID<16#3103_8000:Warning
errorID>=16#3103_8000:Error
OUT speedSetpoint REAL 0.0 [rpm] Speed setpoint
for drive control
OUT torqueOutValues breakPoi - [Nm] Friction torque
ntTable values for various speeds
OUT speedOutValues breakPoi - [rpm] speeds values
ntTable at which Friction torques were
calculated

Functionality

The function block measures the friction characteristic (speed / torque breakpoints)
of a specific mechanical system. Speed setpoints are taken and torque values are
saved in the specified data area referenced by an array. The data structure
contains breakpoints of the characteristic (x value: speed, y value: torque), while
the speed setpoint value has to be specified before starting the function block.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 109
5 Functional description

The user has the possibility to let the function block preassign the speed values
into an array. For this the input parameter maxSpeed must be unequal to zero. The
speed values will be distributed evenly according to the length of the data block.
The first entry will always be zero speed with zero torque.
The function block is started using the input execute. Once started, speedSetpoint
outputs the drives speed based on the values of the breakpoint table. If the input
warmupTime > 0.0, the drive is moving for this defined period of time at the
maximum speed before starting the measurement of the corresponding torque
values.
The actual torque value of the drive has to be connected to the actualTorque input
of the function block. The torque values are averaged with defined number of
samplings specified by input valueNumber. The ramp times for changing the speed
setpoint are specified using the input ramptime. If the sequence is active, done =
FALSE and busy = TRUE. If finished, done = TRUE and busy = FALSE.
If an error occurs during the sequence, this is displayed at the error output and the
associated errorID. If, at the input, the abort signal abort is set to TRUE, the
measurement is interrupted and the setpoint ramped to zero.

Time Diagram
© Siemens AG 2019 All rights reserved

Error Messages

Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
16#3103_8001 The function block is not called in a cyclic interrupt, e.g. OB30.
16#3103_8003 Less than two pairs of values in the breakpoint table or uneven entries in
the table.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 110
5 Functional description

ErrorID Description
16#3103_8004 More than twenty pairs of values in the breakpoint table or uneven entries
in the table.
16#3103_8005 Invalid configuration data
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 111
5 Functional description

5.6 Sectional drive functions


5.6.1 LCon_Sectional Drive

This function block is used to control a converting line sectional drive from the PLC
program. The function block was designed to handle the requirements of a tension
or ratio adjusted driven section. The function block has to be called in a cyclic
interrupt, e.g. OB30.
Function block ID: 7101

Schematic LAD Representation

SectionalDrive

BOOL enable busy BOOL


BOOL enableTorqueLimits ctrlBusy BOOL
BOOL onOff1 error BOOL
BOOL noOff2 errorID DWORD
© Siemens AG 2019 All rights reserved

BOOL noOff3 driveReadyToPowerUp BOOL


BOOL speedSetpointEnable driveReadyForMotion BOOL
BOOL enableFixedEndStop driveZeroSpeed BOOL
BOOL ackFaults driveFault BOOL
BOOL openBrake driveFaultCode DINT
BOOL infeedOperation pidUpperLimitreached BOOL
REAL driveKp pidLowerLimitreached BOOL
REAL lineVelocity driveSpeedActual REAL
REAL additionalVelocity driveTorqueActual REAL
REAL draw driveTorqueActualFtlbs REAL
INT typeOfDrive driveTorqueActualPercent REAL
INT controlMode actShaftSpeed REAL
BOOL jogPos actVelocity REAL
BOOL jogNeg setdriveSpeed REAL
BOOL CntrlEnable pidoutValue REAL
REAL CntrlSetpoint pidEffectiveKp REAL
REAL CntrlActual pidRFGSetpointReached REAL
INT OBnumber
breakPointTable xn_speedValues
breakPointTable yn_torqueValues
INT sizeOfArray
REAL speedSetpoint
BOOL speedSetpointMode
REAL tCycle

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 112
5 Functional description

sectional ----------------------------SectionalConfig-------------------- sectional


ConfigType ----------- ConfigType

Input and Output parameters

I/O Variable name Data Initial Description


type value
IN enable BOOL FALSE FALSE: Function block disabled
TRUE: Rising edge enables
communication and saves parameters
IN onOFF1 BOOL FALSE FALSE: Drive disabled
TRUE: Enable drive
IN noOFF2 BOOL FALSE FALSE: Coast stop request
TRUE: No coast stop request
IN noOFF3 BOOL FALSE FALSE: Fast stop request
TRUE: No fast stop request
IN ackFaults BOOL FALSE FALSE: No fault acknowledgement
TRUE: Rising edge, acknowledge faults
IN openBrake BOOL FALSE If motor is equipped with holding brake:
FALSE: Brake controlled by brake control
TRUE: Release brake
IN infeed BOOL FALSE FALSE: Infeed disabled
© Siemens AG 2019 All rights reserved

Operation TRUE: Infeed enabled, DC bus is ready


IN driveKp REAL 100.0 [ % ] Speed controller gain adaption value.
At 100% the effective Kp = p1460 in the drive.
IN lineVelocity REAL 0.0 [ LU / min ] Master line velocity
IN additionalVelocity REAL 0.0 [ LU / min ] Additional velocity (always enabled)
IN draw REAL 1.0 [ % ] Setting for the speed relation, the effect is
additive to the main setpoint. Only used for Draw-
Control.
IN typeOfDrive INT 0 Specifies the drive mode:
0: PULL
1: HELD
Value is saved upon rising edge of enable.
IN controlMode INT 0 Specifies the tension control mode:
0: DANCER_SPEED_ADAPT
1: DANCER_SPEED_ADAPT_HD
2: TENSION_SPEED_ADAPT
3:TENSION_SPEED_ADAPT_HD
4: TENSION_TORQUE_ADAPT
5: INDIRECT
6: DRAW_CONTROL
Value is saved upon rising edge of enable.
IN jogPos BOOL FALSE FALSE: No jog operation
TRUE: Start Jog forward at Jog Sp
IN jogNeg BOOL FALSE FALSE: No jog operation
TRUE: Start Jog reverse at Jog Sp
IN CntrlEnable BOOL FALSE FALSE: TPID and tension not enabled
TRUE: TPID enable
IN CtrlSetpoint REAL 0.0 TPID Setpoint
IN CtrlActual REAL 0.0 TPID actual value
IN OBnumber INT 30 Calling Cyclic interrupt OB NO
IN xn_speedValues breakPoi - Speed values from friction characteristics
ntTable
IN yn_torqueValues breakPoi - Torque values from friction characteristics
ntTable
IN sizeOfArray INT - length of array
IN speedSetpoint REAL 0.0 Speed setpoint for speed setpoint mode
IN speedSetpointMode BOOL FALSE FALSE: normal operation
TRUE: sectional drive runs with speed
setpoint

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 113
5 Functional description

I/O Variable name Data Initial Description


type value
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
IO SectionalConfig sectional - This data type includes all configuration
Config data required for parameterization of the
Type SectionalDrive function block
OUT busy BOOL FALSE FALSE: Block disabled, no communication active
TRUE: Block active, valid configuration,
communication active
OUT ctrlBusy BOOL FALSE FALSE: controller not working
TRUE: controller busy
OUT error BOOL FALSE FALSE: No error
TRUE: An error has occurred, refer to error
identification
OUT errorID DWORD 16#0000 Error identification, refer to error messages
_0000 errorID < 16#7101_8000: Warning
errorID >= 16#7101_8000: Error
OUT driveReadyToPowerUp BOOL FALSE FALSE: Missing enables
TRUE: Drive is ready
OUT driveReadyForMotion BOOL FALSE FALSE: Missing enables
TRUE: Drive enabled for motion
OUT driveZeroSpeed BOOL TRUE FALSE: Shaft speed not zero
TRUE: Actual shaft speed at zero
OUT driveFault BOOL FALSE FALSE: No drive fault
TRUE: Drive fault present
OUT driveFaultCode INT 0 Drive fault code, refer to drive manual for
more information (r2131 from the drive)
OUT pidUpperLimitReached BOOL FALSE TPID at upper limit
© Siemens AG 2019 All rights reserved

OUT pidLowerLimitReached BOOL FALSE TPID at lower limit


OUT driveSpeedActual REAL 0.0 [ rpm ] Speed actual value (r63 from the drive)
OUT driveTorqueActual REAL 0.0 [ Nm ] Torque actual value (r80 from the drive)
OUT driveTorqueActualFtlbs REAL 0.0 [ ft / lbs ] Torque actual value
OUT driveTorqueActual REAL 0.0 [ % ] Torque actual value in percent of nominal
Percent torque
OUT actShaftSpeed REAL 0.0 [ rpm ] Actual shaft speed
OUT actVelocity REAL 0.0 [ LU / min ] Actual line velocity
OUT setDriveSpeed REAL 0.0 [ rpm ] Speed setpoint to drive
OUT pidOutValue REAL 0.0 TPID controller output
OUT pidEffectiveKp REAL 0.0 TPID effective Kp
OUT pidRFGSetpointReached BOOL FALSE TPID setpoint value reached

Functionality

This function block utilizes the DriveControl, SetpointChannel, TorquePrecontrol


and TechPID function blocks of the Simatic Converting library. This function block
checks for valid configuration data and calls the individual function blocks to
minimize application development time.
With the enable set to true, a plausibility check is done on the configuration data
and will display an error with corresponding error Id should invalid data be entered.
This input allows control functionality. With the function block enabled, the
driveControl function block will become active which will set the busy output true.
With the enables set true the sectional drive will follow the sum of the lineVelocity
and additionalVelocity times the draw factor. Sectional drives are typically made
to follow the master without any ramps. The programmer is responsible for proper
interlocks to prevent unwanted behavior.
The configuration data has diameter, gear ratio and max line speed parameters
which are utilized to calculate the correct surface velocity of the driven roll to match
the section to the master line velocity.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 114
5 Functional description

The configuration data also has parameters for torque precontrol. Torque
precontrol is necessary for torque based tension control modes and is optional
for speed based tension control modes. Speed based tension control modes
with the _HD (high dynamic) prefix utilize torque precontrol.
With the enable set to true and driveReadyForMotion and Cntrlenable then the
CntrlSetpoint will be ramped up based on configuration data. The Tension
controller correction value will be added to the total speed setpoint or additional
torque, scaled and sent to the drive using the driveControl function block as
required.
Function block output parameters allow the user to view the calculated surface
velocity of the section (actVelocity), the sections actual shaft speed
(actshaftSpeed), motor actual speed in RPM (actdriveSpeed), motor torques
(driveTorqueActual, driveTorqueActualFtlbs, driveTorqueActualPercent) and
pertinent PID data.

Tension operating modes


The following overview shows the tension operation modes depending on the
position of the dancer or tension measuring device location in accordance to the
web axis as well as the orientation so the setting variables (speed, force, torque).
The tension operating mode is selected by the typeOfDrive input of the function
block.
© Siemens AG 2019 All rights reserved

The following table shows the different tension operating modes and the orientation
of velocity, tension and torque. At commissioning of the application it must be
ensured that the direction convention and signs of the process variables are
aligned. Eventually it might be necessary to change the direction of rotation in the
drive system.

Operation Representation Description


mode

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 115
5 Functional description

PULL V: Machine velocity


F: Tension in material
line
n: speed of drive
no : velocity override
for speed controller
overcontrol
Mf: Friction torque
Mp: Pre-control torque
HELD MT: Tension torque

Block diagram
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 116
5 Functional description

Warning Messages
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000

ErrorID Description
16#0000_0000 No Warning
16#7101_4005 The table of entered values is not monotonically (steadily) increasing -> no
matching value found
16#7101_4008 The table of entered values is not monotonically (steadily) increasing -> 2
values are identical

Error Messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
16#3101_8005 Invalid configuration data: (DriveControl)
© Siemens AG 2019 All rights reserved

HW_Address_Input <= 0
HW_Address_Output <= 0
referenceSpeed <= 0.0
referenceTorque <= 0.0
16#3102_8001 The function block is not called in a cyclic interrupt, e.g. OB30.
(SetpointChannel)
16#3102_8005 Invalid configuration data: (SetpointChannel)
maxVelocity <= 0.0
gearRatio = 0.0
The configuration data are checked for plaisubility at the rising edge of
enable.
16#1108_8001 The function block is not called in a cyclic interrupt, e.g. OB30. (TPID)
16#1108_8005 Invalid configuration data: (TPID)
setNominalValue <= 0.0
upperlimit < lowerlimit
16#6101_8003 Less than two pairs of values in the breakpoint table or uneven number of
points.
(Torque Precontrol, friction table)
16#6101_8004 More than twenty pairs of values in the breakpoint table or uneven number
of points.
(Torque Precontrol, friction table)
16#6101_8005 One or more configuration values are invalid. (Torque Precontrol)
gearRatio <= 0.0
Jfix < 0.0
Jmandel < 0.0
Jmot < 0.0
typeOfDrive < 0
typeOfDrive > 1
The configuration data are checked for plaisubility at the rising edge of
enable.
16#6101_8006 Invalid diameter value (Torque Precontrol)
diamActVal <= 0.0

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 117
5 Functional description

ErrorID Description
16#7101_8001 The function block is not called in a cyclic interrupt, e.g. OB30
16#7101_8005 Invalid configuration data
controleMode < 0
controlMode > 6
typeOfDrive < 0
typeOfDrive > 1
sectionalConfig.diameter <= 0.0
sectionalConfig.maxVelocity = 0.0
sectionalConfig.gearRatio = 0.0
sectionalConfig.referenceSpeed = 0.0
sectionalConfig.referenceTorque = 0.0
sectionalConfig. HW_Address_Input <= 0
sectionalConfig.HW_Address_Output <= 0
The configuration data are checked for plaisubility at the rising edge of
enable.
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 118
5 Functional description

5.6.2 LCon_SectionalConfigSetup

This function is used to enter individual configuration data into a sectional drive
configuration data structure used by the sectional drive function block. The function
block can be called in any task.
Function ID: 6001

Schematic LAD Representation

SectionalConfigSetup
BOOL metricUnits SectionalConfig SectionalConfigType
BOOL holdIntChannel
BOOL setIntChannel
REAL driveControlMode
REAL jogVelocity
REAL speedMatchRampTime
REAL diameter
REAL KpAdaptionValue
REAL x1
© Siemens AG 2019 All rights reserved

REAL Kp1
REAL x2
REAL Kp2
REAL limRampTime
REAL setNominalValue
REAL setRampTime
REAL integTime
REAL derivTime
REAL
filterTime
REAL
intSetValue
REAL
deadBand
REAL
outValueFactor
REAL
upperLimit
REAL
lowerLimit
REAL
overrideVelocity
REAL
TensionAdjustment
REAL
tensionReference
REAL
Jfixed
REAL
JMandrel
REAL
JMotor
REAL
frictionAdjustment
REAL
maxVelocity
REAL
gearRatio

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 119
5 Functional description

REAL
referenceSpeed
REAL
referenceTorque
WORD
HW_Address_Input
WORD
HW_Address_Output

Input and Output Parameters

I/O Variable name Data Initial Description


type value
IN metricUnits BOOL TRUE FALSE: Imperial
TRUE: Metric
IN holdIntChannel BOOL TRUE FALSE: TPID – Normal integrator
operation
TRUE: TPID - Hold (freeze)
integrator
IN setIntChannel BOOL FALSE FALSE: TPID - Normal integrator
operation
TRUE: TPID - Set integrator
© Siemens AG 2019 All rights reserved

channel to intSetValue
IN derivControlMode BOOL FALSE FALSE: TPID – D-Action acts on
system deviation
TRUE: TPID - D-Action acts in the
actual value
IN jogVelocity REAL 10.0 [ LU / min ] Jog velocity setpoint
(no ramp)
IN speedMatchRamp REAL 0.5 [ s ] Ramp time for acceleration to
Time line speed
IN diameter REAL 1.0 [ m or inch ] Diameter value
IN kpAdaptionValue REAL 0.0 TPID - Kp-Adaption signal
IN x1 REAL 0.0 TPID - Abscissa-1 for KP-
adaption(1)
IN kp1 REAL 1.0 TPID - KP-adaption point(1)
IN x2 REAL 0.0 TPID - Abscissa-2 for KP-
adaption(2)
IN kp2 REAL 1.0 TPID - KP-adaption point(2)
IN limRampTime REAL 1000.0 [ms] TPID - Ramp-up time for pid
controller output limiting
IN setNominalValue REAL 100.0 TPID - Normalization value for
setpoint RFG
IN setRampTime REAL 1000.0 [ms] TPID - Ramp up time for
setpoint RFG
IN integTime REAL 2000.0 [ ms ] TPID - Integration time
constant
IN derivTime REAL 0.0 [ ms ] TPID - Differentiation time
constant
IN filterTime REAL 10.0 [ ms ] TPID - Actual value fitler time
constant
IN intSetValue REAL 0.0 TPID - Integrator set value
IN deadBand REAL 0.0 TPID - Deadband parameter
IN outValueFactor REAL 1.0 TPID - Output scaling factor

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 120
5 Functional description

I/O Variable name Data Initial Description


type value
IN upperLimit REAL 20.0 TPID - Controller output upper limit
IN lowerLimit REAL -20.0 TPID - Controller output lower limit
IN overrideVelocity REAL 10.0 [ LU / min ] Speed controller bias
(override, overcontrol) for
torque controlled modes
IN TensionAdjustment REAL 1.0 1.0 = 100%
Tension torque adjustment factor
IN tensionReference REAL 0.0 [ N or lbf ] Reference value for
tension setpoint. If set to zero
the setpoint is interpreted as
absolute value instead of a
Percentage.
IN JFixed REAL 0.0 [ kgm 2 or lbft /s 2 ] Fixed moment
of inertia, motor side
IN JMandrel REAL 0.0 [ kgm 2 or lbft / s 2 ] Fixed
moment of inertia, load side
IN JMotor REAL 0.0 [ kgm 2 or lbft / s 2 ] Motor inertia
IN frictionAdjustment REAL 0.0 1.0 = 100%
Adjustment factor of the friction
characteristic output. With
0.0 friction compensation is off.
© Siemens AG 2019 All rights reserved

IN maxVelocity REAL - [ LU / min ] Max velocity for


normalization
IN gearRatio REAL - Gear Ratio, Motor / Load
IN referenceSpeed REAL - [ rpm ] Normalization speed of
drive (p2000)
IN referenceTorque REAL - [ Nm ] Normalization torque of drive
(p2003)
IN HW_Address_Input HW_Su - Hardware address of the input area
bmodul of drive telegram
IN HW_Address_Output HW_Su - Hardware address of the output
bmodul area of drive telegram
OUT SectionalConfig Section - Sectional drive configuration Data
al
Config
Type

Functionality

This function creates one output structure of SectionalConfigType from the


configuration parameters. This is done to reduce the amount of input variables on
the sectional drive function block but still give the user easy access.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 121
5 Functional description

5.6.3 LCon_TorquePrecontrol

Torque pre-control calculation.The function block has to be called in a cyclic task.


Function block ID: 6101

Schematic LAD Representation


LCon_TorquePrecontrol

Bool enable busy Bool

Bool metricUnits error Bool

Int typeOfDrive errorID DWord

Real drivespeed totalinertia Real

Real lineAcceleration preCtrlMotor Real

Real diameter totalTorquePreCtrl Real

Real tensionSetpoint tensionTorque Real

Real JFix
© Siemens AG 2019 All rights reserved

Real JMandrel

Real JMot

Real gearRatio

Real frictionAdjustment

Real tensionAdjustment
accelerationAdjustm
Real
ent
Int sizeOfArray

"LCon_BreakPointTable" xn_speedValues

"LCon_BreakPointTable" yn_torqueValues

Input and Output Parameters

I/O Variable name Data Initial Description


type value
IN enable BOOL FALSE FALSE: Deactivate Function block
TRUE: Activate function block
IN metricUnits BOOL TRUE FALSE: Imperial
TRUE: Metric
IN typeOfDrive INT 0 Drive type:
0: Pull
1: Held
IN drivespeed REAL 0.0 [ rpm ] Actual drive speed (for the
friction

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 122
5 Functional description

I/O Variable name Data Initial Description


type value
characteristic)
IN lineAcceleration REAL 0.0 [ LU / s 2 ] Actual line acceleration
IN diameter REAL 0.0 [ m or inch ] Diameter value
IN tensionSetpoint REAL 0.0 [ N or lbf ] Tension setpoint values
IN JFix REAL - [ kgm 2 or lbft / s 2 ] Fixed moment of
inertia, motor
side
IN JMandrel REAL - [ kgm 2 or lbft / s 2 ] Fixed moment of
inertia, load
side
IN JMot REAL - [ kgm 2 or lbft / s 2 ] Motor inertia
IN gearRatio REAL - Gear Ratio, Motor / Load
IN frictionAdjustment REAL - 1.0 = 100%
Adjustment factor of the friction
characteristic
output. With 0.0 friction compensation
is off.
IN tensionAdjustment REAL - 1.0 = 100%
Tension torque adjustment factor
IN accelerationAdjustment REAL 1.0 1.0 = 100%
Adjustment factor of the acceleration
© Siemens AG 2019 All rights reserved

precontrol. With 0.0 precontrol is off.


IN sizeOfArray INT - length of array
IN xn_speedValues breakP - x-array of Speed values
ointTabl
e
IN yn_torqueValues breakP - y-array of Torque values
ointTabl
e
OUT busy BOOL FALSE FALSE: Function block not activated
TRUE: Function block active
OUT error BOOL FALSE FALSE: No error
TRUE: Error occurred, refer to error
identification
OUT errorID DWOR 16#000 Error identification, refer to error
D 0_0000 messages
errorID < 16#6101_8000: warning
errorID >= 16#6101_8000: error
OUT totalinertia REAL 0.0 [ kgm 2 or lbft / s 2 ] Total inertia of
the mechanical
system, reflected to the motor side
OUT preCtrlMotor REAL 0.0 [ Nm ] Motor torque from friction and
acceleration
OUT totalTorquePreCtrl REAL 0.0 [ Nm ] Sum of motor torque
OUT tensionTorque REAL 0.0 [ Nm ] Motor torque from tension.

Functionality

The block determines the pre-controlled torque for Δv/Δt.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 123
5 Functional description

The torque pre-control outputs the following torque setpoints to pre-control the
drive:
1. A torque setpoint as a function of the acceleration setpoint of the
machine/system ramp- function generator and the inertia
2. Friction torque setpoint is generated depending
on the drive speed using a characteristic.
3. Tension torque based on the tension setpoint and the diameter

In order to quickly compensate for disturbances and to implement the closed-loop


control in the first place (for a replacing speed control), the torque to be provided
from the drive must be specified as accurately as possible. Depending on the
control type, this is either realized additively after the speed controller or by
dynamically adjusting the torque limits. In both cases the appropriate torque must
be calculated using its moment of inertia and transferred to the drive. As an
alternative to the method integrated in this block, the integrated friction
characteristic of the drive system (only in SINAMICS S120) can also be used.

The precise setting of the compensation is especially important for indirect


NOTE
tension control.
This is so that the torque-generating current emulates, as far as possible, the
material Tension.
© Siemens AG 2019 All rights reserved

Calculations
The function block FBTorquePrecontrol calculates the following physical quantities:

Quantity Formula
Total 𝐽𝑀𝑎𝑛𝑑𝑟𝑒𝑙
𝑇𝑜𝑡𝑎𝑙𝐼𝑛𝑒𝑟𝑡𝑖𝑎 = + 𝐽𝑀𝑜𝑡 + 𝐽𝐹𝑖𝑥
moment of 𝐺𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜 2
inertia
Angular 𝑙𝑖𝑛𝑒𝑎𝑐𝑐𝑒𝑙𝑒𝑟𝑎𝑡𝑖𝑜𝑛 ⋅ 𝐺𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜
𝛼 = 2⋅
acceleration 𝑑𝑖𝑎𝑚𝑒𝑡𝑒𝑟
of the drive
Acceleration 𝑀 𝑎𝑐𝑐𝑒𝑙 = 𝑇𝑜𝑡𝑎𝑙𝐼𝑛𝑒𝑟𝑡𝑖𝑎 ⋅ 𝛼
torque
Friction 𝑀 𝑓𝑟𝑖𝑐𝑡 = 𝑓(𝑛)
torque
Tension 𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑆𝑒𝑡𝑝𝑜𝑖𝑛𝑡 ⋅ 𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝐴𝑑𝑗𝑢𝑠𝑡𝑚𝑒𝑛𝑡 ⋅ 𝑑𝑖𝑎𝑚𝑒𝑡𝑒𝑟
𝑀 𝑡𝑒𝑛𝑠𝑖𝑜𝑛 =
torque 2 ⋅ 𝐺𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜

This friction torque is internally determined using the function block TableChar. The
user is responsible for providing valid and sensible values in the appropriate data
fields. If the factor FrictionAdjustment is set to 0.0, TableChar is not called and
therefore a frictional torque is not added.
The pre-control torque of the motor, the sum of all pre-control torques and the
tension torque are calculated depending on the drive type. The total torque is
always the sum of the preCtrlMotor and tensionTorque.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 124
5 Functional description

Drive Total torque


mode
Pull 𝑀 𝑝𝑟𝑒𝐶𝑡𝑟𝑙𝑀𝑜𝑡𝑜𝑟 = 𝑀 𝑎𝑐𝑐 + 𝑀 𝑓𝑟𝑖𝑐
𝑀 𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑇𝑜𝑟𝑞𝑢𝑒 = 𝑀 𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑇𝑜𝑟𝑞𝑢𝑒
Held 𝑀 𝑝𝑟𝑒𝐶𝑡𝑟𝑙𝑀𝑜𝑡𝑜𝑟 = 𝑀 𝑎𝑐𝑐 + 𝑀 𝑓𝑟𝑖𝑐𝑡 𝑀 𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑇𝑜𝑟𝑞𝑢𝑒 =
− 𝑀 𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑇𝑜𝑟𝑞𝑢𝑒
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 125
5 Functional description

Block diagram
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 126
5 Functional description

Warning Messages
Warnings are indicated by the status of the outputs error and errorID:
error = FALSE and errorID <> 16#0000_0000

ErrorID Description
16#0000_0000 No Warning
16#6101_4005 The table of entered values is not monotonically (steadily) increasing -> no
matching value found
16#6101_4008 The table of entered values is not monotonically (steadily) increasing -> 2
values are identical

Error Messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
16#6101_8003 Less than two pairs of values in the breakpoint table or uneven number of
© Siemens AG 2019 All rights reserved

points.
16#6101_8004 More than twenty pair of values in breakpoint table
16#6101_8005 One or more configuration values are invalid.
gearRatio <= 0.0
Jfix < 0.0
Jmandel < 0.0
Jmot < 0.0
typeOfDrive < 0
typeOfDrive > 1
The configuration data are checked for plaisubility at the rising edge of
enable.

16#6101_8006 Invalid diameter value


diamActVal <= 0.0

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 127
5 Functional description

5.7 Winder function blocks


5.7.1 LCon_DiamCalcDivision

This function block is used to calculate the diameter of a winder by dividing the
material velocity by the winding shaft speed.
The function block has to be called in a cyclic interrupt, e.g. OB30.
Function block ID: 5101

Schematic LAD Representation

DiamCalcDivision

BOOL enable busy BOOL


BOOL holdDiameter error BOOL
BOOL metricUnits errorID DWORD
BOOL setDiameter atMinDia BOOL
REAL diameterSetValue atMaxDia BOOL
REAL lineVelocity
REAL shaftSpeed
REAL minDia
© Siemens AG 2019 All rights reserved

REAL maxDia
REAL minLineVelocity
REAL minShaftSpeed
REAL lineFilterTime
REAL shaftFilterTime
REAL diameterFilterTime
INT OBnumber
REAL tCycle
REAL diameter REAL

Input and Output parameters

I/O Variable name Data Initial Description


type value
IN enable BOOL FALSE FALSE: Function Block disabled
TRUE: Function Block enabled
IN holdDiameter BOOL FALSE FALSE: Diameter Calculation
TRUE: Hold diameter calculation
IN metricUnits BOOL TRUE FALSE: Imperial
TRUE: Metric
IN setDiameter BOOL FALSE FALSE: Diameter Calculation
TRUE: Set diameter to
diameterSetValue
IN diameterSetValue REAL 1.0 [m or inch] Diameter set value
IN lineVelocity REAL 0.0 [LU/min] Line velocity
IN shaftSpeed REAL 0.0 [rpm] Actual shaft speed
IN minDia REAL 0.1 [m or inch] Minimum diameter
IN maxDia REAL 2.0 [m or inch] Maximum diameter

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 128
5 Functional description

I/O Variable name Data Initial Description


type value
IN minLineVelocity REAL 5.0 [LU/min] Minimum Line velocity for
calculation
IN minShaftSpeed REAL 5.0 [rpm] Minimum shaft speed for
calculation
IN lineFilterTime REAL 20.0 [msec] Filter time of the line velocity
IN shaftFilterTime REAL 20.0 [msec] Filter time of the
shaftSpeedActual
IN diameterFilter REAL 50.0 [msec] Filter time for the calculated
Time diameter
IN OBnumber INT 30 Calling Cyclic Interrupt OB number
IN tCyle REAL 0.0 [ms] Cycle time the FB is called
IO diameter REAL - [m or inch] Diameter
OUT busy BOOL FALSE FALSE: Function Block inactive
TRUE: Function Block active
OUT error BOOL FALSE FALSE: No Error
TRUE: Error has occurred
OUT errorID DWORD 16#000 Error identification
0_0000 errorID<16#5101_8000: Warning
errorID>=16#5101_8000:Error
OUT atMinDia BOOL FALSE At minimum diameter
OUT atMaxDia BOOL FALSE At maximum diameter
© Siemens AG 2019 All rights reserved

Functionality
The function block determines the actual diameter value (diameter) of the roll being
wound (or unwound) using the input quantities:
• Web velocity (lineVelocity) - the web velocity is the setpoint velocity of the
machine and the velocity with which the main drive moves the material web. In
exceptional cases, it is possible to use the actual value from a tachometer
measuring the web speed.
• Shaft speed of the mandrel (shaftSpeed) – Actual speed of the winder shaft.
The actual motor speed is converted to the roll shaft (by the gear ratio) and is
used to calculate the diameter.
The calculation is based on the 𝐷 = 𝑣/(𝜋 ⋅ 𝑛) formula.

Quantity Metric Imperial


line m / min ft / min
velocity
winder rpm rpm
shaft
speed
diameter meter (m) inch (in)

The holdDiameter input will pause diameter calculation and hold the resulting
diameter at the current value when set to true.
The setDiameter input writes the diameterSetvalue as the diameter as long as the
actual shaft speed is below minimum shaft speed. The set value is limited by
the minimum and maximum diameter. With actual line velocity above line and
actual shaft speed above minimum and not hold, the diameter is calculated. The
result of the division is limited and smoothed.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 129
5 Functional description

Block diagram
© Siemens AG 2019 All rights reserved

Error Messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
16#5101_8001 The function block is not called in a cyclic interrupt, e.g. OB30.
16#5101_8005 Invalid configuration data:
minDia <= 0.0
maxDia <= 0.0
minDia >= maxDia
minLineVelocity <= 0.0
minShaftSpeed <= 0.0
The configuration data are checked for plausibility at the rising edge of
enable.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 130
5 Functional description

5.7.2 LCon_DiamCalcIntegral

This function block is used to calculate the diameter of a winder by dividing


material length change by the winding shaft revolutions. The function block has to
be called in a cyclic interrupt, e.g. OB30.
Function block ID: 5103

Schematic LAD Representation

LCon_DiamCalcIntegral

Bool enable error Bool

Bool holdDiameter errorID DWord

Bool metricUnits busy Bool

Bool setDiameter atMinDia Bool

Real diameterSetValue atMaxDia Bool

Real lineVelocity diamIsHold Bool


© Siemens AG 2019 All rights reserved

Real shaftSpeed webThickness Real

Real minDia

Real maxDia

Real minLineVelocity

Real minShaftSpeed

Real lineFilterTime

Real shaftFilterTime
measuringRevolution
Real
Count
Real firstDiameterOutput

Real diameterOutputRate

Int OBnumber

Real tCycle
diameter
Real Real

Input and Output parameters

I/O Variable name Data Initial Description


type value
IN enable BOOL FALSE FALSE: Function Block disabled
TRUE: Function Block enabled
IN holdDiameter BOOL FALSE FALSE: Diameter Calculation
TRUE: Hold diameter calculation

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 131
5 Functional description

I/O Variable name Data Initial Description


type value
IN metricUnits BOOL TRUE FALSE: Imperial
TRUE: Metric
IN setDiameter BOOL FALSE FALSE: Diameter Calculation
TRUE: Set diameter to
diameterSetValue
IN diameterSetValue REAL 1.0 [m or inch] Diameter set value
IN lineVelocity REAL 0.0 [LU/min] Line velocity
IN shaftSpeed REAL 0.0 [rpm] Actual shaft speed
IN minDia REAL 0.1 [m or inch] Minimum diameter
IN maxDia REAL 2.0 [m or inch] Maximum diameter
IN minLineVelocity REAL 5.0 [LU/min] Minimum Line velocity for
calculation
IN minShaftSpeed REAL 5.0 [rpm] Minimum shaft speed for
calculation
IN lineFilterTime REAL 20.0 [msec] Filter time of the line velocity
IN shaftFilterTime REAL 20.0 [msec] Filter time of the
shaftSpeedActual
IN Measuring REAL 2.0 [rev] Winder shaft revolutions for
Revolution diameter calculation interval
Count
IN firstDiameterOutput REAL 1.0 [ - ] Number of shaft rotations after first
© Siemens AG 2019 All rights reserved

diameter is calculated
IN diameterOutputRate REAL 1.0 [ - ] Number of rotations after next
diameter value is calculated
IN OBnumber INT 30 Calling Cyclic Interrupt OB number
IN tCyle REAL 0.0 [ms] Cycle time the FB is called
IO diameter REAL - [m or inch] Diameter
OUT busy BOOL FALSE FALSE: Function Block inactive
TRUE: Function Block active
OUT error BOOL FALSE FALSE: No Error
TRUE: Error has occurred
OUT errorID DWORD 16#000 Error identification
0_0000 errorID<16#5103_8000:Warning
errorID>=16#5103_8000:Error
OUT webThickness REAL 0.0 [m or in] Calculated web thickness in
units
OUT atMinDia BOOL FALSE At minimum diameter
OUT atMaxDia BOOL FALSE At maximum diameter
OUT diamIsHold BOOL FALSE Diameter calculation is stopped

Functionality

The diameter calculator determines the actual diameter value (diameter) of the roll
being wound (or unwound) using the input quantities:
• Web velocity (lineVelocity) - the web velocity is the setpoint velocity of the
machine and the velocity with which the main drive moves the material web. In
exceptional cases, it is possible to use the actual value from a tachometer
measuring the web speed.
• Shaft speed of the mandrel (shaftspeed) – Actual speed of the winder shaft.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 132
5 Functional description

The actual motor speed is converted to the roll shaft (by the gear ratio) and is used
to calculate the diameter.
The integral diameter calculation is also based on the division of the web quantity
by the angular quantity. However, quantities v and ω are integrated over a number
of roll revolutions that can be specified by measuringRevolutionCount. This is to
minimize the disturbing effect of processing just individual values. The following
applies:

Diameter = 2 ⋅ s/𝜑

Quantity Metric Imperial


line velocity m / min ft / min
winder shaft rpm fpm
speed
diameter meter (m) inch (in)
angle rad rad
length m ft

The holdDiameter input will pause diameter calculation and hold the resulting
diameter at the current value when set to true. The setDiameter input writes the
© Siemens AG 2019 All rights reserved

diametersetvalue as the diameter as long as the actual shaft speed is below


minimum shaft speed. The set diameter is limited.
With actual line velocity above minimum and actual shaft speed above and not
hold, the diameter is calculated. The result is limited and interpolated.
If the number of revolutions of the winding shaft - specified by parameter
diameterOutputRate – is reached, then the integrators are reset. One integrator will
give the length change of the material for the specified number of winder shaft
revolutions. From these two values the (average) diameter can be calculated.

Floating diameter calculation

To optimize the diameter signal quality a floating averaging over a defined number
of rotations (measuringRevolutionCount) is used internally.
The floating diameter calculation can be configured by the following configuration
parameter:
• MeasuringRevolutionCount
• FirstDiameterOutput
• DiameterOutputRate

After rising edge of input “enable” the first calculated diameter will be output after
the number of revolutions configured in “FirstDiameterOutput”.
After the first diameter output the calculated diameter will be refreshed cylic after
the number of revolutions configured in “DiameterOutputRate”.
The calculated diameter will be averaged over the number of revolutions
configured in “MeasuringRevolutionCount”, as long as the the parameterized
number of revolutions has been passed already.
The averaging of a specific number or revolutions is determinded by the depth
(array length) of an internal ring buffer. Inside the ring buffer the position deltas of

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 133
5 Functional description

line and winder axis will be entered. The buffer depth is calculated based on the
following formula:

MeasuringRevolutionCount
bufferdept h =
DiameterOutputRate

Is the result of the calculation a non natural number the value will be rounded to
next natural number (N = {1, 2,3, …}).Therby the the effective averaging over a
specific number of revolutions can differ to the configured value in
“MeasuringRevolutionCount” (compare example 3).
The following sketeches show the interacting of the configuration parameter. In the
function block a modulo cycle from 0° to 360° is recreated. The configuration of the
technology object is independend of that.

Example 1:
MeasuringRevolutionCount := 4
DiameterOutputRate := 1
FirstDiameterOutput := 2
© Siemens AG 2019 All rights reserved

MeasuringRevolutionCount

FirstDiameterOutput

DiameterOutputRate
effective averaging:

2 1st diameter output


3 2nd diameter output
4 3rd diameter output
4 4th diameter output
4 5th diameter output

Example 2:
MeasuringRevolutionCount := 4
DiameterOutputRate := 1
FirstDiameterOutput := 0.5

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 134
5 Functional description

MeasuringRevolutionCount

FirstDiameterOutput

DiameterOutputRate

effective averaging:

0.5 1st diameter output


1.5
2nd diameter output
2.5
3rd diameter output
3.5
4th diameter output
4 5th diameter output
4 6th diameter output

Example 3:
© Siemens AG 2019 All rights reserved

MeasuringRevolutionCount := 5
DiameterOutputRate := 2
FirstDiameterOutput := 1

MeasuringRevolutionCount

FirstDiameterOutput

DiameterOutputRate

effective averaging:

1
1st diameter output
3
2nd diameter output
5
3rd diameter output
6
4th diameter output

In addition in every measuring interval based on the diameter change the actual
material thickness is also calculated, e.g. for a rest length calculation.

𝑇ℎ𝑖𝑐𝑘𝑛𝑒𝑠𝑠 = [𝑑𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑁𝑒𝑤 − 𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑂𝑙𝑑]/𝑑𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑂𝑢𝑡𝑝𝑢𝑡𝑅𝑎𝑡𝑒

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 135
5 Functional description

Block Diagram

DiamCalcIntegral

maxDia

metricUnits Diameter = 2 * ( s /  )

setDiameter error
12 0

diameterSetValue
1 1
errorId
P 0
Last Raw D value
l diameter
linevelocity X Raw D value
a T
SV 1
u S
0 webThickness
lineFilterTime
s
 2
minLineVelocity
a 0 atMaxDia
b X Number of revolutions
[rad/s] for calculation reached
minShaftSpeed
i T
x Latch raw value atMaxDia
SV
[rad] ≥
l S y

i
shaftspeed
t 0

shaftFilterTime
y 1
Last Raw D value
2 0

Diameter
OutputRate 

holdDiameter

minDia
© Siemens AG 2019 All rights reserved

Error Messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
16#5103_8001 The function block is not called in a cyclic interrupt, e.g. OB30.
16#5103_8005 Invalid configuration data:
minDia <= 0.0
maxDia <= 0.0
minDia >= maxDia
measuringRevolutionCount <= 0.0
measuringRevolutionCount < diameterOutputRate
minLineVelocity <= 0.0
minShaftSpeed <= 0.0
The configuration data are checked for plaisubility at the rising edge of
enable.
16#5103_8006 Error during floating diameter calculation:
Calculated buffer depth is bigger as the configured maximum value
(MAX_LENGHTH_AVERAGE_VALE)

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 136
5 Functional description

5.7.3 LCon_DiamCalcAddition

This function block is used to calculate the diameter of a winder by adding twice
the material thickness per winding shaft revolutions. The function block has to be
called in a cyclic interrupt, e.g. OB30.
Function block ID: 5102

Schematic LAD Representation

DiamCalcAddition

BOOL enable busy BOOL


BOOL holdDiameter error BOOL
BOOL setDiameter errorID DWORD
INT typeOfWinder atMinDia BOOL
REAL diameterSetValue atMaxDia BOOL
REAL webThickness
REAL minDia
REAL maxDia
© Siemens AG 2019 All rights reserved

REAL minShaftSpeed
REAL shaftSpeed
REAL shaftFilterTime
INT OBnumber
REAL tCycle
REAL diameter REAL

Input and Output parameters

I/O Variable name Data Initial Description


type value
IN enable BOOL FALSE FALSE: Function Block disabled
TRUE: Function Block enabled
IN holdDiameter BOOL FALSE FALSE: Diameter Calculation
TRUE: Hold diameter calculation
IN setDiameter BOOL FALSE FALSE: Diameter Calculation
TRUE: Set diameter to
diameterSetValue
IN typeOfWinder INT 0 Winder type:
0: Rewind from above
1: Rewind from below
2: Unwind from above
3: Unwind from below
IN diameterSet REAL 1.0 [m or inch] Diameter set value
Value
IN webThickness REAL 0.001 [m or inch] web thickness
IN minDia REAL 0.1 [m or inch] Minimum diameter
IN maxDia REAL 2.0 [m or inch] Maximum diameter

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 137
5 Functional description

I/O Variable name Data Initial Description


type value
IN minShaftSpeed REAL 0.5 [rpm] Minimum shaft speed for
calculation
IN shaftSpeed REAL 0.0 [rpm] Actual shaft speed
IN shaftFilterTime REAL 20.0 [msec] Filter time of the
shaftSpeedActual
IN OBnumber INT 30 Calling Cyclic Interrupt OB number
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
IO diameter REAL - [m or inch] Diameter
OUT busy BOOL FALSE FALSE: Function Block inactive
TRUE: Function Block active
OUT error BOOL FALSE FALSE: No Error
TRUE: Error has occurred
OUT errorID DWORD 16#000 Error identification
0_0000 errorID<16#5102_8000:Warning
errorID>=16#5102_8000:Error
OUT atMinDia BOOL FALSE At minimum diameter
OUT atMaxDia BOOL FALSE At maximum diameter
© Siemens AG 2019 All rights reserved

Functionality

The diameter calculator determines the actual diameter value (diameter) of the roll
being wound (or unwound) using the input quantities:
• Web Thickness - the actual web (material) thickness.
• Shaft speed of the mandrel (shaftSpeed) – Actual speed of the winder shaft.

The actual motor speed is converted to the roll shaft (by the gear ratio) and is used
to calculate the diameter.
The holdDiameter input will pause diameter calculation and hold the resulting
diameter at the current value when set to true.
The setDiameter input writes the diametersetvalue as the diameter as long as the
actual shaft speed is below minimum shaft speed. The diameter set value is
limited.
With the actual shaft speed above minimum and not hold, the diameter is
calculated by integrating the diameter change rate based on the web thickness and
mandrel speed. The result of the integration is limited and smoothed.

This calculation method relies very much on the accuracy of the material
NOTE
thickness and the starting diameter value. Any deviation between the actual
effective material thickness and the set material thickness will lead to an invalid
diameter which error will get bigger after each revolution. An inaccurate starting
value will remain as an offset between the actual and the calculated diameter.
This calculation mode is mostly useful for metals where air entrapment and
inwound tension does not influence the effective material thickness.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 138
5 Functional description

Block diagram
© Siemens AG 2019 All rights reserved

Error Messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
16#5102_8001 The function block is not called in a cyclic interrupt, e.g. OB30.
16#5102_8005 Invalid configuration data:
minDia <= 0.0
maxDia <= 0.0
minDia >= maxDia
webThickness <= 0.0
minShaftSpeed <= 0.0
typeOfWinder < 0
typeOfWinder > 0
The configuration data are checked for plaisubility at the rising edge of
enable.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 139
5 Functional description

5.7.4 LCon_DiamCalcWebLength

This function block is used to calculate the diameter of a winder based on the
length of the material that is winded up and the material thickness. The function
block has to be called in a cyclic interrupt, e.g. OB30, OB95.
Function block ID: 5106

Schematic LAD Representation

LCon_DiamCalcWebLength

Bool enable error Bool

Bool holdDiameter errorID DWord

Bool metricUnits busy Bool

Bool setDiameter atMinDia Bool

Real diameterSetValue atMaxDia Bool

Int typeOfWinder

Real lineVelocity
© Siemens AG 2019 All rights reserved

Real minDia

Real maxDia

Real minLineVelocty

Real lineFilterTime

Real webThickness

Int OBnumber

Real tCycle
diameter
Real Real

Input and Output parameters

Name P-Type Data Comment


Type
enable IN Bool FALSE: Function Block disabled TRUE:
Function Block enabled
holdDiameter IN Bool FALSE: Diameter Calculation
TRUE: Hold diameter calculation
metricUnits IN Bool FALSE: Imperial
TRUE: Metric
setDiameter IN Bool FALSE: Diameter Calculation
TRUE: Set diameter to diameterSetValue
diameterSetValue IN Real [m or inch] Diameter set value
typeOfWinder IN Int Winder type:
0: Rewind from above
1: Rewind from below

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 140
5 Functional description

Name P-Type Data Comment


Type
2: Unwind from above
3: Unwind from below
lineVelocity IN Real [LU/min] Line velocity
minDia IN Real [m or inch] Minimum diameter
maxDia IN Real [m or inch] Maximum diameter
minLineVelocity IN Real [LU/min] Minimum Line velocity for calculation
lineFilterTime IN Real [ms] Filter time of the line velocity
webThickness IN Real [m or in] Web thickness in units
OBnumber IN Int Calling Cyclic Interrupt OB number
tCycle IN Real [ms] Cycle time the FB is called
error OUT Bool FALSE: No Error
TRUE: Error has occurred
errorID OUT DWord Error identification
errorID<16#5106_8000:Warning
errorID>=16#5106_8000:Error
busy OUT Bool FALSE: Function Block inactive
TRUE: Function Block active
atMinDia OUT Bool At minimum diameter
© Siemens AG 2019 All rights reserved

atMaxDia OUT Bool At maximum diameter


diameter IN_OUT Real [m or inch] Diameter

Functionality

The diameter calculator determines the actual diameter value of the roll using the
following input quantities:
• Web Thickness - the actual web (material) thickness.
• The length of the winded material

With the help of the actual velocity of the master axis the length of the rewinded or
unwinded material on the core is calculated. In addition with the material thickness
the current diameter of the winder can be calculated.
The holdDiameter input will pause the diameter calculation and hold the resulting
diameter at the current value when set to true.
The setDiameter input writes the diametersetvalue as the diameter as long as the
actual line speed is below minimum line speed setpoint. The diameter set value is
limited.
With the actual line speed above minimum and not hold, the diameter is calculated
by integrating the master speed in addition with the material thickness. The input
velocity of the master axis can be smoothed before the integration.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 141
5 Functional description

This calculation method relies very much on the accuracy of the material
NOTE
thickness and the starting diameter value. Any deviation between the actual
effective material thickness and the set material thickness will lead to an invalid
diameter which error will get bigger after each revolution. An inaccurate starting
value will remain as an offset between the actual and the calculated diameter.
This calculation mode is mostly useful for metals where air entrapment and
inwound tension does not influence the effective material thickness.

Block diagramFigure 5-1

DiamCalcWebLength

enable
error
maxDiam
errorID
metricUnits
holdDiameter
P busy
12
l atMinDia
diameterSetValue
a atMaxDia
setDiameter u 1
diamter
typeOfWinder s
lineFilterTime i
© Siemens AG 2019 All rights reserved

lineVelocity
b
i X F(x)
minLineVelocity
L X
tCycle i -1
OBnumber t
webThickness y
minDiam

Error Messages
ErrorID Description
16#0000_0000 No error
16#5106_8001 The function block is not called in a cyclic interrupt, e.g. OB30.
16#5106_8005 Invalid configuration data:
minDia <= 0.0
maxDia <= 0.0
minDia >= maxDia
webThickness <= 0.0
minShaftSpeed <= 0.0
typeOfWinder < 0
typeOfWinder > 0
The configuration data are checked for plaisubility at the rising edge of
enable.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 142
5 Functional description

5.7.5 LCon_WITorquePrecontrol

Torque pre-control calculation for winder.


The function block has to be called in a cyclic task.
Function block ID: 4102

Schematic LAD Representation


LCon_WITorquePrecontrol

Bool enable busy Bool

Bool torqueOn error Bool

Bool metricUnits errorID DWord

Int typeOfWinder totalinertia Real

Real drivespeed mass Real

Real lineAcceleration preCtrlMotor Real


© Siemens AG 2019 All rights reserved

Real diamActVal totalTorquePreCtrl Real

Real tensionSetpoint variableInertia Real

Real density maxInertia Real

Real diamMin tensionTorque Real

Real diamMax

Real width

Real fillFactor

Real JFix

Real JMandrel

Real JMot

Real gearRatio

Real frictionAdjustment

Real tensionAdjustment

Real accelerationAdjustment

Int sizeOfArray
"LCon_BreakPoint
xn_speedValues
Table"
"LCon_BreakPoint
yn_torqueValues
Table"

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 143
5 Functional description

Input and Output Parameters

I/O Variable name Data Initial Description


type value
IN enable BOOL FALSE FALSE: Deactivate Function block
TRUE: Activate function block
IN torqueOn BOOL FALSE FALSE: Only inertia calculation
TRUE: Activate torque calculation
IN metricUnits BOOL TRUE FALSE: Imperial
TRUE: Metric
IN typeOfWinder INT 0 Winder type:
0: Rewind from above
1: Rewind from below
2: Unwind from above
3: Unwind from below
IN driveSpeed REAL 0.0 [ rpm ] Actual winder speed (fo the
friction characteristic)
IN lineAcceleration REAL 0.0 [ m / s 2 or ft / s 2 ] Actual line
acceleration
IN diamActVal REAL 0.0 [ m or inch ] Diameter actual value
IN tensionSetpoint REAL 0.0 [ N or lbf ] Tension setpoint values
IN density REAL - [ kg / m 3 or lb / ft 3 ] Material density
© Siemens AG 2019 All rights reserved

IN diamMin REAL - [ m or inch ] Minimum diameter


IN diamMax REAL - [ m or inch ] Maximum diameter
IN width REAL - [ m or inch ] Width of the material
IN fillFactor REAL - 1.0 = 100%
Material fill factor (used in case of
traversed
materials like cable)
IN JFix REAL - [ kgm 2 or lbft / s 2 ] Fixed moment of
inertia, motor
side
IN JMandrel REAL - [ kgm 2 or lbft / s 2 ] Fixed moment of
inertia, load
side
IN JMot REAL - [ kgm 2 or lbft / s 2 ] Motor inertia
IN gearRatio REAL - Gear Ratio, Motor / Load
IN frictionAdjustment REAL - 1.0 = 100%
Adjustment factor of the friction
characteristic
output. With 0.0 friction compensation
is off.
IN tensionAdjustment REAL - 1.0 = 100%
Tension torque adjustment factor
IN accelerationAdjustment REAL 1.0 1.0 = 100%
Adjustment factor of the acceleration
precontrol. With 0.0 precontrol is off.
IN sizeOfArray IN - Size of the array
IN xn_speedValues breakP - x-array of Speed values
ointTabl
e
IN yn_torqueValues breakP - y-array of Torque values
ointTabl
e
OUT busy BOOL FALSE FALSE: Function block not activated

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 144
5 Functional description

I/O Variable name Data Initial Description


type value
TRUE: Function block active
OUT error BOOL FALSE FALSE: No error
TRUE: Error occurred, refer to error
identification
OUT errorID DWOR 16#000 Error identification, refer to error
D 0_0000 messages
errorID < 16#4102_8000: warning
errorID >= 16#4102_8000: error
OUT totalinertia REAL 0.0 [ kgm 2 or lbft / s 2 ] Total inertia of
the mechanical
system, reflected to the motor side
OUT mass REAL 0.0 [ kg or lbft ] Mass of the material
OUT preCtrlMotor REAL 0.0 [ Nm ] Motor torque from friction and
acceleration
OUT totalTorquePreCtrl REAL 0.0 [ Nm ] Sum of motor torque
OUT variableInertia REAL 0.0 [ kgm 2 or lbft / s 2 ] Inertia resulting
from the
material, reflected to the motor side.
OUT maxInertia REAL 0.0 [ kgm 2 or lbft / s 2 ] -Maximum
inertia (at maximum
diameter).
© Siemens AG 2019 All rights reserved

OUT tensionTorque REAL 0.0 [ Nm ] Motor torque from tension.

Functionality
The block determines the following:

• The variable moment of inertia for Kp adaptation of the speed and tension
controller
• The pre-controlled torque for Δv/Δt
• The torque pre-control outputs the following torque setpoints to pre-control the
winder drive:
5. A torque setpoint as a function of the acceleration setpoint of the
machine/system ramp-function generator and the inertia
6. Friction torque setpoint is generated depending on the shaft speed of the
winder using a characteristic.
7. Tension torque based on the tension setpoint and the diameter

In order to quickly compensate for disturbances and to implement the closed-loop


control in the first place (for a replacing speed control), the torque to be provided
from the drive must be specified as accurately as possible. Depending on the
control type, this is either realized additively after the speed controller or by
dynamically adjusting the torque limits.
In both cases, starting from the weight of the wound material, the appropriate
torque must be calculated using its moment of inertia (wound material) and
transferred to the drive.
As an alternative to the method integrated in this block, the integrated friction
characteristic of the drive system (SINAMICS) can also be used.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 145
5 Functional description

The precise setting of the compensation is especially important for indirect


NOTE
tension control.
This is so that the torque-generating current emulates, as far as possible, the
material tension.
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 146
5 Functional description

Calculations
The function block FB WITorquePrecontrol calculates the following physical
quantities:

Quantity Formula
Mass of the 𝜋 ⋅ 𝐷𝑒𝑛𝑠𝑖𝑡𝑦 ⋅ 𝑤𝑖𝑑𝑡ℎ ⋅ (𝑑𝑖𝑎𝑚𝐴𝑐𝑡𝑉𝑎𝑙 2 − 𝑑𝑖𝑎𝑚𝑀𝑖𝑛2 )
wound material 𝑀𝑎𝑠𝑠 =
4
Moment of inertia 𝑑𝑖𝑎𝑚𝐴𝑐𝑡𝑉𝑎𝑙 2 + 𝑑𝑖𝑎𝑚𝑀𝑖𝑛2
of the 𝑉𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝐼𝑛𝑒𝑡𝑖𝑎 = 𝑀𝑎𝑠𝑠 ⋅
8 ⋅ 𝐺𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜 2
wound material
Total moment of 𝐽𝑀𝑎𝑛𝑑𝑟𝑒𝑙
𝑇𝑜𝑡𝑎𝑙𝐼𝑛𝑒𝑟𝑡𝑖𝑎 = + 𝑉𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝐼𝑛𝑒𝑟𝑡𝑖𝑎 + 𝐽𝑀𝑜𝑡 + 𝐽𝐹𝑖𝑥
inertia 𝐺𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜 2

Maximum mass of 𝜋 ⋅ 𝐷𝑒𝑛𝑠𝑖𝑡𝑦 ⋅ 𝑤𝑖𝑑𝑡ℎ ⋅ (𝑑𝑖𝑎𝑚𝑀𝑎𝑥 2 − 𝑑𝑖𝑎𝑚𝑀𝑖𝑛2 )


the wound 𝑚𝑎𝑠𝑠𝑚𝑎𝑥 =
4
material
Maximum 𝑑𝑖𝑎𝑚𝑀𝑎𝑥 2 + 𝑑𝑖𝑎𝑚𝑀𝑖𝑛2
moment of inertia 𝑉𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝐼𝑛𝑒𝑡𝑖𝑎𝑚𝑎𝑥 = 𝑚𝑎𝑠𝑠𝑚𝑎𝑥 ⋅
8 ⋅ 𝐺𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜 2
of the wound
material
Maximum 𝐽𝑀𝑎𝑛𝑑𝑟𝑒𝑙
𝑇𝑜𝑡𝑎𝑙𝐼𝑛𝑒𝑟𝑡𝑖𝑎 = + 𝑉𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝐼𝑛𝑒𝑟𝑡𝑖𝑎 + 𝐽𝑀𝑜𝑡 + 𝐽𝐹𝑖𝑥
moment of inertia 𝐺𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜 2
© Siemens AG 2019 All rights reserved

Angular 𝑙𝑖𝑛𝑒𝑎𝑐𝑐𝑒𝑙𝑒𝑟𝑎𝑡𝑖𝑜𝑛 ⋅ 𝐺𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜


𝛼 =2⋅
acceleration of 𝑑𝑖𝑎𝑚𝐴𝑐𝑡𝑉𝑎𝑙
the
roll
Acceleration 𝑀𝑎𝑐𝑐𝑒𝑙 = 𝑇𝑜𝑡𝑎𝑙𝐼𝑛𝑒𝑟𝑡𝑖𝑎 ⋅ 𝛼
torque
Friction torque 𝑀𝑓𝑟𝑖𝑐𝑡 = 𝑓(𝑛)
Tension torque 𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑆𝑒𝑡𝑝𝑜𝑖𝑛𝑡 ⋅ 𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝐴𝑑𝑗𝑢𝑠𝑡 ⋅ 𝑑𝑖𝑎𝑚𝐴𝑐𝑡𝑉𝑎𝑙
𝑀𝑡𝑒𝑛𝑠𝑖𝑜𝑛 =
2 ⋅ 𝐺𝑒𝑎𝑟𝑅𝑎𝑡𝑖𝑜

This friction torque is internally determined using the function block TableChar. The
user is responsible for providing valid and sensible values in the appropriate data
fields. If the factor FrictionAdjustment is set to 0.0, TableChar is not called and
therefore a frictional torque is not added.
The pre-control torque of the motor, the sum of all pre-control torques and the
tension torque are calculated depending on the winder type. The total torque is
always the sum of the preCtrlMotor and tensionTorque.
The winding mode is always defined assuming a positive line speed. If the
leading value becomes negative the winding mode will be inverted automatically (a
rewinder becomes an unwinder and vice versa). The same applies for winding from
above and from below. This inversion is automatic.

Winding mode Total torque


Rewind from MpreCtrlMotor = Macc + Mfrict
above MtensionTorque = MtensionTorque
Rewind from MpreCtrlMotor =- Macc + Mfrict
below MtensionTorque = - MtensionTorque
Unwind from MpreCtrlMotor = Macc + Mfrict
above MtensionTorque = -MtensionTorque
Unwind from MpreCtrlMotor = -Macc + Mfrict

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 147
5 Functional description

below MtensionTorque = MtensionTorque

Warning Messages
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000

ErrorID Description
16#0000_0000 No Warning
16#4102_4005 The table of entered values is not monotonically (steadily) increasing -> no
matching value found
16#4102_4008 The table of entered values is not monotonically (steadily) increasing -> 2
values are identical

Error Messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
© Siemens AG 2019 All rights reserved

16#4102_8003 Less than two pairs of values in the breakpoint table or uneven number of
points.
16#4102_8004 More than twenty pairs of values in the breakpoint table or uneven number
of points.
16#4102_8005 One or more configuration values are invalid – Check Min values, max
values and
other settings.
gearRatio <= 0.0
density < 0.0
diamMin <= 0.0
diamMax <= diamMin
width < 0.0
fillFactor <= 0.0
Jfix < 0.0
Jmandrel < 0.0
Jmot < 0.0
typeOfWinder < 0
typeOfWinder > 3
The configuration data are checked for plaisubility at the rising edge of
enable.
16#4102_8006 Invalid diameter
diamActVal <= 0.0
diamActVal < diamMin

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 148
5 Functional description

5.7.6 LCon_RestLengthCalc

Calculation of the rest length of the coil. The function can be called in any task.
Function ID: 4001

Schematic LAD Representation

RestLengthCalc

REAL webThickness RET_VAL REAL


REAL actualDiameter
REAL targetDiameter
REAL offset

Input and Output parameters


© Siemens AG 2019 All rights reserved

I/O Variable name Data Initial Description


type value
IN webThickness REAL - [m or inch] Thickness of material
IN actualDiameter REAL - [m or inch] Actual diameter of coil
IN targetDiameter REAL - [m or inch] Target diameter/end diameter of
coil
IN Offset REAL - [m or inch] Offset of rest length of the coil
OUT RET_VAL REAL - [m or inch] Rest length of the coil

Functionality

Depending on the roll parameters that have been entered, the function calculates
the residual length of the material. To do this, the following data is required – the
thickness of the material on the roll (webThickness), the actual diameter
(actualDiameter) and the diameter to be reached (targetDiameter). In this case, the
target diameter represents the end of the roll or the diameter to be reached.
Depending on whether the target diameter is greater than or less than the actual
diameter, the length of the material on the roll or the length of the material still to be
wound is output. The thickness of the material web (webThickness) is limited using
the internal constants MIN_THICKNESS and MAX_THICKNESS.

𝜋
𝑅𝐸𝑇𝑉𝐴𝐿 = ⋅ (𝑎𝑐𝑡𝑢𝑎𝑙𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟 2 − 𝑡𝑎𝑟𝑔𝑒𝑡𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟 2 ) + 𝑜𝑓𝑓𝑠𝑒𝑡
4 ⋅ 𝑤𝑒𝑏𝑡ℎ𝑖𝑐𝑘𝑛𝑒𝑠𝑠

Winder mode Actual diameter Target Diameter


winder d1<d2 d2 (full roll, max. diameter)
unwinder d2 < d1 d1 (empty roll, min. diameter)

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 149
5 Functional description
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 150
5 Functional description

5.7.7 LCon_RestDiameterCalc

Calculation of the rest diameter of the coil


The function can be called in any task.
Function ID: 4002

Schematic LAD Representation

RestDiameterCalc

REAL webThickness RET_VAL REAL


REAL actualDiameter
REAL length
BOOL rewind

Input and Output parameters


© Siemens AG 2019 All rights reserved

I/O Variable name Data Initial Description


type value
IN webThickness REAL - [m or inch] Thickness of material
IN actualDiameter REAL - [m or inch] Actual diameter of coil
IN length REAL - [m or inch] Length to un/rewind
IN rewind BOOL - FALSE: Un-winder
TRUE: Re-winder
OUT RET_VAL REAL - [m or inch] Rest diameter to be coiled

Functionality

The function uses the input parameters to calculate the target diameter of a roll.
The calculation relies on the material thickness (webThickness), the actual roll
diameter (actualDiameter) and the material length to be wound or unwound
(length). The winding mode is defined using the windingMode input. The material
thickness (webThickness) is internally limited (MIN_THICKNESS,
MAX_THICKNESS).
In case of a too high material length input the function result is zero.

Winder

𝑎𝑐𝑡𝑢𝑎𝑙𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟 2 𝑤𝑒𝑏𝑇ℎ𝑖𝑐𝑘𝑛𝑒𝑠𝑠 ⋅ 𝑙𝑒𝑛𝑔𝑡ℎ


𝑅𝑒𝑠𝑡𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝐶𝑎𝑙𝑐 = 2 ⋅ √( )+( )
4 𝜋

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 151
5 Functional description

Unwinder

𝑎𝑐𝑡𝑢𝑎𝑙𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟 2 𝑤𝑒𝑏𝑇ℎ𝑖𝑐𝑘𝑛𝑒𝑠𝑠 ⋅ 𝑙𝑒𝑛𝑔𝑡ℎ


𝑅𝑒𝑠𝑡𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝐶𝑎𝑙𝑐 = 2 ⋅ √( )−( )
4 𝜋
© Siemens AG 2019 All rights reserved

Winder Actual diameter Target diameter


mode
Winder d1 < d2 d2 (full roll, max. diameter)
Unwinder d2 < d1 d1 (empty roll, min. diameter)

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 152
5 Functional description

5.7.8 LCon_Taper

Calculation of a reduction factor for the tension setpoint of a winder as a function of


the diameter.
The function block can be called in any cyclic task.
Function block ID: 4101

Schematic LAD Representation

Taper

BOOL enable busy BOOL


INT taperMode error BOOL
REAL diamActval errorID DWORD
REAL upperLimitTaper tensionTaper REAL
REAL lowerLimitTaper
REAL taperRatio
REAL taperDiameterStart
REAL taperDiameterMax
© Siemens AG 2019 All rights reserved

INT NoOfBreakpoints
breakPointTable tensionValues
breakPointTable diametervalues

Input and Output parameters

I/O Variable name Data type Initial Description


value
IN enable BOOL FALSE FALSE: Function block is disabled
TRUE Function block is enabled
IN taperMode INT - Selection of the taper mode:
0: No taper
1: Linear taper characteristic
2: Hyperbolic taper characteristic (max.
reduction at target diameter)
3: Hyperbolic taper characteristic (max.
reduction at infinite diameter)
4: Breakpoint Table
IN diamActVal REAL 0.0 [ m or inch ] Actual diameter value
IN upperLimitTaper REAL 100.0 [ % ] Max. taper value
IN lowerLimitTaper REAL 0.0 [ % ] Min. taper value
IN taperRatio REAL 0.0 [ % ] Maximum reduction at
taperDiameterMax
IN taperDiameterStart REAL 0.2 [ m or inch ] Diameter starting value for
the tension
reduction
IN taperDiameterMax REAL 1.0 [ m or inch ] Max. Diameter value

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 153
5 Functional description

I/O Variable name Data type Initial Description


value
IN NoOfBreakpoints INT 20 No. of break points for breakpoint table
IN tensionValues breakPoin - tension values
tTable
IN diametervalues breakPoin - diameter values
tTable
OUT busy BOOL FALSE FALSE: Taper block inactive
TRUE: Taper block active
OUT error BOOL FALSE FALSE: No error
TRUE: Error occurred, refer to error
identification
OUT errorId DWORD 16#00 Error identification, refer to error
00_00 messages
00 errorID < 16#4101_8000: warning
errorID >= 16#4101_8000: error
OUT tensionTaper REAL 1.0 Taper reduction factor, typically
0 < tensionTaper < 1.0

Functionality
© Siemens AG 2019 All rights reserved

The tension taper characteristic is used to define with which tension the material
should be wound onto the roll as a function of the roll diameter. It only makes
sense to use the tension taper characteristic while actually rewinding in order to
wind the inner layers tightly. For dancer roll controls, the tension taper
characteristic can be used to reduce the pressure setpoint for the dancer roll
support. In this case, the output of the characteristic must be multiplied with the
tension setpoint and made available for the dancer system interface, e.g. analog
output. The block is activated using the enable input. Depending on the mode
selected at input tensionTaperMode, the tension reduction factor is calculated as a
function of the diameter present at diamActVal and output in tensionTaper. The
way in which the reduction factor is processed depends on the mode that has been
selected.

Table 5-3
Calculation Description
mode
0 = No taper No tension taper mode is defined, the function block outputs 1.0 (no reduction
factor).
1 = Linear From a starting diameter that has to be entered (taperDiameterStart), the
taper reduction factor is linearly reduced to the maximum diameter
characteristic (taperDiameterMax) with a reduction defined by the parameter taperRatio.

diamActVal < taperDiameterStart:

𝑡𝑒𝑛𝑠𝑖𝑜𝑛 𝑇𝑎𝑝𝑒𝑟 = 1.0

taperDiameterStart < diamActVal < taperDiameterMax:

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 154
5 Functional description

Calculation Description
mode
𝑡𝑎𝑝𝑒𝑟𝑟𝑎𝑡𝑖𝑜
𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑇𝑎𝑝𝑒𝑟 = (1 − ( )
100
𝑑𝑖𝑎𝑚𝐴𝑐𝑡𝑉𝑎𝑙 − 𝑡𝑎𝑝𝑒𝑟𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑆𝑡𝑎𝑟𝑡
⋅( ))
𝑡𝑎𝑝𝑒𝑟𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑀𝑎𝑥 − 𝑡𝑎𝑝𝑒𝑟𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑆𝑡𝑎𝑟𝑡

diamActVal > taperDiameterMax:


𝑡𝑎𝑝𝑒𝑟𝑅𝑎𝑡𝑖𝑜
𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑇𝑎𝑝𝑒𝑟 = (1 − )
100

2= From a starting diameter that has to be entered (taperDiameterStart) the


Hyperbolic reduction factor is reduced as hyperbolic function with taperRatio to the
taper maximum diameter (taperDiameterMax).
characteristic In this case, the reduction is at a maximum when the maximum diameter has
1 been reached.
diamActVal < taperDiameterStart:

𝑡𝑒𝑛𝑠𝑖𝑜𝑛 𝑇𝑎𝑝𝑒𝑟 = 1.0

taperDiameterStart < diamActVal < taperDiameterMax:


© Siemens AG 2019 All rights reserved

𝑡𝑎𝑝𝑒𝑟𝑅𝑎𝑡𝑖𝑜 𝑑𝑖𝑎𝑚𝐴𝑐𝑡𝑉𝑎𝑙 – 𝑡𝑎𝑝𝑒𝑟𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑆𝑡𝑎𝑟𝑡


𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑇𝑎𝑝𝑒𝑟 = 1 − ∗( )
100 𝑑𝑖𝑎𝑚𝐴𝑐𝑡𝑉𝑎𝑙
𝑡𝑎𝑝𝑒𝑟𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑀𝑎𝑥

𝑡𝑎𝑝𝑒𝑟𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑀𝑎𝑥 − 𝑇𝑎𝑝𝑒𝑟𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑆𝑡𝑎𝑟𝑡

diamActVal > taperDiameterMax:


𝑡𝑎𝑝𝑒𝑟𝑅𝑎𝑡𝑖𝑜
𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑇𝑎𝑝𝑒𝑟 = (1 − )
100
3= From a starting diameter that has to be entered (taperDiameterStart) the
Hyperbolic reduction factor is reduced as hyperbolic function with taperRatio to the
taper maximum diameter (taperDiameterMax). In this case, full reduction is never
characteristic reached.
2 diamActVal < taperDiameterStart:

𝑡𝑒𝑛𝑠𝑖𝑜𝑛 𝑇𝑎𝑝𝑒𝑟 = 1.0

taperDiameterStart < diamActVal:


𝑡𝑎𝑝𝑒𝑟𝑅𝑎𝑡𝑖𝑜 𝑡𝑎𝑝𝑒𝑟𝐷𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑆𝑡𝑎𝑟𝑡
𝑡𝑒𝑛𝑠𝑖𝑜𝑛𝑇𝑎𝑝𝑒𝑟 = (1 − ⋅ (1 − ))
100 𝑑𝑖𝑎𝑚𝐴𝑐𝑡𝑉𝑎𝑙

4= The reduction factor is determined by characteristic defined as breakpoint


Breakpoint table. The breakpoint table consists of pairs of values diameter / reduction
table factor. The factor is linearly interpolated between the breakpoints of the
characteristic.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 155
5 Functional description

Graphic representation

Warning Messages
© Siemens AG 2019 All rights reserved

Warnings are indicated by the status of the outputs error and errorID: error =
FALSE and errorID <> 16#0000_0000

ErrorID Description
16#0000_0000 No Warning
16#4101_4005 The table of entered values is not monotonically (steadily) increasing -> no
matching value found
16#4101_4008 The table of entered values is not monotonically (steadily) increasing -> 2
values are identical

Error Messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

Table 5-4
ErrorID Description
16#0000_0000 No error
16#4101_8003 Less than two pairs of values in the breakpoint table or uneven number of
points.
16#4101_8004 More than twenty pairs of values in the breakpoint table or uneven number of
points.
16#4101_8005 Invalid configuration data:
upperLimitTaper < lowerLimitTaper
lowerLimitTaper < 0.0
Additionally for mode 1 – 3:
taperDiameterStart < 0.0
taperDiameterMax <= taperDiameterStart

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 156
5 Functional description

ErrorID Description
taperRatio < 0.0
taperRatio > 100.0
The configuration data are checked for plausibility at the rising edge of
enable.

16#4101_8006 Invalid diameter


diamActVal <= 0.0
16#4101_C000 Wrong case
Invalid selection of the calculation mode
taperMode < 0
taperMode > 4
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 157
5 Functional description

5.7.9 LCon_WinderConfigSetup

This function block is used to enter individual configuration data into a winder
configuration data structure used by the winder.
Function ID: 4003

Schematic LAD Representation

LCon_WinderConfigSetup
"LCon_Winder
Bool metricUnits WinderConfig
ConfigType"
Real jogVelocity

Real speedMatchRampTime

Int typeOfDiameterCalc

Real diameterSetValue

Real webThickness

Real minDia
© Siemens AG 2019 All rights reserved

Real maxDia

Real minLineVelocity

Real minShaftSpeed

Real lineFilterTime

Real shaftFilterTime

Real diameterFilterTime
measuringRevolutionCo
Real
unt
Real firstDiameterOutput

Real diameterOutputRate

Real KpAdaptionValue

Bool holdIntChannel

Bool setIntChannel
useSetValForFrictionCo
Bool
mp
Real x1

Real Kp1

Real x2

Real Kp2

Real limRampTime

Real setNominalValue

Real setRampTime

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 158
5 Functional description

Real integTime

Real derivTime

Real filterTime

Real intSetValue

Bool derivControlMode

Real deadBand

Real outValueFactor

Real upperLimit

Real lowerLimit

Real overrideVelocity

Real TensionAdjustment

Real tensionReference

Real MaterialWidth

Real MaterialDensity

Real MaterialFillFactor
© Siemens AG 2019 All rights reserved

Real JFixed

Real JMandrel

Real JMotor

Real accelerationAdjustment

Real frictionAdjustment

Real maxVelocity

Real gearRatio

Real referenceSpeed

Real referenceTorque

HW_SUBMODULE HW_Address_Input

HW_SUBMODULE HW_Address_Output

Input and Output Parameters

I/O Variable name Data Initial Description


type value
IN metricUnits BOOL TRUE FALSE: Imperial
TRUE: Metric
IN jogVelocity REAL 10.0 [ LU / min ] Jog velocity setpoint (no ramp)
IN speedMatchRamp REAL 0.5 [ s ] Ramp time for acceleration to line
Time speed
IN typeOfDiameterCalc INT 2 Selection of diameter calculation method:

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 159
5 Functional description

I/O Variable name Data Initial Description


type value
0: Division
1: Thickness addition
2: Integral calculation
3: External diameter determination. Input
via diameterSetValue.
IN diameterSetValue REAL 1.0 [ m or inch ] Diameter set value
Used as external diameter source.
IN webThickness REAL 0.001 [ m or inch ] Web thickness
If integral diameter calculation is used the
calculated thickness is displayed here.
IN minDia REAL 0.01 [ m or inch ] Minimum diameter
IN maxDia REAL 2.0 [ m or inch ] Maximum diameter
IN minLineVelocity REAL 0.5 [LU / min ] Minimum line velocity for
diameter calculation
IN minShaftSpeed REAL 2.0 [ rpm ] Minimum shaft speed for diameter
calculation
IN lineFilterTime REAL 20.0 [ ms ] Filter time for line velocity
IN shaftFiltertime REAL 20.0 [ ms ] Filter time for shaft speed
IN diameterFilterTime REAL 50.0 [ ms ] Diameter calculator filter time
IN measuringRevolution REAL 2.0 [ rev ] Shaft revolution counts for integral
Count diameter
© Siemens AG 2019 All rights reserved

calculation
IN kpAdaptionValue REAL 0.0 TPID - Kp-Adaption signal
IN holdIntChannel BOOL FALSE FALSE:TPID – Normal integrator operation
TRUE: TPID - Hold (freeze) integrator
IN setIntChannel BOOL FALSE FALSE: TPID - Normal integrator
operation
TRUE: TPID - Set integrator channel to
intSetValue
IN useSetValForFriction BOOL FALSE TRUE: Use speed setpoint for friction
Comp compensation
FALSE: Use speed actual value for friction
compensation
IN x1 REAL 0.0 TPID - Abscissa-1 for KP-adaption(1)
IN kp1 REAL 1.0 TPID - KP-adaption point(1)
IN x2 REAL 0.0 TPID - Abscissa-2 for KP-adaption(2)
IN kp2 REAL 1.0 TPID - KP-adaption point(2)
IN limRampTime REAL 1000.0 [ ms ] TPID - Ramp-up time for PID
controller output limiting
IN setNominalValue REAL 100.0 TPID - Normalization value for setpoint
RFG
IN setRampTime REAL 1000.0 [ ms ] TPID - Ramp up time for setpoint
RFG
IN integTime REAL 2000.0 [ ms ] TPID - Integration time constant
IN derivTime REAL 0.0 [ ms ] TPID - Differentiation time constant
IN filterTime REAL 10.0 [ ms ] TPID - Actual value fitler time
IN intSetValue REAL 0.0 TPID - Integrator set value
IN derivControlMode BOOL FALSE FALSE: TPID – D-Action acts on system
deviation
TRUE: TPID - D-Action acts in the actual
value
IN deadBand REAL 0.0 TPID - Deadband parameter
IN outValueFactor REAL 1.0 TPID - Output scaling factor

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 160
5 Functional description

I/O Variable name Data Initial Description


type value
IN upperLimit REAL 20.0 TPID - Controller output upper limit
IN lowerLimit REAL -20.0 TPID - Controller output lower limit
IN overrideVelocity REAL 10.0 [ LU / min ] Speed controller bias
(override, overcontrol) for
torque controlled modes
IN tensionAdjustment REAL 1.0 1.0 = 100%
Tension torque adjustment factor
IN tensionReference REAL 0.0 [ N or lbf ] Reference value for tension
setpoint. If set to zero
the setpoint is interpreted as absolute value
instead of a
percentage.
IN MaterialWidth REAL 0.0 [ m or inch ] Width of the material
IN MaterialDensity REAL 0.0 [ kg / m 3 or lb / ft 3 ] Material density
IN MaterialFillFactor REAL 1.0 1.0 = 100%
Material fill factor (used in case of
traversed materials like cable)
IN Jfixed REAL 0.0 [ kgm 2 or lbft / s 2 ] Fixed moment of
inertia, motor side
IN JMandrel REAL 0.0 [ kgm 2 or lbft / s 2 ] Fixed moment of
inertia, load side
© Siemens AG 2019 All rights reserved

IN Jmotor REAL 0.0 [ kgm 2 or lbft / s 2 ] Motor inertia


IN acceleration REAL 1.0 1.0 = 100%
Adjustment Adjustment factor of the acceleration
precontrol. With 0.0 precontrol is off.
IN frictionAdjustment REAL 0.0 1.0 = 100% Adjustment factor of the friction
characteristic output. With 0.0 frictions
compensation is off.
IN maxVelocty REAL - [ LU / min ] Max velocity for normalization
IN gearRatio REAL - Gear Ratio, Motor / Load
IN referenceSpeed REAL - [ rpm ] Normalization speed of drive
(p2000)
IN referenceTorque REAL - [ Nm ] Normalization torque of drive
(p2003)
IN HW_Address_Input HW_S - Hardware address of the input area of drive
ubmod telegram
ul
IN HW_Address_Output HW_S - Hardware address of the output area of
ubmod drive telegram
ul
OUT WinderConfig Winder - Winder configuration Data
Config
Type

Functionality

This function creates one output structure of WinderConfigType from the


configuration parameters. This is done to reduce the amount of input variables on
the winder function block but still give the user easy access.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 161
5 Functional description

5.7.10 LCon_Winder

Function block for the control of an axial winder.


The function block has to be called in a cyclic interrupt (e.g. OB30) or synchronous
operation (e.g. OB60).
Function block ID: 5104
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 162
5 Functional description

Schematic LAD Representation


LCon_Winder

Bool enable busy Bool

Bool onOff1 ctrlBusy Bool

Bool noOff2 error Bool

Bool noOff3 errorID DWord

Bool ackFaults driveReadyToPowerUp Bool

Bool openBrake driveReadyForMotion Bool

Bool infeedOperation driveZeroSpeed Bool

Real driveKp driveFault Bool

Real lineVelocity driveFaultCode DInt

Real lineActualVelocity driveSpeedActual Real

Real additionalVelocity driveTorqueActual Real

Int typeOfWinder driveTorqueActualFtlbs Real

Int controlMode driveTorqueActualPercent Real


© Siemens AG 2019 All rights reserved

Bool jogPos atMinDia Bool

Bool jogNeg atMaxDia Bool

Bool speedMatch actShaftSpeed Real

Bool holdDiameter actVelocity Real

Bool setDiameter setdriveSpeed Real

Bool Cntrlenable pidoutValue Real

Real CntrlSetpoint pidEffectiveKp Real

Real CntrlActual pidUpperLimitReached Bool

Int OBnumber pidLowerLimitReached Bool

"LCon_BreakPointTable" xn_speedValues pidRFGSetpointReached Bool

"LCon_BreakPointTable" yn_torqueValues

Int sizeOfArray

Real speedSetpoint

Bool speedSetpointMode

Real tCycle
diameter
Real Real
WinderConfig "LCon_Winder
"LCon_WinderConfigType"
ConfigType"

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 163
5 Functional description

Input and Output parameters

I/O Variable name Data Initial Description


type value
IN BOOL FALSE FALSE: Function block disabled
enable TRUE: Rising edge enables
communication and saves parameters
IN BOOL FALSE FALSE: Drive disabled
onOFF1
TRUE: Enable drive
IN BOOL FALSE FALSE: Coast stop request
noOFF2
TRUE: No coast stop request
IN BOOL FALSE FALSE: Fast stop request
noOFF3
TRUE: No fast stop request
IN BOOL FALSE FALSE: No fault acknowledgement
ackFaults
TRUE: Rising edge, acknowledge faults
IN BOOL FALSE If motor is equipped with holding brake:
openBrake FALSE: Brake controlled by brake control
TRUE: Release brake
IN BOOL FALSE FALSE: Infeed disabled
infeedOperation TRUE: Infeed enabled,
DC bus is ready
IN driveKp REAL 100.0 [ % ] Speed controller gain adaption value.
At 100% the effective Kp = p1460 in the
drive.(only S120)
IN lineVelocity REAL 0.0 [ LU / min ] Master line velocity
© Siemens AG 2019 All rights reserved

IN lineActualVelocity REAL 0.0 [LU / min ] Master line actual velocity


(tachometer) for v-constant control mode
IN additionalVelocity REAL 0.0 [ LU / min ] Additional velocity (always
enabled)
IN typeOfWinder INT 0 Specifies the winder mode:
0: REWIND_FROM_ABOVE
1: REWIND_FROM_BELOW
2: UNWIND_FROM_ABOVE
3: UNWIND_FROM_BELOW
Value is saved upon rising edge of enable.
IN controlMode INT 0 Specifies the tension control mode:
0: DANCER_SPEED_ADAPT
1: DANCER_SPEED_ADAPT_HD
2: TENSION_SPEED_ADAPT
3: TENSION_SPEED_ADAPT_HD
4: TENSION_TORQUE_ADAPT
5: INDIRECT
6: V_CONSTANT
Value is saved upon rising edge of enable.
IN jogPos BOOL FALSE FALSE: No jog operation
TRUE: Start Jog forward at Jog Sp
IN jogNeg BOOL FALSE FALSE: No jog operation
TRUE: Start Jog reverse at Jog Sp
IN speedMatch BOOL FALSE FALSE: No line operation
TRUE: Line operation, follows main setpoint
IN holdDiameter BOOL FALSE FALSE: Diameter calculation
TRUE: Hold diameter calculation
IN setDiameter BOOL FALSE FALSE: Diameter calculation
TRUE: Set diameter to diameter set value
IN xn_speedValues breakP - x-array of speed values
ointTab
le
IN yn_torquevalues breakP - y-array of torque value
ointTab
le
IN sizeOfArray INT 20 length of array

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 164
5 Functional description

I/O Variable name Data Initial Description


type value
IN CtrlEnable BOOL FALSE FALSE: TPID and tension not enabled
TRUE: TPID enable
IN CtrlSetpoint REAL 0.0 TPID Setpoint
IN CtrlActual REAL 0.0 TPID actual value
IN OBnumber INT 30 Calling Cyclic Interrupt Block Number
IN speedSetpoint REAL 0.0 Speed setpoint for speed setpoint mode
IN speedSetpointMode BOOL FALSE FALSE: normal operation
TRUE: winder drive runs with speed setpoint
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
I/O diameter REAL - [ m or inch ] Actual diameter
I/O winderConfig Winder - This data type includes all configuration data
Config required for parameterization of the winder
Type function block.
OUT busy BOOL FALSE FALSE: Block disabled, no communication
active
TRUE: Block active, valid configuration,
communication active
OUT ctrlBusy BOOL FALSE FALSE: controller not working
TRUE: controller busy
OUT error BOOL FALSE FALSE: No error
TRUE: An error has occurred, refer to error
identification
OUT errorID DWOR 16#000 Error identification, refer to error messages
© Siemens AG 2019 All rights reserved

D 0_ errorID < 16#5104_8000: Warning


0000 errorID >= 16#5104_8000: Error
OUT driveReady BOOL FALSE FALSE: Missing enables
ToPowerUp TRUE: Drive is ready

OUT driveReady BOOL FALSE FALSE: Missing enables


ForMotion TRUE: Drive enabled for motion
OUT driveZeroSpeed BOOL FALSE FALSE: Shaft speed not zero
TRUE: Actual shaft speed at zero
OUT driveFault BOOL FALSE FALSE: No drive fault
TRUE: Drive fault present
OUT driveFaultCode INT 0 Drive fault code, refer to drive manual for
more information (r2131 from the drive)
OUT driveSpeedActual REAL 0.0 [ rpm ] Speed actual value (r63 from the drive)
OUT driveTorqueActual REAL 0.0 [ Nm ] Torque actual value (r80 from the drive)
OUT driveTorque REAL 0.0 [ ft / lbs ] Torque actual value
ActualFtlbs
OUT driveTorqueActual REAL 0.0 [ % ] Torque actual value in percent of nominal
Percent torque
OUT atMinDia BOOL FALSE At minimum diameter
OUT atMaxDia BOOL FALSE At maximum diameter
OUT actShaftSpeed REAL 0.0 [ rpm ] Actual shaft speed
OUT actVelocity REAL 0.0 [ LU / min ] Actual velocity
OUT setDriveSpeed REAL 0.0 [ rpm ] Speed setpoint to drive
OUT pidOutValue REAL 0.0 TPID controller output
OUT pidEffectiveKp REAL 0.0 TPID effective Kp
OUT pidUpperLimitReached BOOL FALSE TPID at upper limit
OUT pidLowerLimitReached BOOL FALSE TPID at lower limit
OUT pidRFGSetpointReached BOOL FALSE TPID setpoint value reached

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 165
5 Functional description

Functionality

This function block utilizes the DriveControl, SetpointChannel, WITorquePrecontrol,


DiamCalc and TechPID function blocks of the Simatic Converting library. This
function block checks for valid configuration data and calls the individual function
blocks to minimize application development time.
With the enable set to true, a plausibility check is done on the configuration data
and will display an error with corresponding error Id should invalid data be entered.
This input allows control functionality. With the function block enabled, the
driveControl function block will become active which will set the busy output true.
With the enables set true the winder will follow the sum of the lineVelocity and
additionalVelocity times the draw factor. Winders are typically made to follow the
master without any ramps. Winders with splice are an exception as they need to be
able to be detached from the running machine and therefore have separate ramps.
The programmer is responsible for proper interlocks to prevent unwanted behavior.
The configuration data has diameter calculation parameters, gear ratio and max
line speed parameters which are utilized to calculate the correct surface velocity of
the winder to match the section to the master line velocity.
The actual diameter of the winder can either be calculated using one of the
DiamCalc_ function blocks (division, integral, addition) or can also be supplied from
an external source using the configuration structure of the function block.
© Siemens AG 2019 All rights reserved

The configuration data also has parameters for torque precontrol. Torque
precontrol is necessary for torque based tension control modes and is optional for
speed based tension control modes. Speed based tension control modes with the
_HD (high dynamic) prefix utilize torque precontrol.
With the enable set to true and DrvReadyForMotion and Cntrlenable then the
CntrlSetpoint will be ramped up based on configuration data The Tension controller
correction value will be added to the total speed setpoint or additional torque,
scaled and sent to the drive using the driveControl function block as required.
Function block output parameters allow the user to view the calculated surface
velocity of the winder (actVelocity), the actual shaft speed (actShaftSpeed), motor
actual speed in RPM (actDriveSpeed), motor torques (driveTorqueActual,
driveTorqueActualFtlbs, driveTorqueActualPercent) and pertinent PID data.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 166
5 Functional description

Winder operating modes

Operating Drawing Description


mode
Rewind V: Machine velocity
from F: Tension in material line
above
n: speed of winder
n O : velocity override for
speed
controller over control

Rewind M f : Friction torque


from M P : Pre-control torque
below M T : Tension torque

Unwind
from
below
© Siemens AG 2019 All rights reserved

Unwind
from
above

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 167
5 Functional description

Block diagram
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 168
5 Functional description

Warning Messages
Warnings are indicated by the status of the outputs error and errorID:
error = FALSE an errorID <> 16#0000_0000

ErrorID Description
16#0000_0000 No Warning
16#4102_4005 The table of entered values is not monotonically (steadily) increasing -> no matching
value found
16#4102_4008 The table of entered values is not monotonically (steadily) increasing -> 2 values are
identical

Error Messages
Error messages are indicated by the status of the outputs error and errorID:
error = TRUE and errorID <> 16#0000_0000.

ErrorID Description
16#0000_0000 No error
© Siemens AG 2019 All rights reserved

16#5104_8001 The function block is not called in a cyclic interrupt, e.g. OB30.
16#5104_8005 Invalid configuration data
controleMode < 0
controlMode > 5
typeOfWinder < 0
typeOfWinder > 3
winderConfig.typeOfDiameterCalc < 0
winderConfig.typeOfDiameterCalc > 3
winderConfig.minDia = 0.0
winderConfig.maxDia = 0.0
winderConfig.minDia >= winderConfig.maxDia
winderConfig.maxVelocity = 0.0
winderconfig.gearRatio = 0.0
winderConfig.referenceSpeed = 0.0
winderConfig.referenceTorque = 0.0
winderConfig. HW_Address_Input <= 0
winderConfig.HW_Address_Output <= 0
The configuration data are checked for plausibility at the rising edge of enable.
16#3101_8005 Invalid configuration data: (DriveControl)
HW_Address_Input <= 0
HW_Address_Output <=0
referenceSpeed <= 0.0
referenceTorque <= 0.0
16#3101_8065 Torque Limits may not be plausible any more; web break could cause this
problem. Axis runs in the opposite direction too fast. Reaction: brake with full torque.
(DriveControl)
16#3102_8001 The function block is not called in a cyclic interrupt, e.g. OB30. (SetpointChannel)
16#3102_8005 Invalid configuration data: (SetpointChannel)
maxVelocity <= 0.0
gearRatio = 0.0
The configuration data are checked for plausibility at the rising edge of enable.
16#1108_8001 The function block is not called in a cyclic interrupt, e.g. OB30. (TPID)
16#1108_8005 Invalid configuration data: (TPID)
setNominalValue <= 0.0
upperlimit < lowerlimit
16#5101_8001 The function block is not called in a cyclic interrupt, e.g. OB30. (DiamCalcDivision)

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 169
5 Functional description

ErrorID Description
16#5101_8005 Invalid configuration data: (DiamCalcDivision)
minDia <= 0.0
maxDia <= 0.0
minDia >= maxDia
minLineVelocity <= 0.0
minShaftSpeed <= 0.0
The configuration data are checked for plausibility at the rising edge of enable.
16#5103_8001 The function block is not called in a cyclic interrupt, e.g. OB30. (DiamCalcIntegral)
16#5103_8005 Invalid configuration data: (DiamCalcIntegral)
minDia <= 0.0
maxDia <= 0.0
minDia >= maxDia
measuringRevolutionCount <= 0.0
minLineSVelocity <= 0.0
minShaftSpeed <= 0.0
The configuration data are checked for plausibility at the rising edge of enable.
16#5102_8001 The function block is not called in a cyclic interrupt, e.g. OB30. (DiamCalcAddition)
16#5102_8005 Invalid configuration data: (DiamCalcAddition)
minDia <= 0.0
maxDia <= 0.0
minDia >= maxDia
webThickness <= 0.0
minShaftSpeed <= 0.0
typeOfWinder < 0
typeOfWinder > 0
© Siemens AG 2019 All rights reserved

The configuration data are checked for plausibility at the rising edge of enable.
16#4102_8003 Less than two pairs of values in the breakpoint table or uneven number of points.
(WITorquePrecontrol, friction table)
16#4102_8004 More than twenty pairs of values in the breakpoint table or uneven number of points.
(WITorquePrecontrol, friction table)
16#4102_8005 One or more configuration values are invalid – Check Min values, max values and
other settings. (WITorquePrecontrol)
gearRatio <= 0.0
density < 0.0
diamMin <= 0.0
diamMax <= diamMin
width < 0.0
fillFactor <= 0.0
Jfix < 0.0
Jmandrel < 0.0
Jmot < 0.0
typeOfWinder < 0
typeOfWinder > 3
The configuration data are checked for plausibility at the rising edge of enable.
Friction characteristic pointer is not addressing a data block. (WITorquePrecontrol,
friction table)
16#4102_8006 Invalid diameter (WITorquePrecontrol)
diamActVal <= 0.0 diamActVal < diamMin

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 170
5 Functional description

5.7.11 LCon_CalcTargetDiamStopCondition

Calculation of stop condition at target diameter. The function block must be called
in a cyclic interrupt, e.g. OB30.
Function block ID: 4004

Schematic LAD Representation

CalcTargetDiamStopCondition

BOOL enable busy BOOL


INT windingMode error BOOL
REAL actualDiameter errorID DWORD
REAL targetDiameter stop BOOL
REAL offset stopDistance REAL
REAL minDiameter stopTime REAL
REAL maxDiameter restLengthToTarget REAL
REAL maxVelocity
REAL webThickness
© Siemens AG 2019 All rights reserved

REAL actualVelocity
REAL actualAcceleration
REAL rampUpTime
REAL rampDownTime
REAL roundingTime
INT OBNumber
REAL tCycle

Input and Output parameters

I/O Variable name Data Initial Description


type value
IN enable BOOL false false: no calculation
true: parameters will be safed with rising edge,
function block active
IN windingMode INT 0 winding direction. 0: rewinding; 1: unwinding
IN actualDiameter REAL 0.0 [m or inch] actual diameter value of winder
IN targetDiameter REAL 0.0 [m or inch] target diameter for winder
IN offset REAL 0.0 [m or inch] length offset for material on winder
IN minDiameter REAL 0.0 [m or inch] minimum diameter of winder
IN maxDiameter REAL 0.0 [m or inch] maximum diameter of winder
IN webThickness REAL 0.0 [m or inch] thickness of material
IN actualVelocity REAL 0.0 [LU/min] actual velocity of line
IN actualAcceleration REAL 0.0 [LU/s2] actual acceleration of line
IN rampUpTime REAL 0.0 [s] ramp up time of line

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 171
5 Functional description

I/O Variable name Data Initial Description


type value
IN rampDownTime REAL 0.0 [s] ramp down time of line
IN roundingTime REAL 0.0 [s] rounding Time of line
IN OBNumber INT 0 Number of calling OB
IN tCycle REAL 0.0 [ms] Cycle time the FB is called
OUT busy BOOL false false: function block is idle; true: function block
activated
OUT error BOOL false false: no error; true: error occurred
OUT errorID DWORD 16#0000 errorID = 16#0000_0000: no error; errorID <
_0000 16#xxxx_8000: Warning; errorID ≥ 16#xxxx_8000
: error
OUT stop BOOL false false: stop condition not reached; true: stop
condition reached
OUT stopDistance REAL 0.0 [m or inch] actual distance to stop the line
OUT stopTime REAL 0.0 [s] actual time to stop the line
OUT restLengthToTarget REAL 0.0 [m or inch] rest material length between actual
diameter and target diameter
© Siemens AG 2019 All rights reserved

Functionality
The function block combines the Functions “CalcStopDistance” and
“RestLengthCalc”. It calculates based on the input parameters if the line axis needs
to be stopped to reach the target diameter.
The function block calculates the rest length depending on the actual and target
diameter which needs to be re- or unwinded. The winding mode and an optional
offset will also be used for the calculation. Additionally the distance the axis needs
to stop the motion to 0.0 LU/min will be calculated based on the actul motion vector
of the axis. If the rest length is smaller as the stop distance, the stop condition is
reached and the output “stop” is set to true.
If the actual diameter already exceeded the target diameter – actual diameter is
smaller than target diameter in mode unwinding or actual diameter is larger than
target diameter in mode rewinding – the output “stop” will be set to true
immediately.
After setting a new value for actualDiameter, targetDiameter and / or changing the
windingMode the output will be resetted to false, if a positive rest length to the
target diameter is present.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 172
5 Functional description

windingMode =0
&



& ≥1 stop

webThickness

actualDiameter

targetDiameter
RestLengthCalc

offset

actualVelocity

actualAcceleration

maxVelocity
CalcStopDistance
© Siemens AG 2019 All rights reserved

rampUpTime

rampDownTime

roundingTime

Warning messages
Warnings are indicated by the status of the outputs error and errorID: error =
FALSE an errorID <> 16#0000_0000.

errorID description
16#0000_0000 no warning
16#0000_0001 target diameter was limitted to maximum value. targetDiameter = maxDiameter
16#0000_0002 target diameter was limited to minimum value. targetDiameter = minDiameter

Error messages
Error messages are indicated by the status of the outputs error and errorID: error =
TRUE and errorID <> 16#0000_0000.

errorID description
16#0000_0000 no error
16#4004_8001 function block is not called in an cyclic interrupt
16#4004_8004 invalid configuration data:
rampUpTime ≤ 0.0

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 173
5 Functional description

errorID description
rampDownTime ≤ 0.0
roundingTime ≤ 0.0
16#4004_8005 invalic configuration data:
minDiameter ≥ maxDiameter
16#0005_8005 invalid configuration data (CalcStopDistance)
© Siemens AG 2019 All rights reserved

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 174
5 Functional description

5.8 Data Types


The data types of the Converting Toolbox are provided in the Library LCon.

For the S7-300/S7-400 solution, only two data types are provided:
• LCon_SectionalConfigType
• LCon_WinderConfigType

For the S7-1200/S7-1500 solution the following data types are available:

LCon_BreakPointTable
The data type LCon_BreakPointTable consists of an array of REAL variables. It is
used in different function blocks like FrictionCharacteristic, Taper,
TorquePrecontrol, etc.

LCon_DriveControlInputType
This data type contains all input interface parameter of the function block
© Siemens AG 2019 All rights reserved

LCon_DriveControl. For more information about the parameter see the description
of the function block.

LCon_DriveControlOutputType
This data type contains all output interface parameter of the function block
LCon_DriveControl. For more information about the parameter see the description
of the function block.

LCon_FrictionCharacteristicType
The data type contains the speed and torque values for the friction characteristic.

LCon_FrictionMeasurementInputType
This data type contains all input interface parameter of the function block
LCon_FrictionMeasurement. For more information about the parameter see the
description of the function block.

LCon_FrictionMeasurementOutputType
This data type contains all output interface parameter of the function block
LCon_FrictionMeasurement. For more information about the parameter see the
description of the function block.

LCon_FrictionMeasurementOutputType
The data type combines the data types FrictionMeasurementInput and Output.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 175
5 Functional description

LCon_LineAxisModuleType
This data type collects all data types which are necessary for the module
“LineAxis”. It contains the LCon_SetpointChannel interface, the LCon_DriveControl
interface as well as the operating state for the state machine.

LCon_SectionalDriveConfigType
The data type contains all configuration parameter of the function block
LCon_SectionalDrive.

NOTE For the S7-300/S7-400 solution a separate data type is provided in the library
LCon in the sub folder S7-300/S7-400!
Instead of the parameter HW_Address_Input and HW_Address_Output only one
parameter logAddr is used.
The following parameters are not available: “HWAddressAdditionalTelIn”,
“HWAddressAdditionalTelOut”, “baseTelegram”, “Tel750”.
All other parameters are the same.
© Siemens AG 2019 All rights reserved

Name Data type Initial value Description


metricUnits BOOL TRUE FALSE: Imperial
TRUE: Metric
jogVelocity REAL 10.0 [ LU / min ] Jog velocity setpoint (no ramp)
speedMatchRamp REAL 0.5 [ s ] Ramp time for acceleration to line speed
Time
diameter REAL 1.0 [ m or inch ] Diameter value
kpAdaptionValue REAL 0.0 TPID - Kp-Adaption signal
holdIntChannel BOOL TRUE FALSE: TPID – Normal integrator operation
TRUE: TPID - Hold (freeze) integrator
setIntChannel BOOL FALSE FALSE: TPID - Normal integrator operation
TRUE: TPID - Set integrator channel to
intSetValue
x1 REAL 0.0 TPID - Abscissa-1 for KP-adaption(1)
kp1 REAL 1.0 TPID - KP-adaption point(1)
x2 REAL 0.0 TPID - Abscissa-2 for KP-adaption(2)
kp2 REAL 1.0 TPID - KP-adaption point(2)
limRampTime REAL 1000.0 [ms] TPID - Ramp-up time for pid controller
output limiting
setNominalValue REAL 100.0 TPID - Normalization value for setpoint RFG
setRampTime REAL 1000.0 [ms] TPID - Ramp up time for setpoint RFG
integTime REAL 2000.0 [ ms ] TPID - Integration time constant
derivTime REAL 0.0 [ ms ] TPID - Differentiation time constant
filterTime REAL 10.0 [ ms ] TPID - Actual value fitler time constant
intSetValue REAL 0.0 TPID - Integrator set value
derivControlMode BOOL FALSE FALSE: TPID – D-Action acts on system
deviation
TRUE: TPID - D-Action acts in the actual value
deadBand REAL 0.0 TPID - Deadband parameter
outValueFactor REAL 1.0 TPID - Output scaling factor
upperLimit REAL 20.0 TPID - Controller output upper limit

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 176
5 Functional description

Name Data type Initial value Description


lowerLimit REAL -20.0 TPID - Controller output lower limit
overrideVelocity REAL 10.0 [ LU / min ] Speed controller bias (override,
overcontrol) for
torque controlled modes
TensionAdjustment REAL 1.0 1.0 = 100%
Tension torque adjustment factor
tensionReference REAL 0.0 [ N or lbf ] Reference value for tension setpoint.
If set to zero
the setpoint is interpreted as absolute value
instead of a
Percentage.
JFixed REAL 0.0 [ kgm 2 or lbft /s 2 ] Fixed moment of inertia,
motor side
JMandrel REAL 0.0 [ kgm 2 or lbft / s 2 ] Fixed moment of inertia,
load side
JMotor REAL 0.0 [ kgm 2 or lbft / s 2 ] Motor inertia
accelerationAdjustment REAL 1.0 1.0 = 100%
Adjustment factor of the acceleration precontrol.
With 0.0 precontrol is off.
frictionAdjustment REAL 0.0 1.0 = 100%
Adjustment factor of the friction characteristic
output. With
0.0 friction compensation is off.
useSetValForFrictionCo BOOL FALSE TRUE: Use speed setpoint for friction
© Siemens AG 2019 All rights reserved

mp compensation
FALSE: Use speed actual value for friction
compensation
maxVelocity REAL - [ LU / min ] Max velocity for normalization
gearRatio REAL - Gear Ratio, Motor / Load
referenceSpeed REAL - [ rpm ] Normalization speed of drive (p2000)
referenceTorque REAL - [ Nm ] Normalization torque of drive (p2003)
HW_Address_Input HW_Subm - Hardware address of the input Area of the drive
odul
HW_Address_Output HW_Subm - Hardware address of the output Area of the
odul drive
HWAddressAdditionalT HW_SUB 16#0000 Drive Logical IO address for reading
elIn MODULE AdditionalTel (as read in the hardware config)
HWAddressAdditionalT HW_SUB 16#0000 Drive Logical IO address for writing
elOut MODULE AdditionalTel (as read in the hardware config)
baseTelegram Int 999 999: UserDefTel (8/8). Structure as shown in
telegram structure (compatible with previous
version)
2: StandardTel2 is used
3: StandardTel3 is used. Only the PZD of
telegram 2 are evaluated! Caution: The
STW_G1 could be overwritten!
Tel750 Bool FALSE FALSE: Tel 750 is not used (if user def Tel is
used or Tel2or3 and no Torquedata is
necessary)
TRUE: Tel 750 is used (use only if standardTel
= 2 or 3)

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 177
5 Functional description

LCon_SectionalDriveInputType
This data type contains all input interface parameter of the function block
LCon_SectionalDrive. For more information about the parameter see the
description of the function block.

LCon_SectionalDriveOutputType
This data type contains all output interface parameter of the function block
LCon_SectionalDrive. For more information about the parameter see the
description of the function block.

LCon_SectionalDriveITDiagValuesType
The data type contains the variables which are necessary for the Converting
Diagnostic Pages.

LCon_SetpointChannelInputType
This data type contains all input interface parameter of the function block
LCon_SetpointChannel. For more information about the parameter see the
description of the function block.
© Siemens AG 2019 All rights reserved

LCon_SetpointChannelOutputType
This data type contains all output interface parameter of the function block
LCon_SetpointChannel. For more information about the parameter see the
description of the function block.

LCon_TargetDiamStopConditionInputType
This data type contains all input interface parameter of the function block
LCon_TargetDiamStopCondition. For more information about the parameter see
the description of the function block.

LCon_TargetDiamStopConditionIOType
The data type combines the data types LCon_TargetDiamStopConditionInput and
Output.

LCon_TargetDiamStopConditionOutputType
This data type contains all output interface parameter of the function block
LCon_TargetDiamStopCondition. For more information about the parameter see
the description of the function block.

LCon_WinderConfigType
The data type contains all configuration parameter of the function block
LCon_Winder.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 178
5 Functional description

NOTE For the S7-300/S7-400 solution a separate data type is provided in the library
LCon in the sub folder S7-300/S7-400!
Instead of the parameter HW_Address_Input and HW_Address_Output only one
parameter logAddr is used.
The following parameters are not available: “HWAddressAdditionalTelIn”,
“HWAddressAdditionalTelOut”, “baseTelegram”, “Tel750”.
All other parameters are the same.

Name Data type Initial value Description


FALSE: Imperial
metricUnits BOOL TRUE
TRUE: Metric
jogVelocity REAL 10.0 [ LU / min ] Jog velocity setpoint (no ramp)
speedMatchRamp
REAL 0.5 [ s ] Ramp time for acceleration to line speed
Time
Selection of diameter calculation method:
0: Division
1: Thickness addition
typeOfDiameterCalc INT 2 2: Integral calculation
© Siemens AG 2019 All rights reserved

3: External diameter determination. Input via


diameterSetValue.
4: Web length addition
[ m or inch ] Diameter set value
diameterSetValue REAL 1.0
Used as external diameter source.
[ m or inch ] Web thickness
webThickness REAL 0.001 If integral diameter calculation is used the
calculated thickness is displayed here.
minDia REAL 0.01 [ m or inch ] Minimum diameter
maxDia REAL 2.0 [ m or inch ] Maximum diameter
[LU / min ] Minimum line velocity for diameter
minLineVelocity REAL 0.5
calculation
[ rpm ] Minimum shaft speed for diameter
minShaftSpeed REAL 2.0
calculation
lineFilterTime REAL 20.0 [ ms ] Filter time for line velocity
shaftFiltertime REAL 20.0 [ ms ] Filter time for shaft speed
diameterFilterTime REAL 50.0 [ ms ] Diameter calculator filter time
[ rev ] Shaft revolution counts for integral
measuringRevolution
REAL 2.0 diameter
Count
calculation
firstDiameterOutput REAL 1.0 [-] Number of rotations after first diameter is
calculated (only for DiamCalcIntegral)
diameterOutputRate REAL 1.0 [-] Number of rotations after new diameter is
calculated (only for DiamCalcIntegral)
FALSE:TPID – Normal integrator operation
holdIntChannel BOOL FALSE
TRUE: TPID - Hold (freeze) integrator
FALSE: TPID - Normal integrator operation
setIntChannel BOOL FALSE TRUE: TPID - Set integrator channel to
intSetValue
x1 REAL 0.0 TPID - Abscissa-1 for KP-adaption(1)
kp1 REAL 1.0 TPID - KP-adaption point(1)
x2 REAL 0.0 TPID - Abscissa-2 for KP-adaption(2)
kp2 REAL 1.0 TPID - KP-adaption point(2)
[ ms ] TPID - Ramp-up time for PID controller
limRampTime REAL 1000.0
output limiting

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 179
5 Functional description

Name Data type Initial value Description


setNominalValue REAL 100.0 TPID - Normalization value for setpoint RFG
setRampTime REAL 1000.0 [ ms ] TPID - Ramp up time for setpoint RFG
integTime REAL 2000.0 [ ms ] TPID - Integration time constant
derivTime REAL 0.0 [ ms ] TPID - Differentiation time constant
filterTime REAL 10.0 [ ms ] TPID - Actual value fitler time
intSetValue REAL 0.0 TPID - Integrator set value
FALSE: TPID – D-Action acts on system
derivControlMode BOOL FALSE deviation
TRUE: TPID - D-Action acts in the actual value
deadBand REAL 0.0 TPID - Deadband parameter
outValueFactor REAL 1.0 TPID - Output scaling factor
upperLimit REAL 20.0 TPID - Controller output upper limit
lowerLimit REAL -20.0 TPID - Controller output lower limit
[ LU / min ] Speed controller bias (override,
overrideVelocity REAL 10.0 overcontrol) for
torque controlled modes
1.0 = 100%
tensionAdjustment REAL 1.0
Tension torque adjustment factor
[ N or lbf ] Reference value for tension setpoint.
If set to zero
tensionReference REAL 0.0 the setpoint is interpreted as absolute value
instead of a
percentage.
MaterialWidth REAL 0.0 [ m or inch ] Width of the material
© Siemens AG 2019 All rights reserved

MaterialDensity REAL 0.0 [ kg / m 3 or lb / ft 3 ] Material density


1.0 = 100%
Material fill factor (used in case of traversed
MaterialFillFactor REAL 1.0
materials like
cable)
[ kgm 2 or lbft / s 2 ] Fixed moment of inertia,
JFixed REAL 0.0
motor side
[ kgm 2 or lbft / s 2 ] Fixed moment of inertia,
JMandrel REAL 0.0
load side
JMotor REAL 0.0 [ kgm 2 or lbft / s 2 ] Motor inertia
1.0 = 100% Adjustment factor of the friction
frictionAdjustment REAL 0.0 characteristic output. With 0.0 frictions
compensation is off.
maxVelocty REAL - [ LU / min ] Max velocity for normalization
gearRatio REAL - Gear Ratio, Motor / Load
referenceSpeed REAL - [ rpm ] Normalization speed of drive (p2000)
referenceTorque REAL - [ Nm ] Normalization torque of drive (p2003)
HW_Subm
HW_Address_Input - Hardware address of the input area of the drive
odul
HW_Subm Hardware address of the output area of the
HW_Address_Output -
odul drive
HWAddressAdditionalT HW_SUB 16#0000 Drive Logical IO address for reading
elIn MODULE AdditionalTel (as read in the hardware config)
HWAddressAdditionalT HW_SUB 16#0000 Drive Logical IO address for writing
elOut MODULE AdditionalTel (as read in the hardware config)
baseTelegram Int 999 999: UserDefTel (8/8). Structure as shown in
telegram structure (compatible with previous
version)
2: StandardTel2 is used
3: StandardTel3 is used. Only the PZD of
telegram 2 are evaluated! Caution: The
STW_G1 could be overwritten!
Tel750 Bool FALSE FALSE: Tel 750 is not used (if user def Tel is
used or Tel2or3 and no Torquedata is

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 180
5 Functional description

Name Data type Initial value Description


necessary)
TRUE: Tel 750 is used (use only if standardTel
= 2 or 3)

LCon_WinderInputType
This data type contains all input interface parameter of the function block
LCon_Winder. For more information about the parameter see the description of the
function block.

LCon_WinderOutputType
This data type contains all output interface parameter of the function block
LCon_Winder. For more information about the parameter see the description of the
function block.

LCon_WinderITDiagValuesType
© Siemens AG 2019 All rights reserved

The data type contains the variables which are necessary for the Converting
Diagnostic Pages.

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 181
6 Appendix

6 Appendix
6.1 Service and Support
Industry Online Support
Do you have any questions or need assistance?
Siemens Industry Online Support offers round the clock access to our entire
service and support know-how and portfolio.
The Industry Online Support is the central address for information about our
products, solutions and services.
Product information, manuals, downloads, FAQs, application examples and videos
– all information is accessible with just a few mouse clicks at:
https://support.industry.siemens.com

Technical Support
The Technical Support of Siemens Industry provides you fast and competent
support regarding all technical queries with numerous tailor-made offers
– ranging from basic support to individual support contracts. You send queries to
Technical Support via Web form:
www.siemens.com/industry/supportrequest
© Siemens AG 2019 All rights reserved

SITRAIN – Training for Industry


With our globally available training courses for our products and solutions, we help
you achieve with practical experience, innovative learning methods and a concept
that’s tailored to the customer’s specific needs.
For more information on our offered trainings and courses, as well as their
locations and dates, refer to:
www.siemens.com/sitrain

Service offer
Our range of services includes the following:
• Plant data services
• Spare parts services
• Repair services
• On-site and maintenance services
• Retrofitting and modernization services
• Service programs and contracts
You can find detailed information on our range of services in the service catalog:
https://support.industry.siemens.com/cs/sc

Industry Online Support app


You will receive optimum support wherever you are with the "Siemens Industry
Online Support" app. The app is available for Apple iOS, Android and Windows
Phone:
https://support.industry.siemens.com/cs/ww/en/sc/2067

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 182
6 Appendix

6.2 Application Support


Siemens AG
Digital Factory Division
Factory Automation
Production Machines
DF FA PMA APC
Frauenauracher Str. 80
91056 Erlangen, Germany
mailto: tech.team.motioncontrol@siemens.com

6.3 Links and Literature


Table 6-1
Topic
\1\ Siemens Industry Online Support
https://support.industry.siemens.com
\2\ https://support.industry.siemens.com/cs/ww/en/view/58565043

\3\ SIMOTION/SIMATIC/SINAMICS – Converting Toolbox


© Siemens AG 2019 All rights reserved

https://support.industry.siemens.com/cs/de/en/view/109744606

6.4 Change documentation


Table 6-2
Version Date Modifications
V1.0.0 09/2012 creation
V1.0.1 08/2013 Bugfixes, function block calcTargetDiamStopCondition
added
V1.1.0 08/2014 Bugfixes, new control mode v-constant, change drive
interface to HW_Address_Input and HW_Address_Output
V1.2.0 04/2015 Extensions winder mode speed controlled, adaption of drive
control to optimized data format, extension friction
measurement sizeOfArray, ctrlBusy output of winder
Bugfix: diameter calculation blocks retain value
V2.0.0 11/2016 Manual revised; new example project; new TIA library
“LCon”, minor functional extensions
V2.1.0 11/2017 Manual revised; new TIA library “LCon”, minor functional
extensions
V2.1.1 09/2018 Minor functional extensions
V2.2.0 11/2018 - Updated description of function block LCon_RFG
- Enhancement of DriveControl and
DriveControlInputType to use Tel 2 / 3 and 750

SIMATIC winding and tension control S7-1200/S7-1500(T)


Entry-ID: 58565043, V2.2.0, 09/2019 183

Das könnte Ihnen auch gefallen