VSI LC filter optimized by a genetic algorithm from connected to island microgrid operation

In microgrids (MG) with a high penetration of renewable energy sources (RES) power converters are used to regulate the produced energy to a single voltage and frequency reference value across the MG. Adequate incorporation of an LC filter at the output of power electronic devices allows the attenuation of harmful harmonics that can be introduced to the MGs energy bus. By traditional methods, LC filter values can be calculated by means of the power rating, switching frequency, cutoff frequency, and using the bode frequency domain. Nonetheless, in the transition from a connected to an autonomous MG operation, the calculated LC filter can lead to high harmonic injection. As a result, a tuning methodology capable of obtaining the right set of parameters for the LC filter for a transition event can improve the performance of the MG. This work optimizes the LC output parameters with respect to the size of the filter components, the IEEE Std 519-2014, and bandwidth of the filter, within a bounded region of values subjected to performance conditions such as voltage output, and the produced total harmonic distortion (THD) measurements during the transition from a connected to an autonomous operation. In a case study, genetic algorithm optimization is used to obtain the LC filter parameters and compared to a conventional arithmetic methodology to obtain the values of the filter. The optimization results in a set of values that lead to a higher harmonic attenuation after the transition rather than a conventional method using the switching frequency as the main design factor.


Introduction
As a result of the rapid development of electricity demand, new alternative generation systems have been incorporated to aid in electrical power production including renewable energy sources (RES). A microgrid (MG) is a system formed by a cluster of distributed generation units (DGU) such as alternative or conventional generation agents, energy storage systems (ESS), and loads; these operate under the command of a centralized or distributed control system typically known as the microgrid central controller (MGCC). MGs are described as systems capable of operating collectively and independently from the power grid by cause of the single point of connection referred to as the point of common coupling (PCC) [21]. MGs operating independently requires the integration of an MGCC as part of the system to manage the available assets and foresee the overall reliability of the system in an autonomous state [10].
It is worth mentioning that, MGs are planned ahead of their implementation, meaning that the initially installed power capacity is set to cover for any increment in the power demand for limited time, that is, counting all the possible new electrical agents that may be introduced to the system as time passes [16]. Geographical and load-prediction studies are carried out before properly configure the microgrid central controller which includes the secondary and tertiary controllers. A change in the original network configuration would require an update on the MGCC initial parameters, directly affecting the operation of the secondary and tertiary control layers within the MG hierarchical control architecture [30].
MGs with a high penetration number of RES incorporate these alternative generation units through power converters (PCs) in the form of DGU [13]. PCs are power electronics switching devices with the objective of regulating the produced energy to a single voltage and frequency reference value. MGs that include photovoltaic (PV) energy generation and ESS resort to voltage source inverters (VSI) to transform a DC voltage input to a regulated AC voltage output with a nominal frequency [33]. VSIs are power devices with high energy conversion efficiency. Nonetheless, by cause of the high switching frequencies the voltage and current output may contain harmful harmonics especially during transition events when the MG switches from a connected to an independent operation [22], resulting in unsafe operating conditions for the connected loads despite the high efficiency of the PCs. A low-pass filter equipped between the output side of the VSI and the loads can attenuate the injection of harmful harmonics caused by the high switching frequencies [4]. Despite that, the equipped low-pass filter can lead to a short time higher harmonic injection during transitions if its components are not properly obtained.
To attenuate the harmonic injection, an LC filter is usually connected between the VSI output and the loads, by this implementation the reduction of the harmonics generated by the high switching frequencies of the PWM technique and the nonlinear load characteristics is accomplished in the voltage waveform [18,32]. When compared to a conventional L filter, the LC filter provides better attenuation to high-frequency harmonics [24] and exhibits an improved dynamic performance. Nevertheless, LCL filters are also a good alternative to L and LC filters, LCL filters have a better overall performance as reviewed in Ref. [22]. Nonetheless, LCL filters increase the complexity of the system, resulting in a more convoluted model slowing down the design procedure. Thanks to the literature, the procedure of how to design the filter parameters according to different criteria is well known [3]. Despite the chosen filter architecture, the IEEE standards on harmonic voltage distortion for electrical systems IEEE Std 519-1992 and IEEE Std 519-2014 need to be fulfilled to ensure a proper MG operation with a THD limit of 5% and limit of 12% THD over a maximum period of 3 s respectively.
Both standards highlight the recommended operation and qualifications for harmonic control in the field of electrical power systems. However, the standard IEEE Std 519-1992 clarifies on the consumers' harmonic voltage distortion limit at the PCC, this being 5% for general systems and 3% in special applications including hospitals and airports. This standard recognizes the obligation of the generations agents to supply the loads with resembling pure sinusoidal voltage waves [5]. On the other hand, a description and border setting in real-life applications is exposed in the standard IEEE Std 519-2014 [14], it is stated that the maximum allowed THD measurement per day should be less than 1.5 times the THD limit of 8.0%, meaning that a maximum of 12% THD is allowed for periods shorter than 3 s. Overall, the latter restates the collaborative obligation involving both consumption and generation agents, to maintain the recommended harmonic limits for voltages and currents within the electrical power systems [5].
In recent years multiple MG studies have been performed to understand and improve certain areas of interest in the MG system. A particular area of interest is the transition between operating modes in the MG, research in this area focuses on mitigating possible transients introduced to the MG's energy bus due to transition events, mainly when shifting from a connected to an autonomous operation [7,20,27]. Most of the research dedicated on achieving a seamless transition resort to the development of control techniques for VSIs in combination with islanding detection algorithms [9,12]. Usually, these VSIs are found in a grid-supporting configuration, this configuration enables the faculty of acting in a connected and independent MG state for the VSIs.
The performance of these control-based solutions is dependent on the right tuning of the controller's gains, in most cases, these tasks are not straightforward, where an erroneous tuning of these controllers gains can lead to a deficiency in the VSIs controller performance and increment the injected THD to the MG's energy bus. It is worth mentioning that the majority of these control techniques incorporate the dynamics of the LC output filter in their analysis and design. Therefore, the effect of the transition in the filter performance needs to be analyzed since most of the literature takes for granted the attenuation of harmonics during and after transition events with the originally calculated filter parameters.
Several design methodologies have been proposed across the literature, where most of them contemplate the integration of an VSI with a direct connection to the utility grid [1,8,17]. In Ref. [4], the authors use fuzzy logic to design the output LC filter of a single-phase inverter, obtaining promising result in the attenuation of the harmonic content of the output voltage. Although this method is effective, the complexity of the fuzzy logic algorithm for a three-phase inverter would result in a set back for the design procedure. The authors in Ref. [2] propose a design procedure to meet the IEEE Std. 1547 for harmonic attenuation employing the cutoff frequency, fundamental frequency, and switching frequency of the inverter as main design characteristics. The work in Ref. [19] resorts to a genetic algorithm optimization procedure to find the optimal values for an LCL filter applied to a three-phase rectifier, demonstrating that the employed optimization algorithm is suitable for such a task. Authors in Ref. [11] use particle swarm optimization to find the optimal setting for an MG in connected an autonomous operation, the optimization problem for a connected operation includes the LC filter parameters. However, these are not included in the optimization problem for the autonomous operation, in addition, transition tests are not presented once the optimized settings for both modes are successfully obtained.
The problem is constituted for a time during and after the transition from gridconnected to an independent mode of operation. Since VSIs with grid-supporting capabilities are DGUs that can work with and without a direct connection to the power grid, transitions effects between a connected and the independent state can be dampened by grid-supporting VSIs [27], mainly because there is no need to change the VSI control objective from a connected to an independent state of the MG. That is, for disconnection events grid-supporting VSIs use the same control technique for either state of the MG [23].
This work presents a different approach in the task of attenuating the injected THD by a grid-supporting VSI in an MG's bus during and after a transition event between connected and an autonomous operation while meeting the IEEE Std 519-1992 and IEEE Std 519-2014 standards on harmonic voltage distortion. This approach consists of finding an optimized set of LC filter parameters within a bounded region of values that guarantee a desired performance during and after the transition event. The optimization process is done using genetic algorithms (GA) due to its natural selection and classic evolutionary optimization nature, with respect the size of the filter components, the THD during and after a transition event, and the bandwidth of the filter since this attribute eliminates the lowest order harmonics of the output voltage waveform of the VSI.
The proposed optimization of the LC filter, aids in the delivered quality of the electrical energy by reducing the amount of injected harmonics during and after the transition event, while maintaining the harmonic injection levels to an allowed standard in a connected state of the MG. This proposal is referred to as system independent because it uses local data from the primary control layer to obtain the optimal LC filter parameters, this is possible because there is no need for a reconfiguration of the microgrid central controller since there is no linkage between the primary control layer and the microgrid central controller [31]. In other words, the filter performance and the used local data employed during the optimization process are independent of the microgrid central controller. The evaluation of the system is done in a modified version of the IEEE 13 node test feeder.
The remaining work is structured as follows. Section 2 introduces the used MG system with the integration of a VSI with grid-supporting capabilities. Section 3 gives an analysis of the filter bandwidth effect over the voltage output in a VSI.

3
VSI LC filter optimized by a genetic algorithm from connected… Section 4 explains the basics of the genetic algorithm optimization procedure used in this work. Section 5 introduces the selection procedure of values for the bounded region according to the desired performance. Section 6 describes the case of study, introducing the constitution of the optimization problem. Section 7 gives the analysis of results and discussion of this work. Section 8 gives the final conclusions of this paper.

Structure of MG with VSI
To test the impact of the transition from a connected to autonomous operation in the LC output filter of a VSI fed MG, this work makes use of the IEEE 13 node test feeder. This particular system consists of 10 lines connecting 13 buses, with a radial distribution network configuration, the system includes a generation unit, and different linear and nonlinear load configurations consisting of and Y types in constant PQ, impedance, and current behavior; within the system the loads have voltage and power unbalances and one transformer in a Y-Y configuration is included.
For practical purpose, the nominal RMS voltage is defined as balanced across the three-phase system for the different loads in the IEEE 13 node test feeder model, a breaker is added in the 650 node acting as the PCC between the utility grid and the MG, a VSI is added in the 650 node to feed the loads after the grid disconnection. The overall system specifications are brought down by a factor of 0.1 to feed the system with a single DGU with a 10 KW rating without major voltage sags. According to Ref. [15], an output voltage of 240 V has been used for small photo-voltaic-based generation microgrids, hence, the nominal voltage is then scaled to 240 VRMS with an operating frequency of 60 Hz . Figure 1 illustrates the system configuration used in this work.
The power grid is simulated by a constant three-phase generator in the Y grounded configuration, the simulated power grid feeds the system with a balanced three-phase line to line voltages in a swing generation type.
The integration of VSI in MG is a widely studied subject as reviewed in the literature, according to Ref. [23], three different control schemes for a VSI can be implemented in the MG system. Grid-supporting mode allows a VSI to operate in both modes of operation, acting as a grid-feeding unit in a connected state and switching to a grid-forming unit in autonomous operation of the MG.
The implemented VSI is set to operate under a grid-supporting control scheme. The grid-support control architecture includes three different control layers with different control objectives, all control layers in the grid-supporting architecture use local voltage, current, and power system measurements to compute the control signal output. However, the three control strategies are gain-dependent, where proportional integral (PI) controllers can be found in the external voltage and internal current control loops. Since the correct tuning of the gains is not the objective of this work, the different gains for the PI controllers are tuned by the trial and error method. The VSI is fed by a constant DC source, later, SVPWM is used and controlled to give the switching signals to the VSI in order to meet the desired voltage reference. The attenuation of the high order harmonics resulting from the switching 1 3 signals is performed by the LC output filter implementation. The basic structure of the installed VSI is shown in Fig. 2.

LC filter analysis
When working with VSI one of the main concerns is frequency regulation and pure sinusoidal voltage and current waveform at the output side of the PC. The harmonic distortion of the output voltages of a VSI depends on the parameters of the LC filter. By traditional methods, the attenuation of the VSI switching frequencies depends on the cutoff frequency of the filter, a smaller cutoff frequency results in a greater voltage ripple attenuation. In relation, the bandwidth of the filter has a similar impact on  Figure 3a shows the effect of different LC filter bandwidths applied to the three-phase voltage output of a VSI, this effect is also studied in [29].
The voltage signals in Fig. 3a go through different LC filters with different bandwidths, Fig. 3b illustrates the effect of different filters applied to the voltage signals A, B, C, and D. The smaller bandwidth results in a better attenuation of the voltage ripple. However, a small bandwidth can have negative effects on the overall voltage output signal of the VSI, by over attenuating the voltage signal and causing a slower VSI response to any disturbance.

Genetic algorithms optimization
A large number of areas in the engineering field have benefited from the advantages of applying optimization algorithms. Genetic algorithms are one of the most widely used tools since it first appeared in 1970 [26]. GA is classified as an evolutionary optimization tool, this algorithm works under the dynamic principles of natural selection where only the fittest individuals in a population are chosen to continue in the iterative process of the algorithm as possible solutions [6].
GA works to find a minimum or maximum solution to an objective function by manipulating the initial population. Each element of the population is evaluated concerning the established objective function, acquiring a score for it, at the end of the iteration only the inhabitants with the best scores are chosen as parents to create children, children are then created to contain characteristics of their parents. Figure 4 shows the functioning of these operations and the iterative evaluation process of GA optimization.
The basic structure of the GA is divided into operations such as selection, crossover, mutation, and evaluation [28]. The selection processes separate the fit individuals from the unfit ones as the former represents a potential solution due to their Fig. 3 Bandwidth effect over an VSI three-phase voltage output initial scores according to the established objective function, the selected individuals are then copied into children generations by the properties of crossover and mutation. The crossover operation takes the similarities of the best fit values from the parents in previous generations and creates a new population of children with common characteristics [26], at the same time, the mutation operation helps the optimization process to avoid falling in a local minimum or maximum value, this is achieved by changing one factor of a generated children according to certain probability [28].

Proposed bounded LC filter tuning procedure
Given the possible methods to obtain the LC filter values and the need for the system characteristics in the LC filter design, another approach is suggested where the system characteristics are not essential to obtain the values of the LC filter. Moreover, this new approach focuses on a desired design response of the VSI voltage output during and after a transition event. The system is tested through an extended number of LC filter parameters where the attenuation of the harmonics can be evaluated. The tests are exhorted to search for such a correlation of values that meet the IEEE STD 519-1992 on harmonic limits for a THD average bellow 5% and maintain a voltage within the ±5 %. All the performed tests evaluate the attenuation performance by computing the THD during and after the transition event occurs through Eq. (1).
where V n_rms is the measured n = 8 harmonic voltage component and V fund_rms is the measured fundamental frequency RMS voltage. The bounded region is dictated by the constraints in Eqs. (2) and (3) highlighting the filter parameters that meet the desired constraints to form a bounded region of values as shown in Fig. 5.  Figure 5 shows two sets of colored points, the points colored in green represent the combination of inductance and capacitance required by the LC output filer to meet the IEEE Std 519-1992 on harmonic distortion, while the points highlighted in red represent the filter parameters that guarantee a voltage delivery level within the allowed ±5%V. The Z axis shows the THD average measurement at the PCC after the transition event occurs with the tested combination value for the LC filter. An optimization process using Genetic Algorithms is later implemented over the bounded region formed by the set of points that satisfy the system constraints on harmonic distortion and maximum voltage deviation of ± 5 %, this optimization region is shown in Fig. 6. All simulations are carried out using MATLAB Simulink and the simulation parameters are listed in Table 1.

Microgrid transition case study
As a case study, the LC filter parameters are tested in the proposed MG system described in Sect. 2. Consisting of a modified version of the IEEE 13 node test feeder to test the disconnection effect over the VSI's LC filter performance.
The MGs LC filter values were obtained through two different approaches. The fist approach sorts to a design procedure proposed in Ref. [2], this design methodology is   (4) and (5) The equations used to obtain the LC filer are dependent on system variables such as maximum load, fundamental frequency, cutoff frequency, and resort to a design coefficient that depends on the switching frequency and the maximum ripple current, RLm, f1, fr, and respectively. Table 2 shows the system parameters used for the calculation of the LC filter.

Optimization problem formulation
Calculating a set of LC filter parameters able to output the desired THD at the instant of the transition is an unfeasible mathematical task. Therefore, an optimization methodology over a series of system tests is required to guarantee the filter performance in such conditions. The second approach optimizes according to a bounded region of LC filter values shown in Fig. 6 to obtain the LC filter values that satisfy the tuning constraints using GA optimization. For a connected and autonomous operation of the MG, the problem constraints are as follows.
where Lf min and Lf max correspond to the minimum and maximum possible value for the filter inductor, and Cf min and Cf max the values that restrain the possible capacitor values. THD m is the average measured THD in the voltage output signal after the transition, THD t is the THD measured at the instant of the transition event, this constraint is set according to the standard IEEE Std 519-2014 which states that a maximum of 12% THD is allowed over a maximum period of 3 s [14]. The objective function is defined as a weighted sum of the three design parameters for the filter. The geometrical area formed by the capacitor and the inductor values in the XY plane of Fig. 6 is considered as the main design criteria since the size of the components matter in final physical system implementation and are a crucial factor to minimize the system cost [25]. The formed geometrical area can be easily defined as Eq. (10).
The second design parameter being the THD produced during and after the transition event. To meet the standards IEEE Std 519-2014 and IEEE Std 519-1992 the system's THD is evaluated using Eq. (1) up to the 8th harmonic. Since the latter is already guaranteed by the bounded region of values shown in Fig. 6 it's emphasis is reduced in the optimization problem, hence, the variable TDH t has a greater weight in the final objective function.
The third design parameter is the bandwidth of the filter. As demonstrated in Sect. 3, the voltage ripple attenuation due to high switching frequencies of the VSI depends on the bandwidth of the implemented LC filer, thus, one of the optimization objectives is to minimize the bandwidth by the given LC filter without compromising the overall component size of the filter and the disturbance response of the VSI. Each bounded filter parameter is evaluated in the frequency domain by following the second-order transfer function (11), and finding the bandwidth (BW) at the −3 dB points.
The final objective function is then formulated as the weighted sum of the three design constraints and formulated in Eq. (12).
where k 1 , k 2 , and k 3 represent the weights empirically assigned and fixed to each design constraint, the value of 0.7 is assigned to the coefficient k 1 which has a greater impact in the optimization process for an overall cost reduction [25], while 0.2 and 0.1 are chosen for the k 2 and k 3 variables. The GA optimization procedure is carried out with a population vector size of 25 with a uniform mutation vector equal to 0.01. The constraint and function tolerance are declared as 1 × 10 −6 . The result of the bounded GA optimization procedures and the obtained LC values through conventional design methodology calculations are listed in Table 3.
To validate the optimization results for the filter during a transition event in the modified IEEE 13 node test feeder described in Sect. 2, a comparison between the calculated values is done in a disconnection scenario. All tests and simulations are performed using MATLAB Simulink software in discrete time-space. The simulation is fixed to a 20 s step size with ode4 (Runge-Kutta) as the selected solver for the simulation, simulation time is set to 5 s.
The MG voltage and frequency are measured at the PCC node, with a transition event programmed at 0.12 s within the simulation time, the RMS line to neutral voltages are set to 240 VRMS for each phase with an equal 120 • phase angle between each line. The transition is event is programmed to disconnect the three phases simultaneously, hence, entering in autonomous operation.
The VSI is connected to a constant DC source of 600 V , the control creates the switching signals to the IGBT based PC using SVPWM, the switching frequency is selected for a medium power standard to a 3 KHz value according to the IEEE Std 519-1992. The first optimization criteria design is shown in Fig. 8, where the geometric area formed by the obtained filter parameters by the GA optimization process is highlighted. The illustrated area represents the filter parameters that best attenuate the injected THD and deliver a small bandwidth without compromising the size of the filter components. Figure 9 shows the two different frequency characteristics, each represents the calculated and the optimized filters in the frequency domain. The calculated LC filter shows a bandwidth equal to 3.77 × 10 4 rad∕s , whereas, the LC parameters obtained trough the genetic algorithm optimization process displays a smaller bandwidth equal to 1.9 × 10 3 rad∕s . The optimization results in the minimization of the bandwidth, leading to a greater THD mitigation in the voltage output of the VSI as shown in Figs. 11 and 12.

Results and discussion
As discussed a transition event can lead to high harmonic injection. Figure 10 illustrates the measured voltage output THD per phase of the VSI before, during, and after the transition occurs at 0.12 s during the simulation time. Results in Fig. 10a show the filter performance of the calculated LC filter using conventional methods, showing that the filter meets the IEEE Std 519-2014 of a limit of 12% THD over a maximum of 3 s in the voltage output of the VSI. However, the conventional method fails in the fulfillment of the standards IEEE Std 519-1992 by maintaining a THD above 5% after the transition. In the case of the optimized LC filter values, illustrated in Fig. 10b, show a greater THD injection of 1.14% during the transition in the C phase of the VSI, differently, phases A and B display a better transition behavior in the maximum THD injection per phase with −4.1% and −2.03% respectively to their associated values with the calculated LC filter. Figure 11 shows how the calculated LC filter fails in attenuating the high switching harmonics after the transition. The voltage ripple is increased and present due to the loss of connection to the grid. The calculated filter through the switching frequency leads to an increment in the injected THD measured up to the 8th harmonic going from a THD = 0.003% to an average of THD = 8.3% between the three phases of the VSI.
On the other hand, Fig. 12 illustrates the performance of the LC filter obtained trough the bounded optimization process during a transition event, the GA optimized LC filter meets the IEEE Std 519-1992 and IEEE Std 519-2014 standards VSI LC filter optimized by a genetic algorithm from connected… on the maximum allowed harmonic distortion, attenuating the high switching harmonics even after the disconnection. The average THD generated up to the 8th harmonic due to the loss of connection to the grid results in a 1.6003% increment, going from a THD = 0.003% to an average per phase of THD = 1.6033%.
In Both cases, the maximum 12% THD set by the IEEE Std 519-2014 is not exceeded. In the case of the calculated LC filter, the voltage distortion is greater when compared to the generated by the optimized LC filter, particularly the transition event leads evade the 5% THD limit. The optimized LC filter leads to a better VSI performance in transition events from a connected to autonomous operation.  The transition can be improved by the right tuning of the grid-supporting controllers of the VSI. Overall, the GA optimized LC filter has a better performance in the attenuation of harmonics in the voltage after the transition event occurs, leading to better power delivery.

Conclusions
The computation of the LC filter parameters using a genetic algorithm optimization over a bounded region of values that meet the desired VSI response in a transition from a connected to autonomous MG operation has been presented as a novel alternative to conventional switching frequency-based methodologies. Unlike other methodologies, this proposal works on system measurements and does not need the system parameters to compute the LC filter values, therefore, it can be used in any particular system. The optimization procedure was designed to meet the IEEE Std 519-1992 and IEEE Std 519-2014 standards on harmonic distortion being below 5% and with a maximum of 12% during a period of 3 s respectively. The propose optimization process utilized a total of CPU% of 1.21. A comparison to a calculated LC filter using the switching frequency the main design parameter is done and tested in a modified version of the IEEE 13 node test feeder. The performance of the GA optimized filter results in greater attenuation of the injected THD after the transition event and an improved transition behavior in the MG delivered voltage when compared to a conventional design method. The filter component size, bandwidth of the low-pass filter, and the injected THD are part of the optimization objective function and minimized leading to a greater attenuation of high order harmonics, and improving output voltage signal of the VSI during and after the transition between a connected to autonomous operation of the MG.
directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/.