# CascadeExtractSupplyAirTemperature

## `CascadeExtractSupplyAirTemperature` (FB)

FUNCTION\_BLOCK CascadeExtractSupplyAirTemperature

### Short description

> Generation of a supply air setpoint temperature using a cascade controller (PI controller)\
> Additional functions: Limitation of the supply air setpoint temperature\
> Typical application: Supply air temperature control in a ventilation system

### Representation

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

### Function description

#### General

This function block is used to generate the supply air setpoint temperature of a ventilation system from<br>

1. Current setpoint temperature (exhaust or room temperature) in °C

\
2\) Current actual temperature (exhaust or room temperature) in °C\
\
taking into account the relative (rMinSUPTemp and rMaxSUPTemp) and absolute (rMinSUP and rMaxSUP) limits.\
In addition, the special operating modes ‘Fast heating’ and ‘Free night cooling’ are taken into account when forming the supply air setpoint temperature.\
The formation of the supply air setpoint temperature takes place with a time delay (tDelayControl) after the release/locking of the controller (xEn = TRUE).\
\
The cascade controller is enabled if the following conditions described below are fulfilled simultaneously:\
\
1\) The special operating mode Fast heating is locked (xFastHeatEn = FALSE).\
\
2\) The special operating mode Free night cooling is locked (xFNCEn = FALSE).\
\
3\) The current actual temperature rActTemp does not violate its absolute limits (+5.0 - +50.0 °C).\
\
4\) The control is enabled (xEn = TRUE) and the start-up delay (time duration = tDelayControl) has ended.\
\
In all other situations the cascade controller is locked.

#### Control

The current actual temperature *rActTemp* is, with the cascade controller enabled (PI controller, *xEn* = TRUE, expiry of the time duration **tDelayControl**, no limit violation at the input *rActTemp*) continuously compared with the current setpoint temperature *rSetPtTemp* and depending on the magnitude/sign of the difference or depending on the controller settings (**rPI\_Kp** or **rPI\_Tn**) an offset temperature is generated in the cascade controller.\
\
In heating mode (*rActTemp* < *rSetPtTemp*) this produces a positive offset temperature in the range 0.0 - **rMaxRelativeSUP** K.\
In cooling mode (*rActTemp* > *rSetPtTemp*) this produces a negative offset temperature in the range 0.0 - **rMinRelativeSUP** K.\
In the fully regulated state (*rActTemp* = *rSetPtTemp*) the offset temperature does not change.\
\
This offset temperature is then added to the current setpoint temperature and, if necessary, limited to the calculated limits\
\&#xNAN;*rMinSUPTemp* or *rMaxSUPTemp* .\
\
At the output *rMinSUPTemp* the calculated minimum supply air setpoint temperature is continuously shown (*rActTemp* + **rMinRelativeSUP**, absolutely limited to **rMinSUP** or **rMaxSUP**) .\
At the output *rMaxSUPTemp* the calculated maximum supply air setpoint temperature is continuously shown (*rActTemp* + **rMaxRelativeSUP**, absolutely limited to **rMinSUP** or **rMaxSUP**).\
\
The current actual temperature *rActTemp* is monitored for compliance with limits.\
On every limit violation (*rActTemp* < +5.0 °C or *rActTemp* > +50.0 °C) the cascade controller is deactivated.

#### Selection of the supply air setpoint temperature

The selection of the supply air setpoint temperature is carried out according to the following function table.

| *xFastHeatEn* | *xFNCEn* | *rActTemp* within limit | *xEn* | Supply air setpoint temperature   | Notes                                       |
| ------------- | -------- | ----------------------- | ----- | --------------------------------- | ------------------------------------------- |
| TRUE          | X        | X                       | X     | **rMaxSUP**                       | Special operating mode ‘Fast heating’       |
| FALSE         | TRUE     | X                       | X     | **rMinSUP**                       | Special operating mode ‘Free night cooling’ |
| FALSE         | FALSE    | FALSE                   | X     | *rSetPtTemp*                      | Limit violation actual temperature          |
| FALSE         | FALSE    | X                       | FALSE | *rSetPtTemp*                      | Locking of the control                      |
| FALSE         | FALSE    | TRUE                    | TRUE  | *rSetPtTemp* + Offset temperature | Normal operation                            |

Legend: X = any

#### Formation of the current supply air setpoint temperature *rSetPtSUPTemp*

The current supply air setpoint temperature *rSetPtSUPTemp* is formed from the supply air setpoint temperature, extended by a manual override module.

| Supply air setpoint temperature | **eManModeN** | *rSetPtSUPTemp*                 | Notes                                      |
| ------------------------------- | ------------- | ------------------------------- | ------------------------------------------ |
| X                               | eMANNUM.Auto  | Supply air setpoint temperature | Manual override module in automatic        |
| X                               | eMANNUM.Man   | **rManValue**                   | Manual override module in manual operation |

Legend: X = any

### CODESYS

InOut:

| Scope       | Name              | Type    | Initial      |
| ----------- | ----------------- | ------- | ------------ |
| Input       | `xEn`             | `BOOL`  |              |
| Input       | `rActTemp`        | `REAL`  | 0            |
| Input       | `rSetPtTemp`      | `REAL`  | 21           |
| Input       | `xFastHeatEn`     | `BOOL`  | FALSE        |
| Input       | `xFNCEn`          | `BOOL`  | FALSE        |
| Output      | `rSetPtSUPTemp`   | `REAL`  |              |
| Output      | `rMinSUPTemp`     | `REAL`  |              |
| Output      | `rMaxSUPTemp`     | `REAL`  |              |
| Input Const | `rPI_Tn`          | `REAL`  | 600          |
| Input Const | `rPI_Kp`          | `REAL`  | 1            |
| Input Const | `rMaxSUP`         | `REAL`  | 26           |
| Input Const | `rMaxRelativeSUP` | `REAL`  | 6            |
| Input Const | `rMinSUP`         | `REAL`  | 16           |
| Input Const | `rMinRelativeSUP` | `REAL`  | -8           |
| Input Const | `tDelayControl`   | `TIME`  | TIME#5m0s0ms |
| Input Const | `rManValue`       | `REAL`  |              |
| Input Const | `eManModeN`       | eManNum | eManNum.Auto |
