Grid DC battery charging and discharging