A New LCL Filter Design Method for Single-Phase Photovoltaic Systems Connected to the Grid via Micro-Inverters

: This paper aims to propose a new sizing approach to reduce the footprint and optimize the performance of an LCL ﬁlter implemented in photovoltaic systems using grid-connected single-phase microinverters. In particular, the analysis is carried out on a single-phase full-bridge inverter, assuming the following two conditions: (1) a unit power factor at the connection point between the AC grid and the LCL ﬁlter; (2) a control circuit based on unipolar sinusoidal pulse width modulation (SPWM). In particular, the ripple and harmonics of the LCL ﬁlter input current and the current injected into the grid are analyzed. The results of the Simulink simulation and the experimental tests carried out conﬁrm that it is possible to considerably reduce ﬁlter volume by optimizing each passive component compared with what is already available in the literature while guaranteeing excellent ﬁltering performance. Speciﬁcally, the inductance values were reduced by almost 40% and the capacitor value by almost 100%. The main applications of this new design methodology are for use in single-phase microinverters connected to the grid and for research purposes in power electronics and optimization.


Introduction
Solar energy is transformed into electrical energy using photovoltaic panels (PVs).This electrical energy is then connected to the grid or isolated loads through power converters.This collection of components is known as a photovoltaic system [1][2][3][4][5][6].The basic block diagram of a typical single-phase PV is shown in Figure 1.This system consists of a photovoltaic panel, a DC-DC converter, a link capacitor between the DC-DC converter and the inverter, an output filter, and the grid [4,7].The blocks shown are those present in a commercial PV system.This work is focused on the design of the output LCL filter.
This paper analyzes the LCL filter using phasor analysis for the fundamental harmonic and an nth harmonic.The analysis considers the ripple percentage at the input and output of the LCL filter.The value of the inductors and capacitors are based on two parameters called Alpha (α), where alpha is the ratio between the reactance of the inductor L 1 and the reactance of the filter capacitor LCL (C f ) and Beta (β), where Beta is the ratio between the values of L 1 and L 2 .These parameters are the ones that are optimized, resulting in reactance of the filter capacitor LCL (Cf) and Beta (β), where Beta is the ratio between the values of L1 and L2.These parameters are the ones that are optimized, resulting in the minimum and optimum values of the capacitor and inductors.These analysis and optimization methods are not found in the literature at present; therefore, they constitute the main contribution of this paper.The main applications of this research are photovoltaic systems connected to the grid that can be used in microgrids [25].The main limitations of this work are that the method can only be used in single-phase systems connected to the grid and that it cannot be used for three-phase systems and isolated systems.
The theoretical calculations were validated with simulations in SIMULINK and experimentally.The paper is organized as follows: Section 2 presents the proposed mathematical analysis of the LCL filter.Section 3 presents the proposed optimization method.The simulation results are presented in Section 4. Section 5 presents the experimental validation.Section 6 presents a discussion of the traditional methods for calculating the LCL filter [8,11,[26][27][28][29] and the methodology proposed in this paper.Finally, the conclusions are shown in Section 7.

DC-DC Converter Inverter
Cli nk

LCL Filter Mathematical Analysis
The analyzed system uses an LCL filter, connected to a single-phase full bridge inverter and the grid as shown in Figure 2. The SPWM modulation activates and deactivates the gates that make up the full bridge inverter.The generated signal passes through the LCL filter, which is used to reduce the harmonics of the current to be injected into the grid.

Mathematical Analysis of the LCL Filter for the Fundamental Component
One previous analysis of this type was performed for an L-filter connected to the grid and was published in [4].In this paper, to analyze the performance of the LCL filter, a Fourier The theoretical calculations were validated with simulations in SIMULINK and experimentally.The paper is organized as follows: Section 2 presents the proposed mathematical analysis of the LCL filter.Section 3 presents the proposed optimization method.The simulation results are presented in Section 4. Section 5 presents the experimental validation.Section 6 presents a discussion of the traditional methods for calculating the LCL filter [8,11,[26][27][28][29] and the methodology proposed in this paper.Finally, the conclusions are shown in Section 7.

LCL Filter Mathematical Analysis
The analyzed system uses an LCL filter, connected to a single-phase full bridge inverter and the grid as shown in Figure 2. The SPWM modulation activates and deactivates the gates that make up the full bridge inverter.The generated signal passes through the LCL filter, which is used to reduce the harmonics of the current to be injected into the grid.called Alpha (α), where alpha is the ratio between the reactance of the inductor L1 and the reactance of the filter capacitor LCL (Cf) and Beta (β), where Beta is the ratio between the values of L1 and L2.These parameters are the ones that are optimized, resulting in the minimum and optimum values of the capacitor and inductors.These analysis and optimization methods are not found in the literature at present; therefore, they constitute the main contribution of this paper.The main applications of this research are photovoltaic systems connected to the grid that can be used in microgrids [25].The main limitations of this work are that the method can only be used in single-phase systems connected to the grid and that it cannot be used for three-phase systems and isolated systems.The theoretical calculations were validated with simulations in SIMULINK and experimentally.The paper is organized as follows: Section 2 presents the proposed mathematical analysis of the LCL filter.Section 3 presents the proposed optimization method.The simulation results are presented in Section 4. Section 5 presents the experimental validation.Section 6 presents a discussion of the traditional methods for calculating the LCL filter [8,11,[26][27][28][29] and the methodology proposed in this paper.Finally, the conclusions are shown in Section 7.

DC-DC Converter Inverter
Cli nk

LCL Filter Mathematical Analysis
The analyzed system uses an LCL filter, connected to a single-phase full bridge inverter and the grid as shown in Figure 2. The SPWM modulation activates and deactivates the gates that make up the full bridge inverter.The generated signal passes through the LCL filter, which is used to reduce the harmonics of the current to be injected into the grid.
Grid-connected full bridge inverter with an LCL filter.

Mathematical Analysis of the LCL Filter for the Fundamental Component
One previous analysis of this type was performed for an L-filter connected to the grid and was published in [4].In this paper, to analyze the performance of the LCL filter, a Fourier

Mathematical Analysis of the LCL Filter for the Fundamental Component
One previous analysis of this type was performed for an L-filter connected to the grid and was published in [4].In this paper, to analyze the performance of the LCL filter, a Fourier analysis was performed to identify each of the harmonics in the inverter output voltage.Figure 3 shows a flow chart describing step by step how the mathematical analysis with the fundamental and n-harmonics is organized.analysis was performed to identify each of the harmonics in the inverter output voltage Figure 3 shows a flow chart describing step by step how the mathematical analysis with the fundamental and n-harmonics is organized.First, the circuit is analyzed for the fundamental harmonic at the frequency of the grid and after for the next harmonic that appears according to the modulation technique of the output inverter.For the fundamental harmonic, the simplified circuit to be analyzed is shown in Figure 5. First, the circuit is analyzed for the fundamental harmonic at the frequency of the grid and after for the next harmonic that appears according to the modulation technique of the output inverter.For the fundamental harmonic, the simplified circuit to be analyzed is shown in Figure 5. Vi is the phasor of the fundamental harmonic at the LCL filter input, Iinv is the phasor of the LCL filter input current, Ig is the phasor of the grid current, Vg is the phasor of the grid voltage, and XL1 and XL2 are the inductive reactances of the inverter-side inductor (L1) and the grid-side inductor (L2).XCf is the capacitive reactance of the filter capacitor (Cf).Filter input voltage and grid voltage are defined as shown in Equations ( 1) and (2).
where Vi is the peak voltage magnitude of the phasor Vi at LCL filter input, ϕi is the phase angle caused by the LCL filter in the inverter voltage, Vg is the peak grid voltage magnitude, and 0° is the grid reference angle for a unity power factor connection.The reactances of each element of the LCL filter are defined as shown in Equations ( 3)-(5).
where ω is the grid angular frequency.The impedances of each element of the LCL filter are defined as shown in Equations ( 6)- (8).
where ZL1 is the impedance of inductor L1, j is the imaginary number, ZCf is the LCL filter capacitor impedance, and ZL2 is the impedance of the grid side inductor.Applying the superposition theorem to the circuit shown in Figure 3 results in the circuit shown in Figure 6.V i is the phasor of the fundamental harmonic at the LCL filter input, I inv is the phasor of the LCL filter input current, I g is the phasor of the grid current, V g is the phasor of the grid voltage, and X L1 and X L2 are the inductive reactances of the inverter-side inductor (L 1 ) and the grid-side inductor (L 2 ).X Cf is the capacitive reactance of the filter capacitor (C f ).Filter input voltage and grid voltage are defined as shown in Equations ( 1) and (2).
where V i is the peak voltage magnitude of the phasor V i at LCL filter input, φ i is the phase angle caused by the LCL filter in the inverter voltage, V g is the peak grid voltage magnitude, and 0 • is the grid reference angle for a unity power factor connection.The reactances of each element of the LCL filter are defined as shown in Equations ( 3)-(5).
where ω is the grid angular frequency.The impedances of each element of the LCL filter are defined as shown in Equations ( 6)- (8).
where Z L1 is the impedance of inductor L 1 , j is the imaginary number, Z Cf is the LCL filter capacitor impedance, and Z L2 is the impedance of the grid side inductor.Applying the superposition theorem to the circuit shown in Figure 3 results in the circuit shown in Figure 6.Solving the circuit on the left, which is fed by the peak voltage of the fundamental harmonic of the output in unipolar SPWM modulation, XL2 and XCf are in parallel.Solving the parallel is shown in Equation ( 9).
Applying voltage divider on the Zeq.This is shown in Equation (10).
where VCf is the voltage phasor in the parallel formed by XL2 and XCf.The current to be injected into the grid of the left-hand side (Ig1) circuit is solved using Equation (11).
Solving the LCL filter for the right side of Figure 4. ZL1 and ZCf are in parallel, solving the parallel.This is shown in Equation (12).
Solving for grid current from the right-hand side (Ig2) of the circuit.This is shown in Equation (13).
Adding ( 11) and ( 13), Equation ( 14) is obtained, which is the total current injected into the grid at the fundamental harmonic (Ig).Solving the circuit on the left, which is fed by the peak voltage of the fundamental harmonic of the output in unipolar SPWM modulation, X L2 and X Cf are in parallel.Solving the parallel is shown in Equation ( 9).
Applying voltage divider on the Z eq .This is shown in Equation (10).
where V Cf is the voltage phasor in the parallel formed by X L2 and X Cf .The current to be injected into the grid of the left-hand side (I g1 ) circuit is solved using Equation (11).
Solving the LCL filter for the right side of Figure 4. Z L1 and Z Cf are in parallel, solving the parallel.This is shown in Equation (12).
Solving for grid current from the right-hand side (I g2 ) of the circuit.This is shown in Equation ( 13).
Adding ( 11) and ( 13), Equation ( 14) is obtained, which is the total current injected into the grid at the fundamental harmonic (I g ).

Mathematical Analysis of the LCL Filter for a Harmonic n
An LCL filter analysis was performed for any harmonic n.The circuit to be analyzed is shown in Figure 7.The analysis omits the grid voltage since the grid provides only the fundamental harmonic.

Mathematical Analysis of the LCL Filter for a Harmonic n
An LCL filter analysis was performed for any harmonic n.The circuit to be analyzed is shown in Error!Reference source not found.Figure 7. The analysis omits the grid voltage since the grid provides only the fundamental harmonic.The reactances of each LCL filter element for Figure 5 are defined as shown in the following (Equations ( 15)-( 17)).
where XL1n is the inductive reactance for a harmonic n in the inductor L1, ωn is the angular frequency for a harmonic n, XCfn is the capacitive reactance for a harmonic n in the LCL filter capacitor, and XL2n is the inductive reactance for a harmonic n in the grid side inductor.Defining the filter input voltage and the grid voltage, this is shown in Equation ( 18) where Vin is the phasor of the LCL filter input voltage for one harmonic n, Vin is the Peak magnitude of the LCL filter input voltage for one harmonic n, ϕn is the phase angle of the LCL filter input voltage for one harmonic n.
The impedances of each element of the LCL filter for Figure 5 are defined as shown in Equations ( 19)-( 21).
Figure 5 shows that ZCfn and ZL2n are in parallel, solving the given Equation (22).The reactances of each LCL filter element for Figure 5 are defined as shown in the following (Equations ( 15)-( 17)).
where X L1n is the inductive reactance for a harmonic n in the inductor L 1 , ω n is the angular frequency for a harmonic n, X Cfn is the capacitive reactance for a harmonic n in the LCL filter capacitor, and X L2n is the inductive reactance for a harmonic n in the grid side inductor.Defining the filter input voltage and the grid voltage, this is shown in Equation ( 18) where V in is the phasor of the LCL filter input voltage for one harmonic n, V in is the Peak magnitude of the LCL filter input voltage for one harmonic n, φ n is the phase angle of the LCL filter input voltage for one harmonic n.
The impedances of each element of the LCL filter for Figure 5 are defined as shown in Equations ( 19)- (21).
Figure 5 shows that Z Cfn and Z L2n are in parallel, solving the given Equation (22).
where Z eq3 is the equivalent impedance of the parallel between Z Cfn and Z L2n .The inverter side current for one harmonic n in the LCL filter is calculated using Equation ( 23) Substituting ( 19) and ( 22) into Equation ( 23), it results in (24).
where I invn is the phasor of the inverter-side current for one harmonic n.The magnitude of Equation ( 24) is shown in (25).
where I invn is the peak magnitude of the inverter-side current for harmonic n.The maximum grid current of the fundamental harmonic (I g ) is defined by Equation ( 26).For a unity power factor.
where P avg is the average power in the connection point.The current ripple at the input of the LCL filter (%r inv ) is approximately equal to Equation ( 27) as shown in [4].The current ripple analyzed in this paper is the L 1 ripple, as most of the articles are the proposed current ripple [30][31][32] Substituting ( 25) and ( 26) into (27), Equation ( 28) results in the following:

Mathematical Analysis to Calculate LCL Filter Elements
Defining the Alpha and Beta parameters shown in Equations ( 29) and (30).
where α is the ratio between X L1n and X Cfn and β is the ratio between inductors L 1 and L 2 .
The reactance of L 1 as a function of Alpha is shown in Equation ( 31) By subtracting X L2n from Equation ( 30), the result is (32).
By subtracting C f from Equation ( 34), the result is shown in Equation (35).

Resonance Frequency
In most articles [8,28,33,34], the resonant frequency for the LCL filters is reported.Equation (39) shows how to calculate the resonant frequency using an LCL filter.
According to the literature [9,26,33], the resonant frequency must satisfy the condition shown in (41).

DC Bus Calculation
Solving for the V i of Equation ( 14).This is shown in (42).
where γ is the ratio of the angular frequency of a harmonic n to the angular frequency of the fundamental harmonic.Combining (45) into Equation ( 44) results in ( 46): The modulation index (m) relates the DC bus voltage (V dc ) and the input voltage (V i ) of the fundamental harmonic in the LCL filter [35,36].This is shown in Equation (47).
Substituting V i and clearing V dc from Equation ( 47) results in Equation (48).
where α 0 is the constant DC term, α n is the Fourier cosine coefficient, and b n is the Fourier sine coefficient.A unipolar SPWM modulation only has b n components, and the harmonics after the fundamental appear at double the switching frequency and are odd [38][39][40].This is shown in Equation (50).
where n is the harmonic order and α i is the ith switching angle.With the Fourier analysis performed in [41][42][43], the harmonics of the highest magnitude after the fundamental are located at n = 2f sw − f g and n = 2f sw + f g , where f sw is the switching frequency and f g is the grid frequency.Evaluating (49) and (50) for the n harmonic, the relationship shown in Equation (51) is established.
V in is the input voltage of the LCL filter at harmonic n; m n is a ratio of V dc and V in .m n has a direct relationship to the modulation index (m).This value can be obtained from Equation (50).The calculated values are shown in Table 1.

(56)
With Equation (56), it is possible to calculate the dc bus level as a function of the Alpha, Beta, and Gamma parameters, the grid voltage (V g ), the percentage of ripple current (%r inv ) on the inverter side, the m n parameter, and the modulation index (m).Substituting Equation (56) in Equation (51) results in (57).
Equation ( 57) is evaluated for different values of Alpha and Beta.The values obtained from Equation (57) are substituted into Equations ( 35)- (37), which correspond to the LCL filter elements.

Attenuation Coefficient to Determine Beta
To calculate the grid side inductor (L 1 ), some papers [10,44,45] use the parameter (K a ) attenuation coefficient, which is defined as the ratio of the grid side current to the inverter side current at the n-harmonic.This is shown in Equation (58).
where r is the relationship between L 2 and L 1 , ω sw is the angular frequency of commutation and K a is the attenuation coefficient.Figure 6 shows the relation between K a , y, and r.
Figure 8 shows that to have a lower attenuation coefficient, the beta should be close to 1.In this work, the beta chosen in this paper-β-is the ratio of L 1 and L 2 .Therefore, β is the inverse of r.This is shown in Equation (59).In this paper, the parameter beta will be equal to 1.

Design and Optimization of an LCL Filter Connected to the Grid
To validate the above equations, a step-by-step design methodology is proposed in this work.The design specifications are based on the information shown in Table 2.Where it is shown that the frequency fn = 2fsw -fg, as explained in Section 2.3 of this paper and in Equations ( 49) and (50).A design and optimization of the LCL filter are proposed under the specifications shown in the following table.Table 3 shows the step-by-step design methodology for the inverter and LCL filter.

Design and Optimization of an LCL Filter Connected to the Grid
To validate the above equations, a step-by-step design methodology is proposed in this work.The design specifications are based on the information shown in Table 2.Where it is shown that the frequency f n = 2f sw -f g , as explained in Section 2.3 of this paper and in Equations ( 49) and (50).A design and optimization of the LCL filter are proposed under the specifications shown in the following table.Table 3 shows the step-by-step design methodology for the inverter and LCL filter.Step Parameter Symbol Equation Inverter output voltage on harmonic n

5
Filter capacitor Equation ( 56) was evaluated using the data from Table 2 to obtain the value of the DC bus.This is shown in Figure 9.
Step Parameter Symbol Equation 1DC bus voltage

Step 1. Vdc Calculation
Equation ( 56) was evaluated using the data from Table 2 to obtain the value of the DC bus.This is shown in Figure 9Error!Reference source not found..  Figure 9 shows a curve that is asymptotic at 200 V. Therefore, this would be the minimum value of the voltage on the DC bus.

Step 2. V in Calculation
Equation (57) was evaluated using the data from Table 2 to obtain the value of the DC bus.This is shown in Figure 10.
Figure 10 shows that v in as a function of alpha is asymptotic at 56.4 V.This can be shown by substituting the dc bus value (see Figure 7) into Equation (51) with a modulation index of 0.9, which results in (0.282) × (200 V) = 56.4V.
Figure 9 shows a curve that is asymptotic at 200 V. Therefore, this would be the minimum value of the voltage on the DC bus.

Step 2. Vin Calculation
Equation (57) was evaluated using the data from Table 2 to obtain the value of the DC bus.This is shown in Figure 10. Figure 10 shows that vin as a function of alpha is asymptotic at 56.4 V.This can be shown by substituting the dc bus value (see Figure 7) into Equation (51) with a modulation index of 0.9, which results in (0.282) × (200 V) = 56.4V.

Step 3. Inductance L1 Calculation
Referring to Figure 8, r is selected as equal to 1 to ensure the lowest attenuation factor (Ka). Equation ( 37) is evaluated for β = 1 and different values of alpha.The graph is shown in Figure 11.Using a Pareto optimal point at alpha = 3.29, a value of L1 equal to 10.68 mH is obtained.

Step 4. Inductance L2 Calculation
Equation ( 38) is evaluated for β = 1 and different values of alpha.The same graph is shown in Figure 11.Using a Pareto optimal point at alpha = 3.29, a value of L2 equal to 10.68 mH is obtained.

Step 5. LCL Filter Capacitor Calculation (Cf)
Equation ( 35) is evaluated for β = 1 and different values of alpha.Using the alpha obtained in L1 and L2 results in Cf equal to 0.0269 µF.This is shown in Figure 12.

Step 4. Inductance L 2 Calculation
Equation ( 38) is evaluated for β = 1 and different values of alpha.The same graph is shown in Figure 11.Using a Pareto optimal point at alpha = 3.29, a value of L 2 equal to 10.68 mH is obtained.

3.5.
Step 5. LCL Filter Capacitor Calculation (C f ) Equation ( 35) is evaluated for β = 1 and different values of alpha.Using the alpha obtained in L 1 and L 2 results in C f equal to 0.0269 µF.This is shown in Figure 12.  Figure 10 shows that the higher the alpha, the higher the capacitor value of the LCL filter increases linearly.It also shows a comparison between the value calculated with the equation published in [12,13,17,26] and the value calculated with the equation proposed in this work.The values obtained for alpha, beta L1, L2, and Cf are shown in Table 4. Figure 10 shows that the higher the alpha, the higher the capacitor value of the LCL filter increases linearly.It also shows a comparison between the value calculated with the equation published in [12,13,17,26] and the value calculated with the equation proposed in this work.The values obtained for alpha, beta L 1 , L 2 , and C f are shown in Table 4. Equation ( 40) was evaluated using the data obtained in Table 4.A resonance frequency of 15.54 KHz was obtained.

Step 7. Calculation of Link Capacitor (C f )
The equation published in [4] is used to calculate the required link capacitor (C link ).This is shown in Equation (60).
where φ i is the phase angle required in SPWM modulation to ensure connection to the grid with a unity power factor.∆V dc is the proposed DC bus voltage ripple.The angle φ i is the phase obtained from Equation (42) as shown in (61).
Substituting Equation ( 61) into (60) gives the expression shown in Equation ( 62), which is used to calculate the required link capacitor as a function of the value of the LCL filter elements and the phase shift caused by the LCL filter.This phase shift is compensated by the closed-loop control to obtain the connection to the grid with a unity power factor.
Regarding the data in Tables 2 and 4, assuming a voltage ripple of 29 V pp or 14.5% results in a link capacitor equal to 45.78 µF.

Simulation Results
To verify the performance of the design, a closed-loop simulation was performed with Simulink software version 9.0.The block diagram is shown in Figure 13, where the LCL filter is connected to the inverter and the grid.The control is performed using a phase-locked-loop (PLL) with a proportional resonant (PR) current controller.Figure 11 shows the block diagram of the implemented control.The grid voltage is sensed by the PLL to calculate the angle to be implemented in the modulation.The reference current is 1 A, which is compared with the error current to obtain the error to be introduced to the controller.The schematic of the inverter is shown in Figure 14.The control implemented in Simulink is shown in Figure 15.The control implemented in Simulink is shown in Figure 15.

+ PLL
Inverter + PLL  The control implemented in Simulink is shown in Figure 15.  Figure 16 shows the simulation results for voltage, current, instantaneous power, and average power in the grid.The theoretical value of the grid current is 1 A, and the value obtained in the simulation is 1.06 A, resulting in an error of 5.6%.The theoretical value of the maximum instantaneous power is 182 W, and the measured value is 182.8W, resulting in an error of 1.5%.The calculated average power is 90 W, and the measured value is 89.1 W, which is a 1.01% error.The current and voltage are at a fundamental frequency of 60 Hz, and the instantaneous power is at a frequency of 120 Hz. Figure 16 shows the simulation results for voltage, current, instantaneous power, and average power in the grid.The theoretical value of the grid current is 1 A, and the value obtained in the simulation is 1.06 A, resulting in an error of 5.6%.The theoretical value of the maximum instantaneous power is 182 W, and the measured value is 182.8W, resulting in an error of 1.5%.The calculated average power is 90 W, and the measured value is 89.1 W, which is a 1.01% error.The current and voltage are at a fundamental frequency of 60 Hz, and the instantaneous power is at a frequency of 120 Hz. Figure 16 shows the simulation results for voltage, current, instantaneous power, and average power in the grid.The theoretical value of the grid current is 1 A, and the value obtained in the simulation is 1.06 A, resulting in an error of 5.6%.The theoretical value of the maximum instantaneous power is 182 W, and the measured value is 182.8W, resulting in an error of 1.5%.The calculated average power is 90 W, and the measured value is 89.1 W, which is a 1.01% error.The current and voltage are at a fundamental frequency of 60 Hz, and the instantaneous power is at a frequency of 120 Hz.The FFT computed with MATLAB shows on the (y) axis the magnitude of the harmonics concerning the peak magnitude of the fundamental harmonic; however, in this work, it was calculated for the peak-to-peak magnitude; therefore, Equation (34) must be divided by two as shown in Equation (63).The current signal on the inverter side is shown in Figure 17.The percentage of current ripple on the inverter side was proposed to be 15%; therefore, by substituting this value in Equation (64), we obtain a percentage of 7.5%, which is what is shown in the FFT (Figure 18).The FFT computed with MATLAB shows on the (y) axis the magnitude of the harmonics concerning the peak magnitude of the fundamental harmonic; however, in this work, it was calculated for the peak-to-peak magnitude; therefore, Equation (34) must be divided by two as shown in Equation (63).The current signal on the inverter side is shown in Figure 17.The FFT computed with MATLAB shows on the (y) axis the magnitude of the harmonics concerning the peak magnitude of the fundamental harmonic; however, in this work, it was calculated for the peak-to-peak magnitude; therefore, Equation (34) must be divided by two as shown in Equation (63).The current signal on the inverter side is shown in Figure 17.The percentage of current ripple on the inverter side was proposed to be 15%; therefore, by substituting this value in Equation ( 64), we obtain a percentage of 7.5%, which is what is shown in the FFT (Figure 18).The percentage of current ripple on the inverter side was proposed to be 15%; therefore, by substituting this value in Equation (64), we obtain a percentage of 7.5%, which is what is shown in the FFT (Figure 18).Zooming from Figure 18 to the harmonics near 20 kHz, these are shown in Figure 19Error!Reference source not found..The ripple percentage of the proposed harmonic n was 7.5%, and the simulation result was 6.64%, resulting in an error of 12.95%.Zooming from Figure 18 to the harmonics near 20 kHz, these are shown in Figure 19.The ripple percentage of the proposed harmonic n was 7.5%, and the simulation result was 6.64%, resulting in an error of 12.95%.Zooming from Figure 18 to the harmonics near 20 kHz, these are shown in Figure 19Error!Reference source not found..The ripple percentage of the proposed harmonic n was 7.5%, and the simulation result was 6.64%, resulting in an error of 12.95%.The grid side current is shown in Figure 20.The grid side current is shown in Figure 20.The FFT of Figure 20 is shown in Figure 21.The THD of the grid current is 5.12%, which complies with the IEEE 519-2022 standard [46].The grid side current is shown in Figure 20.If one zooms in from Figure 21 to the harmonics near harmonic n (see Figure 22), it becomes apparent that the harmonics associated with the resonant frequency are lower than the harmonics associated with harmonic n.
If one zooms in from Figure 21 to the harmonics near harmonic n (see Figure 22), it becomes apparent that the harmonics associated with the resonant frequency are lower than the harmonics associated with harmonic n.

Experimental Results
A prototype was implemented experimentally to validate the design methodology and the calculations performed.The values obtained from Tables 2 and 4 were used.The prototype used is shown in Figure 23.

Experimental Results
A prototype was implemented experimentally to validate the design methodology and the calculations performed.The values obtained from Tables 2 and 4 were used.The prototype used is shown in Figure 23.If one zooms in from Figure 21 to the harmonics near harmonic n (see Figure 22), it becomes apparent that the harmonics associated with the resonant frequency are lower than the harmonics associated with harmonic n.

Experimental Results
A prototype was implemented experimentally to validate the design methodology and the calculations performed.The values obtained from Tables 2 and 4 were used.The prototype used is shown in Figure 23.  Figure 24 shows the grid voltage, L 1 current, and the instantaneous power.The data obtained are shown in Table 5.
obtained are shown in Table 5.With the data obtained from the oscilloscope, the FFT is computed in Simulink, and this is shown in Figure 25.
The magnitude of the harmonic n for the inverter side current (Figure 25) is 8.5%, and the proposed theoretical value was 7.5%.This results in an error of 11.76%.The grid current was measured with a spectrum analyzer.This is shown in Figure 26.
Figure 26 shows the grid voltage (upper signal) with a peak magnitude of 180 V on a scale of 60.0 V/div.Also shown is the grid current (lower signal) with a measured magnitude of 1 A on a scale of 1.00 A/div.The data obtained from the spectrum analyzer are exported to Simulink, and the FFT shown in Figure 25 is calculated.
Figure 27 shows the magnitude of the harmonics obtained with the data (Figure 24).The magnitude of harmonic n (19940 Hz) is less than 2%.The magnitude of the harmonics close to the resonance frequency is smaller than the magnitude of the harmonics close to harmonic n.The THD calculated from the experimental data for the grid current was 4.4%, thus complying with the IEEE standard.With the data obtained from the oscilloscope, the FFT is computed in Simulink, and this is shown in Figure 25.The magnitude of the harmonic n for the inverter side current (Figure 25) is 8.5%, and the proposed theoretical value was 7.5%.This results in an error of 11.76%.The grid current was measured with a spectrum analyzer.This is shown in Figure 26.   Figure 26 shows the grid voltage (upper signal) with a peak magnitude of 180 V on a scale of 60.0 V/div.Also shown is the grid current (lower signal) with a measured magnitude of 1 A on a scale of 1.00 A/div.The data obtained from the spectrum analyzer are exported to Simulink, and the FFT shown in Figure 25 is calculated.
Figure 27 shows the magnitude of the harmonics obtained with the data (Figure 24).The magnitude of harmonic n (19,940 Hz) is less than 2%.The magnitude of the harmonics close to the resonance frequency is smaller than the magnitude of the harmonics close to harmonic n.The THD calculated from the experimental data for the grid current was 4.4%, thus complying with the IEEE standard.

Discussion
The LCL filter design for single-phase grid-connected systems published in [8][9][10][11]26,44,47] uses the following equations.For inductor L1, Equation (64) is used.and capacitors of an LCL filter.The errors presented using the current ripple at harmonic n are less than 10%.The THD of the grid current is lower than the IEEE standard.The inductor size has been reduced to 39.31% and the capacitor value by 97%.This reduction in capacitor value is because the equation reported in the literature is obtained from a maximum value of reactive power that will handle a capacitor with a maximum value of this capacitor.However, in this work, it was calculated based on the value of the inductors, the grid voltage, the current ripple in the inductors, and the average power, resulting in a minimum value of the capacitor.These are the main contributions of this work.The main applications of this work are as follows: use in microinverters for photovoltaic applications that are interconnected to the grid through an LCL filter, as well as use in the microgrids of the proposed LCL filter.A limitation of this work is that it is only applicable to single-phase connections connected to the grid.In three-phase and isolated systems, it is not possible to use the proposed methodology to design the filters.

Figure 2 .
Figure 2. Grid-connected full bridge inverter with an LCL filter.

Figure 2 .
Figure 2. Grid-connected full bridge inverter with an LCL filter.

Figure 3 .
Figure 3. General diagram of mathematical analysis using harmonics.

Figure 4
Figure 4 shows a step-by-step diagram of the mathematical analysis of the current ripple percentage from which the proposed values and parameters for the LCL filter are obtained.

Figure 3 .
Figure 3. General diagram of mathematical analysis using harmonics.

Figure 4
Figure 4 shows a step-by-step diagram of the mathematical analysis of the current ripple percentage from which the proposed values and parameters for the LCL filter are obtained.

Figure 4 .
Figure 4. Step-by-step diagram for LCL filter calculation and proposed parameters.

Figure 4 .
Figure 4. Step-by-step diagram for LCL filter calculation and proposed parameters.

Figure 5 .
Figure 5. LCL filter connected to the grid for the fundamental harmonic.

Figure 5 .
Figure 5. LCL filter connected to the grid for the fundamental harmonic.

Figure 7 .
Figure 7. LCL filter for any harmonic n.

Figure 7 .
Figure 7. LCL filter for any harmonic n.

Figure 9 .
Figure 9.The voltage on the DC bus as a function of alpha.Figure 9.The voltage on the DC bus as a function of alpha.

Figure 9 .
Figure 9.The voltage on the DC bus as a function of alpha.Figure 9.The voltage on the DC bus as a function of alpha.

Figure 10 .
Figure 10.Vin as a function of alpha.

Figure 10 .
Figure 10.V in as a function of alpha.

3. 3 .
Step 3. Inductance L 1 Calculation Referring to Figure 8, r is selected as equal to 1 to ensure the lowest attenuation factor (K a ).Equation (37) is evaluated for β = 1 and different values of alpha.The graph is shown in Figure 11.Using a Pareto optimal point at alpha = 3.29, a value of L 1 equal to 10.68 mH is obtained.

Figure 12 .
Figure 12.Proposed value for C f .

Figure 13 .
Figure 13.LCL filter control diagram connected to the grid.Figure 13.LCL filter control diagram connected to the grid.

Figure 13 .
Figure 13.LCL filter control diagram connected to the grid.Figure 13.LCL filter control diagram connected to the grid.

Figure 13 .
Figure 13.LCL filter control diagram connected to the grid.

Figure 14 .
Figure 14.Full bridge inverter with LCL filter connected to the grid.

Figure 14 .
Figure 14.Full bridge inverter with LCL filter connected to the grid.

Figure 13 .
Figure 13.LCL filter control diagram connected to the grid.

Figure 14 .
Figure 14.Full bridge inverter with LCL filter connected to the grid.

Figure 15 .
Figure 15.Schematic of control implemented in Simulink.

Figure 15 .
Figure 15.Schematic of control implemented in Simulink.

Figure 15 .
Figure 15.Schematic of control implemented in Simulink.

Figure 19 .
Figure 19.FFT of harmonics near harmonic n for the inverter side current.

Figure 18 .
Figure 18.FFT of the inverter side current signal.

Figure 18 .
Figure 18.FFT of the inverter side current signal.

Figure 19 .
Figure 19.FFT of harmonics near harmonic n for the inverter side current.Figure 19.FFT of harmonics near harmonic n for the inverter side current.

Figure 19 .
Figure 19.FFT of harmonics near harmonic n for the inverter side current.Figure 19.FFT of harmonics near harmonic n for the inverter side current.

Figure 20 .
Figure 20.Grid side current.The FFT of Figure20is shown in Figure21.The THD of the grid current is 5.12%, which complies with the IEEE 519-2022 standard[46].

Figure 21 .
Figure 21.FFT of the grid side current signal.

Figure 20 .
Figure 20.Grid side current.The FFT of Figure20is shown in Figure21.The THD of the grid current is 5.12%, which complies with the IEEE 519-2022 standard[46].

Figure 21 .
Figure 21.FFT of the grid side current signal.

Figure 21 .
Figure 21.FFT of the grid side current signal.

Figure 22 .
Figure 22.FFT of I g (harmonics near harmonic n).

Figure 24 .
Figure 24.Measured inverter-side current and grid voltage.

Figure 24 .
Figure 24.Measured inverter-side current and grid voltage.

Figure 25 .
Figure 25.Experimental FFT of the L 1 current.

Figure 26 .
Figure 26.Measured grid current with a spectrum analyzer.

Figure 26 .
Figure 26.Measured grid current with a spectrum analyzer.

Table 1 .
Relationship between modulation index and mn parameter.

Table 2 .
General design specifications.

Table 2 .
General design specifications.

Table 3 .
Proposed design methodology for the inverter and LCL filter.

Table 4 .
Values calculated with the design methodology.

Table 5 .
Experimental results of L1 current, grid voltage, and instantaneous power.

Table 5 .
Experimental results of L 1 current, grid voltage, and instantaneous power.