Realistic HIL Simulation Ensures BMS Functionality and Safety in Energy Storage Systems