Author Topic: LTSpice IV cap discharge simulation  (Read 6388 times)

0 Members and 1 Guest are viewing this topic.

Offline ZeroResistanceTopic starter

  • Frequent Contributor
  • **
  • Posts: 585
  • Country: gb
LTSpice IV cap discharge simulation
« on: June 14, 2016, 03:31:02 am »
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.

Regards
ZR
 

Offline damn_dirty_ape

  • Contributor
  • Posts: 31
  • Country: us
Re: LTSpice IV cap discharge simulation
« Reply #1 on: June 14, 2016, 03:56:19 am »
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 google

Edit - 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.
« Last Edit: June 14, 2016, 04:02:53 am by damn_dirty_ape »
 

Offline ZeroResistanceTopic starter

  • Frequent Contributor
  • **
  • Posts: 585
  • Country: gb
Re: LTSpice IV cap discharge simulation
« Reply #2 on: June 14, 2016, 04:12:27 am »
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?
 

Offline damn_dirty_ape

  • Contributor
  • Posts: 31
  • Country: us
Re: LTSpice IV cap discharge simulation
« Reply #3 on: June 14, 2016, 04:20:24 am »
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.
 
The following users thanked this post: ZeroResistance

Offline damn_dirty_ape

  • Contributor
  • Posts: 31
  • Country: us
Re: LTSpice IV cap discharge simulation
« Reply #4 on: June 14, 2016, 04:26:52 am »
https://en.m.wikipedia.org/wiki/Flyback_diode  You will notice one of the example circuits looks a lot like the one you posted
 

Offline ZeroResistanceTopic starter

  • Frequent Contributor
  • **
  • Posts: 585
  • Country: gb
Re: LTSpice IV cap discharge simulation
« Reply #5 on: June 14, 2016, 04:29:10 am »
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 well

ZR
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21681
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: LTSpice IV cap discharge simulation
« Reply #6 on: June 14, 2016, 05:30:01 am »
Try .IC I(L1) 0 or however it's written.

The blue curve being nonzero should be a dead giveaway... ;)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: ZeroResistance

Offline ZeroResistanceTopic starter

  • Frequent Contributor
  • **
  • Posts: 585
  • Country: gb
Re: LTSpice IV cap discharge simulation
« Reply #7 on: June 14, 2016, 05:59:10 am »
Try .IC I(L1) 0 or however it's written.

The blue curve being nonzero should be a dead giveaway... ;)

Tim

Thanks 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  :phew:
 

Offline ZeroResistanceTopic starter

  • Frequent Contributor
  • **
  • Posts: 585
  • Country: gb
Re: LTSpice IV cap discharge simulation
« Reply #8 on: June 14, 2016, 06:06:33 am »
Try .IC I(L1) 0 or however it's written.

The blue curve being nonzero should be a dead giveaway... ;)

Tim

Yesss!!! you did it Tim!! :)  It works!! but due you think the current of around 3A seems valid?!
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21681
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: LTSpice IV cap discharge simulation
« Reply #9 on: June 14, 2016, 06:29:38 am »
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.html


Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
Re: LTSpice IV cap discharge simulation
« Reply #10 on: June 14, 2016, 02:36:11 pm »
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.
 

Offline ZeroResistanceTopic starter

  • Frequent Contributor
  • **
  • Posts: 585
  • Country: gb
Re: LTSpice IV cap discharge simulation
« Reply #11 on: June 14, 2016, 08:11:11 pm »
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.

I like your idea however if you check this link https://www.eevblog.com/forum/beginners/ltspice-iv-cap-discharge-simulation/msg961626/#msg961626 you would find that
the 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
 

Offline ZeroResistanceTopic starter

  • Frequent Contributor
  • **
  • Posts: 585
  • Country: gb
Re: LTSpice IV cap discharge simulation
« Reply #12 on: June 14, 2016, 08:15:52 pm »

You didn't change the defaults, did you?

These calculators may be of relevance, too:
http://seventransistorlabs.com/Calc/RLC.html

Tim

I 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!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf