Author Topic: Op amp not working out as planned  (Read 8995 times)

0 Members and 1 Guest are viewing this topic.

Offline netdudeukTopic starter

  • Frequent Contributor
  • **
  • Posts: 447
  • Country: gb
Op amp not working out as planned
« on: March 04, 2018, 06:31:04 pm »
Hi

I've got a AD9833 DDS Signal Generator Module sending out a 1KHz sine wave.  I'm supposed to be amplifying it with a NJM5532 op amp (https://www.njr.com/semicon/PDF/NJM5532_E.pdf) running from the same 5v rail.  However, the output looks poor, being clipped and with ringing.

Here's how I have the op amp configured.

Any idea why the output signal looks so bad and why the gain isn't -10 ?

Thanks

 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2084
Re: Op amp not working out as planned
« Reply #1 on: March 04, 2018, 06:44:05 pm »
running from the same 5v rail. 
Just the one supply ?
You will need both positive and negative power supplies to use any op-amp in that configuration. Also, the NE5532/34 requires a lot of headroom - If you have +5 and -5V supplies, the chip will only work properly with a signal within the range +3 to -3 (I think - look at the "common mode" range on the datasheet).

 
The following users thanked this post: netdudeuk

Offline netdudeukTopic starter

  • Frequent Contributor
  • **
  • Posts: 447
  • Country: gb
Re: Op amp not working out as planned
« Reply #2 on: March 04, 2018, 07:00:30 pm »
Hi

Thanks for the prompt reply.

Yes, I'm using a single 5v supply.

I was taking the design from here but without wanting to add the offset voltage -

https://youtu.be/ts-JqEVzvDo?t=6m35s

He looks to be using a single supply rail here -

https://youtu.be/ts-JqEVzvDo?t=7m44s

He also uses a capacitor in the feedback loop which I don't have.

 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: my
  • reassessing directives...
Re: Op amp not working out as planned
« Reply #3 on: March 04, 2018, 07:25:45 pm »
I was taking the design from here but without wanting to add the offset voltage -
https://youtu.be/ts-JqEVzvDo?t=6m35s
that is used for audio amplification from microphone which usually in 100mV range. multiply by 10 in your application is 1Vpp well within the supply range. your application is 600mV input that is 6Vpp output well outside your supply range, hence the clipping. to avoid clipping you should either reduce your input Vpp or increase the voltage supply range or reduce the opamp gain.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 
The following users thanked this post: netdudeuk

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2084
Re: Op amp not working out as planned
« Reply #4 on: March 04, 2018, 07:26:42 pm »
I was taking the design from here but without wanting to add the offset voltage -
With a single supply it is not optional - you need to bias the op-amp to around 2.5V - as is shown at approximately 6:45. You will also require the decoupling caps - depending on what you are using as your signal source.
 
The following users thanked this post: cncrepair, netdudeuk

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Op amp not working out as planned
« Reply #5 on: March 04, 2018, 07:31:57 pm »
You can use a single supply as long as you bias the non-inverting input up to half of the rail voltage.  Then capacitively couple your AC signal or feed a signal that is biased up  the same as the non-inverting input.

Now all you have to worry about is gain and headroom.  If you use an op amp that can't pull within 2 volts of the top or bottom supply and you are using a 5V supply, you only have 1V left to work with on the output.  Your input needs to be less than 100 mV.


 
The following users thanked this post: netdudeuk

Offline mav_iqdirect

  • Contributor
  • Posts: 15
  • Country: us
Re: Op amp not working out as planned
« Reply #6 on: March 05, 2018, 10:44:43 am »
You can use some free circuit simulator (like partsim) to review your schematic. Just build your circuit here and see if it can work at all.
 
The following users thanked this post: netdudeuk

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Op amp not working out as planned
« Reply #7 on: March 05, 2018, 03:56:03 pm »
The minimum supply for a 5532 dual opamp is 6V so with only 5V it might not do anything or will work poorly. If the second opamp is not disabled or used properly then it could cause oscillation interference to the first opamp.
Of course its input must be biased at half the supply voltage if it has a single positive supply.
 
The following users thanked this post: netdudeuk

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19514
  • Country: gb
  • 0999
Re: Op amp not working out as planned
« Reply #8 on: March 05, 2018, 04:25:25 pm »
Yes, the NJM5532 isn't specified to work below a total supply voltage of 6V.

You're also exceeding the common mode input voltage range. The NJM5532 is only specified to work when its inputs are within 3V of either voltage rail, worst case, 2V being typical.
https://www.njr.com/semicon/PDF/NJM5532_E.pdf

You could try the LM358, but beware it will have crossover distortion, unless its output always either sinks or sources current. A better option is an op-amp designed for 5V operation, with a rail-to-rail output, such as the MCP602.
http://ww1.microchip.com/downloads/en/DeviceDoc/21314g.pdf
 
The following users thanked this post: netdudeuk

Online metrologist

  • Super Contributor
  • ***
  • Posts: 2199
  • Country: 00
Re: Op amp not working out as planned
« Reply #9 on: March 05, 2018, 05:02:16 pm »
Just because I had this set up already, I modeled this using an LT1078 op amp.
 
The following users thanked this post: netdudeuk

Offline netdudeukTopic starter

  • Frequent Contributor
  • **
  • Posts: 447
  • Country: gb
Re: Op amp not working out as planned
« Reply #10 on: March 05, 2018, 05:22:57 pm »
Guys

Thanks for all the replies.

My circuit may not be there yet but I've learned plenty in the meantime.

Looking at the schematic though, I'm pretty sure that the Great Scott video used a 5v supply with that op amp.

I have some MCP602s so I'll try one of those.

 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: my
  • reassessing directives...
Re: Op amp not working out as planned
« Reply #11 on: March 05, 2018, 05:36:49 pm »
Looking at the schematic though, I'm pretty sure that the Great Scott video used a 5v supply with that op amp.
I have some MCP602s so I'll try one of those.
no opamp in this world can produce 6V from 5V rail, let alone -6V in inverting amp as your setup that i missed to see.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline netdudeukTopic starter

  • Frequent Contributor
  • **
  • Posts: 447
  • Country: gb
Re: Op amp not working out as planned
« Reply #12 on: March 05, 2018, 05:55:40 pm »
Looking at the schematic though, I'm pretty sure that the Great Scott video used a 5v supply with that op amp.
I have some MCP602s so I'll try one of those.
no opamp in this world can produce 6V from 5V rail, let alone -6V in inverting amp as your setup that i missed to see.

If I get your meaning, I was just saying that he seems to have used a single 5v supply rail (which, according to Hero999,  isn't supported), not that he was getting 6V out.

 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2084
Re: Op amp not working out as planned
« Reply #13 on: March 05, 2018, 06:16:03 pm »
Looking at the schematic though, I'm pretty sure that the Great Scott video used a 5v supply with that op amp.
Those op-amps will be a bit lethargic at 5V - they are not designed for such low supply voltages. Your signal amplitude will be limited - fortunately you do not need much amplitude for a mic signal, but you do need to bias the op-amp into its working range.

Quote
I have some MCP602s so I'll try one of those.
I think you are going to half-disappointed ;) Consider applying -100mV to the input and calculate the voltage at the output. Now repeat the exercise with +100mV at the input - it should be obvious why it's not going to work. 
 
The following users thanked this post: netdudeuk

Offline netdudeukTopic starter

  • Frequent Contributor
  • **
  • Posts: 447
  • Country: gb
Re: Op amp not working out as planned
« Reply #14 on: April 04, 2018, 04:42:22 pm »
Hi

I've replaced the NJM5532 with a MCP602 (http://ww1.microchip.com/downloads/en/DeviceDoc/21314g.pdf) running at 5V with the non-inverting input biased to 2.5V with two 10k resistors.

This is a single rail (2.7V to 6V) device with Rail-to-Rail output.

Things seem to look better on the scope.  No clipping.

I have a 4.7k resistor on the input and a 5.1k resistor in the feedback loop.  I was expecting the gain to be 5.1/4.7 = 1.085106382978723

I'm assuming that the actual gain is ( Vpp (Output) /2 ) / (Vpp (Input) /2 )  i.e. 360/280 = 1.285714285714286

So, theory and practise don't match up.  I'm assuming that's it is probably my theory that's not right  :)

What's the situation here ?

Thanks

 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Re: Op amp not working out as planned
« Reply #15 on: April 04, 2018, 05:16:59 pm »
1) your average input voltage is about 400mV dc.  The NI input of the amp is biased at 2.5Vdc.  So your output is close to the positive rail.  Is that what you want?
2) your resistors are not as precise as your calculator.  With 5% tolerance, you are not too far off if the scope is giving you accurate measurements.  Why not ac couple the output so that you can display it with the scope 200mV/div like the input? The scope might give a more accurate readout??

It is not good engineering to keep all of those extra digits in your calculation.  Two significant digits is all you have.
 
The following users thanked this post: netdudeuk

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Op amp not working out as planned
« Reply #16 on: April 04, 2018, 05:54:36 pm »
The NJM5532 is a Japanese copy of an American NE5532 so some of them might work when its supply is only 5V instead of the minimum of 6V.
If you want everything you make to work perfectly then use the original IC not a copy and use it with a supply voltage that is guaranteed to work.
 
The following users thanked this post: netdudeuk

Offline netdudeukTopic starter

  • Frequent Contributor
  • **
  • Posts: 447
  • Country: gb
Re: Op amp not working out as planned
« Reply #17 on: April 04, 2018, 06:10:10 pm »
1) your average input voltage is about 400mV dc.  The NI input of the amp is biased at 2.5Vdc.  So your output is close to the positive rail.  Is that what you want?
2) your resistors are not as precise as your calculator.  With 5% tolerance, you are not too far off if the scope is giving you accurate measurements.  Why not ac couple the output so that you can display it with the scope 200mV/div like the input? The scope might give a more accurate readout??

It is not good engineering to keep all of those extra digits in your calculation.  Two significant digits is all you have.

My resistors are from China so 5% is being optimistic ;)  Actually, I measured them previously and got 4.67k and 5.1k.

Here's what we have with AC coupling on the output.

 

Offline netdudeukTopic starter

  • Frequent Contributor
  • **
  • Posts: 447
  • Country: gb
Re: Op amp not working out as planned
« Reply #18 on: April 04, 2018, 06:11:01 pm »
The NJM5532 is a Japanese copy of an American NE5532 so some of them might work when its supply is only 5V instead of the minimum of 6V.
If you want everything you make to work perfectly then use the original IC not a copy and use it with a supply voltage that is guaranteed to work.

That's the original IC that I ditched thanks.  However, it did come from RS so will be genuine.
« Last Edit: April 04, 2018, 06:36:52 pm by netdudeuk »
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Re: Op amp not working out as planned
« Reply #19 on: April 04, 2018, 08:55:55 pm »
1) your average input voltage is about 400mV dc.  The NI input of the amp is biased at 2.5Vdc.  So your output is close to the positive rail.  Is that what you want?
2) your resistors are not as precise as your calculator.  With 5% tolerance, you are not too far off if the scope is giving you accurate measurements.  Why not ac couple the output so that you can display it with the scope 200mV/div like the input? The scope might give a more accurate readout??

It is not good engineering to keep all of those extra digits in your calculation.  Two significant digits is all you have.

My resistors are from China so 5% is being optimistic ;)  Actually, I measured them previously and got 4.67k and 5.1k.

Here's what we have with AC coupling on the output.
Move your NI voltage from 2.5 to 1.5 and run it again just to see if the distortion goes away
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Op amp not working out as planned
« Reply #20 on: April 04, 2018, 10:06:20 pm »
I've replaced the NJM5532 with a MCP602 (http://ww1.microchip.com/downloads/en/DeviceDoc/21314g.pdf) running at 5V with the non-inverting input biased to 2.5V with two 10k resistors.

Biasing the +Ve input to 2.5V only makes sense if the signal is AC coupled to the 4k7 by adding a cap in series with it, at 100kHz a 0.1uF will do.
.  That took much longer than I thought it would.
 
The following users thanked this post: netdudeuk, Wimberleytech

Offline netdudeukTopic starter

  • Frequent Contributor
  • **
  • Posts: 447
  • Country: gb
Re: Op amp not working out as planned
« Reply #21 on: April 05, 2018, 08:36:15 am »
Thanks for all the replies so far.

My original plan was to take the AD9833 DDS Signal Generator module and make a basic lab instrument with it.

I believe that I need to boost the output to a more useful level so decided to use an op amp to do that.

I'm now using the MCP602 op amp to do that at the moment but I'd probably like to end up with a range up to about 10Vdc.  So, that would need a different single supply rail to rail op amp.

The has an output frequency range of 0 MHz to 12.5 MHz and I'd want to be able to get all or most of that range out of it.

 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: Op amp not working out as planned
« Reply #22 on: April 05, 2018, 08:50:58 am »
You won't be able to get a 10v signal out of an opamp with a 6v max supply like the MCP602.  You would need more than a 10V supply because even "rail to rail" opamps get a little flaky in their performance near their supply rails.

Start by making a nice +15v/-15v supply for your opamp and use ones that will work with it.  Just an LM7815 + LM7915 will work very well.  Then start experimenting with opamps that work within it.  Your project is ambitious and it will grow a bit (eg, you'll want an offset control eventually) but you stand to learn quite a lot from it.

EDIT:  Maybe just a +12v/-12v would be better and give you a wider range of opamps.  Other's thoughts?
 
The following users thanked this post: netdudeuk

Offline netdudeukTopic starter

  • Frequent Contributor
  • **
  • Posts: 447
  • Country: gb
Re: Op amp not working out as planned
« Reply #23 on: April 05, 2018, 09:00:53 am »
You won't be able to get a 10v signal out of an opamp with a 6v max supply like the MCP602.  You would need more than a 10V supply because even "rail to rail" opamps get a little flaky in their performance near their supply rails.

Start by making a nice +15v/-15v supply for your opamp and use ones that will work with it.  Just an LM7815 + LM7915 will work very well.  Then start experimenting with opamps that work within it.  Your project is ambitious and it will grow a bit (eg, you'll want an offset control eventually) but you stand to learn quite a lot from it.

EDIT:  Maybe just a +12v/-12v would be better and give you a wider range of opamps.  Other's thoughts?

Thanks for the reply.

I did mention in the previous post that the MCP602 would be no good for 10V and that I would need a different op amp.  Any suggestions please ?

I have a DP832 so I could supply the +15V/-15V with no issues although that would be two out of the three rails leaving me with only a 5V rail.

Single rail still seems easier, especially as I could get up to 15V from the DP832 as a starting point.

Learning is an objective.  I've already learned plenty from the project.

 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19514
  • Country: gb
  • 0999
Re: Op amp not working out as planned
« Reply #24 on: April 05, 2018, 10:42:28 am »
A bipolar power supply is probably easier, as there's no AC coupling to worry about.

Start from the beginning.

What peak input voltage and output voltages do you require? That will let you work out the gain, required bandwidth and slew rate.

What load is this going to be driving? Is it going to be via a long cable? If so, the load impedance, will have to match, the characteristic impedance of the cable.
https://en.wikipedia.org/wiki/Characteristic_impedance

Going from what you've said, you need a fairly fast op-amp. A 12.5MHz sine wave, with a peak voltage of 5V (10V peak to peak) is a slew rate of 392.75V/µs (see link below), and if you want a gain of two, you need a gain bandwidth product of more than double the maximum frequency.
http://www.radio-electronics.com/info/circuits/opamp_basics/operational-amplifier-slew-rate.php

I'd suggest a video amplifier IC, as a suitable op-amp won't be cheap. This is not a simple project. Careful attention needs to be given to layout, otherwise there will be problems with instability and oscillation.
 
The following users thanked this post: netdudeuk


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf