Optimized Controller Gains Using Grey Wolf Algorithm for Grid Tied Solar Power Generation with Improved Dynamics and Power Quality

: This study proposes a control algorithm based on synchronous reference frame theory with unit templates instead of a phase locked loop for grid-connected photovoltaic (PV) solar system, comprising solar PV panels, DC-DC converter, controller for maximum power point tracking, resistance capacitance ripple filter, insulated-gate bipolar transistor based controller, interfacing inductor, linear and nonlinear loads. The dynamic performance of the grid connected solar system depends on the effect operation of the control algorithm, comprising two proportional-integral controllers. These controllers estimate the reference solar-grid currents, which in turn generate pulses for the three-leg voltage source converter. The grey wolf optimization algorithm is used to optimize the controller gains of the proportional-integral controllers, resulting in excellent performance compared to that of existing optimization algorithms. The compensation for neutral current is provided by a star-delta transformer (non-isolated), and the proposed solar PV grid system provides zero voltage regulation and eliminates harmonics, in addition to load balancing. Maximum power extraction from the solar panel is achieved using the incremental conductance algorithm for the DC-DC converter supplying solar power to the DC bus capacitor, which in turn supplies this power to the grid with improved dynamics and quality. The solar system along with the control algorithm and controller is modeled using Simulink in Matlab 2019.

applications of solar power generation technology and the design and implementation of solar technologies that are typically not considered, such as solar water pumping, distillation, detoxification, refrigeration, and rural electrification [1] . Murphy et al. [2] evaluated the feasibility of using alternative water resources to meet water demands for utility-scale solar energy development, focusing on solar energy and competitive renewable energy zones. This enables generation of power from renewable sources such as wind and solar. Solar power is a clean, limitless, and environmentally friendly energy source. However, despite its continuous supply, its interconnection to grid-solar systems faces several challenges such as reliability, power quality, performance, and energy conversion cost [3][4][5] . Any interconnected grid should meet such power quality standards to be compliant with IEC and IEEE 519 standards [6][7] . Bhattacharya et al. [8] proposed the synchronous reference frame (SRF) theory for a hybrid series active filter system. Singh et al. [9] proposed the power balance theory algorithm for active filters and experimentally investigated the design and development of an active filter. Bhuvaneswari et al. [10] proposed a novel Icosφ algorithm applied to a three-phase shunt active filter to provide harmonics and reactive power compensation for a nonlinear reactive load. Bojoi et al. [11] proposed a single-phase inverter for distributed generation (DG) systems requiring power quality features, such as harmonic and reactive power compensation for grid-connected operation. The aim was to integrate the DG unit functions with shunt active power filter capabilities. Bangarraju et al. [12] proposed new and simplified unit templates instead of a standard phase locked loop (PLL) for an SRF control algorithm. The extraction of synchronizing components (sinθ and cosθ) for parks and inverse parks transformation using standard PLL requires longer execution time. Bratcu et al. [13] investigated global power optimization for cascaded dc-dc converter architectures of photovoltaic (PV) generators irrespective of the irradiance conditions. The global optimum of such connections of PV modules is typically equivalent to performing the maximum power point tracking (MPPT) on all the modules. Ghasemi et al. [14] proposed a method to obtain the global maximum power point in a deterministic and fast manner. It intelligently takes some samples from the P-V curve of the array as input and divides the search voltage range into small subregions. Subsequently, it approximates the I-V curve of each subregion with a simple curve and estimates an upper limit for the array power in that subregion accordingly. Hua et al. [15] presented an improved solar system with MPPT, in which a digital signal processor is used to control the converter with the proposed control; thus, the system can implement MPPT independently for each solar panel, regardless of whether it is under shading or irradiation conditions, or contains faulty solar cells. Mirjalili et al. [16] proposed a novel meta-heuristic called the grey wolf optimizer (GWO) inspired by grey wolves. The GWO algorithm mimics the leadership hierarchy and hunting mechanism of grey wolves in nature and four types of grey wolves such as alpha, beta, delta, and omega are employed to simulate the leadership hierarchy. Li et al. [17] presented a comprehensive introduction to the GWO algorithm. They performed numerical experiments on four benchmark functions and applied them to the synthesis of linear arrays to reduce the peak sidelobe level under various constraints. Finally, the performance of the GWO was further verified on the optimization design of two representative antennas, namely, dual-band E-shaped patch and wideband magneto-electric dipole antennas. Rashidi et al. [18] optimized the structure using the multi-objective GWO to maximize the effective mode area and bending loss of higher-order modes, while minimizing the fundamental mode loss. The various control algorithms that use Ziegler and Nichols tuning method to estimate K p and K i gains for proportional-integral (PI) controllers and require settling time for dynamics have limitations. Grey wolf optimization provides better K p and K i values over conventional evolution algorithms. The unit template-based SRF algorithm is modified in combination with the grey wolf optimization technique (GWOT), allowing the flow of active power to the grid with increased power efficiency. Elgendy et al. [19] proposed an efficient and cost-effective incremental conductance MPPT algorithm to improve the energy utilization efficiency of low-power PV systems. Contribution and organization of this paper: The rapid depletion of fossil fuels and increasing demand for electrical energy have led to the use of solar energy for power generation. The integration of solar power, which is environmentally friendly, into the grid with improved power quality and dynamics is the contribution of this study. The control algorithm is a key component of the grid-connected solar system and is used to estimate the reference source currents. The estimation of reference source currents depends on the gains of AC and DC PI controllers when optimized for better dynamics and improved power quality.
The grey wolf optimization algorithm is used to determine the gains of PI controllers; the cost function is added before the PI controller. The errors of the DC and AC PI controllers are (i) summed (integral), (ii) squared, and (iii) time-weighted, referred to as integral of time-weighted squared error (ITSE), to optimize the gains of DC and AC PI controllers. Fig. 1 shows the grid-solar system to improve system dynamics and power quality. The system consists of series-parallel-connected solar PV panels, DC-DC converters (between the controller and the solar panels), three AC interfacing inductors, and controllers (operating with unit template-based SRF control algorithm). Solar PV system output operated at maximum power point uses an algorithm based on incremental conductance, which generates a duty cycle for the DC-DC converter to supply solar power to the DC bus that is maintained at 800 V. A star-delta-connected non-isolated transformer compensates for the neutral current by connecting the transformer neutral and load. Controllers are used in solar grid-connected systems to offer the same functional capabilities as shunt active compensators along with solar power pumping into the grid. The main objectives are to achieve load balancing, harmonics reduction, load neutral current suppression, and reactive power supply. The quick response depends on the gains of AC and DC PI controllers and they are optimized using the grey wolf optimization algorithm. The system data are listed in Tabs. 1-3.  Figs. 2a-2b show I-V and P-V curves of solar modules, with 13 series panels for acquiring solar PV voltage (V sol ) and 66 parallel strings for acquiring solar PV current (I sol ), to obtain solar PV power (P sol ) at different temperatures and irradiation levels. Fig. 2c show the variation of temperature and irradiance with time.

System configuration and operation
Solar PV power regulation has three distinct algorithms. First, the unit templates-based SRF control algorithm extracts reference currents intended for the controller. Second, the peak power of the PV solar system can be obtained by applying the incremental conductance algorithm to generate a duty cycle for the DC-DC converter. Finally, optimized controller proportional-integral gains can be obtained using the grey wolf optimization algorithm.
where sinθ and cosθ are extracted from voltage sources (v sa , v sb , v sc ) in the system, which reduces the computational burden on the controller compared to three-phase PLLs. w pa , w pb , and w pc are in-phase unit templates analogous to sinθ. The w qa quadrature-phase unit templates are analogous to cosθ.
where v tg is the magnitude of the terminal voltage for the solar PV system and is expressed as The DC bus voltage for the self-supported compensator is controlled using a DC bus PI controller.
The difference between the reference magnitude of the terminal voltage (V tr ) and the actual magnitude of the terminal voltage (V tg ) of the AC PI controller and its error voltage (v etg ) at the k th sample is expressed as The PI control gains of the AC PI controllers are K p2 and K i2 . This current loss part (i qls ) is added to q-part of the load current (i qL ) to obtain the source component current ( * qL i ) of the q-axis.
The reference grid currents of the solar PV grid (

Incremental conductance algorithm
The incremental conductance algorithm evaluates the variance path of the instantaneous power of solar modules for incremental conductance by calculating and comparing it with its previous value. If the value (dI pv /dV pv ) equals (−I pv /V pv ), it implies that the maximum power point (MPP) is reached [17][18] . The P-V curve for the solar module is shown in Fig. 4.
Using the above equation dP/dV=0 can be written as dI/dV=(−I/V). Where dV and dI represent the error voltage and current after and before the incremental change, respectively. The flowchart of the MPPT incremental conductance algorithm is shown in Fig. 5.

Grey wolf optimization technique
The GWOT mimics the hunting and hierarchical mechanism of grey wolves (Canis lupus) available in nature. The best solution obtained is considered alpha (α), the second-best solution as beta (β) and delta (δ), and the third-best solution as omega (ω).
The mathematical model behavior of GWOT is proposed as follows where A and C are vector coefficients and k is the current iteration. X p and X are the prey and grey wolf vector positions, respectively. Vectors A and C are determined as The random vectors r 1− r 2 are selected in [0 1], whereas "a" is decreased linearly from 2→0 for various iterations.
Grey wolves typically detect and encircle the prey. Alpha generally leads the chase. Beta-delta sometimes engage in hunting. However, the maximum (prey) position in abstract search space is unknown. To model the activity of grey wolves hunting mathematically, we believe that the alpha-beta (solution for the best candidate) and delta offer better prediction of possible prey positions. Therefore, the first three best possible solutions are saved and the other search agents (together with omegas) are forced to change their positions with the best search agents. 1 2 The errors of DC and AC PI controllers are (i) summed (integral), (ii) squared, and (iii) time-weighted, referred to as ITSE, and the objective function is expressed as The objective function is defined as a minimization problem to minimize the steady-state errors of PI 1 and PI 2 , as follows where w 1 and w 2 are the weights of ITSE 1 and ITSE 2 , ITSE 1 and ITSE 2 are the errors between the reference and actual values and serve as inputs to the terminal and DC PI controllers.
The optimized values of DC PI controller gains (k p1 , k i1 ) are 0.38 and 0.026, as shown in Fig 6b; the optimized values of the terminal voltage PI controller gains (k p2 , k i2 ) are 1.32 and 0.67, respectively. In addition, the best solution obtained for the convergence curve of the GWO cost function is 58.1 in nine iterations and is shown in Fig. 6a. Fig. 6 Convergence curve, and DC and AC PI controller gains using the GWOT

Results and discussion
The performance of grey wolf-optimized PI gains for UT-based SRF control algorithm for a grid-solar PV system is demonstrated with RL (linear) and power electronic (nonlinear) loads are shown in Fig. 7. The gains of DC and AC bus PI controllers that are acquired from the GWO algorithm are used in this system. Fig. 7 shows source grid voltages (V sabc ), grid source currents (I sabc ), linear load currents (I Labc ), controller currents (I cabc ), terminal PCC voltage (V t ), DC bus voltage (V dc ), solar PV system voltage (V pv ), solar PV system current (I pv ), load neutral current (I Ln ), and source neural current (I sn ). At t=3.8 s, one phase is disconnected and at t=3.9 s the same load is reapplied. However, it was observed that the solar PV source grid currents (I sabc ) are free from harmonics and highly balanced owing to the controller operation with improved dynamics. In addition, grid currents and voltages are typically out of phase, which represents voltage regulation. Moreover, it is compensated by the controller. From t=3.75 s to 3.95 s, the voltage of the DC bus (v dc ) of the solar PV system is maintained at 800 V by the DC PI controller and the grid terminal voltage (v tg ) is maintained at 339.6 V by the ac PI controller. During the aforementioned prescribed time, the load neutral current (i Ln ) was present during the unbalance load and it was mitigated by the star/delta transformer which is zero in source neutral current (I sn ). The solar PV voltage (V pv ) is maintained at 800 V and the solar PV current (I pv ) is approximately 3.5 A, illustrating the flow of solar power into the grid with improved dynamics and power quality.

Performance of grid-tied PV solar system with nonlinear loads
The performance of grey wolf-optimized gains for the UT-based SRF control algorithm for solar PV systems with the application of nonlinear loads is demonstrated in Fig. 8. The solar PV system source grid voltages (V sabc ), source grid currents (I sabc ), nonlinear load currents (I Labc ), compensator currents (I cabc ), terminal PCC voltage (V t ), DC bus voltage (V dc ), solar PV system voltage (V pv ), current (I pv ), source neutral current (I sn ), and load neural current (I Ln ) are shown in Fig. 8. At t=3.8 s, one phase is removed and at t=3.9 s the same nonlinear load is reinstated. However, it was observed that the solar PV source grid currents (I sabc ) were free from harmonics and balanced, which illustrates the load balancing action of the controller. In addition, grid currents and voltages are usually out of phase, demonstrating the voltage regulation action of the controller. From 3.75 s to 3.95 s, the solar PV dc bus (v dc ) maintains a constant value of 800 V and the grid terminal PCC voltage was maintained at 339.6V by both AC and DC PI controllers. As shown in Fig. 8, from t=3.75 s to 3.97 s, the load neutral current (i Ln ) during the unbalanced and nonlinear loads is mitigated by the star/delta transformer and the source neutral current (i sn ) is zero. The solar PV current (I pv ) is approximately 4.5 A, illustrating the flow of solar power into the grid; the variation V t , V dc , and the settling time is less, showing improved dynamics and power quality.

Hardware implementation
The performance of the grid-solar PV system is implemented with linear and nonlinear loads as shown in Figs. 9a-9d with gains acquired from the GWO algorithm. Fig. 9a shows the grid source voltage of phase "a"(V sa ) and grid source currents (I sa , I sb , and I sc ). Fig. 9b shows the grid source voltage of phase "a" (V sa ) and load currents (I La , I Lb , and I Lc ). Fig. 9c shows the grid source voltage of phase "a" (V sa ) and compensator currents (I ca , I cb , and I cc ), Fig. 9d shows the grid source voltage of phase "a" (V sa ), grid current of phase "a" (I sa ), load current of phase "c" (I Lc ), and compensator current of phase "c" (I cc ). Based on observations, whether a linear load is balanced or unbalanced, the source current is balanced and sinusoidal.  Fig. 10a shows the grid source voltage of phase "a" (V sa ) and grid source currents (I sa , I sb , and I sc ), Fig. 10b shows the grid source voltage of phase "a" (V sa ) and load currents (I La , I Lb , and I Lc ), Fig. 10c shows the grid source voltage of phase "a" (V sa ) and compensator currents (I ca , I cb , and I cc ), Fig. 10d shows the grid source voltage of phase "a" (V sa ), the grid current of phase "a" (I sa ), load current of phase "b" (I Lb ), and load neutral current (I Ln ). Based on observations, whether the nonlinear load is balanced or unbalanced, the source current is balanced and sinusoidal and when the load is unbalanced, the load neutral current changes. The fundamental components of the harmonic spectrum of the voltage source of the solar grid (V s ), grid source current (i s ), and nonlinear load current (i L ) are shown in Figs. 11a-11c. The total harmonic distortion (THD) of the terminal voltage of the solar grid is 2.11%, the grid source current is 3.45%, and the load current has a %THD of 46.45 which is well within IEEE 519 and IEC standards. Fig. 11 (a, b, and c) show the harmonic band of the solar-grid voltage of phase "a," solar-grid current of phase "a," and load current of phase "a."

Conclusions
The performance of a grid-connected solar PV system using grey wolf-optimized gains in a UT-based SRF control algorithm was found to offer load balancing, reactive power compensation, and removal of harmonic currents with the application of linear and nonlinear loads. The proposed GWO algorithm can be used for quick estimation of K p and K i gains of PI controllers. The results of the grid-tied solar PV system demonstrate that the UT-based SRF control algorithm is simple, effective, and robust. Moreover, it compensates for power quality problems and improves system dynamics. The waveforms of the grid-connected solar PV system output indicate that sensed DC bus voltage and grid PCC voltage is maintained at 800 V and 339.6 V, respectively. The THD of AC voltage and currents in the solar grid is well within IEC and IEEE 519 standards.
Veramalla Rajagopal received his AMIE (Electrical) degree from the Institution of Engineers (India), his M.Tech. degree from the Uttar Pradesh Technical University, India, and his Ph.D. degree from the Indian Institute of Technology (IIT), Delhi. He is currently working as a Professor of Electrical and Electronics Engineering at Kakatiya Institute of Technology and Science, Warangal, Telangana, India. His areas of interest include power electronics and drives, renewable energy generation and applications, flexible AC transmission system, and power quality. He holds one Indian patent, has authored 31 international and national journals articles, and has presented at 35 IEEE and national conferences in India and abroad. He is a Life Member of the Indian Society for Technical Education (ISTE) and a Fellow of Institution of Engineers (India).