Improving the Power Quality of Island Microgrid With Voltage and Frequency Control Based on a Hybrid Genetic Algorithm and PSO

An efficient power control technique for inverter-based distributed generation (DG) in an islanded microgrid is investigated in this work. The objective is to raise the caliber of the electricity pumped from network-connected DGs. The characteristics that are taken into consideration include voltage and frequency control, dynamic response, and steady-state response, particularly when the microgrid is operating in island mode or when there is a load change. The control method consists of an internal current control loop and an external power control loop based on a synchronous reference frame and a conventional PI controller. The power controller is designed based on voltage-frequency (VF) control. In addition, an intelligent search technique that combines Particle Swarm Optimization (PSO) and Genetic Algorithm (GA) is utilized to automatically modify power controller parameters. The control technique in this research is that the DG modifies its control mode to modify the system voltage and frequency when the microgrid is islanded or load conditions change. The simulation results in MATLAB/SIMULINK software show that the proposed control system has been able to improve the power quality well.


I. INTRODUCTION
A microgrid typically consists of a local set of DGs, energy storage systems, and different thermal and electric loads. Which represents the complementary power grid infrastructure due to the rapid increase in load demand. The microgrid can operate in two modes of network connection and islands. In addition, the infiltration of micro-sources such as wind, photovoltaics, water, and fuel cells has emerged as alternatives in the electricity market that provide green energy and scalability in the power system. However, such sources are usually connected by PWM-VSI (Pulse Width Modulation-Voltage Source Inverter) systems, whose semiconductor The associate editor coordinating the review of this manuscript and approving it for publication was Sotirios Goudos .
components have a non-linear voltage-current characteristic and provide a high switching frequency, which increases the quality of power in end consumers [1], [2]. In microgrids, to achieve high-efficiency operation, achieve the desired power quality, and the possibility of connecting DGs to the network, we need a strong control system. As a result, one of the most essential components of modern electronic power converters is the current control strategy of the PWM-VSI system. Hysteresis Current Control (HCC) is a nonlinear controller that is widely utilized for a three-phase network-connected VSI system. The current controller which is linear Spatial Vector PWM (SVPWM) is a suitable controller that compensates for current error using a proportional-integral controller (PI) or a predictive control technique that can correct and generate PWM independently. This controller features a high-quality sine waveform, outstanding steady-state response, and low current ripple. Furthermore, because SVPWM has good qualities such as a stable switching frequency, appropriate switching pattern, and excellent use of DC-link voltage, it can improve controller behavior [3], [4].
In addition, to generate PWM reference voltage signals, an external power control loop is commonly paired with a current control loop. In the combined control method, the power control strategy, to provide acceptable power quality, plays a key role. One of the following two power control strategies can be used by the DG unit. In network connection mode, an active-reactive power control method is used, while in island mode, a voltage-frequency control technique is used. In this instance, the DG unit must provide maximum power while maintaining system stability [5], [6], [7]. Researchers have recently developed power controllers based on the internal current control loop that improves network configuration. In [8] and [9] a controller is investigated that seeks to improve dynamic stability and provides all the information needed for analysis and design. In [10], [11], [12], and [13], a power control strategy is applied to a microgrid, which can be analyzed and compared. Although dynamic performance and load sharing are taken into account, as well as controller details, this procedure lacks automatic parameter adjustment to maximize performance during rapid changes. Since the operation of microgrids is based on DG with a low power generation level, frequency control is done in cooperation with several DG units. DGs, like solar and wind cells, are not able to participate in frequency control due to their uncertain nature [14]. In such a case, one of the units (diesel generator or voltage source inverter) is considered as a reference of voltage and frequency, and the storage is used with a frequency compensation strategy. The basis of diesel generator performance is based on the droop characteristic. In this method, the synchronous generator or inverter voltage source, based on its primary control, the more frequency drop occurs in the microgrid, the more power is injected into the microgrid to compensate for load changes [15], [16]. In such cases, for secondary frequency control (automatic control), the no-load frequency in the drop method must be increased. The controller used is usually a proportionalintegral (PI) controller [17], [18], [19], [20]. In reference [21], [22], and [23], a fuzzy controller is used to improve frequency control. The fuzzy controller provides a better response than the simple PI controller, which is designed for only one working point. In [24] a new hybrid method is used for secondary control in microgrids based on robust control methods. In [25] presents a self-regulating controller based on human emotional behaviors for the frequency controller in microgrids. In [26] a fuzzy controller is proposed to control the microgrid frequency in the presence of electric vehicles and it is claimed that the proposed robust controller can be used for different network topologies. In [27] a fuzzy controller optimized with PSO in [28] of the combination of PSO with artificial neural network and in [29] of fuzzy adaptive model predictive control in [30] of a robust firefly-swarm hybrid optimization in [31] a hybrid cuckoo search and pattern search algorithm is used to control the microgrid frequency.
The combination of evolutionary algorithms has been investigated in many studies. In this research, a real-time optimization-based power controller for inverter-based DG in an island microgrid is examined. Based on the synchronous reference frame, this controller is connected to the present control loop. This design employs a traditional PI controller with a feed-forward compensation applied to the internal control loop to provide a quick dynamic response. When switching from microgrid to island mode or changing loads, the DG unit uses the VF control mode, which uses the GA-PSO meta-heuristic algorithm to regulate the system voltage and frequency. The GA-PSO algorithm is used to automatically adjust the parameters in real-time. The main purpose of this study is to improve the quality of the power supply by keeping the voltage and frequency in the acceptable range. The most important features of the proposed controller can be stated as follows: • Real-time PI controller design using hybrid PSO-GA algorithm.
• Optimum setting of microgrid VF controller parameters using PSO-GA algorithm.
• Including non-linear factors and uncertainties in the microgrid model to approach the real behavior of the microgrid.
• In the proposed controller, no telecommunication link or timing is used to detect the start of the modification process and its implementation, and the start time of the process is determined locally and separately for each DG. VOLUME 10, 2022 • There is no need for a master unit to control voltage and switch between inverter controllers during islanding.
• The proposed controller has a robust performance against changes in the working points of DGs that may have occurred due to load changes, the arrival of new DGs, or changing the operation mode of the microgrid, and it causes proper power sharing between DGs. So, the paper was built to present six parts. The first one is related to the introduction section, then in the second part, the three-phase network-connected mathematical model is presented and explained. Then, in the third part, the proposed control technic is detailed and discussed. Next, the concept of GA-PSO for controlling this system is explained. In the fifth part, the results are demonstrated and explained. Finally, a conclusion part closes the paper.

II. THE THREE-PHASE NETWORK-CONNECTED VSI SYSTEM MODEL
A three-phase network-connected VSI with an LC filter is depicted in this model in '' Figure 1a'' where R S and L S are the equivalent resistance and inductance of the filter. C is the filter capacitor and V s is the network voltage. The equations are written assuming that the zero point on the DC side is connected to the zero point on the AC side.
THE equivalent circuit of the system in the abc reference frame is represented by the state-space equations as Equation (1) [32]: Using the park transform, Equation (1) can be transferred to the dq reference frame as Equation (2): where ω is the angular frequency. Park transform can be defined as Equation (3): where θ = ω s t +θ 0 is the angle of rotation of the synchronous and θ 0 represents the initial value.

A. CONVENTIONAL DROOP CONTROL PRINCIPLES
The usual method of resource local control is to implement the controller in synchronous coordinates, in which the various parameters of the balanced network are permanently mode converted to dc, and as a result, the PI controller can be used to control the source. Figure 1b shows the control structure of an inverter-based DG source with a droop controller. Since the performance of the microgrid in the island mode is considered, it is expected that the DG units will be able to supply the microgrid load optimally. Assuming that the rated power of the sources is the same, each DG unit will supply the load power at a certain level in proportion to the network arrangement and the size of its feeder impedance. As can be seen in Figure 2, by increasing the active and reactive power produced by the source and in proportion to the slope of the characteristic droop, the frequency, and amplitude of the output voltage of the inverter source decrease relative to its nominal value, respectively. But the problem of power-sharing in frequency and voltage characteristics is faced with different conditions.
Depending on the amount of active power provided by each source, the frequency or in other words the voltage angle of the sources will differ from each other. Thus, the voltage of higher frequency sources is leading than that of lower frequency sources, and according to Equation (4), this leading leads to an increase in output at the source with less power output. Given that in the permanent state the frequency of all sources reaches the same value and on the other hand, there is a relationship between frequency and voltage angle according to Equation (5), the voltage angle of different sources relative to each other changes rapidly and this process eventually leads to equal active power production of DG units and ideal sharing of this power in the microgrid. However, because the drop at the source voltage will vary due to the different impedances of the source feeder, the output voltage range of the DG units will not be equal and as a result, the reactive power will not be properly shared between the sources.

B. V/F CONTROL STRATEGY
DG units can be classified into three sorts of energy sources when compared to large generators: 1-Variable speed sources (variable frequency) such as wind energy, 2-High-speed sources (high frequency) such as microturbines, 3-Direct energy conversion sources such as photovoltaics and fuel cells. For this reason, it is necessary to use VSI to connect DG to the network to achieve flexible performance. The DG power circuit is based on the VSI with a control structure, as illustrated in Figure 1a, thus the DG unit's performance is based on the inverter control model. For example, in gridconnected mode, the DG acts as a PQ generator, and the inverter must follow the active-reactive power control mode, while there is no need to adjust the voltage and frequency because the grid voltage is constant. But in island mode, DG is expected to meet load demand for power quality. The voltage and frequency are not constant in this scenario, so the inverter must use control mode V/F to solve the nominal powersharing problem. Therefore, with good DG performance, a proper control mode can be achieved. It is required to ensure an uninterrupted shift of control modes according to the conditions for the microgrid to operate reliably, and stable operation in the island mode should be provided according to the voltage and frequency regulation of the microgrid. In this case, the DG must meet the load demand and keep the voltage and frequency in the acceptable range, so the VF control mode must be adopted by one or more DGs to meet the system needs. Figure 3 depicts the block diagram for this application. As a result, the voltage and frequency reference values must be calculated locally or via the microgrid control center. Loop-Locked-Phase can be used to determine the frequency and the voltage can be obtained by Equation (6): VSI is commonly used as an interface for distributed generation sources in the distribution network. The VSI behaves like a synchronous machine and controls the frequency and voltage of the system through the controllers. The complete model of the VSI control system based on DG units is shown in Figure 4. The power circuit contains the inverter and the output LC filter, while the control circuit includes the power controller based on the drop technique, the voltage and frequency controller, the current controller, and the power calculation loop. The power control loop includes a droop controller which indicates that the active and reactive power in the DG units is divided by the droop coefficient based on the frequency and voltage of the system, respectively. According to the power controller diagram block the relationship between frequency and active power and voltage and reactive power (as shown in Figure 2) can be written as Equation (7):  where ω n is the nominal value of the frequency, V n is the nominal value of the voltage, and m p and n q are the active and reactive power droop gain, respectively. To achieve the correct regulation of voltage and frequency using existing controllers, DC values must be used for the input of the controller. Therefore, the abc values must be converted to dq0 values using the park transform. Equation (8) calculates the instantaneous powers of active P and reactive Q based on the measured output voltage and current [33]: where v od , v oq , and i od , i oq are the output voltages and currents in the form dq, respectively. A low-pass filter is used to eliminate the instantaneous fluctuations in active and reactive power.

III. CONTROL TECHNIQUE PROPOSITION
The power controller for a three-phase network-connected VSI system is described in this section. The controller architecture, as shown in Figure 5, consists of three main blocks: a power controller, a current linear controller, and a GA-PSO algorithm for automatic and real-time power control parameter modification. The details of each of these blocks will be described below.

A. POWER CONTROL STRATEGY
The goal of putting this strategy in place is to increase power quality under the desired control mode. The power controller VOLUME 10, 2022 based on the two PI controllers is illustrated on the left side of the block diagram in Figure 5. This controller denotes an external control loop that is applied to create reference currents id * and iq * . As a result, a relatively moderate shift in the reference current path could result in a higher quality inverter output power, indicating that the target is under control. In this paper, the VF control strategy based on the GA-PSO hybrid algorithm for VSI-based DG is presented. The voltage and frequency of the system are the main objectives of the control that must be achieved in the case of island operation. This technique is offered to respond to unexpected events such as the microgrid being disconnected from the main network or the loads connected to the microgrid changing. The controller changes the voltage and frequency depending on the fref and Vref reference values, and the GA-PSO algorithm finds the control parameters to provide the appropriate reference current vectors. According to the reference frame and based on the PI controller, Equation (9) can be used to obtain the reference current vectors.
The goal of putting this controller in place is to ensure that transient inverter output currents are tracked accurately and quickly. The present control loop, which is based on the synchronous reference frame, is shown on the right side of the block diagram in Figure 5. This controller is normally set up so that voltage is applied to the impedance R-L. The voltage angle is measured by the PLL block, which is then employed in the park transformation frame. To eliminate the current error, two PI controllers are employed, and the inverter current loop and the network voltage feed-forward loop are both used to improve steady-state and dynamic performance. As a result, the output signals in the dq frame indicate the reference voltage signals. By converting the park frame to Clarke, reference voltage signals are generated by combining six pulses for SVPWM in the stationary reference frame. In addition, the use of the SVPWM method ensures that the output voltage vectors have the least harmonic. Based on Equation (2), the relation of the reference voltage signals in the dq synchronous frame can be written as Equation (10): The uppercase * represents the reference values and dX d /dt According to Equation (11), using the Clarke transform, Equation (10) can be transferred to the static frame α-β. In addition, induction current is obtained using a low-pass filter (LPF) LC. Here, the LPF is represented by a first-order transform function.
where f is the filter input value, f 1 is the filtered value and Ti is the time constant.

IV. THE GA-PSO ALGORITHM: DESCRIPTION
By studying the applications of different artificial intelligence algorithms, it has been determined that each of these algorithms has its strengths and weaknesses. A new approach to using these algorithms is to combine them to achieve a more efficient algorithm. For this purpose, by recognizing the strengths and weaknesses of these algorithms, they combine them in such a way that the strengths of these algorithms were used to eliminate and cover each other's weaknesses. Rapid convergence is one of the most significant issues with the PSO algorithm. As a result, the algorithm arrives at the best possible answer before examining the full answer space, increasing the chances of becoming stuck at the best local points. It should be noted that one of the most important things in designing a search algorithm is that the algorithm can navigate the answer space well, thus reducing the possibility of getting stuck in the optimal local points. In this paper, to solve the problem mentioned in the PSO algorithm, the genetic algorithm is used, which has a high search power and can perform an acceptable search in the answer space and escape from the local optimal points. After each iteration of the PSO algorithm, the proposed hybrid algorithm places the particles in the response space again and makes the response space more navigable by selecting half of the particle population that had inferior performance and utilizing the genetic algorithm operators. As a result, the chances of quick convergence and entrapment at local optimal spots are reduced. The steps of the hybrid algorithm used in this paper are shown in Figure 6, and the coding for this proposed algorithm is shown in Figure 7.
In this paper, microgrid stability is affected by four variables k pf , k if , k pv , and k iv , which are the input variables of the problem. It should be noted that each of these variables with a certain coefficient and slope, affect the stability of the microgrid. Here, microgrid stability refers to microgrid voltage and frequency control. To introduce how the particles are displayed, here we consider the microgrid stability as a particle or bird. Each particle is an array defined by the number of impact variables. Particle coding for the PSO algorithm is shown in Figure 7. It should be noted that all input variables are normalized their values are taken in the range of 0 to 1, and each particle is an answer to the coefficients of the regression Equation. If we assume that X 1 , X 2 , . . . , X m are the variables affecting the microgrid stability and Y is the microgrid stability, then each particle of the answer to the  problem is α 1 , α 2 , . . . , α m in the Equation for maintaining the microgrid stability in Equation (13): In fact, according to the coding of Figure 7, X m is the variable that affects the stability of the microgrid and α m is the effective coefficient of that variable, which ultimately determines the stability of the microgrid Y. The purpose of microgrid stability in this study is for dispersed generation sources to be able to control output power to satisfy load demand while maintaining the microgrid's voltage and frequency at their nominal values. Therefore, considering the above control objectives, the objective function is defined as Equation (14) which is the result of the difference between the reference value and the controlled signal.
The initial population formation stage is random. At this point, the algorithm randomly generates the initial solution (number of particles required) as much as Npop. So that each answer in this step contains m numbers in the interval [0,1] and also the velocity of each particle (answer) is generated randomly. At this stage, birds or particles are allowed to move freely in the problem space and each shows a new answer to the problem. Our problem space (which is selected according to the affected variables) has four aspects, the particles are allowed to fly and select a point in space. This point in space gives us a new voltage and frequency according to the number of effective factors, which we calculate by comparing it with the actual amount of voltage and frequency at that point, the pattern error level. Now we have to evaluate the particles of the produced population. The fitness function used for this purpose is the mean square error (MSE) function, which is commonly used in the design of the forecasting system and is defined as follows: where C j is the particle j th of the population, Y i is the output of the prediction system of the training set data i th , P i is the actual output of the training set data i th , and N is the number of the training set data. Finally, it is time to produce a new generation by operating the PSO algorithm and the genetic algorithm. In this section, the PSO algorithm is first implemented on the training data. At the end of each iteration of the algorithm, the crossover and mutation operators of the genetic algorithm act on the particles and move them further in the response space, thus the PSO algorithm performs a better general search in the response space with the help of the genetic algorithm. In other words, at this stage, after each iteration of the PSO algorithm, we take advantage of the genetic algorithm, given that it is possible to get stuck in local minima and the problem space may not be fully explored. By using powerful search engines, genetic algorithms, and random mutations, we force the particles to move to other parts of the multidimensional space of the problem. We continue this process in each iteration until the problem space is fully examined and finally, we reach the condition of stopping the problem (according to Figure 6). In other words, if the number of iterations is equal to the specified number, the process of executing the algorithm ends, otherwise, we go to the relevant step and repeat the above process. At the end of the algorithm, the best particle in the last generation is considered the final answer of the system.

V. SIMULATION RESULTS
First, the proposed method is implemented on the three-phase VSI system model connected to the network in Figure 1, and all simulations are performed with MATLAB software. The system parameters are presented in Table 1.
In this simulation, a 75 kW DG is used. The constants k p and k i are the current control parameters. For SVPWM-based current controllers, the switching and sampling frequencies are 10 kHz and 500 kHz, respectively. The simulation is performed in two modes of voltage and frequency adjustment VOLUME 10, 2022   and load changes, which will be examined in the following subsections. As mentioned before, in the case of islands, it is a microgrid separated from the main network and independently provides load power. Unlike the grid-connected mode where the voltage and frequency were regulated by the grid, in this mode, the voltage and frequency of the two ends must be stabilized with proper microgrid control.

A. ADJUST VOLTAGE AND FREQUENCY IN ISLAND MODE
In addition, the controller is built to analyze both dynamic and steady-state responses, As a result, the network adjusts the microgrid's voltage and frequency. At 0.4 s, it disconnects from the network and enters island mode. To avoid severe frequency deviation and voltage drop due to sudden load entry or starting island mode, DG enters VF control mode. According to Equation (9), V ref is set at 310 V and f ref at 50 Hz. Figure 8 shows the voltage and frequency adjusted using the control method. Which is the interaction of the  control method and PSO-GA algorithm. Figure 8 shows that at 0.4 s it enters the island mode, and the controller maintains the system voltage and frequency at the desired value. During the simulation time, the PSO-GA algorithm adjusts the control parameters and during the process, the voltage and frequency values are in the acceptable range of 1 p.u limits. Figure 9 shows the injection current of the network and microgrid. As shown in Figure 9 (a), after starting the island mode, the load current is fully fed.
As mentioned, in the network-connected mode, the microgrid enters the PQ control mode, in which case it adjusts the active and reactive output power according to the system requirements. Figure 10 (a) shows the active injection power of the network. Power changes, in this case, indicate that the instantaneous power of the system is variable due to decreasing and increasing demand. On the other hand, Figure 10 (b) shows the microgrid active injection power that follows the changes in the active power in the network and controls the power injection according to the needs of the network.
According to Figures 10 (c) and (d), it can be seen that before starting the island mode, the reactive power required by the network is provided by the microgrid, and after starting the island mode, the reactive power produced by the microgrid is zero due to the lack of non-ohmic load in the circuit.
According to the results of Figures 8 to 10, it can be said that the performance of the control system by applying the hybrid PSO-GA algorithm in the island mode was able to regulate the voltage and frequency in an acceptable range and the network-connected mode with QP control was able to active and reactive power sharing to meet network demand. Table 2 lists the settings of the PI controller optimized by the PSO-GA method. Figures 11 and 12 also show the convergence of the parameters and the goal function.

B. IMPLEMENT THE PROPOSED METHOD WITH THE PRESENCE OF SEVERAL DGS
In this part, the proposed method is implemented on a standard island microgrid including various loads and inverterbased DG. Figure 13 shows the single-line diagram of the studied microgrid [34]. The distributed generation units of this microgrid (DG1-DG4) with capacities equal to 12.5 kW are involved in the simulation process. Information about the loads and lines of this network are presented in the single-line diagram of Figure (13) and Table 3, and the controller specifications of the DG units are given in Table 4. Figure 14 shows the load power-sharing status between the units of this microgrid in different conditions. During the start-up of the microgrid, the level of participation of each unit in meeting the demand of loads will be based on the rules of common drop characteristics. Therefore, the active power output reaches the desired value, while the reactive power output of each unit has a different value depending on the size of its feeder impedance. In the next step, the load L5 is added to the microgrid at 1.25s and disconnected at 2.25s. It is observed that these changes are detected in all units and are responded to simultaneously and in a coordinated manner. Finally, in 3.5s, the DG4 unit exits the microgrid, and the simulation results confirm the efficiency of the proposed method in microgrid power control.
Finally, Figure 15 shows the curve of changes in network frequency deviation due to these changes. When load L5 enters the network, the frequency decreases and with load L5 exiting the network, the frequency changes increase and at the moment DG4 exits the network, these frequency changes will be more intense, which can be seen in Figure 15. Where the proposed method is compared with conventional PI control methods and PI optimized by PSO [32]. As you can see, the proposed controller had a good response both in terms of minimizing the frequency changes and in terms of reducing the frequency recovery time. Figure 16 compares the performance of the PSO-GA algorithm with the GA and PSO algorithms. As you can see from the convergence curve of the fitness function, the combined method performed better.

C. SENSITIVITY ANALYSIS OF THE PROPOSED CONTROLLERFOR PARAMETERS UNCERTAINTY
In this section, the performance of the proposed controller has been evaluated for uncertainties in load changes, the presence of different DGs, and changes in the generation power of the units, and its results have been compared with other methods. The studied microgrid information is presented in   reference [35]. In this microgrid, there are different types of DGs, including a photovoltaic (PV), and a wind turbine generator (WTG). Here, the microgrid is modeled through MATLAB software, to improve the model and get closer to the real response of the microgrid, a series of nonlinear elements, limiters, and time delays have been added to the microgrid model, as shown in Figure 17. In this evaluation, the results obtained in the presence of sudden decreasing and increasing changes in a load of consumers and changes in the generation power of WTG and PV in a reasonable range in the presence of non-linear factors such as dead bands and delays (with a delay of 50 milliseconds) have been examined. In this case, the proposed controller should be able to be robust in the presence of changes in atmospheric conditions such as wind speed and solar radiation. Here, because we have large load changes, WTG and PV power changes are also multiplied to be comparable to large load changes as disturbances. Figure 18 shows the load changes in the form of steps, which according to the capacity of the units, step changes are created in such a way as to create significant frequency changes. Also, the random changes in WTG and PV power are shown in Figure 19. Considering that this figure shows the changes in generation power, it can be a negative number.
To compare the performance results of the controllers with each other in different states, a functional index is defined in the form of Equation (16). Which shows the integral amount of microgrid frequency deviation from its nominal amount (50 Hz) so that the lower the value, the better the controller performance. Figure 20 shows the changes in the functional index defined in Equation (16) for the proposed controller, IMPC [36], and MPC-PSO [35]. As it is known, the proposed controller has the lowest amount of functional index changes, which indicates its proper performance.
In reference [35], to improve the PI controller in the microgrid, model predictive control (MPC) is used to optimize the coefficients of the PI controller, and since its purpose is to control the frequency of the microgrid, the performance speed of MPC will be very important. To solve this problem, the PSO algorithm is used to improve the MPC controller both in terms of performance speed and accuracy. Following this issue, in reference [36], the improved MPC controller is used to improve the current control loop in the inverter. Finally,   Figure 21 shows the curve of microgrid frequency changes according to the disturbances presented in Figure 18 and Figure 19. As you can see, the proposed controller has a more suitable response both in terms of reducing overshoot of frequency changes and in terms of reducing frequency settling time, compared to the two MPC-PSO [35] and IMPC [36] controllers. A real microgrid contains different types of uncertainties due to microgrid load changes, system modeling errors, and microgrid structure changes. The simulation results for analyzing the frequency control performance of the studied microgrid show that the parameters are shown in Figure 17, such as T1, Tgi, etc., have a significant effect on the control performance of the system. Therefore, in this article, to reduce the settling time and frequency overshoot of the microgrid and the robust performance of the proposed controller, an integral square time square error (ISTSE) index in the form of Equation (17) has been used to evaluate the  performance of the proposed controller.  Finally, TABLE 5 shows the amount of ISTSE, overshoot, and settling time obtained from the simulation results for normal and worst cases of uncertainty in the parameters, i.e. uncertainty of ±30% of the nominal value for different controllers. As you can see, according to the considered parameters, the proposed controller has been able to obtain better results.

VI. CONCLUSION
An effective power control method for VSI-based DG was researched in this paper to improve power quality in an island microgrid. An internal current control loop and a VF power control loop are part of the control approach.
To implement the real-time auto-tuning method, the PSO-GA algorithm is inserted into the VF control loop. This technique is used to control voltage, frequency, and power-sharing when operating in island mode and while linked to the network. The controller is also designed to examine both dynamic and steady-state responses. According to the simulation results, the suggested controller has acceptable performance for controlling the microgrid's voltage and frequency, and its transient operating time is quite brief. This controller can therefore be used to control DG units in a microgrid while considering power-sharing. Even with these good results and perfect results, some limitations exist. The major of these limitations are related to the complex combination of the optimization application that will resolve the problem. Many parameters must be adapted and chosen and finding the best combination need to make more than testing and measuring. On the other side, this work must be applied in a real application for testing the real efficiency and demonstrating if the system will be stable or not. In future endeavors of this work, more than technic must be used and then compared. But verifying if this protocol is useful for a large charge amount of load must be made soon and try to be in connection with this work.