# Damper2P

## `Damper2P` (FB)

FUNCTION\_BLOCK Damper2P

### Short description

> Control of a binary damper actuator with two position feedbacks\
> \
> Typical application: outdoor and exhaust air dampers of an HVAC system

### Representation

<figure><img src="https://2592874069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-f38ad1fa2c39ec6927f032cf9eb7cbb4f936dcd5%2FDamper2P_FB.png?alt=media" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name       | Data type         | Value range                                                               | Initial value          | Function                                         |
| ---------- | ----------------- | ------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------ |
| *xY*       | BOOL              |                                                                           |                        | Control signal                                   |
| *xForce*   | BOOL              |                                                                           | FALSE                  | Forced override after manual override            |
| *xAlarmIn* | BOOL              |                                                                           | FALSE                  | Actuator fault message                           |
| *eAOO*     | HVACTYPES.eManBin | HVACTYPES.eManBin.Auto, HVACTYPES.eManBin.ManOff, HVACTYPES.eManBin.ManOn | HVACTYPES.eManBin.Auto | Operating mode of the manual override - hardware |
| *xOpen*    | BOOL              |                                                                           |                        | Feedback damper open                             |
| *xClosed*  | BOOL              |                                                                           |                        | Feedback damper closed                           |

#### Outputs

| Name           | Data type | Value range | Initial value | Function                                          |
| -------------- | --------- | ----------- | ------------- | ------------------------------------------------- |
| *xHB*          | BOOL      |             |               | Release of damper actuator after manual override  |
| *xAB*          | BOOL      |             |               | Release of damper actuator before manual override |
| *xAlarmOpen*   | BOOL      |             |               | Fault for damper open position                    |
| *xAlarmClosed* | BOOL      |             |               | Fault for damper closed position                  |
| *xAlarm*       | BOOL      |             |               | Aggregate fault                                   |
| *xAuto*        | BOOL      |             |               | Combined message automatic mode                   |

#### Setpoints / Parameters

| Name               | Data type | Value range                                 | Initial value | Function                                                           |
| ------------------ | --------- | ------------------------------------------- | ------------- | ------------------------------------------------------------------ |
| **udiControlTime** | UDINT     | 10s … 600s                                  | 150s          | Reporting delay of the position monitoring                         |
| **xControl**       | BOOL      |                                             | TRUE          | Enable position monitoring                                         |
| **xForceOption**   | BOOL      |                                             | FALSE         | State of the output *xHB* during forced override                   |
| **eManModeB**      | eMANBIN   | eMANBIN.Auto, eMANBIN.ManOff, eMANBIN.ManOn | eMANBIN.Auto  | Operating mode of the manual override for the digital output *xHB* |

### Function description

#### Automatic output *xAB*

The release of the damper actuator before manual override *xAB* is taken unchanged from the enable input *xY* adopted.

#### Manual output *xHB*

The release of the damper actuator after manual override *xHB* corresponds to the release of the damper actuator before manual override *xAB* additionally extended by a manual override module and a forced override.

| *xAB* | **eManModeB**  | *xForce* | **xForceOption** | *xHB* | Notes                                          |
| ----- | -------------- | -------- | ---------------- | ----- | ---------------------------------------------- |
| FALSE | eMANBIN.Auto   | FALSE    | X                | FALSE | Manual override module in automatic            |
| TRUE  | eMANBIN.Auto   | FALSE    | X                | TRUE  | Manual override module in automatic            |
| X     | eMANBIN.ManOff | FALSE    | X                | FALSE | Manual override module in manual operation Off |
| X     | eMANBIN.ManOn  | FALSE    | X                | TRUE  | Manual override module in manual operation On  |
| X     | X              | TRUE     | FALSE            | FALSE | Forced override Closed                         |
| X     | X              | TRUE     | TRUE             | TRUE  | Forced override Open                           |

Legend: X = any

#### Fault for damper open position *xAlarmOpen*

The fault message for the position at damper opening *xAlarmOpen* is activated ( *xAlarmOpen* = TRUE ), if the following conditions are met simultaneously:

1\) The release of the position monitoring *xControl* is enabled ( = TRUE )\
\
2\) As operating mode of the manual override - hardware \*eAOO\* the automatic mode is selected ( \*eAOO\* = HVACTYPES.eManBin.Auto )\
\
3\) The states of the release of the damper actuator after manual override \*xHB\* and the feedback for damper open \*xOpen\* are continuously different for at least the reporting delay of the position monitoring \*\*udiControlTime\*\* ( ( \*xHB\* = FALSE and \*xOpen\* = TRUE ) OR ( \*xHB\* = TRUE and \*xOpen\* = FALSE ) ).\
\
The fault message for the position at damper opening \*xAlarmOpen\* is deactivated if at least one of the above conditions is no longer met.

#### Fault for damper open position *xAlarmClosed*

The fault message for the position at damper opening *xAlarmClosed* is activated ( *xAlarmClosed* = TRUE ), if the following conditions are met simultaneously:

1\) The release of the position monitoring *xControl* is enabled ( = TRUE )\
\
2\) As operating mode of the manual override - hardware \*eAOO\* the automatic mode is selected ( \*eAOO\* = HVACTYPES.eManBin.Auto )\
\
3\) The states of the release of the damper actuator after manual override \*xHB\* and the feedback for damper closed \*xClosed\* are continuously equal for at least the reporting delay of the position monitoring \*\*udiControlTime\*\* ( ( \*xHB\* = TRUE and \*xOpen\* = TRUE ) OR ( \*xHB\* = FALSE and \*xOpen\* = FALSE ) ).\
\
The fault message for the position at damper opening \*xAlarmClosed\* is deactivated if at least one of the above conditions is no longer met.

#### Aggregate fault *xAlarm*

The aggregate fault *xAlarm* is activated ( = TRUE ), if at least one of the two faults for the positions of the damper ( *xAlarmOpen* and *xAlarmClosed* ) or the input *xAlarmIn* is active.\
In all other cases the combined fault is *xAlarm* is not activated ( = FALSE ).

#### Combined message automatic mode *xAuto*

The combined message automatic mode *xAuto* is activated ( = TRUE ), if the input *eAOO* contains the value HVACTYPES.eManBin.Auto and the setpoint / parameter **eManModeB** contains the value eMANBIN.Auto.\
In all other cases the combined message automatic mode is *xAuto* is not activated ( = FALSE ).

#### Forced override *xForce*

The forced override acts directly on the output *xHB*. With the parameter **xForceOption** it is defined which state the output *xHB* assumes when TRUE at the input *xForce* takes.

### CODESYS

InOut:

| Scope       | Name             | Type    | Initial      |
| ----------- | ---------------- | ------- | ------------ |
| Input       | `xY`             | `BOOL`  |              |
| Input       | `xForce`         | `BOOL`  | FALSE        |
| Input       | `xAlarmIn`       | `BOOL`  | FALSE        |
| Input       | `eAOO`           | eManBin | eManBin.Auto |
| Input       | `xOpen`          | `BOOL`  |              |
| Input       | `xClosed`        | `BOOL`  |              |
| Output      | `xHB`            | `BOOL`  |              |
| Output      | `xAB`            | `BOOL`  |              |
| Output      | `xAlarmOpen`     | `BOOL`  |              |
| Output      | `xAlarmClosed`   | `BOOL`  |              |
| Output      | `xAlarm`         | `BOOL`  |              |
| Output      | `xAuto`          | `BOOL`  |              |
| Input Const | `udiControlTime` | `UDINT` | 200          |
| Input Const | `xControl`       | `BOOL`  | TRUE         |
| Input Const | `xForceOption`   | `BOOL`  | FALSE        |
| Input Const | `eManModeB`      | eMANBIN | eMANBIN.Auto |
