PERFORMANCE COMPARISON OF PID TUNING BY USING ZIEGLER-NICHOLS AND PARTICLE SWARM OPTIMIZATION APPROACHES IN A WATER CONTROL SYSTEM

Tuning the gain of Proportional-Integral-Derivative (PID) controller in a process control system is exceptionally paramount since correct tuning would help a control process response without steady state error and overshoot. As the conventional gain tuning of PID controller, the Ziegler-Nichols (ZN) approach generally delivers an enormous overshoot; therefore, current heuristics approach, namely Particle Swarm Optimization (PSO) is utilized. A tuning problem of a single tank water level dynamic control system is presented. The best PID controller parameters are determined by using the ZN and PSO approaches. Comparisons of process time performance and the performance measurement of the system are made in order to evaluate both approaches in terms of their step response through the MATLAB/Simulink platform. The results demonstrate that the PSO approach produces promising results with lower overshoot compared to the ZN approach. It is found that the PSO approach would be advantageous for the industries related to single tank water control system for a better PID gain tuning.


INTRODUCTION
Proportional-Integral-Derivative (PID) control is the three basic control modes widely used in various applications nowadays, especially in plants and industrial processes.Examples of this type of processes are in power plants, food and beverage, pharmaceutical, manufacturing and packaging applications (Mehta & Reddy, 2015).The PID controller comprises three-term controls: the proportional (P), the integral (I) and the derivative (D) values.Each PID value can be interpreted as present error, accumulation of past errors and prediction of future errors, based on current rate of change.A number of applications related to controllers exist such as in industries which involved with temperature regulation, pressure, flow rate, chemical composition, speed and other applications.
The main issue in PID process control is related to tuning.Tuning a control loop is related to the adjustment of the three control parameters (proportional band, integral, derivative) to the ideal qualities for the control response sought.In an automated industry and plant, water control system is very important, especially in industrial process control to monitor water/fluid level in a tank according to the desired level.Without water level control, the output of the water level will vary, thus producing various outputs that affect the process.
Most of the valves of water tanks are built with electrical components which allow the process to be monitored automatically with controller elements.Therefore, tuning is required in this process, to ensure that the water height of the tank gives a desired value by adjusting the gain of the process control of the PID element.The measures of process performances in a process control are the steady state error, stability and overshoot.Adjusting the gain of PID in a process is very important because it produces either desired or undesired process performances.It is critical to ensure that the process control is in control and stable without the steady state error and overshoot.It is necessary to ensure that certain parameters of a controller in a process control system are tuned correctly to achieve process optimization and stability.
Among the conventional PID tuning approaches, the Ziegler-Nichols (ZN) approach is the most well-known one (Ogata, 1987).Studies have found that the ZN approach is the most favored by process control practitioners (Pillay & Govender, 2007).Pillay and Govender (2007) believe that most practitioners are reluctant to apply other approaches in the system because they have to learn new things which are complicated, time consuming and laborious to implement.This tuning approach works quite well on a wide variety of practical processes.Nevertheless, typically, it does not provide good tuning and most of the time, it has tendency to create an enormous overshoot (Solihin, Tack, & Kean, 2011).Recently, the new Particle Swarm Optimization (PSO) introduced by Kennedy and Eberhart (Kennedy & Eberhart, 1995), has opened a new path of optimal findings in process control.It is featured by its huge capacity for addressing continuous non-linear optimization problems, shorter calculation and simulation time compared to other stochastic approaches (Ebrahim, El-Metwally, Bendary, & Mansour, 2012;Das, Chakraborty, Ray, Bhattacharjee, & Neogi, 2012).This paper attempts to extend our previous research (Edaris & Abdul-Rahman, 2014) by developing a PID tuning utilizing PSO approach to obtain stability of the tuning process for a single tank water system.In addition, the PSO approach is compared to the ZN approach to check the validity of the results and the dynamics of process performances for both approaches.The results of this study show the process performance and effectiveness of PSO-PID as a tuning approach for single tank water level control system.Simulation results considerably clarify the effectiveness of the proposed PSO-PID approach and its flexibility towards improving the dynamic behavior and stability of single tank water level control.
A description on the plant dynamic model of a single tank water system is presented in the second section.The third section discusses the tuning process of ZN and PSO approaches.It is followed by the discussion on the simulation results in the following section for both approaches.Finally, a conclusion is provided with some future directions for research.

LITERATURE REVIEW
There are a number of tuning techniques proposed in the literature.Several traditional heuristics techniques that have been proposed for tuning the PID are by Ziegler and Nichols, (1942);and Cohen and Coon, (1953).These techniques still have a place due to their simplicity compared to other modern tuning techniques.
Other tuning techniques proposed in the literature are fuzzy logic, performance index based technique, genetic algorithm and PSO.A fuzzy logic control provides a formal method of translating subjective and imprecise human knowledge into control strategies which facilitate a better system performance through the exploitation and application of knowledge (Malhotra, Singh and Singh, 2010).A study by Rahmat and Ghazaly (2006) investigated the time specification performance comparison between conventional controller and fuzzy logic controller in the position control system of a DC motor.The result shows that the PID controller performs better compared to the fuzzy logic in terms of percentage overshoot.Tunyasrirut and Wangnipparnto (2007) carried out a study on the Fuzzy-PID cascade controller in controlling the water level of horizontal tank.The results of this study show that the speed of responses of the level control system with and without load interrupt in the tank are fast with the fuzzy logic controller and the PID controller with the smallest state error.
A performance index is defined as a quantitative measure to depict the system performance of the designed PID controller.By applying this technique , a good system can be designed and the PID parameters in the system could be adjusted to meet the required specifications.Solihin, Tack and Kean (2011) applied these performance indices as the objective function in their study.The performance indices are categorized into four criteria to depict the system performance.
Awouda and Mamat (2010) found an efficient tuning method of the PID controller by using the optimization rule of ITAE performance criteria.The method implies an analytical calculation of the gain of the controller for PID controlled systems.The objective function is selected so as to minimize the ITAE performance index.The study shows that the ITAE tuning setting from the authors gives a small rise time.
The genetic algorithm (GA) uses a direct analogy of such natural evolution to do global optimization in order to solve highly complex problems (Goldberg, 1989).It presumes that the potential solution of a problem is an individual and can be represented by a set of parameters (Kim, Kim, Park, Choe, & Heo, 2008).Korkmaz, Aydogdu and Dogan (2012) compared the performance of nonlinear PID and GA based PID.The result shows the effectiveness of the approaches for tuning the PID controller.In a comparative study of various intelligent techniques for temperature control of water bath systems, Saini and Rani (2012) found that the use of advanced techniques, such as Artificial Neural Networks (ANN) and GA with the conventional Fuzzy Logic Control offers encouraging advantages.
Current studies on tuning PID controller focuses on the new approach of PSO.For example, Tandan and Swarnkar (2015) introduced modified particle swarm optimization (MPSO) which is a simple and fast approach for optimizing PID controller.This approach is able to improve closed-loop performance over the PSO based optimized PID controller parameters.In a study by Asifa and Vaishnav (2010), PSO is proposed to improve the step response of a third order system.A comparison with other conventional approaches shows that the PSO based PID controller produces superior results, especially on the stability convergence and computational efficiency.The advantages of PSO approach have attracted our attention to apply this approach for solving a single water control system in this study.

PLANT DYNAMIC MODEL
The water level control system (SE-403) in the control laboratory of Sultan Abdul Halim Muadzam Shah Polytechnic, situated in Jitra, Kedah, Malaysia is an equipment specifically built for engineering education.The water level control system illustrates the dynamics of water from the sump tank to a process control tank.The dynamic feature of the water tank system is due to its flow of the water in and out through time.The water level in a process tank can be monitored automatically from the PID controller.The filling process of the water is carried out until it reaches the set point value or the desired value of level control specified by the user.
The schematic drawing in Figure 1 represents the model.This system consists of two tanks, the sump tank, TN 1 and the process tank, TN 2, with the controller valve or the final elements and level sensors, LS, at the bottom of the sump tank, a differential pressure transmitter of diaphragm seal type, a pump and a number of hand valves, HV.The sump tank, TN 1, at the bottom in the system design has a diameter of 40.5 cm and the process tank, TN 2, has a diameter of 150 mm.The pump provides in-feed from the sump tank, TN 1 to the outflow of process tank, TN 2. Water from the sump tank, TN 1, which acts as the water reservoir, will flow into the process tank, TN 2. Liquid is withdrawn from the base through an outflow orifice (outlet).The outlet pressure is atmospheric pressure.The water level in the process tank is measured utilizing a pressure sensitive sensor located at the base of the tank.Furthermore, a vertical scale in centimeters is placed beside each tank for visual feedback concerning the water level in each tank, also known as Level Gauge (LG) to measure the level for local indication.

Dynamic and Mathematical Model of Water Tank System
Based on the environment case study, the dynamic equations for the liquid level are derived as follows.For the process tank or TN 2 and the sump tank or TN 1 in Figure 1, the time rate of change of liquid level is given by: (1) where, L i (t) is the liquid levels, A is the tank's cross sectional area, F in is the inflow rate for the process tank, F out is the outflow rate for the process and sump tank and i is the number of tanks in the water level system .The inflow rate of the water into the process tank, TN 2 is given by: (2) where, K p is the pump constant (cm 3 /volt-sec) and V p is the voltage applied to the pump.Then, the velocity outflow for process tank derived for flow through the small orifice is given by: (3) where, V out is the velocity outflow for the process tank, g is the gravitational force acceleration and L is the liquid level for the process tank.Thus, the outflow rate for the process tank is: where, a 2 is the cross-sectional area of the outflow orifice at the bottom of process tank.
From Equation 1to Equation 4, the dynamic equations for the water level in the process tank is given by: (5) where A 2 is the tank's cross sectional area.Next, the steady state pump voltage, V PSS that produces the desired steady state constant level in the tank is constructed.Specifically, setting in Equation 5, yields: (1) where, (1) (1) (1) (1) The steady state level, L SS can be computed as: (7) where, a 2 is the cross-sectional area of the outflow orifice at the bottom of process tank and a 1 is the cross-sectional area of the outflow orifice at the bottom of sump tank.Equations 6 and 7 can be used to regulate the water level in the process tank.However, external disturbances, system parameter uncertainty or variation are necessary for a feedback controller to improve the level control system performance.By designing a set of variable l 2 (t) as an output and u(t) as an input in water level system: where D L 2 (t) is water level that changes dynamically with time in process tank, L ss is water level in steady state, is voltage applied to the pump that changes dynamically with time and V PSS is voltage in steady state.The dynamic Equation 5 can be rewritten as: (10) Linearizing the Equation 10 ( l 2 =0, u=0), yields: where, Finally, a transfer function model is developed for the system by taking the Laplace transform from Equation 11. (1) where, (1) (1) (9) (1) (9) where, The numerical values of the parameters for the process control system are presented in Table 1.The values and units from Table 1 are collected based on the actual data from the environment case study of water level control system (SE-403).Data collection is done through the registration system and the experimental study.The sump tank and process tank diameters, sump tank and process tank orifice diameters and the pump constant were collected through a registration system from the manual or the handbook of the environment case study.The experimental study of the environment case was carried out to obtain the specific information regarding the case environment workflow to achieve a correct mathematical model.Besides that, interviews with individuals in the laboratory, such as the laboratory technicians and the person-in-charge of the control laboratory were carried out.The interviewees explained in-depth the mechanics and the workings of the environment case and background theories of the control system.
The block diagram shown in Figure 2 is simplified with the closed loop system of a PID controller in the direct path with the transfer function of the plant or environment case G(s) in which R(s) represents the desired input signal, F(s) the feedback signal, E(s) the error signal of E(s)=R(s)-F(s), I(s) the input signal for the transfer function of plant G(s), Y(s) the output signal for the whole control system and G c (s) the transfer function of the PID controller.The transfer function is defined as the ratio of Laplace transform of the output to the Laplace transform of the input (Ogata, 1987).A 2 is the cross-sectional area of process control tank, TN 2 where =176.738cm 2 , while a 2 is the cross-sectional area of the outflow orifice at the bottom of process tank, TN 2 where 2.836cm 2 .Hence substituting the values from Table 1 into Equation 14, the single water level tank model as the first order system is written as: (15) The objective function used in this study is to minimize the performance index of Integrated Square of Error (ISE).
( 16) By applying ISE as the objective function in this study, it has the capability to seek a set of PID parameters, such that the feedback control system has least settling time and is able to penalize large overshoot.

METHODOLOGY
The gains of PID affect the process control system.For example, a proportional control (K p ) can have the effect of reducing the rise time but never eliminating the steady state error; an integral control (K i ) can have the effect of eliminating the steady state error, but it may make the transient response to worsen; and a derivative control (K d ) can have the effect of increasing the stability of the system, reducing the overshoot and improving the transient response.
Thus, tuning the correct PID could lead to a good performance of the water control system.

Tuning of PID using ZN
The flowchart of PID tuning for ZN Close Loop Control is presented in Figure 3.To do this, PID controller is tuned by setting the P only mode and the gain  Gm/20  (18) Gm/20  (18) Gm/20  (18) Gm/20  (18) is adjusted in order to keep the control system in continuous oscillation.Then, the controlled variable of the period oscillation and the amplitude of the step response are measured to determine the stability margins.(Ogata, 1987).
In this approach, applying proportional control and increasing the controller gain are essential until the process output reaches a sustained oscillation.The PID parameters are computed using the calculation given in Table 2, where T u denotes the period of the oscillation, and K u denotes the regulator gain yielding it.

Tuning of PID using PSO Optimization
Population-based search methodology, such as genetic algorithm (Ibrahim, Shamsuddin & Qasem, 2015) and ant colony algorithm (Alobaedy & Ku-Mahamud, 2015) have successfully solved optimization problem.The PSO is also considered as a population-based search methodology.The searching in this approach is through improvement of individuals by utilizing population cooperation and competition.This approach mimics the simulation of simplified social models, such as bird, fish and the swarming theory (Pan et al., 2006) and utilizes population based stochastic optimization approach.PSO involves a set of particles that fly around in a multidimensional search space by adjusting their directions and positions to search for a better solution.A particle and that of its neighbors with best position toward an optimal solution are known as pbest while gbest is a global best of all particles.The current velocity and the distance from Pbest i , to gbest are employed to calculate the modified velocity and position of each particle.This is shown in the following equations: ( where ; n: Number of particles in the group d: Dimension t : Pointer of iterations (generations) : Velocity of particle i at iteration t, w: Inertia weight factor c 1 , c 2 : Acceleration constant rand(): Random number between 0 and 1 : Current position of particle i at iterations Gm/20  (18) Gm/20  (18) Gm/20  (18) Gm/20  (18) Gm/20  (18) Figure 4 shows the flowchart of PID-PSO approach in water level control system of the environment case study.At first, initial swarm of particles in search space were randomly produced.Each particle was considered as a candidate solution for PID parameters.The values were set in the range of 0 to 50.This study involved three dimensional problems, where the set of parameters K p , K i and K d were represented by matrices with a dimension of 3x swarm size.The swarm size was 50 and the number of iterations for this study was also set to 50.The following parameters of PSO were chosen with inertia weight, w=0.7968 and acceleration constants, c 1 = c 2 = 1.4962.The parameters of w, c 1 and c 2 are weight parameters and were determined based on their performance from the initial test.Applying the values of K u and P u in Table 3 into the calculation of ZN Closed Loop tuning (as presented in Table 2) gave the value of K p , T i and T d as shown in Table 4. for the proposed water level control system.The gain values of K p =0.750, T i = 0.3950 and T d =0.633 for the Proportional, Integral and Derivative (PID) control resulting process control with the integral time, T i that was set to slow, which behave the process that will not return to the set point quickly enough.Besides that, the derivative time, T d which was too small, resulted in a process control which was unable to reduce the amount of possible measurement deviation and overshoot on process upset.Figure 6 shows that the system behaves in a good manner.The response of the system has a small rise time of 0.308 seconds and is able to minimize the steady state error by approaching the set point value at 3.59 seconds.However, the process response has a high overshoot of 55.1%.

Figure 6.
Step response for the PID-ZN Close Loop tuning.

PID-PSO Tuning
The results of PID-PSO Tuning for model control system are presented in Figure 7.It shows that the process output increases responding to the speed and direction of change of the process variable.The step response of PID-PSO Tuning does not show any time lag or dead time occurring in the process.The test illustrates that the PSO approach has the diversity of swarms for the controller gain determination.In Figure 8 (b), the 3-D contour plot shows the velocity of the model system.From the figure, it is clearly seen that each particle moves freely and randomly in the search space.Each different color in the 3-D represents different velocity of data from the first iteration to the 50 th iteration.It shows that a particle from the global best position and its local best position is near; hence, the nearer or smaller the change in velocity to move the particle back , the better the solution.PSO leads to dynamic tuning due to its ability to find the best optimal solution through time by searching the best possible solution in a short time.

Comparison
In the ZN tuned PID controller, the environment case plant response produces high overshoot while, the PID-PSO tuning shows a better performance with reduced amplitude peak of overshoot.The results of K p , K i and K d obtained for both tuning are shown in Table 5.The values of K p , T i and T d for the PID-PSO approach test indicate that the integral time is set from slow to fast, which results in the controller valve to move a bit faster than the measurement value.The derivative time, T d has been increased to a value of 20.1525 that is able to reduce the amount of possible measurement deviation and overshoot in the process.Details of the results for process performances using both tuning approaches are shown in Table 6 obtained from the data simulated by MATLAB prompt.
The transient response shows that the system has a subsequent change compared to the ZN approach with overshoot at 0% in the process and zero steady state.Based on the given values in Table 6, it is proven that the PID-PSO tuning approach is able to eliminate 100% error in the single tank water level control system.The transient response for both approaches proves that the PSO-PID tuning system is stable with less amplitude of steady state error and percentages of overshoot are reduced.Therefore, the process response of PID-PSO shows a better positive reaction compared to that of the ZN tuning approach.From the results and discussions presented in this section, it shows that the PID-PSO approach can give a good performance for solving single tank water level control system.The experiments have shown that this approach can be easily employed especially for the first single order tank water level control system.Moreover, this study has shown that the PID-PSO gives a better performance than the ZN tuning approach due to its capability to stabilize the system and to improve its dynamic behavior.Due to the ability of dynamic tuning of PSO to find best solution through time, thus better performance is obtained compared to the ZN tuning approach.
This study shows that both PSO and ZN approaches can be applied in process plant for process optimization.However, it is proven that PSO approach gives a better step response and performance compared to te ZN approach.The PID-PSO controller is able to reduce overshooting effectively due to the objective function applied in the PSO approach which can minimize large overshooting in a process plant.Inertia weight in PSO approach has a great effect in system performance of the approach itself.Inertia weight determines the velocity and optimal particles position in the search space.The particles in the search space oscillate and the determination for the best position is challenging if a high value of inertia weight is applied to the approach.On the other hand, if the inertia weight used is too low, it tends to create the fast convergence speed (premature convergence) and local minima.

CONCLUSION
This study presents a tuning problem of a single tank water level dynamic control system by tuning the gain of PID controller in a process control system.The tuning of water control system is important because incorrect tuning could lead to a control process response with steady state error and overshoot.This study proposes the tuning approaches based on PSO and ZN approaches.The result of the study shows that the conventional gain tuning of PID controller ZN approach generally delivers an enormous overshoot.Nevertheless, comparison between PSO and ZN approaches prove that PSO approach gives a better step response and performance compared to ZN approach.The PID-PSO controller is able to reduce overshooting effectively due to the objective function applied in the PSO approach which can minimize large overshooting in a process plant.Inertia weight in PSO approach has a great effect in system performance of the approach itself which determines the velocity and optimal particles position in the search space.Thus, PSO leads to dynamic tuning due to its ability to find the best solution through time.This study is implemented by applying PSO and ZN approaches within offline mode.It is suggested that this study can be improved by exploring the offline and online (real-time) modes with the process plant.It is also suggested that an improvement can be done to this study by considering a complex problem of water control system of multi-objective optimization.

Figure 1 .
Figure 1.Model of water level control system.

Figure 2 .
Figure 2. Block diagram of PID controller design.
Get the step response of oscillation curve vars= [K,L,T,N] Determine the close loop gain of G c (s) Define variable of ZN-PID design tool [k,ku,pu]=znPIDtuning(G,2) END Stability checking Verify K u and P u using step response in 5 periods Display the step response of the close loop system G c (s) Determine K u and P u Display step response of three systems using P, PI and PID controller Calculate the total number of input coefficients in the characteristics equation START Input close loop transfer function G c (s)

Figure 7 .
Figure 7. Step response of first test PID-PSO tuning.

Figure 8
Figure 8 (a) shows the contour plot of the local best position for the first test of PID-PSO Tuning.The plot shows that the particles move randomly from the first iteration until the end of iteration while searching for the best local position of the system.It shows that the PSO approach for the process control has large searches of search space in determination of the best local position.The test illustrates that the PSO approach has the diversity of swarms for the controller gain determination.In Figure8(b), the 3-D contour plot shows the velocity of the model system.From the figure, it is clearly seen that each particle moves freely and randomly in the search space.Each different color in the 3-D represents different velocity of data from the first iteration to the 50 th iteration.It shows that a particle from the global best position and its local best position is near; hence, the nearer or smaller the change in velocity to move the particle back , the better the solution.PSO leads to dynamic tuning due to its ability to find the best optimal solution through time by searching the best possible solution in a short time.

Figure 8 .Figure 8 .
Figure 8.(a) Contour plot for the local best position of PID-PSO tuning, (b) 3-D contour plot for the velocity of PID-PSO tuning.

Table 1
PhysicalQuantity and Symbol in Water Level Control System

Table 2 The
ZN Calculation for Closed-Loop

Table 3
K u and P u of ZN tuning Close LoopFrom the PID gains obtained in Table4, the step response for ZN Closed Loop tuning approach was simulated.The gain values of K p , T i and T d for the ZN approach presented in Table4indicate the values of the Proportional (P), Proportional and Integral (PI) and Proportional, Integral and Derivative (PID)

Table 5
PID gains for both approaches

Table 6
Performance measurements of both tuning approach (s = time in seconds, A= amplitude)