How to control the capacitor discharge current