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 mnemonicAmerican mnemonicNameData typeDirectionRequiredAccessMeaning
InstanceInstanceInstance (the controller’s memory)PIDInputYes—Instance (PID1…): the controller's memory (integral, previous measurement).
ENENEnableBOOLInputYesRead (PID1.EN)Rung: at 0, the output is frozen.
SPSPSet pointREALInputYesRead and write (PID1.SP)Setpoint (same unit as the measurement).
PVPVProcess variable (measurement)REALInputYesRead (PID1.PV)Process measurement.
KPKPProportional gainREALInputYesRead and write (PID1.KP)Proportional gain; negative = direct action.
TITIIntegral timeREALInputNoRead and write (PID1.TI)Integral time in seconds (0 = no integral).
TDTDDerivative timeREALInputNoRead and write (PID1.TD)Derivative time in seconds (0 = no derivative).
MANMANManual modeBOOLInputNoRead (PID1.MAN)Manual mode.
MOUTMOUTManual outputREALInputNoRead and write (PID1.MOUT)Manual output in %, used when MAN is 1.
OUTOUTControl outputREALOutputNoRead (PID1.OUT)Output from 0 to 100 % (to a valve, a heater…).
ERRERRErrorREALOutputNoRead (PID1.ERR)Error SP − PV.
MnemonicNameData typeDirectionRequiredAccessMeaning
InstanceInstance (the controller’s memory)PIDInputYes—Instance (PID1…): the controller's memory (integral, previous measurement).
ENEnableBOOLInputYesRead (PID1.EN)Rung: at 0, the output is frozen.
SPSet pointREALInputYesRead and write (PID1.SP)Setpoint (same unit as the measurement).
PVProcess variable (measurement)REALInputYesRead (PID1.PV)Process measurement.
KPProportional gainREALInputYesRead and write (PID1.KP)Proportional gain; negative = direct action.
TIIntegral timeREALInputNoRead and write (PID1.TI)Integral time in seconds (0 = no integral).
TDDerivative timeREALInputNoRead and write (PID1.TD)Derivative time in seconds (0 = no derivative).
MANManual modeBOOLInputNoRead (PID1.MAN)Manual mode.
MOUTManual outputREALInputNoRead and write (PID1.MOUT)Manual output in %, used when MAN is 1.
OUTControl outputREALOutputNoRead (PID1.OUT)Output from 0 to 100 % (to a valve, a heater…).
ERRErrorREALOutputNoRead (PID1.ERR)Error SP − PV.
MnemonicNameData typeDirectionRequiredAccessMeaning
InstanceInstance (the controller’s memory)PIDInputYes—Instance (PID1…): the controller's memory (integral, previous measurement).
ENEnableBOOLInputYesRead (PID1.EN)Rung: at 0, the output is frozen.
SPSet pointREALInputYesRead and write (PID1.SP)Setpoint (same unit as the measurement).
PVProcess variable (measurement)REALInputYesRead (PID1.PV)Process measurement.
KPProportional gainREALInputYesRead and write (PID1.KP)Proportional gain; negative = direct action.
TIIntegral timeREALInputNoRead and write (PID1.TI)Integral time in seconds (0 = no integral).
TDDerivative timeREALInputNoRead and write (PID1.TD)Derivative time in seconds (0 = no derivative).
MANManual modeBOOLInputNoRead (PID1.MAN)Manual mode.
MOUTManual outputREALInputNoRead and write (PID1.MOUT)Manual output in %, used when MAN is 1.
OUTControl outputREALOutputNoRead (PID1.OUT)Output from 0 to 100 % (to a valve, a heater…).
ERRErrorREALOutputNoRead (PID1.ERR)Error SP − PV.

Readable anywhere in the program, for example PID1.OUT. Writable members can be changed by the program (MOVE).

Example

European style
American style

PID1 drives valve TV101 to keep temperature TT101 at 60.

Behaviour in detail

See also