Robust optimization based harmonic mitigation method in islanded microgrids

Power quality issues in islanded microgrids comprising of various renewable energy sources have recently gained more attention. As the harmonic mitigation capability from distributed energy resources will vary for diﬀerent network topologies, this paper introduces a uniﬁed single-end harmonic mitigation approach using a robust optimization model. In the proposed method, a central controller receives voltage harmonic distortion measurements of all buses in the microgrid, optimizes the global information, and then sends back the optimal voltage harmonic components to the local controller of each distributed generation units, which is added to the voltage reference generated by the respective droop controllers locally. The robustness lies in the design of the objective function in the central controller to solve a multi-attribute optimization problem in minimizing both the average total harmonic distortion (THD) and THD of the critical bus in the microgrid considering diﬀerent coeﬃcients for each term. It has been proved with a set of numerical simulations with diﬀerent parameters that the search space is reduced around the global minima, which considerably reduces the search time and the number of iterations. The results show that the suggested controller is robust and eﬀective with respect to the diﬀerent coeﬃcients of the modiﬁed objective function to mitigate voltage harmonic distortion in islanded microgrids.


Introduction
Nowadays, due to the significant increase of the distributed generation (DG) units along with linear and non-linear loads, the evolution of microgrids has gained considerable attention.As they can be operated in both grid connected and islanded modes, an islanded microgrid consists of DGs and loads, which produces power and prepares its demands apart from the main grid.Although microgrids offer several advantages such as decreasing fossil fuel demands, increasing system reliability, etc, their integration may cause challenges like harmonic distortion, which ultimately affect their performances.The main reasons for the voltage or current harmonic distortion in microgrids are power electronic devices used in DGs and their switching behavior, resonances due to interactions, and non-linear loads existing in microgrids.Hence, in order to reduce total harmonic distortion (THD) in microgrids and meet the harmonic standards like IEEE std 519 [1], significant attention is required to design controllers for the DG units to improve their performance in the presence of non-linear loads [2,3,4].
The active power filters are not particularly new and have been used for many years in the power system to solve power quality issues.However, it is not recommended for microgrids as it could be a costly solution.Hence, researchers have recently tried to implement various control methods in the microgrid hierarchical control structure to reduce voltage harmonic distortion in microgrids.The harmonic mitigation methods used in the microgrids are reviewed in [2].
The harmonic mitigation methods used in the microgrids hierarchical control system can be categorized into primary and secondary groups based on their control levels [2].The most common methods used at the primary level are proportional resonant (PR) controller [5], virtual impedance (VI) based schemes [6,7], and modified droop controllers [8] to mitigate the harmonic distortion of the microgrids.The selective harmonic compensation and THD reduction can be achieved at the point of common coupling (PCC) of the microgrid by using these methods at the primary level.The main drawbacks of using the PR controller as a harmonic compensation tool are the complexity of the design procedure and slow steady state response.In [5] and [9], a virtual impedance approach along with the PR controller is used at the primary level to mitigate voltage harmonic distortion at the PCC.In [10], an improved VI scheme along with the double second order generalized integrator (SOGI), which is used for accurate harmonic extraction is proposed to mitigate THD at PCC of the microgrid.Further, the VI based schemes for harmonic reduction purposes are sensitive to system parameters and need heavy computational burden.It is suggested in [11,12,13,8,14] to modify the conventional droop controller, in which new harmonic terms are added to the conventional droop controller to compensate harmonic distortion in the microgrids.Even though these methods can be used in microgrids with parallel DGs connected to the PCC for harmonic mitigation aims, they can not overcome the power harmonic issues in multi-bus microgrids.Therefore, due to the existing drawbacks of the harmonic mitigation methods at primary level, several secondary controller based methods are reported in the literature to address the harmonic mitigation issues in microgrids.
The secondary controllers can be used for obtaining several goals in harmonic reduction methods such as: extracting and calculating the harmonic components [15,16,17], compensating harmonics [18,19,20,21], virtual parameters calculation like virtual impedance and admittance [22,23], and optimization processes [24].Although the voltage harmonic mitigation in the multi-bus microgrid can be achieved by sending and receiving information from the microgrid central controller, this philosophy has not yet received significant attention [25].Moreover, existing studies have attempted to reduce harmonic distortion only at the critical bus (CB) of the multi-bus microgrid.However, average THD of the system, which has been introduced in [24] as another key metric, needs to be minimized in the multi-bus microgrids.
Even though the authors in [24] have suggested to use particle swarm optimization (PSO) based secondary controller to reduce voltage harmonic distortion of all buses in the multi-bus microgrid, to the best of our knowledge, no previous studies have investigated the proposed and modified objective function in the optimization based secondary controller in order to mitigate both THD of the CB and average THD of the microgrid simultaneously with respect to different coefficients.It must be noted that the optimization based algorithms should be robust to increase accuracy, and reduce searching time.The proposed robust objective function can be used in fractional and integer control process of the microgrids by the microgrid control designers.
In this paper, a robust optimization approach is proposed to mitigate THD of the CB and average THD of the microgrid simultaneously.To reduce both THD of the CB and average THD of the microgrid at the same time, a modified objective function is presented in the PSO based central controller.The main features of the proposed optimization based method for voltage harmonic mitigation in islanded microgrids can be summarized as follows: 1.A robust optimization based method is proposed to reduce voltage harmonic distortion in islanded microgrids, which reduces the search time significantly compared to the traditional optimization techniques.

A modified objective function in which reduction
of THD in the CB and average THD mitigation of the microgrid are combined considering different coefficients is introduced and analyzed.3. A reduced range for the optimization search space is found based on statistical analysis.4. The results show that the proposed harmonic mitigation method can perform effectively while the variables of the objective function are altered, and load variation situations are considered in the multi-bus microgrid.Moreover, harmonic standards can be met by using the proposed approach.

Microgrid Structure
In this section, the microgrid structure including primary and secondary controllers are discussed.As shown in Fig. 1, the considered microgrid includes six buses (b1−b6) along with linear and non-linear loads, two DGs generate power and are interconnected to the network via line impedances (Z 1 to Z 6 ).It is worth notifying that bus number four is chosen as the CB, which have the highest THD in the considered microgrid in this study.
In the following subsections, the hierarchical control of the considered microgrid is described, as shown in Fig. 2.Moreover, the PSO-based secondary controller, which is used as a harmonic mitigation tool is explained.

Primary controller
The power produced by each DG is transmitted to the loads through the LC filter and line impedance, as shown in Fig. 2. The main components of each DG are a primary (local) controller, an inverter, and sinusoidal pulse width modulation (SPWM).
The main controllers used at the primary level of the DGs are current, voltage, and droop controllers, as shown in Fig. 2. The main duty of the primary controller is to provide proper signal for SPWM generation box.Then, the SPWM box can generate the specific signals for firing the inverter switches.
The block diagram of the conventional droop controller, which is used in this study to generate the voltage reference is shown in Fig. 3.The output voltage and current of the DG are measured, and then the active and reactive powers are calculated.The frequency and voltage used as voltage reference generation of i th DG are obtained based on the following droop equation: where ω * i and E * i are the system frequency and the rms value of the rated voltage, respectively.m i and n i are the droop controller parameters.P o and Q o are the reference values for active and reactive powers, respectively.P i and Q i are the calculated active and reactive powers of the DG, respectively.
The droop controller output voltage (v dr ), as shown in Fig. 2 is then added to the voltage harmonics compensation terms, which are injected by the proposed secondary controller to produce the final reference voltage: where |V h,i | and ∠θ h,i denote the amplitude and angle of the harmonic order h in DG i received from the secondary controller, respectively.In this paper, both voltage and current controllers are considered as proportional controllers.The PSO-based secondary controller will be explained in the next subsection.

Secondary controller
In this subsection, the secondary controller used for harmonic mitigation in islanded microgrid is de- scribed.As shown in Fig. 2, the THDs of all buses (N buses) in the microgrid are measured and then sent to the secondary controller.At the secondary level of the hierarchical microgrid control, the optimal voltage amplitudes and angles are produced by using a PSO algorithm, and then sent to the primary controller of each DG in order to add to the droop controller output voltage.
The PSO algorithm is a computational-based approach, which optimizes the position of its particles iteratively using following equations [26]: where v p and x p are the velocity and position of the p th particle, respectively.k is the number of the iterations.The position and velocity in the next iteration (k + 1) are calculated based on the local and global best known positions, which are P k best,p and G best , respectively.P k best,p and G best are the best location of p th particle and best particle location among all the particles up to time t, respectively.c 1 and c 2 are the acceleration values, which are constants in all iterations and normally have the value between 0.5 and 2. r 1 and r 2 are the random values between 0 and 1. a is the inertia weight factor [27,28].
In the proposed PSO-based approach, the particles are the amplitudes and angles of the voltage harmonics, which can be optimized at the secondary level of the microgrid.As shown in the flow-chart in Fig. 4, number of particles are first generated randomly.Then, these particles are injected into the primary controller of each DG and the THD of the all buses are measured and transferred to the secondary controller.The local and global best positions are selected based on the information captured at the secondary level.Each particle is applied for ∆t seconds until the microgrid reaches to its steady state con- dition.To meet the termination criteria, and find the best position in the search area, the PSO-based approach is applied to the microgrid for the j iterations.In this study, the optimization algorithm is terminated when the measured THD is less than the standard value of THD.

Proposed robust objective function
The objective of this paper is to propose a robust objective function assisted PSO based secondary controller to reduce both THD of the CB and average THD of the microgrid simultaneously.To achieve this, the objective function is given by: min a 1 THD b1 cr + a 2 THD b2 avg (5) where THD cr and THD avg are the THD of the CB and average THD of the microgrid, respectively.a 1 , a 2 , b 1 , and b 2 are the objective function coefficients and orders.The THD of the n th bus can be obtained as follows: Furthermore, the average THD of the microgrid can be calculated as follows: where N is the total number of buses.Therefore, the THD of the CB and average THD of the microgrid used in ( 5) can be calculated based on ( 6) and (7).Finally, the overall objective function and its constraints can be determined as follows: where THD * is the standard value of THD in harmonic standards such as IEEE std 519 [1].Both THD of the CB and average THD of the microgrid can be minimized by using the proposed objective function in (8) applied in PSO-based secondary controller of the microgrid.It is shown that the proposed method is a robust and accurate optimization based method to use in harmonic mitigation purposes in microgrids, in this section.The simulation results of the proposed method will be presented in next section in order to validate the effectiveness of the proposed approach.

Simulation results
In order to show the performance and effectiveness of the proposed method, the simulation results for the THD orders and coefficients, and the results under load change situations are demonstrated in this section.The considered islanded microgrid shown in Fig. 1 is implemented in the MATLAB/Simulink environment.Two 3 kW inverters are used in the DGs to produce power.The microgrid parameters are given in Table 1.The linear and non-linear loads are resistors (R LL ) and the resistor R N LL , which is in parallel  As discussed earlier, the main aim of the proposed approach is to reduce both THD of the CB and average THD of the microgrid considering the variables and constraints given in (8) by injecting the voltage harmonics optimized in the secondary controller of the microgrid.In the following subsections, the variables used in (8) are analyzed and determined.Moreover, the statistical analysis of these variables, and the performances of the proposed approach under load change situations are considered and discussed.

Analysis of THD orders
The simulation results for different values of b 1 and b 2 are shown in Figs. 5 and 6, respectively.Figs.5(a  Furthermore, the objective function and its constraint applied in the secondary controller of the microgrid to reduce average THD of the microgrid are as follows: It is observed that the proposed PSO-based approach can be used effectively to mitigate THD of the CB and average THD of the microgrid considering different order values between 0.1 and 3.The    and b 2 will be discussed in the next subsection in order to show that the smaller variation range is needed for numerical efficiency.It is not suggested to choose the value less than 0.1 since smaller variation range introduces numerical issues and also it makes hard to mitigate the voltage harmonic distortion since the values of THD before and after applying the proposed method would be too close to each other.The values of THD b1 cr and THD b2 avg are shown in Table 2 for different values of b 1 and b 2 before and after applying the proposed method, which are stated as real and last values in this table.It can be seen that the proposed method can be effectively reduced both THDs.

Analysis of THD coefficients
In this subsection, the results for different values of a 1 and a 2 (THD coefficients) are shown and discussed.As discussed and concluded in the last subsection, it is recommended to choose b 1 and b 2 equal to 0.1 to reduce the search area and increase accuracy.Therefore, the results for only two values of these orders, which are 1 and 0.1, are shown in Figs.7 and 8.Moreover, the results for equal values of a 1 and a 2 with b 1 = b 2 = 0.1 are shown in Fig. 9.
The simulation results for the values of a 1 and a 2 between 0.1 and 1.5 are shown in Fig. 7, in    8.It is shown that the objective function determined in (8) and its constraints can be met for different values of a 1 and a 2 by using the proposed approach.Moreover, a 1 THD 0.1 cr + a 2 THD 0.1 avg increase gradually with the increase in the coefficient values.
To briefly conclude this subsection, the simulation results for the proposed objective function determined in (8) with different values of a 1 and a 2 show that the robust objective function with respect to its constraints can be used at the secondary controller of the multi-bus microgrid to reduce voltage harmonic distortion.Moreover, the simulation results for wide ranges of a 1 and a 2 are shown in Figs. 7, 8, and 9, which are between 0.1 and 3. Therefore, the weighted THD can be achieved by changing the value of a 1 and a 2 .For example, in the situation that the THD of the CB is much more than the other buses, the value of a 1 , which is the weight for THD cr can be chosen larger than a 2 .Moreover, the best value for THD orders b 1 and b 2 are determined based on the simulation results.It is shown that smoother harmonic distortion can be achieved by using smaller value of b.Further-   more, it is observed that the proposed approach can be used for wide range of THD coefficients a 1 and a 2 .Finally, it can also be concluded that the robust optimization based method can reach the global optimum quickly and accurately.In the next subsection, the simulation results for load change situations are shown.
The values of a 1 THD b1 cr + a 2 THD b2 avg are shown in Table 3 for different values of coefficients before and  after applying the proposed method, which are stated as real and last values in this table.It can be seen that the proposed method can be effectively reduced the THD calculated in (8).

Statistical analysis of variables
There are two terms in the proposed objective function in (8), which are a 1 THD b1 cr and a 2 THD b2 avg .The results for these two terms considering different values of a 1 , a 2 , b 1 and b 2 are shown in Fig. 10.It should be mentioned that the best values for both terms in (8), which meet the objective function requirement are the lowest value in each optimization process.
As shown in Fig. 10, the increase in a coefficients and b orders of the two terms lead to the increase in the area of the search for the PSO algorithm.For instance, the search area for a 1 = a 2 = 3 and b 1 = b 2 = 1 is about 14 percent.It means that the PSO algorithm should search in this area to achieve the objective function determined in (8).However, the search area for a 1 = a 2 = 3 and b 1 = b 2 = 0.1 is less than 0.5 percent, which is much less than for b 1 = b 2 = 1.Therefore, the search space is significantly reduced wherein the global optimum lies to minimize both THD of the CB and average THD of the microgrid.
For a better understanding, the simulation results for a given a 1 and a 2 are shown in Fig. 11.It is  obvious that with the increase in b orders the search area for the PSO algorithm is wider.Moreover, the proposed algorithm can be used for the coefficients of parameter a in a wide range.It is also observed that the modified objective function can reach global optimum quickly and also accurately when the values of b are decreased.Hence, the search area would be reduced and an accurate optimal solution can be achieved by using the robust objective function in the PSO-based secondary controller.Figure 12: Load change scenarios.

Load change situations
The analysis of the proposed objective function has been carried out in this subsection for two load change situations.The resistance R N LL of nonlinear load, which is in parallel with the three-phase diode rectifier has been changed from 55 Ω to 45 Ω and 35 Ω for the two cases.As discussed earlier, the value of b 1 and b 2 are equal to 0.1 in order to have a smaller search area and therefore, reduce the search time and number of iterations.The simulation results for the two cases are shown in Fig. 12.
As it can be seen from Fig. 12, the proposed approach can be applied to the islanded microgrids in order to mitigate the harmonic distortion according to the robust objective function in (8) under load changes.Before the microgrid load has been changed, the proposed approach applied to mitigate both THD of the CB and average THD of the microgrid with a 1 = a 2 = 1.For the next two load changes, the value of a 2 is changed from 1 to 0.5 in order to show that the robust optimization based harmonic mitigation method can meet the harmonic standard criteria with different coefficients used for the two terms in (8).It means that the weighted factor of the THD cr is two times of the THD avg .The simulation results in Figs.12(a) and 12(b) are proving that the proposed robust approach can be applied to the microgrid to reduce THD cr and THD avg simultaneously even in the worst case load scenarios like in the second load change situation.

Communication Delay Analysis
In this subsection, a time delay, which is, for simplicity, chosen as a fraction of the sampling time is used for the input signals of the secondary controller.It means that the outputs, which are THDs in this paper, are sent to the secondary controller with a time delay.Hence, the value of THD during the time delay is considered zero.In other words, the secondary controller will receive the information with a delay of 0.08 s through the communication links.Hence, the THD is considered zero, when time delay is applied since the information to calculate the THD and as a result, value of THD are not received through the communication links.Furthermore, it should be mentioned that the optimization algorithm is inactive, when the time delay is applied.The time delay is considered 1/4, 2/4, 3/4, 1 and 2 times of the sampling time, which is 0.04 s.The results for the THD calculated in (8) 4. In this table, the value of THD calculated in (8) with and without the proposed method for both cases,  13(a) and Fig. 13(b), respectively.The effectiveness of the proposed method to reduce THD for worst case scenario, which is the time delay of 0.08 s in this paper, is shown in these figures.It can be seen that the proposed approach can effectively reduce THD with and without delay.It is evident that the proposed method can reduce THD calculated in (8) for both

Discussion
The proposed objective function with its constraints are defined in (8).The suggested objective function can be used in the optimization-based secondary controller of the microgrids to reduce the THD of the CB and average THD of the multi-bus microgrid simultaneously.There are four variables a 1 , a 2 , b 1 and b 2 to be used in the proposed objective function, which can be used in the wide range.It is suggested to use small b variables (b 1 and b 2 ) (e.g.0.1) according to the simulations and statistical analysis to reduce the search area of the optimization algorithm, increase the accuracy, and have a better THD response.
The a variables (a 1 and a 2 ), which are the coefficients of the THD terms can be considered as the weighting factors for each term.Therefore, the THD of the CB and average THD of the microgrid can have different weights in different situations.In this paper, the range of weighting factors is considered [0.1, 3].It is obvious that the increase in the proposed objective function variables (both a and b) would increase the value of THD combinations.
In this paper, the simulation and statistical analysis for different situations of the proposed objective function are discussed.The results show that the robust optimization approach can mitigate both THD of the CB and average THD of the microgrid simultaneously in multi-bus islanded microgrids.As secondary controllers usually operates in seconds, it is important to have a fast and yet accurate optimal solution, which is ensured by using the robust optimization approach at the secondary level of the microgrid.For the practical implementation, a look-up table can be created based on the pre-obtained optimal particles and calculate the sample distances for every iteration in the optimization search space.It that the current particles during the operation, which is close to the best answer can be found and stored, and then calculate the sample distance.Therefore, pre-calculated optimized points using K nearest neighbor or simpler sample distance calculation to each pre-calculated optimized point can be applied to the real-time system.

Conclusion
A robust optimization-based method, in which a modified objective function is used in the optimization algorithm is proposed in this paper to reduce harmonic distortion in the multi-bus islanded microgrid.The modified objective function suggests four possibilities for parameters to be tuned.Therefore, the microgrid control designers have more possibilities for reducing harmonic distortion in the large microgrids.
The effects of these four variables on the proposed harmonic mitigation method are explored in this paper.The detailed simulation studies and statistical analysis are carried out for a multi-bus islanded microgrid.The results show that the THD of the critical bus and average THD of the multi-bus microgrid are reduced simultaneously by using the proposed robust optimization-based approach along with the modified objective function, as well as they can meet the harmonic standards like IEEE 519 standard.Moreover, the reduced range of the four variables are found and discussed.It has been proved with a set of numerical simulations with different parameters that the search space of the optimization algorithm is reduced around the global minima by using the proposed approach.Therefore, the search time and number of iterations can be reduced significantly.Although the PSO-based secondary controller along with the modified objective function is used in this paper, other population based algorithms can be applied at the secondary level in future work.Moreover, the application of the robust approach can be studied in the multi-bus multi-inverter microgrids in the future.

Figure 2 :
Figure 2: Primary and secondary controllers of the considered microgrid.

Figure 3 :
Figure 3: Block diagram of the conventional droop controller shown in Fig. 2.

Figure 4 :
Figure 4: The flow-chart of the PSO algorithm used at the secondary level of the microgrid control[24].

5 Rated
mH, C = 22 µF Line Impedances (Z 1 − Z 6 ) R L = 0.8 Ω, L L = 2 mH Primary controller parameters Values Current and Voltage Controller k pi = 20, k pv = 5 Droop Controller m i = 1 × 10 −3 , n i = 5 × 10 −R N LL = 55 Ω Secondary controller parameters Values PSO Parameters c 1 = 2, c 2 = 1, a = 0.99 with the three-phase diode rectifier, respectively.It means that the diode rectifier is used to feed a load represented by the resistor R N LL The CB, which is bus number four is shown in Fig. 1.The particles are injected for ∆t = 0.04 s in each iteration.
) and 6(a) show all the different values for b 1 and b 2 between 0.1 and 3, respectively.To have a better look, the results for the values of b 1 and b 2 between 0.1 and 1 are shown in Fig. 5(b) and 6(b), respectively.The results before and after applying the proposed method and as well as for the steady state condition are shown in Figs. 5 and 6.The objective function and its constraint used in the secondary controller to mitigate the THD of the CB are as follows: min THD b1 cr s.t.THD b1 cr < THD * b1(9)(a) b1 between 0.1 and 3. (b) b1 < 1. (c) b1 = 0.1.

Figure 5 :
Figure 5: Reduction of THDcr for different values of b1.

Figure 6 :
Figure 6: Reduction of THDavg for different values of b2.
the smaller values for b 1 and b 2 can reduce the search and increase accuracy.More results and reasons to choose smaller values for b 1

which b 1
and b 2 are equal to 1.It is observed that the PSO-based secondary controller along with the robust objective function, which is determined in (8) can reduce both THD cr and THD avg of the microgrid considering different coefficient values.Moreover, a 1 THD cr +a 2 THD avg obviously increase dramatically with the increase in the coefficient values.Moreover, the global optimum can be achieved quickly by using the robust optimization based harmonic mitigation method.Similar figures can be obtained for different values of a 1 and a 2 with b 1 = b 2 = 0.1, as shown in Fig.

a 1 = 1 and a 2 a 1 and a 2 Figure 10 :
Figure 10: The values of two terms in (8) for different values of a1, a2, b1 and b2.

Figure 11 :
Figure 11: The values of two terms in (8) for different values of a1 and a2.
(a) Results for reduction of both THD 0.1 cr and THD 0.1 avg .(b) Results for a1THD 0.1 cr + a2THD 0.1 avg .
with a 1 = a 2 = 1, b 1 = b 2 = 0.1 and b 1 = b 2 = 1 are given in Table a 1 = a 2 = 1, b 1 = b 2 = 0.1 and a 1 = a 2 = 1, b 1 = b 2 = 1, are given in two situations; with and without time delay.It should be noted that the time delay starts at 0.2 s during the performance of the microgrid.It can be seen that the THD can be reduced by using the proposed approach properly even in the presence of the time delay.It should also be mentioned that the greater the time delay would result in the greater time to meet the objectives of PSO optimization algorithm.Moreover, the application of the proposed method in two situations; with and without time delays for both cases, a 1 = a 2 = 1, b 1 = b 2 = 0.1 and a 1 = a 2 = 1, b 1 = b 2 = 1, are shown in Fig.

Table 1 :
System, Controllers and Load Parameters

Table 2 :
THD b1 cr and THD b2 avg for different values of b1 and b2 b 1 and b 2

Table 4 :
THD values (%) for different time delaysWithout delay Time Delay as a fraction of Ts (s)