Function Block CTRL_PID

The Function Block CTRL_PID is a PID controller. It can be used as P, PI, PD or ID controller.

Input IN

The input is the measured actual value. This can be passed directly to the PID controller without debouncing or smoothing.

Input SETPOINT

The input is the target value that should be achieved. It is recommended to delay the input with the Function Block DELAYVALUE4.

Input RESET

The input resets the PID controller. The internal timers as well as I and D components are reset.

Input DIS

The input interrupts all calculations immediately. The calculation of the I and D component is paused. The values at output P and Q are buffered.

Input Kp

The input defines the P component of the controller. The P component is calculated as follows:

P=(SETPOINT-IN)*Kp

Input Ti

The input defines the I component as time constant of the incremental part of the controller. The I component is calculated flying as follows:

I=I+(SETPOINT-IN)*(ZEIT/Ti)

Input Td

The input defines the D component as time constant of the controller. The D component is calculated flying as follows:

D=((SETPOINT-IN)-D)*(ZEIT/Td)*MAX

Input PT

With the input PT, the sampling time of the controller is defined. The larger the value, the lower the load on the PLC.

Input MIN

The input defines the lower working range of the controller. If the input is not defined or the value is equal to NULL, then 0 is assumed.

Input MAX

The input defines the upper working range of the controller. If the input is not defined or the value is equal to NULL, then 255 is assumed.

Output Q

The output contains all controllers as a sum. This is limited according to the working range MIN and MAX.

Output P

The output P is always calculated immediately.

Output I

The output I contains the calculated I component.

Output D

The output D contains the calculated D component.

Note: The D component is only correctly calculated if the sampling PT was defined.