2
\$\begingroup\$

Can I rely on what a simulator gives me for the output of an op-amp based differential amplifier without verifying that the common mode input to my op-amp is between the voltages of my op amp's power rails (or otherwise appropriate for my op amp?)

Suppose I have an op amp based differential amplifier use to measure the voltage across a load RL such as this:

schematic

simulate this circuit – Schematic created using CircuitLab

The transformer is 1:1, and Vac is 168V peak (120V rms). I calculate the current through RL to be 120V/10\$\Omega\$ = 1.2A(rms).

When I run the simulator, it shows a 3.36 peak output (approximately). This makes sense, because my amplifier gain is 100k/2k = 1/50. If I multiply the input by the gain, I get 168V / 50 = 3.36V.

enter image description here

Even though the the voltage across the secondary is 168V peak, and my op amp supply is only +/- 5V, my op amp is fine because the resistor network (R1, R2, R3, and R4) reduces the voltage at the op amp inputs.

Now, however, I add a common mode signal thus.

schematic

simulate this circuit

If I run the simulator, I again get a 3.36V peak output sine wave.

enter image description here

Everything looks good. However, if I take a look at the common mode voltage at the op amps input (either should work if I am running negative feedback, and the op amp is running in linear mode) like this:

schematic

simulate this circuit

when I run the simulation, I see that the common mode voltage at the op amp's input exceeds its specification. For an LM358 the common mode voltage should be between V- and V+ - 1.5V.

enter image description here

From this I conclude that I cannot rely on the fact that the simulation appears to give the output I hoped for. The simulator does not seem to check for this. It seems I should verify that the common mode voltage on the input pins of the op amp are within the specified limits as well.

Is that a valid conclusion?

\$\endgroup\$
4
  • 2
    \$\begingroup\$ What real world effect are you modeling as drawing 10 mA through a 100 kohm bias network? \$\endgroup\$
    – The Photon
    Dec 13 '20 at 19:18
  • \$\begingroup\$ The simulation has a 10mA ideal current sink, so it must draw 10mA through the resistors. But hey, -510V is an excellent amount of common mode voltage! \$\endgroup\$ Dec 14 '20 at 0:11
  • \$\begingroup\$ If you have to "survive" an offset of 510 volts, you do a simple calculation that would tell you that the voltage at the non-inverting terminal is 10 volts and that's all to it. Use weak models at your peril. \$\endgroup\$
    – Andy aka
    Dec 14 '20 at 11:13
  • \$\begingroup\$ Does that mean I shouldn't rely solely upon the output of the op amp in simulation to tell me everything is fine, but should investigate what are the voltages at my op amps input pins? After all, my op amp seemed to work fine when the voltage under test was 168V peak. \$\endgroup\$ Dec 14 '20 at 13:03
4
\$\begingroup\$

I would suggest getting a better model if it doesn't handle input range.

For example, here is a voltage follower LM358 powered from +/-5V with a 10V sine wave applied to the input through 100K:

enter image description here

As you can see, it models the output railing at approximately +4V (typically) and about -5V.

That's LTspice with the National Semi model, this one, I believe. It's still a macromodel, not a transistor level model, but it at least doesn't lie to you on such basic things.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ This is exactly what you should do to answer "can I trust the simulator". You build a special circuit that simulates the specific situation you have doubts about. First, think what the results should be, if you're applying signals outside the common mode input range then you expect the opamp not to work properly for that situation. Now run the simulation, do you see the opamp acting like an ideal opamp or do you see that it cannot cope? It is the only way to be sure. A simulator is only as good as the models it uses. Simulators (usually) don't lie but models do! \$\endgroup\$ Dec 13 '20 at 19:33
  • 1
    \$\begingroup\$ Yes, and note that if you use the Circuitlab model it rails at unrealistic voltages. It may do some other things somewhat realistically, but not that. \$\endgroup\$ Dec 13 '20 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.