How to balance the power of series-connected battery packs