*2.5.1. PID control*

The three term controller (Proportional-Integral-Deriavative) is well defined as:

$$u(t) = K \left( e(t) + \frac{1}{T\_i} \int\_0 e(\tau) d\tau + T\_d \frac{d e(t)}{dt} \right).$$

Where e(t) is the error signal, which represents the difference between the desired value known a set point SP and the measured variable MV. So e(t) =SP –MV. Ti is the integral time constant, Td is the derivative time constant and K is the loop gain. So basically the role of this controller is to force the output to follow the input, as fast as the parameters permit, with an acceptable overshoot and without steady state error. This requires very careful choosing of the parameters (known as tuning) with a considerable gain without driving the system into non stability. The PID controller algorithm is used for the control of almost all loops in the process industries, and is also the basis for many advanced control algorithms and strategies. In order for control loops to work properly, the PID loop must be properly tuned. Standard methods for tuning loops and criteria for judging the loop tuning have been used for many years such as Ziegler, though new ones have been reported in recent literature to be used on modern digital control systems.

#### *2.5.1.1. PID tuning*


This results in the smallest upset due to the fact that the net change in the amount of reagent added is zero.

From figure(11), by reducing the control valve opening by 30% (step response), the pH response could be represented by a first order system plus a time delay model (FOPTD). The following could be noticed:

For this First Order Plus Time Delay (FOPTD) model, we note the following characteristics of its step response:


3. The step response is essentially complete at t=5τ. In other words, the settling time is ts=5τ.

**Figure 11.** PH with small disturbance on the flow rate

254 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

The three term controller (Proportional-Integral-Deriavative) is well defined as:

0

Where e(t) is the error signal, which represents the difference between the desired value known a set point SP and the measured variable MV. So e(t) =SP –MV. Ti is the integral time constant, Td is the derivative time constant and K is the loop gain. So basically the role of this controller is to force the output to follow the input, as fast as the parameters permit, with an acceptable overshoot and without steady state error. This requires very careful choosing of the parameters (known as tuning) with a considerable gain without driving the system into non stability. The PID controller algorithm is used for the control of almost all loops in the process industries, and is also the basis for many advanced control algorithms and strategies. In order for control loops to work properly, the PID loop must be properly tuned. Standard methods for tuning loops and criteria for judging the loop tuning have been used for many years such as Ziegler, though new ones have been reported in recent literature to

 When one wants to find the parameters of PID control he needs first the transfer function for his process. G. Shinskey and J. Gerry (6) have described the pH tuning technique after setting up a series of restrictions summarized as follows((figure(11)):

 Wait about 15 seconds and increase the controller output by 20% of its original value. Wait another 15 seconds and decrease the controller output by 10% of its original value. Let the pH signal re-stabilize. Analysis software processes the data to optimal PID tuning variables. It could be clearly noticed that this method is near to an offline more

This results in the smallest upset due to the fact that the net change in the amount of reagent

From figure(11), by reducing the control valve opening by 30% (step response), the pH response could be represented by a first order system plus a time delay model (FOPTD). The

For this First Order Plus Time Delay (FOPTD) model, we note the following characteristics

2. The line drawn tangent to the response at maximum slope (t = θ) intersects the y/KM=1

1. The response attains 63.2% of its final response at time, t = τ+θ.

*d*

*T dt* 

1 *t*

*i de(t) u(t) K e(t) e( )d T*

*2.5.1. PID control* 

*2.5.1.1. PID tuning* 

added is zero.

be used on modern digital control systems.

than to online technique.

following could be noticed:

line at (t = τ + θ).

of its step response:

 Let the pH signal stabilize in the manual mode Decrease the controller output by about 10%

**Figure 12.** Graphical analysis of to pbtain parameters of FOPTD

From pervious steps the transfer function is:

$$TF = \frac{-4.67e^{-0.916}}{0.4s + 1}$$

In the next section, we discuss different tuning methods to determine the PID parameters.

#### *2.5.1.2. ITEA technique*

Integral of the time –weighted absolute error (ITEA). ITEA criterion penalizes errors that persist for long period of time.

#### **PROPOTIONAL:**

$$\begin{aligned} Y &= A \left( \frac{\theta}{\tau} \right)^B = 0.965 \left( \frac{0.916}{0.41} \right)^{-0.85} = 0.488 \\ K K\_{\odot} &= 0.488 \\ K\_{\odot} &= \frac{0.488}{0.476} = -0.1045 \end{aligned}$$

**INTEGRAL:** 

$$\begin{aligned} Y &= A + B \left( \frac{\theta}{\tau} \right) = 0.796 - 0.1465 \left( \frac{0.916}{0.41} \right) = 0.469 \\ \frac{\tau}{\tau\_l} &= 0.469 \tau\_l = \frac{0.4}{0.469} = 0.876 \end{aligned}$$

**DERIVATIVE**:

256 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

*2.5.1.2. ITEA technique* 

persist for long period of time.

**Figure 13.** ITEA SIMULINK test

**PROPOTIONAL:** 

**INTEGRAL:** 

0.916 4.67 0.4 1

*s* 

*<sup>e</sup> TF*

In the next section, we discuss different tuning methods to determine the PID parameters.

Integral of the time –weighted absolute error (ITEA). ITEA criterion penalizes errors that

0.85 0.916 0.965 0.488 0.41

0.916 0.796 0.1465 0.469 0.41

 

0.488

*B*

0.476

*C*

*Y A*

*C*

*K*

*Y AB*

*l*

*KK*

0.488 0.1045

0.4 0.469 0.876 0.469 *<sup>l</sup>*

$$Y = A \left(\frac{\theta}{\tau}\right)^B = 0.308 \left(\frac{0.916}{0.41}\right)^{0.929} = 0.649$$
 
$$\frac{\tau\_D}{\tau} = 0.649$$
 
$$\tau\_D = 0.649 \times 0.4 = 0.267$$

**PID equation is:**

$$PID = -0.1045 \left( 1 + \frac{1}{0.876s} + 0.267s \right)$$

#### *2.5.1.3. IMC*

More comprehensive method model design is the Integral Model Control (IMC). **PROPOTIONAL:** 

$$\begin{aligned} KK\_{\odot} &= \frac{\tau + \frac{\partial}{2}}{\tau\_c + \frac{\partial}{2}} = \frac{0.4 + \frac{0.916}{2}}{1 + \frac{0.916}{2}} = 0.588 \\\\ K\_{\odot} &= \frac{0.858}{-4.67} = -0.126 \end{aligned}$$

**INTEGRAL:**

$$
\tau\_l = \tau + \frac{\theta}{2} = 0.4 + \frac{0.916}{2} = 0.858
$$

**DERIVATIVE:** 

$$\tau\_D = \frac{\pi \theta}{2\tau + \theta} = \frac{0.4 \times 0.916}{2 \times 0.4 + 0.916} = 0.2136$$

**PID equation is:** 

$$PID = -0.126 \left( 1 + \frac{1}{0.858s} + 0.2136s \right)$$

**Figure 14.** IMC using SIMULINK test

**Figure 15.** IMC online test

### *2.5.1.4. Self tuning*

The SIMULINK is used to tune the PID (refer to figure(16)). The following transfer function of the self tuning PID was obtained:

$$PID = -0.16877 \left( 1 + \frac{1}{-0.1335s} + 0.0329s \right)^2$$

From figure (13-18), it could be easily noticed that neither technique, when applied to the real system, they have all produced unsatisfactory result. In fact, the best one is the self tuning, yet it has produced an oscillatory response. This has been reflected on the valve opening. (Refer to fig(18)). This is due to the fact that there are three gains. So any small change in the input results in a large change in the output. And this explains the behaviour of the titration curve. This has lead us to look for a non linear controller to control the system. This is the fuzzy logic control which is the subject of the next part.

258 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

The SIMULINK is used to tune the PID (refer to figure(16)). The following transfer function

*PID s*

<sup>1</sup> 0.16877 1 0.0329 0.1335

*s* 

**Figure 14.** IMC using SIMULINK test

**Figure 15.** IMC online test

of the self tuning PID was obtained:

*2.5.1.4. Self tuning* 

**Figure 17.** Self turning using SIMULINK simulation

**Figure 18.** Self tunung online test
