Electronic – Parts tolerance simulations in ltspice

ltspicemonte carlotolerance

I just recently found this tutorial (and various other places mentioning a similar technique) when trying to evaluate how one of my circuits behaves when using real world components with real world tolerances.

However normally I design it with ideal values, play around with .step directive etc. so to just do that evaluation I would have to change all the value statements to use the mentioned functions, and when I am not happy, change them back and to play with values again and so on. This seems like an awful lot amount of work. I could probably write a script that does it on the .asc files for me, but I was wondering if there really is no other way.

For most components you have a "Tolerance[%]" field, so I was wondering if this can be used in some global way? Just like some components seem to react on the .step temp variable. Unfortunately in the documentation I find the temp mentioned, but not the tolerance (which results in SpiceLine tol=xxx in the .asc file, if that helps anyone).

So, is there an easy way to have LTSpice (randomly) vary component tolerances over multiple runs, without having to put formulas at each and every one? (I am mostly interested in resistors and capacitors today, if that helps to find a 90% solution)

Best Answer

Monte Carlo analysis and worst-case is usually the way this is done, exactly as the linked article describes. For Monte-Carlo you don't have to change your components by hand, just run the Monte Carlo sims and the simulator will automatically change the components based on your Tolerance field. You have to run enough cases to get a statistically significant result, and you can calculate how many runs you need for a given confidence. Worst-case requires a little more work and knowledge of how the circuit works, but the linked article explains that as well.

Related Topic