BMS battery pack capacity calculation