Next Article in Journal
Multi-Scenario Pumped Storage Capacity Timeline Configuration Method Adapted to New Energy Development
Previous Article in Journal
A Hybrid Fuzzy AHP–MULTIMOORA Approach for Solar Energy Development on Rural Brownfield Sites in Serbia
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Battery Power Interface to Mitigate Load Transients and Reduce Current Harmonics for Increasing Sustainability in DC Microgrids

by
Carlos Andrés Ramos-Paja
1,*,
Sergio Ignacio Serna-Garcés
2 and
Andrés Julián Saavedra-Montes
1
1
Facultad de Minas, Universidad Nacional de Colombia, Medellín 050041, Colombia
2
Departamento de Electrónica y Telecomunicaciones, Instituto Tecnológico Metropolitano, Medellín 050013, Colombia
*
Author to whom correspondence should be addressed.
Sustainability 2025, 17(17), 7987; https://doi.org/10.3390/su17177987
Submission received: 5 August 2025 / Revised: 29 August 2025 / Accepted: 1 September 2025 / Published: 4 September 2025

Abstract

In microgrids, battery chargers/dischargers are used to manage power flow between the battery and the DC bus and to regulate the DC bus voltage, ensuring safe operating conditions for sources and loads. These actions contribute to enhancing the sustainability of the microgrid by improving energy efficiency, extending battery life, and ensuring reliable operation. The classical converter adopted to implement the battery chargers/dischargers is the boost converter, which avoids high current harmonic injection into the battery because of its continuous input current. But due to the discontinuous output current, it introduces high current harmonics into the DC bus. This also occurs in Sepic, Zeta, or other DC/DC converters with discontinuous input or output currents. One exception is the Cuk converter, which has both continuous input and output currents. However, in the Cuk converter, the intermediate capacitor voltage is higher than the input and output voltages, thus imposing high stress on the semiconductors and requiring a costly capacitor with high energy storage. Therefore, this paper proposes the design of a battery charger/discharger based on a non-electrolytic capacitor boost converter. This topology provides continuous input and output currents, which reduces harmonic component injection, extends battery life, and increases operation efficiency. Moreover, it requires a lower intermediate capacitor voltage, thereby enhancing reliability. The design of this battery charger/discharger requires an adaptive sliding-mode controller to ensure global stability and accurate bus voltage regulation. A formal stability analysis and design equations are provided. The proposed solution is validated through detailed simulations, while the adaptive sliding-mode controller is specifically tested using a detailed software-in-the-loop approach.

1. Introduction

The sustainability of microgrids can be enhanced by improving energy efficiency, extending component lifespan, and ensuring safe operating conditions for sources, power converters, and loads. Key actions to achieve this include reducing current harmonics [1,2,3,4], which minimizes power losses and extends the lifespan of microgrid components. In addition, accurate regulation of the bus voltage ensures safe operation for all components within the microgrid. Moreover, subtle actions, such as operating the sliding-mode control (SMC) of power interfaces with fixed switching frequency, also contribute to the sustainability of microgrids. The fixed frequency allows for the selection of optimized MOSFET characteristics such as Ton, Toff, and RDS(on), in contrast to selecting components for the worst-case or maximum switching frequency when a range of operation is used. This, in turn, increases efficiency and reduces the overall size of the converter [5,6,7].
Battery-based microgrids rely on chargers/dischargers to control the power flow between the battery and the DC bus. The classical boost converter is widely used for this purpose because of its continuous input current, which reduces harmonic current injections into the battery [1,2,3,4]. In [1], the authors propose a sliding-mode controller for a boost-based charger/discharger, which enhances disturbance rejection while regulating the bus voltage. Reference [2] presents a hybrid optimization method for a battery charger/discharger in a DC microgrid, combining the spider wasp optimizer and the dilated residual network, which reduces system cost and improves the battery power extraction. In [3], a review of soft-switched power-factor-correction (PFC) boost converters is provided, focusing on various PFC techniques and implementations using analog and digital circuits. Similarly, reference [4] compares different PFC topologies, emphasizing the requirements for battery chargers/dischargers, and proposing a cascade of boost and buck converters to maximize efficiency while ensuring proper voltage and current regulation. Despite the benefits of a boost converter, its discontinuous output current introduces significant current harmonics into the DC bus, affecting all connected components. Similar limitations arise in Sepic and Zeta converters, which draw discontinuous input or output currents.
The Cuk converter, in contrast, provides both continuous input and output currents [8], but its intermediate capacitor voltage exceeds both the input and output voltages, increasing stress on semiconductors and requiring a costly capacitor [9,10,11]. In [9], a Cuk converter is used to interface a PV module and a lithium-ion battery in a standalone photovoltaic energy storage system. The study integrates a positive-pulse-current battery charge control algorithm with a hill-climbing MPPT technique to extend the battery lifespan. Reference [10] presents a bipolar converter that combines Sepic and a Cuk converters, leveraging their advantages while using only one active switch, simplifying control circuitry. In [11], a modified Cuk converter is employed as a basic cell in a cascade topology, achieving a high voltage conversion ratio suitable for interfacing with high-voltage buses. Additionally, some Cuk converters operate in discontinuous conduction mode to simplify control circuits and provide power factor correction without an input filter. However, this mode generates high current harmonics at the converter’s output [12]. Despite the advantages of Cuk converters in battery interfacing, the high stress in the intermediate capacitor increases cost, necessitating alternative solutions.
The sliding-mode control is widely used with the classical boost converter in battery chargers/dischargers. SMC is frequently selected because of its robustness, stability, and fast dynamic response. However, its nature leads to the operation of a wide frequency range, which introduces challenges in converter design, such as sizing power components for the worst-case, i.e., the maximum switching frequency. Several authors have proposed using a fixed switching frequency in various applications, commonly reporting a reduction in losses and, in some cases, a decrease in power component size [5,6,7]. In [7], the authors apply a fixed switching frequency to a sliding-mode controller for an energy storage system connected to the electrical grid. They report that their solution eliminates the possibility of DC injection into the grid. In [6], a sliding-mode current controller with fixed switching frequency is applied to a utility interface inverter. The main advantages of this solution are power factor control and minimization of supply current harmonics. In [5], a control algorithm based on three decoupled SMC and three Kalman filters is proposed for a three-phase unity power factor rectifier. In this case, the switching spectrum is concentrated around the desired switching frequency, thus achieving the benefits of a fixed-frequency operation. As shown in these three studies, using a fixed switching frequency, in contrast to a variable switching frequency, reduces power losses and optimizes converter design. These characteristics can be used to enhance the sustainability of microgrids based on power converters.
To address those challenges, this paper proposes a battery charger/discharger based on a bidirectional version of the non-electrolytic capacitor (NEC) boost converter. This solution provides continuous input and output currents while maintaining a lower intermediate capacitor voltage compared to other converters, such as the Cuk structure. The NEC boost structure was introduced by Zhang et al. in [13] for considering an unidirectional power flow; thus, it was not suitable for battery chargers/dischargers. A modification to the NEC structure was developed in [14] to invert the power flow, thus producing an NEC buck converter. In the boost version, the input current is the sum of two inductor currents, and the output current is defined by a single inductor; thus, both input and output currents are continuous. Inversely, in the buck version, the input current is defined by a single inductor, while the output current is the sum of two inductor currents; hence, both input and output currents are continuous. Moreover, due to the circuit structure, the intermediate capacitor voltage is defined by the output voltage in the boost case; however, in the buck case, the intermediate capacitor voltage is defined by the input voltage. This is an advantage over other converters with continuous input/output currents like the Cuk converter, in which the intermediate capacitor voltage is defined by the output voltage divided by the duty-cycle [8], thus leading to very large voltages at low duty-cycles.
The main objective of this paper is to design a battery charger/discharger using a bidirectional NEC boost converter. The continuous input and output currents reduce the high order current harmonics, thus mitigating potential adverse effects on the battery and the load. To ensure proper operation of this battery interface, two controllers are designed: an adaptive sliding-mode current controller, which guarantees global stability of the entire converter, and an adaptive voltage controller to regulate the DC bus voltage, thus ensuring a safe and stable voltage level for all connected sources and loads. In addition, the sliding-mode controller ensures a fixed switching frequency, which enables appropriate component selection and converter design, minimizing high current harmonics, preventing potential damage to the battery, and maintaining power quality within the system. Finally, this paper includes both a formal stability analysis and control design equations to support the proposed approach.
The rest of the paper is organized as follows: Section 2 presents the analysis of the power stage, including the converter’s complete structure; it also describes the differential equations for each operation state and the steady-state relationships among parameters and variables. Section 3 focuses on the adaptive sliding-mode current controller, presenting the transversality, reachability, and equivalent control conditions. Section 4 introduces the adaptive voltage controller design, while Section 5 discusses the design of system components, such as inductors and capacitors. Validation is presented in Section 6 and Section 7: first, a simulation-based application example demonstrates the effectiveness of the design, and then, the implementation of the current and voltage controllers is verified using high-fidelity Software-In-the-Loop (SIL). Finally, the paper concludes in Section 8 with a summary of key findings and future research directions.

2. Power Stage Analysis

Figure 1 shows the circuital model of the proposed battery charger/discharger based on a bidirectional implementation of the NEC converter. The circuit is formed by two inductances L 1 and L 2 , an intermediate capacitor C i , and two MOSFETs driven by the control signal u and its complement u ¯ = 1 u . The NEC converter interfaces a battery v b with a DC bus formed by the capacitance C o ; the circuit also models the aggregated currents of the loads and sources connected to the bus as a single current source i o . In order to provide a realistic representation of the power system, the parasitic resistances on the converter’s elements are also considered: the on-resistance of the MOSFETs ( R o n ), the inductors’ ESR ( R L 1 for L 1 and R L 2 for L 2 ), and the capacitors’ ESR ( R C i for C i and R C o for C o ). Figure 1 also shows the proposed control structure, which is formed by an adaptive sliding-mode controller, used to ensure global stability by regulating both inductor currents in a stable profile, and an adaptive voltage controller, which is designed to regulate the behavior of the DC bus voltage.
Two circuit states are formed depending on the control signal value. The first state occurs when u = 1 ( u ¯ = 0 ), which is depicted at the top of Figure 2. In state 1 the battery charges the inductor L 1 , while the intermediate capacitor C i is discharged to charge the inductor L 2 . State 2 occurs when u = 0 ( u ¯ = 1 ), and it is observed at the bottom of Figure 2. In this second state the battery charges the inductor L 2 , while the capacitor C i is charged. This behavior shows that the C i capacitor is used as an energy buffer for the inductors, isolating one inductor at a time; thus, this intermediate capacitance can be small, which can avoid unnecessarily large energy storage. In addition, Figure 2 shows that the battery current is the sum of the currents in both inductors for the two states, hence it has a continuous waveform. Similarly, the current provided to the DC bus i o u t is the L 2 current ( i o u t = i L 2 ), thus it is also a continuous waveform. Therefore, this power stage provides continuous input ( i b ) and output ( i o u t ) currents. This is an improvement over the classical boost converter that only provides continuous input current, while the output current is discontinuous [15], thus introducing undesired high-frequency harmonics to the DC bus. An alternative converter to provide continuous input and output currents is the Cuk topology, but it has higher voltage stress, as mentioned in the introduction; this aspect will be further discussed afterward.
The differential equations for the inductor currents and capacitor voltages in state 1 are as follows:
d i L 1 d t = v b i L 1 + i L 2 · R o n i L 1 · R L 1 L 1
d i L 2 d t = v C i + v b v C o R C i · L 2 i L 1 + i L 2 · R o n i L 2 i o · R C o i L 2 · R L 2 L 2
d v C i d t = i L 2 C i
d v C o d t = i L 2 i o C o
Similarly, the differential equations for the inductor currents and capacitor voltages in state 2 are as follows:
d i L 1 d t = v b v C i R C i · i L 1 i L 1 + i L 2 · R o n R L 1 · L 1 L 1
d i L 2 d t = v b v C o i L 1 + i L 2 · R o n i L 2 i o · R C o R L 2 · i L 2 L 2
d v C i d t = i L 1 C i
d v C o d t = i L 2 i o C o
Then, combining both states using the MOSFETs control signal u leads to the switched model, which describes all the non-linear dynamics of the power system, including the switching ripple:
d i L 1 d t = v b v C i · u ¯ i L 1 + i L 2 · R o n i L 1 · R L 1 R C i · i L 1 · u ¯ L 1
d i L 2 d t = v C i · u + v b v C o i L 1 + i L 2 · R o n i L 2 i o · R C o R L 2 · i L 2 R C i · i L 2 · u L 2
d v C i d t = i L 1 · u ¯ i L 2 · u C i
d v C o d t = i L 2 i o C o
The average value of the MOSFETs control signal u corresponds to the duty cycle, as given in (13), where T s w is the switching period and d = 1 d is the complementary duty cycle; hence the averaged model of the power system is calculated as reported in (14), (15), (16) and (17).
d = 1 T s w · 0 T s w u d t
d i L 1 d t = v b v C i · d i L 1 + i L 2 · R o n i L 1 · R L 1 R C i · i L 1 · d L 1
d i L 2 d t = v C i · d + v b v C o i L 1 + i L 2 · R o n i L 2 i o · R C o R L 2 · i L 2 R C i · i L 2 · d L 2
d v C i d t = i L 1 · d i L 2 · d C i
d v C o d t = i L 2 i o C o
In addition, the input current, which is equal to the battery current, is given in (18), and the DC bus voltage is reported in (19).
i b = i L 1 + i L 2
v o = v C o + i L 2 i o · R C o
The stable relationships between the inductor currents and capacitor voltages are calculated from the averaged model when the differential equations are equal to zero:
d = x b + x b 2 4 · x a · x c 2 · x a where x a = v o i o · R L 1 + R L 2 x b = v b + 2 · v o + 2 · i o · R L 2 x c = v b v o i o · R o n + R L 2
i L 1 · ( 1 d ) = i L 2 · d
v C i = v o + i o · R L 2 d 1 d · R L 2
In addition, from the charge-balance principle at the bus capacitor, it is concluded that the average current of the inductor L 2 is equal to the load current, i.e.,  i L 2 = i o . Moreover, it must be pointed out that the stable voltage (at null load current) of the intermediate capacitor (22) is equal to the DC bus voltage v o . Instead, the voltage of the intermediate capacitor of a Cuk converter [8] is v o d ; thus, the proposed solution has a lower voltage stress in the components, stores less energy in the intermediate capacitor, and requires a lower voltage rating. Therefore, the topology adopted in this paper provides the same continuous input/output current characteristic available in a Cuk topology, but with lower voltage stress and rating.
Other important measurements are the ripple magnitudes in both inductor currents and capacitor voltages, which are calculated from the differential equations in each state. Those expressions take into account that the switching frequency F s w is the inverse of the switching period T s w , i.e.,  F s w = 1 / T s w , as follows:
Δ i L 1 = v b i L 1 + i L 2 · R o n i L 1 · R L 1 2 · L 1 · F s w · d
Δ i L 2 = v b i L 1 + i L 2 · R o n i L 2 · R L 2 + R C i 2 · L 1 · F s w · d
Δ v C i = i L 2 · d 2 · C i · F s w = i o · d 2 · C i · F s w
Δ v C o = Δ i L 2 8 · C o · F s w = v b · d 16 · L 2 · C o · F s w 2
Δ v o = v b · d 16 · L 2 · C o · F s w 2 + R C o · Δ i L 2
Since the battery current is the sum of both inductor currents (18), and the inductor currents are in phase, as observed in (1) and (2), the ripple in the battery current is as follows:
Δ i b = Δ i L 1 + Δ i L 2
The previous models will be used in the following sections to design the control system and power stage.

3. Adaptive Current Controller

The charger/discharger must operate with positive load current (discharge mode), null load current (stand-by mode), and negative load current (charge mode), which are very different operation conditions. Therefore, classical linear controllers designed for a particular condition could fail at other operation points. This problem is addressed by designing the current controller with the sliding-mode theory, which is able to guarantee global stability for the power converter in the entire operation range.
The first control objective is to ensure the stability of the power system. Analyzing the states in Figure 2, we observe that the intermediate capacitor voltage is the result of the difference between the inductor currents. Therefore, imposing condition (21) between i L 1 and i L 2 ensures the stability of the C i voltage, thus all the system becomes stable. This analysis leads to the following first control objective:
O 1 = i L 2 i L 1 · 1 d d = 0
The second control objective is to regulate the current delivered to the bus capacitor, which will be used by the adaptive voltage controller to regulate the DC bus voltage. Since the first control objective (29) ensures the stable relation between both currents, regulating i L 1 or i L 2 provides the same result, just with a different gain. For mathematical simplicity, the second control objective is defined as given in (30), where i r is the desired reference for i L 1 current.
O 2 = i r i L 1 = 0
Then, combining both control objectives O 1 and O 2 into a single switching function Ψ gives the expression reported in (31). Finally, the sliding surface proposed for the SMC is reported in (32). It must be pointed out that such a sliding surface changes with the duty cycle, hence it is adapted to changes in the operation conditions.
Ψ = i r i L 1 d + i L 2
Φ = Ψ = 0
The conditions needed to ensure a stable operation of an SMC in power converters were established by Sira-Ramirez in [16]: transversality, reachability, and equivalent control conditions. Moreover, Sira-Ramirez demonstrated in [16] that fulfilling both transversality and reachability conditions also ensures the equivalent control condition; thus, the system is globally stable if both transversality and reachability conditions are guaranteed. Those two analyses are performed in the following subsections.

3.1. Transversality Condition

The transversality condition tests the ability of the controller to modify the system trajectory, which is needed to perform any control action. This condition is analyzed by searching for the presence of the control signal u in the derivative of the switching function Ψ ; if it is present, the controller can modify the system behavior. This condition is formalized as follows:
d d u d Ψ d t 0
Therefore, the first step is to calculate the time derivative of the switching function:
d Ψ d t = d i r d t 1 d · v b v C i · u ¯ i L 1 + i L 2 · R o n i L 1 · R L 1 R C i · i L 1 · u ¯ L 1 + v C i · u + v b v C o i L 1 + i L 2 · R o n i L 2 i o · R C o R L 2 · i L 2 R C i · i L 2 · u L 2
Then, evaluating the transversality condition (33) using (34) results in the following expression:
d d u d Ψ d t = v C i + R C i · i L 1 d · L 1 + v C i R C i · i L 2 L 2
In null load current the previous expression fulfills restriction (33) if L 2 d · L 1 . So, there are two options: value (35) must be positive ( L 2 < d · L 1 ) or negative ( L 2 > d · L 1 ). With the aim of ensuring the lowest current harmonics injected into the DC bus, the option with the higher L 2 condition is selected. Finally, the worst-case occurs in charge mode ( i o < 0 ):
L 2 > d · L 1 · v C i R C i · i L 2 v C i + R C i · i L 1 d d u d Ψ d t < 0
In conclusion, designing the power stage with restriction (36) ensures the transversality condition, which makes it possible to implement an SMC based on the switching function (31).

3.2. Reachability Conditions

The reachability conditions analyze the ability of the controller to reach the surface from an arbitrary operation point. This concept is summarized as follows:
  • When the system is operating under the surface Ψ < 0 , then the derivative of the switching function must be positive d Ψ d t > 0 to be able to reach the surface Ψ = 0 .
  • When the system is operating above the surface Ψ > 0 , then the derivative of the switching function must be negative d Ψ d t < 0 to be able to reach the surface Ψ = 0 .
The previous conditions are formalized as follows:
lim Ψ 0 d Ψ d t > 0 and lim Ψ 0 + d Ψ d t < 0
An important aspect of this analysis concerns the control signal value u needed to change the sign of the switching function derivative. This is obtained from the sign of the transversality condition (36), which in this design is negative. This means that a positive change in u produces a negative switching function derivative, while a negative change in u produces a positive switching function derivative. Those conditions complement inequalities (37) as follows:
lim Ψ 0 d Ψ d t u = 0 > 0 and lim Ψ 0 + d Ψ d t u = 1 < 0
Evaluating the practical reachability conditions (38) using the switching function derivative (34) leads to the following restrictions, where the steady-state condition v C i v o is considered. The worst case for inequality (39) occurs in charge condition ( i o < 0 ), and the worst case for inequality (40) occurs in discharge condition ( i o > 0 ).
d i r d t > v b + v o i L 1 + i L 2 · R o n R L 2 · i L 2 L 2 v b + v o i L 1 + i L 2 · R o n i L 1 · R L 1 R C i · i L 1 d · L 1
d i r d t < v b i L 1 + i L 2 · R o n R L 2 · i L 2 R C i · i L 2 L 2 + v b i L 1 + i L 2 · R o n i L 1 · R L 1 d · L 1
In conclusion, fulfilling the dynamic restrictions (39) and (40) is needed to ensure the reachability of the sliding surface. Finally, fulfilling restrictions (36), (39) and (40) ensure the existence of the sliding-mode, which guarantees the global stability of the system (29) to impose i L 1 = i r (30).

3.3. Fixing the Switching Frequency

The theoretical implementation of the SMC control law is extracted from inequalities (38), as follows:
u = 0 if Ψ < 0 1 if Ψ > 0
The main problem of the previous theoretical control law is the infinite switching frequency occurring around Ψ = 0 , i.e., inside the sliding surface. Therefore, it is a common practice to introduce a hysteresis band Δ Ψ , + Δ Ψ to limit the switching frequency, which forms a practical control law:
u = 0 if Ψ < Δ Ψ 1 if Ψ > + Δ Ψ
Then the switching frequency is calculated from the switching function (31) and the inductor ripples (23) and (24). The ripple Δ Ψ in the switching function is calculated as given in (43), which considers that the average value of i L 1 · 1 d is equal to the average value of i L 2 · d (control objective O 1 ), and the average value of i L 1 is equal to i r (control objective O 2 ).
Δ Ψ = Δ i L 2 Δ i L 1 d
Then, defining K L = L 2 / L 1 as the relation between the inductors, and replacing the ripple magnitudes (23) and (24), leads to the following expression for the switching function ripple:
Δ Ψ = d · v b i L 1 + i L 2 · R o n i L 2 · R L 2 + R C i K L v b i L 1 + i L 2 · R o n i L 1 · R L 1 2 · L 1 · F s w
Adapting the hysteresis band using Equation (44) imposes a fixed frequency F s w to the battery charger/discharger. Therefore, this is an adaptive SMC designed to achieve two goals: guaranteeing the desired behavior under any operating condition (adapting Ψ ) and providing a fixed frequency (adapting Δ Ψ ). Such a last characteristic is important since switching power losses increase with the switching frequency as reported in [17]. Similarly, the reliability of switching converters significantly decreases with increments in the switching frequency, as illustrated in [18]. Since Equation (44) shows that a fixed Δ Ψ value results in higher switching frequencies for higher v b and lower duty cycles, adapting Δ Ψ prevents additional power losses and reduces the failure rate in those operation conditions, thus making the battery charger/discharger more sustainable. Finally, the fixed value of the switching frequency must be selected to achieve a balance between size, switching losses, reliability, cost, and dynamic performance: low switching frequencies allow high reliability, reduced switching losses, and low implementation cost; instead, high switching frequencies provide a compact implementation and faster dynamic response.

4. Adaptive Voltage Controller

The adaptive sliding-mode current controller (ASMC) ensures regulated inductor currents, but the bus voltage is not regulated. Therefore, this section proposes an adaptive voltage controller to provide global stability to the DC bus.

4.1. Equivalent Model of the Current Control Loop

The first step is to model the power system under the action of ASMC designed in Section 3. Figure 3 shows, at the top, the circuital equivalent of the system, where the power converter is modeled by a dependent current source with gain 1 d d ; such a gain is calculated from (29) and taking into account that i L 1 = i r due to the ASMC action.
In the equivalent model the ASMC reference is provided by an adaptive voltage controller, and the ASMC output current interacts with both the DC bus capacitor and load current. Equation (45) reports the Laplace equation of the DC bus voltage obtained from the analysis of the output node (A).
v o = 1 + R C o · C o · s s · C o · 1 d d · i r i o
Figure 3 shows, at the bottom, the block diagram of the complete control system, including the structure of the proposed adaptive voltage controller: it is formed by a Proportional-Integral (PI) controller with adaptive parameters, and an adaptive law calculating those parameters. The following transfer function is obtained from that block diagram, which neglects the R o · C o factors since they have n s units ( R o in m Ω and C o in μF ), thus are much faster than the system dynamics:
G v o , i o = v o i o = s C o · 1 + 1 d d · k p · R C o · s 2 + 1 d d · k p · s + 1 d d · k i
The previous transfer function G v o , i o provides the dynamic relation between the DC bus voltage and the perturbations on the bus current, which are introduced by the sources and loads. An important characteristic of G v o , i o is the transfer function modification caused by changes in the operation point (i.e., duty-cycle d), which is the motivation for designing an adaptive voltage controller.

4.2. Design of the Voltage Controller

The main problem of designing a PI controller using transfer function (46) is the coefficient variation depending on the duty cycle. This condition is faced by normalizing those coefficients as reported in Equation (47), which leads to the normalized transfer function G v o N reported in (48). Then, the normalized parameters k p N and k i N are designed with G v o N to ensure the global stability and desired performance in any operation condition.
k p N = 1 d d · k p and k i N = 1 d d · k i
G v o N = v o i o = s C o · 1 + k p N · R C o · s 2 + k p N · s + k i N
The controller is designed considering the strongest current perturbation in the DC bus: a step change in the load current with amplitude δ i o , which depends on the particular application. In the Laplace domain such a current perturbation is formalized as i o = δ i o s . Moreover, this solution considers a unitary damping ratio to avoid large voltage oscillations, thus requiring the relation between k i N and k p N given in (49).
k i N = k P N 2 4 · C o · 1 + k p N · R C o
Then, the bus voltage is calculated as the inverse Laplace transformation v o = L 1 G v o N · δ i o s . The time-domain expression resulting from such a procedure is given in (50), where exp · calculates the exponential function.
v o = G 0 · t · exp t · P 2 where G 0 = δ i o C o · 1 + k p N · R C o and P = k p N C o · 1 + k p N · R C o
The main safety restriction in the DC bus concerns limiting the voltage deviations within a safe band [ M O , + M O ] , which prevents overshoots that could damage the devices connected to the bus and avoids undershoots that could shut down the connected devices. The  M O magnitude corresponds to the maximum deviation of v o , which occurs when the voltage derivative (51) is equal to zero.
d v o d t = G 0 1 p 2 · t · exp t · p 2
Solving d v o d t = 0 leads to the time t M O = 2 P when the maximum voltage deviation occurs. Then, replacing that t M O and solving for v o t = t M O = v r ± M O leads to the k p N value given in (52), which ensures the desired voltage limitation v r M O v o v r + M O .
k p N = 2 · δ i o · exp 1 M O
Finally, the settling time of the bus voltage is calculated from (50) by solving t s in v o t = t s = v r · 1 ± ϵ , where ϵ is the settling-time band; usually ϵ = 2 % , but any other value can be adopted depending on the application.
The practical implementation of the adaptive voltage controller must be performed in terms of k p and k i , thus reversing the normalization process (47) leads to the adaptive law:
k p = d 1 d · k p N and k i = d 1 d · k i N

5. System Component Design

This section describes the selection of the power stage parameters, synthesis of the control algorithm, and implementation of the control law using a switching circuit.

5.1. System Parameters

The first step is to co-design the power stage parameters to ensure the global stability of the ASMC, and to fulfill the current and voltage ripple requirements imposed by the loads and sources connected to the DC bus. Finally, the design of the elements is performed in stand-by mode ( i o = i L 2 = i L 1 = 0 ) to provide compact expressions.

5.1.1. Inductor Design

The transversality condition of the current ASMC requires fulfilling the L 2 restriction given in (36). Therefore, the most extreme case corresponds to the higher d value occurring at the maximum v o condition, i.e., d calculated from (20) with v o = v r + M O . Such a restriction for the inductors is summarized as follows:
L 2 > d m a x · L 1 where d m a x = 1 v b v o + M O
K L = L 2 L 1 K L > d m a x
The value of L 1 is defined to impose a desired current ripple Δ i b to the battery, which is calculated from Equation (28) in stand-by mode, as given in (56). Moreover, L 2 is calculated as given in (57) to fulfill the transversality condition.
L 1 v b · d 2 · Δ i b · F s w · 1 + 1 K L
L 2 = L 1 · K L

5.1.2. Capacitor Design

The reachability conditions of the current ASMC require fulfilling the dynamic restrictions (39) and (40) for the reference current derivative d i r d t , which is generated by the voltage controller. Since the previous i r derivative limits have different magnitudes, the lowest one (in stand-by mode) defines the safe design limit:
lim d i r d t = min v o v b , v b · 1 d · L 1 1 L 2
Therefore, to fulfill the reachability restrictions (39) and (40), we needed to ensure that the maximum value of the reference current derivative is always lower than the limit (58):
max d i r d t < lim d i r d t max d i r d t < min v o v b , v b · 1 d · L 1 1 L 2
The dynamic behavior of the reference current is calculated from the block diagram at the bottom of Figure 3, disregarding the term R C o · C o due to its small value. Then, including the normalization (47), the following expression is obtained:
i r = G i r N · i o where G i r N = k p N · s + k i N C o · s 2 + k p N · s + k i N
Considering the same maximum perturbation i o = δ i o s discussed in the previous section, the time-domain waveform of the reference current is calculated as i r = L 1 G i r N · δ i o s , resulting in the following expression:
i r = δ i o · 1 exp k p N · t 2 · C o + k p N · t 2 · C o · exp k p N · t 2 · C o
Then, the reference current derivative is calculated as given in (62). The maximum value of such a function occurs at t = 0 , resulting in the maximum current reference derivative reported in (63).
d i r d t = δ i o · k p N C o · exp k p N · t 2 · C o k p N · t 4 · C o · exp k p N · t 2 · C o
max d i r d t = δ i o · k p N C o
Replacing Equation (63) into (59) leads to the stability limit of C o :
C o > δ i o · k p N min v o v b , v b · 1 d · L 1 1 L 2
The intermediate capacitor is calculated, using Equation (25), to provide a desired voltage ripple in v C i . From Equations (9) and (10) it is observed that the ripple on v C i affects the inductor current derivatives, hence such a voltage ripple must be small to ensure a high precision on the current ripples magnitude. This condition is needed to ensure an accurate limitation of the switching frequency; therefore, a small ripple (lower than 2 % ) is needed. Finally, C i is calculated by solving (25) as follows:
C i = δ i o · d 2 · Δ v C i · F s w

5.1.3. Synthesis of the System Process

The integration of the electrical components calculation and control design, using a unified process, impose a direct effect of the components values into the system performance (global stability, M O , t s , ripples). The synthesis of such a design process, considering stand-by mode, is reported in Algorithm 1. The first step is to calculate d m a x , which is used to calculate the stable relation K L between the inductors. Since expression (55) provides a minimum value for K L , in Algorithm 1, selecting double the stability limit to account for inductance tolerances is recommended. Then, the stand-by duty cycle is also calculated.
Algorithm 1 Design of the power stage parameters
Require: 
v b , v r , M O , δ i o , F s w , Δ i b , Δ v C i , t s , ϵ
1:
d m a x 1 v b v r + M O
2:
K L 2 · d m a x
3:
d 1 v b v r
4:
L 1 near commercial value of v b · d 2 · Δ i b · F s w · 1 + 1 K L including tolerance
5:
L 2 near commercial value of L 1 · K L including tolerance
6:
C i near commercial value of δ i o · d 2 · Δ v C i · F s w including tolerance
7:
k p N 2 · δ i o · exp 1 M O
8:
repeat
9:
     C o commercial value higher than δ i o · k p N min v r v b , v b · 1 d · L 1 1 L 2 including tolerance
10:
     G 0 δ i o C o · 1 + k p N · R C o
11:
     P k p N C o · 1 + k p N · R C o
12:
     t s * solve ϵ · v r G 0 · t s * · exp t s * · P 2 = 0
13:
    if  t s * > t s  then
14:
         C o decrease to the near commercial value
15:
    end if
16:
until t s * t s
17:
k i N k p N 2 4 · C o · 1 + k p N · R C o
18:
return L 1 , L 2 , K L , C o , C i , k p N , k i N
The next step is to calculate the inductor L 1 to ensure the desired battery current ripple; this selection must take into account the inductor tolerance, hence it is selected as a commercial value higher than the calculated value. The selection of L 2 is performed next, also taking into account the element tolerance. Finally, the intermediate capacitor is also calculated, taking into account the element tolerance.
Then, the normalized parameter k p N of the voltage controller is calculated, which is used in an iterative loop to calculate the bus capacitor to fulfill two conditions: ensure the reachability conditions of the ASMC, and fulfill the desired settling time for the bus voltage calculated from (50). If the settling time is not fulfilled, the  C o capacitor must be decreased until the desired value is reached. Finally, the normalized parameter k i N is calculated.
Algorithm 1 can be executed in any calculation software or programming language, and it can be used to automatize the design process. Section 6 will illustrate this algorithm with an application example.
It must be noted that the minimum value of L 1 is defined (56) to ensure the desired battery current ripple, and the minimum value of L 2 is defined in (57) to ensure stability. Similarly, the minimum value of C o is defined in (64) to ensure stability, and the minimum value of C i is defined in (65) to ensure the desired voltage ripple in the intermediate capacitor. It is recommended to select values around those limits, which would account for the tolerances of the commercial devices. However, values much larger than those limits will increase both the size and cost of the battery charger/discharge; thus, a balance between safe values and cost must be considered.

5.2. Switching Circuit

The next hardware to design is the switching circuit needed to implement the practical control law (42). Such a control law needs two analog comparisons and a memory device to keep the value of u; in addition, the power stage requires the complement of u, i.e.,  u ¯ = 1 u . Those functions are implemented as reported in Figure 4, where two classical (analog) comparators are used to detect the Ψ > + Δ Ψ and Ψ < Δ Ψ conditions. The control signal u and its complement u ¯ are generated using an S-R flip-flop; thus, this compact switching circuit only requires three components: two classical comparators and an S-R flip-flop. The input signals for the switching circuit ( Ψ , + Δ Ψ , and Δ Ψ ) are generated using a digital signal processor (DSP) running the control algorithm described in the next subsection.

5.3. Control Algorithm

The generation of the input signals for the switching circuit, i.e.,  Ψ , + Δ Ψ , and Δ Ψ , requires the measurement of i L 2 ( k ) , v o ( k ) , and v b ( k ) . Then, the instantaneous duty cycle is calculated, which is used to estimate i L 1 ( k ) current and adapt the voltage controller (PI) parameters in real-time. The next step is to calculate the reference current i r for the ASMC as the output of the adaptive PI controller, which is used to calculate the switching function Ψ . Then, the adaptive hysteresis band [ + Δ Ψ , Δ Ψ ] is calculated to provide a fixed frequency. Finally, the switching function ( Ψ ) and the limits of the hysteresis band ( + Δ Ψ and Δ Ψ ) are provided to the switching circuit. This real-time control circuit is summarized in the Algorithm 2, and its effectiveness is validated in Section 6 and Section 7.
Algorithm 2 Control algorithm
Require:  v r , L 1 , K L , F s w , k p N , k i N , Δ T p
1: loop
2:     measure  i L 2 ( k ) , v o ( k ) , v b ( k )
3:      x a ( k ) v o ( k ) i L 2 ( K ) · R L 1 + R L 2
4:      x b ( k ) v b ( K ) + 2 · v o ( K ) + 2 · i L 2 ( K ) · R L 2
5:      x c ( k ) v b ( K ) v o ( K ) i L 2 ( K ) · R o n + R L 2
6:      d ( k ) x b ( K ) + x b ( K ) 2 4 · x a ( K ) · x c ( K ) 2 · x a ( K ) ▹ Calculate the duty cycle
7:      i L 1 ( k ) d ( k ) 1 d ( k ) · i L 2 ( k ) ▹ Estimate i L 1 value
8:      k p ( k ) d ( k ) 1 d ( k ) · k p N ▹ Adaptive k p value
9:      k i ( k ) d ( k ) 1 d ( k ) · k i N ▹ Adaptive k i value
10:      e v ( k ) v r v o ( k ) ▹ Bus voltage error
11:      e v ( k ) e v ( k 1 ) + e v ( k ) · Δ T p ▹ Integral of the error
12:      i r ( k ) k p ( k ) · e v ( k ) + k i ( k ) · e v ( k ) ▹ Current reference for the ASMC
13:      Ψ ( k ) i r ( k ) i L 1 ( k ) d ( k ) + i L 2 ( k ) ▹ Adaptive switching function
▹ Adaptive hysteresis band:
14:      Δ Ψ d ( k ) · v b ( k ) i L 1 ( k ) + i L 2 ( k ) · R o n i L 2 ( k ) · R L 2 + R C i K L v b ( k ) i L 1 ( k ) + i L 2 ( k ) · R o n i L 1 ( k ) · R L 1 ( k ) 2 · L 1 · F s w
15:      e v ( k 1 ) e v ( k ) ▹ Store e v ( k ) value
16:     return  + Δ Ψ ( k ) , Ψ ( k ) , Δ Ψ ( k ) ▹ Signals for the switching circuit
17: end loop

6. Application Example and Simulation Results

The 12 V DC microgrid has been the standard for decades, thanks to the automotive industry. Still, current power demands have pushed it to its limits: high currents generate voltage drops and inevitable thermal losses. Increasing cable thickness is no longer viable due to weight and cost. Therefore, migrating to 48 V is the most practical option.
The 48 V DC bus is emerging as a key solution for increasing energy efficiency and reducing cable weight in high-power applications. In factories and robotics, it powers motors, actuators, and sensors with lower I 2 R losses and better motion control. In hospitals, it powers critical medical equipment, ensuring continuity and safety. Data centers are adopting 48 V racks for servers and GPUs, which reduces distribution losses and improves power density. In telecommunications, it supports 5G base stations and backup systems with 48 V batteries. The automotive industry utilizes it for 48 V mild-hybrid architectures, where it manages start-up, steering, and auxiliary systems, complementing the existing 12 V network. The standardization of 48 V reduces costs, simplifies integration, and accelerates the transition to more efficient and sustainable systems. The integrated converter/controller design proposed in this paper can be applied to multiple industrial systems requiring DC/DC conversions.
The case study proposed in this section illustrates both the design and control processes for the battery charger/discharger. The example, whose requirements are outlined in Table 1, examines the interface between the traditional 12 V DC bus and the promising 48 V DC bus, which is prevalent in multiple industrial applications as previously discussed. The power is limited to 100 W, and therefore, the load current is limited to 2 A. Then, a maximum voltage deviation defined at ±2 V and the settling time at 1 ms ensure compliance with the ISO 21780:2020 standard (mild-hybrid) [19] and with future standards being developed for BEVs (Battery Electric Vehicles) and PHEVs (Plug-in Hybrid Electric Vehicles). The battery current ripple ( Δ i b ) is designed to be a 20% of the steady-state current ( i b ) to prevent damages, while the voltage ripple ( Δ v C i ) in the intermediate capacitor is set to 2% of the steady-state voltage ( v C i ) to avoid large voltage oscillations in the inductors. Finally, the switching frequency of the power stage ( F s w ) is set to 50 kHz to enable the controller implementation in a low-cost device and minimize switching losses.
The parameter calculation is performed following the Algorithm 1. First, the d m a x = 0.76 value is calculated, which leads to K L = 1.5 . Then, d = 0.75 is used to calculate L 1 = 93.75 μ H, and including a 5% tolerance leads to the near commercial values for L 1 = 100 μ H and L 2 = 150 μ H. The commercial inductor PQ108081-101MHF [20] from ITG Electronics (NY, USA) is selected for L 1 , which has an ESR R L 1 = 22 m Ω ; similarly, the commercial inductor 60B154C [21] from Murata Power Solutions (Atlanta, USA) is selected for L 2 , which has an ESR R L 2 = 38 m Ω .
The next calculation yields C i = 15.62 μ F, and including a 20% tolerance leads to the nearest commercial value for C i = 22 μ F; the commercial capacitor R75GW5220AA00J [22] from KEMET (Taipei, Taiwan) is selected, which has an ESR equal to R C i = 2.2 m Ω . The normalized k p N parameter for the voltage controller must be calculated first to ensure the maximum overshoot restriction, resulting in k p N = 0.7358 A/V. Finally, the bus capacitor is calculated as C o = 18.4 μ F, and including a 20% tolerance and 25% for safety factor leads to the commercial value C o = 44 μ F; this value is selected in order to have two parallel-connected 22 μ F R75GW5220AA00J capacitors, which provides redundancy in the case of one capacitor failure, and an ESR equal to R C o = 1.1 m Ω . Following the procedure reported in Algorithm 1, the C o commercial capacitor imposes a settling time of t s = 0.56 ms < 1 ms, thus fulfilling the application requirements. Then, the normalized k i N = 3.0758 kA/(V·s) parameter for the voltage controller is calculated. Finally, two N-channel MOSFETs AOB290L [23] from Alpha & Omega (Sunnyvale, CA, USA) are selected, which have on-resistances R o n = 3.2 m Ω . Table 2 summarizes the system parameters.

6.1. Circuital Simulation of the NEC Battery Charger/Discharger

The proposed power stage (Figure 1) was implemented in the power electronics simulator PSIM ver. 2020 [24] from Powersim (Troy, MI, USA) using the inductors, capacitors and MOSFETs listed in Table 2. Moreover, the switching circuit depicted in Figure 4 was also implemented in PSIM using analog comparators and a flip-flop S-R. Finally, the control algorithm (Algorithm 2) was coded in C-language and implemented in PSIM using a C-block, which simulates the operation of a microprocessor.
The first simulation, reported in Figure 5, considers fast load current perturbations (10 kA/s) with an amplitude of 2 A (as defined in Table 1). Figure 5a shows the system operation under discharge ( i o > 0 ), stand-by ( i o = 0 ) and charge ( i o < 0 ) conditions, where the DC bus voltage v o is stable and constrained to the required safe range [46 V, 50 V]; in addition, the control system ensures a null steady-state error for all conditions. Figure 5a also confirms the correct operation of the current ASMC, since the i L 1 current performs a correct tracking of the reference i r generated by the voltage controller. The stability of the power stage is evident in the stable waveform of v C i , which fulfills the stable relation given in Equation (25). Finally, Figure 5a confirms the continuous condition of the battery current, thus avoiding the large current harmonics present in the classical boost converter.
Figure 5b shows a zoom of the same simulation for the first current transient, i.e., between [6 ms, 6.7 ms]. This figure confirms that the maximum deviation ( M O ) and maximum settling time ( t s ), defined in Table 1, are fulfilled. In addition, the correct tracking of i r is evident, since the average value of i L 1 is equal to i r . Figure 5b depicts the switching function Ψ , which is always trapped inside the hysteresis band ± Δ Ψ , thus confirming the stability of the ASMC. Finally, the continuous waveform of the battery current enables us to calculate the current ripple Δ i b = 1.5 A, which fulfills the design restriction listed in Table 1.
The second simulation, reported in Figure 6, illustrates the capability of the proposed solution to provide a fixed switching frequency. First, Figure 6a shows the system behavior with a classical hysteresis band (fixed Δ Ψ ), which allows a stable operation but with variable switching frequency. The simulation considers ±10% variations in the battery voltage, where the DC bus voltage is correctly regulated with some variations in the voltage ripple. Similarly, the switching function Ψ is trapped inside the hysteresis band, which is constant since Δ Ψ is a fixed value. This classical (fixed) band produces a change in the switching frequency of up to 27%, which is the condition that must be avoided.
In contrast, the operation of the proposed solution based on the adaptive hysteresis band (44) is observed in Figure 6b. This test considers the same variations on the battery voltage, obtaining also a correct regulation of the DC bus voltage with an almost constant ripple. However, in this case, the hysteresis band Δ Ψ is adapted to compensate for the perturbations on v b , ensuring a stable ASMC operation. Finally, this simulation confirms the correctness of the proposed strategy since the switching frequency is constant and equal to the desired value, thus removing the classical disadvantage of sliding-mode controllers.
In conclusion, the NEC converter-based charger/discharger system was simulated at five different operating points, as shown in Table 3. It can be verified that in all cases it meets the requirements listed in Table 1, ensuring global stability and a safe DC bus voltage with a constant switching frequency.

6.2. Comparison with a Classical Battery Charger/Discharger Based on a Boost Converter

The bidirectional boost converter is widely adopted to design battery chargers/dischargers. Such a preference is based on the small size of the circuit, control simplicity, and continuous input current, which prevents high-frequency current components from entering the battery. Figure 7 shows a classical battery charger/discharger based on a bidirectional boost converter, which also includes the parasitic resistances on the MOSFETs, inductor, and bus capacitor. Such a circuit highlights the main problem of this classical solution: the output current i o u t delivered to the DC bus capacitor is defined by the second MOSFET ( M O S 2 ) current, which is discontinuous. This undesired condition forces the bus capacitor ( C o b in Figure 7) to filter the discontinuous output current i o u t , thus requiring a much larger bus capacitor in comparison with the proposed NEC battery charger/discharger.
In order to evaluate the performance of the proposed solution, the parameters and control system of the bidirectional boost converter were calculated following the procedure reported in. Such a calculation was focused on providing a fair comparison; thus, the boost parameters must ensure the same input current ( i b ) and output voltage ( v o ) ripples, with the same switching frequency. The inductor of the boost converter was calculated as L b = 65 μ H, where the commercial inductor 7443783533650 from Wurth Elektronik (Watertown, MA, USA) can be used; such an inductor has a series resistance R L b = 14.44 m Ω and a cost of USD 13.46. Since the bus capacitor must filter the discontinuous output current of the boost structure, achieving the desired output voltage ripple requires a very large bus capacitance C o b = 440 μ F, which is 10 times higher than the bus capacitor of the NEC solution. Such a bus capacitance can be obtained by using 20 parallel R75GW5220AA00J capacitors, resulting in R C o b = 0.11 m Ω . Finally, the MOSFETs are the same ones used in the NEC solution, i.e., AOB290L with R o n = 3.2 m Ω .
Figure 8 shows the circuital simulations of both boost and NEC battery charger/dischargers. The top of Figure 8a reports the input (battery) currents i b imposed by both solutions, where it is confirmed that both converters provide the same current harmonics. This is confirmed at the top of Figure 8b, which shows the single-sided amplitude spectrums of the input currents: both solutions produce the same harmonic content, where the main component occurs at the switching frequency (50 kHz). The middle waveforms in Figure 8a correspond to the bus voltages v o , where the NEC solution imposes a sinusoidal ripple due to the output second-order filter, while the boost solution imposes a triangular ripple due to the first-order filter at its output. In both cases the amplitude of the bus voltage v o ripple is the same. The middle waveforms in Figure 8b show the single-sided amplitude spectrums of those bus voltages, which are equivalent: since the NEC converter has a sinusoidal waveform, its harmonic content at 50 kHz is higher, but the harmonic components at higher frequencies are lower than the components produced by the boost converter. Those simulations confirm the correct design of the classical boost converter as a charger/discharger.
The bottom of Figure 8a shows the output current i o u t for both battery charger/dischargers, where i o u t = i L 2 for the NEC converter and i o u t = i M O S 2 for the boost converter. Those simulations confirm the continuous characteristic of the output current in the NEC solution, and the discontinuous output current of the boost solution is also observed. The bottom of Figure 8b shows the single-sided amplitude spectrums of those output currents, where the boost converter introduces a much higher harmonic content into the DC bus capacitor. Such a condition can be quantified by calculating an equivalent Total Harmonic Distortion for DC signals T H D D C as given in (66), where I D C is the DC single-sided amplitude (0 Hz), and I 2 , I 3 , I 4 , are the single-sided amplitude at higher frequencies. The resulting T H D D C value for the NEC solution is T H D N E C = 0.246 , while the boost solution produces T H D B o o s t = 2.493 , hence the classical boost solution introduces 10 times more harmonic content than the proposed NEC alternative.
T H D D C = I 2 2 + I 3 2 + I 4 2 + I D C
Wang et al. demonstrated in [25] that the reliability of DC buses is reduced when the capacitance is increased. Therefore, taking into account that the boost battery charger/discharger requires 10 times the bus capacitors used in the NEC battery charger/discharger, the proposed NEC solution significantly improves the DC bus reliability. Moreover, the work in [25] also demonstrates that high current ripples in DC bus capacitors affect the capacitor health due to the large current stress. We observe from the bottom traces of Figure 8b that the NEC solution imposes a much smaller current stress on the bus capacitor, thus reducing the capacitor degradation.
Concerning the overall energy stored in both circuits, the boost converter requires 6.51 times the energy used by the NEC solution, thus the proposed solution is more sustainable. Finally, the element cost of the NEC solution, calculated from Table 2, is USD 39.45, while the element cost of the boost solution is USD 145.5. Therefore, the elements of the proposed NEC battery charger/discharger are 73% cheaper in comparison with the classical boost solution, which improves the sustainability of battery chargers/dischargers and DC microgrids.

7. Controller Implementation and SIL Verification

Before soldering the first MOSFET on a power board, designers and quality managers share a common concern: will the converter behave as the model predicts when tens of amps and hundreds of volts are flowing? Power semiconductors are unforgiving: a poorly tuned control can trigger surges that destroy switches in microseconds, an unstable current loop can saturate the magnetic core and melt the copper, and poor thermal compensation can reduce lifetime to hundreds of hours instead of years. Simulating the power processing system, whether a DC/DC converter for batteries or other applications, allows us to test thousands of load, fault, and transient scenarios in minutes, with no risk of smoke and no prototyping cost. Pre-simulation not only saves material and time; it is the only way to certify that, when the final hardware comes to life, it will respond with the accuracy, efficiency, and robustness that safety standards and users demand [26,27,28,29,30].
The SIL (Software-in-the-Loop), PIL (Processor-in-the-Loop), and HIL (Hardware-in-the-Loop) simulation methods form a progressive sequence of embedded system validation, each located at a different point in the development flow and with an increasing level of integration of physical components. SIL runs entirely in a workstation environment: the control model and the plant model reside on the same computer, both compiled for the native architecture. This stage allows running thousands of test cases in minutes, obtaining code coverage and debugging with conventional software tools; however, it ignores rounding phenomena, memory limits, and latencies specific to the target microcontroller. It is, therefore, ideal for validating logic, control algorithms, and early regression testing, but does not detect stack overflow errors or data type incompatibility [31,32,33].
PIL introduces the first layer of realism by moving the control code to the physical target CPU, while the plant continues to be simulated on the computer. The test environment is connected via a serial channel, JTAG, or Ethernet, synchronizing data frames between the two domains. In this way, the numerical behavior (floating or fixed-point), memory usage, and latency of real interrupts are validated, but without the need for sensors and actuators. The simulation speed is 10 to 100 times slower than SIL, but still sufficient for functional testing and performance benchmarks. In addition, it allows measuring CPU load and isolating cross-compilation failures before reaching the prototype [34,35,36,37,38,39].
HIL represents the most complete stage: the plant is replaced by a hardware simulator that dynamically emulates sensors and actuators, while the control runs on the final electronic control unit (ECU). The simulator generates real electrical signals (PWM, CAN, Ethernet TSN, currents, voltages) and can inject faults such as short circuits or electromagnetic noise. Fidelity is maximized, but so is the infrastructure cost and setup time for each bench. HIL is used to validate safety standards (ISO 26262, DO-178C) [40,41], final regression tests, and long-duration tests that would be impossible in a real system [42,43,44,45,46,47].
Comparatively, the three approaches complement rather than replace each other. SIL offers the most favorable cost-cover ratio in early phases; PIL bridges the gap between host and target environment, reducing integration surprises; HIL brings the final certainty to the physical world. Execution speed decreases from SIL to HIL, while accuracy and cost increase. In many modern development flows, all three levels are orchestrated in CI/CD pipelines (Continuous Integration-Continuous Deployment), so that commits first pass automated SIL, then PIL, and, after passing coverage and performance thresholds, are promoted to a distributed HIL bank [48,49,50]. This strategy enables early detection of defects, when their correction costs are minimal, while ensuring compliance with safety and regulatory requirements prior to mass production.

7.1. High-Fidelity SIL Simulation

In this work, a SIL simulation is performed, that is, the controller code is executed on the computer, along with the NEC converter model. Communication between the controller and the plant occurs entirely within the simulation environment of the computer. However, this simulation is called a high-fidelity SIL because the effects of the hardware within the software environment are modeled. The behavior of the 12-bit ADC and DAC at a frequency of 100 kSPS is simulated, but the simulation itself is still a completely computer-run process. It is not testing the efficiency of the compiler, the actual latency of the ADC interrupt, or whether the 12-bit code produces memory overflows in the actual microcontroller. The controller logic is being tested to ensure it works correctly, despite the limitations of a 12-bit system and a reduced sampling frequency.
Adding float-to-12-bit integer conversion, and vice versa, along with a fixed sample rate, is very useful in digital controller validation, as it allows three things:
  • Check the impact of quantization: verify if the loss of 12-bit resolution (rather than the float precision of a computer) affects the stability or performance of the controller.
  • Confirm the impact of discretization: ensure that the chosen sampling rate (e.g., 100 kSPS) is fast enough for the controller and does not introduce a time delay that destabilizes the control loop.
  • Test the robustness of the algorithm: ensure that the algorithm can handle the rounding and truncation effects that will inevitably occur in the final hardware.
By doing this, the SIL simulation moves from being a purely functional test to an implementation test. It is the logical intermediate step to gain confidence in the design before moving to the PIL stage, where it will test whether the 12-bit code executes as expected on the physical processor.
Figure 9 shows the component diagram of the SIL simulation system. The NEC Converter component is the switched model of the converter based on differential equations. Its outputs are signals representing the electrical variables of the system, currents and voltages, represented in 64-bit floating point format [51]. Its inputs are two Boolean signals that control the switching of the two MOSFETs in the converter.
A prevalent native data type in modern microcontrollers or digital signal processors (DSP) is the 32-bit floating point [51], so before introducing the electrical variables to the ADC, the outputs of the NEC Converter component, which are 64-bit floats, are converted to 32-bit floats. In the same way, the outputs of the Microcontroller component are converted to 64-bit floats for comparison purposes, as this is performed on the computer hosting the SIL simulation.
Within the Microcontroller component, as shown in Figure 10, three key components are visible: the 12-bit ADC converter (ADC_12bit component) and 12-bit DAC converter (DAC_12bit component), which operate at a frequency of 100 kSPS, and the 32-bit floating-point CPU (CPU_32bit component), which executes the control law. Before the external signals are passed to the CPU, they must be converted to the 32-bit floating-point format to calculate the control signals.
To take advantage of 100% of the dynamic range of the ADC, and taking into account the simulation results of Figure 5 and Figure 6, before delivering the signals Vo, iL2, and Vb to the ADC, their offset and maximum value are defined according to Table 4.

7.2. Implementation of the Control Law

The switching circuit reported in Figure 4 performs analog comparisons between the switching function Ψ and the adaptive hysteresis limits ± Δ Ψ , both generated inside a microcontroller. This requires high precision to ensure that Ψ is always trapped inside ± Δ Ψ , thus requiring very high sampling frequencies for the ADC inside the microcontroller. This problem can be avoided by isolating the high-frequency component of Ψ : from the expression of the control objective O 1 , given in (29), it is observed that the current ripple of O 1 is zero since i L 2 = i L 1 · ( 1 d ) / d . Moreover, from the expression of the control objective O 2 , given in (30), it is observed that the current ripple of O 2 is equal to the ripple in i L 1 . Therefore, the high-frequency component of Ψ corresponds to the high-frequency component of i L 1 .
Based on the previous analysis, the real-time implementation of the switching function must be modified to remove the high-frequency component from the ADC. This modification takes into account that the ASMC control law (42) sets the flip-flop ( u = 1 ) when Ψ > Δ Ψ , and resets the flip-flop ( u = 0 ) when Ψ < Δ Ψ . Then, replacing the expression of Ψ reported in (31) to isolate i L 1 leads to the modified control law given in (67). Such an expression provides the hysteresis band for the switching circuit in terms of i L 1 , which is directly connected to the analog comparators, thus avoiding the requirement of high sampling frequencies since the hysteresis band can be calculated once or twice for each switching period. In fact, for this implementation, the sampling frequency is set to twice the switching frequency, i.e., 100 kSPS ( 10 5 samples per second), which is available in many low-cost microcontrollers.
Set condition ( u = 1 ) : Ψ > Δ Ψ d · i r + i L 2 Δ Ψ > i L 1 Reset condition ( u = 0 ) : Ψ < Δ Ψ d · i r + i L 2 + Δ Ψ < i L 1
The modification to the switching circuit that eliminates the need for a high sampling frequency for the ADC is modeled by the AnalogComparator component in Figure 9. The implementation is quite simple as it is shown in Figure 11.

7.3. SIL Simulation Results

This section presents the results of the high-fidelity Software-in-the-Loop (SIL) simulation developed for the NEC converter-based bidirectional charger/discharger. In this simulation the control system runs on the workstation at a realistic speed but incorporates, for the first time in this type of study, the combined effects of 12-bit quantization and the reduced sampling frequency of the ADC and DAC converters present in the final ECU. The objective is to establish a critical comparison against the conventionally accepted solution: the PSIM model, widely used in the industry for its speed and nominal accuracy, but operating with floating-point variables and theoretically infinite resolution.
The dynamic limitations imposed by the embedded hardware, 12-bit sample encoding, and 100 kSPS sampling frequency were integrated in the SIL platform, which allows for the anticipation of saturation phenomena, loss of resolution, and aliasing that could compromise current and voltage regulation during fast load transients. The converter, controller, and test scenarios are the same as those replicated in PSIM and presented in Section 6, so it is possible to isolate the unique influence of quantization and undersampling.
Quantitative analysis focuses on the accuracy of output and intermediate capacitor voltages, inductors and battery currents, and switching frequency. For those variables, the overshoot and settling time are analyzed for load changes, and for the switching frequency to be maintained at around 50 kHz. The above demonstrates the extent to which SIL simulation reveals deviations from models of higher abstraction, which PSIM cannot predict. Therefore, it justified the need of incorporating the real limits of the measurement channel and the control loop for validating critical chargers/dischargers.
The constraints set for the performance of the NEC converter-based charger/discharger were reported in Table 1, and the simulation results using PSIM are reflected in Figure 5 and Figure 6. The SIL simulation of the same system with the same performance constraints is shown in Figure 12. Note that at ±2 A variations in the load, it is evident that the reference for the output voltage, 48 V, and its maximum deviation, ±2 V, are fulfilled. Likewise, the settling time after the change in the load remains around 1 ms. For the intermediate capacitor voltage, a maximum ripple of 2%, ±0.96 V, was defined, which is satisfied. Finally, the switching frequency oscillates around 50 kHz ± 0.2 kHz, i.e., with an error near 0.4%. In this simulation, the battery voltage was kept constant, 12 V, and to draw on the same axis as the charging current, an offset of −12 V was applied.
After detailed analysis of the quantitative results of the PSIM simulation versus the SIL simulation of the NEC-based charger/discharger, it is concluded that the data demonstrates excellent performance of the adaptive sliding mode controller in the SIL environment, even under the restrictive conditions imposed. Quantization of the ADC and DAC to 12 bits, together with a sampling rate reduced to only 100 kSPS, did not compromise the stability and efficiency of the controller, which maintained robust reference tracking and effective disturbance rejection. These results represent a first vote of confidence in the controller design, validating its ability to operate under realistic deployment conditions. Furthermore, the observed performance suggests that the controller could be successfully deployed on a low-cost commercial microcontroller while maintaining its functionality and efficiency. This breakthrough opens the door to future tests on real hardware, where its robustness and adaptability in practical applications are expected to be confirmed, thus consolidating its potential for efficient and affordable power systems.
For comparative purposes, the SIL simulation results of the same system with the same performance constraints, but using a classical PI controller, are reported in Figure 13. There, it can be seen that the output voltage is maintained at 48 ± 2 V, but with a strong oscillation when the load is −2 A, and the settling time is not met, since it is longer than 1 ms. The intermediate capacitor voltage ripple is maintained at around ±1 V, while the switching frequency deviation becomes about 2%, i.e., 1 kHz. As expected, the performance of the adaptive sliding mode controller is much better than that of the classical PI controller.
Table 5 shows the performance parameters for the NEC converter controlled by the ASMC compared to the classic PI controller. Errors were calculated using the average absolute value given by M A E = 1 N y i y i ¯ .
The error analysis was performed during two of the three transients: when the load changed from +2 A to 0 A, and when the load changed from 0 A to −2 A. In both cases, the error in the output voltage, the intermediate capacitor voltage, and the switching frequency were greater when the NEC converter was controlled with the classic PI controller. The closest error values between the two controllers occurred in the intermediate capacitor voltage during the 0 to −2 A transient. For the other cases and variables, the system error under the PI controller was greater by more than 30%. It is noteworthy that the switching frequency, in the 0 to −2 A transient, using the PI controller had an average error of 365.7% greater than the proposed sliding mode controller.
It should be noted that during the transition from +2 A to 0, the DC bus voltage when the converter was controlled using the PI controller exceeded 50 V for a short time, which means that it does not meet the requirements for which it was designed. Finally, both solutions provide similar settling times, which in general fulfill the design restriction.

8. Conclusions

This paper presented a novel approach to designing a non-electrolytic capacitor (NEC) DC-DC boost converter for battery charging/discharging applications, focusing on enhancing the sustainability of a microgrid by improving reliability, performance, and extending battery life. The proposed NEC-based solution offers significant advantages over existing alternatives. Unlike the conventional Cuk converter, which exhibits both step-up and step-down capabilities, the NEC converter exclusively operates in the step-up mode. This condition permits fully utilizing the control’s dynamic range (duty cycle between 0 and 1), minimizing the saturation risk and increasing the system flexibility for step-up chargers/dischargers. Furthermore, the NEC converter requires a significantly lower intermediate capacitor voltage than the Cuk (in this case, 60 V for the Cuk and 48 V for the NEC), reducing the voltage stress on components. Also, the above translates to lower energy storage requirements, enabling the use of components with lower voltage ratings, ultimately leading to cost reductions, improved efficiency, and enhanced sustainability of the whole system. While the boost converter also offers step-up functionality, its discontinuous output current challenges battery charging applications. The NEC converter, in contrast, provides continuous currents at both the input (battery side) and output (DC bus side), mirroring the desirable characteristic of the Cuk while avoiding its limitations. An adaptive sliding-mode control strategy was implemented to control the NEC converter effectively. Adaptive SMC offers inherent advantages in robustness against parametric variations and guarantees global stability, a critical aspect often lacking in linear control techniques. Moreover, the adaptive nature of the controller ensures optimal performance across the entire operating range, not just guarantee stability. This design maintains a constant switching frequency (around 50 kHz), unlike classical SMC implementations that suffer from variable switching frequency. The fixed switching frequency allows for the selection of optimized MOSFET characteristics such as Ton, Toff, and Ron, increasing efficiency and reducing the overall size of the converter. The proposed solution was validated through the simulation of an application example that showed accurate results. The controller is particularly well-suited for practical implementation on platforms such as DSPs, as it simplifies the design of sensing filters and reduces hardware requirements. For this reason, the adaptive sliding-mode controller was also specifically tested using a high-fidelity software-in-the-loop (SIL) approach.
Adopting SIL simulations is advantageous over Hardware-In-the-Loop (HIL) or experimental testing because it allows control algorithms to be validated in a purely virtual environment, without the need for physical hardware. This results in lower initial costs and faster iteration speeds, as changes to the software can be tested immediately without reconfiguring real laboratory equipment. In addition, SIL allows thousands of extreme cases or injected faults to be run in minutes, something that is impractical with physical prototypes or real plants. It also facilitates multidisciplinary collaboration by eliminating dependencies on available hardware. Although HIL and real-world testing are crucial in later phases, SIL accelerates the early detection of logical errors and the optimization of control strategies, reducing risks and costs before moving to more expensive validations.
To increase the academic value of this work, which is still in the SIL stage, and to prepare for the HIL/experimental field, the following future works are proposed:
  • Quantify the parametric uncertainty of a battery-converter system using Morris–Sobol analysis in SIL to prioritize sensors and calibrations.
  • Design and validate an online residual observer that detects and isolates sensor/actuator faults without real hardware.
  • Release the SIL model (MATLAB/Simscape) with test cases, which will enable the community to reproduce and compare algorithms.
  • Generate a lightweight digital twin model (time step shorter than 1 ms) suitable for microcontrollers, which can be used to demonstrate its functional equivalence against the detailed SIL.
  • On the other hand, to prepare this work for different types of simulation scenarios, a hybrid framework of an average/event-driven model for a power converter is proposed, enabling multi-hour simulations of a battery charger/discharger controlled by the ASMC.

Author Contributions

Conceptualization, C.A.R.-P.; Formal analysis, C.A.R.-P.; Funding acquisition, C.A.R.-P.; Investigation, C.A.R.-P., S.I.S.-G. and A.J.S.-M.; Methodology, S.I.S.-G. and A.J.S.-M.; Project administration, S.I.S.-G.; Software, C.A.R.-P.; Validation, S.I.S.-G.; Writing—original draft, C.A.R.-P. and A.J.S.-M.; Writing—review and editing, S.I.S.-G. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Instituto Tecnológico Metropolitano and Universidad Nacional de Colombia under the research project “Simulación en Hardware-In-the-Loop para Convertidores Conmutados DC/DC”, (ITM code P24204, Hermes code Código: 62237).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Serna-Garcés, S.I.; Gonzalez Montoya, D.; Ramos-Paja, C.A. Control of a Charger/Discharger DC/DC Converter with Improved Disturbance Rejection for Bus Regulation. Energies 2018, 11, 594. [Google Scholar] [CrossRef]
  2. AlKawak, O.A.; Saghafi, H.; Albakry, A.A.A.; Fani, B.; Delshad, M. Regulation of bus voltage on DC microgrid using hybrid technique through charger/discharger storage. J. Energy Storage 2024, 101, 113620. [Google Scholar] [CrossRef]
  3. Bashir, I.; Bhat, A.H.; Ahmad, S. A review on soft switched PFC boost converter for efficient lowering of switching losses. Electr. Power Syst. Res. 2025, 242, 111430. [Google Scholar] [CrossRef]
  4. Sánchez, J.S.; Trujillo, C.L.; Montoya, O.D. Implementation of a strategy to improve the efficiency of battery chargers with double conversion topology, high power factor, and low THDi. Ain Shams Eng. J. 2024, 15, 102379. [Google Scholar] [CrossRef]
  5. Guzman, R.; Vicuña, L.; Morales, J.; Castilla, M.; Matas, J. Sliding-Mode Control for a Three-Phase Unity Power Factor Rectifier Operating at Fixed Switching Frequency. IEEE Trans. Power Electron. 2016, 31, 758–769. [Google Scholar] [CrossRef]
  6. Sebaaly, F.; Vahedi, H.; Kanaan, H.; Moubayed, N.; Al-Haddad, K. Sliding Mode Fixed Frequency Current Controller Design for Grid-Connected NPC Inverter. IEEE J. Emerg. Sel. Top. Power Electron. 2016, 4, 1397–1405. [Google Scholar] [CrossRef]
  7. Abeywardana, D.; Hredzak, B.; Agelidis, V. A Fixed-Frequency Sliding Mode Controller for a Boost-Inverter-Based Battery-Supercapacitor Hybrid Energy Storage System. IEEE Trans. Power Electron. 2017, 32, 668–680. [Google Scholar] [CrossRef]
  8. Ramos-Paja, C.A.; Montoya, D.G.; Bastidas-Rodríguez, J.D. Sliding-mode control of a CuK converter for voltage regulation of a dc-bus. Sustain. Energy Technol. Assess. 2020, 42, 100807. [Google Scholar] [CrossRef]
  9. Chandola, R.; Panchal, A.K. A standalone photovoltaic energy storage application with positive pulse current battery charging. J. Energy Storage 2024, 85, 111184. [Google Scholar] [CrossRef]
  10. Al-Hysam, M.A.; Raisz, D. A hybrid high-gain bipolar converter for LVDC microgrid with average current mode control. Energy Convers. Manag. X 2025, 25, 100857. [Google Scholar] [CrossRef]
  11. Assidiq, A.R.; Dahono, A.; Rizqiawan, A.; Furqani, J. High ratio DC-DC converter based on cascade modified Cuk converter topology. E-Prime-Adv. Electr. Eng. Electron. Energy 2024, 9, 100654. [Google Scholar] [CrossRef]
  12. Shameli, A.; Farzanehfard, H. Bridgeless Cuk PFC converter with full load range soft switching operation by using a simple auxiliary circuit. Comput. Electr. Eng. 2025, 122, 109905. [Google Scholar] [CrossRef]
  13. Zhang, G.; Chen, W.; Yu, S.; Zhang, Y. Non-electrolytic-capacitor boost converter with non-pulsating ripple-free output current. Int. J. Circuit Theory Appl. 2021, 49, 2719–2735. [Google Scholar] [CrossRef]
  14. Ramos-Paja, C.; Bastidas-Rodriguez, J.; Saavedra-Montes, A. Low-Voltage Photovoltaic System Based on a Continuous Input/Output Current Converter. Computation 2023, 11, 42. [Google Scholar] [CrossRef]
  15. Almalaq, Y. Design and Analysis of a Non-Isolated High Gain Step-Up Cuk Converter Converter. Ph.D. Dissertation, University of Denver, Denver, CO, USA, January 2019. Available online: https://digitalcommons.du.edu/etd/1558/ (accessed on 15 April 2025).
  16. Sira-Ramirez, H. Sliding motions in bilinear switched networks. IEEE Trans. Circuits Syst. 1987, 34, 919–933. [Google Scholar] [CrossRef]
  17. Azpurua, M.; Pous, M.; Silva, F. Time- and Frequency-Domain Characterization of Switching Losses in GaN FETs Power Converters. IEEE Trans. Power Electron. 2022, 37, 3219–3232. [Google Scholar] [CrossRef]
  18. Eslamloo, M.; Varesi, K.; Tarzamni, H.; Lee, S. Comprehensive Reliability Review and Assessment of Switched-Capacitor Step-Up DC–DC Converters. IEEE Trans. Reliab. 2025, 74, 2766–2778. [Google Scholar] [CrossRef]
  19. ISO 21780:2020; Road Vehicles—Supply Voltage of 48 V—Electrical Requirements and Tests. International Standard Organization: Geneva, Switzerland, 2020. Available online: https://www.iso.org/standard/71607.html (accessed on 15 May 2025).
  20. ITG Electronics. PQ108081H Series; datasheet; ITG Electronics, Inc.: New York, NY, USA, 2022. [Google Scholar]
  21. Murata. 6000B Series; datasheet KMP_6000B_B01; Surface Mount Power Inductors; Murata Manufacturing Co., Ltd.: Kyoto, Japan, 2020. [Google Scholar]
  22. KEMET Electronics. Polypropylene Pulse/High Frequency Capacitors R75, Single Metallized Polypropylene Film, Radial, DC and Pulse Applications (Automotive Grade); datasheet F3106_R75; KEMET Electronics Corporation, Ltd.: Fort Lauderdale, FL, USA, 2025. [Google Scholar]
  23. Alpha and Omega. AOT290L/AOB290L 100V N-Channel MOSFET; datasheet Rev. 4.1; Alpha and Omega Semiconductor: Sunnyvale, CA, USA, 2024. [Google Scholar]
  24. Powersim, Inc. PSIM User’s Manual; Technical Report Version 2020a Release 1; Powersim, Inc.: Troy, MI, USA, 2020. [Google Scholar]
  25. Wang, H.; Blaabjerg, F. Reliability of Capacitors for DC-Link Applications in Power Electronic Converters—An Overview. IEEE Trans. Ind. Appl. 2014, 50, 3569–3578. [Google Scholar] [CrossRef]
  26. Rashid, M. Simulation and Analysis of Circuits for Power Electronics; The Institution of Engineering: London, UK, 2025. [Google Scholar] [CrossRef]
  27. Bai, H.; Liu, C.; Majstorovic, D.; Gao, F. Roles and challenges of power electronics real-time simulation. In Real-Time Simulation Technology for Modern Power Electronics; Academic Press: Cambridge, MA, USA, 2023; pp. 1–11. [Google Scholar] [CrossRef]
  28. Frivaldsky, M. Advanced Perspectives for Modeling Simulation and Control of Power Electronic Systems. Energies 2021, 14, 8108. [Google Scholar] [CrossRef]
  29. O’Neill-Carrillo, E.; Martinez-Navedo, T.; Rodriguez, B.; Mendez, A.; Oliveras, V. Simulation tools for power electronics applications in power systems. In Proceedings of the 2002 IEEE Workshop On Computers In Power Electronics, 2002. Proceedings, Mayaguez, PR, USA, 3–4 June 2002; pp. 117–121. [Google Scholar] [CrossRef]
  30. Dembecki, J.; Spalding, B. Power System Simulation. IFAC Proc. Vol. 1977, 10, 374–378. [Google Scholar] [CrossRef]
  31. Clausen, C.; Jørgensen, B.; Ma, Z. A scoping review of In-the-loop paradigms in the energy sector focusing on software-in-the-loop. Energy Inform. 2024, 7, 12. [Google Scholar] [CrossRef]
  32. Wiesner, P.; Steinke, M.; Nickel, H.; Kitana, Y.; Kao, O. Software-in-the-loop simulation for developing and testing carbon-aware applications. Software Pract. Exp. 2023, 53, 2362–2376. [Google Scholar] [CrossRef]
  33. Chen, X.; Salem, M.; Das, T.; Chen, X. Real Time Software-in-the-Loop Simulation for Control Performance Validation. Simulation 2008, 84, 457–471. [Google Scholar] [CrossRef]
  34. Cavanini, L.; Majecki, P.; Grimble, M.; Sasikumar, L.; Li, R.; Hillier, C. Processor-In-the-Loop Demonstration of MPC for HEVs Energy Management System. IFAC-PapersOnLine 2022, 55, 173–178. [Google Scholar] [CrossRef]
  35. Andrews, J.; Green, P.; Barnes, M. A Pscad Processor-in-the-Loop System for Hardware Evaluation of Power Converter Control Algorithms. IET Conf. Proc. 2021, 2020, 255–260. [Google Scholar] [CrossRef]
  36. Hisar, C.; Sefa, I.; Altin, N. Processor-in-the-Loop Simulation of an Interleaved Buck Converter with MATLAB/Simulink. In Proceedings of the 2021 13th International Conference On Electronics, Computers And Artificial Intelligence (ECAI), Pitesti, Romania, 1–3 July 2021; pp. 1–6. [Google Scholar] [CrossRef]
  37. Fekkak, B.; Menaa, M.; Boussahoua, B.; Rekioua, D. Processor in the loop test for algorithms designed to control power electronics converters used in grid-connected photovoltaic system. Int. Trans. Electr. Energy Syst. 2019, 30, e12227. [Google Scholar] [CrossRef]
  38. Mina, J.; Flores, Z.; Lopez, E.; Perez, A.; Calleja, J. Processor-in-the-loop and hardware-in-the-loop simulation of electric systems based in FPGA. In Proceedings of the 2016 13th International Conference On Power Electronics (CIEP), Guanajuato, Mexico, 20–23 June 2016; pp. 172–177. [Google Scholar] [CrossRef]
  39. Jiang, Z.; Leonard, R.; Dougal, R.; Figueroa, H.; Monti, A. Processor-in-the-loop simulation, real-time hardware-in-the-loop testing, and hardware validation of a digitally-controlled, fuel-cell powered battery-charging station. In Proceedings of the 2004 IEEE 35th Annual Power Electronics Specialists Conference (IEEE Cat. No.04CH37551), Aachen, Germany, 20–25 June 2004; pp. 2251–2257. [Google Scholar] [CrossRef]
  40. ISO 26262-2:2018; Road Vehicles—Functional Safety. International Organization for Standardization: Geneva, Switzerland, 2018.
  41. RTCA. DO-178C Software Considerations in Airborne Systems and Equipment Certification, Includes Errata; Radio Technical Commission for Aeronautics: Washington, DC, USA, 2020. [Google Scholar]
  42. Núñez-Gutiérrez, C. Power-Hardware-in-the-Loop Simulation for Applied Science, a Review to Highlight Its Merits and Challenges. Inventions 2025, 10, 19. [Google Scholar] [CrossRef]
  43. Song, J.; Hur, K.; Lee, J.; Lee, H.; Lee, J.; Jung, S.; Shin, J.; Kim, H. Hardware-in-the-Loop Simulation Using Real-Time Hybrid-Simulator for Dynamic Performance Test of Power Electronics Equipment in Large Power System. Energies 2020, 13, 3955. [Google Scholar] [CrossRef]
  44. Estrada, L.; Vázquez, N.; Vaquero, J.; Castro, Á.; Arau, J. Real-Time Hardware in the Loop Simulation Methodology for Power Converters Using LabVIEW FPGA. Energies 2020, 13, 373. [Google Scholar] [CrossRef]
  45. Vogel, S.; Nguyen, H.; Stevic, M.; Jensen, T.; Heussen, K.; Rajkumar, V.; Monti, A. Distributed Power Hardware-in-the-Loop Testing Using a Grid-Forming Converter as Power Interface. Energies 2020, 13, 3770. [Google Scholar] [CrossRef]
  46. Sankhe, D.; Sawant, R.; Rao, Y. Overview of Power Hardware-in-the-Loop Simulation Towards Implementation of Digital Controller for Resonant Inverters. In Proceedings of the 2018 2nd International Conference On Micro-Electronics And Telecommunication Engineering (ICMETE), Ghaziabad, India, 20–21 September 2018; pp. 6–11. [Google Scholar] [CrossRef]
  47. Liu, C.; Ma, R.; Bai, H.; Gechter, F.; Gao, F. A new approach for FPGA-based real-time simulation of power electronic system with no simulation latency in subsystem partitioning. Int. J. Electr. Power Energy Syst. 2018, 99, 650–658. [Google Scholar] [CrossRef]
  48. Jani, Y. Implementing Continuous Integration and Continuous Deployment (CI/CD) in Modern Software Development. Int. J. Sci. Res. 2023, 12, 2984–2987. [Google Scholar] [CrossRef]
  49. Zampetti, F.; Geremia, S.; Bavota, G.; Di Penta, M. CI/CD Pipelines Evolution and Restructuring: A Qualitative and Quantitative Study. In Proceedings of the 2021 IEEE International Conference On Software Maintenance And Evolution (ICSME), Luxembourg, 27 September–1 October 2021; pp. 471–482. [Google Scholar] [CrossRef]
  50. Arachchi, S.; Perera, I. Continuous Integration and Continuous Delivery Pipeline Automation for Agile Software Project Management. In Proceedings of the 2018 Moratuwa Engineering Research Conference (MERCon), Moratuwa, Sri Lanka, 30 May–1 June 2018; pp. 156–161. [Google Scholar] [CrossRef]
  51. IEEE 754-2019; IEEE Standard for Floating-Point Arithmetic. IEEE Computer Society; C/MSC-Microprocessor Standards Committee: New York, NY, USA, 2019.
Figure 1. Circuital model of the NEC battery charger/discharger. v b , v o , and v C i are, respectively, the battery, the DC-bus, and the intermediate capacitor voltages; i L 1 , i L 2 , i o , i C i , i C o , and i b are the currents of the L 1 and L 2 inductors, of the load, of the intermediate and output capacitors, and of the battery, respectively; R L 1 , R L 2 , R C i , and R C o are the losses of L 1 , L 2 , C i , and C o , respectively; R o n is the conduction losses of the MOSFETs; u and u ¯ are the control signals of the converter.
Figure 1. Circuital model of the NEC battery charger/discharger. v b , v o , and v C i are, respectively, the battery, the DC-bus, and the intermediate capacitor voltages; i L 1 , i L 2 , i o , i C i , i C o , and i b are the currents of the L 1 and L 2 inductors, of the load, of the intermediate and output capacitors, and of the battery, respectively; R L 1 , R L 2 , R C i , and R C o are the losses of L 1 , L 2 , C i , and C o , respectively; R o n is the conduction losses of the MOSFETs; u and u ¯ are the control signals of the converter.
Sustainability 17 07987 g001
Figure 2. Circuit states of the power stage. v b , v o , v C i , and v C o are, respectively, the battery, the DC-bus, the intermediate capacitor, and the output capacitor voltages; i L 1 , i L 2 , i o , i C o and i b are the currents of the L 1 and L 2 inductors, of the load, of the output capacitor, and of the battery, respectively; R L 1 , R L 2 , R C i , and R C o are the losses of L 1 , L 2 , C i , and C o , respectively; R o n is the conduction losses of the MOSFETs; u is the control signal of the converter. The blue path corresponds to the discharge of C i ; the red path corresponds to the charge of C i .
Figure 2. Circuit states of the power stage. v b , v o , v C i , and v C o are, respectively, the battery, the DC-bus, the intermediate capacitor, and the output capacitor voltages; i L 1 , i L 2 , i o , i C o and i b are the currents of the L 1 and L 2 inductors, of the load, of the output capacitor, and of the battery, respectively; R L 1 , R L 2 , R C i , and R C o are the losses of L 1 , L 2 , C i , and C o , respectively; R o n is the conduction losses of the MOSFETs; u is the control signal of the converter. The blue path corresponds to the discharge of C i ; the red path corresponds to the charge of C i .
Sustainability 17 07987 g002
Figure 3. An equivalent model of the battery charger/discharger with the current control. v b , v o , v r , and v C o are, respectively, the battery, DC-bus, DC-bus reference, and output capacitor voltages; i L 2 , i o , and i r are the currents of the L 2 inductor, the load, and the reference, respectively; k p and k i are the adaptive parameters of the PI controller; d is the converter cycle duty; C o and R C o are the output capacitor and its losses.
Figure 3. An equivalent model of the battery charger/discharger with the current control. v b , v o , v r , and v C o are, respectively, the battery, DC-bus, DC-bus reference, and output capacitor voltages; i L 2 , i o , and i r are the currents of the L 2 inductor, the load, and the reference, respectively; k p and k i are the adaptive parameters of the PI controller; d is the converter cycle duty; C o and R C o are the output capacitor and its losses.
Sustainability 17 07987 g003
Figure 4. Switching circuit. u and u ¯ are the control signals of the converter MOSFETs; i L 2 is the current of L 2 ; v b and v o are, respectively, the voltages of the battery and DC-bus; Ψ and Δ Ψ are, respectively, the switching function and hysteresis band.
Figure 4. Switching circuit. u and u ¯ are the control signals of the converter MOSFETs; i L 2 is the current of L 2 ; v b and v o are, respectively, the voltages of the battery and DC-bus; Ψ and Δ Ψ are, respectively, the switching function and hysteresis band.
Sustainability 17 07987 g004
Figure 5. Dynamic response to load current perturbations. v o , v r , and v C i are the voltages of the DC bus and its reference, and the intermediate capacitor, respectively; i o , i L 1 , i r , and i b are the currents of the load, the L 1 inductor and its reference, and the battery, respectively; Ψ and Δ Ψ are, respectively, the switching function and hysteresis band. The black dashed line show the MO limits.
Figure 5. Dynamic response to load current perturbations. v o , v r , and v C i are the voltages of the DC bus and its reference, and the intermediate capacitor, respectively; i o , i L 1 , i r , and i b are the currents of the load, the L 1 inductor and its reference, and the battery, respectively; Ψ and Δ Ψ are, respectively, the switching function and hysteresis band. The black dashed line show the MO limits.
Sustainability 17 07987 g005
Figure 6. Regulation of the switching frequency. v b , v o , and v r are, respectively, the battery, DC-bus, and DC-bus reference voltages; Ψ and Δ Ψ are, respectively, the switching function and hysteresis band; F s w is the switching frequency.
Figure 6. Regulation of the switching frequency. v b , v o , and v r are, respectively, the battery, DC-bus, and DC-bus reference voltages; Ψ and Δ Ψ are, respectively, the switching function and hysteresis band; F s w is the switching frequency.
Sustainability 17 07987 g006
Figure 7. Classical battery charger/discharger based on a bidirectional boost converter. i b , i L b , i o u t , and i o are, respectively, the input, inductor, output, and load currents of the converter; v b and v o are, respectively, the battery and DC-bus voltages; u and u ¯ are, respectively, the control signal of the MOSFETs M O S 1 and M O S 2 ; R L b and R C o b are, respectively, the inductor and capacitor losses, while R o n is the MOSFETs conduction losses.
Figure 7. Classical battery charger/discharger based on a bidirectional boost converter. i b , i L b , i o u t , and i o are, respectively, the input, inductor, output, and load currents of the converter; v b and v o are, respectively, the battery and DC-bus voltages; u and u ¯ are, respectively, the control signal of the MOSFETs M O S 1 and M O S 2 ; R L b and R C o b are, respectively, the inductor and capacitor losses, while R o n is the MOSFETs conduction losses.
Sustainability 17 07987 g007
Figure 8. Comparison between boost and NEC battery charger/dischargers. i b and i o u t are, respectively, the input and output currents of the converters; v o is the DC-bus voltage.
Figure 8. Comparison between boost and NEC battery charger/dischargers. i b and i o u t are, respectively, the input and output currents of the converters; v o is the DC-bus voltage.
Sustainability 17 07987 g008
Figure 9. Component diagram of the SIL simulation system.
Figure 9. Component diagram of the SIL simulation system.
Sustainability 17 07987 g009
Figure 10. Controller hardware component diagram.
Figure 10. Controller hardware component diagram.
Sustainability 17 07987 g010
Figure 11. Implementation of the modified switching circuit. u and u n e g are the control signals of the converter MOSFETs; i L 1 is the current of inductor L 1 ; D i L 1 s and D i L 1 r are the modified hysteresis bands for determining the set and reset conditions of the converter, respectively.
Figure 11. Implementation of the modified switching circuit. u and u n e g are the control signals of the converter MOSFETs; i L 1 is the current of inductor L 1 ; D i L 1 s and D i L 1 r are the modified hysteresis bands for determining the set and reset conditions of the converter, respectively.
Sustainability 17 07987 g011
Figure 12. Simulation SIL of the NEC charger/discharger with an adaptive sliding-mode controller. v o , v b , and v C i are the voltages of the DC bus, the battery, and the intermediate capacitor, respectively; i L 1 , i o , and i b are the currents of the L 1 inductor, the load, and the battery, respectively; F s w is the switching frequency. The blue dashed lines are the reference values.
Figure 12. Simulation SIL of the NEC charger/discharger with an adaptive sliding-mode controller. v o , v b , and v C i are the voltages of the DC bus, the battery, and the intermediate capacitor, respectively; i L 1 , i o , and i b are the currents of the L 1 inductor, the load, and the battery, respectively; F s w is the switching frequency. The blue dashed lines are the reference values.
Sustainability 17 07987 g012
Figure 13. Simulation SIL of NEC charger/discharger with classical PI controller. v o , v b , and v C i are the voltages of the DC bus, the battery, and the intermediate capacitor, respectively; i L 1 , i o , and i b are the currents of the L 1 inductor, the load, and the battery, respectively; F s w is the switching frequency. The blue dashed lines are the reference values.
Figure 13. Simulation SIL of NEC charger/discharger with classical PI controller. v o , v b , and v C i are the voltages of the DC bus, the battery, and the intermediate capacitor, respectively; i L 1 , i o , and i b are the currents of the L 1 inductor, the load, and the battery, respectively; F s w is the switching frequency. The blue dashed lines are the reference values.
Sustainability 17 07987 g013
Table 1. Application data.
Table 1. Application data.
RequirementValue
Battery voltage ( v b )12 V
Reference for Bus voltage ( v r )48 V
Maximum load current perturbation max δ i o 2 A
Maximum safe deviation the bus voltage ( M O )2 V
Maximum settling time of the bus voltage ( t s ) for ϵ = 2 % band1 ms
Maximum current ripple for the battery ( Δ i b / i b )20%
Maximum voltage ripple for the intermediate capacitor ( Δ v C i / v C i )2%
Switching frequency ( F s w )50 kHz
Table 2. System parameters.
Table 2. System parameters.
ParameterPartValueCost
K L 1.5
L 1 and R L 1 PQ108081-101MHF 100 μ H and 22 m Ω USD 9.2
L 2 and R L 2 60B154C 150 μ H and 38 m Ω USD 2.42
C i and R C i R75GW5220AA00J 22 μ F and 2.2 m Ω USD 6.13
C o and R C o two parallel R75GW5220AA00J 44 μ F and 1.1 m Ω USD 12.26
MOSFET R o n two AOB290L 3.2 m Ω USD 9.44
k p N 0.7358 A/V
k i N 3.0758 kA/(V·s)
Table 3. Specification of the operating points for the NEC converter simulations.
Table 3. Specification of the operating points for the NEC converter simulations.
Operating Point v o v b i o
148 V13 V+2 A
248 V12 V−2 A
348 V12 V0 A
448 V12 V+2 A
548 V11 V+2 A
Table 4. Characteristics of the input signals in the simulation with the 12-bit ADC converter.
Table 4. Characteristics of the input signals in the simulation with the 12-bit ADC converter.
SignalOffsetRangeResolution
Vo44 V8 V19.54 mV/bit
iL2−3 A6 A14.65 mA/bit
Vb10 V4 V0.98 mV/bit
Table 5. Performance comparison of the NEC converter controlled with sliding-mode controller vs. classical PI controller.
Table 5. Performance comparison of the NEC converter controlled with sliding-mode controller vs. classical PI controller.
VariableError-SMCError-PIComparison
Load from 2 A to 0 v o 0.2818 V0.3657 VPI 29.8% > SMC
v C i 0.4375 V0.6741 VPI 54.1% > SMC
F s w 45.7756 Hz70.2216 HzPI 53.4% > SMC
VariableError-SMCError-PIComparison
Load from 0 to −2 A v o 0.2663 V0.3464 VPI 30.1% > SMC
v C i 0.6220 V0.7120 VPI 14.5% > SMC
F s w 55.8947 Hz260.3202 HzPI 365.7% > SMC
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ramos-Paja, C.A.; Serna-Garcés, S.I.; Saavedra-Montes, A.J. Battery Power Interface to Mitigate Load Transients and Reduce Current Harmonics for Increasing Sustainability in DC Microgrids. Sustainability 2025, 17, 7987. https://doi.org/10.3390/su17177987

AMA Style

Ramos-Paja CA, Serna-Garcés SI, Saavedra-Montes AJ. Battery Power Interface to Mitigate Load Transients and Reduce Current Harmonics for Increasing Sustainability in DC Microgrids. Sustainability. 2025; 17(17):7987. https://doi.org/10.3390/su17177987

Chicago/Turabian Style

Ramos-Paja, Carlos Andrés, Sergio Ignacio Serna-Garcés, and Andrés Julián Saavedra-Montes. 2025. "Battery Power Interface to Mitigate Load Transients and Reduce Current Harmonics for Increasing Sustainability in DC Microgrids" Sustainability 17, no. 17: 7987. https://doi.org/10.3390/su17177987

APA Style

Ramos-Paja, C. A., Serna-Garcés, S. I., & Saavedra-Montes, A. J. (2025). Battery Power Interface to Mitigate Load Transients and Reduce Current Harmonics for Increasing Sustainability in DC Microgrids. Sustainability, 17(17), 7987. https://doi.org/10.3390/su17177987

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop