**3. ESS Considering Battery Efficiency**

Figure 4 illustrates the proposed EMS algorithm and shows a day-ahead EMS algorithm based on the proposed battery management algorithm.

**Figure 4.** EMS charge-discharge algorithm according to time.

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%.

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.
