I have a generalised op-amp question. I am having trouble trying to
extrapolate what I need to know from manuals and datasheets, so maybe one of
you experts here in analog electronics (something I definately am not) can
help me with understanding the concept. This may seem like a dumb question
to some of you, but here goes...

Do op-amps have a limit on the amount they can amplify a signal ? What I am
finding is that if you increase the difference in resistance in the divider
in a differential amplification setup, at a certain point, the signal
becomes non-linear at the peaks. Increasing the reference voltage into the
op-amp does not seem to help. At a certain point in the divider value, the
output simply shifts further up from zero, rather than increasing the gain,
and the peaks are flattened out. Note that this is not the same as getting
the low point to zero on a non rail-to-rail op-amp by providing a negative
reference - I am already doing this. I am having a great deal of trouble
getting much more than about 20x gain from an LM358. I would like 100x
gain, but this seems impossible to achieve with this op-amp, even though it
is marketted as a "HiGain" op-amp.

I am pretty sure of my observations. I am not proto testing it, but SPICE
testing it with CircuitMaker, so I can see a sine wave amplified output
compared to a sine wave input - a good way to graphically see with a SPICE
transient analysis what is going on.

PS: I am good with digital electronics, but I wish I was better at analog
...

Are you sure that you're not getting close to either of the supply rails? -
Otherwise I can't think of much!
100x gain should be OK provided that the input offsets don't get out of
hand - do both input have the same effective source impedance (or near
enough the same).

What frequency are you simulating your circuit - could you be hitting a
slew rate limit - or the simulated effect of one?

Can you send the circuit or put it on a website somewhere?

Richard P

Hi guys,

I have a generalised op-amp question. I am having trouble trying to
extrapolate what I need to know from manuals and datasheets, so maybe one
of
you experts here in analog electronics (something I definately am not) can
help me with understanding the concept. This may seem like a dumb question
to some of you, but here goes...

Do op-amps have a limit on the amount they can amplify a signal ? What I
am
finding is that if you increase the difference in resistance in the divider
in a differential amplification setup, at a certain point, the signal
becomes non-linear at the peaks. Increasing the reference voltage into the
op-amp does not seem to help. At a certain point in the divider value, the
output simply shifts further up from zero, rather than increasing the gain,
and the peaks are flattened out. Note that this is not the same as getting
the low point to zero on a non rail-to-rail op-amp by providing a negative
reference - I am already doing this. I am having a great deal of trouble
getting much more than about 20x gain from an LM358. I would like 100x
gain, but this seems impossible to achieve with this op-amp, even though it
is marketted as a "HiGain" op-amp.

I am pretty sure of my observations. I am not proto testing it, but SPICE
testing it with CircuitMaker, so I can see a sine wave amplified output
compared to a sine wave input - a good way to graphically see with a SPICE
transient analysis what is going on.

PS: I am good with digital electronics, but I wish I was better at analog
...

On Thursday 20 February 2003 06:00 pm, Ian McLean wrote:
> Just 10kHz input in simulation. In reality it would only be 5. Is
> this where I am going wrong. As Richard has suggested, am I
> reaching a slew-rate limit ?

The LM358 will swing its outputs from 0V to V+ - 1.5V. So you can
expect to see clipping at 3.5V if you have a 5V supply.

On Thursday 20 February 2003 06:00 pm, Ian McLean wrote:
> Just 10kHz input in simulation. In reality it would only be 5. Is
> this where I am going wrong. As Richard has suggested, am I
> reaching a slew-rate limit ?

The LM358 will swing its outputs from 0V to V+ - 1.5V. So you can
expect to see clipping at 3.5V if you have a 5V supply.

The answer to your question is "Yes". Opamps do have a limit on the amount
they can amplify a signal. But it is usually way more than 20x.

What is going on here?

First, as others mentioned, if the output gets near the power supply rails,
it will distort (flatten out usually). So check the peak values and see if
this is the case. If so, reduce the magnitude of your input signal (the ac
value).

Reality check: you want a gain of 100. Your opamp can only produce some
limited maximum undistorted signal at the output. Let's suppose you have
+5V and Gnd rails. The '358 can go a little better than 3Vpp in this case.
Thus your input will need to be NO MORE than 100 times less which is
30mVpp. With a gain of 100, any more input will square the sinewave into a
distorted square wave. Adjust your signal depending on what actual power
supply numbers you have.

Next, the AC gain numbers of voltage mode op amps decreases with frequency.
The '358 GBW is 1MHz which means that at 10KHz, you will have only a gain
of 100 OPEN LOOP.

It wasn't clear to me what sort of input biasing scheme you are using. To
get maximum signal swing, you will need your input bias point located in
the middle of what the output can do. Since the output swings closer to
gnd but 1.5v from the positive rail, you don't want an input bias point of
2.5; rather, something a little lower. This assumes you are using +5 and
gnd for power; if you have a negative rail, things will work better. With
+/- supplies, you can use gnd usually as your bias point. Remember that
the amplifier will amplify DC so if you have a gain of 100, any DC offsets
will be multiplied by 100.

Finally, Ian, you are doing the RIGHT thing: using a simulator. Trying
this with hardware with a very limited knowledge base and perhaps no
oscilloscope or signal generators, etc. will be an exercise in frustration.
As others have mentioned about the value of the MPLAB sim for software, an
simulator for circuits is a great idea. Plus you don't let out any smoke or
burn fingers. You can build circuits all day and see what they will do
without having to buy and destroy any parts.

Yes, there are limits to how much you can amplify a signal with an op-amp,
even in the theoretical ideal op-amp. In any real world op-amp there are so
many limiting factors that without knowing the exact circuit topology and,
input signal you're using, it is nearly impossible to figure out which
limitation(s) you're hitting.

But since this is the PIClist I'll take a guess :-).

A limit I've seen people trip over often, is the magnitude of the power
supplies. If your input times your gain exceeds the power supply then the
output will be clipped to the supply level. In practice no real op-amp can
drive it's output all the way to its supply rails. So, you'll see clipping
at some value less than the PS voltage.

By the standards of 1974 when it was introduced, the LM358 was a "HiGain"
amplifier. By today's standards it's a very inexpensive commodity amplifier.
I only use it and, its quad brother the LM324, for signals from DC to ~100Hz
and with gains of < 20. If you really want 100x gain on this series of amps
I'd go with a 10x gain differential stage followed by a 10x non-inverting
stage.

If you're interested in learning a lot about op-amps I highly recommend
Walter G. Jung's excellent book "IC Op-Amp Cookbook". If you just want to
get a specific circuit working let the list know more details and I'm sure
you'll get lots of favorite op-amp recommendations ;-).

You are right about using a differential, followed by non-inverting stage
for the job with this op-amp ...

The solution to my problem as it happens is to do with gain as much as the
maximum voltage swing I could expect from an LM358. Somebody has mentioned
that if my negative is at 0, then I could expect clipping above 3.5V. This
is indeed what I saw, clipping, and is what gave me the clue, and after
further simulation, have concluded that the gain is pretty much limited to a
0-3.5V swing for an input range of 0-400mV (can't be bothered working that
out). I could settle for that, or as I have now tried, use both op-amps in
the package to get a swing from 0-4V which is what I was after.

Thank you for all the advise.

PS: Must get my hands on some better op-amps ? Any suggestions as to a
suitable one for this job ?

On Thursday 20 February 2003 08:37 pm, Ian McLean wrote:
> You are right about using a differential, followed by non-inverting
> stage for the job with this op-amp ...
>
> The solution to my problem as it happens is to do with gain as much
> as the maximum voltage swing I could expect from an LM358.
> Somebody has mentioned that if my negative is at 0, then I could
> expect clipping above 3.5V. This is indeed what I saw, clipping,
> and is what gave me the clue, and after further simulation, have
> concluded that the gain is pretty much limited to a 0-3.5V swing
> for an input range of 0-400mV (can't be bothered working that out).
> I could settle for that, or as I have now tried, use both op-amps
> in the package to get a swing from 0-4V which is what I was after.

I don't think you'll get that kind of swing on a 5V supply out of
these, no matter what gain you're running at. Your positive output
swing is still going to be limited.

> Thank you for all the advise.
>
> PS: Must get my hands on some better op-amps ? Any suggestions as
> to a suitable one for this job ?

There are many dual op amps out there with better specs. A lot of CMOS
op amps have rail-to-rail inputs *and* outputs.

If you could share these, we could help better. Or you could look at
the op amp selection guides at National, TI, Linear Tech, and Analog
Devices. They all have parametric selection guides; some also give
price estimates (these will be much lower than you'll pay in small
quantities, of course, but they can be used to compare amps).

>PS: Must get my hands on some better op-amps ? Any suggestions as to a
>suitable one for this job ?

I posted a list of readily available dual op-amps a couple of weeks
back. My requirements for that project required a reasonably low offset
voltage so that is what my list focused upon. However, I also listed the
supply voltage operating range and maximum Vout swing: the parts marked
"RR" have rail-to-rail output stages. Finally, the list included cost
(Canadian $).

>Just 10kHz input in simulation. In reality it would only be 5. Is this
>where I am going wrong. As Richard has suggested, am I reaching a slew-rate
>limit ?

"Just" 10 kHz? That's pretty high. The LM358 has a
gain-bandwidth product (i.e., a unity-gain crossover frequency)
of 1 MHz. At 10 kHz, therefore, the open-loop gain of the part
is only 100. If you're trying to make a differential amplifier
with an accurate gain of 100 at that frequency, the LM358 isn't
going to cut it. You need something a lot faster. You can make
a X100 diffamp with an LM358, but only at low frequencies.

You may also be running into slew-rate limiting, but that would
depend on the amplitude of your signal. Also, there's the input
common-mode range to consider, as well as maximum output swing.

> What I am
> finding is that if you increase the difference in resistance in the
divider
> in a differential amplification setup, at a certain point, the signal
> becomes non-linear at the peaks. Increasing the reference voltage into
the
> op-amp does not seem to help. At a certain point in the divider value,
the
> output simply shifts further up from zero, rather than increasing the
gain,
> and the peaks are flattened out.

This sounds more like you are hitting other limits than gain. Opamps also
have finite input impedence and non-zero bias and offset currents. These
all cause increasing trouble as the impedence driving the inputs
increases. You should post your exact circuit.

> Finally, Ian, you are doing the RIGHT thing: using a simulator. Trying
> this with hardware with a very limited knowledge base and perhaps no
> oscilloscope or signal generators, etc. will be an exercise in
frustration.
> As others have mentioned about the value of the MPLAB sim for software,
an
> simulator for circuits is a great idea. Plus you don't let out any smoke
or
> burn fingers. You can build circuits all day and see what they will do
> without having to buy and destroy any parts.

Simulation certainly has its place. It is a great testbed for *theory*.
However, there is still no substitute for real parts as a testbed for
*practice*. In the end you get valuable and somewhat different
experiences from both. There is little point in building a circuit that
the simulator says won't work, but I strongly encourage fiddling with real
parts and an oscilloscope. Some things can only be learned this way.

> There is little point in building a circuit that
>the simulator says won't work

Disagree with this. There are many times when we know better than the
simple models used for simulation and are using some characteristic that
isn't simulated. Some regions of operation may not be modeled accurately,
if at all, in simple op-amp macromodels.

I posted a 3-component (1-R, 1-C, 1-BJT) oscillator on s.e.d. fairly
recently, and nobody (AFAIK) was able to get it to work in the simulation,
but it works just fine in practice. That's an extreme example, I'd not
use the part like this in a production circuit.

Finally? Where did that come from? I have mentioned simulation quite a few
times already. And I do have access to a CRO, signal generator, and freq.
counter.

Most of my sub circuits, at least it current projects, have been simulated
successfully prior to prototyping in hardware. In fact, I have been doing
it that way for about 2 years now. As I eluded to before, I do not in
general need to pre-simulate digital components and sub-circuits, as I am
fairly good with digital electronics, but when it comes to the analog stuff
and analog sub-circuits, well ...

I might like to add that the sweet little bonus to pre-prototyping
simulation ... You have a working circuit schematic - documentation :)

And I agree that there is no substitute for real hardware. That is what
prototyping is for. The simulations do give you at least a starting point,
where at least in most cases, you are not going to let out any smoke.

My knowledge of op-amps is unfortunately a little slim, but simulation and
some texts have taught me a great deal recently.

I tried posting the final circuit as a jpeg, using the two op-amps in the
LM358 package to get a bigger swing in voltage, but it got bounced back as
being too big. Doesn't really matter now, unless anyone in particular
wishes to see it.

PS: Thanks again everyone for all of the advice. I certainly have got the
answers I needed this time around.

At 03:31 AM 2/22/2003 +1300, you wrote:
> > I posted a 3-component (1-R, 1-C, 1-BJT) oscillator on s.e.d. fairly
> > recently, and nobody (AFAIK) was able to get it to work in the simulation,
> > but it works just fine in practice.
>
>
>Please describe the circuit !
>Only so many ways to connect 3 such parts, but which is your way?
>
>I assume grounded emitter with cap to ground and res from base to collector,
>but maybe not.

At 12:44 PM 2/21/03 -0500, Spehro Pefhany wrote:
>At 03:31 AM 2/22/2003 +1300, you wrote:
>> > I posted a 3-component (1-R, 1-C, 1-BJT) oscillator on s.e.d. fairly
>> > recently, and nobody (AFAIK) was able to get it to work in the simulation,
>> > but it works just fine in practice.
>Here's the output waveform, if that's any help:
>
>http://www.speff.com/osc.jpg

Let me guess: the transistor is avalanching? What is the P-P voltage on
that waveform?

At 12:57 PM 2/21/2003 -0700, you wrote:
>At 12:44 PM 2/21/03 -0500, Spehro Pefhany wrote:
>>At 03:31 AM 2/22/2003 +1300, you wrote:
>>> > I posted a 3-component (1-R, 1-C, 1-BJT) oscillator on s.e.d. fairly
>>> > recently, and nobody (AFAIK) was able to get it to work in the
>>> simulation,
>>> > but it works just fine in practice.
>>Here's the output waveform, if that's any help:
>>
>>http://www.speff.com/osc.jpg
>
>Let me guess: the transistor is avalanching? What is the P-P voltage on
>that waveform?

No it didn't :-) - but I just realised that I didn't deal with the collector
! :-)
(In mitigation, it was 3:30am, Sir!)

Lessee.
Yes. It does sound a bit impossible.
Just maybe there is 'special pleading" here and the supply voltage needs to
be set "just right" ?
C must be above E
B needs fwd bias to start and something to then turn it off.

Resistor from C to supply.
Collector from base to collector.
Phasing is right.
On turn on C is high. So base is high
Collector voltage falls a Q conducts and drives base low via C so ...
Nope.

Q: Are there any "special conditions"
Such as eg power supply set in certain range.
eg very low so you can turn on across a supply OKish or just bias Vbe on or
high enough to breakdown Vber or ...
Don't have to say what they are but just that they exist.
Otherwise it's a trick question.

>Q: Are there any "special conditions"
>Such as eg power supply set in certain range.

No, supply voltage is not critical. 12V works fine.

>eg very low so you can turn on across a supply OKish or just bias Vbe on or
>high enough to breakdown Vber or ...
>Don't have to say what they are but just that they exist.
>Otherwise it's a trick question.
>
>Same if transistor is "special"" somehow.

>Q: Are there any "special conditions"
>Such as eg power supply set in certain range.

No, supply voltage is not critical. 12V works fine.

>eg very low so you can turn on across a supply OKish or just bias Vbe on or
>high enough to breakdown Vber or ...
>Don't have to say what they are but just that they exist.
>Otherwise it's a trick question.
>
>Same if transistor is "special"" somehow.

I had some things *like* this oscillating when I was
testing capacitor dump systems during design of my
2-tran Black regulator. They rely on one cap being
dumped into another via *some* resistance.

In the case above the (!) parts are the capacitance
of the breadboard strips and the significant resistance
of the 2 breadboard spring contacts between C1 leg
and collector leg of Q1. Which explains why the spice
model didn't oscillate. :o)
-Roman

for the purpose I would suggest MCP602-I/P made by Microchip. It is
advertised as a rail-to-rail one. The only thing is - which is even an
advantage in your case - the Vdd may not exceed 5V (nominal).
I use it with success.

Regards,
Imre

+-----------------------------------------------------------------------+
| The information transmitted is intended only for the person or entity |
| to which it is addressed and may contain confidential and/or |
| privileged material. Any review, retransmission, dissemination or |
| other use of, or taking of any action in reliance upon, this |
| information by persons or entities other than the intended recipient |
| is prohibited. If you received this in error, please contact the |
| sender and delete the material from any computer. |
+-----------------------------------------------------------------------+

> You are right about using a differential, followed by non-inverting stage
> for the job with this op-amp ...
>
> The solution to my problem as it happens is to do with gain as much as the
> maximum voltage swing I could expect from an LM358. Somebody has mentioned
> that if my negative is at 0, then I could expect clipping above 3.5V. This
> is indeed what I saw, clipping, and is what gave me the clue, and after
> further simulation, have concluded that the gain is pretty much limited to a
> 0-3.5V swing for an input range of 0-400mV (can't be bothered working that
> out). I could settle for that, or as I have now tried, use both op-amps in
> the package to get a swing from 0-4V which is what I was after.
>
> Thank you for all the advise.
>
> PS: Must get my hands on some better op-amps ? Any suggestions as to a
> suitable one for this job ?
>
> Ian.
>
>
>