PID Control Design Using AGPSO Technique and Its Application in TITO Reverse Osmosis Desalination Plant

Desalination plants have an important concern regarding controlling the permeate flow rate and pH during operability. This paper proposes the proportional integral derivative (PID) control design using modified Particle Swarm Optimization (PSO) techniques called autonomous groups PSO (AGPSO) in the two-input two-output (TITO) RO desalination plant to control the permeate flow rate and pH. Here, three different versions (AGPSO1, AGPSO2, and AGPSO3) of the AGPSO algorithm are utilized to design PID control for the same TITO plant. In addition, an integral time absolute error ( $J_{\mathrm {ITAE}}$ ) based objective function is utilized to design a PID controller. The simulation results suggest that the proposed controller designs are flexible, self-tuning, and have stable characteristics, while the AGPSO3-PID control design attained a robust design for optimum tuning compared to existing improved grey wolf optimization PID (IGWO-PID) and other versions of AGPSO based PIDs (AGPSO1-PID, AGPSO2-PID). The design of AGPSO-PID achieved a minimum objective function than existing IGWO-PID and other versions of AGPSO based PIDs {AGPSO1-PID, AGPSO2-PID}. Finally, the proposed controller designs outperform the existing IGWO-PID design in literature in terms of control performance, demonstrating a precise control for and the improvement of plant performance.

are ∼18,000 desalination plants installed with 97.2 million m 3 /day capacity around the world [11]. The Minjur reverse osmosis (RO) desalination plant in Chennai, which is built on a 60-acre, is the largest plant in India, producing ∼100 megalitres clean water per day [12].
Literature suggests that commonly two types of desalination techniques are widely used during treatment: thermal-based and membrane-based [11]. The thermal-based desalination techniques like multi-effect distillation (MED) and multi-stage flash (MSF) involve evaporating saline water and then condensing the resulting steam to recover freshwater [11]. These techniques have been installed mainly in the Middle East, particularly in Saudi Arabia. The membrane techniques like ultrafiltration (UF), nanofiltration (NF), RO, forward osmosis (FO), and membrane distillation (MD) use semipermeable membranes to separate freshwater from saline water [11]. Among them, the RO-based desalination is the most widely used water-treatment technique, with more than 60% installed capacity worldwide [13].
The type of process controlling action plays a vital role in the desalination plant. This requires manipulating the process variables like speed, pressure, flow, temperature, etc., to improve the plant performance [36], [38], [39], [39], [40]. According to the literature, various controllers such as ON-OFF, proportional (P), integral (I), derivative (D), PI, PD, and PID have been utilized earlier in the plant's design [36], [37], [38], [39], [41], [42], [43], [44], [45]. Though, every controller has unique characteristics, PID is the most widely used controller in the plant. It is simple and performs more precise outcomes than others. But, some literature articles suggest that the tuning of PID is also a critical issue for improving the robustness and performance of the control system [36], [37], [38], [39]. Hence, there are still possibilities to enhance the robustness and performance of processes by the proper tuning of the PID. Recently, many researchers have worked on the tuning of the PID controllers using various nature-inspired algorithms [36], [37], [38], [39]. Some nature-inspired-techniques based PID controller designs for the RO desalination plants have been discussed in the next section to understand this research area more clearly. Literature suggests that these are more capable of achieving faster and smoother responses for the higher-order systems.
Park et al. [46] presented a PID control design using a genetic algorithm (GA) of the Doha RO desalination plant of Kuwait. It includes two input parameters: feed pressure (800-1000 psig) and pH (6-7), while permeate flux (0.85-1.25 gpm) and conductivity (400-500 µs/cm) are the output parameters. They have reported improved settling time (t s = 91224 s and t s = 452 s) of the proposed design compared to Ziegler-Nichols (ZN) proposed PID setting (t s = 1939269 s and t s = 454 s) for permeate flux and conductivity, respectively. Further, Kim et al. [47] proposed a PID control design using an immune GA (IGA) of the same Doha RO desalination plant of Kuwait. They have also reported a better settling time (t s = 147 s and t s = 25 s) of the proposed design than the ZN PID (t s = 529000 s and t s = 82 s) for permeate flux and conductivity, respectively. Recently, Guna et al. [48] presented PID control designs for a single-stage pilot-scale RO process using particle swarm optimization (PSO) and bacterial foraging optimization (BFO) algorithms. To examine controller designs, they used four objective functions: integral absolute error (IAE), integral squared error (ISE), integral time absolute error (ITAE), and integral time squared error (ITSE). Finally, they reported minimum settling times for PSO and BFO tuned PIDs (t s = 20.3 s and t s = 17.3 s, respectively).
These nature-inspired algorithm-based PID controllers are a part of optimization of controlling action. Thus, optimization is a systematic process that allows the plant engineer to design a precise controller for a stable and optimal solution. It aims to achieve the ''best'' design and maximize factors such as efficiency, reliability, productivity, strength, and utilization. With the motivation of the literature mentioned above, we have proposed a PID control design using a nature-inspired algorithm called autonomous groups PSO (AGPSO) to control the permeate flow rate (m 3 /h) and pH in the two-input two-output (TITO) RO desalination plant in this paper.
Why AGPSO algorithm to design PID controller: Mirjalili et al. [49] developed the modified PSO technique called the AGPSO algorithm. They employed 23 benchmark functions to analyze this algorithm. The results demonstrated that the AGPSO algorithm outperforms the conventional PSO in terms of escaping local minima and convergence speed. It has gained much interest in solving optimal control problems and providing a globally optimized solution. Therefore, we have utilized this algorithm in this research.

B. MAJOR OBJECTIVES, CONTRIBUTIONS, AND PAPER OUTLINES
Based on the above discussions, we have concluded that AGPSO algorithm has not been explored for PID control design in the literature. In addition, the proposed control design has also not been implemented for the RO desalination plants. Thus, with this apparent literature gap, we have utilized the AGPSO technique to design a PID controller for the first time for desalination systems. Hence, the major objectives and contributions are as follows: (1) This paper explores implementation of the PID control design assisted with modified PSO techniques called AGPSO and improved grey wolf optimization based PID (IGWO-PID) in the TITO RO desalination plant to control the permeate flow rate (m 3 /h) and pH. (2) The tuning of PID controller is done using three different versions (AGPSO1, AGPSO2, and AGPSO3) of the AGPSO algorithm for the same TITO plant. (3) The proposed controller design is compared and found to show better control performance than the IGWO-PID based design [39].
The outlines of this paper are as follows: The desalination plant's process, along with a relevant schematic diagram, is described in Section 2. It involves the technical input-output parameters of the plant. In Section 3, the AGPSO algorithm is described in detail. The proposed controller designs with an appropriate flow diagram and objective function are presented in Section 4. Section 5 provides the results and discussion. Finally, Section 6 presents the conclusion.

II. RO DESALINATION PLANT'S PROCESS DESCRIPTION
Sobana and Panda [38] have designed a transfer function model (shown in equation 1) for control of a RO desalination plant with a capacity of 3.80 MLD drinking water in the Village of Narippaiyur, District Ramanathapuram, Tamil Nadu, India. Here, two-input two-output (TITO) parameters were considered for PID controller design [39]. The input parameters considered were pump pressure ( P) and the ratio of flow rates of seawater feed to that of brine stream (R FB ), while the output parameters ware permeate flow rate F p (m 3 /h) and pH. The schematic diagram of the RO desalination plants is shown in Figure.1 [38].
The primary components involved in the RO desalination plant are an equalization tank, high-pressure pumps, RO, and freshwater tank. Initially, raw seawater is pretreated and stored in an equalization tank. Then, it is pumped to the RO tubular membrane chamber using the high-pressure pump and separated into freshwater and brine. In this plant, the RO membrane is made by Dow Filmtech with a diameter of 2.5 inches [38]. Finally, the freshwater collected into the freshwater tank is ready for portable water, while the concentrated brine is returned to the equalization tank for reuse.
The transfer function representation of the TITO RO Desalination plant is given as follows [38]: where, P indicates the feed pump pressure; R FB denotes the ratio of flow rates of seawater feed to that of brine stream; F p represents the permeate flow rate (m 3 /h); and pH indicates the permeate pH. The individual process transfer functions in the laplace domain are described as follows [38]:  [49]. Here, T = maximum number iterations and Small t = current iteration.

III. AGPSO ALGORITHM
Kennedy and Eberhart [50], [51], [52] invented a natureinspired algorithm called the PSO technique. It is inspired by the social behavior of birds flocking and is initialized by a group of random particles. Particles move around in a multidimensional space, adjusting their positions based on their own best positions, called individual best (pbest), and another best value achieved by a neighbor, called as global best (gbest). In this technique, every particle searches for its best position in space with its own knowledge and guides the best positions towards each other. Thus, the mathematical equations for the best velocity and position of every particle are represented as below [20], [50]: where, i is the particle index; v n i and v n+1 i are the velocity of i th particle at n th and n+1 th iteration, respectively; x n i and x n+1 i are the particle i position at n th and n+1 th iteration, respectively; n is the number of iterations; x n i,p is the individual best position associated with particle i (pbest); x n g is the global best value, obtained by the particle (gbest); c 1 and c 2 are the acceleration factors; r n 1 and r n 2 are the random values and ω is the weight of inertia.
Further, Mirjalili et al. [49] found some limitations in acceleration factors (c 1 and c 2 ) of the conventional PSO algorithm and developed a modified PSO algorithm called autonomous groups PSO (AGPSO). It fine-tunes the acceleration factors to identify the global minima of the problems relatively more quickly. With the fine-tuning of c 1 and c 2 through a unique strategy, the authors assigned four independent groups wherein and each group of particles attempts to find the best on its own. Based on these unique strategies, the authors developed three versions (AGPSO1, AGPSO2, and AGPSO3) of this algorithm with their updating formulas, illustrated in Table 1. All versions of the AGPSO have unique capabilities and perform different outcomes. Besides, the authors suggested that the AGPSO3 algorithm shares better performance than other versions of AGPSO (AGPSO1 and AGPSO2).

IV. PROPOSED CONTROLLER DESIGN
This section has been divided into three subsections for ease of understanding of the proposed controller design. The first subsection explains the structure of the PID controller design of the TITO RO desalination plant, and then the second subsection explains the objective functions in detail. Finally, the last subsection defines the complete step-by-step proposed controller (AGPSO-PID) design using a suitable flow diagram.

A. PID CONTROLLER DESIGN
As stated earlier in the introduction section, the PID controller is the most widely used one in industrial applications. It is simple and automatically optimized, regulates different parameters like pressure, temperature, and speed of the plant, and performs precise outcomes. It estimates error by computing the difference between the actual and desired values and adjusting the decision parameters accordingly [36], [37]. This error is calculated continuously until the process  is terminated. The mathematical formulation of the PID controller is as follows [36], [37]: where, u(t) is the PID control variable; e(t) is the error value {e(t) = r(t) − y(t)} or the difference between the desired value r(t) and the actual value y(t); K p , K i and K d are the proportional, integral, and derivative coefficients, respectively. The basic block diagram representation of the PID controller is shown in Figure. 2.
The main aim of this investigation is to design a PID controller for the TITO RO desalination plant. In the present case RO desalination plant, the proposed TITO system has two inputs (U 1 (s) = P and U 2 (s) = R FB ) and two outputs (Y 1 (s) = F p and Y 2 (s) = pH ). The TITO control system has been designed based on these input-output parameters and shown in Figure. 3. Here, PID controllers have been employed in the whole control design. As illustrated in Figure. 3, the system presents two loops: the first loop is for the permeate flow rate F p (m 3 /h), and the second loop is for the pH. The control transfer function G c (s) controls the process transfer function G p (s) of the system. Here, two control transfer functions G c1 (s) and G c2 (s) have been employed to control the four process transfer functions G p11 (s), G p12 (s), G p21 (s), and G p22 (s) represented in equations 9 and 10, also in Figure. 3.
The control transfer functions {G c (s)} and the process transfer functions {G p (s)} of the system are given below as follows:  where, G c1 (s) and G c2 (s) are the first and second control transfer functions of the TITO RO desalination plant;G p11 (s), G p12 (s), G p21 (s), and G p22 (s) are the four process transfer functions of the same TITO plant.

B. OBJECTIVE FUNCTION
The tuning of the PID controller of the TITO RO desalination plant is more complex because of the interaction effect. Literature suggests numerous nature-inspired tuning algorithms (GA [46], IGA [47], PSO, and BFO [48]) for the PID controller to tune easily. The tuning using these techniques depends on the selection of objective functions. This research utilizes the integral time absolute error (ITAE) objective function to tune the AGPSO based PID controller of the TITO RO desalination plant, as illustrated in Figure. 4. The mathematical formulation of this objective function is given below as follows: k p2 , min ≤ k p2 ≤ k p2 , max where, e(t) is the error; J is the objective function; ITAE is the integral time absolute error; k p1 , k i1 , k d1 are the gains of PID controller for permeate flow rate (m 3 /h); k p2 , k i2 , k d2 are the gains of PID controller for pH. The main reason for selecting this objective function for the PID controller design is that the order of integrator produces offset for a long time. It may provide a better controller with faster servo tracking and disturbance rejection without offset.

C. FLOW DIAGRAM OF AGPSO-PID CONTROLLER
In the initial two subsections, we designed the AGPSO based PID controller and defined the objective function. In this subsection, we have described the step-by-step AGPSO-PID approach by a suitable flow diagram (shown in Figure. 5) summarized as follows:

V. RESULTS AND DISCUSSION
The results and discussion section has been divided into five subsections to understand the fruitful findings of the AGPSO based PID controller for the TITO RO desalination system. The first subsection deliberates the optimal gains of the IGWO-PID (Existing) [39], AGPSO1-PID, AGPSO2-PID, and AGPSO3-PID control design based on the ITAE objective function. The second and third subsections discuss the servo and regulatory response analysis of the PID controller design, respectively. The fourth subsection described the servo and regulatory response with disturbance of the same system. Finally, the last subsection gives a comparative study between AGPSO based PID and existing IGWO based PID performance of the TITO RO desalination plant.

A. PID CONTROL DESIGN
In this study, the simulation results suggest to employ AGPSO based PID control design of the TITO RO desalination plant work for an accurate control. The proposed design explored the optimal gain by using the 10 number of particles and the 30 maximum iterations. The lower (lb) and upper bound (ub) ranges employed in this design as below (18) and (19), shown at the bottom of the next page. The optimal gains obtained for IGWO-PID (Existing) [39], AGPSO1-PID, AGPSO2-PID, and AGPSO3-PID control design based on ITAE objective function are shown in Table 2. As apparent from Table 3 Table 4. Finally, simulation findings suggested that the proposed AGPSO based PID controllers are the most suitable for the RO desalination plant.

C. SCENARIO II: REGULATORY RESPONSES ANALYSIS
For further analysis of the proposed PID control design, the integral absolute error (IAE), the integral squared error (ISE), and the integral time absolute error (ITAE) have been checked. Thus, the regulatory response analysis of the listed errors and their performances for the permeate flow rate (m 3 /h) and permeate pH of the RO desalination  [39], AGPSO1-PID, AGPSO2-PID, and AGPSO3-PID control design based on ITAE objective function.

TABLE 3.
Obtained minimum objective function value for IGWO-PID (Existing) [39], AGPSO1-PID, AGPSO2-PID, and AGPSO3-PID control design based on ITAE objective function. plant is illustrated in Table 5. We have recorded that the AGPSO3-PID controller design performs minimum errors for IAE, ISE, and ITAE than the existing IGWO-PID and other versions of the AGPSO-PIDs. In addition, we have also noted that the ITAE recorded a minimum of minimum errors for permeate flow rate (m 3 /h) (ITAE = 33.91) and pH (ITAE = 3.31) than IAE and ISE. However, the literature suggests that the performance errors may vary according to the plant's transfer function model and the design of the control system.

D. SERVO AND REGULATORY RESPONSES ANALYSIS WITH DISTURBANCES
For the deep analysis of the proposed AGPSO based PID control design, we have employed the disturbances and observed numerous outcomes, as shown in the graphical form in Figure.7 and the recorded form in Table 6. We have observed that the proposed controllers (ASPSO1-3 PIDs) perform better than the existing (IGWO-PID) control design when employing disturbances for both measurements, permeate flow rate (m 3 /h) and pH. We have also recorded much smaller    error (IAE, ISE, and ITAE) for all proposed controllers than previously modeled IGWO-PID controller, as shown in Table 6. In addition, we have noted that the AGPSO3-PID has performed better than the existing IGWO-PID and other versions of AGPSO-PIDs. Finally, we conclude that the disturbances have not affected the proposed PID control designs performance. Thus, the proposed PID control designs are the most suitable for the RO desalination plant performance.

E. COMPARATIVE STUDY BETWEEN AGPSO BASED PID AND PREVIOUSLY MODELED IGWO BASED PID
Finally, this section presents the comparative analysis between the proposed AGPSO based PID and the existing IGWO based PID control designs of the TITO RO desalination plant. We have observed that the proposed control design ensures a smoother but quicker servo and regulatory response. It has also been noted that the proposed design clearly performed better than the existing IGWO-PID VOLUME 10, 2022 design [39]. Some fruitful comparative findings are listed as follows: (1) The AGPSO3-PID achieved the minimum objective function value (J ITAE = 19.303) than the IGWO-PID (84.810) [39] and other versions of AGPSO PIDs (J ITAE = 20.305 for AGPSO1-PID and J ITAE = 21.105 for AGPSO2-PID) ( Table 3 ).  (Table 5 ). (4) The AGPSO-PID also achieved minimum errors for IAE, ISE, and ITAE than the existing IGWO-PID in the mostly cases with disturbances. (Table 6 ). (5) The proposed AGPSO1-3 PID performs better than the existing IGWO-PID control design for disturbances made in permeate flow rate (m 3 /h) and pH measurements.

VI. CONCLUSION
In this work, the modified particle swarm optimization (PSO) technique called autonomous groups PSO (AGPSO) was used to tune the proportional integral derivative (PID) controller of the two-input two-output  Professor and the Head. Prior to joining IITR, he has served extensively in industry (3M, Indo Gulf Fertilizers & Chemicals Ltd., and Classic Stripes Pvt. Ltd.) and academia (BITS Pilani and BIET Jhansi) totaling up his rich experience to more than 18 years. In industry, he is credited with creating and commercializing several innovative products and protecting IP through significant number of patents and record of inventions. He has more than 150 research publications in international peer-reviewed SCI journals, patent applications, conferences, and book chapters. He has significantly valued ∼74 publications in peer-reviewed chemical engineering, biomedical engineering, and polymer science and engineering journals of repute such as Renewable and Sustainable Energy Reviews, Energy, Microchimica Acta, Composites B: Engineering, Applied Surface Science, Polymer, Progress in Organic Coatings, and ACS Applied Materials and Interfaces, to name a few and holds seven granted patents/patent applications of industrial commercial relevance, has contributed to 22 books and 49 conference publications. He has executed/supervised five research projects and supervised one postdoctoral, seven Ph.D. students (more than three ongoing), 11 M.Tech. students, and 25 B.Tech. students project. In his department at IIT Roorkee, he has recorded amongst the highest average number of research journal publications/patent applications consistently in the last few years and maintained amongst the highest student appraisal score in teaching. His research interests include molecular modeling and simulations of polymers/materials, biosensing, chemical process modeling and simulation, development of novel and industrially significant sustainable polymer composites, coatings, sealants, quantum dots, and adhesives. Among several awards received by him to disseminate professional knowledge and research, he has been awarded with the prestigious APAC level TechForum Contribution Award at 3M, in 2012, and received the Best Innovative Product Design Award twice at 3M, in 2010 and 2011, the Secondment as a Visiting Faculty sanctioned by the President of India for teaching at the international platform at the Asian Institute of Technology, Thailand, and the VICAL Award for Best Technical Paper by Institute of Chemical Engineers (IIChe), India. He has been an invited speaker, guest, and sessions chair at several national and international conferences and workshops in India and abroad and serves as the Board of Directors of STEM Research Society, India.