Hello,
Hoping to be clear, I'll try and elaborate as much as possible, so this might be long :
I am searching to discharge a lithium battery. It is put across a load of 2.4 ohms. To control the current pulled via a micro controller to 1a I use a pwm signal, essentially averaging the current switching between 1.375 and 0 amps flowing ( at a nominal of 3,3v ) so a theoretical duty cycle of 72.7% at 3.3v would put a load of 1a on the source. Using PID I controll the duty cycle depending on actual voltage of the batt and the known resistance, this duty cycle is provided by a micro controlling a Nchannel fet ( placed after the load resistor ) as such :
C2 smooths voltage to adc, R2 prevents the battery reverse powering the micro, C1 was supposed to smooth the voltage pulled from the battery ( see below why this doesn't work )
This works in practice because all the leads are very short and thick, but now comes the problem : It would be better to filter the output for the battery and for the micro that reads the voltage of the battery ( otherwise it might read 3.465 and a micro second later 3.452, although this is fixed by filtering the line going to the ADC ).
Now, adding a capacitance of 1000µF in between the battery and ground makes the amount of current go straight up. I understand why, when the mosfet is off the battery is charging the cap and when it's on a higher voltage is maintained so more current can pass in the same amount of time, this also explains the smaller delta V.
But what equations would allow me to know and calculate the current flowing with the cap ? This is a very complex problem to solve myself ( I have no background in electronics whatsoever ), I get that load resistance, battery internal resistance, battery voltage and capacitance all play in, but what equations do I use ( I searched all day :p )
This is more of a quest for personnal knowledge than actually using it in practice, because I really don't have to put the cap across the battery
Also to be noted pwm frequency is at 500hz, and I'll bump it up to 31kHz later to be able to use a smaller cap once I get the maths because 1000µF is way to big, I'l hoping to use ~22µF-88µF.
Thank you for all help !
---->> Thanks to the people in the posts bellow, the answer is that the capacitor allows current to flow through itself ( this post has been edited a few times )