Author Topic: Getting LTspice to simulate as accurately as possible  (Read 7452 times)

0 Members and 1 Guest are viewing this topic.

Offline ShockerTopic starter

  • Contributor
  • Posts: 15
  • Country: gb
Getting LTspice to simulate as accurately as possible
« on: December 15, 2015, 02:32:42 pm »
How can we simulate a circuit as accurately as possible?

I have a circuit, where i've managed to obtain all of the simulation circuit components for LTspice. But when i simulate it, i don't get the same distortion and oscillations as i do in the real circuit. I've even gone to the effort of calculating the inductance and capacitance of the traces but i still get a result that shows that it should be working beautifully well.

I've also found that depending on how i simulate the traces - lumped RLC or lossy transmission lines, LTspice sometimes doesn't want to simulate the circuit. I've found that it doesn't like multiple transmission lines but is fine with multiple lumped RLC representations. Is there a likely cause to this? I would attached the simulation file for people to have a glance at but i can't in it's entirety.

Thanks
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Getting LTspice to simulate as accurately as possible
« Reply #1 on: December 15, 2015, 02:38:21 pm »
Oh god, lots of reasons why it might not be accurate. If you're using any ICs or MOSFETs, there could just be a poor model there - both of those aren't all that great, though the BJT models are pretty good. Could have missed some magnetic coupling somewhere (try throwing that in if you really want to see it slow down >:D), or some stray capacitance, or whatever. In short, you're probably missing something.

As for why it doesn't always simulate at all - uh, math. Maybe someone here's more familiar with the specific math involved, but all I can say is - the "equations" (really linear-algebraic matrix computations) don't always have a solution, and are more likely to for simpler circuits. And my general experience matches yours, that transmission lines don't always simulate nicely, particularly when not perfectly matched and terminated.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline krivx

  • Frequent Contributor
  • **
  • Posts: 765
  • Country: ie
Re: Getting LTspice to simulate as accurately as possible
« Reply #2 on: December 15, 2015, 02:43:53 pm »
Apart from the missing circuit elements and inaccurate models, LTSpice also sidesteps any measurement issues. It effectively has perfectly accurate DMMs and Oscilloscopes, with zero parasitic probing.

How far from reality are your simulations? "Good enough" varies by problem but I'm usually fine if things are within 5%
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Getting LTspice to simulate as accurately as possible
« Reply #3 on: December 15, 2015, 02:55:09 pm »
There are two different kinds of accuracy involved in numerical simulators like SPICE

(1) Accuracy of the model
(2) Accuracy of the solvers

(1) Are the models of your components and the netlist, which, for accurate results, would need to contain all the additional parasitic properties of the real circuit (as lumped elements for lower frequencies). So your netlist might be off, but also the submodels you include in it (e.g. transistors, integrated circuits etc.)

(2) Is the numerical accuracy of the solver which determines numerical solutions with finite resolution from your model. SPICE / LTSPICE has a few options here, e.g. floating point precision, time step size, lossy compression, ...
,
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2265
  • Country: ca
Re: Getting LTspice to simulate as accurately as possible
« Reply #4 on: December 15, 2015, 04:15:21 pm »
Your real circuit will have inductive and capacitive coupling, as well as resistive loss along conductors (especially ground traces), all of which contribute to its behaviour, and none of which are usually modelled. Also, passives like R, L, C are all ideal by default in LTSpice, but not in the real world. You need to add the parasitics in to them if you want more realistic modelling. Add ESR and ESL to Caps, add Cp and ESR to inductors. You might add series inductance to resistors (ironically, the easiest way is to use an inductor in place of the resistor).  I sometimes find that regulators don't like ideal capacitors on the output, and I need to add realistic ESR to get stability (opposite problem you have).

You might do better to examine your real circuit and question why is it oscillating, rather than questioning why the simulation doesn't. Many layout and construction issues can can instabilities. For example, you never need to decouple power supplies in the simulation since power rails and grounds are all perfect. When have you ever gotten away with that in a real circuit? Care to post a photo of your circuit?

(p.s., you did not attach the simulation).
 

Offline rjeberhardt

  • Regular Contributor
  • *
  • Posts: 62
  • Country: fr
Re: Getting LTspice to simulate as accurately as possible
« Reply #5 on: December 17, 2015, 04:45:08 pm »
Unless you post a few more details people can only guess at the possibilities.

Can you post a schematic?  What kind of components are you using?  Is it a digital circuit, an audio circuit, a microwave circuit?  You say your circuit doesn't work but what are the symptoms.

Russell.
Retired Chartered Engineer
 

Offline Neilm

  • Super Contributor
  • ***
  • Posts: 1550
  • Country: gb
Re: Getting LTspice to simulate as accurately as possible
« Reply #6 on: December 17, 2015, 07:44:27 pm »
There is also the possibility that your circuit is going unstable due to the layout of your circuit. If your circuit has any high frequency components this could be critical. For instance some circuits will never work on a vero-board (basically any switch mode PSU)

I have used LTSpice to model circuits and have got very good corrolation between real world and the simulation. However to get it that good, I needed to measure and model all of parasitic components. With the transformer that included resistance of the windings, the leakage inductance, the capacitance between the primary and the both of the other windings, the capacitance between the two secondary windings. Add into that the inductance and capacitance of the current sense resistor, ESR of the supply caps the characteristics of the snubber network etc that is a lot of things to model. The final result was the flyback off pulse snubbed to within 4% of what LTSpice predicted.
Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. - Albert Einstein
Tesla referral code https://ts.la/neil53539
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf