Development of a Hardware-in-the-loop system for testing cell balancing circuits