HOW DOES BMS CALCULATE BATTERY CAPACITY