PID Loop Configuration — Engineering Guide
Shared by TSIMEREZIVO Team · 4 Oct 2026 · 47 views
#
PID Loop Configuration
Proportional-Integral-Derivative (PID) control is the backbone of process automation.
TSIMEREZIVO includes a full-featured PID function block that supports auto/manual switching
with bumpless transfer, setpoint ramping, output limits, cascade control, and feed-forward.
This guide covers configuration, tuning, and advanced strategies.
20 min
## PID Control Fundamentals
ISA-51.1 PID Algorithm (Position Form)
u(t) = Kp × e(t) + Ki × ∫e(t)dt + Kd × de(t)/dt
| term | formula | desc |
|---|---|---|
| Proportional (Kp) | Kp × e(t) | React to current error. Higher Kp = faster response, but may overshoot. Too high → oscillation. |
| Integral (Ki) | Ki × ∫e(t)dt | Eliminate steady-state offset. Accumulates error over time. Too high → windup and slow oscillation. |
| Derivative (Kd) | Kd × de(t)/dt | Dampen sudden error changes. Reduces overshoot. Too high → noise amplification and instability. |
where: `e(t) = SP − PV`
· SP = Setpoint · PV = Process Variable · u(t) = Controller Output (CV)
## TSIMEREZIVO PID Function Block Parameters
| param | tag | type | desc | val |
|---|---|---|---|---|
| Process Variable | PV | REAL | Measured process value (4–20mA scaled to engineering units) | Sensor read |
| Setpoint | SP | REAL | Desired process value. Operator setpoint in manual SP mode | Process design |
| Output | CV | REAL | Controller output 0–100%. Connected to valve/VFD AO channel | 0–100 % |
| Mode | MODE | BOOL | FALSE = Manual (operator controls CV), TRUE = Auto (PID controls CV) | FALSE (startup) |
| Proportional Gain | Kp | REAL | Proportional gain. Start at 1.0, tune up until near-oscillation | 0.5–5.0 |
| Integral Time | Ti | TIME | Integral time in seconds. Lower Ti = more integral action | T#30s–T#300s |
| Derivative Time | Td | TIME | Derivative time. Use 0 for most loops. Enable for slow processes | T#0s (default) |
| Output High Limit | CV_HI | REAL | Maximum CV output (valve fully open / VFD max frequency) | 100.0 |
| Output Low Limit | CV_LO | REAL | Minimum CV output (valve minimum stop / VFD min frequency) | 0.0 or 5.0 |
| SP Ramp Rate | SP_RAMP | REAL | Maximum SP change per minute. Prevents step changes from shocking process | 0 = disabled |
| Anti-Windup | ANTI_WINDUP | BOOL | Enable integrator anti-windup when output is at limit. ALWAYS TRUE in production | TRUE |
| Feed-Forward | FF | REAL | Feed-forward bias added to CV output. Compensates for measurable disturbances | 0.0 |
## Auto / Manual Mode Switching
> **RULE-P1: Bumpless Transfer — Mandatory** —
Switching a PID from Manual to Auto MUST use bumpless transfer: before enabling Auto,
the internal integrator is pre-loaded with the current manual CV value.
Without this, the controller will step the output to where the integral says it should be,
causing a potentially dangerous step change on the control valve or VFD.
The TSIMEREZIVO PID function block handles bumpless transfer automatically when ANTI_WINDUP=TRUE.
```st
(* Manual Mode: operator can write directly to TIC201.CV *)
TIC201.MODE := FALSE; (* FALSE = Manual *)
TIC201.CV := 45.0; (* Operator opens valve to 45% *)
(* Before switching to Auto: TSIMEREZIVO PID block pre-loads integrator *)
(* (This happens internally — no code required from engineer) *)
(* Switch to Auto: integrator starts from current CV = 45% *)
TIC201.MODE := TRUE; (* TRUE = Auto *)
(* PID now adjusts gradually from 45% to maintain SP *)
(* No bump, no step change on TIC201.CV output *)
(* Good practice: Log the mode switch *)
(* TSIMEREZIVO audit log records mode change automatically via RULE-P5 *)
```
## Step-Response Tuning (Ziegler-Nichols Open Loop)
### Step 1 — Put Loop in Manual Mode
Switch the PID to Manual. Let the process reach a stable steady state (PV flat for 5+ minutes).
Note the current CV% and the stable PV value.
### Step 2 — Make a Step Change
Apply a step change to the CV — typically 10% up or down.
In TSIMEREZIVO, adjust the Manual CV value in the faceplate from e.g. 45% to 55%.
Record the time of the step.
### Step 3 — Record the Step Response
Watch the trend. Record:
- **Dead time (L)**: Time from the step until PV starts to move
- **Rise time / time constant (τ)**: Time for PV to reach 63.2% of its final change
- **Process gain (Kp_process)**: ΔPV / ΔCV (e.g. 8°C / 10% = 0.8 °C/%)
### Step 4 — Calculate Ziegler-Nichols PID Parameters
```text
Kp = 0.9 × (τ / (Kp_process × L))
Ti = 3.33 × L (integral time in seconds)
Td = 0 (derivative — omit for most flow/pressure loops)
Example: L = 8s, τ = 45s, Kp_process = 0.8 °C/%
Kp = 0.9 × (45 / (0.8 × 8)) = 0.9 × (45 / 6.4) = 6.3
Ti = 3.33 × 8 = 26.7s → use T#27s in TSIMEREZIVO
```
## Cascade Control
Cascade control uses two PID controllers — a primary (outer) loop controlling the main process
variable, and a secondary (inner) loop that executes faster and compensates for inner disturbances.
The primary loop's output becomes the setpoint for the secondary loop.
*[Interactive diagram — view in the TSIMEREZIVO docs]*
```st
(* PRIMARY LOOP — Temperature outer controller *)
TIC201.PV := TT201_PV; (* Temperature PV from thermocouple *)
TIC201.SP := 120.0; (* Desired reactor temperature 120°C *)
TIC201.MODE := TRUE; (* Auto *)
(* PRIMARY loop output = setpoint for secondary *)
FIC401.SP := TIC201.CV; (* PrimaryOut drives cooling water flow SP *)
(* SECONDARY LOOP — Flow inner controller (faster — 100ms cycle) *)
FIC401.PV := FT401_PV; (* Cooling water flow m³/h *)
FIC401.MODE := TRUE; (* Auto — SP set by primary loop *)
(* FIC401.CV drives XV-401 cooling water valve *)
```
### Related Guides
| href | label | desc |
|---|---|---|
| /dashboard/docs/structured-text | Structured Text | Write the TSIMEREZIVO_PID function block in ST |
| /dashboard/docs/drum-level-3-element | 3-Element Drum Level | Classic cascade application for boiler drum |
| /dashboard/docs/faceplate-design | PID Faceplate | Design the operator-facing PID control panel |