Performance Evaluation of an Active Neutral-Point-Clamped Multilevel Converter for Active Filtering in G2V-V2G and V2H Applications

This paper presents the performance evaluation of a proposed single-phase bidirectional active neutral-point-clamped (ANPC) five-level converter (5LC) for active filtering in grid-to-vehicle (G2V), vehicle-to-grid (V2G) and vehicle-to-home (V2H) applications. In the system, the 5LC is series-connected with an electric vehicle battery charger based on a dual active half-bridge DC-DC converter (DAHBC). A cascaded strategy with a proportional-resonant compensator controls the 5LC whereas the DAHBC is controlled by a single phase-shift technique. A performance comparison is carried out for the proposed topology versus three NPC/ANPC 5L converters found in literature with similar topologies. The simulation results obtained in MATLAB-SimPowerSystems along with the experimental results obtained from a laboratory prototype validate the following: a) the first two literature topologies have the highest efficiencies, but they are incapable of balancing the voltage of the split-capacitors what increases the total harmonic distortion of both the grid current in the G2V/V2G modes and the 5LC output voltage in the V2H mode while producing a sluggish transient response, b) the 3rd literature topology like the proposed one properly balance the capacitors voltage and achieve a faster dynamics, but at the expense of an efficiency reduction, and c) unlike the former topology that continuously applies a natural but wasting unfedback voltage balancing strategy, the proposed one that includes a closed-loop control allows achieving an ANPC 5LC with a superior performance featured by a higher efficiency, a reduced switches stress, a flatter power losses distribution and a better power quality improving under the three modes of operation.


I. INTRODUCTION
Multilevel converters (MC) are fastly evolving and amazingly spreading in all power electronics applications, e.g., photovoltaics, wind generators, electric vehicles (EV), battery chargers, electrical machine drives and active power filters [1]. This is mainly due to the fact that in comparison with the traditional two-level converters, MC feature a lower dV /dt stress, a lower electromagnetic interference The associate editor coordinating the review of this manuscript and approving it for publication was Chi-Seng Lam . and a reduced size/cost of the required output passive filter while being capable of fault-tolerant operation as well as of handling high-voltage and high-power [2]. MC alike provide a voltage signal with a lower harmonic content and achieve it using a lower switching frequency, what represents an important advantage in terms of switching losses reduction [3]. Thus, MC are particularly a promising solution for developing more performant active filters that not only improve the power quality but also allow a more efficient power conversion [4]. The main topologies of MC are the flying capacitor (FC), the cascaded H-bridge (CHB) and VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ the neutral point-clamped (NPC) which also comprises the active-NPC (ANPC) subtopology [5]. Unlike the CHB, the NPC/ ANPC only requires one isolated DC source whereas in contrast with the FC, it can reliably operate at low switching frequencies and does not need pre-charging the capacitors at start-up [6]. Nevertheless, the NPC/ANPC inherently presents the voltage unbalancing phenomenon of its DC-link split-capacitors due to the non-zero average neutral current drawn over a fundamental frequency period. Therefore, it necessarily requires the implementation of voltage balancing compensating strategies [7], [8].
In spite of this requirement, three-level [9], five-level [10] and even seven-level [11] NPC/ANPC converters have been successfully applied in shunt active power filters (SAPF) for power quality improvement. In applications where these converters are further series-connected with an EV battery charger, the power transfer between the battery, the grid and the load can be controlled, thus giving rise to three possible operation modes, i.e., grid-to-vehicle (G2V), vehicle-to-grid (V2G) and vehicle-to-home (V2H) [12], [13]. The disregard of the split-capacitors voltage imbalance in the NPC/ANPC topologies results in a distorted output voltage from the converter [14]. However, under the G2V/V2G modes, this distortion is not of fairly importance since its detrimental effect on the grid current quality is in turn compensated by the active filtering algorithm. Such self-compensation also occurs in applications of pure active filters with no EV battery charger connected [15]. Nevertheless, as it will be further shown, their filtering dynamic response becomes sluggish and the converter cannot compensate for fast disturbances. In contrast, under the V2H mode, where the converter works as a conventional inverter with no power quality compensation capabilities, the voltage imbalance of capacitors becomes quite critical, since the load is being fed by a highly distorted voltage [16]. Over the last years, various NPC/ANPC five-level converters have been developed [17]- [19]. In [17], an NPC 5LC based on a topology with a reduced devices count is proposed. This single-phase converter rises from merging one leg of a conventional three-phase 2-level converter and one leg of a three-phase 3-level NPC converter. The resulting converter consisting of only six switches and two clamping diodes is advantageous in terms of a lower cost and complexity. Nevertheless, the reduction in the number of switches also eliminates the redundant switching vectors required to counteract the voltage unbalancing of split-capacitors. The distortion produced in the multilevel output voltage due to this phenomenon generally is disregarded in active filters given that the distortion produced in the grid current is concurrently improved by the implemented power quality strategy [20]. A single-phase hybrid Si/SiC ANPC 5LC is proposed in [18]. The devised topology is obtained by replacing the two clamping diodes in [17] with switches, thus having a total of eight. The addition of these two switches allows increasing the number of switching states and in turn the available current flowing paths. By selecting them according to a particular modulation scheme, the conduction losses are properly reduced. Nevertheless, within these extra switching states there are no flowing paths neither for generating a positive voltage from the upper capacitor nor a negative voltage from the lower capacitor. Thus, when the 5LC outputs half the DC bus voltage, the charging and discharging of split-capacitors cannot be regulated, and nothing can be done to counteract the voltage imbalance. Unlike [17] and [18], the symmetrical ANPC 5LC proposed in [19] is capable of balancing the split-capacitors voltage. This topology consists of four high frequency switches commutating at twice the pulse width modulation (PWM) carrier signal and four low frequency switches that change their state with the polarity of the modulating signal. Advantageously, this ANPC 5LC has two redundant vectors to output a positive voltage from either of the capacitorsand two more vectors to output a negative voltage also from either of the capacitors. Given that the modulation strategy applies the corresponding couple of redundant vectors within a switching period, thus the charging and discharging of the capacitors is the same, and consequently, the unbalancing is naturally compensated. Nevertheless, this continuous and arbitrary alternation of the redundant vectors without considering a feedback measurement, not only results in an increment of the switching power losses and a reduction of the converter efficiency but also in a higher stress of the high frequency switches.
This paper presents the performance evaluation of a proposed ANPC 5LC for active filtering in G2V, V2G and V2H applications. A performance comparison based on simulation and experimental results is carried out for the proposed topology versus three NPC/ANPC 5L converters found in literature with similar topologies [17]- [19]. The main contributions of this work are as follows: • In contrast with [17] and [18], the proposed topology is capable of balancing the voltage of the DC-link splitcapacitors. Thus, achieving a high-performance during transients in the V2G/G2V modes as well as providing a high-quality voltage signal during a power outage in the V2H mode [12], [21].
• Unlike [19], in the proposed topology, the alternation between the charging and discharging switching redundant vectors is not performed arbitrarily but as required in function of the voltage difference polarity and the direction of the 5LC current flow. As a result, a higher efficiency, a reduced switches stress and a flatter power losses distribution is achieved.
• The four presented NPC/ANPC 5L converters working as a SAPF in conjunction with a series-connected DAHB EV charger in the G2V/V2G modes and functioning within an uninterruptible power supply (UPS) unit for feeding the home loads during a power outage in the V2H mode have been neither studied nor compared in the past, thus the included analysis and results are new unpublished material. This paper is organized as follows: section II describes the power electronics system under study, the compared four NPC/ANPC 5L topologies, the DAHBC and the interconnected LCL passive filter. The cascaded control strategy for the 5LC as well as the single phase-shift (SPS) control technique for the DAHBC are described in section III. Section IV presents the simulation results obtained with MATLAB-SimPowerSystems in both steady and transient state conditions. The experimental results for various scenarios under the three modes of operation as well as the power quality analysis and the power losses distribution study are presented in section V. Finally, the conclusion and some important remarks are provided in section VI.

II. POWER ELECTRONICS SYSTEM UNDER STUDY
The scheme of the overall system under study is shown in Figure 1. It consists of the 5LC, the DAHBC, the LCL filter, the EV battery, the single-phase grid as well as of the linear and nonlinear loads.

A. FIVE-LEVEL BIDIRECTIONAL CONVERTER
The electric circuit of the 5LC used as SAPF and frontend converter for regulating the transfer of energy in the three operation modes, i.e., G2V, V2G and V2H is shown in zone D of Figure 1. This 5LC works as an inverter (DC to AC) and also as a rectifier (AC to DC) depending on the operation mode and working point. It is noteworthy that due to its higher number of levels, it will inherently allow a better compensation of the grid current harmonics in comparison with 2-level and 3-level based-converter topologies [4]. Figure 2 shows the four topologies of the NPC/ANPC 5L converters analyzed in this paper [17]- [19]. The topology of the 5LC proposed in this study for working as an active filter has been previously analyzed and validated in [16]. The switching states SS k , the state of the switches S 1−10 and the corresponding output voltage V 5LC of such converter considering the voltage balancing condition always activated are shown in Table 1. Note that the voltage unbalance V is defined as V C up − V C low whereas the flow direction of the battery current i bat is given by the sign function sgn.  The NPC 5LC from [17] and the ANPC 5LC from [18] are inherently incapable of balancing the voltage of the split-capacitors because they cannot generate a voltage of half the DC bus from either of the capacitors, thus lacking of the essential current flowing paths for carrying out the VOLUME 10, 2022 charging and discharging process. Unlike [17] and [18], the ANPC 5LC from [19] and the proposed one are capable of balancing the capacitors voltage. In [19], the low frequency switches A-D commutate twice per period of the modulating signal whereas the high frequency switches E-H commutate twice per period of the triangular PWM carrier signal. At each half of this period, an opposite redundant switching vector is applied, thus alternately charging and discharging the upper and lower capacitors, what keeps them quite well balanced. In spite that the proposed topology accounts with two more switches than the one from [19], i.e., ten instead of eight, it presents a little bit higher efficiency and a better distribution of the power losses. This is because in [19], the alternation of the redundant switching vectors is continuously and indistinctly done, irrespective of the neutral current unbalancing conditions whereas in the proposed topology, the alternation between the charging and discharging switching states is carried out only when necessary, according to the sign of the voltage difference and the sign of the output current, thus reducing the stress and the switching losses.

B. DUAL ACTIVE HALF-BRIDGE DC-DC CONVERTER
Several EV charger topologies can be found in literature [22], [23]. However, the dual active full bridge (DAFB) and the dual active half bridge (DAHB) topologies are especially attractive due to the overall benefits of including a highfrequency transformer (HFT). Its main advantage is providing a galvanic isolation for safely interconnecting the EV batteries with the grid and the home load. Bearing in mind that by increasing the operating switching frequency of such converters, the physical size, weight and volume of the required HFT fairly reduce, thus the DAFB and the DAHB configurations are very suitable for EV applications [24].
Although the DAHB has limited resonance capabilities for applying zero-voltage and soft-switching techniques, it consists of only half the switches of the DAFB, what represents a smaller size and a lower cost. Another benefit is the absence of a steady-state DC magnetizing current component within the HFT due to the presence of the capacitors half-bridge [25]. Furthermore, since only half of the DC bus voltage is applied to the switching devices, their stress is lower than in the DAFB where they have to withstand the full DC bus voltage [16]. In spite that the SPS control used in the DAHB has limited degrees of liberty for carrying out the power transfer regulation, this topology is widely adopted due to its high dynamics, reduced complexity and low device count [26], [27].
According to the diagram of Figure 1, the DAHB DC-DC converter is located between the EV batteries and the 5LC. As it can be seen in zone E of this figure, the topology of such buck-boost voltage converter advantageously includes the HF isolation transformer. Besides this component, the DAHBC comprises four switches, two pairs of splitting capacitors and an optional leakage inductor. The direction and magnitude of the power flow is controlled by shifting the phase of the voltages across the terminals of the HFT. With the aim of keeping at minimum the circulating power, the current stress and the power losses in the switching devices, the turns ratio n r of this transformer is selected to be 1:1. The leakage and magnetization inductances of the HFT utilized in this work, the values of the splitting capacitors as well as some other design and operating parameters are provided in Table 2.

C. LCL PASSIVE FILTER
The electric diagram of the single-phase LCL passive filter used for interconnecting the 5LC to the grid and the load as well as for attenuating the HF current harmonics generated in the G2V/V2G operation mode and those of voltage in the V2H mode is shown in zone C of Figure 1.
By applying the Kirchhoff's voltage law (KVL) in the Laplace domain s to the electrical nets on the grid and converter sides, (1)-(2) are obtained. Similarly, by applying the Kirchhoff's current law (KCL) on the LCL node, (3) is derived [28]: where V L g and V L f are the voltages on the inductances L g and L f whereas V LCL is the voltage in the middle of the LCL filter as shown in zone C of Figure 1. By taking i grid and V 5LC as the respective output and input of the system, the equivalent structure for the set of equations (1)-(3) is shown in Figure 3. By substituting (3) into (2) and equating to zero, the following expression is obtained By expanding the terms in (4) and after leaving the converter current i 5LC as a common factor, the former equation is rewritten as By substituting (3) into (1) and assuming V grid (s) = 0, the following equation is derived  . Block diagram of the cascaded control strategy for the 5LC based on PI and PR controllers and the multicarrier PD-PWM modulation [4], [16].
and by solving (6) for the converter current Finally, by substituting (7) into (5) and after reducing the resulting equation, the transfer function between the grid current i grid and the five-level converter voltage V 5LC is given by [29]: The parameters in (8) have been selected for achieving a fairly reduced ripple while bearing in mind the following trade-offs: a) the inductances L f and L g small enough for avoiding large voltage drops in the filter, b) the filter capacitance C f small enough for avoiding a high amount of reactive power interchanged, and c) the value of the damping resistance R f high enough for attenuating the gain at the resonance frequency but not too much in order to limit the power losses of the filter. The numerical values have been obtained following the design procedure presented in [29]- [31]. Table 2 shows the resulting values for the LCL passive filter components. Since the resonance frequency is approximated as [30]: when substituting in (9) the obtained design parameters, it is found that f resonance ≈ 2.25 kHz, thus being properly lower than half the switching frequency f sw/5LC = 5 kHz.

III. CONTROL STRATEGIES OF POWER CONVERTERS A. CASCADED CONTROL OF 5LC
The block diagram of the cascaded control strategy for the 5LC is shown in Figure 4. According to this scheme, the DC bus voltage is regulated by means of the current demanded from the grid or supplied to the grid [4], [16]. Bearing in mind that the proportional-integral (PI) compensator is designed for linear control and acts on DC quantities, the measurement of the DC bus voltage is first low-pass filtered. This also helps to minimize the introduction of oscillations to the control loop that can give rise to instability issues due to the feedback of the same periodical components.  In order to generate the grid current reference i grid * in the G2V/V2G operation modes, a PI controller and a phaselocked-loop (PLL) are used. Note that unlike V dc * , i grid * is not a constant value but a sine wave synchronized with the grid voltage V grid . Given that a PI controller has a limited bandwidth, and hence a poor performance for tracking the sinusoidal harmonic signals found in the grid current, it has been replaced with a proportional-resonant (PR) controller, which has a theoretical infinite gain at the resonance frequency and also a zero steady-state error [17]. In order to properly compensate the grid current distortion, this PR controller has been tuned for the first 37 harmonics. The gains of the controllers PI 1 and PR included in Figure 4 are provided in Table 5 of the appendix. The design and stability analysis of this controller as well as the details about its implementation can be found in [32]. The frequency and phase responses for the resulting set of transfer functions are shown in Figure 5.
In the G2V/V2G operation modes, the voltage reference V 5LC * of the five-level converter is obtained by subtracting VOLUME 10, 2022 the output of the PR controller from the grid voltage V grid . In the V2H mode, V 5LC * is simply obtained from a virtual PLL that outputs a 60Hz sine wave with the same peak voltage of the grid operating in normal conditions. The classical multicarrier phase-disposition (PD) PWM has been used for generating the ten switching signals S 1−10 [4], [14]. A detailed scheme of the PD-PWM block included on the right-hand side of Figure 4 is shown in Figure 6. Note that in this modulation technique, the amplitude of the voltage reference also called modulating signal is first normalized, then divided into fourth vertical sections and finally each of the resulting waveforms is accordingly compared with one of the four synchronized triangular carriers. Figure 7 shows the closed-loop control scheme with the transfer functions involved in the cascaded strategy for regulating the DC bus voltage V dc and the grid current i grid by means of two series-connected controllers [4], [16]. For this, the PLL first synchronizes with the grid voltage V grid and provides a unit sinusoidal signal. Then, it multiplies with the output from the compensator H C V (s) of the outer voltage loop for generating the grid current reference i grid * that becomes the input of the cascaded inner current loop. Later, the output from the compensator H C i (s) becomes the voltage reference V 5LC * of the converter. This voltage is assumed to be ideally synthetized with the ANPC 5LC by means of the multicarrier PD-PWM [4], [14]. Note that the resulting state SS k is sent to the voltage balancing block that finally outputs the switching signals S 1−10 of the converter. The maths behind these cascaded controllers is described in the following.
The outer loop voltage error e V and the inner loop current error e i are defined as [16]: where the superscript * means a reference signal. Bearing in mind that the middle branch of the LCL filter (see zone C of Figure 1) is a low impedance path for the high-frequency harmonics, it is assumed that they are totally filtered out and thus, the low-frequency (LF) currents flowing through the inductances L f and L g are equal. The analysis shown below dealing with only low-frequency signals is a valid approximation since under such condition, the low-frequency harmonics are much more significant that the high-frequency ones, which are ideally attenuated and absorbed by the middle branch of the LCL filter. Hence, by applying the KVL to the simplified power circuit of Figure 1 consisting of the 5LC connected to the single-phase grid through two series inductors, the following equation is obtained: where t means time whereas the terms L f and L g represent the line inductance on the converter side and the grid side, respectively. The variables i grid , V grid and V 5LC are the grid current, the grid voltage and the 5LC output voltage. This voltage can be represented as a function of the duty cycle δ as [4]: By substituting (13) in (12) while assuming an average value for the grid current and the respective duty cycle, the small signal model of the grid current is given by: Assuming that the inner current loop is at least ten times faster than the outer voltage loop, V grid can be seen as a constant value that does not vary with time, thus, V grid (s) = 0. Hence, the transfer function H i (s) for the inner current loop is written as: Bearing in mind that the inner loop deals with the grid current that is an AC quantity, thus a PR controller with a zero steady-state error and a theoretical infinite gain at the resonance frequency has been used. The transfer function H C i (s) of this current controller is given by [32]: where ω h is the angular frequency of the harmonics, and the index h is an odd integer number. After applying the KCL at the node P in the power circuit of Figure 1, the following equations are obtained [16]: . Scheme of cascaded control strategy for the grid-tied five-level converter [4], [16].
where i dc is the DC bus current, i cap is the split-capacitors current and C = C up /2 = C low /2 whereas ω g is the grid angular frequency. By substituting (13) into (20), and the resulting (18)- (20) into (17) while assuming an average value for the grid current and the duty cycle, the small signal model that links up the DC bus voltage with the grid current is found as: By considering in (21) the same assumption as in the inner loop, i.e., V grid (s) = 0, the transfer function H V (s) for the outer voltage loop is expressed as: Bearing in mind that this outer loop deals with the bus voltage that is a DC quantity, thus a classical PI controller has been used. The transfer function H C V (s) of this voltage controller is given by [4]: By programming the transfer functions of the plants (15), (22) as well as the compensators (16), (23) in MATLAB code and using the single-input single-output (SISO) design tool, the gains of the controllers have been accurately tuned until obtaining a good response [4], [16], [32]. The gains of the controllers PR and PI 1 included in (16) and (23) can be found in Table 5 of the appendix.

B. SINGLE-PHASE-SHIFT CONTROL OF DAHBC
The block diagram of the classical SPS control strategy applied to the DAHB DC-DC converter is shown in Figure 8. In the V2G operation mode, the battery discharging is regulated by using only the current control mode whereas in the G2V mode by changing the state of selector 1 also the voltage control mode is used, thus fully implementing the classical constant current (CC) -constant voltage (CV) battery charging technique [13]. It is important to note that in the three modes of operation, e.g., G2V, V2G and V2H, the switching signals G 1 =Ḡ 2 are obtained from the SPS technique whereas G 3 =Ḡ 4 are simply derived from a 50% fixed-duty cycle block.
As it is shown in Figure 8, the selector 2 allows choosing the phase Φ from either the G2V/V2G modes or the V2H mode, respectively. In both cases, the output from either of the PI controllers corresponds to the angle that exists between the pulses G 1 and G 3 . During the G2V mode, the pulses G 1 /G 2    [17] and [18], (Right) [19] and proposed.
lead G 3 /G 4 , whereas in the V2G/V2H modes, the pulses G 1 /G 2 lag G 3 /G 4 , respectively. It is important to note also that during the G2V/V2G modes, the cascaded control strategy regulates the DC bus voltage V dc through the 5LC, whereas in the V2H mode, it is controlled by the SPS strategy by means VOLUME 10, 2022  of the DAHBC [12]. The gains of the controllers PI 2 , PI 3 and PI 4 included in Figure 8 can be found in Table 5 of the appendix. Figures 9-11 show the steady-state results obtained from the four NPC/ANPC 5L converters under study when operating in the G2V, V2G and V2H modes, respectively. The displayed curves are the voltage of upper and lower split-capacitors V C up and V C low , the output voltage of the converter V 5LC , the grid voltage V grid , the grid/load/converter currents i grid , i load , i 5LC as well as the spectrum of either i grid or V 5LC .

A. STEADY-STATE IN G2V, V2G AND V2H MODES
In Figure 9, it can be observed how under the G2V mode, a quite big voltage unbalancing of capacitors is generated with the topologies [17] and [18], and how it is properly compensated with the topology [19] and also with the proposed one. This compensation allows reducing the total harmonic distortion (THD) of the grid current from about 2.8% to 2.2%.  Under the V2G mode, the voltage unbalancing is alike present in [17] and [18] whereas in [19] and the proposed, the voltage of split-capacitors properly overlaps. As a result, the voltage signal provided by both of these 5LC has symmetrical levels as it shown in Figure 10. In this operation mode, the balancing compensation techniques have allow reducing the THD from around 4.3% to 3.9%.
Bearing in mind that under the V2H mode, the full system is off-the-grid, thus no grid voltage and consequently no grid current are available. Hence, Figure 11 shows instead the spectrum of the output voltage from the 5LC. It can be observed how in [17] and [18], the THD of V 5LC is near 8.9% whereas in [19] and the proposed, it is reduced to only 2.4%. Note that under the V2H mode, the waveform of the current supplied by the 5L converter i 5LC becomes the same as that of the load current i load since i grid = 0.  of the DC bus voltage regulation during the step-change in load is very similar for the four 5L converters. However, in [19] and the proposed, the dynamic response of the THD not only presents a lower value but also reaches faster the steady-state conditions. Note also how the responses in [17] and [18] present a higher THD peak value as well as a sluggish dynamics. Given that in the V2H mode, the 5L converters work as a conventional inverter without any active filtering capability, thus [17] and [18] are not able of compensating its self-distortion produced by the voltage unbalancing of the split-capacitors. Therefore, under the V2H operation mode, they provide an output voltage V 5LC with a fairly high THD. In contrast, the balancing strategies applied in [19] and the proposed 5LC allow keeping such THD much below 5%, thus providing a high-quality voltage signal for properly supplying the home loads while fulfilling the standard IEEE 519.

V. EXPERIMENTAL RESULTS
In order to evaluate and validate the performance of the four NPC/ANPC 5L converters, the DAHBC and their control strategies under the three operation modes, they have been implemented and exhaustively tested. Figure 15 shows a close-up view of the prototypes built in laboratory, i.e., the five-level converters, the dual active half bridge DC-DC converter and their drivers. Figure 16 shows the full experimental setup whereas Table 2 provides its design and operating parameters. Figure 17 shows the experimental results obtained from the prototype built in laboratory. With the aim of straightforwardly comparing all of them, they have been organized and presented in three rows having three graphs each. The top and middle rows group the results for the G2V and V2G operation modes whereas the bottom row groups the results for the V2H mode. The particular tests conditions as well as the results for each operation mode are described below.

A. G2V: GRID-TO-VEHICLE
The results shown in Figure 17a correspond to the following sequence of events: • At t = 3s, the battery current reference i bat * is step-changed from −0.2A to −0.4A, where the negative sign of i bat implies that the battery is charging.
• At t = 7s, i bat * is returned back to −0.2A. It can be observed how the battery current properly follows the desired reference. Likewise, the grid current i grid accurately remains in-phase with the grid voltage V grid , thereby confirming that the grid is sending power to the battery. It is noteworthy that in spite of the current step-changes, the voltage unbalancing of split-capacitors is fairly well compensated by maintaining V C up overlapped with V C low at half the DC bus voltage V dc * = 24V. Figure 17b shows the results obtained from a grid voltage sag of 18% while the battery current is regulated at a constant value of −0.4A. From t = 5s, the peak value of V grid is gradually decreased from 22V to 18V. It can be noted that this sag event practically has no influence neither on the DC bus voltage regulation nor in the battery current control. Figure 17c shows the results obtained from a 17% increment in the DC bus voltage. At t = 5s, V dc * is stepchanged from 24V to 28V. Due to the voltage balancing strategy, the upper and lower capacitors properly keep the same voltage during the full test, even when the DC bus voltage variation occurs. Note that the output voltage from the 5LC not only increases quite fast, but also does it while always maintaining its voltage levels accurately symmetric.  Furthermore, the magnitude of the output current from the 5LC does not undergo any visible disturbance in spite of the sudden increment in the DC bus voltage.

B. V2G: VEHICLE-TO-GRID
The results shown in Figure 17d correspond to the following sequence of events: • At t = 3s, i bat * is step-changed from +0.2A to +0.4A. Given that the sign of i bat is positive, thus the battery is discharging.
• At t = 7s, i bat * is returned back to +0.2A. It can be noted that the results are very similar to the ones obtained in the G2V mode. The only noticeable difference is that the magnitude of i grid is lower than in the G2V mode since the battery is now contributing to feed the load. Figure 17e shows the results obtained from a grid voltage swell of 25% while i bat * and V dc * remain at +0.4A and 24V, respectively. From t = 2.5s, the peak value of V grid is gradually increased from 16V to 20V. As with the grid voltage sag, in the G2V mode, this grid voltage swell event has no effect on the battery current while the DC bus voltage alike only undergoes a small disturbance and fastly reaches steady-state. Figure 17f shows the results obtained from a 14% decrement in the DC bus voltage. At t = 1.25s, V dc * is step-changed from 28V to 24V. It is noteworthy how even during this fast DC bus voltage transient that lasts less than two cycles of the grid frequency, V 5LC remains symmetrical. Under these conditions, the battery current regulation loop and the active filtering control also remain unaffected, thus maintaining a high-quality grid current accurately in-phase with the grid voltage.

C. V2H: VEHICLE-TO-HOME
The results shown in Figure 17g correspond to the following event: • At half the time scale, i.e., t = 0.1s, the active filtering algorithm is activated. Therefore, from there on the PR controllers start compensating for the grid current harmonics. Note that during the full test, the grid is still connected at the point of common coupling (PCC) but the battery current flow is maintained at zero. Hence, under such conditions, the proposed 5LC behaves as a pure active filter that compensates the harmonics generated by the nonlinear load. It can be observed how from t = 0.1s, the grid current i grid becomes a sinusoidal waveform while it remains accurately in-phase with the grid voltage V grid . These results mean that the grid is only providing active power whereas the active filter is supplying the reactive power demanded by the nonlinear home load. Figure 17h shows the results obtained from a sudden power outage. At half the time scale, i.e., t = 100ms, the grid is abruptly disconnected from the PCC. It is noteworthy how the V2H operation mode is immediately activated, thereby the battery supplies the power required by the load while the 5LC provides a high-quality voltage signal V 5LC with a very low harmonic content. During this power failure and its restoration, the load is seamlessly and uninterruptedly fed from either of the available power sources [12], [21]. Note that before the transition to the V2H mode, the load voltage waveform V load is the same as that of the grid voltage V grid due to its shunt connection whereas after this transition, the load current i load is equivalent to the converter current i 5LC since they are series connected and the grid current is zero. Thus, the load voltage and load current waveforms are also implicitly shown in this figure. Figure 17i shows the results obtained from an incremental and a decremental step-change in the load current. During the full test, the grid remains disconnected from the PCC while the battery supplies the total power drawn by the load. At t = 90ms, the load is step-changed for producing an increment of 28% in the peak current, thus going from +0.7A to +0.9A. Later, at t = 210ms, the load is changed to its former value so that the peak current returns back to +0.7A, equivalent to a current variation of 22%. From the multilevel voltage signal it can be inferred that the voltage of the DC-link is slightly disturbed by these load changes but it properly reaches steady-state conditions while maintaining V dc * at around 16V. It is also noteworthy how the voltage balancing of split-capacitors is practically unaffected since they keep fairly well its voltage at half of V dc . Figure 18 shows the experimental results obtained from a power quality analysis carried out with the Fluke 43B for a set of exhaustive tests under the three modes of operation, e.g., G2V, V2G and V2H. Figure 18a shows the output voltage V 5LC and current i 5LC from the five-level converter during the G2V operation mode whereas Figure 18b shows the resulting grid voltage V grid and grid current i grid . Note that they are in-phase because the energy is flowing from the grid to the load and the battery. For this reason, the power factor (PF) is also positive. The spectra VOLUME 10, 2022 of i load and i grid are shown in Figures 18c and 18d, respectively. It is noteworthy how due to the active filtering capabilities of the 5LC, the THD of the grid current is reduced from 30% to only 3.9% while the PF is unity. Figure 18e shows the waveforms of V 5LC and i 5LC obtained during the V2G operation mode whereas Figure 18f shows the resulting V grid and i grid . Given that the battery is contributing to feed the load, thus the power provided by the grid is lower than in the G2V mode. Under this condition, the PF remains at 0.99. The spectra of i load and i grid are shown in Figures  18g and 18h, respectively. Observe that the distortion of the grid current is quite good compensated by decreasing its THD from 37.3% to 4.8%. Take into account that in order to send more power from the battery to the grid, the peak magnitude of the grid voltage has been reduced from around 22V to 12V.

D. POWER QUALITY ANALYSIS
Note that the grid voltage conditions are different in the V2G and G2V modes. It has been possible by adjusting the knob of the grid interfacing variable autotransformer shown in Figure 16i. It is important to remark that the magnitude of this voltage has been set only once before starting either the V2G or the G2V tests, and from there on, the knob remained fixed during their progress. Hence, the peak value of the grid voltage was properly kept constant during each of the tests for both operation modes. Figure 18i shows the signals of V grid and i 5LC obtained when the active filtering task carried out by the PR controllers is turned on while the battery current is regulated at zero. Note that these waveforms have been captured with the grid still connected at the PCC. Figure 18j shows the voltage V 5LC and current i 5LC from the five-level converter right after the power outage occurs. Figures 18k and 18l show the spectra of i 5LC and V 5LC , respectively. Given that under the V2H mode, the converter current i 5LC and the load current i load are the same, its spectrum is also implicitly shown in Figure 18k, thus demonstrating the high harmonic content of the load current waveform formerly presented in the second half of the time scale in Figure 17h as well as in Figure 17i. It is noteworthy that even though the 5LC is feeding this highly nonlinear home load, its output voltage has a THD of only 2.5%.
It can be observed that in the three operation modes, the output voltage V 5LC from the 5LC is a high-quality signal with symmetric levels due to the good performance of the balancing strategy for keeping the split-capacitors at the same voltage in spite of the disturbances and testing conditions. Likewise, the transition from the V2G/G2V modes to the V2H mode is seamless for the load since the output from the 5LC is always ready for generating a voltage signal with the same magnitude as that of the grid and also accurately phase-synchronized. Note that the voltage feeding the load before and after the power outage is equal in magnitude but it is generated by the converter once the grid is off.
It is also important to remark that the detection of the power outage has been carried out automatically. For this, the grid voltage signal is first rectified, later low-pass filtered and finally, the obtained DC component is compared with a threshold value. Figure 19 shows the normalized power losses distribution of the four NPC/ANPC 5L converters under study when operating in the G2V, V2G and V2H modes. Take into account that the letters from A to J included on the y-axis label of these 3D graphs allow identifying the corresponding switch within the topologies presented in Figure 2. Bear alike in mind that in the NPC topology [17], I and F are not switches but diodes. Additionally, the blank squares found among the 3D bars mean that such topology does not have that particular switch. According to Table 3, the 5L topologies [17] and [18] present the highest efficiencies in the three modes of operation. Nevertheless, both of them are incapable of balancing the voltage of the split-capacitors since the resulting converters lack of redundant vectors for generating a voltage of half the DC bus, and consequently, the upper and lower capacitors cannot be charged and discharged as required. Unlike [17] and [18], the topology in [19] and the proposed one properly balance the split-capacitors voltage but at the expense of a little bit efficiency reduction.

E. POWER LOSSES DISTRIBUTION
It is noteworthy that even though the proposed topology consists of two more switches than [19], it presents a slightly higher efficiency as well as a better distribution of the power losses. This is because in the proposed 5L converter, the voltage balancing algorithm changes among the charging and discharging switching states only if it is necessary according to the sign of the capacitors voltage difference and the sign of the 5LC output current. On the contrary, in [19], the capacitors are kept balanced by continuously and indistinctly alternating the charging/discharging switching states at a high frequency rate, i.e., twice per period of the carrier signal. Therefore, the highest stress and losses occur in switches E and F under the G2V mode as well as in switches G and H under the V2G and V2H operation modes. Note also how in [19], the lowest power losses occur in the four switches A-D since they commutate at a low frequency rate, i.e., twice per period of the modulating signal.
A comparison of the four topologies considering the number of components, the voltage balancing capability, the switches stress and the overall efficiency is summarized in Table 4.

VI. CONCLUSION
The performance evaluation of the proposed single-phase bidirectional ANPC 5LC for active filtering in G2V, V2G and V2H applications has been presented in this paper. The comparison carried out among the four NPC/ANPC 5L converters showed that the proposed one not only is capable of properly balancing the split-capacitors voltage but also does it optimally by continuously monitoring the sign of the capacitors voltage difference and the direction of the 5LC current. It is noteworthy that in contrast with the literature topologies, the proposed converter achieved a faster dynamics, a higher efficiency, a reduced switches stress and a flatter power losses distribution under the three modes of operation. The PR compensator included in the cascaded control strategy fairly attenuated the harmonics generated by the nonlinear load while maintaining a high-quality grid current with a THD below 5%, an almost zero reactive power and a PF very close to unity in the V2G/G2V modes. Furthermore, when the power outage suddenly occurred, the linear and nonlinear home loads correctly drew the EV battery's energy and they were seamlessly and uninterruptedly supplied. Under this V2H mode, both loads were fed through the 5LC with a five-level voltage signal having a THD of only 2.5%. It is important to remark that the obtained simulation and experimental time domain results along with the indexes and spectra from the power quality analysis, validate the superior performance of the proposed ANPC 5LC functioning as an active filter for improving the power quality when cascaded with an EV charger.