A proportional-integral-derivative controller (PID controller) is a control loop mechanism employing feedback taht is widely used in industrial control systems and a variety of other applications requiring continously modulated control.

Principle

A PID controller continuously calculates an error value e(t)e(t) as the difference between a desired setpoint (SP) and a measured process variable (PV) and applies a correction based on proportional, integral, and derivate terms (denoted P, I and D respectively),
hence the name.

Image of PID Controller

Positional PID Controller

From the above image, we can get the equation of Postional PID controller:


In this equation, e(t)e(t) means the error between target output and current output; KPK_P is the coefficient of the proportional process; TIT_I is the coefficient of the integral process; TDT_D is the coefficient of the derivative process.

However, in industrial control systems, the input and output values are discrete and we obtain them by sampling periodically by sensors. Therefore, the equation of PID controller should be transfromed into the discrete equation, in which TT is the sampling period.


Through the above equation, the control signal uu could be calculated by sampling the output yy of the discrete system each step. Therefore, such equation is named Positional PID Controller, since it calculates the input signals each step.

Unfortunately, Positional PID controller needs to save and compute all the errors between target output and actual output from the beginning till now, which cost numerous computing resources. Hence, Incremental PID Controller is introduced to resolve the problem.

Incremental PID Controller

A new equation of positional PID controller in the ek1e_{k-1} moment is introduced,


Use the equation (1) minus eqution (2), equation (3) could be obtained.


Through equation (3), we can calculate the increment of control signals only by saving past errors ek1e_{k-1}, ek2e_{k-2}.

Bonus

So, how to choose the optimal value of parameters KPK_P, TDT_D and TIT_I?

KP

The parameter KPK_P has an impact on the proportional process of PID controller and decide the tracking speed. However, if the plant is affected by an external load, the pure P Controller cannot reach the target output, which introduces the steady-state error.

TI

In order to eliminate the steady-state error, integral process is introduced and this procedure depends on the parameter TIT_I. Although the integral process is able to eliminate the steady-state error, it brings the problem of overshooting and oscillation.

TD

To resolve the problem of overshooting, derivative process use errors eke_k and ek1e_{k-1} to output the correction value.

Adjust Parameters

Hence, we can optimize the parameters of PID Controller through the following processes,

Common Method

  • Set a small KPK_P and an infinite TIT_I with TDT_D eqaulling to 0. Then gradually increase KPK_P until getting an opportune tracking speed and a satisfactory quarter attenuation transition curve.
  • If the steady-state error occurs, increase the effect of the integral process by decrease the parameter TIT_I until we think the integral process is enough, meanwhile, KPK_P should be set to 5/6KP5/6K_P.
  • If the problem of overshooting and oscillation occurs, set TD=(1/31/4)TIT_D = (1/3 \sim 1/4)T_I and increase it, which can miligate the problem but it will slow down the tracking speed.

Critical Ratio Method

  • Set a small KPK_P and an infinite TIT_I with TDT_D eqaulling to 0. Then gradually increase KPK_P until getting an equal amplitude oscillation, then record the critical coefficient KuK_u and the critical period of ascillation TuT_u.
  • Calculate the coefficients of KP,TI,TDK_P, T_I, T_D according to empirical formula.
  • Set coefficients of PID controller to the computed parameter and optimize them if necessary.
Image of Empirical Formula

References