FB_BA_SunBldActr
This function block is used for positioning of a louvered blind via two outputs: drive up and drive down. The blind can be driven to any desired (height) position and louvre angle via the positioning telegram stSunBld. On top of that, 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.
Structure of the blind positioning telegram stSunBld.
TYPE ST_BA_SunBld:
STRUCT
rPos : REAL;
rAngl : REAL;
bManUp : BOOL;
bManDwn : BOOL;
bManMod : BOOL;
bActv : BOOL;
END_STRUCT
END_TYPE
The current height position and the louvre 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 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 under udiBckLshTiDwn_ms [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 louvres from the "Outward low point" to the "Inward low point". This time should be entered as udiTurnTiDwn_ms [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 louvre 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 louvres start to turn from the "Outward low point" to the "Inward low point". During this time the louvre 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 udiBckLshTiUp_ms [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 louvres from the "Outward low point" to the "Inward low point". This time should be entered as udiTurnTiUp_ms [ms] at the function block.
Parameterization
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:
- the travel time of the backlash (udiBckLshTiUp_ms / udiBckLshTiDwn_ms [ms])
- the turning duration (udiTurnTiUp_ms / udiTurnTiDwn_ms [ms])
- the total travel time (udiTiUp_ms / udiTiDwn_ms [ms])
Furthermore the following are required for the calculation:
- the highest louvre angle after turning upwards (rAnglLmtUp [°])
- the lowest louvre angle after turning downwards (rAnglLmtDwn [°])
The louvre angle λ is defined by a notional straight line through the end points of the louvre 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 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 travel-up time + 5 s.
For reasons of flexibility, there are two ways to interrupt the referencing process: 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 "travel-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 can also be terminated through a manual "travel-down" command.
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°.
VAR_INPUT
bEn : BOOL;
stSunbld : ST_BA_SunBld;
udiTiUp_ms : UDINT;
udiTiDwn_ms : UDINT;
udiTurnTiUp_ms : UDINT;
udiTurnTiDwn_ms : UDINT;
udiBckLshTiUp_ms : UDINT;
udiBckLshTiDwn_ms : UDINT;
rAnglLmtUp : REAL;
rAnglLmtDwn : REAL;
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_ms: Complete time for driving up [ms].
udiTiDwn_ms: Complete time for driving down [ms].
udiTurnTiUp_ms: Time for turning the louvres in the upward direction [ms].
udiTurnTiDwn_ms: Time for turning the louvres in the downward direction [ms].
udiBckLshTiUp_ms: Time to traverse the backlash in the upward direction [ms]. This input is internally limited to a minimum value of 0.
udiBckLshTiDwn_ms: Time to traverse the backlash in the downward direction [ms]. This input is internally limited to a minimum value of 0.
rAnglLmtUp: Highest position of the louvres [°].
This position is reached once the blind has moved to the top position.
The louvre angle λ, as defined above, is then typically greater than zero.
rAnglLmtDwn: Lowest position of the louvres [°].
This position is reached once the blind has moved to the bottom position.
The louvre angle λ, as defined above, is then typically less than zero.
VAR_OUTPUT
bUp : BOOL;
bDwn : BOOL;
rActlPos : REAL;
rActlAngl : REAL;
bRef : BOOL;
udiRefTi_sec : UDINT;
bInitRefCompl : BOOL;
bBusy : BOOL;
bErr : BOOL;
sErrDesc : T_MAXSTRING;
bUp: Control output for blind up.
bDwn: Control output for blind down.
rActlPos: Current position in percent.
rActlAngl: Current louvre angle [°].
bRef: The blind is referencing, 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.
udiRefTi_sec: 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.
sErrDesc: Contains the error description.
Error description |
---|
01: Error: Up/Down timer = 0. |
02: Error: Turning timer = 0. |
03: Error: Louvre angle limits: The upper limit is less than or equal to the lower limit (rAnglLmtUp<=rAnglLmtDwn). |
Requirements
Development environment | Required PLC library |
---|---|
TwinCAT from v3.1.4024.7 | Tc3_BA from v1.1.6.0 |