*3.1. 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.

**Figure 5.** BMS algorithm that considers the battery efficiency.

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 Pcharging or discharging power Pdischarging 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.
