How to maintain lead-acid battery charging and discharging