Op-Amp output different than real world

My Op-Amp output in Circuit Lab outputs 12 Volts but in real life, I'm only getting 7.7 volts. I know that one op-amp rule is the voltages are the same at the inputs but my LM358 is not meeting that. I have the positive input wired at 12V. I have the gain set at 3 (56K/18K) with 12 volts as the input to the negative side. The resulting negative input voltage is 11.67 volts. Am I violating some limit of the LM358? Circuit Lab says the output should be 12 volts. The rails are at 12V and 0V.

by nwilson
June 19, 2012

See circuit at

by nwilson
June 19, 2012

The LM358 is an older amplifier, and it's definitely not rail to rail output. The spec sheet is mighty scanty about this info, but it suggests the output doesn't get much closer than 4 volts to the plus rail. Which matches with your observations.

Try turning up the plus rail on the real-world op-amp to like 24 volts and you should see better results.

And Oh, it still won't quite make it-- to put 12 volts at the minus input, the output has to reach to like 36 volts, which is beyond most older op-amp maximums. Not quite sure what you're trying to do-- triple V1? You either need to lower V1 quite a bit or use a higher-voltage capable op-amp.

Circuitlab doesn't model the op-amp rail behavior very well, you sometimes see it saying your 741 has Gigavolts out.

by arduinohacker
June 19, 2012

Several points:

i) " ... one op-amp rule is the voltages are the same at the inputs ..." is true if you want the opamp to operate in the linear region i.e. not slam its output into one or the other supply rail but this statement applies to the inverting and the non-inverting inputs to the opamp itself not the inputs you apply in your application circuit.

You have tried to apply the same voltage to the non-inverting input and to the input end of R4. That's not the same thing as ensuring that the difference between the two opamp inputs is always zero.

ii) You haven't said what you want the circuit to do or what you actually expect it to do. From your circuit title, it seems as though you are trying to make a x3 non-inverting amplifier but that is very definitely not what you have made.

iii) "The rails are at 12V and 0V." Sorry but that is not true because your CL circuit uses an opamp model which has no supply rail limits so you can generate an output that may be far higher, or lower, than a real opamp can achieve.

If you really do want a x3 amp run off 0V and +12V then you cannot have an input voltage of more than 4V if you assume that the opamp output voltage can really reach the +12V rail. In practice that will not be possible: it will be below that by somewhere between a few mV and several volts, depending on the opamp you choose so you practical max Vin will probably be less than 4V.

Please have a look at:

You might also like to have a read of:

http://en.wikibooks.org/wiki/Electronics/Op-Amps

and

http://en.wikipedia.org/wiki/Operational_amplifier

and the first couple of chapters of:

http://www.analog.com/library/analogDialogue/archives/39-05/op_amp_applications_handbook.html

:)

by signality
June 19, 2012

Oops, forget most of my comments, Signality is right, you're not going to get a gain of 3 that way. The first resistor has to go to ground, not the signal input. Then the circuit should simulate "correctly", algebraicqly anyway. But a real LM358 isn't going to be able to put out 36 volts. Always something.

by arduinohacker
June 19, 2012

I've updated my circuit to add showing the inverting input of the opamp so that you can see that it is at the same voltage as the non-inverting input.

You can now run a DC solver and a DC sweep simulation.

by signality
June 20, 2012

For an input of 9-12 volts DC, I need an output 0-12 volts DC where the op-amp rails are 0 and 12 volts. A DC sweep on V1 from 9 to 12 volts shows this working in CircuitLab but not on my LM358 in the real world. Is there an op-amp better suited for this application?

by nwilson
June 20, 2012

If you look at "Input Common-Mode Voltage Range" in the table of Electrical Characteristics at the top of p3 in:

https://www.national.com/ds/LM/LM158.pdf

you'll see that the LM358 cannot operate with it's inverting and non-inverting i/ps at the positive supply. They must be at least 1.5V below it.

Also, if you look at "Output Voltage Swing" at the top of p 4 and the graph of "Output Characteristics Current Sourcing" on p7, you'll see that the output cannot reach the positive supply rail.

To do what you want the way you have drawn your circuit, you need a rail-to-rail input and rail-to-rail output opamp.

Try this search at TI:

http://focus.ti.com/paramsearch/docs/parametricsearch.tsp?family=analog&familyId=1562&uiTemplateId=NODE_STRY_PGE_T#p78=+/-%2012V;In;Out

Otherwise you need to rethink what you are trying to do in a different way and redesign the circuit.

For example maybe you can attenuate the input voltages before you do the subtraction which would remove the need to rail-to-rail input.

Do you really need the o/p to be 12V? Could 10V do?

Don't just think about why doing something in a certain way will be good. Think about why doing it in other ways may be bad and remember so you don't fall into the same trap next time.

Many times you will find that what you think you want to do or what you've been asked to do by your boss (and that can get very tricky!) is based on a misunderstanding of what the real problem is.

A design process:

Stage 1:

Think about what you are trying to do.

Think about why you want to do it.

Think up a way to do what's really needed.

What's good about it?

What's bad about it?

Write it down.

Stage 2:

Think about what you are trying to do some more.

Think again about why you want to do it.

Think up another way to do do what's really needed.

What's good about it?

What's bad about it?

Write it down.

Stage 3:

Think again about what you are trying to do.

Think really hard about why you want to do it.

Think up a third way to do do what's really needed.

What's good about it?

What's bad about it?

Write it down.

Stage 4:

Now cherry pick the best bits of all of them and you may have a good solution.

:)

by signality
June 21, 2012

You have to think around the problem and see how strict the requirements are. Requiring an output to go exactly to the positive rail is mighty strict..... No transistor output stage can do that ... It can get within 0.3 volts if you plop a PNP up there, otherwise you need a resistor to the positive rail, or a p channel FET,or a newer op amp that has rail to rail outputs. An old LM3xx isn't going to get within 4 volts of the positive rail- if you look at its schematic, the output stage has two base emitter drops and a current source down from the positive rail,,so that's at least 1.2 volts plus whatever minimum voltage a current source can manage to run at.

by arduinohacker
June 21, 2012

Thanks for the advice. I've got a couple fancy op-amps ordered from Linear but like you've said, op-amps may not be the solution due to the strict requirements. The voltage source is the temperature control for the rear heating/cooling system on a 2005 suburban. It controls a blend door actuator that requires a 0-12 volt signal to determine position. I wanted to avoid ripping out the whole headliner and troubleshooting the source but it seems more likely now.

by nwilson
June 21, 2012

Okey, dokey, here's a circuit that does what you want, I think. At least it simulates nicely:

One unknown: we don't know how much current drive you need for the actuator. I used a FET that can supply up to 8 amps, when heat-sunk. Also we don't know if the actuator needs a hefty pulldown, I use a 100 ohm resistor, which should work relatively fine if the actuator doesn't need much pull-down.

by arduinohacker
June 22, 2012

And oh, I forgot, it doesn't have to be a TL082, just any old op amp that can take inputs up to the positive rail should do. Oh dear, could be an issue. We could scale down the inputs by adding four cheap resistors, then we can use any old op-amp, like a 741:

Doing so shifts the operation up by 0.2 volts, but that should still be okay, I'd guess.

by arduinohacker
June 22, 2012

Cool circuit! What's the idea behind the resistor from the bottom of the FET? Looks like some sort of feedback loop. I've noticed the output is dependent on the impedance of the load. If the load is higher like 1K or 10K, how would I compensate?

by nwilson
June 23, 2012

The pull-down resistor is needed if the load can source some current back, which isn't very likely, but possible.

The output shouldn't be dependent on the load impedance, the R3 feedback resistor should be compensating for any reasonable load.

by arduinohacker
June 24, 2012

I got an LT1677 op-amp and tried it out with the most basic setup and it worked well on my test bench. The next step is to install it into the vehicle and see if it works there as well.

by nwilson
July 02, 2012

Post a Reply

Please sign in or create an account to comment.

Go Ad-Free. Activate your CircuitLab membership. No more ads. Save unlimited circuits. Run unlimited simulations.

About CircuitLab

CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.