TEMPLATE FOR ACADEMICA SCIENCE JOURNAL AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 147 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. DESIGN OF INTELLIGENT PID CONTROLLER BASED ON MODIFIED SWARM TECHNIQUES Ahmed Kareem Abdullah, Al-Furat Al-Awsat Technical University, AL-Mussaib Technical College, Babel, Iraq Email: Ahmed_albakri1977@yahoo.com Received on 27 October 2016 Accepted on 31 January 2017 . Abstract: The swarm techniques are used widly to enhance the response of the control system, but there are many drawbacks appear when these techniques are used to select the initial solution for the problem and then will referect on the overall convergence. This paper try to solve this problem by modify the initial solution of particale swarm techniques based on fast genetic algorithm, the modified PSO make good free searching in candidate solutions to get optimum suggesions, which leads the algorithm towards the global optimum searching over wid range. The proposed controller named PSO-FGA-PID controller and two experiments are tested by this controller to check the proposed work, first one the linear time invariant system is taken and the second one is to control on the speed of the DC motor. Keywords: Particle Swarm optimization, Genetic algorithm, linear time invariant system, Intelligent controller 1. INTRODUCTION The artificial intelligence (AI) algorithms consist of evolutionary computation (EC) and swarm intelligence (SI) [1]. The EC technique based on the biological evolution principles while the SI technique based on the swarm behavioral patterns. , the artificial intelligence techniques used to solve many complex control problems. Many researchers deals with the hybridization of intelligent technique with PID controller to enhance the overall responses, W. Meng 2015, used adaptive neural control to investigate and enhance the MIMO nonlinear with time-varying system, the weight of single neural network is online tuned estimated the unidentified functions in the dynamics of the system also the singularity of the coefficient is escaped without prior knowledge [2]. J. Murphy and S. Godsill 2015, demonstrate an efficient method for conditionally and estimation the matrix of the time-varying system parameters based on the inference of time-varying parameter vector auto regression system [3]. Many methods used to tune PID parameters and set gains, such as Ziegler-Nichols, Cohen-Coon, and Chien-Hrones-Reswick [4]. This paper focuses on the PSO and SGA as important artificial intelligent techniques used to enhance the response of linear time invariant system LTI and DC motor speed control by tuning the PID gains. 2. ARTIFICIAL INTELLIGENT TECHNIQUES Evolutionary computational techniques (EC) based on the biological philosophies and swarm intelligent (SI) techniques based on swarm social [1]. mailto:Ahmed_albakri1977@yahoo.com AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 148 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. 2.1. EVOLUTIONARY COMPUTATION (EC) EC algorithms are inspired by biological concepts such as population, crossover, and mutation. EC are stochastic examine techniques that modeled the system in standard selection and growth in the biological system [5]. The EC techniques categorized into several algorithms Genetic Programming (GP), Evolutionary Programming (EP), Evolutionary Strategies (ES), and Genetic Algorithm (GA) as mentioned in [6, 7]. 2.2. SWARM INTELLIGENT (SI) SI algorithms established on the analysis of the routine of a collection in regionalized the swarm system. SI is naturally organized the local of the tested group with the main location. Ant colony optimization (ACO) and Particle Swarm Optimization [5] represent important techniques in this field [8]. 3. COMPARISON BETWEEN GA AND PSO In recent years and from earlier analysis of the intelligent techniques confirmed that the PSO is better than GA when used to analysis the system. Some significant landscapes for PSO compared with GA are registered below [5]: - The PSO is faster than GA. - The PSO is robust and its performance better than GA. - The routine of PSO is unfeeling to the size of the population. - The obtained solutions by PSO are more stable. - The calculations in PSO is less than the calculations in GA. Even though GA has been usually used to resolve the optimization problems in many field, but GA steps needs more calculations to access the goal. As well as the decrease of the convergence of GA reduces the performance of the system and decreases the abilities of the system to search the optimum solution. PSO algorithm give the best solution in a little calculation also the obtained results are more stable compared with any stochastic techniques. 4. PROPOSED CONTROLLER (PSO-FGA-PID) In this section, the controller is described in details: The PID is used to improve the response by adjust the error between actual output and required input. The control action signal which is created by weighted sum of the PID actions as shown in Figure 1 [4]. P  Input Figure 1. The system with a PID Error e(t) I Plant Output D  _ AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 149 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. The output or control action signal of PID is ruled by: (1) Fast genetic algorithm (FGA) is a stochastic founded on biological development field [9]. In each loop a fresh solution or children is formed which will perfectly have better fitness than the former solutions. Fitness refers to how well a solution acts in the problem domain [10]. FGA is a vectored execution of GA in Matlab without bells. GA parameters are [11]: Max. No. of Gen. = 40; Population Size = 30; The length of chromosome =3; The crossover probability = 0.95; The mutation probability of = 0.05; Type of selection is roulette wheel selection; Type of crossover is Single point; Type of mutation is real, The fitness is ruled by : (2) Integral of square error (ISE) is used as optimization condition in this algorithm. The epsilon ( Ɛ ) is very small constant (0.0001) added to ISE in the denominator of the fitness function to avoid the infinity value. The chromosome representation of the proposed algorithm is shown in Figure 2. The control parameters set K= (Kp, Ki, and Kd) are observed as a position p = (p1, p2, and p3) of a particle in a 3-dimensional field [6]. If the number of particles is L in a generation, the technique of the suggested PSO-FGA-PID controller can be designated by: - Set the PSO parameters: particles’ number (L), Iterations’ number (n=50), range of search, the constraint of velocity, and the constants c1 = c2 = 2. - Set the generation (g =1) for the initial generation and produce the particles from fast genetic algorithm as above - Compute the fitness for the particles in the generation and govern the position of the particle with the greatest fitness. - Calculate the (q) of the particle with the maximum fitness. - If generation index g > N, then go to the end. And then, go to next step. - Tuning the velocity values for the particles and form the velocity. - Tuning the position values for the particles and bound the new position values for particles - Regulate the controller based on the gotten parameter set (pbest) with the best fitness (fbest). - The velocity and position are calculated: The flowchart of the PSO-FGA-PID is illustrated in Figure 3. Kp Ki Figure 2. Chromosome representations in PSO-FGA-PID controller Kd AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 150 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. Start End The best solution (Kp, Ki, Kd ) from GA represent the initial searching field for PSO. The gains K= (Kp, Ki, and Kd) are represented by the positions p = (p1, p2, and p3) of the element in a 3D field And then calculate the initial velocities, positions, pbests, and gbest. Compute the Fitness function Choice the pbest and gbest Recalculate the velocities and positions Best PID gains Checking Figure 3. Flowchart of the proposed controller PSO-FGA-PID Yes No No Stopping criterion (No. of Generati on) Calculate the Fitness Function for Each Chromosome by Eq.2 Selection, Crossover, and Mutation Get best solution for PID parameters (Kp, Ki, Kd ) and obtain the system responses Yes Call PID Controller Call PID Controller Increase Gen. Initialize GA parameter Pc, Pm, Pop, Maximum No. of generation, and generate initial population AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 151 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. 5. RESULTS 5.1. BENCHMARK 1: LINEAR TIME INVARIANT SYSTEM (LTI) To verify the efficiency of the proposed controller, the following time invariant system is taken [12]. Figure 4 shows the block diagram of the system with PID. The simulated system in MATLAB is represented in Figure 5. Figure 5. Plant Model representation from Matlab-Simulink Figure 4. Block diagram of feedback control system with a PID controller simulated by Matlab- Simulink AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 152 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. The responses of the LTI system with different controllers are shown in Figure 6. The system has been subjected to a internal sudden large disturbance as shown in Figure 7 at the terminal to test the proposed controllers. The scope signals are shown in Figure 8. In order to emphasize the advantages of the proposed controllers, the system with conventional PID and without any controller are implemented for comparison. Table 1 illustrates the Performance Index (ISE) and PID parameters for the linear time invariant system without Controller, with conventional PID, FGA-PID controller, and PSO-FGA-PID controller. Figure 6 . The responses of LTI system (a) without controller (b) with PID controller (c) with FGA-PID (d) with PSO-FGA-PID (a) (b) (c) (d) Time Time Time Time O u tp u t re s p o n s e O u tp u t re s p o n s e O u tp u t re s p o n s e O u tp u t re s p o n s e AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 153 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. Figure 7. Simulation of system subjected to a disturbance 5.2. BENCHMARK 2: DC MOTOR SPEED CONTROL [13] The motor is categorized into: DC & AC motor, these groups have different types and each one givs unique soultions for particular requests. The design requirements are: overshoot ≤ %5 , settling time ≤ 2 seconds, and Steady state error ≤ 1%. The general schematic diagram for the DC motor is represented by the Figure 9 [13] (a) (b) (c) (d) Figure 8. The responses of LTI system with sudan change (a) without controller (b) with PID controller (c) with FGA-PID (d) with PSO-FGA-PID Time Time Time Time O u tp u t re s p o n s e O u tp u t re s p o n s e O u tp u t re s p o n s e O u tp u t re s p o n s e AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 154 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. Table 1. Performance Index, PID Parameters, and Time Response Parameters The Motor parameters are: moment of inertia (Jm)=0.01kg × m2/s2 ; R =1Ω; L=0.5H; Constant of Electromotive Force Kt=0.01Nm/Amp; Constant of Motor Viscous Friction (Beq)=0.1Nms; 1000 rpm DC motor. These parameters may be changed based on the torque & rpm. The transfer function of the motor is determined based on the Figure 10. Type of Controller ISE Time response parameters tr tp O.S tss Without controller 48.316 0.033 0.051 2.901 0.21 PID 5.3161 0.032 0.055 1.203 0.13 FGA-PID 1.2011 0.039 0.071 0.19 0.06 PSO-FGA-PID 1.0936 0.038 0.082 0.09 0.05 Figure 9. The Schematic of the DC Motor Figure 10. Feedback DC motor control system simulated in Matlab simulank AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 155 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. The DC motor transfer function is: (9) The responses of the DC motor with different controllers are shown in Figure 11. Table 2 illustrates the ISE and PID parameters for the DC motor speed control system for different controllers. 6. CONCLUSIONS The duty of the swarm technique is to enhance the output response of the systems by tuning the PID gains until reach to the specific conditions. The paper is focused on the PSO as intelligent computational technique for tuning PID parameters and compared with another intelligent technique FGA. The objective has been to enhance the performance of the response of LTI system and DC motor speed control, that experience very poor control behavior with conventional tuning methods. The proposed controller is proposed based on hybridiz of two intelligent techniques with conventional PID. Intelligent-PID controllers are solved many difficulties, but they are little complicated in a computation. The fitness function based on ISE is very efficient criteria. The tuning of PID parameters have a significant effect on the system response, therefore the best choose is generated and tuned randomly by the proposed algorithm. Finally, the results obtained by the proposed controllers are encouraged. Figure 11 . The responses of DC motor system (a) without controller (b) with PID controller (c) with FGA-PID (d) with PSO-FGA-PID (a) (b) (d) (c) O u tp u t re s p o n s e O u tp u t re s p o n s e Time Time Time Time AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 156 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. Table 2. Performance index, PID parameters, and Time response parameters 7. ACKNOWLEDGMENT Thanks to Al-Furat Al-Awsat Technical University to support this research and I would like to express my thanks to Amin Noshadi/ College of Engineering and Science, Victoria University, Australia to support and help me by codes. REFERENCES 1. Engelbrecht. A.P., Computational Intelligence: John Wiley and Sons, 2002 2. Meng W., Qinmin Yang M., and Sun Y., "Adaptive Neural Control of Nonlinear MIMO Systems With Time-Varying Output Constraints," IEEE transactions on neural networks and learning systems, vol. 26, 2015. 3. Murphy J. and Godsill S., "Efficient Filtering And Sampling For A Class Of Time-Varying Linear Systems," presented at the 2015 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), , South Brisbane, QLD, 2015. 4. Yi T. Q., Kasilingam G., and Raguraman R., "Effect of PID Power System Stabilizer for a Synchronous Machine in Simulink Environment,"presentedat the 4th International Conferenceon Energyand Environment 2013(ICEE2013), 2014. 5. Pillay N., "A Particle Swarm Optimization Approach for Tuning of SISO PID Control Loops " Master, Department of Electronic Engineering., Durban University of Technology., 2008. 6. Rahimian M. S. and Raahemifar K., "Optimal PID Controller Design For Avr System Using Particle Swarm Optimization Algorithm," presented at the Electrical and Computer Engineering (CCECE), 2011 24th Canadian Conference on, Niagara Falls, ON, 2011. 7. Al-Awami A. T., Abdel-Magid Y. L., and Abido M. A., "A particleswarm-based approach of power system stability enhancement with unified power flow controller," Electric Power and Energy Systems, vol. 29, pp. 251-259, 2007. 8. Dorigo M. and G. L.M., "Ant Colony System: A Cooperative Learning Approach to the Traveling Salesman Problem," IEEE Transactions on Evolutionary Computation, pp. 53-66, 1997 9. Mohammed N. F., X. MA, and Song E., "Tuning Of PID Controller For Diesel Engines Using Genetic Algorithm," in 2013 IEEE International Conference on Mechatronics and Automation (ICMA), Japan 2013, pp. 1523-1527. Type of Controller ISE Time response parameters tr tp O .S tss Without controller 4.234 0.41 0.45 0.12 1.2 PID 2.178 0.53 0.55 / 1.3 FGA-PID 1.927 0.67 0.21 0.12 1.2 PSO-FGA-PID 1.298 0.69 0.19 0.09 1.1 AL-QADISIYAH JOURNAL FOR ENGINEERING SCIENCES Vol. 10 , No. 2 ISSN: 1998-4456 Page 157 Copyright  2017 Al-Qadisiyah Journal For Enginnering Science. All rights reserved. 10. kumar B. R., Murali M., Kumari M. S., and Sydulu M., "Short-range Fixed head Hydrothermal Scheduling using Fast Genetic Algorithm," presented at the Industrial Electronics and Applications (ICIEA), 2012 7th IEEE Conference on, Singapore, 2012. 11. Mitchell M., An Introduction to Genetic Algorithms: MIT Press, 1996. 12. Noshadi A., Shi J., Lee W. S., Shi P., and Kalam A., "Optimal PID-type fuzzy logic controller for a multi-input multi-output active magnetic bearing system," Natural Computing Applications, Springer 2015. 13. Temel S., Yağli s., and Gören s., "Discrete time control systems, P, PD, PI, PID controllers," middle east technical university; electrical and electronics; engineering department2010.