Calculation of common current for battery cabinet discharge