How to use power supply to simulate battery charging