Fig. 2 Outline of smart charge algorithm