Share this

PID calculation in PLC control system

2026-04-06 05:46:21 · · #1

Currently, some well-known domestic and international brands dominate the entire field of industrial automation control, such as Emerson and Siemens from abroad, and Zhejiang University Control Technology and Hollysys from China. So how is the most common PID control implemented in these control systems , and how are PLD calculations obtained through programming and configuration? This article summarizes and briefly introduces the common PID control modules and their applications:

I. PID Calculation in DCS and PLC Control Systems

1. Instruction Explanation

In the above formula, T represents the time relay cycle output of the ladder diagram, which is referred to here as the sampling and adjustment cycle.

lS1 is the set target value, also known as the setpoint.

lS2 is the actual measured value.

lS3 is the starting parameter unit for PID control parameters, and the control parameters occupy the subsequent 25 D data registers of S3. Details are as follows:

S3+0: The TS sampling time is set to K1(1T).

S3+1:ACT. The operation direction is generally set to H0001;

Setting it to H0000 enables inverse PID calculation.

S3+2:L filter coefficient 0-99% 0% No filtering. Reference setting is K50.

0000-99.00

S3+3:KP proportional gain 0-32767% reference setting is K2000.

0000-327.67

S3+4:TI integration time 0-32767 (•1T) reference setting is K500.

S3+5: KD differential gain 0-32767% is generally set to K0.

0000-327.67

S3+6: The differential parameter TD 0-32767(•1T) is set to K0, with no differential.

S3+7: Deviation, floating-point representation, occupies two bytes: S7+7, S7+8.

E(K) = SV - PV (ACT.0 = 1)

E(K) = PV - SV (ACT.0 = 0)

S3+8:

S3+9: The first derivative of the deviation, represented as a floating-point number. S3+9, S3+10

E(K)'=E(K)-E(K-1)

S3+10:

S3+11: The second derivative of the deviation, in floating-point representation. S3+11, S3+12

E(K)''=E(K)'-E(K-1)'

S3+12:

S3+13: The measured value after filtering, represented as a floating-point number. S3+13, S3+14.

PVF(K)=PV(K)+L•[PVF(K-1)-PV(K)]

S3+14:

S3+15: The derivative adjustment term of the PID controller, represented as a floating-point number. S3+15, S3+16.

PID_D(K)=[TD•E(K)''+KD•TD•PID_D(K-1)]/(TS+KD•TD)

S3+16:

S3+17: The output of this PID adjustment, represented as a floating-point number. S3+17, S3+18

DMV(K) = Few part of DMV(K-1) + KP[E(K)' + TS•E(K)/TI + PID_D(K)]

S3+18:

S3+19: Output value of PID control, range: 0-32767.

MV(K) = MV(K-1) + INT(DMV)

S3+20:SH upper limit alarm set to K20000

S3+21:SL lower limit alarm set to K20

S3+22: OH upper limit value is set to K10000

S3+23:OL lower limit value is set to K20

S3+24:ALM.0SH Upper Limit Alarm ON

ALM.1SL lower limit alarm ON

ALM.2OH upper limit output ON

ALM.3OL lower limit output ON

PID calculation formula

1.PVF(K)=PV(K)+L•[PV(K-1)-PV(K)]

E(K) = SV(K) - PVF(K)

E(K)'=E(K)-E(K-1)

E(K)''=E(K)'-E(K-1)'

2.D(K)=[TD•E(K)''+KD•TD•D(K-1)]/(TS+KD•TD)

3.MV(K)=MV(K-1)+KP•[E(K)'+TS•E(K)/TI+D(K)]

Symbol explanation:

PV: Measured value. SV: Target value. MV: Output value.

PVF: Measured value after filtering.

L: Filtering coefficient.

TS: Sampling time.

KP: Proportional gain.

TI: Integral Time.

TD: Differential time.

KD: differential gain.

PV(K): The value measured in this sampling.

D(K): Differential term.

INT(DMV): The incremental output of the PID in this iteration.

PV(K-1): The value measured before one adjustment period T.

II. Application of PID Calculation in DCS and PLC Control Systems

Case 1. Control a group (four) of experimental electric furnaces. Temperature detection uses PT100 resistance thermometers. The operating temperature is below 100℃, and the control accuracy requirement is 0.1℃ with overshoot less than 0.5℃. The heat source is resistance wire, and the total heating power of each furnace is 380VAC 8KW.

Control scheme: Select a hybrid PLC as the adjustment and control unit. Its output controls four three-phase intelligent modules. The office computer communicates with the PLC to track and record temperature.

The configuration parameters for each channel (set via HMI or character screen):

Channel 0, Channel 1, Channel 2, Channel 3

AI channel set temperature D300D310D320D330

P parameters D301D311D321D331

I parameter D302D312D322D332

D parameters: D303D313D323D333

PID manual/automatic switching M100M110M120M130

Manually add M101M111M121M131

Manually reduce M102M112M122M132

Measured temperatures D10D11D12D13

DA channel output current D20D21D21D23

Select one of the routes and provide a brief explanation:

Step 1: Plan and set the control zone parameters. PID control occupies a total of 28 data registers, and the first channel temperature control is planned to D2000-D2027.

Step 2: PID control and manual control must be coordinated to achieve seamless switching. In the example, the final outputs of both manual and automatic control are attributed to D2028.


Disclaimer: This article is a reprint. If it involves copyright issues, please contact us promptly for deletion (QQ: 2737591964). We apologize for any inconvenience.

Read next

CATDOLL Christina Hard Silicone Head

The head made from hard silicone does not have a usable oral cavity. You can choose the skin tone, eye color, and wig, ...

Articles 2026-02-22