# Design and Control of a Battery Charger/Discharger Based on the Flyback Topology
###### Abstract
On the other hand, the compensators introduced in [19, 30] use frequency response to tune the controller parameters; nonetheless [30],  
textcolorblackthey 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_{dc}\), 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 implementedwith 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_{dc}\), 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_{dc}\), the current through \(L_{m}\), the DC bus current, and two constants (\(K_{v}\) and \(K_{l}\)). 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_{dc}\), 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).