How to control the current of the battery pack