FB_BA_SunBldActr
The function block FB_BA_SunBldActr is used to position a 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 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:
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 nBckLshTiDwn [ms]. Since it is not known at any point after a blind movement of any length whether backlash has already taken effect, the backlash of the downward movement or its travel time can be measured most reliably if the blind was first raised fully. A further important parameter is the time interval of the subsequent turning of the slats from the "Inward low point" to the "Outward low point". This time should be entered as nTurnTiDwn [ms] at the function block.
Upward travel profile:
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). Also this time is an important parameter for the movement calculation and is entered in the function block under nBckLshTiUp [ms]. Since it is not known at any point after a blind movement of any length whether backlash has already taken effect, the backlash of the upward movement or its travel time can be measured most reliably if the blind was first 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 should be entered as nTurnTiUp [ms] at 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:
- the backlash duration (nBckLshTiUp / nBckLshTiDwn [ms])
- the turning duration (nTurnTiUp / nTurnTiDwn [ms])
- the total travel time (nTiUp / nTiDwn [ms])
Furthermore the following are required for the calculation:
- the highest slat angle after turning upwards (fAnglLmtUp [°])
- the lowest slat angle after turning downwards (fAnglLmtDwn [°])
The slat angle λ is defined by a notional straight line through the end points of the slat to the horizontal.
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 slat angle are always driven to, wherein changes are immediately accounted for. The height positioning takes priority: First the entered height and afterwards the slat 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 travel-up time. The position is then in any case "0" and the lamella 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 bUp continues to be held for the complete up time + 5 s.
The referencing process can be interrupted by a manual "down" command or by repositioning.
After a plant restart, the function block executes a reference run.
Target accuracy
Since the function block determines the blind position solely via travel times, the cycle time of the PLC task plays a crucial role for positioning accuracy. If the switching time for a slat angle range of -70° to 10° is 1 second, for example, the accuracy at a cycle time of 50 ms is +/-4°.
Inputs
VAR_INPUT
bEn : BOOL;
stCmd : ST_BA_SunBld;
nTiUp : UDINT;
nTiDwn : UDINT;
nTurnTiUp : UDINT;
nTurnTiDwn : UDINT;
nBckLshTiUp : UDINT;
nBckLshTiDwn : UDINT;
fAnglLmtUp : REAL;
fAnglLmtDwn : REAL;
END_VAR
Name | Type | Description |
---|---|---|
bEn | BOOL | 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. |
stCmd | Positioning telegram | |
nTiUp | UDINT | Complete time for driving up [ms] |
nTiDwn | UDINT | Complete time for driving down [ms]. |
nTurnTiUp | UDINT | Time for turning the slats in the upward direction [ms]. |
nTurnTiDwn | UDINT | Time for turning the slats in the downward direction [ms]. |
nBckLshTiUp | UDINT | Time to traverse the backlash in the upward direction [ms]. This input is internally limited to a minimum value of 0. |
nBckLshTiDwn | UDINT | Time to traverse the backlash in the downward direction [ms]. This input is internally limited to a minimum value of 0. |
fAnglLmtUp | REAL | 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.
Name | Type | Description |
---|---|---|
fAnglLmtDwn | REAL | 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.
Outputs
VAR_OUTPUT
bUp : BOOL;
bDwn : BOOL;
fActlPos : REAL;
fActlAngl : REAL;
bRef : BOOL;
nRefTi : UDINT;
bBusy : BOOL;
bErr : BOOL;
sErrDesc : T_MAXSTRING;
END_VAR
Name | Type | Description |
---|---|---|
bUp | BOOL | Control output for blind up |
bDwn | BOOL | Control output for blind down |
fActlPos | REAL | Current position in percent |
fActlAngl | REAL | Current lamella angle [°] |
bRef | BOOL | The blind is in referencing mode, i.e. the output bUp is set for the complete travel-up time + 5s. Only a manual "down" command can move the blind in the opposite direction and terminate this mode. |
nRefTi | UDINT | Referencing countdown display [s] |
bBusy | BOOL | A positioning or a referencing procedure is in progress. |
bErr | BOOL | In case of a fault, e.g. if warning stages are active, this output is set to TRUE. |
sErrDescr | T_MAXSTRING | Contains the error description. |
Error description |
---|
01: Error: Up/down timer = 0. |
02: Error: Turning timer = 0. |
03: Error: Lamella angle limits: the upper limit is less than or equal to the lower limit (fAnglLmtUp <= fAnglLmtDwn). |
Requirements
Development environment | Required PLC library |
---|---|
TwinCAT from v3.1.4024.22 | Tc3_BA2 from v5.2.5.0 |