Next Article in Journal
Unraveling Dissipation-Related Features in Magnetic Imaging by Bimodal Magnetic Force Microscopy
Next Article in Special Issue
Dynamic Virtual Energy Storage System Operation Strategy for Smart Energy Communities
Previous Article in Journal
Identifying Engineering Undergraduates’ Learning Style Profiles Using Machine Learning Techniques
Previous Article in Special Issue
Risk-Based Virtual Power Plant Implementation Strategy for Smart Energy Communities
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Design and Control of a Battery Charger/Discharger Based on the Flyback Topology

by
Carlos Andres Ramos-Paja
1,*,†,
Juan David Bastidas-Rodriguez
2,† and
Andres Julian Saavedra-Montes
1,†
1
Facultad de Minas, Universidad Nacional de Colombia, Medellin 050041, Colombia
2
Facultad de Ingeniería y Arquitectura, Universidad Nacional de Colombia, Manizales 170003, Colombia
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Appl. Sci. 2021, 11(22), 10506; https://doi.org/10.3390/app112210506
Submission received: 27 September 2021 / Revised: 29 October 2021 / Accepted: 1 November 2021 / Published: 9 November 2021

Abstract

:

Featured Application

Interface low-voltage battery packs with medium-voltage or high-voltage DC buses, e.g., DC buses in microgrids or electric vehicles.

Abstract

Devices connected to microgrids require safe conditions during their connection, disconnection and operation. The required safety is achieved through the design and control of the converters that interface elements with the microgrid. Therefore, the design of both power and control stages of a battery charger/discharger based on a flyback is proposed in this paper. First, the structure of a battery charger/discharger is proposed, including the battery, the flyback, the DC bus, and the control scheme. Then, three models to represent the battery charger/discharger are developed in this work; a switched model, an averaged model, and a steady-state model, which are used to obtain the static and dynamic behavior of the system, and also to obtain the design equations. Based on those models, a sliding-mode controller is designed, which includes the adaptive calculation of one parameter. Subsequently, a procedure to select the flyback HFT, the output capacitor, and the K v parameter based on operation requirements of the battery charger/discharger is presented in detail. Five tests developed in PSIM demonstrate the global stability of the system, the correct design of the circuit and controller parameters, the satisfactory regulation of the bus voltage, and the correct operation of the system for charge, discharge and stand-by conditions. Furthermore, a contrast with a classical PI structure confirms the performance of the proposed sliding-mode controller.

1. Introduction

A DC microgrid can be defined as a power system formed by renewable energy sources (RESs), energy storage devices (ESDs), loads connected to a DC bus (see Figure 1), and a control system that manages the energy resources to supply the loads [1]. The RESs use the local resources to generate the power required by the loads. The power produced by some RESs can be imposed by the control system (e.g., fuel cells and hydro); while the power produced by other sources depends on the environmental conditions, like photovoltaic (PV) generators and wind turbines. Moreover, the loads vary over time since they depend on the specific application. Therefore, in a microgrid, it is common to have power unbalances between the RES and the loads.
Such power unbalances are compensated by regulating the DC bus voltage using one (or more) ESD and a charging/discharging system [1]. On the one hand, when the load exceeds the generation, the DC bus voltage tends to decrease; then, the ESD is discharged to balance generation and load, as consequence, the DC bus voltage increases and returns to its reference value. On the other hand, the DC bus voltage tends to increase when the generation exceeds the load; in that case, the ESD is charged to guarantee the power balance and return the DC bus voltage to its nominal value. Finally, when generation and load are equal, the ESD does not supply or absorb power (stand-by). Moreover, it is worth noting that the DC bus voltage regulation is important in a microgrid to provide safe operating conditions for the loads since most of the RESs work as current sources assuming a regulated DC bus voltage.
An ESD charging/discharging system is typically formed by a storage device, a bidirectional power converter, and a control system. The DC bus voltage ( v d c ) is usually greater than the battery voltage ( v b ); hence, bidirectional step-up converters like Boost [2,3,4] or Buck-Boost [5,6] are commonly used. Considering that these converters have limited voltage gains, a typical value of v b is 12 V [7,8,9], and the values of v d c in microgrid applications vary in wide range, but are significantly greater than v b (e.g., 48 V [10,11,12], 200 V [13]), or higher [14]; then, multiple batteries are connected in series and parallel to reach the required voltage and storage capacity levels, respectively. Those batteries have different electrical characteristics due to manufacturing imperfections, uniform aging, and continuous charging/discharging cycles; these differences produce excessive heat and accelerated degradation of the batteries [15]. That is why there is a necessity for battery balancing systems [15,16] or charging/discharging systems implemented with high-gain power converters to connect each battery, or arrays of parallel batteries, directly to the DC bus. Such a charging/discharging system would avoid the necessity of a balancing system providing some advantages like a high ESDs modularity, and the connection of batteries with several technologies and electrical characteristics. Moreover, this charging/discharging system would permit a simple connection and disconnection of batteries to adjust the storage capacity and the use of second-life batteries coming from applications like electric vehicles.
A bidirectional flyback converter is a feasible option to implement such an ESD charging/discharging system since it provides galvanic isolation between the ESD and the DC bus, it has a simple structure, and it can provide high voltage gains. One disadvantage of the flyback converter is its discontinuous input current, which produces significant ripples in the battery current reducing its life cycle [17,18]. This disadvantage is shared by other charging/discharging systems based on Buck, Buck-Boost, or Zeta converters and has been mitigated by connecting a capacitor in parallel to the battery. Such a capacitor does not affect the dynamic response of the charging/discharging system and absorbs the high frequency components of the battery current [19,20].
A state-of-the-art in this topic shows that the flyback converter has been used to implement battery charging systems for generic applications [21,22], electric vehicles [23,24,25,26], phones [27], PV systems [28,29], and microgrids [6]. Additionally, the flyback converter has also been used for other applications involving batteries like power supply of DC motors [19,30], LED drivers [20], and rectifiers [31]. Nevertheless, the authors have not found up to now any ESD charging/discharging system with a flyback converter to regulate the voltage in a DC bus.
The design of the flyback converter and the control strategy is necessary to obtain the desired performance of the charging/discharging system. In the literature, it is possible to find different design procedures and equations to determine the flyback magnetizing inductance ( L m ), output capacitance ( C d c ) , and transformer’s turns ratio (n) for battery charging or discharging systems. In [21,30,32], the authors introduce procedures and equations to determine L m and n, as well as other elements for the snubber circuit [21] and additional characteristics of the high-frequency transformer (HFT) [32]. An interesting aspect of the procedure presented in [21] is that it includes the calculation of three parameters required by the proposed controller (peak current mode controller with exponential compensation ramp). However, those procedures do not include the design of C d c [21,30,32] and the controllers do not regulate the DC bus voltage [21], are not clearly explained [30], or are not included [32].
Other papers provide equations to size the elements of flyback converters used in battery charging applications. In [25,31], the authors provide equations to determine L m , n, and C d c for step-down flyback converters for a rectifier [31] and an electric vehicle charger. While in [27,28] the authors provide additional equations to determine more characteristics of the snubber circuit elements [27] and the HFT [28] for a phone battery charger [27] and a PV-based uninterruptible power supply [28]. Moreover, other papers are focused on the design of the flyback HFT for a LED illumination system [20] or on providing equations to calculate just L m [24,33] or L m and C d c [19,26] for flyback-based battery charging applications.
Regarding the controllers proposed in the literature for battery charging systems that use flyback converters, most of the papers use linear controllers, while others use specialized controllers (like peak current control [21,34] or fuzzy controller [23]) or do not include a control structure [22,29,31,32,33,35]. A cascade controller is used in [24,25,26], where the outer loop is a PI controller to regulate v b , and the inner loop is a PI that tracks a reference of the battery current ( i b ). In [24], both PIs are tuned by using frequency response to guarantee a desired phase margin and crossover frequency; while the other two papers do not include a design procedure for the PIs [26] or do not provide clear information of the controller structure [25]. Some authors use one PI [6,20,27] or one two-poles two-zeros compensator [19,30] to regulate the flyback output voltage. On the one hand, the PI controller proposed in [27] is tuned by trial and error using different values of the proportional and integral gains; whereas the PIs introduced in [6,20] do not include a design procedure. On the other hand, the compensators introduced in [19,30] use frequency response to tune the controller parameters; nonetheless [30], they do not provide details about the controller design criteria.
From the literature review, the authors identified that there is not a flyback-based battery charging/discharging system to regulate the voltage of a DC bus. However, it is possible to find different battery charging or discharging systems for different applications that illustrate the feasibility of using flyback converters as a power interface for batteries. Moreover, some flyback-based battery interfaces propose design procedures of the main converter components like L m , C d c , and n. Nevertheless, those procedures consider a single operating point of the converter, a single operating mode (i.e., charging or discharging), and do not consider the effect of the flyback parameters on the closed-loop system stability. As consequence, the design of the controller and flyback converter are two independent procedures, which may restrict the stability regions of the system. Additionally, linear converters are the most widely used approach for flyback-based charging or discharging systems. These controllers are designed using linearized models on a particular operating point; therefore, they cannot guarantee the system stability for any operating condition and mode (i.e., charging, discharging, and stand-by).
This paper proposes a flyback-based DC bus voltage regulation system and a co-design procedure of the flyback converter and its control system, where the last is implemented with an adaptive Sliding-Mode Controller (SMC). This paper has three main contributions: (1) a DC bus voltage regulation system that provides high voltage gain and galvanic isolation, which allows the direct connection of a battery to a DC bus and the protection of the battery from faults in the DC bus; (2) an adaptive SMC that guarantees the system stability in any operating condition and mode (i.e., charging, discharging, or stand-by); (3) a detailed co-design procedure of the flyback parameters ( L m , C d c , and n) and the SMC parameters considering the system stability.
The paper begins with the modeling of the proposed charging/discharging system (Section 2) followed by the stability analysis of the proposed Sliding-Mode Controller (SMC) (Section 3), which considers the voltage at C d c , the current through L m , the DC bus current, and two constants ( K v and K i ). Then, the paper introduces the implementation of the proposed SMC along with the analysis of the maximum switching frequency and the dynamic calculation of K i (Section 4). Later, the paper presents the co-design procedure to determine the HFT parameters ( L m and n), C d c , and K v , to guarantee the system stability (Section 5). Finally, simulation results validate the proposed procedure and illustrate the dynamic and static performance of the proposed charging/discharging system under different operating conditions (Section 6) and the conclusions close the paper (Section 7).

2. Proposed Charger/Discharger

The proposed charger/discharger circuit is based on a bidirectional flyback converter; thus, the classical output diode must be replaced by a second Mosfet. Figure 2 presents the proposed circuit, where Mosfet M 2 replaces the output diode of the unidirectional Flyback converter, while Mosfet M 1 is in the same position for both unidirectional and bidirectional topologies.
The flyback converter includes a HFT, which provides galvanic isolation and a high voltage conversion ratio. In the circuit of Figure 2, the HFT is highlighted in green color, and it is modeled accounting for both the magnetizing L m and leakage L k inductances [35,36]. The magnetizing inductance is modeled at the primary side, which allows analyzing the effect of the primary control signal u on the circuit. Instead, the leakage inductance is modeled at the secondary side, which enables the analysis of the dynamic behavior of the DC bus voltage v d c . The HFT is modeled, without loss of generality, with a turn ratio 1 : n , but any other relation can be adopted.
In this bidirectional circuit, the primary control signal u activates/deactivates the Mosfet M 1 at the primary side of the HFT, while the complementary control signal u ¯ = 1 u activates/deactivates the Mosfet M 2 at the secondary side of the HFT. The circuital model of the battery charger, depicted in Figure 2, models the interaction between sources and loads connected to the DC bus as a single bus current i d c , which is the result of subtracting the sources and loads currents, i.e., i d c = i i 1 + i i 2 + i i n i o 1 + i o 2 + i o m using the nomenclature of Figure 1. In addition, the DC bus capacitance is modeled with the C d c capacitor, which collects the output capacitances of the sources and the input capacitances of the loads connected to the bus.
The charger/discharger proposed in Figure 2 also includes a control system aimed at regulating the bus voltage v d c , which is needed to provide a safe operating condition to both sources and loads. Such a control system is designed using the sliding-mode control (SMC) theory, and its analysis and stability are studied in the following section. The outputs of the SMC are the converter control signals u and u ¯ , thus no PWM is required. Figure 2 also describes the measurements needed by the SMC: current of both the primary i p and secondary i s sides of the HFT, battery voltage v b , DC bus voltage v d c , and current i d c . Since both battery and DC bus are isolated by the HFT, a single ground reference is not present, instead the battery and DC bus voltages are measured using differential voltage sensors S v b and S v d c , respectively. From the circuit it is also noted that the battery current is equal to the current at the primary side of the HFT, thus i b = i p . Finally, the SMC receives the reference value v r of the DC bus voltage.

2.1. Switched Model

The mathematical model of the charger/discharger is obtained by studying the differential equations governing the converter for the two possible conditions of the control signal u, which are reported as follows:
  • When u = 1 ( u ¯ = 0 ) Mosfet M 1 is ON and Mosfet M 2 is OFF, which imposes the following differential equations on the magnetizing inductance current i L m and bus voltage v d c :
    d i m d t = v b L m
    d v d c d t = i d c C d c
  • When u = 0 ( u ¯ = 1 ) Mosfet M 1 is OFF and Mosfet M 2 is ON. For this analysis the effect of both the leakage L k inductance and bus voltage is calculated at the primary side of the HFT, while the effect of the magnetizing inductance is calculated at the secondary side of the HFT:
    d i m d t = v d c / n L m + L k / n 2
    d v d c d t = i m / n i d c C d c
Combining the previous differential equations leads to the following switched model:
d i m d t = v b · u L m v d c · 1 u n · L q
L q = L m + L k n 2
d v d c d t = 1 C d c · i m · 1 u n i d c
Moreover, the leakage inductor current i k , and the currents i p and i s  presented in Figure 2, are:
i k = i s = i m n · 1 u
i p = i m · u

2.2. Averaged Model

The averaged model is obtained by averaging the previous equations within the switching period T s w . Such a procedure is performed by replacing the binary control signal u by its averaged value, which corresponds to the converter duty cycle:
d = 1 T s w · 0 T s w u · d t
Then, the averaged model of the charger/discharger is the following one:
d i m d t = v b · d L m v d c · 1 d n · L q
d v d c d t = 1 C d c · i m · 1 d n i d c
Moreover, the averaged leakage inductor current i k and i p current are:
i k = i s = i m n · 1 d
i p = i m · d

2.3. Steady-State Model

The steady-state relations between the previous physical variables are obtained by considering the averaged differential equations equal to zero, which leads to:
i m = n 1 d · i d c
d = M M + n · L q / L m , M = v d c v b
Other important expressions needed for the converter design are the voltage and current ripple magnitudes. In this work, the design will be focused on the current ripple at the magnetizing inductance and the voltage ripple at the bus voltage, since the first one affects the transformer rating and the second one is defined by the requirements of the devices connected to the bus. The ripple at the magnetizing inductance is calculated from (1), which forces the increment of i m during d · T s w seconds (when u = 1 ); thus, the current ripple in i m , around the steady-state value given in (15), is given in (17). In such an expression, F s w = 1 / T s w is the switching frequency.
δ i m = v b · d 2 · L m · F s w
Similarly, the voltage ripple in v d c , around the steady-state value defined by (16), is calculated from (2) as given in (18).
δ v d c = i d c · d 2 · C d c · F s w

3. Sliding-Mode Controller Design

The correct operation of the charger/discharger requires a suitable controller to ensure both global stability and the desired speed correcting the voltage deviations caused by perturbations in the bus current. Therefore, this work proposes an SMC, where the switching function is designed based on the following conditions:
  • The error between the bus voltage v d c and the desired value (reference) v r must be corrected, thus the term K v · v d c v r is introduced, where K v is a parameter.
  • The perturbations introduced in the bus current i d c could be quickly compensated by the magnetizing inductor current i m , thus the term K i · i m i d c is introduced, where K i is a parameter.
Based on the previous considerations, the following switching function Ψ and sliding-surface Φ are defined:
Ψ = K v · v d c v r + K i · i m i d c
Φ = Ψ = 0
A stable SMC ensures the system operates within the sliding surface [37,38]. Therefore, if the proposed SMC is stable, it will ensure the charger/discharger operation within the sliding surface (20), thus v d c = v r and K i · i m = i d c . Since the bus current i d c changes depending on the operation condition, the parameter K i must be dynamically adapted; hence, the proposed controller is an adaptive SMC. The adaptive value of K i is discussed afterward.
The stability of an SMC is evaluated using three tests [37,38]: transversality, reachability, and equivalent control. Those proofs are performed in the following subsections.

3.1. Transversality Condition

The transversality condition proves the presence of the control signal u into the derivative of the switching function Ψ ; therefore, this condition evaluates the capability of the SMC to modify the system behavior. The mathematical formalization of this procedure is given in (21).
d d u d Ψ d t 0
This analysis is based on the switching function derivative, which is calculated as given in (22).
d Ψ d t = K v C d c · i m · 1 u n i d c + K i · v b · u L m v d c · 1 u n · L q d i d c d t
Then, replacing Equations (22), (15), and (16) into (21) leads to the expression given in (23).
d d u d Ψ d t = K v · i d c C d c · n · M · L m L q + n + K i · v b L m + v d c n · L q
The following subsection will explain that the sign of the transversality value defines the reachability conditions, thus the sign of (23) must be the same for any operating condition. The values of K v , C d c , n, M, L m , L q , v b , and v d c are positive; the values of K v and K i are also positive as will be demonstrated in Section 3.4, but the bus current i d c could be positive, negative, or zero. Evaluating expression (23) for i d c = 0 leads to a positive value; hence, the proposed SMC must have positive transversality. Therefore, expression (23) must be positive, which leads to the following design equation for the SMC parameters:
K v · i d c C d c · n · M · L m L q + n + K i · v b L m + v d c n · L q > 0
In conclusion, the SMC fulfills the transversality condition when expression (24) is satisfied, thus such an expression must be considered in the calculation of the parameters.

3.2. Reachability Conditions

The reachability conditions evaluate the ability of the SMC to reach the desired surface starting from any operating condition. The concepts of the reachability analysis are:
  • If the system is operating under the surface Ψ < 0 , the switching function derivative must be positive d Ψ d t > 0 to ensure that the system is able to reach the surface Ψ = 0 . This first concept is formalized as follows:
    lim Ψ 0 d Ψ d t > 0
  • If the system is operating above the surface Ψ > 0 , the switching function derivative must be negative d Ψ d t < 0 to ensure that the system is able to reach the surface Ψ = 0 . This second concept is formalized as follows:
    lim Ψ 0 + d Ψ d t < 0
However, the sign of the transversality condition defines the behavior of the switching function derivative, thus it is necessary to define the effective reachability conditions:
  • A positive transversality sign implies that positive changes on u (from 0 to 1) impose a positive switching function derivative. The formal description of this condition is d d u d Ψ d t > 0 d Ψ d t > 0 when u = 1 .
  • A negative transversality sign implies that negative changes on u (from 1 to 0) impose a positive switching function derivative. The formal description of this condition is d d u d Ψ d t < 0 d Ψ d t > 0 when u = 0 .
Taking into account that the design condition defined in (24) imposes positive transversality, the general reachability conditions (25) and (26) are rewritten as the effective conditions (27) and (28), respectively.
lim Ψ 0 d Ψ d t u = 1 > 0
lim Ψ 0 + d Ψ d t u = 0 < 0
The previous reachability conditions are analyzed by replacing the switching function derivative (22) into inequalities (27) and (28), obtaining the design expressions given in (29) and (30), respectively, where expressions (15) and (16) have also been used.
K v · i d c C d c · n + K i · v b L m > d i d c d t
v d c n · L q · K v · i d c · L m C d c · v b K i < d i d c d t
In conclusion, the SMC fulfills the reachability conditions when expressions (29) and (30) are satisfied, thus those expressions must be considered in the calculation of the parameters.

3.3. Equivalent Control Condition

The equivalent control condition evaluates that the average value of the control signal u is always constrained within the control signal limits [ 0 , 1 ] . Taking into account that the average value of u is the converter duty cycle d, as given in (10), the equivalent control condition, in practice, evaluates the non-saturation of the duty cycle:
0 < u e q = d < 1
The equivalent control is calculated within the surface and with a trajectory parallel to the surface Ψ = 0 and d Ψ d t = 0 [37,38], replacing u by its averaged value d. Hence, solving switching function derivative (22) equal to zero, for u e q = d , results as follows:
u e q = d = d i d c d t K v · i m C d c · n + K v · i d c C d c + K i · v d c n · L q K v · i m C d c · n + K i · v b L m + K i · v d c n · L q
Replacing the u e q value (32) into inequality (31) leads to the same expressions (29) and (30) obtained from the reachability analysis. Therefore, fulfilling the reachability conditions also ensures that the SMC fulfills the equivalent control condition; hence, the duty cycle will not be saturated.
Finally, the SMC will provide global stability when the system parameters fulfill the restrictions imposed in (24), (29), and (30).

3.4. Closed-Loop Dynamics

Taking into account that the SMC parameters fulfill the restrictions (24), (29) and (30), the SMC ensures Ψ = 0 , thus K v · v d c v r + K i · i m i d c = 0 . Since the main perturbation sources are the changes on the bus current, i m or K i must be adjusted to compensate the changes on i d c : the relation between i m and i d c , given (15), shows that i d c = 1 d n · i m , thus K i must be defined as given in (33) to ensure the compensation of i d c .
K i = 1 d n > 0
Moreover, since the SMC is in charge of driving the Mosfets states, the closed-loop dynamics of the bus voltage must be described using the averaged model. In addition, the correct operation of the SMC ( Ψ = 0 ) with the K i value defined in (33) imposes K i · i m i d c = K v · v d c v r , which is replaced into the averaged model (12) to obtain the closed-loop dynamics of the bus voltage under the action of the SMC:
d v d c d t = 1 C d c · K v · v d c v r
The previous equation is an equivalent linear expression, which can be analyzed using the Laplace transformation as follows:
V d c ( s ) V r ( s ) = 1 C d c K v · s + 1
The equivalent dynamics of the DC bus voltage, reported in (35), exhibits a first-order behavior with an equivalent time constant τ = C d c K v ; hence, the settling-time t s of the bus voltage is calculated as t s = 4 · τ [39], which leads to the design equation for the parameter K v of the SMC:
K v = 4 · C d c t s > 0
In conclusion, the design of K i , as given in (33), ensures the compensation of the perturbations on i d c ; and the design of K v , as given in (36), ensures a settling time equal to t s in the bus voltage.

4. Implementation of the Sliding-Mode Controller

The implementation of sliding-mode controllers for power converters is usually performed using comparators with hysteresis to limit the switching frequency [40]. Therefore, the practical sliding surface is defined as given in (37), where H is the hysteresis amplitude, i.e., the hysteresis band is δ Ψ , + δ Ψ . It must be put into evidence that the switching function Ψ is the same one defined in (19), the change occurs at the comparison limits (from 0 to ± δ Ψ ).
Φ H = Ψ δ Ψ
Based on the reachability conditions reported in (27) and (28), the control law required to reach the hysteresis band is obtained as follows:
  • If Ψ > + δ Ψ , it is required d Ψ d t < 0 to reach δ Ψ , + δ Ψ (the hysteresis band), which is achieved with u = 0 .
  • If Ψ < δ Ψ , it is required d Ψ d t > 0 to reach δ Ψ , + δ Ψ , which is achieved with u = 1 .
The previous control law is formalized with the logic equation given in (38), which generates the main control signal u, and requires the calculation of the switching function Ψ . The following subsection describes, in detail, the synthesis of this control law.
u = 1 if Ψ < δ Ψ 0 if Ψ > + δ Ψ

4.1. Synthesis of the Control Law

The first step for the synthesis of the control law is the calculation of the switching function, which has two main terms: K v · v d c v r and K i · i m i d c . The first term is simple to calculate since K v is the constant given in (36), v d c is measured using a voltage sensor, and v r is defined as an input of the SMC. The calculation of this first term is illustrated in Figure 3 by using a subtractor and a gain for K v .
The second term, instead, requires the dynamic calculation of K i , and i m is not physically measured in the circuit. The calculation of K i , reported in (33), requires calculating the duty cycle as given in (16), which is done by measuring both v d c and v b to perform the required mathematical operation with the constants n and L q / L m . Then, 1 d is calculated, which is divided by n. The dynamic calculation of K i is defined in (39) and illustrated in Figure 3 (green block) using gains, an adder, and a divider.
K i = v b v d c · L m / L q + v b · n
The second term requires the value of i m , which is not measured directly. However, from the switched expressions for i p and i s , given in (8) and (9), it is possible to reconstruct i m from the measurement of i p and i s as follows:
i m = i p if u = 1 i s · n if u = 0
The previous i m reconstruction enables the calculation of the switching function (19) from i p and i s , which is used to modify the control law given in (38) as follows:
u = 1 if Ψ s < δ Ψ where Ψ s = K v · v d c v r + K i · n · i s i d c 0 if Ψ p > + δ Ψ where Ψ p = K v · v d c v r + K i · i p i d c
Finally, such a practical control law is implemented using multipliers, adders, subtractors, comparators, and an S-R Flip-Flop. The Flip-Flop is used to keep the value of u inside the hysteresis band, where u = 1 is imposed by activating the set (S) signal, while u = 0 is imposed by activating the reset (R) signal. Moreover, the Flip-Flop also produces the complementary control signal u ¯ without the need for additional hardware. Finally, the complete synthesis of the practical control law is illustrated in Figure 3 (red block), which corresponds to an adaptive sliding-mode controller due to the dynamic calculation of the parameter K i . In such a figure, the blue signals correspond to physical measurements, while the red signals are the outputs of the SMC.

4.2. Switching Frequency

The switching frequency of the dc/dc converter must be constrained to the limit imposed by the Mosfets; otherwise, the SMC will not be able to properly regulate the charger/discharger.
The switching frequency F s w is the result of the Mosfet activation/deactivation at the limits of the hysteresis band, thus the ripple in the switching function δ Ψ must be calculated. The correct operation of the SMC guarantee that v d c = v r (bus voltage regulation) and 1 d n · i m = i d c (current balance at the output capacitor); hence, from the switching function definition (19) it is obtained the following ripple equation:
Ψ r i p p l e = K v · δ v d c + 1 d n · δ i m
The charger/discharger must be designed to provide low-harmonic distortion to the DC bus; therefore, δ v d c must be small, but δ i m depends on the transformer parameters. In addition, Equations (1) and (2) show that the derivatives of v d c and i m have opposite signs, as consequence, the most negative value of δ v d c occurs when δ i m has the most positive value. Therefore, the maximum value of Equation (42) is achieved when δ v d c 0 , which is used to obtain the maximum switching frequency of the charger/discharger:
lim δ v d c 0 + Ψ r i p p l e = δ Ψ = 1 d n · δ i m
Replacing Equations (15) and (17) into (43) leads to an expression for the maximum switching frequency of the charger/discharger:
F s w , m a x = v b · M · L q 2 · δ Ψ L m · M + n · L q 2
Finally, the parameter δ Ψ of the SMC, which corresponds to the peak value of the hysteresis band, must be calculated from (44) to ensure a maximum switching frequency in agreement with Mosfets limitations.

4.3. Bus Capacitance and Voltage Perturbation

The term switching function of the SMC is designed to compensate for the perturbation at the bus current; however, an instantaneous change on the bus current will produce a voltage perturbation on the DC bus. This phenomenon is unavoidable since the capacitor current is the result of the instantaneous change on the bus current and the leakage current, which has a non-instantaneous change defined by (8). Therefore, after a perturbation in the bus current, the capacitor current is not zero, which produces a bus voltage perturbation.
This phenomenon is illustrated in Figure 4, where a step-like change in the bus current i d c is considered. In this example, the bus current changes from the maximum discharge value i d c ( 0 ) > 0 to the maximum charge value i d c ( f ) < 0 with almost an almost infinite derivative d i d c d t , which produces the following behavior:
  • A stable bus voltage requires to fulfill the charge balance principle; thus, the average capacitor current must be zero, i.e., i C d c = i k i d c = 0 .
  • The leakage current i k was originally defined to have an average value equal to the DC current previous to the perturbation i d c ( 0 ) .
  • The step-change on the DC current to the new value i d c ( f ) produces an instantaneous change on the capacitor current equal to i d c ( 0 ) i d c ( f ) .
  • The SMC must reduce i k to have an average value equal to the new DC current i d c ( f ) , thus the control signal must be set to u = 0 .
  • The leakage current changes with a limited derivative defined by (5) and (8), thus i k takes a time T d to reach i C d c = i k i d c = 0 .
  • During T d , the i C d c current is positive because i k > i d c ; hence, a positive charge is introduced into the capacitor, which increases the bus voltage.
  • This process produces an undesired deviation Δ v d c into the bus voltage, which must be limited to avoid damages on both the loads and sources connected to the bus.
Therefore, this paper proposes to develop a design equation for C d c based on the maximum Δ v d c value acceptable for a safe operation of the devices connected to the bus.
The first step is to calculate the maximum change on the capacitor current, which occurs when the dc current changes at the peak of the leakage current, i.e., max i k . From Equation (8), it is noted that i k = i m n for u = 0 . Replacing the previous values into max i k , and adding the ripple δ i m given in (17) to calculate the peak value of i m , it is possible to obtain (45):
max i k = max i m n = i m + δ i m n
The net change on i C d c = i k i d c that causes the voltage deviation, as observed in Figure 4, is:
Δ i k = max i k i d c ( f )
Since the leakage current takes T d seconds to reach the i C d c = 0 [ A ] condition, i.e., i k = i d c ( f ) , the charge Q C d c introduced into the bus capacitor C d c during this perturbation is:
Q C d c = 0 T d i k i d c ( f ) d t = 1 2 · T d · Δ i k
T d is calculated from the condition i k = i d c ( f ) , considering the relation i k = i m n for u = 0 given in (8), and using the derivative of i m for u = 0 given in (3) to calculate the derivative of i k :
T d = max i k i d c ( f ) v d c n 2 · L q
Now, taking into account that the charge (47) introduced in C d c produces the voltage deviation Δ v d c = Q C d c C d c , and using the previous expressions for T d given in (48), Q C d c given in (47), Δ i k given in (46), max i k given in (45), and δ i m given in (17), the voltage deviation caused by a step-like DC current perturbation is:
Δ v d c = n 2 · L q 2 · v d c · C d c · i d c ( 0 ) 1 d + v b 2 · F s w · n · L m i d c ( f ) 2
Finally, the capacitance C d c of the DC bus must be calculated from (49) to ensure a maximum Δ v d c value that guarantees a safe operation of the devices connected to the bus. Since the bus capacitor collects the output capacitances of the sources and the input capacitances of the loads connected to the bus, C d c could be increased to the desired value by adding an external capacitor. However, if the required C d c is lower than the collected capacitance of sources and loads, the voltage deviation will be lower than the maximum safe value and a correct operation is achieved.

5. Design Procedure and Application Example

This section provides a summary of the design procedure for both the charger/discharger circuit and SMC parameters. Moreover, the design procedure is illustrated using an application example based on realistic conditions.
The first step of the design process is to define the design requirements. Table 1 reports the requirements adopted for illustrating the design process, where a standard 12 [V] volt battery must be connected to a 48 [V] bus, which is used in DC microgrids [10,11,12]. The battery charger/discharger must be designed to provide or absorb a maximum of 1 [A], with a maximum slew-rate (current derivative) of 50 [A/ms], which could completely charge (SOC = 100%) a EnerSys NP0.8-12-ND [41] lead-acid battery (12 V–0.8 Ah) in 48 min, or charge/discharge the 10% of the SOC in 4.8 min.
The sources and loads require a maximum voltage ripple of 0.5 [ % ] for a correct operation, and those devices could be damaged for voltage perturbations higher than 3.5 [ % ] , which could be triggered by the highest current perturbation possible, i.e., a step from the maximum current (1 [A]) to the minimum current ( 1 [A]) or vice versa, thus ±2 [A]; moreover, the bus voltage must exhibit a settling time lower than 1 [ms]. Since the ripple in the magnetizing current defines the peak values of the currents at both primary and secondary sides of the HFT, that peak ripple was limited to 5 [A]. Finally, the maximum switching frequency achievable with the adopted Mosfets is 30 [kHz], but any switching frequency below that value is acceptable.

5.1. Selection of the HFT

The second step is to select the HFT. Figure 5 shows the effect of L m and n values on both δ i m and F s w magnitudes. Such a figure was constructed using expressions (16), (17), (33) and (44) with the parameters in Table 1; the figure shows that reducing L m increases, exponentially, the current ripple; while the switching frequency depends on both the ripple and inductance magnitudes. Decreasing the turn ratio n affects, in a similar way, both the current ripple and switching frequency. Thus, decreasing at the same time both the inductance and turn-ratio is not a suitable option; instead, increasing both L m and n enables to select small ripples and low switching frequencies, but the HFT becomes bulkier, heavier, and more expensive.
The previous figure is useful to design a custom HFT since such an analysis enables to fine-tune both the turn-ratio and magnetizing inductance. However, construct an HFT is not a trivial task since specialized equipment is needed, e.g., a frequency analyzer. Therefore, using a commercial HFT is a simpler alternative; for example, Table 2 reports the characteristics of four commercial HFT designed for dc/dc applications. The turn-ratio of those HFT can be used to extract sections of Figure 5 to evaluate the current ripple and switching frequency imposed by those transformers.
Figure 6 shows the effect of L m on both δ i m and F s w for the turn-ratio values of the HFT reported in Table 2, where a wide range of turn-ratios are available; i.e., from n = 1.4 to n = 12 . The figure shows that XFRMS ( n = 1.4 ) and Vitec ( n = 5.4 ) HFT are able to provide both δ i m < 5 [A] and F s w < 30 [kHz], operating near the limit of the feasibility zone due to the L m and L k values of those HFT, which are reported in Table 2. However, the Pulse ( n = 12 ) HFT will provide a switching frequency under 20 [kHz], which is not desirable since that frequency is in the range of the audible noise. A similar, but much worst condition is achiever with the Nascent ( n = 8 ) HFT, which will provide a switching frequency under 5 [kHz].
Another important analysis needed to define the HFT concerns the range of duty cycle available for the SMC: the average duty cycle of the flyback converter must not be near the saturation, otherwise the duty cycle could be saturated when the SMC acts to compensate a perturbation; therefore, it is desirable to have a duty cycle margin for the SMC operation. In this example, a margin of 30% is selected, thus the average duty cycle must be between 30% and 70%; such a value can be modified depending on the load profile. The average duty cycle achieved with the HFT of Table 2 was calculated from expressions (6), (15), and (16), and it is summarized in Figure 7. This analysis shows that XFRMS ( n = 1.4 ) and Pulse ( n = 12 ) transformers require an average duty cycle of 74% and 25%, respectively, thus those HFT are out of the desired duty cycle range. Instead, the Vitec ( n = 5.4 ) and Nascent ( n = 8 ) HFT are inside the desired duty cycle range with average duty cycles of 42.5% and 33.3%, respectively; however, the Vitec ( n = 5.4 ) HFT provides a better duty cycle range since its average duty cycle is near to the 50%. Finally, the only HFT in Table 2 providing an acceptable switching frequency and duty cycle range is the Vitec ( n = 5.4 ), thus such a transformer is selected to design the charger/discharger.
The final calculation of this subsection concerns the hysteresis band limit, which is obtained from expression (44) using the inductances of the selected HFT, which results in δ Ψ = 0.5 [A].

5.2. Selection of the Bus Capacitance

The third step is to design the bus capacitance to fulfill both the maximum ripple δ v d c / v d c < 0.5 [ % ] and the maximum perturbation of the DC bus voltage Δ v d c / v d c < 3.5 [ % ] . Therefore, expressions (16), (18), (44), and (49) are used to analyze the δ v d c / v d c and Δ v d c / v d c values for different bus capacitances, and those results are synthesized in Figure 8.
The previous figure shows that any capacitor higher than 48.85 μ F, which is the minimum C d c acceptable, fulfills both the maximum ripple and maximum perturbation of the DC bus voltage. From the figure, it is evident that such a limit C d c value fulfills the maximum Δ v d c / v d c , and provides a much smaller ripple δ v d c / v d c . Finally, the bus capacitor is selected as the near commercial value C d c = 50 [ μ F], which provides Δ v d c / v d c = 3.4 [ % ] and δ v d c / v d c = 0.35 [ % ] , thus fulfilling both maximum ripple and maximum perturbation of the DC bus voltage.

5.3. Calculation of K v

The fourth step is to calculate the K v parameter of the SMC using expression (36), which must fulfill the stability conditions given in (24), (29), and (30). Figure 9 shows the K v values for different settling times and bus capacitances, taking into account that such K v values fulfill the stability conditions. Finally, in that figure are highlighted the C d c = 50 [ μ F] value selected in the previous subsection, and the maximum settling time t s = 1 [ms], which results in the K v = 0.2 [A/V] value. Since the selected condition t s = 1 ms , C d c = 50 μ F , K v = 0.2 A / V is within the feasibility zone defined by the stability conditions, K v = 0.2 [A/V] ensures both global stability of the SMC and the desired settling time t s = 1 ms for the bus voltage.
Finally, the fourth step described in this section enables to design a stable battery charger/discharger, based on the flyback topology, fulfilling the conditions required to ensure a safe operation for both sources and loads connected to a DC bus.

6. Simulation Results

This section presents circuital simulations of the proposed battery charger/discharger, which validate the design procedure developed in the previous sections. Figure 10 shows the circuital implementation of the battery charger/discharger in the power electronics simulator PSIM, where the flyback converter follows the same circuital structure described in the theoretical circuit of Figure 2, including the voltage sensors for v d c and v b , and the current sensors for i p , i s and i d c .
The circuital implementation also includes the implementation of the adaptive sliding-mode controller described in Figure 3, where can be observed the dynamic calculation of K i . Such SMC implementation is defined by the hysteresis band limit δ Ψ using two voltage sources, but such a limit could be also imposed using zener diodes, requiring a single power source for polarization. The addition/subtraction and gain functions can be implemented using operational amplifiers, while the multiplication and division functions can be implemented with integrated circuits. Moreover, the S-R flip-flop produces the main u and complementary u ¯ control signals, which are observed in the circuital implementation of Figure 10. Finally, the simulation uses a current source to produce the dc current profile in the bus, which could produce three possible states: discharge the battery ( i d c > 0 ), charge the battery ( i d c < 0 ), and battery in stand-by ( i d c = 0 ); thus, the SMC must be able to regulate the charger/discharger in those operating conditions.

6.1. Performance Evaluation

The first test, reported in Figure 11, evaluates the correct operation of the charger/discharger concerning the ripple limits. Thus, the charger/discharger was set in the operating conditions defined for the design process (Table 1), with a bus current i d c = 1 [A] and a reference v r = 48 [V], which produces a duty cycle d = 42.5   [ % ] , a switching frequency F s w = 25.3 [kHz] and K i = 0.1067 [A/V]. Therefore, the steady-state duty cycle is inside the acceptable range defined in Figure 7, and the switching frequency is lower than the maximum limit F s w , m a x = 30 [kHz] defined in Table 1. The simulation reports a DC voltage ripple δ v d c = 0.36 [ % ] (top waveforms), which is lower than the maximum acceptable ripple of 0.5 [ % ] ; this is expected since the bus capacitor was defined as higher than the minimum limit reported in Figure 8. In addition, the current ripple in i m is equal to the design value δ i m = 5 [A] imposed in Table 1 (second waveforms), this is expected since the magnetizing inductance of the selected Vitec HFT imposes that δ i m value as observed in Figure 6b. The simulation also confirms the stability of the SMC (third waveforms), since the switching function Ψ is always trapped inside the hysteresis band 0.5 , + 0.5 , where δ Ψ = 0.5 [A] was calculated at the end of Section 5.1. Finally, the control signal u is depicted at the bottom of the figure, which confirms the control law: u = 1 imposes a positive switching function derivative ( Ψ increases), and u = 0 imposes a negative switching function derivative ( Ψ decreases).
The second test is performed to evaluate the reachability of the surface starting from outside of the hysteresis band. Figure 12 shows a first simulation in which the switching function starts above the hysteresis band ( Ψ > + δ Ψ ), where the SMC follows the practical control law reported in (41): when Ψ = Ψ p > + δ Ψ the control signal is set to 0 ( u = 0 ), which imposes a negative derivative on the switching function ( d Ψ d t < 0 ), forcing Ψ to enter in the hysteresis band 0.5 , + 0.5 , keeping the switching function trapped into that band, which ensures global stability. A second simulation shows a similar behavior, but with the switching function starting below the hysteresis band ( Ψ < δ Ψ ). In this case, the control signal is set to 1 ( u = 1 ) to impose a positive derivative on the switching function ( d Ψ d t > 0 ), forcing Ψ to enter in the hysteresis band, also keeping the switching function trapped into that band; this is in agreement with the SMC control law (41). Therefore, the simulations of Figure 12 confirm that the designed SMC fulfills the reachability conditions, since the charger/discharger is always controlled to enter into the sliding surface from any operation condition outside the surface, thus the system is always driven to stability.
The third test is designed to evaluate the response of the charger/discharger to current derivatives on the DC bus surpassing the limit defined in Table 1. This condition can occur when a load connected to the bus experiments a failure leading to a short-circuit, thus requesting a large current step to the bus. Similarly, if a source experiments a sudden failure, thus will produce a step in current requested by the loads to the battery, since the current provided by the sources will be instantaneously reduced. Figure 13 presents a first simulation (left) in which the bus current changes with the design limit d i d c d t 50 [A/ms], thus the switching function remains inside the hysteresis band. This confirms that the SMC parameters fulfill both the transversality and reachability conditions imposed in (24), (29), and (30), which provide both global stability and the desired bus voltage performance. The second simulation (right) considers a bus current perturbation with almost infinite derivative (step change), thus d i d c d t 50 [A/ms], which forces the switching function to leave the hysteresis band. However, since that high current derivative disappears when the perturbation ends, the reachability of the SMC forces the system to enter the hysteresis band, ensuring again global stability. Therefore, the proposed charger/discharger and SMC could support even step-like perturbations in the DC bus current, since the reachability conditions will force the system into stability as demonstrated in the previous and these tests, i.e., simulations reported in Figure 12 and Figure 13.
The fourth test evaluates the performance of the charger/discharger in compensating the bus voltage after a step-current occurs in the DC bus. The results of this test are reported in Figure 14, where the maximum instantaneous current perturbation of 2 [A], defined in Table 1, is considered. Since the bus capacitor was designed under the minimum C d c capacitor reported in Figure 8, the maximum voltage deviation achieved with the designed charger/discharger is lower than the limit defined in Table 1 (3.5%), achieving Δ v d c / v d c = 3.35 %. Thus, the designed charger/discharger ensures a safe bus voltage to the devices connected to the bus, even under an extreme step-like perturbation on the bus current. This satisfactory behavior is achieved due to the dynamic change of the K i parameter, which enables the SMC to adapt the sliding surface to the instantaneous operation conditions of the system. Finally, the simulation also confirms that the settling time t s = 1 [mA] for the bus voltage, imposed in Table 1, is achieved; this precise behavior is caused by the exact calculation of K v = 0.2 [A/V] performed in Figure 9, which takes into account the C d c = 50 [ μ F] value adopted for the implementation. In conclusion, this test confirms the correctness of the closed-loop dynamics reported in expression (35), and the accurate calculation of K v using expression (36) and Figure 9.
The last test is designed to evaluate the charger/discharger behavior in the three possible operating states: battery discharge ( i d c > 0 ), battery charge ( i d c < 0 ), and battery in stand-by ( i d c = 0 ). Moreover, the test also evaluates the performance of the system for the transition between those operation states, which is a realistic condition since the power flow requested to the battery could suddenly change depending on the operation of both sources and loads. The results of this test are presented in Figure 15, where the DC bus current changes from 1 [A] (battery discharge), to 0 [A] (battery in stand-by) to 1 [A] (battery charge). Since the perturbations have a 1 [A] amplitude, which is half of the perturbation evaluated in the previous test, the deviation of the DC bus voltage is much smaller, thus a safe operation is provided to the devices connected to the bus. Moreover, the simulation also reports the duty cycle, which is never saturated; therefore, the equivalent control condition (31)–(32) is always fulfilled and the system has global stability for all the operating conditions. Similarly, the switching frequency is always lower than the maximum limit (44), defined in Table 1, which confirms the correctness of the HFT selection reported in Figure 6b. In conclusion, this last test demonstrates the ability of the proposed charger/discharger to operate in all the possible conditions of the battery, providing global stability within those states and in the transitions between the states.
Summarizing, the five tests performed to the proposed charger/discharger verify the global stability of the system, the correct design of the circuit and controller parameters, the satisfactory regulation of the bus voltage, and the correct operation of the system for charging, discharging, and stand-by conditions. Therefore, it is confirmed that this solution will provide safe conditions to the devices connected to the DC bus, which is the main objective of a battery charger/discharger in a microgrid.

6.2. Comparison with a Classical Control System

An additional evaluation was carried out by contrasting the performance of the proposed SMC with a classical solution based on PI controllers. The first step to design this classical controller solution is to obtain a linearized model depending on the duty cycle d of the converter. This process starts with the averaged model presented in Section 2.2, which is evaluated at the steady-state conditions defined in Section 2.3 using the values given in Table 1 and Table 2 (Vitec HFT). The resulting linear model is given in expressions (50) and (51), which describe the small-signal models of both the bus voltage and magnetizing current depending on the duty cycle.
v d c ^ d ^ = 3.471 × 10 4 · s + 2.222 × 10 9 s 2 + 1.131 × 10 7
i m ^ d ^ = 1.041 × 10 6 · s + 1.839 × 10 8 s 2 + 1.131 × 10 7
Analyzing the small-signal model of the bus voltage, given in (50), shows that the system exhibits a non-minimum phase behavior due to the positive zero of the transfer function, thus it will be almost impossible to regulate the bus voltage with a single PI controller. This type of system is commonly controlled using a cascade structure [24,26], where an inner controller regulates another state variable to reduce the order of the system. In this case, the other state variable available is the magnetizing current, which small-signal model (51) has a negative zero, thus it has a minimum phase behavior that can be regulated with a single PI controller. Then, the current control loop reported in (52) was designed, using the pole-placement technique [46], to provide a settling time of the magnetizing current ( i m ) equal to 0.2 ms and a closed-loop bandwidth of 8 kHz, which is below the switching frequency imposed by the PWM driving the Mosfets ( F s w = 30 kHz).
Current control loop d ^ = 0.037 · s + 1.442 × 10 4 s · i r ^ i m ^
Since the settling time of i m is five times smaller than the settling time defined in Table 1 for the bus voltage ( t s = 1.0 ms), the cascade voltage controller is designed by considering a correct control of the magnetizing current, thus i m ^ i r ^ where i r ^ is the small-signal reference for the magnetizing current. Therefore, the dc bus voltage model is simplified by assuming i m ^ i r ^ to obtain the reduced-order model reported in (53), which describes the behavior of the bus voltage to changes on the magnetizing current. Finally, a voltage control loop is designed to provide the current reference i r ^ to the current control loop; such a voltage control loop, reported in (54), was designed using the pole-placement technique to provide the desired settling time and maximum voltage deviation defined in Table 1.
v d c ^ i m ^ = 0.5761 0.00027 · s where i m ^ i r ^
Voltage control loop i r ^ = 5.568 · s + 3960 s · v r v d c ^
The output of the inner (current) control loop is the duty cycle, thus a PWM is used to impose that duty cycle to the Mosfets with a fixed switching frequency F s w = 30 kHz. Figure 16 presents the comparison between the performance of the proposed SMC solution and the classical cascade PI structure presented in this subsection. The main perturbation of the charger/discharger is the bus current which exhibits changes with the amplitude defined in Table 1: it is observed that the proposed SMC ensures both the desired settling time and maximum voltage deviation, while the PI structure only fulfills the settling time since the voltage deviation is higher than the limit Δ v d c . Despite the PI structure was designed to ensure the desired voltage deviation, the change in the duty cycle modifies the operating point of the system, which prevents that the PI structure from being able to ensure the desired performance.
Moreover, the simulation of Figure 16 shows the dynamic advantage of the SMC over the PI structure, since the magnetizing current reaches the steady-state condition much faster, thus a lower bus voltage deviation occurs. This is also observed in the duty cycle imposed by the controllers, where the SMC imposes a faster control action in comparison with the PI structure, thus ensuring a fast compensation of the bus voltage. It must be noted that the PI structure defined in (52) and (54) was designed near the speed limit imposed by the switching frequency defined in Table 1: the maximum bandwidth of the inner controller is usually between 1 / 10 = 0.1 and 1 / 5 = 0.2 of the switching frequency since that is the range of validity for the linearized model [46], in this example, it was possible to increase that ratio to 0.266 , but further increments could cause an unstable operation. Therefore, classical linear controllers are not able to ensure the desired behavior of the flyback charger/discharger for all the operating conditions; instead, following the design procedure proposed in this paper ensures that the proposed SMC imposes the desired performance under any condition.

7. Conclusions

The correct design of power and control stages of a battery charger/discharger was presented and validated in this paper. The development of three battery charger/discharger models in order to: design an SMC, establish design equations, and operate the system under requirements and safely, were presented. Particularly, the design equations were used to graph the relations among variables, parameters, and limits enlightening the design procedure. The requirement conditions include maximum ripple and perturbation of the DC bus voltage, a settling time of the DC bus voltage, a maximum switching frequency, and a maximum ripple of the magnetization current. All the requirements were achieved and illustrated through five tests carried out in PSIM. The first test evaluated the correct operation of the battery charger/discharger concerning the ripple limits; the second test evaluated the reachability of the surface achieved by the SMC; the third test verified the response of the battery charger/discharger to current derivatives on the DC bus; the fourth test evaluated the performance of the battery charger/discharger in regulating the bus voltage after a step of current in the DC bus; and the fifth test verified the behavior of the battery charger/discharger in the three possible operating states: charge, discharge, and battery stand-by. That test also evaluated the transition between states. Finally, a comparison of the SMC solution with a classical PI structure was carried out. Although the PI controller was designed to fulfill the requirements of the battery charger/discharger, specifically a desired voltage deviation, the change on the duty cycle modified the operating point of the system, which disabled the PI structure to ensure the desired performance criteria. Because of the excellent behavior of the system facing the perturbations, future work can be focused on extending the design to include the uncertainties of the experimental implementation.

Author Contributions

Conceptualization, C.A.R.-P., A.J.S.-M. and J.D.B.-R.; methodology, C.A.R.-P., A.J.S.-M. and J.D.B.-R.; software, C.A.R.-P., A.J.S.-M. and J.D.B.-R.; validation, C.A.R.-P., A.J.S.-M. and J.D.B.-R.; writing—original draft preparation, C.A.R.-P., A.J.S.-M. and J.D.B.-R.; writing—review and editing, C.A.R.-P., A.J.S.-M. and J.D.B.-R. All authors have read and agreed to the published version of the manuscript.

Funding

This research and the APC were funded by Minciencias, Universidad Nacional de Colombia, Universidad del Valle, and Instituto Tecnológico Metropolitano under the research project “Dimensionamiento, planeación y control de sistemas eléctricos basados en fuentes renovables no convencionales, sistemas de almacenamiento y pilas de combustible para incrementar el acceso y la seguridad energética de poblaciones colombianas”, (Minciencias code 70386), which belongs to the research program “Estrategias para el desarrollo de sistemas energéticos sostenibles, confiables, eficientes y accesibles para el futuro de Colombia”, (Minciencias code 1150-852-70387, Hermes code 46771).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data used in this study are reported in the paper figures and tables.

Acknowledgments

The authors thank the Facultad de Minas (Sede Medellín) and Facultad de Ingeniería y Arquitectura (Sede Manizales) of the Universidad Nacional de Colombia.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Abhishek, A.; Ranjan, A.; Devassy, S.; Kumar Verma, B.; Ram, S.K.; Dhakar, A.K. Review of hierarchical control strategies for DC microgrid. IET Renew. Power Gener. 2020, 14, 1631–1640. [Google Scholar] [CrossRef]
  2. Eghtedarpour, N.; Farjah, E. Control strategy for distributed integration of photovoltaic and energy storage systems in DC micro-grids. Renew. Energy 2012, 45, 96–110. [Google Scholar] [CrossRef]
  3. Vigneysh, T.; Kumarappan, N. Autonomous operation and control of photovoltaic/solid oxide fuel cell/battery energy storage based microgrid using fuzzy logic controller. Int. J. Hydrogen Energy 2016, 41, 1877–1891. [Google Scholar] [CrossRef]
  4. Serna-Garcés, S.I.; Montoya, D.G.; Ramos-Paja, C.A. Sliding-mode control of a charger/discharger DC/DC converter for DC-bus regulation in renewable power systems. Energies 2016, 9, 245. [Google Scholar] [CrossRef]
  5. Georgious, R.; García, J.; García, P.; Summer, M. Analysis of Hybrid Energy Storage Systems with DC Link Fault Ride-Through Capability. In Proceedings of the 2016 IEEE Energy Conversion Congress and Exposition (ECCE), Milwaukee, WI, USA, 18–22 September 2016; pp. 1–8. [Google Scholar]
  6. Chang, Y.c.; Liaw, C.m. Establishment of a Switched-Reluctance Generator-Based Common DC Microgrid System. IEEE Trans. Power Electron. 2011, 26, 2512–2527. [Google Scholar] [CrossRef]
  7. Crown Battery. Renewable Power on Demand; Crown Battery: Fremont, OH, USA, 2020. [Google Scholar]
  8. Discovery Battery. AES LiFePO4 Solar Stationary Batteries; Discovery Battery: Richmond, BC, Canada, 2021. [Google Scholar]
  9. Fullriver Battery. DCG Series Deep Cycle GEL Batteries; Fullriver Battery: Camarillo, CA, USA, 2021. [Google Scholar]
  10. Chang, X.; Li, Y.; Zhang, W.; Wang, N.; Xue, W. Active Disturbance Rejection Control for a Flywheel Energy Storage System. IEEE Trans. Power Electron. 2015, 62, 991–1001. [Google Scholar] [CrossRef]
  11. Madduri, P.A. A Scalable DC Microgrid Architecture for Rural Electrification in Emerging Regions. Ph.D. Thesis, University of California, Berkeley, CA, USA, 2015. [Google Scholar]
  12. Sabry, A.H.; Shallal, A.H.; Hameed, H.S.; Ker, P.J. Compatibility of household appliances with DC microgrid for PV systems. Heliyon 2020, 6, e05699. [Google Scholar] [CrossRef]
  13. Sechilariu, M.; Wang, B.; Locment, F. Building-integrated microgrid: Advanced local energy management for forthcoming smart power grid communication. Energy Build. 2013, 59, 236–243. [Google Scholar] [CrossRef]
  14. Wu, H.; Ding, S.; Sun, K.; Zhang, L.; Li, Y.; Xing, Y. Bidirectional Soft-Switching Series-Resonant Converter with Simple PWM Control and Load-Independent Voltage-Gain Characteristics For Energy Storage System in DC Microgrids. IEEE J. Emerg. Sel. Top. Power Electron. 2017, 5, 1. [Google Scholar] [CrossRef]
  15. Guo, X.; Geng, J.; Liu, Z.; Xu, X.; Cao, W. A Flyback Converter-Based Hybrid Balancing Method for Series-Connected Battery Pack in Electric Vehicles. IEEE Trans. Veh. Technol. 2021, 70, 6626–6635. [Google Scholar] [CrossRef]
  16. Lee, Y.L.; Lin, C.H.; Yang, S.J. Power loss analysis and a control strategy of an active cell balancing system based on a bidirectional flyback converter. Appl. Sci. 2020, 10, 4380. [Google Scholar] [CrossRef]
  17. Li, J.; Gee, A.M.; Zhang, M.; Yuan, W. Analysis of battery lifetime extension in a SMES-battery hybrid energy storage system using a novel battery lifetime model. Energy 2015, 86, 175–185. [Google Scholar] [CrossRef] [Green Version]
  18. Ning, G.; Haran, B.; Popov, B.N. Capacity fade study of lithium-ion batteries cycled at high discharge rates. J. Power Sources 2003, 117, 160–169. [Google Scholar] [CrossRef]
  19. Musasa, K.; Muheme, M.I.; Nwulu, N.I.; Muchie, M. A simplified control scheme for electric vehicle-power grid circuit with DC distribution and battery storage systems. Afr. J. Sci. Technol. Innov. Dev. 2019, 11, 369–374. [Google Scholar] [CrossRef]
  20. Mamizadeh, A.; Mustafa, B.A.; Genc, N. Planar Flyback Transformer Design for PV Powered LED Illumination. Int. J. Renew. Energy Res. 2021, 11, 439–445. [Google Scholar]
  21. Lamar, D.G.; Sebastian, J.; Arias, M.; Rodriguez, A.; Hernando, M.M. A low-cost high power factor battery charger based on standard peak-current mode integrated controllers. EPE J. 2010, 20, 12–21. [Google Scholar] [CrossRef]
  22. Suntio, T. Average and Small-Signal Modeling of Self-Oscillation Control. Dyn. Profile Switch. Mode Convert. 2009, 21, 189–210. [Google Scholar] [CrossRef]
  23. Raj, P.J.; Prabhu, V.V.; Premkumar, K. Fuzzy Logic-based Battery Management System for Solar-Powered Li-Ion Battery in Electric Vehicle Applications. J. Circuits Syst. Comput. 2021, 30, 1–29. [Google Scholar] [CrossRef]
  24. Kushwaha, R.; Singh, B. Interleaved Landsman Converter Fed EV Battery Charger with Power Factor Correction. IEEE Trans. Ind. Appl. 2020, 56, 4179–4192. [Google Scholar] [CrossRef]
  25. Kushwaha, R.; Singh, B. Power Factor Improvement in Modified Bridgeless Landsman Converter Fed EV Battery Charger. IEEE Trans. Veh. Technol. 2019, 68, 3325–3336. [Google Scholar] [CrossRef]
  26. Singh, B.; Kushwaha, R. EV battery charger with non-inverting output voltage-based bridgeless PFC Cuk converter. IET Power Electron. 2019, 12, 3359–3368. [Google Scholar] [CrossRef]
  27. Chao, P.C.; Chen, W.D.; Wu, R.H. A battery charge controller realized by a flyback converter with digital primary side regulation for mobile phones. Microsyst. Technol. 2014, 20, 1689–1703. [Google Scholar] [CrossRef]
  28. Özküçük, S.; Özen, S.A. Isolated solar electronic unit design including capacitive storage for the uninterruptible power supply of critical DC loads. Sol. Energy 2021, 214, 367–376. [Google Scholar] [CrossRef]
  29. Chung, Y.N.; Lin, D.C.; Tseng, K.C.; Wang, C.W. A multiple-input multiple-output power converter with efficient power management. J. Chin. Inst. Eng. Trans. Chin. Inst. Eng. Ser. A/Chung-Kuo K. Ch’eng Hsuch K’an 2007, 30, 1277–1286. [Google Scholar] [CrossRef]
  30. Huang, K.C.; Huang, S.J. Design Enhancement of a Power Supply System for a BLDC Motor-Driven Circuit with State-of-Charge Equalization and Capacity Expansion. IEEE Trans. Ind. Electron. 2018, 65, 8613–8623. [Google Scholar] [CrossRef]
  31. Gökçegöz, F.; Akboy, E.; Hülya Obdan, A. Analysis and design of a flyback converter for universal input and wide load ranges. Electrica 2021, 21, 235–241. [Google Scholar] [CrossRef]
  32. Verma, R.; Shyam, A.; Nair, L. Development of battery powered 100 kV dc power supply. Rev. Sci. Instrum. 2006, 77, 88–91. [Google Scholar] [CrossRef]
  33. Govidan, N.; Rajasekaran Indra, M. Smart fuzzy-based energy-saving photovoltaic burp charging system. Int. J. Ambient. Energy 2018, 39, 671–677. [Google Scholar] [CrossRef]
  34. Newsom, R.L.; Dillard, W.C.; Nelms, R.M.; Member, S. Digital Power-Factor Correction for a Capacitor-Charging Power Supply. IEEE Trans. Ind. Electron. 2002, 49, 1146–1153. [Google Scholar] [CrossRef]
  35. Wu, Q.; Zhu, Z. An Adaptive High-Precision OCP Control Scheme for Flyback AC/DC Converters. IEEE Trans. Power Electron. 2017, 32, 8969–8973. [Google Scholar] [CrossRef]
  36. Erickson, R.W.; Maksimović, D. Fundamentals of Power Electronics, 3rd ed.; Springer: Gewerbestrasse, Switzerland, 2020; pp. 1–1071. [Google Scholar] [CrossRef]
  37. Sira-Ramirez, H. Nonlinear variable structure systems in sliding mode: The general case. IEEE Trans. Autom. Control 1989, 34, 1186–1188. [Google Scholar] [CrossRef]
  38. Sira-Ramirez, H. Sliding Motions in Bilinear Switched Networks. IEEE Trans. Circuits Syst. 1987, 34, 919–933. [Google Scholar] [CrossRef]
  39. Ogata, K. Modern Control Engineering, 4th ed.; Prentice Hall: Upper Saddle River, NJ, USA, 2010; pp. 567–595. [Google Scholar]
  40. Tan, S.C.; Lai, Y.M.; Tse, C.K. Sliding Mode Control of Switching Power Converters; CRC Press: Boca Raton, FL, USA, 2011; p. 368. [Google Scholar] [CrossRef]
  41. EnerSys. NP0.8-12 Lead-Acid Battery; EnerSys: Reading, PA, USA, 2020. [Google Scholar]
  42. XFMRS Inc. 50 W Flyback Transformer XF0356A-EFD25S; XFMRS Inc.: Camby, IN, USA; Available online: https://xfmrs.com/all/ (accessed on 29 October 2021).
  43. ViTEC. Flyback CCM Transformer 58PR6962; ViTEC: Carlsbad, CA, USA, 2000. [Google Scholar]
  44. NASCENTechnology. LTCC High Voltage Flyback Transformer 95073, 95073-STX; NASCENTechnology: Watertown, SD, USA, 2013. [Google Scholar]
  45. Pulse Engineering Inc. Smt Flyback Transformer For Photoflash Capacitor Charger; Pulse Engineering Inc.: Sha Tin, Hong Kong, 2004. [Google Scholar]
  46. Petrone, G.; Ramos-Paja, C.A.; Spagnuolo, G. Photovoltaic Sources Modeling, 1st ed.; Wiley-IEEE Press: Hoboken, NJ, USA, 2016. [Google Scholar]
Figure 1. General structure of a DC microgrid.
Figure 1. General structure of a DC microgrid.
Applsci 11 10506 g001
Figure 2. Proposed circuit for the charger/discharger based on the flyback topology.
Figure 2. Proposed circuit for the charger/discharger based on the flyback topology.
Applsci 11 10506 g002
Figure 3. Proposed sliding-mode controller for the battery charger/discharger.
Figure 3. Proposed sliding-mode controller for the battery charger/discharger.
Applsci 11 10506 g003
Figure 4. Example of a bus voltage deviation due to fast current perturbations.
Figure 4. Example of a bus voltage deviation due to fast current perturbations.
Applsci 11 10506 g004
Figure 5. Effect of L m and n values on both δ i m and F s w .
Figure 5. Effect of L m and n values on both δ i m and F s w .
Applsci 11 10506 g005
Figure 6. Effect of L m on both δ i m and F s w for turn-ratio values of some commercial HFT. (a) n = 1.4 and XFRMS HFT; (b) n = 5.4 and Vitec HFT; (c) n = 8.0 and Nascent HFT; (d) n = 12.0 and Pulse HFT.
Figure 6. Effect of L m on both δ i m and F s w for turn-ratio values of some commercial HFT. (a) n = 1.4 and XFRMS HFT; (b) n = 5.4 and Vitec HFT; (c) n = 8.0 and Nascent HFT; (d) n = 12.0 and Pulse HFT.
Applsci 11 10506 g006
Figure 7. Average duty cycle achieved with the HFT of Table 2.
Figure 7. Average duty cycle achieved with the HFT of Table 2.
Applsci 11 10506 g007
Figure 8. δ v d c / v d c and Δ v d c / v d c for different C d c values.
Figure 8. δ v d c / v d c and Δ v d c / v d c for different C d c values.
Applsci 11 10506 g008
Figure 9. K v calculation for different settling times and bus capacitances.
Figure 9. K v calculation for different settling times and bus capacitances.
Applsci 11 10506 g009
Figure 10. Circuital implementation of the battery charger/discharger in PSIM.
Figure 10. Circuital implementation of the battery charger/discharger in PSIM.
Applsci 11 10506 g010
Figure 11. Steady-state operation for i d c = 1 [A].
Figure 11. Steady-state operation for i d c = 1 [A].
Applsci 11 10506 g011
Figure 12. Reachability of the hysteresis band. Left: reachability from Ψ > + δ Ψ ; Right: reachability from Ψ < δ Ψ .
Figure 12. Reachability of the hysteresis band. Left: reachability from Ψ > + δ Ψ ; Right: reachability from Ψ < δ Ψ .
Applsci 11 10506 g012
Figure 13. Stability on low-frequency and high-frequency current perturbations. Left: low-frequency perturbation; Right: high-frequency perturbation.
Figure 13. Stability on low-frequency and high-frequency current perturbations. Left: low-frequency perturbation; Right: high-frequency perturbation.
Applsci 11 10506 g013
Figure 14. Performance in the compensation of the bus voltage.
Figure 14. Performance in the compensation of the bus voltage.
Applsci 11 10506 g014
Figure 15. Transition between battery discharge, battery charge, and battery in stand-by.
Figure 15. Transition between battery discharge, battery charge, and battery in stand-by.
Applsci 11 10506 g015
Figure 16. Comparison between the proposed SMC and a classical PI structure.
Figure 16. Comparison between the proposed SMC and a classical PI structure.
Applsci 11 10506 g016
Table 1. Parameters for the application example.
Table 1. Parameters for the application example.
ParameterSymbolValue
Battery voltage v b 12 [V]
Reference value for the bus voltage v r 48 [V]
Maximum ripple of the DC bus voltage δ v d c / v d c 0.5 [%]
Maximum perturbation of the DC bus voltage Δ v d c / v d c ±3.5 [%]
Settling time of the DC bus voltage t s 1 [ms]
Maximum switching frequency F s w , m a x 30 [kHz]
Maximum ripple of the magnetizing current δ i m 5 [A]
Maximum dc current i d c ±1 [A]
Maximum instantaneous current perturbation Δ i d c ±2 [A]
Maximum dc current derivative max d i d c d t ±50 [A/ms]
Table 2. Parameters of some commercial HFT designed for dc/dc applications.
Table 2. Parameters of some commercial HFT designed for dc/dc applications.
Transformer n [ ] L m [ μ H ] L k [ μ H ] Datasheet
XFRMS1.4350.45 [42]
Vitec5.4204 [43]
Nascent8.07511 [44]
Pulse12180.75 [45]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Ramos-Paja, C.A.; Bastidas-Rodriguez, J.D.; Saavedra-Montes, A.J. Design and Control of a Battery Charger/Discharger Based on the Flyback Topology. Appl. Sci. 2021, 11, 10506. https://doi.org/10.3390/app112210506

AMA Style

Ramos-Paja CA, Bastidas-Rodriguez JD, Saavedra-Montes AJ. Design and Control of a Battery Charger/Discharger Based on the Flyback Topology. Applied Sciences. 2021; 11(22):10506. https://doi.org/10.3390/app112210506

Chicago/Turabian Style

Ramos-Paja, Carlos Andres, Juan David Bastidas-Rodriguez, and Andres Julian Saavedra-Montes. 2021. "Design and Control of a Battery Charger/Discharger Based on the Flyback Topology" Applied Sciences 11, no. 22: 10506. https://doi.org/10.3390/app112210506

APA Style

Ramos-Paja, C. A., Bastidas-Rodriguez, J. D., & Saavedra-Montes, A. J. (2021). Design and Control of a Battery Charger/Discharger Based on the Flyback Topology. Applied Sciences, 11(22), 10506. https://doi.org/10.3390/app112210506

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