How to design an energy storage battery control system