Tunning PID controller using particle swarm optimization algorithm on automatic voltage regulator system

PID Controller (Proportional Integral Derivative) was invented since 1910, but till today still is used in industries, even though there are many kind of modern controllers like fuzz controller and neural network controller are being developed. Performance of PID controller is depend on on Proportional Gain (Kp), Integral Gain (Ki) and Derivative Gain (Kd). These gains can be got by using method Ziegler-Nichols (ZN), gain-phase margin, Root Locus, Minimum Variance dan Gain Scheduling however these methods are not optimal to control systems that nonlinear and have high-orde, in addition, some methods relative hard. To solve those obstacles, particle swarm optimization (PSO) algorithm is proposed to get optimal Kp, Ki and Kd. PSO is proposed because PSO has convergent result and not require many iterations. On this research, PID controller is applied on AVR (Automatic Voltage Regulator). Based on result of analyzing transient, stability Root Locus and frequency response, performance of PID controller is better than Ziegler-Nichols.


Introduction
PID controller is one of the controllers of the most widely used in industries. Although there are controllers modern, recently being developed for example, fuzzy controller, but controller PID is still used till today [1]. The performance of PID controller is depend on Gain Proportional (Kp), Gain Integral (Ki) and Gain Derivative (Kd), the selection of those values are not appropriate can make the system become unstable [2] [3]. There are several methods to find the value of the gains such as Ziegler-Nichols (ZN), gain-phase margin, Root Locus, Minimum Variance and Gain Scheduling. However, these methods were considered less than optimal for a system that non-linear and has high orde [4][5] [3], besides several of these methods in calculation relative hard. To solve these obstacles the algorithm Particle Swarm Optimization (PSO) is proposed which is assigned to find the value of Kp, Ki and Kd are optimized, where controller PID is applied on automatic voltage regulator (AVR). PSO is proposed because it has the results of convergance and do not require a number of iterations, so in relative calculation relative quick. AVR role in the electric power system is to withstand the magnitude of the terminal voltage synchronous generator at a certain rate. An AVR system consists of four main components, namely amplifiers, exciter, generators and sensors. The transfer function of the four components as shown tabel 1 [6].

PID Controller
PID controller is an automatic controller that compares the actual value of the output of a system at the desired price and generates a control signal to minimize the error value [7]. As the name implies PID controller consists of three basic types, namely controller proportional, integral and derivative that can be used separately or together depending on what we need. Each controller has karakteristrik respectively. Characteristics of a proportional controller is determined by Kp (Constant Proportional) [8]. Kp value is too small to generate a response rise time is slow, increase the value of Kp will increase the response faster, but when the value of Kp is too large will create an oscillating output. Characteristics of the integral controller can improve response while eliminating the steady-state error, but the selection of Ki (Integral Constants) which may cause high transient response, which can cause system instability. Selection of very high Ki can also cause the output to oscillate. Characteristics of derivative controllers can not work alone because it is improve the transient response with an error predicting what will happen. Selection of the value of Kd (constant Derivative) is appropriate can improve system stability and reduce overshoot [3].
The output of the PID controller is given as follows: [9] Where u is the control signal, and e is the error value. Then the transfer function: (3)

Performace Estimation of PID Controller
In some literature many techniques have been proposed to evaluate the performance of PID controllers. Evaluation of the performance of the following criteria: Integrated Absolute Error (IAE), Integral Time Absolute Error (ITAE) and Integral of Timing-Weghted-Squared-Error (ITSE). Third performasi index has advantages and disadvantages of each. For example, weakness IAE is able to generate a response with overshoot ralatif small, but long setling time , although the ITSE can overcome the shortcomings of the criteria IAE, persamaanya calculation process is complex and takes a relatively longer time. ITAE equation, IAE and itse shown in the equation below [10] : Where Vt is the terminal voltage, a reference voltage Vr and t is the time span from smiulasi [3].

Paricle Swarm Optimization (PSO)
PSO algorithm was first introduced by Eberhart and Kennedy in 1995 [11]. The origin of the PSO terinipirasi of the behavior of a flock of birds or a school of fish while searching for prey [12]. Demonstrating how the Particle Swarm Optimization, to take the example of a number of patikel (in PSO, individuals are often referred to patikel), N moving together in a search space S. Each particles of i is kanidat settlement and expressed by the vector xi. Each particle has a position and velocity and will move based on experience and information from the social environment and the current position and the particle. Experience particle i expressed as pi best position ever achieved by these particles. Information from the environment is represented by particles that have the best position g, in the collection of the particles, whereas, the current position of particle i is expressed by xi (t-1). Change the speed of the particle and particle position (vi, xi) was determined based on two equations below as follows [13].
Selection of the proper w inertia weight provides a balance between global exploration and local exploration, so do not require many iterations in searching optimal solution. W always decline linearly approximately ranging from 0.9 to 04 for the calculation. general inertia weight w is set berdasarakn persasaam below [4].
Frist step in PSO is initialization is to determine the number of iterations, the number of population (n) inertia weight (w) and cognetif learning and social learning (c1 and c2), The next step aroused the population in the form of a random matrix with a range of values [0,1] that the dimension (dimensi_masalah.xn). Generation population by typing sinkaks matlab rand (dimensi_masalah, n). . After that, the initialization speed and position. In this step makes the value of the velocity and position of a particle to be equal to zero, Than Calculate the error (Vref-Vout), The amount used in this case is a power unit (pu) are worth one. Description 1 pu equals yout reference and a generator terminal voltage value, then error = | 1-yout |. The next step is to calculate the value of fitness or function to be optimized. In this paper ITAE (Integrated Time of Weighted Absolute Error) proposed, and continue with update velocity and update position. This process contoinue till iteration maximum. After finshing calculate till iterasi maximum, finally chek whether the result of calculating already convergence ? if it already convergance excecute if no try again and or change the intialtization (back to frist stap). To understand easyly, Flowchart PSO is givent at figure 2.

Result and Discussion
In the flowchart PSO is explained that first step is initialization. Proper initialization can produce maximum results. Initialize the form of information and the price used in penilitian this time presented in Table 2.

Table 2. Initialization Parameter PSO
After calculating as many as fifty iterations (50) result of value Kp, Ki and Kd. Kp = 1,068; Ki = 0:04 Kd = 0.4011. These value is chosen not only already reach the calculations as much as fifty times (50 iterations), but also the tendency of convergance. Figure 3 shows after the 25th iteration of the convergent tendencies and maintain maximum results until the 50th iteration.

The Result Of Transient Analysis
Transient analysis is done by providing a signal on the system. The best system is a system that has the input and output signals are identical. The results of transient analysis using the algorithm PSO has a value of overshoot is smaller 15.9% of the system with the ZN-PID and less 65% of the system without PID controller, for systems with PSO-PID value of peak-time 20.3% faster than the system without the PID and 73.8% faster compared to ZN-PID system. Values rise time for PSO-PID system with 37.01% and 7.61% faster than a system with ZN-PID and without PID system. Value settling time for the system to PSO PID faster 398.9% (almost 4x faster) than the system without the PID and 239.1% (2x faster) than a system with ZN-PID and final value error steady state for the system with the PSO-PID is 0 %.

The Result of Root Locus
Results of the stability of the Root Locus analysis showed that for the three conditions are conditions without the PID system, the system with the ZN-PID and the PSO-PID system are stable because they have a pole and a zero to the left of the field s. However, a system with PSO-PID has the location of the lie away from axis s and do not have the critical point that indicates the system is very stable, plus a system with PSO-PID had a price damping ratio ζ is greater 45.8% compared with the ZN-PID and 85.1% greater than the system without PID.

Frequency Response
Systems that have the widthest bandwidth and has the greatest resonance frequency values indicated have the best performance because these values show a rapid system response. The stability of the system can be seen from the gain margin and phase margin. The system is said to be stable if the price gain margin is lower than 0 dB and phase margin is above -180 0 . Bode diagram of the PSO-PID system, ZN-PID and systems without the PID controller is shown in Figure 7 and Table 6 shows the results of a frequency response analysis that PSO-PID has the widthest bandwidth and the greatest resonance frequency thay indicate, PSO-PID has the best performance.  Figure 6. Bode Diagram

Conclusion
The main purpose of the application of PSO algorithm in PID controller is to determine the price of Kp, Ki and Kd are optimal, so it can improve the performance of PID controllers. Results of the application of PSO algorithm will compare the results with the method ZN (Ziegler-Nichols) and without PID system. Results of the transient analysis shows that the PSO-PID overshoot and settling time have the lowest compared to ZN-PID and PID Without a system. Based on Root Locus damping ratio owned PSO-PID has the largest value even close to one and is based on the frequency response using Bode plots PSO-PID has a bandwidth of the widest and the price of the resonant frequency of the greatest, so that both the transient analysis, Root locus and frequency response of the system by PSO-PID has the best performance among ZN-PID and without PID system.