# DamperAnalog

## `DamperAnalog` (FB)

FUNCTION\_BLOCK DamperAnalog

### Short description

> Control of a continuous damper actuator with continuous position feedback\
> \
> Typical application: continuous recirculation damper of an HVAC system

### Representation

> <img src="https://2592874069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-4825398b20029ec01a3532b2d60ebf59cc18d334%2FDamperAnalog_FB.png?alt=media" alt="" data-size="original">

### Interfaces

#### Inputs

| Name       | Data type         | Value range                                   | Initial value          | Function                                       |
| ---------- | ----------------- | --------------------------------------------- | ---------------------- | ---------------------------------------------- |
| *rY*       | REAL              |                                               |                        | Setpoint - Position                            |
| *xForce*   | BOOL              |                                               | FALSE                  | Forced override by manual mode                 |
| *xAlarmIn* | BOOL              |                                               | FALSE                  | Actuator fault message                         |
| *rU*       | REAL              |                                               | 0.0                    | Feedback of the damper position                |
| *eAO*      | HVACTYPES.eManNum | HVACTYPES.eManNum.Auto, HVACTYPES.eManNum.Man | HVACTYPES.eManBin.Auto | Operating mode of manual override - hardware   |
| *rPoti*    | REAL              |                                               | 0.0                    | Manual value of the manual override - hardware |

#### Outputs

| Name        | Data type | Value range | Initial value | Function                                                 |
| ----------- | --------- | ----------- | ------------- | -------------------------------------------------------- |
| *rHA*       | REAL      |             |               | Control signal to damper actuator after manual override  |
| *rAA*       | REAL      |             |               | Control signal to damper actuator before manual override |
| *xAlarmPos* | BOOL      |             |               | Fault message from position monitoring                   |
| *xAlarm*    | BOOL      |             |               | Aggregate fault                                          |
| *xAuto*     | BOOL      |             |               | Collective automatic mode message                        |

#### Setpoints / parameters

| Name               | Data type | Value range               | Initial value | Function                                                                |
| ------------------ | --------- | ------------------------- | ------------- | ----------------------------------------------------------------------- |
| **udiControlTime** | UDINT     | 10s … 600s                | 150s          | Duration of the position monitoring                                     |
| **rControlDiff**   | REAL      |                           | 7.0 %         | maximum permissible deviation between setpoint and actual position in % |
| **xControl**       | BOOL      |                           | TRUE          | Enablement of the position monitoring                                   |
| **xForceOption**   | BOOL      |                           | FALSE         | State of the output *rHA* under forced override                         |
| **rManValue**      | REAL      |                           | 0.0           | Manual value                                                            |
| **eManModeN**      | eMANNUM   | eMANNUM.Auto, eMANNUM.Man | eMANBIN.Auto  | Operating mode of the manual override                                   |

### Function description

#### Control signal to damper actuator before manual override *rAA*

The control signal of the damper actuator before manual override *rAA* is taken unchanged from the input Setpoint - Position *rY* over.

#### Control signal to damper actuator after manual override *rHA*

The control signal of the damper actuator after manual override *rHA* corresponds to the control signal of the damper actuator before manual override *rAA* additionally extended by a manual override module and by a forced override.

| *rAA* | **eManModeN** | *xForce* | **xForceOption** | *rHA*         | Notes                                      |
| ----- | ------------- | -------- | ---------------- | ------------- | ------------------------------------------ |
| X     | eMANNUM.Auto  | FALSE    | X                | *rAA*         | Manual override module in automatic        |
| X     | eMANNUM.Man   | FALSE    | X                | **rManValue** | Manual override module in manual operation |
| X     | X             | TRUE     | FALSE            | 0.0           | Forced override 0.0                        |
| X     | X             | TRUE     | TRUE             | 100.0         | Forced override 100.0                      |

Legend: X = don't care

#### Position monitoring

The position monitoring can be enabled ( **xControl** = TRUE ) or disabled ( **xControl** = FALSE ).\
When position monitoring is enabled, the absolute value of the difference between the control signal after manual override *rHA* and the position feedback from the damper actuator *rU* is determined and compared with the threshold **rControlDiff** .\
If this difference permanently exceeds the threshold during an alarm delay **udiControlTime** an alarm signal is generated, provided at the same time the feedback - automatic operation *eAO* signals the automatic operation ( *eAO* = HVACTYPES.eManNum.Auto ).\
This alarm signal is forwarded to the output *xAlarmPos* transferred ( *xAlarmPos* = TRUE ).\
The alarm signal is deactivated again ( *xAlarmPos* = FALSE ) as soon as the difference falls below the threshold for the first time.

#### Aggregate fault *xAlarm*

The aggregate fault *xAlarm* is activated ( = TRUE ) if *xAlarmPos* or the input *xAlarmIn* is active.\
In all other cases the collective fault *xAlarm* is not activated ( = FALSE ).

#### Collective automatic mode message *xAuto*

The collective automatic mode message *xAuto* is activated ( = TRUE ) if the input *eAO* has the value HVACTYPES.eManNum.Auto and the setpoint / parameter **eManModeN** contains the value eMANNUM.Auto. In all other cases the collective message automatic operation *xAuto* is not activated ( = FALSE).

#### Forced override *xForce*

The forced override acts directly on the output *rHA*. With the parameter **xForceOption** it is defined which state the output *rHA* assumes at TRUE on the input *xForce* takes.\
\
When **xForceOption** = FALSE\
If the input *xForce* is TRUE, then the output *rHA* set to 0.\
\
At **xForceOption** = TRUE\
If the input *xForce* is TRUE, then the output *rHA* set to 100.

### CODESYS

InOut:

| Scope       | Name             | Type    | Initial      |
| ----------- | ---------------- | ------- | ------------ |
| Input       | `rY`             | `REAL`  |              |
| Input       | `xForce`         | `BOOL`  | FALSE        |
| Input       | `xAlarmIn`       | `BOOL`  | FALSE        |
| Input       | `rU`             | `REAL`  | 0            |
| Input       | `eAO`            | eManNum | eManNum.Auto |
| Input       | `rPoti`          | `REAL`  | 0            |
| Output      | `rHA`            | `REAL`  |              |
| Output      | `rAA`            | `REAL`  |              |
| Output      | `xAlarmPos`      | `BOOL`  |              |
| Output      | `xAlarm`         | `BOOL`  |              |
| Output      | `xAuto`          | `BOOL`  |              |
| Input Const | `udiControlTime` | `UDINT` | 200          |
| Input Const | `rControlDiff`   | `REAL`  | 7            |
| Input Const | `xControl`       | `BOOL`  | TRUE         |
| Input Const | `xForceOption`   | `BOOL`  | FALSE        |
| Input Const | `rManValue`      | `REAL`  | 0            |
| Input Const | `eManModeN`      | eMANNUM | eMANNUM.Auto |
