# How to remove huge startup current spikes in charger circuit? [closed]

I am building solar USB charger model in matlab simulink. It uses solar panel as main power source and body consists of 2 buck converters and a battery. First buck converter has output capacitor(naturally) and second buck converter has input capacitor. Both of them are 20uF and I know my battery is short-circuited at the beginning of the simulation. The current is enormous, going to 1260A and battery charging power (in this case discharging) goes to 3600W which is enormous.

How can I negate this so that discharging power can be much lower (less than 30W for example as this would be my solar panel maximum power provided and all my components will be chosen to acommodate this or a bit higher, but not 3KW)?

I did use resistor relay to control these values and it does decrease the values significantly and relays are controlled by some time (using tic/toc in matlab function) but I would still get relatively huge spikes when switching relay to bypass resistor.

Here are the readings of the battery when I have two relays (one between battery and each buck converter):

I am stuck in this project, and I don't know how to move past this.

• Please plot both graphs using identical y axis values and on a white background and, add your circuit diagram (a circuit and not what your fairly unfathomable simulink diagram looks like). Commented Apr 7 at 9:41
• This cannot be answered without a block diagram Commented Apr 9 at 16:50

You will always get surges when you connect a capacitor to anything at a different voltage. The duration of the power spike is about 2uS and as such will not effect anything. The energy transferred is $$\ 3600 \times 2 \times 10^-6\$$ J which is the best part of nothing.