FB_BA_SunBldActr

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 stSunBld. In addition, the positioning telegram stSunBld 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_BA_SunBldSwi.

The function block has an internal fixed toggle latch (output bUp to output bDwn) of 500 ms.

FB_BA_SunBldActr 1:

This function block must be called in every PLC cycle, since the PLC cycle time is included in the calculation of the positions.

FB_BA_SunBldActr 2:

Functional description

Structure of the blind positioning telegram stSunBld

TYPE ST_BA_SunBld:
STRUCT
     lrPos        : LREAL;
     lrAngl       : LREAL;
     bManUp       : BOOL;
     bManDwn      : BOOL;
     bManMod      : BOOL;
     bActv        : 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_BA_SunBldActr 3:

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 under udiBckLshTiDwn [ms]. 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 udiTurnTiDwn [ms] in the function block.

Upward travel profile:

FB_BA_SunBldActr 4:

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 an important parameter for the movement calculation and is entered in the function block under udiBckLshTiUp [ms]. 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 timespan of the subsequent turning of the slats from the "Outward low point" to the "Inward low point". This time is to be entered as udiTurnTiUp [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_BA_SunBldActr 5:

Functioning

As a rule, the function block controls the blind based on the information from the positioning telegram stSunBld. If automatic mode is active (bManMod=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 (bManMod=TRUE), the blind is controlled by the commands bManUp and bManDwn. An automatic movement command is triggered whenever a change from manual to automatic mode occurs.

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 0% is reached, the output bUp continues to be held for the complete blind 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.

After a system restart, the function block executes a reference run. Completion of the initial referencing is indicated through a TRUE signal at output bInitRefCmpl. The initial referencing cannot be terminated prematurely through a manual "blind down" command.

Target accuracy

Target accuracy

Since the function block determines the blind position solely via run times, the cycle time of the PLC task plays a crucial role for positioning accuracy. If the switching time for a louvre angle range of -70° to 10° is 1 second, for example, the accuracy at a cycle time of 50 ms is +/-4°.

Inputs/outputs

VAR_INPUT

bEn             : BOOL;
stSunbld        : ST_BA_SunBld;
udiTiUp         : UDINT;
udiTiDwn        : UDINT;
udiTurnTiUp     : UDINT;
udiTurnTiDwn    : UDINT;
udiBckLshTiUp   : UDINT;
udiBckLshTiDwn  : UDINT;
lrAnglLmtUp     : LREAL;
lrAnglLmtDwn    : LREAL;

bEn: 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 bUp and bDwn and the function block remains in a state of rest.

stSunbld: positioning telegram, see ST_BA_SunBld

udiTiUp: complete time for driving up [ms]

udiTiDwn: complete time for driving down [ms]

udiTurnTiUp: time for turning the slats in the upward direction [ms]

udiTurnTiDwn: time for turning the slats in the downward direction [ms]

udiBckLshTiUp: time to traverse the backlash in the upward direction [ms]

udiBckLshTiDwn: time to traverse the backlash in the downward direction [ms]

lrAnglLmtUp: highest position of the slats [°]

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

lrAnglLmtDwn: lowest position of the slats [°].

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

VAR_OUTPUT

bUp           : BOOL;
bDwn          : BOOL;
lrActlPos     : LREAL;
lrActlAngl    : LREAL;
bRef          : BOOL;
bInitRefCompl : BOOL;
bRef          : BOOL;
bBusy         : BOOL;
bErr          : BOOL;
udiErrId      : UDINT;
udiErrArg     : UDINT;

bUp: control output blind up

bDwn: control output blind down

lrActlPos: current position in percent

lrActlAngl: current slat angle [°]

bRef: the blind is referencing, i.e. the output bUp 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.

udiRefTi: referencing countdown display [s]

bInitRefCompl: initial referencing process complete

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

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

udiErrId / udiErrArg: contains the error number and the error argument. See error codes.

Requirements

Development environment

Target system

required library

required supplement

TwinCAT 2.11 R3/x64

PC/CX

TcBA library from V1.0.0

TS8040 | TwinCAT Building Automation from V1.0.0