Battery Management System Algorithm for Energy Storage Systems Considering Battery Efﬁciency

: Aging increases the internal resistance of a battery and reduces its capacity; therefore, energy storage systems (ESSs) require a battery management system (BMS) algorithm that can manage the state of the battery. This paper proposes a battery efﬁciency calculation formula to manage the battery state. The proposed battery efﬁciency calculation formula uses the charging time, charging current, and battery capacity. An algorithm that can accurately determine the battery state is proposed by applying the proposed state of charge (SoC) and state of health (SoH) calculations. To reduce the initial error of the Coulomb counting method (CCM), the SoC can be calculated accurately by applying the battery efﬁciency to the open circuit voltage (OCV). During the charging and discharging process, the internal resistance of a battery increase and the constant current (CC) charging time decrease. The SoH can be predicted from the CC charging time of the battery and the battery efﬁciency, as proposed in this paper. Furthermore, a safe system is implemented during charging and discharging by applying a fault diagnosis algorithm to reduce the battery efﬁciency. The validity of the proposed BMS algorithm is demonstrated by applying it in a 3-kW ESS.


Introduction
Energy storage systems (ESSs) store electricity when surplus electricity is generated or electricity rates are low and supply the stored electricity to the unit when electricity is in high demand or prices are high; therefore, for the efficient operation of power facilities, the development of an energy management system (EMS) algorithm is imperative.
Battery characteristics [1][2][3] and the sizing of ESSs have been extensively investigated [4][5][6] because the battery accounts for most of the budget when designing ESSs; therefore, battery selection and management are important, as the aging problems caused by inappropriate battery management costs account for a large part of the replacement budget.
Many ESSs use lithium-ion batteries, since they offer a high energy density and high efficiency [7,8]; however, it is crucial to identify the charging state of batteries because there is a risk of fire during charge-discharge cycles and because there is a need to predict the state of health (SoH) and state of charge (SoC) for battery state management [9]. The ESS consists of cells in series-parallel [10,11] with a large capacity. To solve the safety problems related to fires and explosions [12], a system that manages the battery status is required [13].
The purpose of a battery management system (BMS) is to manage the battery [14,15]. To improve the reliability and safety of the battery [16,17], many BMS functions are being developed [18]. The functions of BMS can be classified as real-time monitoring, calculation and prediction, protection, and optimization. The battery voltage, current, temperature, SoC, (DRNN) with the ability to conduct dynamic mapping [55], and the XGBoost-based estimation method [56]. Additionally, a state estimation method combining the battery model with a data-based method [57] and a voltage-power-curve-based estimation method [58] has been researched. In [59], a more accurate SoH estimation method was proposed by considering the charging time of the battery, although it did not consider the internal resistance variation and showed estimation error; however, as the SoH estimated without considering the internal resistance is incorrect, some researchers have considered it a constant value [60,61]. Although the SoH is also predicted based on its constant current (CC) charging time [62][63][64], the internal resistance and temperature [65] of a battery are considered when a system is operated for a long time, while the accurate characteristics of a battery cannot be numerically represented; however, this research used the battery efficiency equation, allowing for a more accurate estimation of the battery state by numerically defining the capacity reduction and the internal resistance of a battery.
The BMS measures the battery's initial SoH and stores the value. The BMS stores the current SoH by comparing the current values with the initial SoH based on the changing values as the battery is used. According to the battery status, the temperature of the battery arises and internal resistance increases along with it. Because of the increase in the internal resistance, the SoH of a battery decreases and it takes less time to chargedischarge the battery; therefore, the CC time period decreases. Based on this time period difference among the charge-discharge cycles, the SoH estimation method is proposed in this paper. The proposed SoH estimation method uses the integral value of the CC time period difference among the charge-discharge cycles for more accurate SoH estimation. In this paper, the battery efficiency equation is used to predict the SoH of a battery considering the decrease in the CC charging time of the SoH due to the increase in the internal resistance of the battery and the fact that the capacity of a battery decreases when it heats up.
An algorithm for predicting battery-related system safety and accurate SoC and SoH by determining a battery fault using the battery efficiency equation is proposed.
The literature on the fault diagnosis of batteries shows that the estimated SoH method is typically used. Many studies on battery fault diagnosis have focused on SoH estimation, since it is a major part of fault diagnosis. For example, in [66], the fault diagnosis method is based on the estimated SoH using the surface temperature of the battery, while fault detection is performed using the SoH estimated based on a multilayer neural network (MNN) in [67].
In this paper, a novel fault diagnosis algorithm that detects the fault state based on the SoH and the efficiency of the battery is proposed for more accurate fault detection. With the proposed method, the battery can be managed more safely because battery faults can be detected beforehand, since the battery efficiency plummets in the fault state before the SoH reaches its fault range.
In this study, we implement the SoC calculation combined with the OCV and CCM, SoH based on the charging time, as well as a fault diagnosis algorithm in a 3 kW ESS. Furthermore, the validity of the proposed BMS algorithm is investigated. Figure 1 illustrates the factors affecting the performance of a battery. As the number of charge-discharge cycles increases, a chemical reaction occurs in the battery, causing aging, which reduces the SoH of the battery. Aging increases the internal resistance of a battery and decreases its charge-discharge capacity. As the capacity of a battery decreases, its charge voltage reaches the maximum value.

Battery Efficiency for Predicting Battery State
Identifying the occurrence of aging during the charge-discharge operation of a battery requires determination of the magnitude by which its capacity decreases by calculating its internal resistance or efficiency.
Although accurate modeling of a battery is required to understand its state, it is difficult to perform accurate modeling because of the nonlinear characteristics. Furthermore, given the various factors for batteries, the system costs increase because the roles of the BMS managing the battery vary and the number of computations increases. This paper proposes a battery efficiency calculation formula that considers the internal resistance, which significantly affects the performance of a battery, as well as a system that considers the nonlinear characteristics.  The ESS consisted of a battery system and a power conversion system (PCS). The battery system consisted of a battery and a BMS. The ac-dc of the PCS comprised a two-level converter that was easy to control with high efficiency, while the dc-dc comprised a fullbridge converter [68].  Figure 3 illustrates the BMS configuration of the battery system. The BMS received data regarding the battery voltage, current, and temperature and predicted the SoC and SoH. Furthermore, the data were transmitted using controller area network (CAN) communication. When any abnormalities occurred in the battery voltage, current, or state, the charge-discharge state of the battery was cut off to protect it. Furthermore, the BMS provided a protection function to secure the battery safety when an abnormality in the battery temperature occurred [69]. By applying the proposed algorithm, the BMS sensed the battery voltage, current, and temperature; accumulated data; calculated the battery efficiency; and predicted the SoC and SoH. In addition, battery's efficiency protected it in from faults.   The ESS supported the grid by discharging during the daytime (when there are many power users) and charging at night. During the charge-discharge process, the proposed algorithm could sense the battery state through CAN communication using the BMS algorithm and proceeded with charging. If the SoC of the ESS battery was below 80%, the battery was charged, while if it was above 80%, charging was terminated. The minimum and maximum values of the battery SoC could be redefined by the user, and this paper defines the operational SoC as that defined between 20% and 80%. After charging, if the power required by the grid increased, the ESS proceeded with discharging. Furthermore, the ESS used an algorithm that terminated the discharging of the battery when the SoC dropped below 20%.

ESS Considering Battery Efficiency
The EMS algorithm is an algorithm for the charge-discharge process of a battery, which ensures high safety when connected with the BMS. The paper did not separately consider the system fault diagnosis performed by the EMS because the EMS algorithm was proposed considering the battery state; however, further studies are necessary to investigate the fault diagnosis and response in EMS, which are critical factors affecting the charge-discharge process required for the grid.

Proposed BMS Algorithm
The ESS, which charges and discharges energy from a battery, is directly affected by battery performance; thus, a BMS that manages and protects the battery and communicates with the outside is critical.
One of the problems in nonlinear batteries is that their internal characteristics change based on the number of charge-discharge cycles; thus, the primary goal of a BMS is to accurately follow these changes.
This paper proposes a method to improve battery safety and performance based on the reduction in its efficiency (which occurs during battery use), derive a battery efficiency equation, and apply it to calculate and predict the SoC and SoH of the battery. Furthermore, based on the battery efficiency calculation, this paper proposes an algorithm for terminating the use of the battery and diagnosing faults. Figure 5 illustrates the proposed BMS algorithm. The proposed BMS algorithm can sense the battery voltage, current, and temperature and calculate its efficiency. When the efficiency of a battery is calculated, its charge-discharge current is measured to determine whether the ESS is in the charge-discharge state. When the ESS is charged or discharged, the SoC is calculated using the combination of the OCV and CCM. When the ESS is not in the charge-discharge state, the SoC of the battery is reset to increase the accuracy of the initial value of the SoC.
At the end of the charging and discharging operation of the battery, the charging power P charging or discharging power P discharging is measured to estimate battery loss and internal resistance for the next cycle. As a day-ahead EMS was used in this paper, one cycle represents a day of operation; therefore, the internal resistance of the battery was estimated based on the difference between the charging and discharging energies for a day.
After the charge-discharge process, the SoH, to which the battery efficiency was applied, was calculated and predicted to improve the battery safety and performance.

Battery Efficiency
Battery efficiency can be used as an indicator of the current usage time compared to the initial time. A battery efficiency equation was proposed to express the relationship between the capacity and voltage of the battery model. Because the internal resistance of a battery affects the battery output, the battery's internal resistance must be accurately calculated.
The internal resistance of a battery is the key indicator of its state. The internal resistance of a battery increases with an increase in the heat generated during the chargedischarge of the battery. Figure 6 illustrates the current capacity of the ESS with aging. As the battery aged, its internal resistance increased and the current capacity decreased, which significantly affected the performance of the ESS when the capacity was large. Furthermore, the use of a battery with reduced performance causes overcharging and overdischarging, which limits battery safety.
The current battery capacity is the amount of current that a fully charged battery can discharge for one hour. Compared to a battery in the birth of life (BOL) state, an aging battery, upon discharge, reaches the terminal voltage limit faster because of its reduced current capacity.
The efficiency of a battery decreases when it is used. As a battery shows the maximum efficiency at the initial state, its efficiency can only decrease when it is in operation.
Equation (1) defines the efficiency of a battery. The efficiency of a battery η bat can be expressed by subtracting the battery loss η loss from the initial battery efficiency, 100%.
As the decrease in the efficiency can be expressed as the increase in the internal resistance, η loss can be calculated based on the charging and discharging powers, as shown in Equation (2).
I bat is the charge-discharge current, R is the battery's internal resistance, and V bat is the battery voltage.
In this case, the charge-discharge current of the battery can be represented by Equation (3).
During the charge-discharge of a battery, the current can be calculated as the amount of charge (battery capacity) and the C-rates at which the battery has been charged or discharged over time. Q bat is the battery capacity, while t is the charge-discharge time of the battery. Equation (3) uses the electric charge equation.
Equations (2) and (3) give the total loss in battery efficiency, as represented in Equation (4). Using Equation (4), the battery loss equation, as well as Equation (1), the battery efficiency can be calculated. Equation (4) can be used to determine the internal resistance of a battery. Equation (5) gives the internal resistance of the battery. In this paper, as the charge-discharge process progressed, the battery efficiency decreased.

Improved SoC and SoH Prediction Method
A battery protection system monitors the battery state and prevents it from overcharging and overdischarging, improving its safety and performance. The performance of a BMS is evaluated based on how accurately it predicts the SoC and SoH of the battery [34].
CCM is used to track the SoC with the value calculated by integrating the current during the charge-discharge of the battery to the initial value of the SoC; however, because the current is accumulated to the initial value of the CCM, errors are accumulated if the precise initial value is unknown [70,71]. Because errors gradually increase, the paper propose following the SoC with an improved method combining the OCV and CCM to improve the initial value.
Equation (6) expresses the voltage calculated using the open circuit voltage formula of the battery through Equation (5). The battery state can be more accurately predicted using the internal resistance obtained through Equation (5) and the OCV of the battery.
The final CCM is depicted in Equation (7). The accuracy of the prediction of the battery state can be improved by applying the internal resistance value derived from the battery efficiency equation to the conventional CCM. SoC(t) is the SoC at time t, SoC(t−1) is the initial SoC, C n is the battery capacity, and V ocv is the battery voltage in the open state [72,73].
SoH, which is an indicator of the battery life time, is essential for managing the battery charge-discharge process. Various models for predicting SoH have been proposed to improve the battery safety and performance. The standard method predicts the life time of a battery by analyzing it according to the chemical principle of the battery and through mathematical or physical modeling [74][75][76]; however, these methods do not consider the internal resistance of a battery, which significantly affects its life time. Figure 7 illustrates the constant current-constant voltage (CC-CV) charging curve of a battery. A battery is typically charged through the CC-CV [77]. Whenever the battery is charged, its CC charging time decreases, while the CV charging time increases. As the battery charging proceeds, the battery temperature increases and internal resistance increases, resulting in a decrease in its SoH. Figure 8 shows the discharge characteristics of a battery. As in the charging cycle, the time to reach the cut-off voltage is also reduced during charging because the SoH decreases as the temperature and internal resistance of the battery increase, as shown in the charging curve.
This paper considered the internal resistance of a battery, which significantly affects the SoH, to propose a method for predicting the battery SoH based on the charging time after the charge-discharge process. Although previous studies [62,64] did not accurately predict the internal resistance value, they numerically derived and applied the internal resistance value based on the battery efficiency.
To calculate a battery's SoH, the equation should be rearranged by t using the SoC derived from Equations (6) and (7) after the SoC charge-discharge process, resulting in Equation (8). By applying the internal resistance equation derived from the battery efficiency equation, the charge-discharge time is compared based on the charge-discharge cycle of the battery. Here, t after is the time after the charge-discharge process, which can be used to predict the battery SoH using the battery characteristics by comparing the values after the charge-discharge process (Equations (8) and (9)). SoH after is the SoH of the battery compared to the time after charging and discharging. The SoH of the battery can be predicted using the charge-discharge time of the battery. Here, t before is the battery charge-discharge time before t after .
SoH a f ter = t a f ter t be f ore × 100% (9) Figure 9 illustrates the proposed battery fault diagnosis algorithm. The fault diagnosis algorithm considers two situations. After the battery information is sensed through the BMS and the battery efficiency is evaluated regarding whether the value corresponds to the over range, charging proceeds. If the battery efficiency is not higher than the over range, the charge-discharge process is performed; however, if the battery efficiency is higher than the over range and the battery SoH is 40% or less, the charge-discharge process is terminated.

Method Used to Diagnose Battery Fault
This over range value changes depending on the battery state, battery type, and other factors, and this value should be set before the operation. In this paper, the fault state was set when the efficiency was below 80% and the SoH was below 40%.
Although the battery's charge-discharge SoC is used correctly at 0-100% for the ESS, in this paper, the SoC was charged at 20-80%, the optimal operation region for lithium-ion batteries from a safety viewpoint. Furthermore, the SoH was subjected to charge-discharge cycles up to the maximum region of the battery. Charging was terminated based on the experimental requirements and safety considerations-when the SoH reached 40% or less-to confirm the disposal of the battery through a signal.  (1) and (9), then a chargedischarge termination signal is transmitted through CAN communication if the value is within the over range. The paper predicted the correct battery state through BMS and diagnosed the fault using the proposed method during the charge-discharge process to propose a BMS algorithm for an ESS that uses a large battery capacity.

Experiments to Verify the Proposed Algorithm
A 3-kW ESS was implemented to verify the BMS algorithm of the ESS considering the battery efficiency.
The BMS algorithm proposed in this paper was applied to the ESS and the battery efficiency was tested during the charge-discharge process by charging several battery modules.
The internal resistance calculated from the battery efficiency was applied to the SoC. Then, the OCV, CCM, and proposed algorithm were compared and the SoC was confirmed in the case of a battery fault. The charge-discharge cycle was performed by converting the SoC calculated from the internal resistance of the battery into the charging-discharging time. Furthermore, the termination of the charge-discharge cycle was confirmed through the connection between the ESS and BMS in the case of a fault. In the additional part of the algorithm, the total efficiency of the ESS was further confirmed to verify its validity. Figure 10 illustrates the ESS experiment hardware used in this paper, while Table 1 lists the experiment parameters. The PCS of the ESS consists of a two-level inverter, a full bridge converter, and a master controller. The output side comprised three lithium-ion battery modules (1 module: 24 cells × 4.2 V) and a BMS. The experiment was conducted using an oscilloscope and a laptop computer to confirm the operation.  For the battery efficiency experiment, battery efficiency was confirmed by the chargedischarge of a faulty battery module and a normal battery module.
The profiling of the battery was carried out in four steps. The data were confirmed in the order of (1) securing the charge-discharge data, (2) deriving an equation through curve fitting, (3) performing the charge-discharge cycle, and (4) extracting the target data from the implemented correlation equation.
An experiment battery was proposed to verify the battery efficiency by configuring the battery with three modules and assigning modules 1 and 2 as the normal batteries and module 3 as the battery subjected to repeated charge-discharge cycles. Figure 11 illustrates the efficiency graph of the battery module. During battery charging, the difference in the final internal resistance values of the battery was confirmed, as depicted in Figure 11. If a specific range was set during the charge-discharge cycle for testing, the change in the state of the battery caused by aging was detected.
The battery efficiency test revealed a significant change in the efficiency of the battery after investigating the changes in the efficiency of the faulty or abnormal batteries that occurred during the charge-discharge cycle of the ESS and those of the normal battery. The difference between the efficiencies of the faulty (aged) and normal batteries was 38.4%. The results suggest that the battery efficiency of the proposed algorithm could be applied for predicting the SoC and SoH, which requires improved accuracy, while the change in the internal resistance (which has the greatest impact on the battery state) could also be applied to increase the accuracy of the battery state prediction.   Table 2 illustrate the SoC profile of the battery to which the proposed battery efficiency equation was applied.  All three normal battery modules were discharged up to 20% and charged up to 80% of the maximum SoC.
By applying the battery efficiency, the OCV, CCM, and proposed SoC algorithm could be compared.
The SoC profile was confirmed using the proposed algorithm.
To confirm the SoC calculation, the OCV and CCM were compared with the proposed SoC calculation algorithm. The CCM was charged after accurately determining the initial value. The OCV could not accurately determine the SoC during charging. The CCM and proposed SoC operation seemed to accurately calculate the SoC; however, when using the actual CCM, the user could not directly and accurately set the initial value. As such, using the algorithm proposed in this paper, the SoC can be determined more accurately. Figure 13 illustrates the SoH profile to which the proposed algorithm was applied, while Table 3 presents the CC termination time based on the battery state.  50 cycles were charged and discharged at 0.3 C-rate, and CC charging time was compared in the 51st cycle.
The battery was charged by applying the internal resistance to which the battery efficiency was applied. The results demonstrated that the CC charging time of the module decreased when the battery failed or had other problems.
Equation (10), which compared the SoH profiles obtained using the three methods investigated, confirmed that the SoH prediction was possible based on the CC termination time of the battery. The ∆SoH is the amount of change between SoH before and SoH after , while SoH before is the SOH before SoH after . ∆SoH = 1 − SoH a f ter SoH be f ore × 100 (10) It is difficult to accurately diagnose faulty batteries based on environmental changes, such as battery aging. Because the characteristics of the battery vary when a cell comprises modules, the internal resistance and capacity deviation occurs, causing overdischarge; thus, because the safety and energy efficiency of the battery system is significantly reduced, in this paper we diagnosed the battery state using two methods, whereby faulty batteries were diagnosed based on when the (1) battery efficiency and (2) SoH battery efficiency were reached. Figure 14a shows the charging voltage and current waveform at the time of a fault signal, while Figure 14b is the discharge voltage and current waveform at the time of a fault signal. Figure 14 illustrates the fault signals when the battery efficiency is reduced and the SoH is 40% or less. If a fault is detected, the charge-discharge cycle of the battery is terminated with the general purpose input output (GPIO) signal, which cuts off the battery MC through the BMS. The main controller then terminates the pulse width modulation signal, causing the ESS to enter into a stop state.  Figure 15 illustrates the efficiency waveform of the ESS when the system was implemented by applying the proposed algorithms. The efficiency of ESS is caused by the decrease in the difference between the power consumed by charging and the power generated by discharging; therefore, the operating cost for using the battery increases. Efficiency was measured when applying the proposed EMS and BMS algorithms. When the algorithm proposed in this paper was applied, the maximum efficiency was 97.57%. This paper proposes a BMS algorithm for an ESS. To apply the BMS algorithm to the ESS, the experiment was conducted by deriving the internal resistance of the battery from its efficiency. Moreover, the increase in battery state accuracy was verified through experiments by applying the battery efficiency to the SoC with the OCV and CCM and the SoH considering the charging time. Furthermore, increased safety through the diagnosis of faulty batteries was verified through experiments.

Conclusions
In this paper we proposed a BMS algorithm that considers battery efficiency. The algorithm was applied to an ESS to improve the battery safety and performance. The algorithm proposed in this paper was divided into three parts.
First, the efficiency of the battery was used to estimate the state of the battery. The internal resistance of the battery was estimated based on the difference between the charging and discharging power to obtain the value of the variable internal resistance. The variation in the internal resistance was confirmed by the experimental results, which showed the increase in the charging-discharging power difference during the battery's operation.
Second, the SoC and SoH estimation methods were proposed. For SoC estimation, the method of combining OCV and CCM with the estimated battery states was proposed to compensate for both low initial estimation accuracies of CCM and incorrect estimation of OCV. An SoH estimation algorithm based on the charging time was also proposed. This proposal was based on the fact that an increase in the temperature of a battery results in an increase in its internal resistance and a decrease in the CC charging time. This charging time decrement according to the internal resistance variation was confirmed in the experiment. Based on the estimated SoH, the battery lifespan estimation method, which observes the charging-discharging SoH difference for a long period of time, was proposed. Additionally, the proposed method is more flexible than conventional methods, since it does not require any additional analysis of different kinds of battery cells for SoH estimation.
Third, this paper proposed a battery fault diagnosis algorithm that aims to improve battery safety. Using this method, faults are diagnosed through efficiency and SoH, and this fault diagnosis algorithm was validated through experiments.
In conclusion, accurate SoC and SoH estimations were proposed by applying battery efficiency to the estimation process. The estimated SoC and SoH were used to improve not only the performance of BMS but also the battery safety via a fault diagnosis algorithm with accurate SoH estimation.