Compensation of Unbalanced Low-Voltage Grids Using a Photovoltaic Generation System with a Dual Four-Leg, Two-Level Inverter

: In this paper, a grid-connected photovoltaic (PV) generation system is proposed with the purpose of providing support to low-voltage grids, namely through the elimination or attenuation of the grid imbalances. This compensation must consider the load types, which can be either linear or non-linear, and whether the reactive power and current harmonics generated by the non-linear loads need to be compensated in addition to the unbalanced active power. This must be well considered, since the compensation of all aspects requires oversized PV inverters. Thus, the different unbalanced compensation schemes are addressed. Several schemes for the generation of the inverter current references taking into consideration the compensation and load type are presented. For this PV generation system, a dual four-leg, two-level inverter is proposed. It provides full unbalanced compensation owing to the fourth leg of the inverter and also extends the AC voltage, which is important when this compensation is required. To control this inverter, a control scheme for the inverter that considers several compensation factors is proposed. A vector voltage modulator associated with the controller is another aspect that is addressed in the paper. This modulator considers the balance between the DC voltages of the inverters. Several compensation schemes are veriﬁed through computational tests. The results validate the effectiveness of the proposed PV generation system.


Introduction
One of the renewable energy sources that now plays an important role is solar energy, specifically when harnessed using photovoltaic (PV) generators. These energy generators have shown enormous growth in recent years [1]. Besides their ability to generate renewable and clean energy, several other factors have also been involved, such as technological advances, falling prices of PV panels and government incentives [2]. Regarding the technological advances, one of the components of the PV generators that has been subject to significant research is the inverter. Besides acting in the conversion from DC to AC and control of the system in grid-connected applications, the inverter can also be an active grid participant. In such cases, it must be designed to support the optimized operation of to PV systems. Other multilevel inverters with four wires and unbalanced loads, such as the Z and quasi-Z-source inverters, have also been studied [63,64]. However, regarding the new multilevel inverters that use the classical two-level VSIs, virtually no proposals of PV generators with four wires to supply an unbalanced power are available. A topology with two three-phase, two-level VSIs, which has been extensively studied, is one of the best cases.
Considering the important role that PV generators can play in the compensation of unbalanced loads, this paper proposes a generator with a modular multilevel inverter with associated compensation schemes to provide this type of grid support. The proposed multilevel inverter consists of two four-wire, two-level inverters in connection with the open windings of a transformer. A control strategy associated with a new vectorial modulator is also proposed for this multilevel inverter. This modulator allows the DC capacitors of the inverters to always be balanced. Therefore, the unbalanced generation of the PV panels connected to each inverter does not generate voltage imbalances in the capacitors. Moreover, several schemes to generate the current references are proposed, considering either linear or non-linear loads.
After this introductory section, the paper is organized as follows. In Section 2, the system to be compensated and the dual four-leg, two-level inverter topology are introduced. Next, in Section 3, the control strategy and the vectorial voltage modulator proposed in this paper are disclosed. Section 4 covers the results and discussion of the computer simulations. Finally, some conclusions are drawn in the last section.

Proposed System
Typically, low-voltage (LV) networks are characterized by a three-phase, four-wire connection. In these LV grids, a neutral wire connection is provided for the loads. This connection is provided not only for single-phase loads, but also for the three-phase loads ( Figure 1). The scattered distribution of the consumer loads will result in an asymmetric distribution. Therefore, imbalances associated with the currents and voltages will show up. This problem is aggravated by the existence of non-linear loads, which are becoming increasingly prevalent.  Figure 1. LV network characterized by a three-phase, four-wire connection in which the scattered distribution of the consumer loads can result in an asymmetric distribution.
As described in the previous section, the inverters that are used in PV systems can also provide ancillary services, such as support to unbalanced loads. In order to maximize the provision for the type of ancillary service, a new dual-inverter structure is proposed, as shown in Figure 2. This structure is based on two four-leg, two-level inverters connected to an injection transformer. The windings of the transformer are in As described in the previous section, the inverters that are used in PV systems can also provide ancillary services, such as support to unbalanced loads. In order to maximize the provision for the type of ancillary service, a new dual-inverter structure is proposed, as shown in Figure 2. This structure is based on two four-leg, two-level inverters connected to an injection transformer. The windings of the transformer are in open configuration, in which each side is connected to each of the inverters. The inverters are also connected between them through their fourth leg. open configuration, in which each side is connected to each of the inverters. The inverters are also connected between them through their fourth leg.
PV Generator 2 C 2 V C2 C 1 S13 S12 S11 S13 S12 S11 S14 S14  The output voltages of the proposed four-wire multilevel converter can be obtained through the application of the Kirchhoff laws and the state of the switches of the inverters. Thus, considering the switches as a binary variable bji (directly related to switch Sji and equal to 1 if the switch is on and 0 if is off), the AC voltages of each of the inverters are given by (j = 1,2): where Cj V are the input voltages of each inverter. Taking into consideration the previous equations and that the output voltages of the multilevel converter are the difference between the two inverters, the AC voltages at the terminals of the transformer windings are expressed by: 11 21 1  12  22  2  1  2  13  23  3  14  24 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 However, in order to obtain a space vector diagram of the proposed inverter, the Clark-Concordia transformation must be applied to the AC voltages at the terminals of the transformer windings, as given by Equation (3).  1  1  2  2  2  3  3  0  3  2  2  1 1 1 From the analysis of Equation (3), considering all possible combinations of the switches and that the DC voltages are equal, a total number of 256 space vectors are obtained. However, not all of these vectors are different. In fact, only 65 voltage vectors (including the zero voltage) are different, with the others being redundant. Figure 3 shows these different voltage vectors in a three-dimensional space (αβo coordinates), which can be applied at the output of the proposed converter. On the other hand, from the 65 different voltage vectors, 19 vectors are related to the two-dimensional αβ plane The output voltages of the proposed four-wire multilevel converter can be obtained through the application of the Kirchhoff laws and the state of the switches of the inverters. Thus, considering the switches as a binary variable b ji (directly related to switch S ji and equal to 1 if the switch is on and 0 if is off), the AC voltages of each of the inverters are given by (j = 1,2): where V Cj are the input voltages of each inverter.
Taking into consideration the previous equations and that the output voltages of the multilevel converter are the difference between the two inverters, the AC voltages at the terminals of the transformer windings are expressed by: However, in order to obtain a space vector diagram of the proposed inverter, the Clark-Concordia transformation must be applied to the AC voltages at the terminals of the transformer windings, as given by Equation (3).
From the analysis of Equation (3), considering all possible combinations of the switches and that the DC voltages are equal, a total number of 256 space vectors are obtained. However, not all of these vectors are different. In fact, only 65 voltage vectors (including the zero voltage) are different, with the others being redundant. Figure 3 shows these different voltage vectors in a three-dimensional space (αβo coordinates), which can be applied at the output of the proposed converter. On the other hand, from the 65 different voltage vectors, 19 vectors are related to the two-dimensional αβ plane (Figure 4a

Control Strategy
The proposed dual-inverter structure based on two four-leg, two-level in controlled in order to transfer the maximum power from the PV generators achieved through the control of the AC currents in balanced and imbalanc Additionally, the regulation of the DC capacitors and the balance between th always be achieved.
In order to develop the control system of the inverter, the system dynam converter connected to the grid established in state space equations is required. the analysis of the power converter topology, the following state equation

Control Strategy
The proposed dual-inverter structure based on two four-leg, two-level inverters is controlled in order to transfer the maximum power from the PV generators. This is achieved through the control of the AC currents in balanced and imbalanced ways. Additionally, the regulation of the DC capacitors and the balance between them must always be achieved.
In order to develop the control system of the inverter, the system dynamics of the converter connected to the grid established in state space equations is required. Through the analysis of the power converter topology, the following state equations for the capacitor voltages can be obtained:

Control Strategy
The proposed dual-inverter structure based on two four-leg, two-level inverters is controlled in order to transfer the maximum power from the PV generators. This is achieved through the control of the AC currents in balanced and imbalanced ways. Additionally, the regulation of the DC capacitors and the balance between them must always be achieved.
In order to develop the control system of the inverter, the system dynamics of the converter connected to the grid established in state space equations is required. Through Electronics 2022, 11, 320 6 of 25 the analysis of the power converter topology, the following state equations for the capacitor voltages can be obtained: where currents i DC 1 and i DC 2 are given by (5); currents i PH1 and i PH2 are the currents of each of independent PV generator; C 1 and C 2 are the capacitances of each inverter input capacitor.
Using Park's transformation, the state space equations of the capacitor voltages in the stationary coordinates dqo are: Using a similar analysis but considering the Clarke-Concordia transformation, it is possible to obtain the following state space equations for the inverter AC currents in the coordinates αβo: where R f and L f are the resistance and inductance of each coupling inductor, respectively. Since in this system it is also required to compensate an unbalanced grid, then the controller is developed on the αβo coordinate system. In this way, in accordance with the strong relative degree [65,66] of the inverter AC currents, the control laws of these currents in the αβo reference frame will be given by: To ensure the desired condition (8), a voltage vector modulator based on the sliding mode stability condition S e iαβo , t . S e iαβo , t < 0 is proposed [65,66]. Thus, in accordance with this stability condition, the adopted voltage vector must ensure that . S e iαβo , t < 0 if S e iαβo , t > 0 or . S e iαβo , t > 0 if S e iαβo , t < 0. In order to implement this strategy, the errors associated with the control laws given by (8) are discretized using hysteretic comparators. In this case, one five-and two sevenvoltage levels (from −2 to +2 and −3 to +3) are considered. The output of these hysteretic comparators (ν α , ν β , ν o ) are the inputs of the three look-up tables. In Tables 1-3, these lookup tables are presented. Variables ν α , ν β and ν o are related to the hysteretic comparator levels. For example, let us consider that the outputs of the hysteretic comparators are ν α = +2, ν β = +1 and ν o = +1. In this case, two vectors can be chosen, namely 4 and 20.  This system is developed with the purpose of injecting the generated PV power in a way that will help to balance the grid load voltage. However, this generation must consider several different conditions, namely:

•
The generated PV power is lower than the unbalanced grid load power; • The generated PV power is higher than the unbalanced grid load power.
For the first condition, the inverter should inject the generated PV power in an unbalanced way and proportional to the grid's unbalanced load power. In this way, the phase with higher load will receive more generated PV power, helping to balance the low-voltage grid. However, if the generated PV power is higher than the unbalanced grid load power, then the system must inject the power in two different ways: a part of the injected power must be unbalanced and the other part must be balanced. The unbalanced part is equal to the unbalanced grid load power and the other part is injected in a balanced way. Therefore, a completely balanced grid [30] is achieved. It should be noted that this procedure can be achieved for the active power or reactive power and current harmonics. To define the reference of the grid current d component, a PI controller associated with the inverter connected to the PV generator 1 is used. This controller is defined to ensure the control of the voltage of the DC capacitor, V C 1 . This reference is given by: For the other inverter, there is no need to control it in a similar way, since the AC currents of one of the inverters are the same as in the other. The control of the capacitor voltage V C 2 is obtained through the right choice of voltage vector to be applied to the inverters. As can be verified in Tables 1-3, there are redundant vectors. Therefore, since some of them charge one of the capacitors and discharge the other one, and vice versa, the correct choice maintains the voltage of capacitor C 2 as equal to the voltage of capacitor C 1 . For example, considering the previous case in which ν α = +2, ν β = +1 and ν o = +1, then vectors 4 and 20 can be applied. On the other hand, associated with these two vectors are redundant combinations, as can be seen in Table 4. Therefore, if capacitor voltage V C 1 is higher than capacitor voltage V C 2 and the current of phase 1 is positive and the other ones are negative, then vector 20E must be applied, since it will discharge capacitor C 1 and charge capacitor C 2 . For the reverse situation, in which the capacitor voltage V C 1 is lower than capacitor voltage V C 2 , then vector 20D should be chosen. The balance between the two capacitors is granted. The complete control scheme of the proposed multilevel inverter can be seen in Figure 5. This control scheme consists of the DC voltage controller, AC current controller and space vector modulator.
Another aspect that must be considered is how the current references are generated. For the current d reference, whether the injected is higher than the unbalanced grid load power or not must be assessed. This is achieved using the following condition: where i d_load is the d component of the load current and K 1 and K 2 are given by: Electronics 2022, 11, 320 9 of 25 Regarding the other references (q and o current components), it must be considered that the load imbalance is reflected in the AC components of the qo load currents. However, in order to avoid a significant increase in the inverter's apparent power, only the unbalanced active power is considered. The i q and i o references are given by: where ∼ i q_load is the oscillatory load q current component and i o_load is the load o current component.
The complete scheme for the generation of the inverter current references can be seen in Figure 6.
are negative, then vector 20E must be applied, since it will discharge capacitor C1 and charge capacitor C2. For the reverse situation, in which the capacitor voltage VC1 is lower than capacitor voltage VC2, then vector 20D should be chosen. The balance between the two capacitors is granted. The complete control scheme of the proposed multilevel inverter can be seen in Figure 5. This control scheme consists of the DC voltage controller, AC current controller and space vector modulator. Table 4. Redundant vectors for the case of να = +2, νβ = +1 and νo = +1.

Seven-level Comparator
Seven-level Comparator  Another aspect that must be considered is how the current references are generated For the current d reference, whether the injected is higher than the unbalanced grid load power or not must be assessed. This is achieved using the following condition: where id_load is the d component of the load current and K1 and K2 are given by: Regarding the other references (q and o current components), it must be considered that the load imbalance is reflected in the AC components of the qo load currents However, in order to avoid a significant increase in the inverter's apparent power, only the unbalanced active power is considered. The iq and io references are given by: is the oscillatory load q current component and io_load is the load o curren component.
The complete scheme for the generation of the inverter current references can be seen in Figure 6.
Dead zone Saturation LPF Figure 6. Scheme for the generation of the inverter current references for the compensation of th active power imbalance and linear loads.
As mentioned before, the current reference scheme was designed to avoid a significant increase in the inverter apparent power. However, this last scheme does no completely eliminate the imbalance (if the load is not a single resistor), since the As mentioned before, the current reference scheme was designed to avoid a significant increase in the inverter apparent power. However, this last scheme does not completely eliminate the imbalance (if the load is not a single resistor), since the imbalance associated with the reactive components of the currents are not compensated. It also does not consider imbalances originated by non-linear loads. Thus, if there is no restriction regarding the inverter apparent power, all imbalances can be compensated. In this case, the DC component of current i q should not be removed. Non-linear loads must also be taken into consideration, since nowadays they are becoming predominant. For this type of load, the harmonics are reflected in the dqo currents as AC components. Thus, considering that there are not any restrictions, these harmonics can also be compensated by the PV system. Therefore, if the apparent power of the PV generator and converter is equal or higher than the load, the grid currents will be balanced, sinusoidal (without harmonics) and in phase with the grid voltage. The scheme of this compensation can be seen in Figure 7.
Dead zone Saturation Figure 7. Scheme for the generation of the inverter current references for the compensation of reactive power and harmonics.
If the loads are non-linear and it is only desired to compensate for the active power or active and reactive power imbalances associated with the load, the scheme should be changed. The generated harmonics will be reflected in the dqo currents as AC components. Thus, to avoid the compensation of the harmonics by the PV inverter (to prevent oversizing the inverter), these AC components should be removed. However, these components will introduce a new problem, since some of them are at the near frequency of the AC components generated by the imbalance of the linear loads. To avoid this problem, the acquired load currents are filtered with a low-pass filter before the Clark-Concordia transform is applied. The new scheme that only compensates for the active and reactive power imbalances of the load is presented in Figure 8. If it is desired only to compensate for the active power, then the AC components of the q current component should be removed.

Simulation Results
The validation of the proposed PV generation system with a dual four-leg, two-level If the loads are non-linear and it is only desired to compensate for the active power or active and reactive power imbalances associated with the load, the scheme should be changed. The generated harmonics will be reflected in the dqo currents as AC components. Thus, to avoid the compensation of the harmonics by the PV inverter (to prevent oversizing the inverter), these AC components should be removed. However, these components will introduce a new problem, since some of them are at the near frequency of the AC components generated by the imbalance of the linear loads. To avoid this problem, the acquired load currents are filtered with a low-pass filter before the Clark-Concordia transform is applied. The new scheme that only compensates for the active and reactive power imbalances of the load is presented in Figure 8. If it is desired only to compensate for the active power, then the AC components of the q current component should be removed.
Dead zone Saturation Figure 7. Scheme for the generation of the inverter current references for the compensation of reactive power and harmonics.
If the loads are non-linear and it is only desired to compensate for the active power or active and reactive power imbalances associated with the load, the scheme should be changed. The generated harmonics will be reflected in the dqo currents as AC components. Thus, to avoid the compensation of the harmonics by the PV inverter (to prevent oversizing the inverter), these AC components should be removed. However, these components will introduce a new problem, since some of them are at the near frequency of the AC components generated by the imbalance of the linear loads. To avoid this problem, the acquired load currents are filtered with a low-pass filter before the Clark-Concordia transform is applied. The new scheme that only compensates for the active and reactive power imbalances of the load is presented in Figure 8. If it is desired only to compensate for the active power, then the AC components of the q current component should be removed.

Simulation Results
The validation of the proposed PV generation system with a dual four-leg, two-level inverter and the proposed control system were achieved through several tests carried out

Simulation Results
The validation of the proposed PV generation system with a dual four-leg, two-level inverter and the proposed control system were achieved through several tests carried out by computer simulations. For these tests, the previously described controller, proposed compensation system and several schemes for the compensation were also considered. The PV generation system was connected to a low-voltage grid with 230/400 V RMS . The inverter was connected to the grid through a transformer with a 1:4 turns-ratio and an inductor low-pass filter with 10 mH. The DC voltage reference of each inverter was 200 V and 1000 µF capacitors were used. For the simulation of our test system, MATLAB 2017a with Simulink version 8.9 was used. We also used the Simulink Library, namely the Simscape/PowerSystems blockset.
Tests with linear and non-linear loads were implemented. The first ones were performed for an unbalanced linear load, consisting of a RL load per phase with 8.5 Ω and 4.2 mH for phase 1, 10 Ω and 5 mH for phase 2 and 7 Ω and 3.5 mH for phase 3. These tests were performed for no unbalanced compensation and several types of compensation, namely sub-, full and overcompensation. The three modes depend on the compensation scheme that is used, namely whether it is only the active power to be compensated or whether the other power types also need to be compensated. If the compensation scheme is only for the active power to be compensated, in order to reduce the apparent power of the inverter, then:

•
The subcompensation mode is when the generated power from the PV system is lower than the active load power; • The full compensation mode is when the generated power from the PV system is equal to the active load power; • The overcompensation mode is when the generated power from the PV system is higher than the active load power.
For example, if the load is only resistive, when in subcompensation mode, the PV system is unable to fully compensate the load unbalance, meaning some imbalance still appears at the point of common coupling (PCC). When in full compensation mode (power generated by the PV system is equal to the load power), the current is null at the PCC. When in overcompensation mode, the grid receives power, although with the currents balanced. If the load is inductive, even in full compensation mode the imbalance remains and the grid currents are not zero, since the reactive component of the load power is not compensated. However, if the scheme considers the other powers to be compensated, then for any type of load and for the full compensation mode, the current is null at the PCC.
The first result is for the situation in which the PV system does not compensate the imbalances of the load. In Figure 9, the load currents, current in the line between the fourth leg of the inverters, AC currents of the PV generator and grid currents are all presented. Since the PV generator operates in a balanced mode, the amplitude of the three-phase currents is equal. Since those currents are balanced, as shown in Figure 9b, the current in the line between the fourth leg of the inverters is nearly zero, meaning the circulating current is also nearly zero. On the other hand, since the PV generator is not operating to provide ancillary services associated with the unbalanced loads, the grid currents maintain the imbalance that exists in the load currents. The results for the test in subcompensation mode can be seen in Figure 10a-d. The multilevel operation of the PV converter can be seen in Figure 10a, where the transformer primary voltage of phase 1 (V 1 ) is presented. It is also possible to see through the other figures that the imbalance of the grid currents is reduced. In fact, the AC currents of the PV generator are unbalanced in order to compensate for the load imbalance (Figure 10c). The grid currents are still unbalanced (Figure 10d), but comparing the load (Figure 10b) with an important attenuation. The current in the line between the fourth leg of the inverters is the difference of the sum of the three-phase currents (Figure 10b). This is the result of the imbalance; therefore, there is no increase in current due to circulating currents. Regarding the test results in full compensation mode, these can be seen in Figure 11a-c. These results confirm that the PV generator injects an unbalanced current that practically compensates for the entire imbalance. Since the reactive current component of the load is not compensated, the grid current will be not zero. The grid currents are shifted by 90 degrees of the voltage, showing that only they are associated with the inductive load. As mentioned before, the reason for not compensating this could be as an option to reduce the inverter's apparent power. The current in the line between the fourth leg of the inverters is increased, but proportional to the difference of the sum of the three-phase currents, which is also increased (Figure 11b). The test results related to the overcompensation mode can be seen in Figure 12a-c. The results show that the amplitude of the grid currents is increased but in the opposite phase compared with the subcompensation mode. This confirms that the generated power from the PV system is higher that the power that is supplied to the load. currents, which is also increased (Figure 11b). The test results related to the overcompensation mode can be seen in Figure 12a-c. The results show that the amplitude of the grid currents is increased but in the opposite phase compared with the subcompensation mode. This confirms that the generated power from the PV system is higher that the power that is supplied to the load. currents, which is also increased (Figure 11b). The test results related to the overcompensation mode can be seen in Figure 12a-c. The results show that the amplitude of the grid currents is increased but in the opposite phase compared with the subcompensation mode. This confirms that the generated power from the PV system is higher that the power that is supplied to the load.   One of the aspects that is associated with this inverter and its control system is the regulation of the DC capacitors voltages. There are two strategies used to define the reference value for these voltages. The first one is when the PV arrays are connected to the DC inverter capacitors through a DC-DC converter. This is the more used solution, since it allows to harness more power from the PV panels. In this way, for the input DC side of the inverters, the PV panels and DC-DC converter behave similarly to a variable current source. Under this solution, the DC capacitors voltage should be regulated for a specific reference value. This solution was the one adopted in this work. The results obtained for the capacitors DC voltage and the test with the PV generator in full compensation mode can be seen in Figure 13a. It is possible to verify that the voltages fluctuate around the reference. It must be noted that due to the fact that there are redundant vectors, it is possible to choose a vector that charges one capacitor and discharges the other. If one of them is below the reference voltage and the other is above, then that vector should be chosen. Another aspect is when one of the PV arrays generates a lower DC voltage, meaning that the solar irradiance is also lower. In this case, the current injected in the DC input of the inverter associated with that PV array will also be lower. Due to the characteristics of the proposed vector voltage modulator, in which the redundant vector that leads the voltage to the reference is chosen, this will not affect the regulation of the inverter DC capacitor voltages. The result of a test in which the PV array of generator 2 produces less 25% than the PV array of generator 1 is presented in Figure  13b. It is possible to verify that the voltages remain within the reference range. Another strategy is when the PV arrays are directly connected to the DC side of the inverters. In such cases, the reference of the DC capacitors voltage should be variable. These reference values should be given by the MPPT and the DC capacitors voltage should be regulated One of the aspects that is associated with this inverter and its control system is the regulation of the DC capacitors voltages. There are two strategies used to define the reference value for these voltages. The first one is when the PV arrays are connected to the DC inverter capacitors through a DC-DC converter. This is the more used solution, since it allows to harness more power from the PV panels. In this way, for the input DC side of the inverters, the PV panels and DC-DC converter behave similarly to a variable current source. Under this solution, the DC capacitors voltage should be regulated for a specific reference value. This solution was the one adopted in this work. The results obtained for the capacitors DC voltage and the test with the PV generator in full compensation mode can be seen in Figure 13a. It is possible to verify that the voltages fluctuate around the reference. It must be noted that due to the fact that there are redundant vectors, it is possible to choose a vector that charges one capacitor and discharges the other. If one of them is below the reference voltage and the other is above, then that vector should be chosen. Another aspect is when one of the PV arrays generates a lower DC voltage, meaning that the solar irradiance is also lower. In this case, the current injected in the DC input of the inverter associated with that PV array will also be lower. Due to the characteristics of the proposed vector voltage modulator, in which the redundant vector that leads the voltage to the reference is chosen, this will not affect the regulation of the inverter DC capacitor voltages. The result of a test in which the PV array of generator 2 produces less 25% than the PV array of generator 1 is presented in Figure 13b. It is possible to verify that the voltages remain within the reference range. Another strategy is when the PV arrays are directly connected to the DC side of the inverters. In such cases, the reference of the DC capacitors voltage should be variable. These reference values should be given by the MPPT and the DC capacitors voltage should be regulated for these values. To verify the capability of the inverter to operate in this condition, a test in which the references of the capacitor voltages are initially equal and suddenly change to 220 V in inverter 1 and 180 V in inverter 2 can be seen in Figure 13c. From this test, it is possible to verify the capability of the control system to regulate those voltages for different values. for these values. To verify the capability of the inverter to operate in this condition, a test in which the references of the capacitor voltages are initially equal and suddenly change to 220 V in inverter 1 and 180 V in inverter 2 can be seen in Figure 13c. From this test, it is possible to verify the capability of the control system to regulate those voltages for different values. Tests with the same linear load were performed, although the compensation scheme for both active and reactive unbalanced components of the load was used. The test results for the subcompensation mode are presented in Figure 14. As in the previous tests, since the system is not fully compensated, the imbalance remains, although with some attenuation. However, the impact of this different scheme is evident from the test in full compensation mode. In fact, as the results presented in Figure 15 show, in this full compensation mode the currents of the PV generator (Figure 15a) are equal to the currents of the load (Figure 9a). Therefore, the grid currents become zero (which was not verified by the previous scheme). Regarding the results of the overcompensation mode, they are presented in Figure 16. They show that the grid current is balanced and in opposite phase to the grid voltage, showing that a balanced active power in injected into the grid. Tests with the same linear load were performed, although the compensation scheme for both active and reactive unbalanced components of the load was used. The test results for the subcompensation mode are presented in Figure 14. As in the previous tests, since the system is not fully compensated, the imbalance remains, although with some attenuation. However, the impact of this different scheme is evident from the test in full compensation mode. In fact, as the results presented in Figure 15 show, in this full compensation mode the currents of the PV generator (Figure 15a) are equal to the currents of the load (Figure 9a). Therefore, the grid currents become zero (which was not verified by the previous scheme). Regarding the results of the overcompensation mode, they are presented in Figure 16. They show that the grid current is balanced and in opposite phase to the grid voltage, showing that a balanced active power in injected into the grid.  A new set of tests with linear and non-linear loads was also performed. The linear load consists of a resistor and inductance per phase with 50 Ω and 0.03 mH for phase 1, 32 Ω and 0.03 mH for phase 2 and 64 Ω and 0.03 mH for phase 3. For the non-linear load, A new set of tests with linear and non-linear loads was also performed. The linear load consists of a resistor and inductance per phase with 50 Ω and 0.03 mH for phase 1, 32 Ω and 0.03 mH for phase 2 and 64 Ω and 0.03 mH for phase 3. For the non-linear load, A new set of tests with linear and non-linear loads was also performed. The linear load consists of a resistor and inductance per phase with 50 Ω and 0.03 mH for phase 1, 32 Ω and 0.03 mH for phase 2 and 64 Ω and 0.03 mH for phase 3. For the non-linear load, a single-phase diode rectifier per phase with an output capacitor and resistors in parallel was considered. For the output capacitor, a value of 1000 µF was used, while for the resistors the values were 160 Ω, 240 Ω and 120 Ω for phases 1, 2 and 3, respectively. As in the previous tests, several types of compensation, namely sub-, full and overcompensation, were also considered. The obtained results for the test in subcompensation mode can be seen in Figure 17a-c. The non-linear characteristics of the load can be seen in Figure 17a. The other two figures show that the imbalance of the grid currents is reduced. One fact that is possible to verify is that in the presence of non-linear loads the AC PV system currents are practically sinusoidal. This confirms that the system only compensates the unbalanced active power of the load. The advantage of this compensation is that the PV multilevel inverter does not need to present an important size gap. This aspect can be better observed through the results obtained in full compensation mode, which can be seen in Figure 18. Through these results, it is possible to verify that the grid currents are not zero. However, these currents are practically associated with the harmonics of the non-linear load current (the fundamental component is practically removed). Regarding the results in overcompensation mode, which are presented in Figure 19, they show that the grid currents are now in the opposite phase to the grid voltage. This shows that the PV system generates higher active power than the load. However, the harmonics are still reflected in these currents. This last result also shows that the imbalance of the grid currents becomes very small. a single-phase diode rectifier per phase with an output capacitor and resistors in parallel was considered. For the output capacitor, a value of 1000 μF was used, while for the resistors the values were 160 Ω, 240 Ω and 120 Ω for phases 1, 2 and 3, respectively. As in the previous tests, several types of compensation, namely sub-, full and overcompensation, were also considered. The obtained results for the test in subcompensation mode can be seen in Figure 17a-c. The non-linear characteristics of the load can be seen in Figure 17a. The other two figures show that the imbalance of the grid currents is reduced. One fact that is possible to verify is that in the presence of non-linear loads the AC PV system currents are practically sinusoidal. This confirms that the system only compensates the unbalanced active power of the load. The advantage of this compensation is that the PV multilevel inverter does not need to present an important size gap. This aspect can be better observed through the results obtained in full compensation mode, which can be seen in Figure 18. Through these results, it is possible to verify that the grid currents are not zero. However, these currents are practically associated with the harmonics of the non-linear load current (the fundamental component is practically removed). Regarding the results in overcompensation mode, which are presented in Figure 19, they show that the grid currents are now in the opposite phase to the grid voltage. This shows that the PV system generates higher active power than the load. However, the harmonics are still reflected in these currents. This last result also shows that the imbalance of the grid currents becomes very small.  Tests with the same non-linear load, but in which the compensation scheme for both active and reactive unbalanced components and harmonics of the load was used, were also performed. To see the impact of this new compensation scheme, tests for sub-, full and overcompensation were again performed. The results of the first test (for the subcompensation mode) are presented in Figure 20. These results show that now the load current harmonics are reflected in the AC current of the PV generator. Therefore, now the current amplitude of the grid currents becomes reduced when compared with the previous test (Figure 17c). The impact of this new scheme can be better seen with the full compensation mode. The obtained results for this compensation mode are presented in Figure 21. Analyzing these results, it is possible to verify that now the currents of the PV system (Figure 21a) are practically equal to the load currents ( Figure 17a). Therefore, the grid currents become practically zero, showing the complete compensation that can be achieved with this scheme. The compensation of the reactive harmonics can also be seen with the obtained results for the overcompensation mode, as presented in Figure 22. Now the grid currents are practically sinusoidal, showing that the harmonics were almost all removed. The grid currents are also practically balanced (Figure 22b), showing that the imbalance of the load was not reflected into the grid. Tests with the same non-linear load, but in which the compensation scheme for both active and reactive unbalanced components and harmonics of the load was used, were also performed. To see the impact of this new compensation scheme, tests for sub-, full and overcompensation were again performed. The results of the first test (for the subcompensation mode) are presented in Figure 20. These results show that now the load current harmonics are reflected in the AC current of the PV generator. Therefore, now the current amplitude of the grid currents becomes reduced when compared with the previous test (Figure 17c). The impact of this new scheme can be better seen with the full compensation mode. The obtained results for this compensation mode are presented in Figure 21. Analyzing these results, it is possible to verify that now the currents of the PV system (Figure 21a) are practically equal to the load currents ( Figure 17a). Therefore, the grid currents become practically zero, showing the complete compensation that can be achieved with this scheme. The compensation of the reactive harmonics can also be seen with the obtained results for the overcompensation mode, as presented in Figure 22. Now the grid currents are practically sinusoidal, showing that the harmonics were almost all removed. The grid currents are also practically balanced (Figure 22b), showing that the imbalance of the load was not reflected into the grid. Tests with the same non-linear load, but in which the compensation scheme for both active and reactive unbalanced components and harmonics of the load was used, were also performed. To see the impact of this new compensation scheme, tests for sub-, full and overcompensation were again performed. The results of the first test (for the subcompensation mode) are presented in Figure 20. These results show that now the load current harmonics are reflected in the AC current of the PV generator. Therefore, now the current amplitude of the grid currents becomes reduced when compared with the previous test (Figure 17c). The impact of this new scheme can be better seen with the full compensation mode. The obtained results for this compensation mode are presented in Figure 21. Analyzing these results, it is possible to verify that now the currents of the PV system (Figure 21a) are practically equal to the load currents ( Figure 17a). Therefore, the grid currents become practically zero, showing the complete compensation that can be achieved with this scheme. The compensation of the reactive harmonics can also be seen with the obtained results for the overcompensation mode, as presented in Figure 22. Now the grid currents are practically sinusoidal, showing that the harmonics were almost all removed. The grid currents are also practically balanced (Figure 22b), showing that the imbalance of the load was not reflected into the grid. The performance of the system in response to several types of faults in the low-voltage grid was also assessed. A first test in which a phase-to-ground fault in the PV generator in subcompensation mode with a linear load and compensation of the active The performance of the system in response to several types of faults in the low-voltage grid was also assessed. A first test in which a phase-to-ground fault in the PV generator in subcompensation mode with a linear load and compensation of the active The performance of the system in response to several types of faults in the low-voltage grid was also assessed. A first test in which a phase-to-ground fault in the PV generator in subcompensation mode with a linear load and compensation of the active The performance of the system in response to several types of faults in the low-voltage grid was also assessed. A first test in which a phase-to-ground fault in the PV generator in subcompensation mode with a linear load and compensation of the active power imbalance was performed. This type of fault affects the voltage of the line under fault, namely with a reduction in its amplitude. In Figure 23, the obtained results for a fault of this type in phase A are shown. The fault occurs from 0.4 s to 0.5 s, whereby the voltage amplitude of that phase is reduced by 50%. Due to the fact that the load is linear, the amplitude of the current associated with the faulty phase is also reduced. However, the PV generator is not affected, since it keeps the power injected into the grid. In the grid current associated with the faulty phase, it is possible to verify that during the fault, there is a phase inversion because the load current of that phase reduces and the PV current is kept. Another test was performed, although in this case for a phase-to-phase fault in phases B and C. This fault affects the voltages in phases B and C, namely with a reduction of 50 % (Figure 24a), meaning there are two phases that are affected, which can be seen from the grid currents presented in Figure 24c. The power injected by the PV generator is not affected (Figure 24b). A test for the three-phase fault was also performed. The obtained results are presented in Figure 25. As expected, now the fault affects all phases. Since the power injected by the PV generator is maintained during the fault, there are increases in grid current amplitude and phase inversion for all phases. power imbalance was performed. This type of fault affects the voltage of the line under fault, namely with a reduction in its amplitude. In Figure 23, the obtained results for a fault of this type in phase A are shown. The fault occurs from 0.4 s to 0.5 s, whereby the voltage amplitude of that phase is reduced by 50%. Due to the fact that the load is linear, the amplitude of the current associated with the faulty phase is also reduced. However, the PV generator is not affected, since it keeps the power injected into the grid. In the grid current associated with the faulty phase, it is possible to verify that during the fault, there is a phase inversion because the load current of that phase reduces and the PV current is kept. Another test was performed, although in this case for a phase-to-phase fault in phases B and C. This fault affects the voltages in phases B and C, namely with a reduction of 50 % (Figure 24a), meaning there are two phases that are affected, which can be seen from the grid currents presented in Figure 24c. The power injected by the PV generator is not affected (Figure 24b). A test for the three-phase fault was also performed. The obtained results are presented in Figure 25. As expected, now the fault affects all phases. Since the power injected by the PV generator is maintained during the fault, there are increases in grid current amplitude and phase inversion for all phases.

Discussion
There are several factors that must be considered when it is intended to provide PV generators the capability to provide ancillary services associated with the load imbalance.

Discussion
There are several factors that must be considered when it is intended to provide PV generators the capability to provide ancillary services associated with the load imbalance. The first factor to consider is the choice of the inverter topology, since a four-wire, threephase inverter must be considered instead of the classical three-wire inverter. Several studies, such as [19][20][21][22][23], have addressed this issue using classical two-level voltage source inverters with four wires. However, in this kind of load imbalance compensation, since in unbalanced mode the currents can be higher than in balanced mode (for the same output power), higher DC voltages applied to the DC side of the inverter are required. Thus, this work addresses all of these aspects, since a solution with two four-wire inverters is adopted, in which it is possible to apply a maximum AC voltage level that is double that of each inverter's DC voltage. On the other hand, due to the known advantages of the multilevel inverters, a solution in which the two inverters provide that capability was proposed. This scheme keeps the modularity of the classic two-level voltage source inverters. Another aspect that must be taken into consideration is the compensation, as well as the type of load. One of the aspects that is crucial is the cost of the system, which affects the compensation capability. In fact, to introduce the capability to compensate the load imbalance with the PV generator at full power, the inverter should be oversized. Therefore, whether the compensation is full or partial must be addressed. In this context, one of the aspects that was considered was the partial compensation, taking into consideration that the PV generators are typically designed to only inject active power into the grid. Thus, considering this principle, the inverter can be designed to only compensate the active power load imbalances. However, since the load typically is not only resistive, the grid currents at the PCC remain unbalanced. With this compensation type, the power factor in the grid PCC will increase. However, since the amplitude of the currents will decrease, the losses in the system will also decrease. The decrease in this power factor can be achieved by providing full compensation. The problem is that the inverter should be even more oversized. This increase in size depends on the load type, since in the case of non-linear loads, besides the reactive power imbalance, the imbalance of the current harmonics should also be considered. Therefore, this aspect should be carefully analyzed, since the cost of the inverter could show a very pronounced increase. On the other hand, in association with the compensation types, a particular scheme for the PV inverter currents references should be designed. The scheme for the situation in which only the active power imbalance is considered is different than the one that allows for a full compensation of the grid current imbalance at the grid PCC. This aspect was addressed in this work via the presentation of various schemes taking into consideration the adopted unbalanced compensation.

Conclusions
A three-phase, multilevel power converter for grid-connected PV generation systems with capability to grid-inject an unbalanced active power was proposed. This converter is characterized by its modular structure. Therefore, the proposed multilevel inverter consists of two four-leg, two-level inverters that are connected to a three-phase transformer with an open-end winding arrangement. The other side of the transformer is connected to the phases and neutral wires of the grid, compensating for unbalanced loads. For the control of the multilevel inverter AC currents and to balance the DC buses, a control scheme based on a voltage PI compensator, sliding mode current controller and vectorial voltage modulator was developed. Furthermore, schemes to generate the current references were proposed, allowing the compensation of load imbalances. These schemes consider several aspects, ranging from the linear and non-linear load to assessing whether the PV generator should also compensate for unbalanced current reactive components or harmonics. This resulted in an effective multilevel converter and control scheme that transferred to the grid the energy generated by the PV panels in a way that provided grid support in the form of ancillary services to compensate for different types of unbalanced loads. The proposed power condition system and control approach were tested through several computer simulation tests. The obtained results with the system operating in steady state and transient conditions were in good accordance with the proposed theoretical model.