FB_BARSunblindActuator

This function block is used for positioning of a slatted blind via two outputs: up and 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).

FB_BARSunblindActuator 1:

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 travel 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 slat 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 slats start to turn from the "inward low point" to the "outward low point". During this time the slat 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 traveled, 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 timespan of the subsequent turning of the slats 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). Alsp this time is 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 backlash has already been traveled, the most secure way to measure the backlash of the upward movement or its travel 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.

Parameterization

For the calculation of the (height) position and the slat 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 slat angle λ is defined by a notional straight line through the end points of the slat 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), the current position and slat angle are always approached, and changes are immediately taken into account. The positioning to the height has priority: the entered height is approached first and then the slat angle. 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 travel-up time. The position is then in any case "0" and the slat angle is at its maximum. Since a blind positioning without encoder is naturally always error-prone, it is important to reference automatically as often as possible: every time the position "0" is to be approached (the angle does not matter), the blind first moves up normally with continuous position calculation. Once the calculated position value 0% is reached, the output bBlindUp continues to be held for the complete travel-up time + 5s.
For reasons of flexibility there are now two possibilities to interrupt the referencing procedure: until the calculated 0% position is reached, a change in position continues to be assumed and executed. Once this 0% position is reached, the blind can still be moved with the manual "blind down" command. 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:= eDataSecurityType_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 internally released.

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: FB_BARSunblindActuator 5: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 blind up.

bBlindDown: control output blind down.

uiActPosition: current position in percent.

uiActAngle: current slat angle in degrees.

bReferencing: the blind is referencing, i.e. the output bBlindUp is set for the complete travel-up time + 5 s. Only a manual "down" command can move the blind in the opposite direction and terminate this 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

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 declared as input variables, they would not be able to write a reference variable.
Application example: FB_BARSunblindActuator 6:Example_PERSISTENT.zip.

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

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: total time for driving up in ms.

uiTotalTimeDown: total time for driving down in ms.

uiBlindHeight: blind height in mm.

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 7:

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 8: