A simple wave line with a dark background showcasing LTspice.

What is the True Value of LTspice?

Someone once asked Mike Engelhardt[1], the creator of LTspice®, “What is the value of a simulator?”

He answered:

Is it a sanity check? No, if you are worried about your sanity, you should see a therapist. Is it how you verify a design? No, because the macromodels you use are all typical performance at room temperature and take no account of production scatter. The real value of a simulator is in helping you develop intuition on how the circuit works and there is no way to understate the value of that insight.

In my career as an Applications Engineer at Analog Devices, I was lucky to have had the opportunity to use LTspice to help customers gain insight into why their circuits were behaving, misbehaving, or simply existing in an alternate universe. In this and future posts to this space, I share some examples of how LTspice can enhance intuition, including the illustrative LTspice files.

Everything is Perfect

I start with a case that shows how engineers at a bench (or using a simulator) can be drawn into the fallacy of “ideal” components. As an aside, take a simple example of a two-transistor astable circuit. The circuit is symmetrical, and with ideal components, it is unlikely to oscillate in a simulation. In real life, one transistor will have marginally more beta than the other and will start to conduct earlier, kicking off oscillation on the bench. We can get around this in our simulation by placing initial conditions to help the simulator. If you run the simulation below you will see what I mean. If you turn the .ic statement from a comment into a SPICE directive by right-clicking on it and changing the radio button you will see that this provides the slight imbalance to kick off the oscillator.

astable.asc

Back to the case in point, the customer reported a benchtop-testing issue with one of our amplifiers, the ADA4522, which they were using to differentially sense voltage across a current shunt. In the application, the shunt measured current in a motor coil, so there was no reason to reference it to ground.

The surprising behavior was that the differential amplifier’s output appeared to also depend on the offset voltage across the shunt. If they isolated the sense resistor from the circuit and drove it with a well-known current, the amplifier output reflected that current. In contrast, if they introduced any DC offset between the shunt and local ground, the amplifier output was changed—by about 40mV from the expected value for a DC offset of 20V. On a signal of 100mV, 40% error is a problem.  The customer ran an experiment by varying the amount of DC offset, both positive and negative, and found that the deviation from expected behavior was essentially linear with offset.

Figure 1 shows the expected amplifier output of 100 mV at 100 mA through the shunt at no offset, but the output deviates from the expected value linearly with an applied offset.

Effect of Shunt DC Offset on Output

Figure 1 - Effect of Shunt DC Offset on Output of High-Side Current Measurement

They scratched their heads but ultimately decided to move the experiment to LTspice, simulating the circuit by using the ‘Open this macromodel’s example circuit’ button and adding a source to model the common-mode DC offset. The link to that simulation file is below:

ADA4522_current_sense_with_DC_offset.asc

The simulation matched the bench test, in that output had a linear dependency on DC offset, but the order of magnitude was much smaller; less than ±2mV, not the ±50mV they were observing in hardware. As you can see in the results below, there is a small difference between the expected value at no DC offset, due to the amplifier's offset voltage and bias current, but ±1.42mV at ±20V DC offset:

Output at Zero Offset Output at Zero Offset

Gaining Circuit Insight

So, what is the problem with the ADA4522? Well, there is none. Any operational amplifier shows similar results or worse. The linear offset with applied common-mode voltage is caused by the resistor mismatch due to tolerance affecting the circuit’s common-mode rejection ratio (CMRR). In effect, the circuit amplifies the common mode voltage as well as the difference voltage, albeit to a lesser extent. In a 1991 article, Ramón Pallás-Areny and John Webster[2] showed that the common-mode rejection ratio, assuming a perfect op amp, is

 Equation

where Ad is the gain of the difference amplifier and t is the resistor tolerance. According to Pallás-Areny, even if the amplifier itself has infinite CMRR, for a unity gain configuration, with 1% resistors, the CMRR you should expect is 34 dB or 20mV/V worst case, and with 0.1% resistors, you should expect no better than 54dB or 2mV/V worst case. Rather than the absolute tolerance, the important thing is the close matching of values between resistor pairs.

I asked what tolerance resistors the customer was using, and they confirmed they were 1% resistors. The common mode error they measured was showing up as 20mV/10V = –54dB. So, they were seeing 0.1% matching tolerance performance from 1% resistors – very good 1% resistors indeed.

Finding a Solution

To get around the fact that the amplifier gain was being set through resistors that were inaccurately matched, there were two ways that the customer could improve the common-mode rejection of the design:

  1. Place a difference amplifier (with sufficient bandwidth) set to a gain of 1 at the input. Follow the diff amp with another amplifier to produce the required gain. These difference amplifiers have on-chip, laser-trimmed (matched) resistors, yielding 90dB or better CMRR. The supply current is lower, too.

  2. Stick with the ADA4522 at the front end, but ditch the individual resistors and use a LT5400-1 Quad Matched Resistor Network. The LT5400’s trimmed resistors offer 0.01% matching, yielding a 74dB CMRR or better with this setup.

Playing with CMRR in Simulation

We can create an LTspice simulation file that shows the effect of resistor mismatching. In it, we can use the .step parameter directive to look at perfect resistors, 0.1% resistors, and 1% resistors and then use the .measure directive to calculate the CMRR in each case.  The link to that LTspice file is below:

CMRR_with_different_resistor_tolerances.asc

Happy Simulations!

Find the next blog in this series here.


References

  1. LTspice with Mike Engelhardt, Altron Arrow 16 Jul 2018 https://www.youtube.com/watch?v=x6TrbD7-IwU&t=2s
  2. R. Pallas-Areny and J. G. Webster, "Common mode rejection ratio in differential amplifiers," in IEEE Transactions on Instrumentation and Measurement, vol. 40, no. 4, pp. 669-676, Aug. 1991, doi: 10.1109/19.85332.

Further Reading

A Deeper Look into Difference Amplifiers by Harry Holt, Analog Dialogue Vol 48 Feb 2014 https://www.analog.com/en/analog-dialogue/articles/deeper-look-into-difference-amplifiers.html

Matched Resistor Networks for Precision Amplifier Applications by Tyler Hutchison https://www.analog.com/en/technical-articles/matched-resistor-networks-for-precision-amplifier-applications.html

LTspice: Worst-Case Circuit Analysis with Minimal Simulations Runs by Joseph Spencer and Gabino Alonso https://www.analog.com/en/technical-articles/ltspice-worst-case-circuit-analysis-with-minimal-simulations-runs.html

How to Model Statistical Tolerance Analysis for Complex Circuits Using LTspice by Steve Knudtsen https://www.analog.com/en/technical-articles/how-to-model-statistical-tolerance-analysis.html