FB_HVACBasicSequenceCtrl

FB_HVACBasicSequenceCtrl 1:

Unlike the sequence controllers FB_HVACPIDCooling, FB_HVACDehumidify, FB_HVACEnergyRecovery, FB_HVACPIDHumidify, FB_HVACPIDMixedAir, FB_HVACPIDPreHeating and FB_HVACPIDReHeating, the function block FB_HVACBasicSequenceCtrl has no special system-specific extension or application. It is more general. The control direction of the controller is not automatically determined depending on the room air and outside air as is the case with the function blocks for heat recovery or the mixed air chamber.

A sequence of static heating and cooling ceiling can be implemented in the field of room automation with this function block.

VAR_INPUT

eDataSecurityType     : E_HVACDataSecurityType;
bSetDefault           : BOOL;
bEnable               : BOOL;
iNumberOfSequences    : INT;
iMyNumberInSequence   : INT;
rW                    : REAL;
rX                    : REAL;
tTaskCycleTime        : TIME;
tCtrlCycleTime        : TIME;
eCtrlMode             : E_HVACCtrlMode;
rYManual              : REAL;
rInitialValue         : REAL;
bResetController      : BOOL;
bReset                : BOOL;

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: Input variable for enabling the controller. The controller is enabled if bEnable = TRUE.

iNumberOfSequences: Number of sequence controllers in the system.

iMyNumberInSequence: The controller’s own number in the sequence.

rW: The setpoint is transferred to the controller with the variable rW.

rX: Actual value of the control loop.

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.

tCtrlCycleTime: Cycle time with which the control loop is processed. This must be greater than or equal to TaskCycleTime. The function block uses this input variable to calculate internally whether the state and the output variables have to be updated in the current cycle.

eCtrlMode: The operation mode is selected via this enum (see E_HVACCtrlMode).

rYManual: Manual value.

rInitialValue: The restart behavior of the controller is influenced by rInitialValue.

bResetContoller: A positive edge on the input bResetController resets the PID controller.

bReset: Acknowledge input in the event of a fault.

VAR_OUTPUT

rY                 : REAL; 
rXW                : REAL;
bMaxLimit          : BOOL;
bMinLimit          : BOOL;
bActive            : BOOL;
bARWactive         : BOOL;
eState             : E_HVACState;
bError             : BOOL;
eErrorCode         : E_HVACErrorCodes;
bInvalidParameter  : BOOL;

rY: Control signal output of the PID controller.

rXW: Control deviation

bMaxLimit: The output bMaxLimit is TRUE if the output rY has reached the value rYMax.

bMinLimit: The output bMinLimit is TRUE if the output rY has reached the value rYMin.

bActive: bActive is TRUE if the controller is active and enabled.

bARWactive: bARWactive is TRUE if the integral component of the controller has reached the lower or upper control variable limit.

eState: State of the controller (see E_HVACState).

bError: This output indicates with a TRUE that there is an error.

eErrorCode: Contains the command-specific error code (see E_HVACErrorCodes).

bInvalidParameter: TRUE if an error has occurred during the plausibility check. The message must be acknowledged with bReset.

VAR_IN_OUT

rDeadRange      : REAL;
bDirection      : BOOL;
rKp             : REAL;
tTi             : TIME;
tTv             : TIME;
tTd             : TIME;
rDeadBand       : REAL;
rYMin           : REAL;
rYMax           : REAL;
iCurrentSequence: INT;

rDeadRange: In order to avoid unnecessary driving and hence premature wear of the valves or damper drives, a dead range (0..32767) can be set for the controller output signal rY. This means that a control signal change is only active if the change of value is greater than the dead range. A constant change of the control signal rY is converted to a pulsating drive of the actuator if a dead range is specified. The larger the dead range the larger the pauses and the control signal jumps will be. The variable is saved persistently. Preset to 0.

bDirection: The control direction of the controller can be changed with the parameter bDirection. If bDirection is TRUE, then the direct control direction is active for cooling operation of the controller.
If bDirection is FALSE, then the indirect control direction of the controller is activated for heating operation.
The variable is saved persistently. Preset to FALSE.

rKp: Proportional factor amplification. The variable is saved persistently. Preset to 1.

tTi: Integration time. The I-component corrects the residual control deviation following correction of the P-component. The smaller the tTi time is set, the faster the controller corrects. The control loop becomes unstable if the time is too short. Larger tTi-times must be entered in order to reduce the integration component. The integral action time should be selected to be longer than the stroke time of the valve or damper actuator. The variable is saved persistently. Preset to 30 s.

tTv: Rate time. The larger tTv is, the stronger the controller corrects. The control loop becomes unstable if the time is too long. Often in normal building automation applications only a PI controller is used. In this case zero must be entered for tTv. The variable is saved persistently. Preset to 0 s.

tTd: Damping time. The variable is saved persistently. Preset to 0 s.

rDeadBand: If the control value is at the lower or upper limit of a controller and the actual value of the controlled system oscillates around the setpoint with a small amplitude, frequent switching back and forth between two sequence controllers can be avoided by an additional parameter for the switchover (0..32767). To this end, the difference between the actual and setpoints of the controlled system is integrated after the sequence controller has reached its lower or upper limit. Switching to the next sequence only takes place if the sum of this integration is greater than the value of rDeadband (See Example).
The variable is saved persistently. Preset to 0.

rYMin: Lower limit of the working range of the controller. The variable is saved persistently. Preset to 0.

rYMax: Upper limit of the working range of the controller. The variable is saved persistently. Preset to 100.

iCurrentSequence: Currently active controller in the sequence.

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