LTSpice IV cap discharge simulation - Page 1
Forum section: electronics / beginners

author: ZeroResistance
author_rank: Frequent Contributor
timestamp: June 14, 2016, 03:31:02 am
content: I'm trying to simulate a cap discharging into an inductor.I have used a 1uf cap and an inductor with resistor 1ohm in series. The series resistor models the dc resistance of the inductor.The initial condition for the capacitor has been set as charged to 350V.I am getting unexpected results, like the voltage across the capacitor(green waveform) rises to few kiloVolts.Am I doing something wrong here, any comments would be highly appreciated.RegardsZR

author: damn_dirty_ape
author_rank: Contributor
timestamp: June 14, 2016, 03:56:19 am
content: I don't know what's going on here well enough to explain it, but voltage spikes like this are well known in inductive circuits. Maybe you can consider adding a diode, try looking up free wheeling diodes on googleEdit - my suggestion is related to turning the voltage off. I'm not sure how the simulation software works, can you add a switch to turn on at time=x?Second edit - looking at how a boost circuit works might really help here. Sorry for all the ninja edits but I'm on my phone and should be sleeping. Good luck.

author: ZeroResistance
author_rank: Frequent Contributor
timestamp: June 14, 2016, 04:12:27 am
content: Thanks for replying at this unearthly hour. I'm expecting a much lower voltage than the few Kilovolts that I'm getting here across the cap and since I've charge the cap to 350V.Regarding the diode, were you referring to something like a freewheeling diode.Basically I'm trying to simulate this circuit to find the peak current through the induction when I discharge it, if there is a calculation for that I can cross check where am I going wrong?

author: damn_dirty_ape
author_rank: Contributor
timestamp: June 14, 2016, 04:20:24 am
content: It's a little late for me to try to collect my thoughts about what is happening in your example, but the simulation is correct. You basically made half a boost circuit. When the sim starts I assume there is no current, so the voltage across the inductor will be high and the current through it low. As time continues the voltage across the inductor will rapidly decrease and the current will increase. At some point the voltage will reverse but the current will continue in the same direction for a period of time (current lagging voltage I believe). Anyway it gets really complicated really fast. Solving the math on that by hand is probably a second order differential if I remember correctly so I can't crunch the numbers for you but I'd believe 20kv off of that.

author: damn_dirty_ape
author_rank: Contributor
timestamp: June 14, 2016, 04:26:52 am
content: https://en.m.wikipedia.org/wiki/Flyback_diodeYou will notice one of the example circuits looks a lot like the one you posted

author: ZeroResistance
author_rank: Frequent Contributor
timestamp: June 14, 2016, 04:29:10 am
content: Thanks again, Do you expect the same waveforms if I build a real world circuit. The reason I'm asking is I've seen several waveforms on the web of a cap discharging into an inductor and they show that the voltage keeps damping off in a few cycles and doesn't ever rise above the initial charged cap voltage.Sleep wellZR

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 14, 2016, 05:30:01 am
content: Try .IC I(L1) 0 or however it's written.The blue curve being nonzero should be a dead giveaway...Tim

author: ZeroResistance
author_rank: Frequent Contributor
timestamp: June 14, 2016, 05:59:10 am
content: Quote from: T3sl4co1l on June 14, 2016, 05:30:01 amThanks Tim, When I look at the Inductor current curve it is going to zero the scale being on the right hand side am I missing something

author: ZeroResistance
author_rank: Frequent Contributor
timestamp: June 14, 2016, 06:06:33 am
content: Quote from: T3sl4co1l on June 14, 2016, 05:30:01 amYesss!!! you did it Tim!!It works!! but due you think the current of around 3A seems valid?!

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 14, 2016, 06:29:38 am
content: Well, let's see.You've got a series resonant tank circuit. C = 1u, L = 8.2m, R = 1. V(0) = 350, I(0) = 0.The parameters are:Resonant impedance Zo = sqrt(L/C) = sqrt(8200), about 90 ohms.Resonant frequency, well I don't really care because it's on a scaled horizontal axis anyway. But that's Fo = 1 / (2*pi*sqrt(L*C)) if you like. (The exact frequency of zero crossings is the pseudofrequency: it's not a periodic system, because the amplitude is decaying between zeroes. Usually, this has a damping term that decreases the frequency slightly.)Q factor Zo / R = 90, which means it will decay by e in about 90 cycles. Which... uh... hmm.You didn't change the defaults, did you?Yeah, LTSpice does that...In fact, it's decayed that far in about 2.5 cycles, so the ESR + DCR total is around 36 ohms. (Seems awfully high for defaults, but there may be a parallel equivalent instead.)Anyway, since the resonant impedance is 90 ohms, we know the first quarter wave has to be a current maxima, where Ipk <= Vpk / Zo, or 3.89A.It's actually more like 3.5A on the first peak, another indicator of circuit losses.So the damping is wrong because of parasitics (and possibly numerical stability; try GEAR solver and RELTOL = 0.0001), but the peak values, early on, are consistent.These calculators may be of relevance, too:http://seventransistorlabs.com/Calc/RLC.htmlTim

author: macboy
author_rank: Super Contributor
timestamp: June 14, 2016, 02:36:11 pm
content: I suspect that due to your initial condition of 350V across the cap (and therefore also across the L+R), that there is 350 A of current flowing through the L+R at the start. When LTSpice solves the initial dc operating point, inductors are removed and replaced with a short and capacitors are removed leaving an open circuit. This is going to result in quite some funny business. Plot the Current though the resistor or inductor, you will see it starting at 350 A. Of course that doesn't happen if you connect a 350 V cap across the inductor, since the inductor resists current change.You could set up a voltage-controlled switch that is initially off, then have it turn on at some point and watch from there. The attached is closer to what you are expecting I think.

author: ZeroResistance
author_rank: Frequent Contributor
timestamp: June 14, 2016, 08:11:11 pm
content: Quote from: macboy on June 14, 2016, 02:36:11 pmI like your idea however if you check this linkhttps://www.eevblog.com/forum/beginners/ltspice-iv-cap-discharge-simulation/msg961626/#msg961626you would find thatthe current starts at zero as you would see in the attachment. Do you still find any other flaws in the circuit, what more I can I do to accurately model the discharge so that it is as close to real world practical build of the circuit.It would be interesting to know what kind of currents you get in your circuit.Thanks for giving another perspective!ZR

author: ZeroResistance
author_rank: Frequent Contributor
timestamp: June 14, 2016, 08:15:52 pm
content: Quote from: T3sl4co1l on June 14, 2016, 06:29:38 amI don't know what defaults are but I did change the values and selected different capacitors and inductors from different manufacturers. I only modified the capacitance and inductance values keeping other values as is.Thanks for the calculators they look great!