Estimation of the Hot Swap Circulation Current of a Multiple Parallel Lithium Battery System with an Artificial Neural Network Model

Battery applications, such as electric vehicles, electric propulsion ships, and energy storage systems, are developing rapidly, and battery management issues are gaining attention. In this application field, a battery system with a high capacity and high power in which numerous battery cells are connected in series and parallel is used. Therefore, research on a battery management system (BMS) to which various algorithms are applied for efficient use and safe operation of batteries is being conducted. In general, maintenance/replacement of multi-series/multiple parallel battery systems is only possible when there is no load current, or the entire system is shut down. However, if the circulating current generated by the voltage difference between the newly added battery and the existing battery pack is less than the allowable current of the system, the new battery can be connected while the system is running, which is called hot swapping. The circulating current generated during the hot-swap operation is determined by the battery’s state of charge (SOC), the parallel configuration of the battery system, temperature, aging, operating point, and differences in the load current. Therefore, since there is a limit to formulating a circulating current that changes in size according to these various conditions, this paper presents a circulating current estimation method, using an artificial neural network (ANN). The ANN model for estimating the hot-swap circulating current is designed for a 1S4P lithium battery pack system, consisting of one series and four parallel cells. The circulating current of the ANN model proposed in this paper is experimentally verified to be able to estimate the actual value within a 6% error range.


Introduction
As environmental and resource depletion problems become more serious, research on eco-friendly systems that use batteries, such as electric vehicles, electric-powered ships, and large-capacity energy storage system (ESS) power generation systems that do not use fossil fuels, is accelerating. Since large capacity and high power are required in these fields, battery packs in which numerous battery cells are connected in series/parallel are used. Various studies are being conducted because the role of the battery management system (BMS) is very important to maintain the optimal state of these battery packs and perform protection operations [1][2][3][4][5][6]. Figure 1 is an example of a large-capacity battery system configuration applied to an energy storage system and an electric propulsion ship. A total of 200 to 300 lithium battery cells are connected in series to form one high-voltage rack, and several racks are connected in parallel to expand the capacity [7]. Hot swap refers to the function of detaching/attaching a module from the DC bus by applying a high voltage relay on the top of the rack for maintenance/replacement of cell unit batteries in the above multiseries/multi-parallel system. At this time, the hot swap action should be performed only maintenance/replacement of cell unit batteries in the above multi-series/multi-parallel system. At this time, the hot swap action should be performed only under certain conditions. The reason is that the difference in the state of charge of the newly added battery and the working battery causes an excessive circulating current. In order to minimize or avoid the circulating current during the hot-swap operation, the hot-swap operation should be performed after matching the state of charge between the newly added battery and the existing working battery. To solve this problem, there was a study on applying a DC/DC converter to match the output voltage of the battery. Jiang et al. used a buck regulator and Moo et al., applied a buck/boost converter to minimize the circulating current by controlling the battery voltage [8,9]. These studies devised ways to basically suppress the circulating current caused by the voltage difference of the battery, but they are problematic in that the system size increases and the efficiency decreases when a converter is used to connect the device to a high voltage/power battery system.
On the other hand, studies have been conducted to connect batteries in parallel without using a DC/DC converter. Hsu et al. presented an algorithm for opening and closing switches according to priority through differential classification of SOCs of batteries for both individual and parallel charging of batteries [10]. In this study, an efficient battery parallel connection method without using a DC/DC converter was presented, but the parallel connection condition was simply set as SOC, and only the case where the load current was the charging condition was considered. In addition, studies to estimate the circulating current have not been conducted. Song et al. controlled the switch connected to the battery by using a control algorithm based on fuzzy control logic [11]. They succeeded in lowering the circulating current due to the parallel connection and were able to achieve efficient energy management. In Song's study, similar to that of Hsu, the circulating current was reduced by classifying the battery, according to the SOC, and the circulating current estimation study was not performed. Two previous studies [10,11] used the state of charge (SOC) as a condition for the parallel connection of batteries. Since the state of charge of the battery is an estimated value, there may be an error compared to the actual state of charge. Since the SOC estimation error of parallel-connected battery racks represents a In order to minimize or avoid the circulating current during the hot-swap operation, the hot-swap operation should be performed after matching the state of charge between the newly added battery and the existing working battery. To solve this problem, there was a study on applying a DC/DC converter to match the output voltage of the battery. Jiang et al. used a buck regulator and Moo et al., applied a buck/boost converter to minimize the circulating current by controlling the battery voltage [8,9]. These studies devised ways to basically suppress the circulating current caused by the voltage difference of the battery, but they are problematic in that the system size increases and the efficiency decreases when a converter is used to connect the device to a high voltage/power battery system.
On the other hand, studies have been conducted to connect batteries in parallel without using a DC/DC converter. Hsu et al. presented an algorithm for opening and closing switches according to priority through differential classification of SOCs of batteries for both individual and parallel charging of batteries [10]. In this study, an efficient battery parallel connection method without using a DC/DC converter was presented, but the parallel connection condition was simply set as SOC, and only the case where the load current was the charging condition was considered. In addition, studies to estimate the circulating current have not been conducted. Song et al. controlled the switch connected to the battery by using a control algorithm based on fuzzy control logic [11]. They succeeded in lowering the circulating current due to the parallel connection and were able to achieve efficient energy management. In Song's study, similar to that of Hsu, the circulating current was reduced by classifying the battery, according to the SOC, and the circulating current estimation study was not performed. Two previous studies [10,11] used the state of charge (SOC) as a condition for the parallel connection of batteries. Since the state of charge of the battery is an estimated value, there may be an error compared to the actual state of charge. Since the SOC estimation error of parallel-connected battery racks represents a large voltage difference between the battery racks, using only the SOC as a hot swap condition may be problematic. Therefore, in this paper, the terminal voltage of the battery is determined to be a hot-swap condition. Lee et al. predicted the circulating current of the battery based on an equivalent model of the battery. To calculate the inrush current that occurs during the hot-swap operation, the equivalent model of the battery is based on the open-circuit voltage and Ri model. Cell unit tests and the simulation were used to verify the model by applying an EV driving cycle. However, these authors did not verify the situation in which the direction of the charging/discharging load current is changed, nor did they study the characteristics of the battery according to the state change, such as the temperature and aging of the battery [12,13]. Chou et al. conducted a study on the design of a Smart Redundant Battery (SRB) that reflects the direct current internal resistance (DCIR) and pack impedance of the battery (cable, etc.) and the hot-swap conditions that can operate within a set current [14]. Since this study did not consider the hot-swap circulating current, according to the parallel configuration of batteries, it is possible to exceed the current limit of the battery system under the parallel condition of three or more batteries.
In previous studies, various studies on circulating current generation in multi-parallel battery systems were performed, but most studies determined that the circulating current generated during hot-swap operation was due to differences in the SOC of the battery. However, no study was conducted to analyze and estimate the influence of major factors affecting the magnitude of the circulating current generated during hot swapping.
In this paper, the effects of voltage deviation, temperature, parallel configuration, and load current were analyzed as major factors that determine the circulating current generated during a hot-swap operation. After designing a 1S4P battery pack to perform the hot-swap analysis, a 2 RC-based battery equivalent simulation model design was performed. Based on the simulation model, the case study analysis led to hot-swap conditions that could operate within the established current limits. The nD-LUT (Look-Up Table) model can be used to perform a hot-swap operation that reflects various conditions but can only be used as a condition to turn the action on and off. However, the estimated current can be utilized for power management before and after the hot-swap operation as well as determining the hot-swap operation by estimating the circulating current generated during the hot-swap operation.
In the previous study of Lee et al., a formula for calculating the magnitude of circulating current generated during the hot swap was derived from a simplified circuit model of the entire system [13]. The formula for estimating the circulating current can be applied well under the stabilized condition in which the state of charge of the existing connected batteries is the same, but it cannot be used in a situation where the current between the battery cells is unbalanced, due to the continuous hot-swap operation. Therefore, in this paper, an artificial neural network (ANN) model was used to estimate the circulating current generated during the hot-swap operation, considering various conditions in real time.
The ANN model was suggested as a method for estimating the state of the battery, such as the state of charge (SOC) and state of health (SOH) in battery systems but has not yet been applied to studies to estimate the hot-swap circulating current [15][16][17][18]. Among the ANN models, the Fitnet model can be fitted to any degree of accuracy if sufficient input values are available. Thus, the results of the simulation-based hot-swap case study analysis were used as the input data, and the circulating current generated under the corresponding condition is displayed as the result [19][20][21]. Therefore, it is possible to determine the conditions for the hot-swap operation from the results of the circulating current estimation with the ANN model, which can take various conditions into consideration. In this study, an ANN model with two hidden layers was constructed to estimate the hot-swap circulating current of a 1S4P lithium battery pack. The performance of the model in terms of the circulating current estimation was confirmed to be approximately 94% accurate.

Design of Lithium Battery Model
The battery system of an ESS consists of numerous battery cells. Specifically, units containing 200-300 lithium battery cells that are connected in series are connected in parallel. The battery model for the analysis of the ESS of a cell causes the simulation model to become computationally complex, and the analysis may not be possible. Since a highvoltage battery in a multi-series configuration requires a passive or active cell-balancing function, it can be simplified to a single-cell equivalent model under the assumption that the cell-to-cell voltage is consistent [22].
In this study, the hot-swap analysis was performed, using a scaled down 1S4P lithium battery pack to account for multiple parallel systems.

Design of Lithium Battery Equivalent Circuit
The lithium battery equivalent circuit model (ECM) can be used to describe the nonlinear characteristics of batteries and to estimate the state of the batteries [23][24][25]. The model can be based on an ECM consisting of voltage sources, resistors, and capacitors as shown in Figure 2. Figure 2a,b shows the first-and second-order RC circuits, respectively. As the number of RCs increases, the accuracy of the model may increase, but the parameters constituting the model increase, which increases the computational intensity and analysis time. In addition, because the nonlinearity of the battery can be sufficiently described with 2RC, the equivalent circuit model was designed using the 2RC model [26]. In this study, the lithium battery equivalent circuit was designed using MATLAB/Simulink software. Two approaches could be followed for the design. First, as shown in Figure 3a, the Simscape or Power Sim library provided by Simulink includes a method for configuring electrical circuit elements. Second, the ECM can be represented by Equation (1), and it can be modeled based on equations using basic blocks as shown in Figure 3b.

Design of Lithium Battery Model
The battery system of an ESS consists of numerous battery cells. Specifically, units containing 200-300 lithium battery cells that are connected in series are connected in parallel. The battery model for the analysis of the ESS of a cell causes the simulation model to become computationally complex, and the analysis may not be possible. Since a highvoltage battery in a multi-series configuration requires a passive or active cell-balancing function, it can be simplified to a single-cell equivalent model under the assumption that the cell-to-cell voltage is consistent [22].
In this study, the hot-swap analysis was performed, using a scaled down 1S4P lithium battery pack to account for multiple parallel systems.

Design of Lithium Battery Equivalent Circuit
The lithium battery equivalent circuit model (ECM) can be used to describe the nonlinear characteristics of batteries and to estimate the state of the batteries [23][24][25]. The model can be based on an ECM consisting of voltage sources, resistors, and capacitors as shown in Figure 2. Figure 2a,b shows the first-and second-order RC circuits, respectively. As the number of RCs increases, the accuracy of the model may increase, but the parameters constituting the model increase, which increases the computational intensity and analysis time. In addition, because the nonlinearity of the battery can be sufficiently described with 2RC, the equivalent circuit model was designed using the 2RC model [26]. In this study, the lithium battery equivalent circuit was designed using MATLAB/Simulink software. Two approaches could be followed for the design. First, as shown in Figure 3a, the Simscape or Power Sim library provided by Simulink includes a method for configuring electrical circuit elements. Second, the ECM can be represented by Equation (1), and it can be modeled based on equations using basic blocks as shown in Figure 3b.  Each parameter constituting the lithium battery equivalent circuit is derived from the voltage characteristic behavior of the current flowing through the lithium battery. In addition, the characteristics of the battery, such as the SOC, temperature, and aging, are not

Design of Lithium Battery Model
The battery system of an ESS consists of numerous battery cells. Specifically, units containing 200-300 lithium battery cells that are connected in series are connected in parallel. The battery model for the analysis of the ESS of a cell causes the simulation model to become computationally complex, and the analysis may not be possible. Since a highvoltage battery in a multi-series configuration requires a passive or active cell-balancing function, it can be simplified to a single-cell equivalent model under the assumption that the cell-to-cell voltage is consistent [22].
In this study, the hot-swap analysis was performed, using a scaled down 1S4P lithium battery pack to account for multiple parallel systems.

Design of Lithium Battery Equivalent Circuit
The lithium battery equivalent circuit model (ECM) can be used to describe the nonlinear characteristics of batteries and to estimate the state of the batteries [23][24][25]. The model can be based on an ECM consisting of voltage sources, resistors, and capacitors as shown in Figure 2. Figure 2a,b shows the first-and second-order RC circuits, respectively. As the number of RCs increases, the accuracy of the model may increase, but the parameters constituting the model increase, which increases the computational intensity and analysis time. In addition, because the nonlinearity of the battery can be sufficiently described with 2RC, the equivalent circuit model was designed using the 2RC model [26]. In this study, the lithium battery equivalent circuit was designed using MATLAB/Simulink software. Two approaches could be followed for the design. First, as shown in Figure 3a, the Simscape or Power Sim library provided by Simulink includes a method for configuring electrical circuit elements. Second, the ECM can be represented by Equation (1), and it can be modeled based on equations using basic blocks as shown in Figure 3b.  Each parameter constituting the lithium battery equivalent circuit is derived from the voltage characteristic behavior of the current flowing through the lithium battery. In addition, the characteristics of the battery, such as the SOC, temperature, and aging, are not Each parameter constituting the lithium battery equivalent circuit is derived from the voltage characteristic behavior of the current flowing through the lithium battery. In addition, the characteristics of the battery, such as the SOC, temperature, and aging, are not constant and vary with time. Therefore, in this study, a discharge experiment was carried out using battery charging/discharging equipment (Neware, Hong Kong, China, BTS-4000) and a temperature chamber (JEIO Tech, Daejeon, Korea, LCH-11) to reflect the extent to which the characteristics of the battery change, depending on the SOC and temperature in the model. The temperature levels were 0, 10, 23, 35, and 45 • C and the SOC was tested at 10% intervals. The experimental profile of the charging/discharging equipment used in the experiment is shown in Figure 4, and the results of the voltage/current measurements in the discharge period are shown in Figure 5 [27].
Electronics 2021, 10, x FOR PEER REVIEW 5 of 20 constant and vary with time. Therefore, in this study, a discharge experiment was carried out using battery charging/discharging equipment (Neware, Hong Kong, China, BTS-4000) and a temperature chamber (JEIO Tech, Daejeon, Korea, LCH-11) to reflect the extent to which the characteristics of the battery change, depending on the SOC and temperature in the model. The temperature levels were 0, 10, 23, 35, and 45 °C and the SOC was tested at 10% intervals. The experimental profile of the charging/discharging equipment used in the experiment is shown in Figure 4, and the results of the voltage/current measurements in the discharge period are shown in Figure 5 [27].  The parameters of the equivalent model were derived from the dynamic characteristics of the voltage during the discharge period, and the battery terminal voltage is expressed by Equation (2). The OCV parameter was derived from the voltage in the steady state before the current for each discharge section was applied. The series resistance Ri is calculated by dividing the voltage difference denoted as ①ΔV1, as shown in Figure 6, by the applied current. The Rdiff and Cdiff parameters were derived by exponentially fitting the voltage values, excluding the OCV and IR-Drop in ②ΔV2 in Figure 6. The MATLAB curve-fitting ToolBox was used for function fitting. The fitting was performed by applying Equation (3) to the Custom Equation item of curve-fitting, and the Rdiff1, Rdiff2, Cdiff1, and constant and vary with time. Therefore, in this study, a discharge experiment was carried out using battery charging/discharging equipment (Neware, Hong Kong, China, BTS-4000) and a temperature chamber (JEIO Tech, Daejeon, Korea, LCH-11) to reflect the extent to which the characteristics of the battery change, depending on the SOC and temperature in the model. The temperature levels were 0, 10, 23, 35, and 45 °C and the SOC was tested at 10% intervals. The experimental profile of the charging/discharging equipment used in the experiment is shown in Figure 4, and the results of the voltage/current measurements in the discharge period are shown in Figure 5 [27].  The parameters of the equivalent model were derived from the dynamic characteristics of the voltage during the discharge period, and the battery terminal voltage is expressed by Equation (2). The OCV parameter was derived from the voltage in the steady state before the current for each discharge section was applied. The series resistance Ri is calculated by dividing the voltage difference denoted as ①ΔV1, as shown in Figure 6, by the applied current. The Rdiff and Cdiff parameters were derived by exponentially fitting the voltage values, excluding the OCV and IR-Drop in ②ΔV2 in Figure 6. The MATLAB curve-fitting ToolBox was used for function fitting. The fitting was performed by applying Equation (3) to the Custom Equation item of curve-fitting, and the Rdiff1, Rdiff2, Cdiff1, and The parameters of the equivalent model were derived from the dynamic characteristics of the voltage during the discharge period, and the battery terminal voltage is expressed by Equation (2). The OCV parameter was derived from the voltage in the steady state before the current for each discharge section was applied. The series resistance R i is calculated by dividing the voltage difference denoted as 1 ∆V 1 , as shown in Figure 6, by the applied current. The R diff and C diff parameters were derived by exponentially fitting the voltage values, excluding the OCV and IR-Drop in 2 ∆V 2 in Figure 6. The MATLAB curve-fitting ToolBox was used for function fitting. The fitting was performed by applying Equation (3) to the Custom Equation item of curve-fitting, and the R diff1 , R diff2 , C diff1 , and C diff2 parameters were derived from Equations (5) and (6) as a result of the fitting [28,29]. Figure 7 shows the results that were obtained using the second-order RC ECM and MATLAB/Simulink/Simscape software, and the parameters derived from the above results reflect the characteristics according to the values of SOC and Temp, using the nD-lookup table. To verify the accuracy of the battery ECM model in Figure 7, we performed a terminal voltage comparison between the voltage measurement data of the pulse discharge test and the simulation model. The comparison result is shown in Figure 8, and the ECM model confirmed that the voltage error was less than about 30 mv in most regions except for the low SOC (<3 V) region, where the nonlinear characteristics of the battery are severe, and the MSE (Mean Square Error) was found to be 0.0011; through this, the accuracy of the single cell ECM model was verified.
Cdiff2 parameters were derived from Equations (5) and (6) as a result of the fitting [28,29]. Figure 7 shows the results that were obtained using the second-order RC ECM and MATLAB/Simulink/Simscape software, and the parameters derived from the above results reflect the characteristics according to the values of SOC and Temp, using the nDlookup table. To verify the accuracy of the battery ECM model in Figure 7, we performed a terminal voltage comparison between the voltage measurement data of the pulse discharge test and the simulation model. The comparison result is shown in Figure 8, and the ECM model confirmed that the voltage error was less than about 30 mv in most regions except for the low SOC (<3 V) region, where the nonlinear characteristics of the battery are severe, and the MSE (Mean Square Error) was found to be 0.0011; through this, the accuracy of the single cell ECM model was verified. Figure 6. Voltage, OCV, and current waveform when SOC decreased from 70% to SOC 60%. Figure 6. Voltage, OCV, and current waveform when SOC decreased from 70% to SOC 60%.

1S4P Lithium Battery Pack Design for Experimental Verification
To verify the lithium battery software model and the hot-swap experiment, a 1S4P battery pack was designed. Current sensors and relays were allocated for each cell unit to implement the hot-swap function for the parallel connection of batteries in series units of the ESS system. Table 1 lists the components of the lithium battery pack. The INR 18650-30Q was used as the lithium battery, the ACS 712 product with <5 A performance was used as the current sensor, and measurements were performed in units of 100 ms, using a myRio-1900 controller. In the case of the voltage measurement, a direct connection was made from the lithium battery to satisfy the analog input specification (< 5 V) of the controller. For the voltage/current measurement and relay control of the lithium battery pack, an experimental set was constructed, using the myRio-1900 controller and LabVIEW software; the composition is shown in Figure 9.

1S4P Lithium Battery Pack Design for Experimental Verification
To verify the lithium battery software model and the hot-swap experiment, a 1S4P battery pack was designed. Current sensors and relays were allocated for each cell unit to implement the hot-swap function for the parallel connection of batteries in series units of

1S4P Lithium Battery Pack Design for Experimental Verification
To verify the lithium battery software model and the hot-swap experiment, a 1S4P battery pack was designed. Current sensors and relays were allocated for each cell unit to implement the hot-swap function for the parallel connection of batteries in series units of  used as the current sensor, and measurements were performed in units of 100 ms, using a myRio-1900 controller. In the case of the voltage measurement, a direct connection was made from the lithium battery to satisfy the analog input specification (< 5 V) of the controller. For the voltage/current measurement and relay control of the lithium battery pack, an experimental set was constructed, using the myRio-1900 controller and LabVIEW software; the composition is shown in Figure 9.

Designing Software Model for 1S4P Lithium Battery Pack
The lithium battery cell model was composed of a second-order RC ECM, as shown in Figure 7, and a relay model was arranged for each cell to implement the relay function, as shown in Figure 10. The relay on-resistor was confirmed experimentally with 30 mΩ. The cable and contact resistance used in the pack configuration was confirmed by carrying out an experiment with 5 mΩ, using one resistance model for each cell. The ECM model of the battery pack consisted of a cell model, a relay and other cable resistance models. To verify the accuracy of the modeling, the modeling accuracy was judged by comparing the Figure 9. Configuration of the 1S4P battery pack for the experiment: (a) block diagram of the experimental construction; (b) hot-swap experiment and configuration of the measurement system.

Designing Software Model for 1S4P Lithium Battery Pack
The lithium battery cell model was composed of a second-order RC ECM, as shown in Figure 7, and a relay model was arranged for each cell to implement the relay function, as shown in Figure 10. The relay on-resistor was confirmed experimentally with 30 mΩ. The cable and contact resistance used in the pack configuration was confirmed by carrying out an experiment with 5 mΩ, using one resistance model for each cell. The ECM model of the battery pack consisted of a cell model, a relay and other cable resistance models. To verify the accuracy of the modeling, the modeling accuracy was judged by comparing the circulating current generated by performing a hot swap experiment on four batteries with different states of charge. Cell voltage accuracy was performed in Section 2.1. First, as shown in Figure 11, when the 3.932 V cell and the 3.822 V cell performed the hot-swap operation, the measured current was 1.02 A and the ECM simulation result was 1.055 A. Second, when the 3.827 V and 3.766 V cells were hot swapped, the measured current was 0.6 A and the ECM simulation result was 0.585 A. Finally, it was confirmed as shown in Table 2 that the measured current of the 3.766 V battery and the 3.402 V battery during the hot-swap operation ws 3.41 A and the ECM simulation result was 3.54 A. From the above results, it was confirmed that the ECM model of the 1S4P lithium battery pack had an accuracy of 96% or more.

Hot-Swap Analysis
The purpose of hot swap analysis is to establish the conditions under which excessive circulating current is not generated when batteries with different charge states are connected in parallel. The magnitude of the circulating current generated during the hotswap operation is determined not only by the difference in the state of charge of the battery, but also by various factors that determine the characteristics of the battery. Therefore, when deriving the conditions for hot swap operation, the optimal hot swap algorithm can be designed by considering the factors that affect the circulating current. In this study, based on the simulation model of the 1S4P configuration, we derived the optimal hotswap operating conditions by conducting a case study under various conditions.

Derivation of Key Factors for Hot Swap (Case Study)
The key factors that determine the circulating current generated during the hot-swap operation were derived. This was accomplished by analyzing the parallel configuration of the lithium battery packs and hot-swap case studies by varying the temperature, voltage deviation, and load current based on a simulation model of the 1S4P configuration.

Impact of Parallel Configuration of Battery
In the 1S4P configuration, the hot-swap parallel configuration in which one battery is inserted is divided into three cases: 1 (On) vs. 1 (Off), 2 (On) vs. 1 (Off), and 3 (On) vs. 1

Hot-Swap Analysis
The purpose of hot swap analysis is to establish the conditions under which excessive circulating current is not generated when batteries with different charge states are connected in parallel. The magnitude of the circulating current generated during the hot-swap operation is determined not only by the difference in the state of charge of the battery, but also by various factors that determine the characteristics of the battery. Therefore, when deriving the conditions for hot swap operation, the optimal hot swap algorithm can be designed by considering the factors that affect the circulating current. In this study, based on the simulation model of the 1S4P configuration, we derived the optimal hot-swap operating conditions by conducting a case study under various conditions.

Derivation of Key Factors for Hot Swap (Case Study)
The key factors that determine the circulating current generated during the hot-swap operation were derived. This was accomplished by analyzing the parallel configuration of the lithium battery packs and hot-swap case studies by varying the temperature, voltage deviation, and load current based on a simulation model of the 1S4P configuration.

Impact of Parallel Configuration of Battery
In the 1S4P configuration, the hot-swap parallel configuration in which one battery is inserted is divided into three cases: 1 (On) vs. 1 (Off), 2 (On) vs. 1 (Off), and 3 (On) vs. 1 (Off). Table 3 provides the simulation results with one 4.1 V (+0.4 V) or 3.3 V (−0.4 V) battery inserted depending on the number of parallel batteries operating under the same conditions (23 • C, load 0 A, voltage 3.7 V). In the case in which N batteries are in operation, it was confirmed that the circulating current is exchanged between N batteries and one battery when one battery with a different charge state is inserted. Therefore, the larger the number of batteries connected in parallel, the greater the circulating current flow in the inserted battery. These results confirmed that it is necessary to reflect the configuration information of the existing connected battery during the hot-swap operation.   These results indicated that, as the temperature decreased, the slope of the OCV decreased and the internal resistance increased. In the absence of a load current and when the 3.7 V battery is connected in parallel, a circulating current flows through the 3.3 V inserted battery. The variation in this current with temperature is shown in Figure 13a. The higher the temperature, the larger the magnitude of the circulating current generated under the same conditions. These results confirmed that it is necessary to reflect the temperature information during the hot-swap operation. 23, 35, and 45 °C). These results indicated that, as the temperature decreased, the slope of the OCV decreased and the internal resistance increased. In the absence of a load current and when the 3.7 V battery is connected in parallel, a circulating current flows through the 3.3 V inserted battery. The variation in this current with temperature is shown in Figure 13a. The higher the temperature, the larger the magnitude of the circulating current generated under the same conditions. These results confirmed that it is necessary to reflect the temperature information during the hot-swap operation.

Influence of Deviation in Battery Voltage
The circulating current generated during the hot-swap operation is generated in the process of maintaining the energy balance from the difference in voltage (SOC) of the battery. Figure 13b shows the circulating current that is generated when hot swapping one battery with a voltage deviation of −0.3~+0.3 V when three batteries at 23 °C, a load current of 0 A, and 3.7 V are connected in parallel. The results of the above analysis confirmed that, in the absence of a load current, the circulating current generated during the hotswap operation under the corresponding condition maintains a linear relationship with the voltage deviation. Therefore, in the absence of a load current, the voltage deviation and circulating current were confirmed to increase and decrease linearly during the hotswap operation.  Figure 14 shows the results of the simulation analysis when a battery with a charge state of ±0.3 V, compared to the terminal voltage, is input when a 3 A/Cell discharge load current is applied to three batteries connected in parallel with a 3.7 V charge state. Figure  14a shows the case where a battery of ② +0.3 V is input when a discharge current is applied to the existing connected battery. When the result is changed to charging current ③, a battery with a low existing charging state receives a charging current from the external charging current and the inserted cell. Figure 14b shows the case in which a battery of ② −0.4 V is inserted when a discharge load current is applied to an existing connected battery. To charge the inserted battery, the existing battery supplies an additional discharge current in addition to the discharge load current. When the load current changes to the charging current at ③, the latter current can confirm the result of the required current concentration needed to charge the inserted battery. This result confirmed that the allowable (+)/(−) voltage deviation range based on the direction of the load current (charge/discharge) is not symmetric. Therefore, it is necessary to reflect the condition of the load current when establishing the hot-swap operation condition.

Influence of Deviation in Battery Voltage
The circulating current generated during the hot-swap operation is generated in the process of maintaining the energy balance from the difference in voltage (SOC) of the battery. Figure 13b shows the circulating current that is generated when hot swapping one battery with a voltage deviation of −0.3~+0.3 V when three batteries at 23 • C, a load current of 0 A, and 3.7 V are connected in parallel. The results of the above analysis confirmed that, in the absence of a load current, the circulating current generated during the hot-swap operation under the corresponding condition maintains a linear relationship with the voltage deviation. Therefore, in the absence of a load current, the voltage deviation and circulating current were confirmed to increase and decrease linearly during the hot-swap operation. Figure 14 shows the results of the simulation analysis when a battery with a charge state of ±0.3 V, compared to the terminal voltage, is input when a 3 A/Cell discharge load current is applied to three batteries connected in parallel with a 3.7 V charge state. Figure 14a shows the case where a battery of 2 +0.3 V is input when a discharge current is applied to the existing connected battery. When the result is changed to charging current 3 , a battery with a low existing charging state receives a charging current from the external charging current and the inserted cell. Figure 14b shows the case in which a battery of 2 −0.4 V is inserted when a discharge load current is applied to an existing connected battery. To charge the inserted battery, the existing battery supplies an additional discharge current in addition to the discharge load current. When the load current changes to the charging current at 3 , the latter current can confirm the result of the required current concentration needed to charge the inserted battery. This result confirmed that the allowable (+)/(−) voltage deviation range based on the direction of the load current (charge/discharge) is not symmetric. Therefore, it is necessary to reflect the condition of the load current when establishing the hot-swap operation condition.

Derivation of Hot Swap Operating Conditions
The case study analysis in Section 3.1 enabled a hot-swap condition to be derived in which the magnitude of the circulating current generated during the hot-swap operation in the 3 vs. 1 parallel configuration, which is the worst condition, does not exceed 3 A/Cell (1C). The factors considered in the hot-swap operation were the load current, temperature, and voltage deviation; the results appear in Table 4. The hot-swap operation can be applied by either using a lookup table as a table or by dividing a specific section by the temperature and load current. However, in the case of a hot-swap operation based on a table, the dimension of the table increases rapidly with the addition of conditions, and the disadvantage is that a look-up table can only be used to turn on/off a simple relay. Therefore, research is needed to estimate the circulating current generated during a hot-swap operation.

Derivation of Hot Swap Operating Conditions
The case study analysis in Section 3.1 enabled a hot-swap condition to be derived in which the magnitude of the circulating current generated during the hot-swap operation in the 3 vs. 1 parallel configuration, which is the worst condition, does not exceed 3 A/Cell (1C). The factors considered in the hot-swap operation were the load current, temperature, and voltage deviation; the results appear in Table 4. The hot-swap operation can be applied by either using a lookup table as a table or by dividing a specific section by the temperature and load current. However, in the case of a hot-swap operation based on a table, the dimension of the table increases rapidly with the addition of conditions, and the disadvantage is that a look-up table can only be used to turn on/off a simple relay. Therefore, research is needed to estimate the circulating current generated during a hot-swap operation.

Artificial Neural Network (ANN) Models
As mentioned in the discussion of the hot-swap analysis in Section 3, various key factors must be considered to set the hot-swap operating conditions, and a look-up table model can be used to consider various conditions. However, as conditions are added, the dimensions of the table increase and can only be used as simple relay on/off controls. If the circulating current generated during the hot-swap operation can be estimated, hot-swap execution and power management before and after the execution become possible.

Design of ANN Model (Fitnet)
The Fitnet model was used among several ANN models of the deep learning toolbox provided by MathWorks. The Fitnet model can be fitted with any accuracy if there is sufficient input value, as mentioned in the introduction, so it is possible to estimate the circulating current generated during the hot-swap operation with simulation-based input data.

Inputs and Target Data
For the input and target data of the Fitnet model, the results of the hot swap case study were used as input; the data type is listed in Table 5. Four conditions (parallel configuration, temperature, load current, and voltage deviation) derived through the case study were set as inputs, and the circulating current generated under the corresponding condition and the current when the load current was reversed were set as target data. For the input and target data of the Fitnet model, the results of the hot-swap case study were used as input; the data type is provided in Table 5. Four conditions (parallel configuration, temperature, load current, and voltage deviation) derived through the case study were set as inputs, and the circulating current generated under the corresponding condition and the current when the load current was reversed were set as target data. There was a total of 500 input data values; 70% of the input data were randomly classified as train_set, 15% as validation_set, and the remaining 15% as test_set, after which the training proceeded. As shown in Figure 15, the performance of the ANN model is determined by the hidden layers, neurons, and training functions that exist between the inputs and outputs. As the number of hidden layers and neurons increases, the accuracy of the model may increase, but this increases the learning time, and the overfitting problem occurs. Therefore, the number of hidden layers and neurons was varied, and the results are provided in Table  6. The results indicate that when two hidden layers with 10 neurons in each layer are used, the model design is optimized.
As the number of hidden layers and neurons increases, the accuracy of the model may increase, but this increases the learning time, and the overfitting problem occurs. Therefore, the number of hidden layers and neurons was varied, and the results are provided in Table 6. The results indicate that when two hidden layers with 10 neurons in each layer are used, the model design is optimized. Figure 15. Composition of the artificial neural network model [20].

Training Function
The process that was followed to determine the number of hidden layers and neurons for the ANN model is described in Section 4.1.2. In this section, the training functions are compared to determine the most suitable function. The deep learning toolbox provided by MathWorks provides approximately 12 training functions. The model was configured by using each function under the same conditions, which enabled the performance of the model for each function to be confirmed (Table 7). In this model, which is designed to estimate the circulating current from the results in Table 7, the trainlm function applied with the Levenberg-Marquardt algorithm and the trainbr function applied with the Bayesian regularization algorithm delivered superior estimation performance, compared with the other training functions. Of these two functions, the trainlm function was significantly faster than the trainbr function; therefore, the trainlm function was used in the ANN model [30].

Validation of ANN Model
The learned ANN model was validated on the basis of the hot-swap simulation results and hot-swap experimental results obtained for the 1S4P battery packs. Figure 15. Composition of the artificial neural network model [20].

Training Function
The process that was followed to determine the number of hidden layers and neurons for the ANN model is described in Section 4.1.2. In this section, the training functions are compared to determine the most suitable function. The deep learning toolbox provided by MathWorks provides approximately 12 training functions. The model was configured by using each function under the same conditions, which enabled the performance of the model for each function to be confirmed (Table 7). In this model, which is designed to estimate the circulating current from the results in Table 7, the trainlm function applied with the Levenberg-Marquardt algorithm and the trainbr function applied with the Bayesian regularization algorithm delivered superior estimation performance, compared with the other training functions. Of these two functions, the trainlm function was significantly faster than the trainbr function; therefore, the trainlm function was used in the ANN model [30].

Validation of ANN Model
The learned ANN model was validated on the basis of the hot-swap simulation results and hot-swap experimental results obtained for the 1S4P battery packs.

Simulation-Based ANN Model Validation
In the 3 vs. 1 configuration, the charging state of the three cells that are already connected is 3.7 V, and the circulating current is generated when a battery with a load current of −1A/Cell and a battery with +0.13 V, compared to the terminal voltage, are input. The direction of the load current changes after 3 s. The flowing load current was compared with the simulation model. The results obtained using the following input values for the ANN model are shown in Figure 16: module configuration 3, temperature (23 • C), load current −1 A/Cell, and voltage deviation 0.13 V. As a result of comparing the simulation results in Table 8 with the ANN model, it can be seen that the circulating current estimation performance of the ANN model operated around 3%.      Figure 17 shows the experimental results in which cell 2 and cell 3 are sequentially hot-swapped at 10 s intervals while battery cell 1 is connected to the DC bus in a 1S4P battery pack. At this time, the magnitude of the circulating current estimated in the ANN model is shown together with a circle.  Figure 17. Table 9 summarizes the magnitude of the peak current generated during the hot swap from the above experiment and simulation results. As shown in Table 9, it can be confirmed that the peak value of the circulating current that occurs when the cell to be hot-swapped is connected to the DC bus can be estimated with the ANN model proposed in this paper.

Conclusions
In this study, a method for estimating the circulating current generated during the hot-swap operation applied to multiple series and multiple parallel battery systems using the ANN model was proposed. The circulating current generated during the hot swap is determined not only by simple differences in the state of charge, but also by complex relationships, such as the parallel configuration of multiple parallel systems, temperature and load current. Therefore, it is difficult to calculate and estimate the circulating current considering various conditions. In this study, the multi-simulation results used in the hotswap analysis to build an artificial neural network (ANN) model can be used to estimate circulation currents for training battery configuration, temperature, load current, and power deviation conditions. For performance validation of the ANN model reflecting the above four conditions (parallel configuration, temperature, current, i.e., deviation), when compared with the hot-swap simulation results, the circulation current estimate was found to be around 97%. We also performed periodic current estimation for approxi-  Figure 17. Table 9 summarizes the magnitude of the peak current generated during the hot swap from the above experiment and simulation results. As shown in Table 9, it can be confirmed that the peak value of the circulating current that occurs when the cell to be hot-swapped is connected to the DC bus can be estimated with the ANN model proposed in this paper.

Conclusions
In this study, a method for estimating the circulating current generated during the hot-swap operation applied to multiple series and multiple parallel battery systems using the ANN model was proposed. The circulating current generated during the hot swap is determined not only by simple differences in the state of charge, but also by complex relationships, such as the parallel configuration of multiple parallel systems, temperature and load current. Therefore, it is difficult to calculate and estimate the circulating current considering various conditions. In this study, the multi-simulation results used in the hotswap analysis to build an artificial neural network (ANN) model can be used to estimate circulation currents for training battery configuration, temperature, load current, and power deviation conditions. For performance validation of the ANN model reflecting the above four conditions (parallel configuration, temperature, current, i.e., deviation), when compared with the hot-swap simulation results, the circulation current estimate was found to be around 97%. We also performed periodic current estimation for approximately 94% of the ANN model performance for the 1S4P battery pack.
The ANN model proposed in this study was validated in a 1s4p system with a small number of cells connected in parallel. Therefore, in addition to this study, it is necessary to design an ANN estimation model for a battery system with more series and parallel connections to verify its estimation performance. In addition, it is necessary to study the algorithm to increase the safety and efficiency of the multi-parallel battery system by applying the estimated circulating current estimation result to the power management algorithm.
Author Contributions: N.-G.L. contributed to the main ideas of this study and wrote the paper. J.-Y.K. and S.L. comprehensively revised the paper. All authors approved the final version of the manuscript for publication. All authors have read and agreed to the published version of the manuscript.

Conflicts of Interest:
The authors declare no conflict of interest.  Table  OCV Open Circuit Voltage