Modeling and Control of a Modular Multilevel Converter Based on a Battery Energy Storage System with Soft Arm State-of-Charge Balancing Control

: Modular multilevel converters (MMCs) with integrated battery energy storage systems (BESSs) are becoming crucial for modern power grids. This paper investigates the modeling and control of a grid-connected MMC-BESS, with a specific emphasis on state-of-charge (SoC) balancing. Compared to conventional hard arm SoC balancing control (HASBC), this paper proposes an alternative soft arm SoC balancing control (SASBC). The simulation results and analysis indicate the following: 1. SASBC provides superior performance in achieving SoC balance both between and within the arms, as compared to HASBC. 2. The MMC-BESS power fluctuates between phases, arms, and individual submodules to balance the SoC of batteries. After the accomplishment of SoC equalization, the power is equally distributed, and the circulating current is well eliminated. 3. MMC-BESS can operate in both the charging and discharging modes, and the total harmonic distortion (THD) of the output current is reduced from 6.80% to 1.13% after SoC balancing is achieved. 4. A robustness test shows the control system’s effective performance in handling component variations.


Introduction
According to the International Electrotechnical Commission (IEC), the share of renewable energy in the global power sector will reach 8108 TWh in the year 2025, representing a 100% increase compared to 2009.The increasing penetration of renewable energy sources has led to a growing need for grid modernization and upgrading the infrastructure to accommodate higher levels of renewable generation.One crucial aspect of grid modernization is addressing increasing voltage level requirements [1].Consequently, the demand for a high-performance, scalable multilevel converter becomes inevitable to efficiently convert power from renewable energy sources to the grid while supporting the transmission of renewable energy over longer distances and reducing transmission losses [2,3].Battery energy storage systems (BESSs) are progressively utilized to balance the variable generation of renewable energy sources and provide grid stability and flexibility while integrating larger amounts of renewable generation.BESSs need to be interfaced with the grid by utilizing advanced power electronics and control systems to enhance flexibility, grid stability, and reliable power flow [4,5].A modular multilevel converter (MMC) is a recent advanced high-power electronic device that is utilized to convert electrical energy between DC and AC [6].The MMC is flexible to scale up or down to meet the power requirements of the system, and it is advantageous for constant balancing generation and load, high system reliability and efficiency, and stable control performance compared to traditional power Energies 2024, 17, 740 2 of 24 converters [7].Therefore, it is prospective to embed a BESS into an MMC and integrate with the grid to support a more sustainable, reliable, and resilient modern grid.
Some of the recent literature has made contributions to the applications of the MMC-BESS system.It is reported that the MMC system with distributed battery sources has higher efficiency, reliability, and versatility compared to the MMC with a centralized BESS [4].For the distributed MMC-BESS, it is crucial to realize the SoC equalization among phases, between upper and lower arms, and among submodules within one arm.The individual SoC balancing [8] can be realized by the carrier rotation method [9,10], sorting algorithm [11][12][13], and modulation reference adjustment [14,15].Leg/phase and arm SoC balancing can be achieved by a zero-sequence injection [15,16], a negative-sequence current injection [17], and circulating current control [18][19][20][21][22][23].Zero-sequence voltage injections and negative-sequence current injections can realize SoC balancing among phases by incorporating deviation power into the input/output power reference.The balancing process needs to be performed in active operation and is not feasible in standby mode.On the other hand, by utilizing circulating current control, the MMC-BESS can achieve phase SoC balancing and arm SoC balancing even in standby mode [8].Specifically, leg SoC balancing is realized by regulating the DC component of the circulating current, and arm SoC balancing is performed by regulating the fundamental component of the circulating current from the three phases of the MMC, which has been discussed in detail in [18][19][20][21][22][23].The method used to balance the SoC between the upper and lower arms by employing fundamental circulating current from the three phases is referred to as hard arm SoC balancing control (HASBC) in this paper.By regulating the fundamental circulating current, the power can be injected into the arms, realizing SoC balancing between the upper and lower arms.In [24], the authors introduced the power control of individual submodules by using a power ratio factor, phase power control by choosing a common-mode voltage, and arm power control by HASBC.Based on the power control of individual submodules, phases, and arms, three-level SoC balancing is realized with a proportional controller.The control methods under DC and AC fault modes were investigated in [25], where HASBC is used to balance the SoC in the DC-side fault mode by injecting fundamental circulating current, and the DC component is regulated to balance the SoC in the AC-side fault mode.The authors in [26] analyzed the gain calculation of the grid-connected power-current double-closed control and proposed a self-adaption control based on an online SoC capacity estimation.The SoC convergence rate and overmodulation of submodules are discussed in [27], which highlights that the methods mentioned above are not always optimal and that SoC may not converge in some cases.For instance, in [28], the SoC will not converge and the system will become unstable when the average power of the arm cannot be equal to zero.Moreover, it is pertinent to acknowledge that, in scenarios involving three-phase variables, the circulating currents are confined solely to the MMC converter, and their total value is inherently constrained to be equal to zero.Assuming the arm SoCs in all three phases are taken into consideration in the control, as in the HASBC, the sum of the generated circulating current references can potentially violate the zero rule and cause conflicts in the arm SoC balancing.For example, from the figure of all SoCs of battery stacks in [21], it can be noticed that during the discharging mode, while all the SoC profiles decline, they can be separated into two groups, which potentially indicates that the SoCs of the upper arm and lower arm are split into two values, which are not well balanced.
Therefore, this paper aims to address the limitations of the HASBC by proposing an alternative soft arm SoC balancing control (SASBC).In the SASBC, rather than the three-phase arm SoCs adopted in the HASBC, two out of the three arm SoCs are taken in the loop, and the minus sum of the produced circulating current references in the selected two phases is considered the third circulating current reference.Compared to the HASBC, the SASBC consistently adheres to the principle of maintaining zero total current flow in the circulating currents.This unwavering compliance not only elevates the efficiency of the balancing operation but also enables a more flexible and effective distribution of the SoCs between and within the arms.Therefore, the SASBC is an advanced and preferable alternative for the SoC management of an MMC-BESS.
The rest of this paper is organized as follows: Section 2 introduces the configuration of the MMC-BESS system and mathematically analyzes the converter behaviors and balancing principles.Section 3 presents control scenarios with respect to the grid-connected power control, the circulating current control, and the SoC balancing control.The results and analysis are described in Section 4 to verify the operating characteristics of the proposed MMC-BESS.Section 5 concludes this paper.

MMC-BESS Configuration
The schematic diagram of the MMC-BESS considered in this paper is illustrated in Figure 1.The MMC-BESS has three phases, and each phase contains two symmetrical arms in the upper and lower branches.In each arm, there are N identical submodules connected in series together with an arm inductor.The arm inductor is able to suppress the MMC-BESS circulating current, limit its fault current, and reduce current ripples.The submodule is integrated with battery banks, one capacitor, and a bidirectional half-bridge converter composed of two power switches with freewheeling diodes.With N submodules per arm, the MMC-BESS can generate three-phase line-to-line AC voltages with (2N + 1) levels.The voltage stress across each semiconductor is restricted to the battery module voltage.The battery pack can either be charged or discharged, depending on the switch's actions and the current direction.
the balancing operation but also enables a more flexible and effective distribution of the SoCs between and within the arms.Therefore, the SASBC is an advanced and preferable alternative for the SoC management of an MMC-BESS.
The rest of this paper is organized as follows: Section 2 introduces the configuration of the MMC-BESS system and mathematically analyzes the converter behaviors and balancing principles.Section 3 presents control scenarios with respect to the grid-connected power control, the circulating current control, and the SoC balancing control.The results and analysis are described in Section 4 to verify the operating characteristics of the proposed MMC-BESS.Section 5 concludes this paper.

MMC-BESS Configuration
The schematic diagram of the MMC-BESS considered in this paper is illustrated in Figure 1.The MMC-BESS has three phases, and each phase contains two symmetrical arms in the upper and lower branches.In each arm, there are N identical submodules connected in series together with an arm inductor.The arm inductor is able to suppress the MMC-BESS circulating current, limit its fault current, and reduce current ripples.The submodule is integrated with battery banks, one capacitor, and a bidirectional half-bridge converter composed of two power switches with freewheeling diodes.With N submodules per arm, the MMC-BESS can generate three-phase line-to-line AC voltages with (2N + 1) levels.The voltage stress across each semiconductor is restricted to the battery module voltage.The battery pack can either be charged or discharged, depending on the switch's actions and the current direction.

MMC-BESS System Modeling
Assuming that there are N submodules in each arm and each submodule battery pack shares the same voltage, then the maximum voltage on each arm is  =  .The upper and lower arms in the same phase are regulated complementarily, with a focus on

MMC-BESS System Modeling
Assuming that there are N submodules in each arm and each submodule battery pack shares the same voltage, then the maximum voltage on each arm is V max = NV BAT .The upper and lower arms in the same phase are regulated complementarily, with a focus on Energies 2024, 17, 740 4 of 24 maintaining the voltage constant between the positive and negative busbars.According to the Kirchhoff voltage law, the voltages in the upper and lower arms are as follows: where v x represents the fundamental output voltage, and all the quantities referred to in the three phases are expressed with the subscript x; v L arm xu and v L arm xl are the voltage drops across the upper and lower arm inductors.Assuming the resistance of the arm inductors is small and can be neglected, the voltage drop across the arm inductors can be calculated by the derivative of the current flowing through them, which is given by the following: where i cirx is the circulating current flowing within the MMC-BESS system, and i x is the output current.The current flowing through the arm inductor is referred to as the upper arm current i xu and lower arm current i xl , which are expressed as i cirx and i x in Equations ( 4) and (5).The relations between the MMC-BESS output current, circulating current, and upper/lower arm current are expressed as follows: The circulating current contains DC and harmonic components, which can be expanded with the Fourier series as follows: where i cirx,dc is the DC component of the circulating current, I cirx,h represents the amplitude of the h-th harmonic component, and φ h is the corresponding phase angle.By substituting Equations (4)-( 7), the MMC-BESS outer and inner dynamic equations can be yielded as follows: As stated in Equations ( 10) and (11), the output current i x can be managed by tuning the difference between the upper arm and lower arm voltages, and by regulating the sum voltage of the upper arm and the lower arm, the circulating current i cirx is under control.Consequently, the voltage difference and sum of the upper arm and lower arm contribute to the output current and circulating current driving voltages, which are presented as follows:

MMC-BESS SoC Balancing Analysis
The battery packs can be discharged and charged by the submodule switching events and current direction.The corresponding battery current can be described by means of battery SoC and capacity as follows: where i xuk and i xlk denote the current flowing into or out of the battery banks in the k-th submodule in the upper arm and lower arm, respectively, Q BAT is the battery capacity, and SoC xuk and SoC xlk are the k-th submodule corresponding SoCs.Based on each single SoC xuk and SoC xlk , the average SoC of the arm, phase, and whole system can be calculated as follows: where SoC xu and SoC xl represent the average upper/lower arm SoCs, SoC x denotes the average phase SoC, and SoC avg is the individual average SoC of the whole MMC-BESS system.Under the assumption of ideal switches and battery packs, the power of the battery packs in each submodule can be obtained by [19] as follows: where p xuk and p xlk are the k-th submodule battery power in the upper arm and lower arm, respectively.Then, the power of the upper arm and lower arm can be calculated by the sum of all independent submodules in that arm, which can be expressed in Equations ( 22) and (23) after being substituted by Equations ( 16) and ( 17): Energies 2024, 17, 740 6 of 24 where p xu and p xl represent the power of the upper arm and lower arm, respectively.According to the arm power and the relationship in Equation ( 18), the power of each phase and its differential value can be obtained as follows: As stated above, the arm power is calculated from the perspective of battery voltage and current.Additionally, arm power can be yielded from the perspective of arm voltage and arm current, as shown below: Similarly, the arm power summation and its difference are yielded as follows: The right sides of Equations ( 24), ( 25), ( 28) and ( 29) are equal to each other.Assuming v x = V x sin(ωt) and i h = I h sin(ωt − φ) and ignoring the alternating terms, the new equations to describe the SoC can be yielded with the substitution of Equation ( 9) into ( 28) and ( 29) (see and Appendices A.1 and A.2): From Equation (30), it is indicated that the DC component of the circulating current can contribute to achieving SoC equalization between different phases in the MMC-BESS.Additionally, Equation (31) shows that the SoC between the upper arm and lower arm can be balanced by adjusting the fundamental component of the circulating current.

MMC-BESS Control Strategy
The control system of the MMC-BESS comprises grid-connected power control, circulating current control, and SoC balancing control.The grid-connected power control is the control top level, which regulates the power exchange between the grid and BESS with a desired output voltage following the grid.The circulating current control is responsible for eliminating the circulating current flowing within the converter, which can be disadvantageous in the steady state of the MMC-BESS.The SoC balancing control consists of three parts: the phase SoC balancing control, the arm SoC balancing control, and the individual SoC balancing control.With the benefit of the SoC balancing control, SoC equalization can be achieved among the phases, arms, and submodules.

Grid-Connected Power Control
The grid-connected power control structure is shown in Figure 2 by using the prominent dual-loop control method in the rotating reference frame.Here, v g is the grid voltage, and the PLL detects and synchronizes with the grid frequency.The outer-loop controller, as the power controller, tracks the commanded active power and reactive power, subsequently producing reference values for the active current i * d and reactive current i * q .The inner-loop controller, tasked with tracking the current references, generates the direct and quadrature voltage components, which are inversely transformed to generate the output voltage reference [7].In terms of power flow, since the proposed MMC-BESS has no external DC link, the power only flows between the battery modules and the AC grid side during both the charging and discharging modes under balanced conditions.Before the realization of SoC balancing, the phase power is redistributed from the phase with a higher SoC to the phase with a lower SoC by using the DC circulating current component, as presented in Equation ( 30).Similarly, arm power is transferred from the arm with a higher SoC to the one with a lower SoC by leveraging fundamental circulating current, as stated in Equation ( 31).Notably, the power flow adjustments made to facilitate SoC balancing remain internal to the converter, even in scenarios of SoC imbalance.Consequently, the power exchange between the battery side of the converter and the AC grid side consistently aligns with the command values P * and Q * .Additional details regarding the implementation of grid-connected power control can be found in reference [26].

Grid-Connected Power Control
The grid-connected power control structure is shown in Figure 2 by using the prominent dual-loop control method in the rotating reference frame.Here,  is the grid voltage, and the PLL detects and synchronizes with the grid frequency.The outer-loop controller, as the power controller, tracks the commanded active power and reactive power, subsequently producing reference values for the active current  * and reactive current  * .The inner-loop controller, tasked with tracking the current references, generates the direct and quadrature voltage components, which are inversely transformed to generate the output voltage reference [7].In terms of power flow, since the proposed MMC-BESS has no external DC link, the power only flows between the battery modules and the AC grid side during both the charging and discharging modes under balanced conditions.Before the realization of SoC balancing, the phase power is redistributed from the phase with a higher SoC to the phase with a lower SoC by using the DC circulating current component, as presented in Equation ( 30).Similarly, arm power is transferred from the arm with a higher SoC to the one with a lower SoC by leveraging fundamental circulating current, as stated in Equation (31).Notably, the power flow adjustments made to facilitate SoC balancing remain internal to the converter, even in scenarios of SoC imbalance.Consequently, the power exchange between the battery side of the converter and the AC grid side consistently aligns with the command values  * and  * .Additional details regarding the implementation of grid-connected power control can be found in reference [26].

Circulating Current Control
The circulating current only flows within the converter system and has little impact on the output current.However, since the circulating current causes distortion in the arm current and additional power losses, it is required to be eliminated.The arm inductor can suppress the circulating current to a certain degree [29], but to fully eliminate it, an active regulator is needed.Since the circulating current is dominated by second-order harmonics, the eliminator is mainly designed to suppress this component.As reported in the literature, the most prominent circulating current control methods are based on a PI controller and a proportional resonant (PR) controller.In this paper, the quasi-PR (QPR) controller is utilized due to its wider bandwidth and more practical implementation compared to the PR controller [30][31][32][33], and the control block diagram is shown in Figure 3.

Circulating Current Control
The circulating current only flows within the converter system and has little impact on the output current.However, since the circulating current causes distortion in the arm current and additional power losses, it is required to be eliminated.The arm inductor can suppress the circulating current to a certain degree [29], but to fully eliminate it, an active regulator is needed.Since the circulating current is dominated by second-order harmonics, the eliminator is mainly designed to suppress this component.As reported in the literature, the most prominent circulating current control methods are based on a PI controller and a proportional resonant (PR) controller.In this paper, the quasi-PR (QPR) controller is utilized due to its wider bandwidth and more practical implementation compared to the PR controller [30][31][32][33], and the control block diagram is shown in Figure 3.The transfer function of the QPR controller is given as follows: where  and  are the proportional and integral coefficients of the QPR controller,  and 2 denote the cut-off and resonant angular frequency.The introduced cutoff frequency can prevent a loss of sensitivity in the QPR controller when the frequency shifts, and the shift should be limited to a range of ∆ = 2% [33].Therefore, the margin of the cut-off frequency can be set as follows: where  is the fundamental frequency, assuming  = 50 Hz, and then the cut-off frequency margin is  ≤ 12.57.The transfer function of the plant is as follows: The open-loop transfer function of the circulating current control can be expressed as follows: The selection of the coefficients of the QPR controller will be discussed in Section 3.3.SoC Balancing Control.In this paper, the coefficients are set as  = 5,  = 250, and  = 8.Given a 10 mH inductor used in the arm, the Bode plot of the circulating current open-loop transfer function can be obtained, as shown in Figure 4. From the Bode plot, it indicates that the circulating current control is stable with a good gain margin and a phase margin of 34.3° at a frequency of 936.5 rad/s.Additionally, it is shown from the Bode plot that the resonant frequency is 628.3 rad/s, aligning with the targeted second-order harmonics.As the frequency increases, a significant decrease in magnitude is observed.This trend is counteracted at the resonant frequency of 628.3 rad/s, where the magnitude increases.This particular characteristic underscores the enhanced capability of the circulating current control to eliminate the component at the specified second-order frequency.The transfer function of the QPR controller is given as follows: where K cirp and K cirh are the proportional and integral coefficients of the QPR controller, ω c and 2ω 0 denote the cut-off and resonant angular frequency.The introduced cut-off frequency can prevent a loss of sensitivity in the QPR controller when the frequency shifts, and the shift should be limited to a range of ∆ f = ±2% [33].Therefore, the margin of the cut-off frequency can be set as follows: where f 0 is the fundamental frequency, assuming f 0 = 50 Hz, and then the cut-off frequency margin is ω c ≤ 12.57.The transfer function of the plant is as follows: The open-loop transfer function of the circulating current control can be expressed as follows: The selection of the coefficients of the QPR controller will be discussed in Section 3.3.SoC Balancing Control.In this paper, the coefficients are set as K cirp = 5, K cirh = 250, and ω c = 8.Given a 10 mH inductor used in the arm, the Bode plot of the circulating current open-loop transfer function can be obtained, as shown in Figure 4. From the Bode plot, it indicates that the circulating current control is stable with a good gain margin and a phase margin of 34.3 • at a frequency of 936.5 rad/s.Additionally, it is shown from the Bode plot that the resonant frequency is 628.3 rad/s, aligning with the targeted second-order harmonics.As the frequency increases, a significant decrease in magnitude is observed.This trend is counteracted at the resonant frequency of 628.3 rad/s, where the magnitude increases.This particular characteristic underscores the enhanced capability of the circulating current control to eliminate the component at the specified secondorder frequency.

SoC Balancing Control
The SoC balancing control contains the phase SoC balancing control, the arm SoC balancing control, and the individual submodule SoC balancing control.In this paper, we propose an alternative soft arm SoC balancing control (SASBC) compared to conventional hard arm SoC balancing control (HASBC).In the HASBC, the circulating current references generated by the arm SoC balancing controller from the three phases are applied to balance the SoC between the upper and lower arms in the three phases.Instead, the components of two phases are utilized in the SASBC, and the minus sum of the produced circulating current references in the selected two phases is taken as the third circulating current reference.
Firstly, in terms of phase SoC balancing, it drives the three-phase  to be the same value as  .If  is less than  , more power tends to be required in the corresponding phase, and vice versa, less power is required.The power distribution among phases is achieved by regulating the DC component of the circulating current.The control scheme is visualized in Figure 5a, where LPF is the low-pass filter to extract the DC component from the circulating current, and the command DC component is generated by the outer-loop controller as follows: where  and  denote the proportional and integral coefficients of the outerloop PI controller.The modulation voltage reference of the phase SoC balancing control is created by the inner controller, which is given by the following: where  and  represent the proportional and integral gains of the inner-loop PI controller.In order to reduce the computational burden, there is no need to detect the current direction.

SoC Balancing Control
The SoC balancing control contains the phase SoC balancing control, the arm SoC balancing control, and the individual submodule SoC balancing control.In this paper, we propose an alternative soft arm SoC balancing control (SASBC) compared to conventional hard arm SoC balancing control (HASBC).In the HASBC, the circulating current references generated by the arm SoC balancing controller from the three phases are applied to balance the SoC between the upper and lower arms in the three phases.Instead, the components of two phases are utilized in the SASBC, and the minus sum of the produced circulating current references in the selected two phases is taken as the third circulating current reference.
Firstly, in terms of phase SoC balancing, it drives the three-phase SoC x to be the same value as SoC avg .If SoC x is less than SoC avg , more power tends to be required in the corresponding phase, and vice versa, less power is required.The power distribution among phases is achieved by regulating the DC component of the circulating current.The control scheme is visualized in Figure 5a, where LPF is the low-pass filter to extract the DC component from the circulating current, and the command DC component is generated by the outer-loop controller as follows: where K SOCxp and K SOCxi denote the proportional and integral coefficients of the outerloop PI controller.The modulation voltage reference of the phase SoC balancing control is created by the inner controller, which is given by the following: where K SOCxp ′ and K SOCxi ′ represent the proportional and integral gains of the inner-loop PI controller.In order to reduce the computational burden, there is no need to detect the current direction.With respect to arm SoC equalization, HASBC is widely applied, where all SoC variables of the three phases are taken into account in the arm SoC balancing control, as shown in Figure 5b.However, the circulating current only flows within the MMC converter, and the sum of the circulating currents is equal to zero.

∑𝑖 = 0 (38)
Assuming the arm SoCs in all three phases are used in the control, as in the HASBC, the sum of the generated circulating current references could potentially violate Equation (38) and cause conflicts in the arm SoC balancing.Therefore, SASBC is proposed where the arm SoCs of two phases are adopted rather than those of three phases, as shown in Figure 5c, and the minus sum of the produced circulating current references in the selected two phases is taken as the third circulating current reference.Similar to the power flow in the phase SoC control scheme, the power is transferred from the arm with the greater SoC to the arm with less SoC.The command for the fundamental component of the circulating current is given as follows: With respect to arm SoC equalization, HASBC is widely applied, where all SoC variables of the three phases are taken into account in the arm SoC balancing control, as shown in Figure 5b.However, the circulating current only flows within the MMC converter, and the sum of the circulating currents is equal to zero.
Assuming the arm SoCs in all three phases are used in the control, as in the HASBC, the sum of the generated circulating current references could potentially violate Equation (38) and cause conflicts in the arm SoC balancing.Therefore, SASBC is proposed where the arm SoCs of two phases are adopted rather than those of three phases, as shown in Figure 5c, and the minus sum of the produced circulating current references in the selected two phases is taken as the third circulating current reference.Similar to the power flow in the phase SoC control scheme, the power is transferred from the arm with the greater SoC to the arm with less SoC.The command for the fundamental component of the circulating current is given as follows: where K SOCarmp and K SOCarmi are the proportional and integral gains of the inner-loop arm SoC controller, respectively.Similarly to the circulating current controller, the QPR controller is adopted to regulate the fundamental harmonics.The final modulation reference of the arm SoC balancing control is expressed as follows: (41) where is the transfer function G cir_1 (s) of the fundamental circulat- ing current controller.For the fundamental current, the plant transfer function is as follows: In Section 3.2, the margin of the cut-off frequency ω c is discussed.ω c is chosen to have a desired bandwidth around the resonant frequency.In the arm SoC balancing control, the resonant frequency is equal to the grid frequency.K cirp_1 should be calculated within the boundary to have a good transient response and stability.It is assumed that the modulation time delay is half of the sampling period T s ; therefore, the transfer function of the modulation PWM can be written as follows [33]: The delay can be approximated by poles and zeros to simplify the calculation with reasonable accuracy by using the first-order Pade approximation, as shown in Equation ( 46).
Substituting Equation (46) into Equation (45), G PW M (s) can be approximated as follows: Then, the boundary of K cirp_1 can be calculated according to the open-loop transfer function G cir_1 (s)G cirP_1 (s)G PW M (s) by using Routh's stability criterion.Assuming G cir_1 (s)G cirP_1 (s)G PW M (s) = N(s)/D(s), the characteristic equation can be yielded as follows: where K is the upper boundary of the proportional coefficient under different K cirp_1 values.By using the MATLAB symbolic solver, the boundary of K cirp_1 can be obtained as follows: The value of K cirh_1 is chosen to help eliminate phase and magnitude steady-state errors.Before estimating K cirh_1 , the corresponding phase margin ϕ m can be assumed according to [34] as follows: where α c denotes the crossover frequency, and the time constant τ i can be obtained approximately by the crossover frequency as follows [35]: Then, the resonant coefficient K cirh_1 can be estimated by considering the time constant in relation to the proportional coefficient K cirp 1 as follows: Given the coefficients K cirp_1 = 10, K cirh_1 = 500, the Bode plot of the fundamental circulating current control is presented in Figure 6 with a good gain margin and a phase margin of 69.3 • at a frequency of 2146 rad/s.The resonant frequency can be observed at 314.2 rad/s.Similar to the second-order circulating current eliminator, the magnitude decreases while the frequency increases, but it is pulled up at the fundamental resonant frequency.This particular characteristic shows the enhanced tracking capability of the fundamental circulating current to balance the SoC between the upper and lower arms.The value of  _ is chosen to help eliminate phase and magnitude steady-state errors.Before estimating  _ , the corresponding phase margin  can be assumed according to [34] as follows: where  denotes the crossover frequency, and the time constant  can be obtained approximately by the crossover frequency as follows [35]: Then, the resonant coefficient  _ can be estimated by considering the time constant in relation to the proportional coefficient  as follows: Given the coefficients  _ = 10,  _ = 500, the Bode plot of the fundamental circulating current control is presented in Figure 6 with a good gain margin and a phase margin of 69.3° at a frequency of 2146 rad/s.The resonant frequency can be observed at 314.2 rad/s.Similar to the second-order circulating current eliminator, the magnitude decreases while the frequency increases, but it is pulled up at the fundamental resonant frequency.This particular characteristic shows the enhanced tracking capability of the fundamental circulating current to balance the SoC between the upper and lower arms.The individual SoC equalization is achieved with a simple PI controller, as shown in Figure 5d, and the sign of the arm current is incorporated to adjust the control signal.
where K indp and K indi are the proportional and integral coefficients of the individual SoC controller.The individual SoC equalization is achieved with a simple PI controller, as shown in Figure 5d, and the sign of the arm current is incorporated to adjust the control signal.

Results and Analysis
In order to explore the operating characteristics of the proposed MMC-BESS, a simulation model was prepared in MATLAB/Simulink ® R2020b.The specification of the simulated MMC-BESS is shown in Table 1.

Results and Analysis
In order to explore the operating characteristics of the proposed MMC-BESS, a simulation model was prepared in MATLAB/Simulink ® R2020b.The specification of the simulated MMC-BESS is shown in Table 1.The MMC-BESS system has 6 submodules in each arm branch, i.e., 36 submodules in total.The nominal voltage of each battery bank is assumed to equal 1000 V.The MMC-BESS is a grid-connected converter used for stationary applications, where the connected grid voltage is RMS 2000 V in phase-to-phase and rotates at 50 Hz.Since the rechargeable batteries need to be charged and discharged from the grid, there are two operation modes in the model, which are the charging mode and the discharging mode.Additionally, the system's nominal power level is ±1 MW.The simulated inductance of the arm inductor is 10 mH, which is obtained as follows [36]: where T S is the switching cycle duration, ∆i L,max is the maximum ripple current, and V arm, max is the maximum arm voltage.
The important input signals of the MMC-BESS system are the active power and reactive power references, which are carried as at time [0 s, 10 s], respectively, as shown in Figure 8. P and Q present the actual active power and reactive power, respectively.Under the regulation of the power controller, the actual active power and reactive power are forced to track the reference values.

Grid frequency 50 Hz Carrier frequency
1 kHz Nominal power level ±1 MW Submodule capacitance 1000 μF Arm inductance 10 mH The MMC-BESS system has 6 submodules in each arm branch, i.e., 36 submodules in total.The nominal voltage of each battery bank is assumed to equal 1000 V.The MMC-BESS is a grid-connected converter used for stationary applications, where the connected grid voltage is RMS 2000 V in phase-to-phase and rotates at 50 Hz.Since the rechargeable batteries need to be charged and discharged from the grid, there are two operation modes in the model, which are the charging mode and the discharging mode.Additionally, the system's nominal power level is ±1 MW.The simulated inductance of the arm inductor is 10 mH, which is obtained as follows [36]: where  is the switching cycle duration, Δ , is the maximum ripple current, and  , is the maximum arm voltage.The important input signals of the MMC-BESS system are the active power and reactive power references, which are carried as  * =  = [−1 MW, 1 MW] and  * =  = [0 W, 0 W] at time [0 s, 10 s], respectively, as shown in Figure 8. P and Q present the actual active power and reactive power, respectively.Under the regulation of the power controller, the actual active power and reactive power are forced to track the reference values.To better explore the power flow and conversion of the MMC-BESS, the power distribution among phases, arms, and individual submodules is demonstrated graphically in Figure 9.The phase power and arm power (Figure 9a) are not equally distributed among phases and arms initially, which happens because at the start of the operation, the phase and arm SoC profiles are not balanced.As aforementioned in the balancing control, more power would be captured by the phase/arm with less SoC, and vice versa.Similarly, Figure 9b provides the individual submodule power distribution of the MMC-BESS.After realizing the SoC balancing, the power is equally distributed among the phases, arms, and individual submodules.To better explore the power flow and conversion of the MMC-BESS, the power distribution among phases, arms, and individual submodules is demonstrated graphically in Figure 9.The phase power and arm power (Figure 9a) are not equally distributed among phases and arms initially, which happens because at the start of the operation, the phase and arm SoC profiles are not balanced.As aforementioned in the balancing control, more power would be captured by the phase/arm with less SoC, and vice versa.Similarly, Figure 9b provides the individual submodule power distribution of the MMC-BESS.After realizing the SoC balancing, the power is equally distributed among the phases, arms, and individual submodules.Under the command of the grid-connected power control, the output voltage of the MMC-BESS matches the rotating grid voltage, and the output current is forced to follow the voltage to contribute to the target power in the charging mode and inversely align with it in the discharging mode, as shown in Figure 10.Under the command of the grid-connected power control, the output voltage of the MMC-BESS matches the rotating grid voltage, and the output current is forced to follow the voltage to contribute to the target power in the charging mode and inversely align with it in the discharging mode, as shown in Figure 10.Under the command the grid-connected power control, the output voltage of the MMC-BESS matches the rotating grid voltage, and the output current is forced to follow the voltage to contribute to the target power in the charging mode and inversely align with it in the discharging mode, as shown in Figure 10.The realization of balancing control is based on controlling the circulating current.The circulating current is calculated by measuring the upper arm and low arm currents.After the balancing achievement, the circulating current is disadvantageous in terms of the arm current quality and power losses, which are required to be eliminated.Figure 11 presents the simulated output current, arm current, and circulating current.From Figure 11a, it is shown that the circulating current reaches 40 A, and the waveforms of the output current and the current in the upper arm and lower arm yield some distortions at the start of the operation.As shown in Figure 11b, the circulating current is eliminated, and the output current and arm current are less distorted in a balanced situation.The realization of balancing control is based on controlling the circulating current.The circulating current is calculated by measuring the upper arm and low arm currents.After the balancing achievement, the circulating current is disadvantageous in terms of the arm current quality and power losses, which are required to be eliminated.Figure 11 presents the simulated output current, arm current, and circulating current.From Figure 11a, it is shown that the circulating current reaches 40 A, and the waveforms of the output current and the current in the upper arm and lower arm yield some distortions at the start of the operation.As shown in Figure 11b, the circulating current is eliminated, and the output current and arm current are less distorted in a balanced situation.The harmonic distortions of the output current are analyzed by fast Fourier transform (FFT), as shown in Figure 12.It is obvious that the quality of the output current is improved from THD 6.80% to 1.13% after balancing is achieved.
To compare the control performance of the HASBC and the SASBC, the SoC profiles under the two control methods are shown separately in Figure 13a,b in terms of phase SoC, arm SoC, and individual SoC.It is noted that the arm SoC profiles with the HASBC cannot be converged to a line, and the individual SoC profiles of phase A split as two bundles, even though the individual SoC profiles of phase B and phase C are well equalized.In contrast, the arm SoC profiles with the SASBC tend to be equal, and the individual SoC profiles of phase A, phase B, and phase C are all well balanced.The SoC profiles are shown in 5 s for the sake of a clear illustration, and more information is shown in Figure 14.The harmonic distortions of the output current are analyzed by fast Fourier transform (FFT), as shown in Figure 12.It is obvious that the quality of the output current is improved from THD 6.80% to 1.13% after balancing is achieved.To compare the control performance of the HASBC and the SASBC, the SoC profiles under the two control methods are shown separately in Figure 13a,b in terms of phase SoC, arm SoC, and individual SoC.It is noted that the arm SoC profiles with the HASBC cannot be converged to a line, and the individual SoC profiles of phase A split as two bundles, even though the individual SoC profiles of phase B and phase C are well equalized.In contrast, the arm SoC profiles with the SASBC tend to be equal, and the individual SoC profiles of phase A, phase B, and phase C are all well balanced.The SoC profiles are shown in 5 s for the sake of a clear illustration, and more information is shown in Figure 14.
Figure 14a,b track the value of the difference/delta between the arm SoCs and their average SoC under the regulation of the hard and soft SoC balancing controls.As shown in Figure 14a, under HASBC, even though the delta arm SoCs in phase B and phase C can be fast-forced to zero, i.e., equalized arm SoCs, the arm SoCs of the phase A upper arm and lower arm are not able to follow the average arm SoC before 100 s, and it takes 66 s in the phase A upper arm to reduce the delta SoC to 0.05% (∆SoC xu/xl = 0.05%) with reference to the average arm SoC.In contrast, as shown in Figure 14b, all arm SoCs in the three phases/six arms can be balanced fast, and it takes 5.1 s to fall into the 0.05% zone under the SASBC.Figure 14c,d depict the SoC gap (delta individual SoC calculated by Equation ( 43)) in phase A under the two control modes.It is obvious that the delta individual SoCs under the HASBC are split into two groups and converge slowly (>100 s) toward zero, taking up to 62.5 s to enter the threshold of 0.05% deviation.However, they are forced to converge at zero rapidly and only take 6.5 s to reach the margin of 0.05% under the SASBC.To summarize, the SoC comparison between the HASBC and SASBC is listed in Table 2 based on Figures 13 and 14.   Figure 15 depicts the SoC profiles of 36 submodules of the MMC-BESS model with the SASBC in both the charging and discharging modes.In Figure 15a, the operation starts in the charging mode and then switches to the discharging mode at 10 s.On the contrary, the operation is shifted from the discharging mode to the charging mode at 10 s in Figure 15b.In both scenarios, it is indicated that all the individual SoCs can be forced to converge on a common average value in the charging mode and the discharging mode.To summarize, the SoC comparison between the HASBC and SASBC is listed in Table 2 based on Figures 13 and 14. Figure 15 depicts the SoC profiles of 36 submodules of the MMC-BESS model with the SASBC in both the charging and discharging modes.In Figure 15a, the operation starts in the charging mode and then switches to the discharging mode at 10 s.On the contrary, the operation is shifted from the discharging mode to the charging mode at 10 s in Figure 15b.In both scenarios, it is indicated that all the individual SoCs can be forced to converge on a common average value in the charging mode and the discharging mode.Considering the robustness of the MMC-BESS, which encompasses numerous submodules and components, evaluating its robustness in response to component variations becomes essential.Consequently, a simulation is conducted for the MMC-BESS, integrating variations in submodule capacitances and arm inductance.The capacitance of the submodule and the inductance of the arm inductor, respectively, exhibit random variations of ±10% around the nominal values.The simulation results, as shown in Figure 16, reveal that the output current, upper and lower arm current, and SoC profiles show little difference from those of the simulation without component variations.Additionally, the circulating current is noticeably higher but acceptable (<2% output current) compared to simulations without these variations.The robustness test shows the control system's effective performance in handling component variations.Considering the robustness of the MMC-BESS, which encompasses numerous submodules and components, evaluating its robustness in response to component variations becomes essential.Consequently, a simulation is conducted for the MMC-BESS, integrating variations in submodule capacitances and arm inductance.The capacitance of the submodule and the inductance of the arm inductor, respectively, exhibit random variations of ±10% around the nominal values.The simulation results, as shown in Figure 16, reveal that the output current, upper and lower arm current, and SoC profiles show little difference from those of the simulation without component variations.Additionally, the circulating current is noticeably higher but acceptable (<2% output current) compared to simulations without these variations.The robustness test shows the control system's effective performance in handling component variations.

Conclusions
The control of a grid-connected MMC-BESS can have three main parts, which are the grid-connected power control, the circulating current control, and the SoC balancing control.This paper focuses on the modeling and control of a grid-connected MMC-BESS, especially its SoC balancing modeling and control.The main contribution of this paper is the first proposal of the alternative SASBC method compared to the corresponding HASBC.The simulation results show the following: 1. Compared to HASBC, SASBC provides better performance in balancing the SoC between and within the arms.In this case, under the control of HASBC, the arm SoCs of the phase A upper arm and lower arm are not able to be equalized before 100 s, and it takes 66 s to reduce the delta SoC to 0.05% with reference to the average arm SoC.In contrast, all the arm SoCs in the three phases/six arms can be balanced fast, and it takes 5.1 s to fall into the 0.05% zone under the control of SASBC.Besides, individual SoCs of phase A under the control of HASBC are split into two groups and exhibit a protracted convergence exceeding 100 s toward zero, requiring 62.5 s to

Conclusions
The control of a grid-connected MMC-BESS can have three main parts, which are the power control, the circulating current control, and the SoC balancing control.This paper focuses on the modeling and control of a grid-connected MMC-BESS, especially its SoC balancing modeling and control.The main contribution of this paper is the first proposal of the alternative SASBC method compared to the corresponding HASBC.The simulation results show the following: 1.
Compared to HASBC, SASBC provides better performance in balancing the SoC between and within the arms.In this case, under the control of HASBC, the arm SoCs of the phase A upper arm and lower arm are not able to be equalized before 100 s, and it takes 66 s to reduce the delta SoC to 0.05% with reference to the average arm SoC.
In contrast, all the arm SoCs in the three phases/six arms can be balanced fast, and it takes 5.1 s to fall into the 0.05% zone under the control of SASBC.Besides, individual SoCs of phase A under the control of HASBC are split into two groups and exhibit a protracted convergence exceeding 100 s toward zero, requiring 62.5 s to reach the 0.05% deviation range.However, they are forced to converge at zero rapidly and only take 6.5 s to reach the margin of 0.05% under the SASBC.

2.
The MMC-BESS power fluctuates between phases, arms, and individual submodules to balance the SoC of batteries, and after the accomplishment of the SoC equalization, the power is equally distributed and the circulating current is well eliminated.

3.
The MMC-BESS can operate in both charging and discharging modes, and the THD of the output current is reduced from 6.80% to 1.13% after SoC balancing is achieved.4.
The robustness test shows the control system's effective performance in handling component variations.

Figure 4 .
Figure 4. Bode plot of the circulating current control.

Figure 4 .
Figure 4. Bode plot of the circulating current control.

Figure 6 .
Figure 6.Bode plot of the fundamental circulating current control.Figure 6. Bode plot of the fundamental circulating current control.

Figure 6 .
Figure 6.Bode plot of the fundamental circulating current control.Figure 6. Bode plot of the fundamental circulating current control.

Figure 7
provides an overview of the control strategy for the MMC-BESS.Firstly, the grid voltage and output current are measured and sent to the grid-connected power control, and the command active and reactive power are assigned to generate the output voltage reference v * x (v * a , v * b , and v * c ).Secondly, the leg SoC balancing control and arm SoC balancing control adjust the references v * phx (v * pha , v * phb , and v * phc ) and v * armx (v * arma , v * armb , and v * armc ) caused by the unbalanced phase and arm SoCs.Then, the circulating current control is used to eliminate the circuiting current by using the command v * cirx (v * cira , v * cirb , and v * circ ).The individual SoC balancing control deals with each submodule SoC and generates the individual SoC control signal v * indxk (v * indak , v * indbk , and v * indck ( k = 1 ∼ 2N)).All reference signals generated by the grid-connected power control, leg/arm/individual SoC balancing control, and circulating current control are combined to generate the final modulation references for each submodule.These references are then sent to the modulator to produce the gating signals for each switch of the submodule to realize the objectives of the control strategy.Energies 2024, 17, x FOR PEER REVIEW 13 of 24 and  are the proportional and integral coefficients of the individual SoC controller.

Figure 7
provides an overview of the control strategy for the MMC-BESS.Firstly, the grid voltage and output current are measured and sent to the grid-connected power control, and the command active and reactive power are assigned to generate the output voltage reference  * ( * ,  * , and  * ).Secondly, the leg SoC balancing control and arm SoC balancing control adjust the references  * ( * ,  * , and  * ) and  * ( * ,  * , and  * ) caused by the unbalanced phase and arm SoCs.Then, the circulating current control is used to eliminate the circuiting current by using the command  * ( * ,  * , and  * ).The individual SoC balancing control deals with each submodule SoC and generates the individual SoC control signal  * ( * ,  * , and  * (  = 1~2 )).All reference signals generated by the grid-connected power control, leg/arm/individual SoC balancing control, and circulating current control are combined to generate the final modulation references for each submodule.These references are then sent to the modulator to produce the gating signals for each switch of the submodule to realize the objectives of the control strategy.

Figure 7 .
Figure 7. Overview of control strategy for MMC-BESS.

Figure 7 .
Figure 7. Overview of control strategy for MMC-BESS.

Figure 8 .
Figure 8. Grid active power (P) and reactive power (Q) at 1 MW charging and 1 MW discharging.

Figure 8 .
Figure 8. Grid active power (P) and reactive power (Q) at 1 MW charging and 1 MW discharging.

Figure 9 .
Figure 9. Power distribution with 1 MW (charging and discharging) operation: (a) phase power and arm power; (b) submodule power.

Figure 10 .
Figure 10.Output voltage and current from charging mode to discharging mode.

Figure 9 .
Figure 9. Power distribution with 1 MW (charging and discharging) operation: (a) phase power and arm power; (b) submodule power.

Figure 9 .
Figure 9. Power distribution with 1 MW (charging and discharging) operation: (a) phase power and arm power; (b) submodule power.

Figure 10 .
Figure 10.Output voltage and current from charging mode to discharging mode.Figure 10.Output voltage and current from charging mode to discharging mode.

Figure 10 .
Figure 10.Output voltage and current from charging mode to discharging mode.Figure 10.Output voltage and current from charging mode to discharging mode.

Figure 12 .
Figure 12.Harmonic distortion analysis of the output current: (a) not balanced; (b) balanced.Figure 12. Harmonic distortion analysis of the output current: (a) not balanced; (b) balanced.

Figure 12 .
Figure 12.Harmonic distortion analysis of the output current: (a) not balanced; (b) balanced.Figure 12. Harmonic distortion analysis of the output current: (a) not balanced; (b) balanced.

Figure 14
Figure 14 compares the hard SoC balancing control and the soft SoC balancing control further based on processed SoC data given by the following: ∆SoC xu/xl = SoC xu/xl − ∑ SoC xu + ∑ SoC xl 6 (55)

Figure 14 Figure 14 .
Figure 14 compares the hard SoC balancing control and the soft SoC balancing control further based on processed SoC data given by the following: Δ / =  / − ∑  + ∑  6 (55)

Figure 15 .
Figure 15.SoC profiles: (a) from the charging mode to the discharging mode; (b) from the discharging mode to the charging mode.

Figure 15 .
Figure 15.SoC profiles: (a) from the charging mode to the discharging mode; (b) from the discharging mode to the charging mode.

Figure 16 .
Figure 16.Simulation results under component variations: (a) arm current and circulating current; (b) SoC profiles.

Figure 16 .
Figure 16.Simulation results under component variations: (a) arm current and circulating current; (b) SoC profiles.

Table 1 .
Specification of the simulated MMC-BESS.