PID PID controller (set point SP, measure PV → output OUT 0–100 %)
Also called: PID loop, proportional integral derivative, closed-loop control, PID controller
PID controller: computes OUT (0–100 %) to bring the measurement PV to the setpoint SP.
What it does
The PID block compares the measurement PV with the setpoint SP and adjusts the output OUT (0 to 100 %) to remove the error, with proportional (KP), integral (TI) and derivative (TD) action.
When to use it
To control a continuous quantity: temperature, level, pressure, flow. The PID simulator lets you practise tuning.
Operands
| European mnemonic | American mnemonic | Name | Data type | Direction | Required | Access | Meaning |
|---|---|---|---|---|---|---|---|
| Instance | Instance | Instance (the controller’s memory) | PID | Input | Yes | — | Instance (PID1…): the controller's memory (integral, previous measurement). |
| EN | EN | Enable | BOOL | Input | Yes | Read (PID1.EN) | Rung: at 0, the output is frozen. |
| SP | SP | Set point | REAL | Input | Yes | Read and write (PID1.SP) | Setpoint (same unit as the measurement). |
| PV | PV | Process variable (measurement) | REAL | Input | Yes | Read (PID1.PV) | Process measurement. |
| KP | KP | Proportional gain | REAL | Input | Yes | Read and write (PID1.KP) | Proportional gain; negative = direct action. |
| TI | TI | Integral time | REAL | Input | No | Read and write (PID1.TI) | Integral time in seconds (0 = no integral). |
| TD | TD | Derivative time | REAL | Input | No | Read and write (PID1.TD) | Derivative time in seconds (0 = no derivative). |
| MAN | MAN | Manual mode | BOOL | Input | No | Read (PID1.MAN) | Manual mode. |
| MOUT | MOUT | Manual output | REAL | Input | No | Read and write (PID1.MOUT) | Manual output in %, used when MAN is 1. |
| OUT | OUT | Control output | REAL | Output | No | Read (PID1.OUT) | Output from 0 to 100 % (to a valve, a heater…). |
| ERR | ERR | Error | REAL | Output | No | Read (PID1.ERR) | Error SP − PV. |
| Mnemonic | Name | Data type | Direction | Required | Access | Meaning |
|---|---|---|---|---|---|---|
| Instance | Instance (the controller’s memory) | PID | Input | Yes | — | Instance (PID1…): the controller's memory (integral, previous measurement). |
| EN | Enable | BOOL | Input | Yes | Read (PID1.EN) | Rung: at 0, the output is frozen. |
| SP | Set point | REAL | Input | Yes | Read and write (PID1.SP) | Setpoint (same unit as the measurement). |
| PV | Process variable (measurement) | REAL | Input | Yes | Read (PID1.PV) | Process measurement. |
| KP | Proportional gain | REAL | Input | Yes | Read and write (PID1.KP) | Proportional gain; negative = direct action. |
| TI | Integral time | REAL | Input | No | Read and write (PID1.TI) | Integral time in seconds (0 = no integral). |
| TD | Derivative time | REAL | Input | No | Read and write (PID1.TD) | Derivative time in seconds (0 = no derivative). |
| MAN | Manual mode | BOOL | Input | No | Read (PID1.MAN) | Manual mode. |
| MOUT | Manual output | REAL | Input | No | Read and write (PID1.MOUT) | Manual output in %, used when MAN is 1. |
| OUT | Control output | REAL | Output | No | Read (PID1.OUT) | Output from 0 to 100 % (to a valve, a heater…). |
| ERR | Error | REAL | Output | No | Read (PID1.ERR) | Error SP − PV. |
| Mnemonic | Name | Data type | Direction | Required | Access | Meaning |
|---|---|---|---|---|---|---|
| Instance | Instance (the controller’s memory) | PID | Input | Yes | — | Instance (PID1…): the controller's memory (integral, previous measurement). |
| EN | Enable | BOOL | Input | Yes | Read (PID1.EN) | Rung: at 0, the output is frozen. |
| SP | Set point | REAL | Input | Yes | Read and write (PID1.SP) | Setpoint (same unit as the measurement). |
| PV | Process variable (measurement) | REAL | Input | Yes | Read (PID1.PV) | Process measurement. |
| KP | Proportional gain | REAL | Input | Yes | Read and write (PID1.KP) | Proportional gain; negative = direct action. |
| TI | Integral time | REAL | Input | No | Read and write (PID1.TI) | Integral time in seconds (0 = no integral). |
| TD | Derivative time | REAL | Input | No | Read and write (PID1.TD) | Derivative time in seconds (0 = no derivative). |
| MAN | Manual mode | BOOL | Input | No | Read (PID1.MAN) | Manual mode. |
| MOUT | Manual output | REAL | Input | No | Read and write (PID1.MOUT) | Manual output in %, used when MAN is 1. |
| OUT | Control output | REAL | Output | No | Read (PID1.OUT) | Output from 0 to 100 % (to a valve, a heater…). |
| ERR | Error | REAL | Output | No | Read (PID1.ERR) | Error SP − PV. |
Readable anywhere in the program, for example PID1.OUT. Writable members can be changed by the program (MOVE).
Example
PID1 drives valve TV101 to keep temperature TT101 at 60.
Behaviour in detail
- Ideal form: output clamped to 0–100 %, integral anti-windup, derivative on the measurement (no kick when the setpoint changes).
- TI and TD in seconds; TI = 0 disables the integral.
- Negative KP: direct action (the output rises when the measurement exceeds the setpoint, e.g. for cooling).
- MAN at 1: manual mode, OUT follows MOUT; bumpless return to automatic.
- Rung at 0: the output is frozen and the block tracks it (no jump on return).
- ERR = SP − PV.