FB_BARSunblindActuator

FB_BARSunblindActuator 1:

This function block is used for positioning of a slatted blind via two outputs: drive up and drive down. The blind can be driven to any desired (height) position and slat angle via the positioning telegram stSunblind. On top of that, the positioning telegram stSunblind also contains manual commands with which the blind can be moved individually to certain positions. These manual commands are controlled by the function block FB_BARSunblindSwitch.

The total stroke time in milliseconds is limited here by the UINT format to 65535 ms. FB_BARSunblindActuatorEx should be used for longer stroke times as it represents these times in UDINT format (udiTotalTimeUp/udiTotalTimeDown).

Structure of the blind positioning telegram stSunblind.

TYPE ST_BARSunblind:
STRUCT
     uiPosition      : UINT;
     iAngle          : INT;
     bManUp          : BOOL;
     bManDown        : BOOL;
     bManualMode     : BOOL;
     bActive         : BOOL;
END_STRUCT
END_TYPE

The current height position and the slat angle are not read in by an additional encoder, but determined internally by the travel time of the blind. The calculation is based on the following travel profile (regarded from the highest and lowest position of the blind):

Downward drive profile:

FB_BARSunblindActuator 2:

More detailed explanations of the terms "backlash" and "turning" are given here in the downward movement:

The blind normally describes its downward movement with the louvre low point directed outwards, as in fig. 3.
If the blind is in an initial position with the low point directed inwards (i.e. after the conclusion of an upward movement), then a certain time elapses after a new downward movement begins before the louvres start to turn from the "inward low point" to the "outward low point". During this time the louvre angle does not change; the blind only drives downward (fig.1 and fig. 2). This time is an important parameter for the movement calculation and is entered in the function block in ms under uiBacklashTimeDown. Since it is not known at an arbitrary point after a blind movement of an arbitrary length whether part of the backlash has already been travelled, the most secure way to measure the backlash of the downward movement or its travel time is when the blind has initially been driven fully upward. A further important parameter is the time interval of the subsequent turning of the louvres from the "Inward low point" to the "Outward low point". This time is to be entered as uiTurningTimeDown in ms in the function block.

Upward travel profile:

FB_BARSunblindActuator 3:

More detailed explanations of the terms "backlash" and "turning" are given here in the upward movement:

The circumstances are similar to the downward movement described above: The blind normally describes its upward movement with the slat low point directed inwards, as in fig. 3.

If the blind is in an initial position with the low point directed outwards (i.e. after the conclusion of a downward movement), then a certain time elapses after a new upward movement begins before the slats start to turn from the "Outward low point" to the "Inward low point". During this time the slat angle does not change; the blind only drives upward (fig. 1 and fig. 2). This time is also an important parameter for the movement calculation and is entered in the function block in ms under uiBacklashTimeUp. Since it is not known at an arbitrary point after a blind movement of an arbitrary length whether part of the reversal backlash has already been traversed, the most secure way to measure the reversal backlash of the upward movement or its extension time is when the blind has initially been driven fully downward. A further important parameter is the time interval of the subsequent turning of the slats from the "Outward low point" to the "Inward low point". This time is to be entered as uiTurningTimeUp in ms in the function block.

Parameterisation

For the calculation of the (height) position and the louvre angle, the following times now have to be determined for both the upward and downward movement:

Furthermore the following are required for the calculation:

The louvre angle λ is defined by a notional straight line through the end points of the louvre to the horizontal.

FB_BARSunblindActuator 4:

Functioning

The function block fundamentally controls the blind via the information from the positioning telegram stSunblind. If automatic mode is active (bManualMode=FALSE), then the current position and louvre angle are always driven to, wherein changes are immediately accounted for. The height positioning takes priority: First the entered height and afterwards the louvre angle are driven to. For reasons of the simplicity the position error due to the angle movement is disregarded. In manual mode (bManualMode=TRUE) the commands bManUp and bManDown control the blind.

Referencing

Secure referencing is ensured if the blind is driven upward for longer than its complete drive-up time. The position is then in any case "0" and the louvre angle is at its maximum. Since blind positioning without an encoder is naturally always susceptible to error, it is important to automatically reference as often as possible: each time the "0" position is to be driven to (the angle is unimportant), the blind initially drives upward quite normally with continuous position calculation. Once the calculated position value of 0% has been reached, the output bBlindUp is kept active until another complete drive-up time + 5 s has elapsed.
For reasons of flexibility there are now two possibilities to interrupt the referencing procedure: Until the calculated 0% position has been reached, a change of position is still accepted and executed; after reaching this 0% position, the manual command "down" can still move the blind differently. These two sensible limitations make it necessary for the user to ensure that the blind is securely referenced as often as possible.

VAR_INPUT

eDataSecurityType  : E_HVACDataSecurityType;
bEnable            : BOOL;
stSunblind         : ST_BARSunblind;

eDataSecurityType: If eDataSecurityType:= eHVACDataSecurityType_Persistent, the persistent VAR_IN_OUT variables of the function block are stored in the flash of the computer if a value changes. For this to work, the function block FB_HVACPersistentDataHandling must be instanced once in the main program, which is called cyclically. Otherwise the instanced FB is not released internally.

A change of value can be initiated by the building management system, a local operating device or via a write access from TwinCAT. When the computer is restarted the saved data are automatically read back from the flash into the RAM.

Application example: example_persistent.zip

If eDataSecurityType:= eHVACDataSecurityType_Idle the persistently declared variables are not saved in a fail-safe manner.

Notice

A cyclically changing variable must never be linked with the IN_OUT variable of a function block, if eDataSecurityType:= eHVACDataSecurityType_Persistent. It would lead to early wear of the flash memory.

bEnable: Enable input for the function block. As long as this input is TRUE, the actuator function block accepts and executes commands as described above. A FALSE signal on this input resets the control outputs bBlindUp and bBlindDown and the function block remains in a state of rest.

stSunblind: Positioning telegram, see ST_BARSunblind.

VAR_OUTPUT

bBlindUp       : BOOL;
bBlindDown     : BOOL;
uiActPosition  : UINT;
uiActAngle     : UINT;
bReferencing   : BOOL;
bBusy          : BOOL;
bError         : BOOL;
udiErrorId     : UDINT;

bBlindUp: control output for blind up.

bBlindDown: control output for blind down.

uiActPosition: current position in percent.

uiActAngle: current louvre angle in degrees.

bReferencing: the blind is in the reference-process, which means, that the output bBlindUp will be set for the complete drive-up time + 5 s. Only the manual command "down" can move the blind in the opposite direction an terminate the reference-mode.

bBusy: a positioning or a referencing procedure is in progress.

bError: this output is switched to TRUE if the parameters entered are erroneous.

udiErrorId: contains the error code if the values entered should be erroneous. See Error codes.

VAR_IN_OUT

uiBacklashTimeUp   : UINT;
uiBacklashTimeDown : UINT;
uiTurningTimeUp    : UINT;
uiTurningTimeDown  : UINT;
uiTotalTimeUp      : UINT;
uiTotalTimeDown    : UINT;
uiBlindHeight      : UINT;
iAngleLimitUp      : INT;
iAngleLimitDown    : INT;

In order for the registered parameters to be retained beyond a controller failure, it is necessary to declare them as In-Out variables. A reference variable is then assigned to them in the program. Each change of the value of these reference variables is persistently stored in the function block and written back to the reference variable following a controller failure and restart. If the parameters were only to be defined as input variables, they would not be able to write a reference variable.
Application example: example_persistent.zip.

uiBacklashTimeUp: Time to traverse the backlash in the upward direction in ms.

uiBacklashTimeDown: Time to traverse the backlash in the downward direction in ms.

uiTurningTimeUp: Time for turning the slats in the upward direction in ms.

uiTurningTimeDown: Time for turning the slats in the downward direction in ms.

uiTotalTimeUp: Complete time for driving up in ms.

uiTotalTimeDown: Complete time for driving down in ms.

uiBlindHeight: This input is currently not used and does not need to be described by the user.

iAngleLimitUp: Highest position of the slats in degrees.

This position is reached once the blind has moved to the top position.

The slat angle λ, as defined above, is then typically greater than zero.

FB_BARSunblindActuator 5:

iAngleLimitDown: Lowest position of the slats in degrees.

This position is reached once the blind has moved to the bottom position.

The slat angle λ, as defined above, is then typically less than zero.

FB_BARSunblindActuator 6:

Requirements

Development environment

required library

required function

TwinCAT 3.1 build 4022.16 or higher

Tc2_HVAC V3.3.1.0

TF8000 | TC3 HVAC V1.0.0.0