BATTERY STATE OF CHARGE CALCULATION