FB_HVACAnalogTo3Point

FB_HVACAnalogTo3Point 1:

This function block serves to convert an analog control signal into a three-point step signal. Hence three-point dampers or valves can be controlled by a controller with a continuous control signal. The function block FB_HVACAnalogTo3Point works with or without a continuous positional feedback signal from the drive.

Example: 3-Point-Actuator without feedback and limit switches

FB_HVACAnalogTo3Point 2:

VAR_INPUT

eDataSecurityType    : E_HVACDataSecurityType;
bSetDefault          : BOOL;
bEnable              : BOOL;
rSetpoint            : REAL;
rFeedb               : REAL;
bLimitSwitchOpen     : BOOL;
bLimitSwitchClose    : BOOL;
bCtrlVoltage         : BOOL;
bReset               : BOOL;
tTaskCycleTime       : TIME;

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.

bSetDefault: If the variable is TRUE, the default values of the VAR_IN_OUT variables are adopted.

bEnable: The function block is enabled if bEnable = TRUE. If control voltage is present and there are no errors and bEnable = FALSE, then the output bClose is TRUE and the output bOpen is FALSE. If the reference mode eReferencingMode = eHVACReferencingMode_Emulation, then the output bClose remains set until either the limit switch is reached, the enable signal is present again or there is an error.
If the reference mode eReferencingMode = eHVACReferencingMode_AnalogFeedback, then the output bClose remains set until either the enable signal is present again, or there is a fault or rFeedback = rMinSetpoint.

rSetpoint: The setpoint for the position of the damper or the valve is transferred to the function block with the variable rSetpoint. The value range for rSetpoint is specified by the parameters rMaxSetpoint and rMinSetpoint (0.0..32767).
If no correct variable value is present at rSetpoint, then the last valid variable value, if one exists, will be taken. If there is no valid last value, operation continues internally with rMinSetpoint. bInvalidParameter will be set in the event of an incorrect variable value; the function block continues to work normally.

rFeedb: The input variable rFeedb (0.0..32767) is only active if the referencing mode of the function block eReferencingMode = eHVACReferencingMode_AnalogFeedback. The actual position of the drive is fed back with the scaled input signal rFeedb. The scaling of rFeedb must correspond to the scaling of rSetpoint. The value range for rFeedb is specified by the parameters rMaxSetpoint and rMinSetpoint. rFeedb is feedback to the controller via the output variable rPosition.
If no correct variable value is present at rFeedb , then the last valid variable value, if one exists, will be taken. If no valid last value exists, operation continues internally with rMinSetpoint. bInvalidParameter will be set in the event of an incorrect variable value; the function block continues to work normally.

bLimitSwitchOpen/bLimitSwitchClose: If the three-point actuator is equipped with limit switches, these can be connected to the inputs bLimitSwitchOpen and bLimitSwitchClose.
The limit switches serve as references for the function block in the referencing mode eReferencingMode = eHVACReferencingMode_Emulation. Depending on the direction of driving, the currently calculated position rPosition is automatically set to the corresponding value of rMaxSetpoint/rMinSetpoint by a falling edge on one of the two inputs bLimitSwitchOpen/bLimitSwitchClose. This also takes place when the drive is at a standstill.
Regardless of which referencing mode the function block is in, the associated output bOpen or bClose remains at TRUE after the respective limit switch has been reached.
The limit switches must be connected to the function block as normally closed contacts. If none exist, a TRUE must be applied to the two inputs bLimitSwitchOpen/bLimitSwitchClose.

bCtrlVoltage: A check is made of whether control voltage is present via the input variable bCtrlVoltage. Both bOpen and bClose are set to FALSE in the event of failure of the control voltage. Since many error messages are based on the quiescent current principle, there would be a torrent of error messages following failure of the control voltage. Therefore all error messages are suppressed in the FB_HVACAnalogTo3Point in the event of control voltage failure.
The control voltage is present if a TRUE is present at the input bCtrlVoltage.

bReset: Acknowledge input in the event of a fault.

tTaskCycleTime: Cycle time with which the function block is called. If the function block is called in every cycle this corresponds to the task cycle time of the calling task.
If an incorrect time value of T#0 s is present on tTaskCycleTime, then tTaskCycleTime is set internally to T#1 ms. bInvalidParameter is set in the case of an incorrect variable value.

VAR_OUTPUT

bOpen             : BOOL;
bClose            : BOOL;
byState           : BYTE;
rPosition         : REAL;
bErrorGeneral     : BOOL;
byError           : BYTE;
bErrorLimitSwitch : BOOL;
bInvalidParameter : BOOL;

bOpen: Output for opening drive of the three-point actuator.

bClose: Output for closing drive of the three-point actuator.

byState: Status byte indicating the operating state of the function block.
byState.0 := bEnable
byState.1 := bOpen
byState.2 := bClose
byState.3 := bLimitSwitchOpen
byState.4 := bLimitSwitchClose
byState.7 := bCtrlVoltage

rPosition: With rPosition either the measured or the calculated position of the drive is fed back to the controller.
If eReferencingMode = eHVACReferencingMode_AnalogFeedback, then rFeedb is fed back to the controller via the output variable rPosition. If rFeedb > rMaxSetpoint, then rPosition = rMaxSetpoint and bInvalidParameter is set. If rFeedb < rMinSetpoint, then rPosition = rMinSetpoint and bInvalidParameter is set.
If eReferencingMode = eHVACReferencingMode_Emulation, then the actual position of the drive will be emulated on the basis of a calculation and fed back to the controller via rPosition.

bErrorGeneral: The error message bErrorGeneral becomes TRUE as soon as bErrorGeneralLimitSwitch = TRUE. The outputs bOpen and bClose are then set to FALSE and are only enabled again when the error has been rectified and acknowledged via bReset.

byError: Delivers all error messages and warnings from the function block
byError.1 := bInvalidParameter
byError.2 := bErrorGeneral
byError.3 := bErrorLimitSwitch

bErrorLimitSwitch: Becomes TRUE if both limit switches are activated simultaneously or if ((rMaxSetpoint - rThreshold) < rSetpoint) and bOpen = TRUE ) or if ((rMinSetpoint + rThreshold) > rSetpoint) and bClose = TRUE). The error bErrorLimitSwitch can only occur if eReferencingMode = eEmulation.

bInvalidParameter: Indicates that an incorrect parameter is present at one of the variables rMinSetpoint, rMaxSetpoint, rThreshold, rTolerance, tPauseMin, tPauseMax, tInterval, tStrokeTime, tSwitchOverDeadTime, eReferencingMode, rSetpoint or rFeedback. An incorrect parameter entry does not lead to a standstill of the function block; see description of variables. After rectifying the incorrect parameter entry, the message bInvalidParameter must be acknowledged via bReset.

VAR_IN_OUT

rMinSetpoint        : REAL;
rMaxSetpoint        : REAL;
rThreshold          : REAL;
rTolerance          : REAL;
tPauseMin           : TIME;
tPauseMax           : TIME;
tInterval           : TIME;
tStrokeTime         : TIME;
tSwitchOverDeadTime : TIME;
eReferencingMode    : E_HVACReferencingMode;

rMinSetpoint/rMaxSetpoint: The value range for rSetpoint is specified by the parameters rMaxSetpoint (0..32767) and rMinSetpoint (0..32767). rMaxSetpoint must be greater than rMinSetpoint. In addition the two variables rMaxSetpoint and rMinSetpoint are integrated in the calculation of the variable pulse/pause modulation; see fig. 1.1.
If an incorrect variable value is present, then the last valid variable value, if one exists, will be taken. If there is no valid last value, operation continues with the preset value. bInvalidParameter will be set in the event of an incorrect parameter entry; the function block continues to work normally. The variables are saved persistently. rMinSetpoint preset to 0. rMaxSetpoint preset to 100.

rThreshold/rTolerance: If the difference between the set position value rSetpoint and the calculated or measured actual position value rPosition of the actuator is greater than the threshold value set by the variable rThreshold (0.001..32767), then the function block begins to correct the position by cycling the outputs bOpen and bClose, depending on the control deviation value. Correction continues until the deviation is smaller than the value rTolerance (0.001..32767). A hysteresis loop for the opening and closing movement of the drive is defined by the value of rThreshold – rTolerance. This is necessary in order to prevent the drive reacting to the smallest changes of the control value. Wear on the drive and the relay is thus reduced. rThreshold must be greater than rTolerance.
rSetpoint - rPosition
> = rThreshold: bOpen is activated
rPosition- rSetpoint > = rThreshold:
bClose is activated
If an incorrect variable value is present, then the last valid variable value, if one exists, will be taken. If there is no valid last value, operation continues with the preset value. bInvalidParameter will be set in the event of an incorrect parameter entry; the function block continues to work normally. The variables are saved persistently. rThreshold preset to 5.0. rTolerance preset to 2.0.

tPauseMin/tPauseMax/tInterval: A variable pulse/pause modulation for cycling the three-point actuator can be set with the parameters tPauseMin [s] (0..3600), tPauseMax [s] (0..3600) and tInterval [s] (0..3600). The pause length is defined as a function of the control deviation by the parameters tPauseMin and tPauseMax. In the case of a small deviation the pause time is long in relation to the interval time. Analogously, the pause time is short if the deviation is large. The effective driving speed of the three-point actuator is thus higher for larger control deviations than it is for smaller ones; see following fig. The following condition must be satisfied in all cases: tPauseMin < tPauseMax < tInterval
If an incorrect variable value is present, then the last valid variable value, if one exists, will be taken. If there is no valid last value, operation continues with the preset value. bInvalidParameter will be set in the event of an incorrect parameter entry; the function block continues to work normally. The variables are saved persistently. tPauseMin preset to 2 s. tPauseMax preset to 8 s. tInterval preset to 10 s.

tStrokeTime: The variable tStrokeTime [s] specifies the complete stroke time of the drive. If the drive has no continuous position feedback, the actual position of the drive will be emulated on the basis of a calculation. For this reason the precise input of the total stroke time of the actuator is important. The following condition must be satisfied in all cases: tStrokeTime > tInterval
If an incorrect variable value is present, then the last valid variable value, if one exists, will be taken. If there is no valid last value, operation continues with the preset value. bInvalidParameter will be set in the event of an incorrect parameter entry; the function block continues to work normally. The variable is saved persistently. Preset to 200 s.

tSwitchOverDeadTime: Dwell time when changing direction (0..3600). Both outputs are reset during this period.
If an incorrect variable value is present, then the last valid variable value, if one exists, will be taken. If there is no valid last value, operation continues with the preset value. bInvalidParameter will be set in the event of an incorrect parameter entry; the function block continues to work normally. The variable is saved persistently. Preset to 500 ms.

eReferencingMode: Enum that specifies the referencing mode of the function block (see E_HVACReferencingMode).
Depending on the features of the actuator used, the position is referenced depending on eReferencingMode.
If eReferencingMode = eHVACReferencingMode_Emulation, the position of the drive will be calculated on the basis of the activation of bOpen and bClose by means of tStrokeTime. However, as the operating hours of the three-point valve or three-point damper increase, deviations could occur due to mechanical inaccuracies in the drive. In order to achieve automatic matching of the actual and calculated positions, one of the outputs bOpen or bClose will be set to TRUE upon reaching the calculated position rPosition of rMaxSetpoint or rMinSetpoint and it is correspondingly given the value of the parameter rMaxSetpoint or rMinSetpoint. A falling edge on the signal inputs bLimitSwitchOpen and bLimitSwitchClose is used to reference the position of the drive to rMaxSetpoint or rMinSetpoint. The associated output bOpen or bClose remains at TRUE after the respective limit switch has been reached.
If eReferencingMode = eHVACReferencingMode_AnalogFeedback, the position of the drive will be transferred on the basis of the signal rFeedback. The associated output bOpen or bClose remains at TRUE after the respective limit switch has been reached.
If an incorrect variable value is present, then the last valid variable value, if one exists, will be taken. If there is no valid last value, operation continues with the preset value. bInvalidParameter will be set in the event of an incorrect parameter entry; the function block continues to work normally. The variable is saved persistently. Preset to 0.

Figure 1.1

FB_HVACAnalogTo3Point 3:

Example

tInterval

120 seconds

tPauseMin

10 seconds

tPauseMax

60 seconds

 

 

rSetpoint

100%

rPosition

50%

tPauseInterval / bClose OR bOpen

35 seconds/85 seconds

 

 

rSetpoint

50%

rPosition

25%

tPauseInterval / bClose OR bOpen

47,5 seconds/72,5 seconds

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