# Design and Control of a Battery Charger/Discharger Based on the Flyback Topology
###### Abstract
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  
Figure 1: General structure of a DC microgrid. 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_{dc}\)), 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_{dc}\)[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_{dc}\) 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_{dc}\)[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, 33, 35, 32]. 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.