SMS dit: Power hardware-in-loop emulation of a battery for charging systems and grid applications