Author Topic: Op Amp Difficulties... PLZ Help!  (Read 2047 times)

0 Members and 1 Guest are viewing this topic.

Offline popcornhoboTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Op Amp Difficulties... PLZ Help!
« on: February 18, 2010, 11:20:30 AM »
I have tried to set up both an inverting and a non-inverting op amp to no avail. I am using an LM358 op amp with +/- 5v power supply. I am inputting a signal that ranges from .25-.5v and I am trying to amplify it 4.7x using a 470k ohm and a 100k ohm resistor. The only thing the op amp output does is give me a slightly diminished version of my input signal, say .28-.47v. I should also note that inputting a larger signal say 2v-2.25v seems to correct the problem. Does anyone know what is going wrong? I have also ran simulations in Pspice and everything works perfectly. I would think the op amp could handle an input signal in this range.

I am pretty sure it is connected properly. I am using this configuration http://en.wikipedia.org/wiki/File:Op-Amp_Non-Inverting_Amplifier.svg with r2=470k and r1=100k for the non-inverting amp.


Offline cyberfish

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Re: Op Amp Difficulties... PLZ Help!
« Reply #1 on: February 18, 2010, 01:55:09 PM »
Just a guess -

Have you tried using a 470ohm and 100ohm instead?

An ideal op amp has infinite input impedance, real op amps don't. The resistances you are using could be getting close to the input impedances of the op amp.

Offline popcornhoboTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Op Amp Difficulties... PLZ Help!
« Reply #2 on: February 18, 2010, 02:48:15 PM »
Thanks! I think you may be on to something, I will give that a try.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Op Amp Difficulties... PLZ Help!
« Reply #3 on: February 18, 2010, 07:08:31 PM »
Hi,

Have you tried using a 470ohm and 100ohm instead?

An ideal op amp has infinite input impedance, real op amps don't. The resistances you are using could be getting close to the input impedances of the op amp.
Won't matter. The LM358 has a typical input impedance of 100 MOhm! Close to infinity compared the values in this example.
Actually, i have yet to see an op-amp that wouldn't be able to handle 470k/110k.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Op Amp Difficulties... PLZ Help!
« Reply #4 on: February 18, 2010, 08:13:02 PM »
Hi,

I am using an LM358 op amp with +/- 5v power supply. I am inputting a signal that ranges from .25-.5v and I am trying to amplify it 4.7x using a 470k ohm and a 100k ohm resistor.
Non-inverting gain (Av) = 1+R2/R1 = 5.7
But that's still inside the range of up to 3.0V to 3.5V it should have on a 5V supply.


The only thing the op amp output does is give me a slightly diminished version of my input signal, say .28-.47v. I should also note that inputting a larger signal say 2v-2.25v seems to correct the problem.
How do you assert that??
Correct function would be 2V*5.7=11.4V to 2.25V*5.7=12.825V and unless you break the laws of physic, it's gonna be problematic seeing much above 3.5V when supplying 5V.


Does anyone know what is going wrong? I have also ran simulations in Pspice and everything works perfectly. I would think the op amp could handle an input signal in this range.

I am pretty sure it is connected properly. I am using this configuration http://en.wikipedia.org/wiki/File:Op-Amp_Non-Inverting_Amplifier.svg with r2=470k and r1=100k for the non-inverting amp.
Yes, we know what is going wrong. It's a 12" Error ;D

Here's some points to check:
  • Are you using a solderless breadboard?
  • If not, then (even though you are The marksman with an iron) please check your solder joints with a magnifying glass and an ohmmeter.
  • Did you connect the grounded end of R1 to 0V (i.e. the midpoint of your two voltages)?
  • Did you passivate the unused op-amp in the packet (or is it oscillating the heck out of both)?
  • Did you put capacitors from the supply lines to ground?
  • Did you 'scope the output or did you just use a voltmeter?
You might have oscillations due to stray capacitance. Put a cap in parallel with the 470k resistor (20pF to 100pF should be suitable for 470k).

From what source does the 0.25V to 0.5V come?

Do you know how an op-amp work and what the term "virtual earth" means?
If you put 0.25V on the non-inverting pin, the op-amp will try its hardest to make the non-inverting pin the same voltage. That means you have 0.25V over the 100k resistor, which then carries 2.5µA to ground.
Since the two resistors are in series they will carry the same current (the input impedance is so high that it's negligible). Ohms Law on this: 470k * 2.5µ = 1.175V. Add the 0.25V at the bottom of the 470k resistor and the top side (the op-amp output) will be 1.425V.
Going the other way:  1.425V/0.25V=5.7 so Av=5.7

You will probably see a minor deviance, as the op-amp will have an input offset voltage of up to ~5mV, which is amplified Av times as well so expect a worst case offset of up to slightly below 30mV.

If you make sure the above points are followed to the letter, it will work.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline popcornhoboTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Op Amp Difficulties... PLZ Help!
« Reply #5 on: February 18, 2010, 08:21:44 PM »
now that i think of it, could it be the Vin that is causing the problem? It has no problem amplifying a 1.5v battery and when i bias my Vin with the 1.5v it will amplify the 1.5v but it won't amplify the swing of the voltage... i.e. say i multiply the voltage by 2, then the battery gets amplified up to 3v but my Vin only has a .25v swing as it did without the bias.

Here's some points to check:
Are you using a solderless breadboard?-- Yes
If not, then (even though you are The marksman with an iron) please check your solder joints with a magnifying glass and an ohmmeter.
Did you connect the grounded end of R1 to 0V (i.e. the midpoint of your two voltages)?-- yes
Did you passivate the unused op-amp in the packet (or is it oscillating the heck out of both)?-- i don't understand what this means.
Did you put capacitors from the supply lines to ground?-- yes
Did you 'scope the output or did you just use a voltmeter?-- voltmeter

From what source does the 0.25V to 0.5V come?-- it comes from a radio controller receiver.

« Last Edit: February 18, 2010, 08:37:32 PM by popcornhobo »

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Op Amp Difficulties... PLZ Help!
« Reply #6 on: February 18, 2010, 09:21:00 PM »
Hi,


now that i think of it, could it be the Vin that is causing the problem? It has no problem amplifying a 1.5v battery and when i bias my Vin with the 1.5v it will amplify the 1.5v but it won't amplify the swing of the voltage... i.e. say i multiply the voltage by 2, then the battery gets amplified up to 3v but my Vin only has a .25v swing as it did without the bias.
The 3V limit is, as I mentioned in my last post, because you're banging your head on the virtual roof of the chip. The output is not able to go to the positive rail.


Are you using a solderless breadboard?-- Yes
There's a reason I put that question first. Solderless boards are extremely error prone due to worn contacts - if you have any possibility to solder the circuit, the solderless boards makes nice paper weights  ;D


Did you passivate the unused op-amp in the packet (or is it oscillating the heck out of both)?-- i don't understand what this means.
Either ground both inputs, or to be absolutely positive it's taken care off, ground the non-inverting input and connect the inverting input to V+
Then you're sure the spare op-amp won't oscillate.


Did you 'scope the output or did you just use a voltmeter?-- voltmeter
Then you cannot see if there's oscillations, so place the cap over the 470k just to be sure.


From what source does the 0.25V to 0.5V come?-- it comes from a radio controller receiver.
Err??
I smell a rat here.
Is this perhaps measured from a servo output of an R/C-receiver?
If that's the case, forget about op-amp problems, you cannot use a servo output that way (at least not without a very hard to make integration of the signal.
The servo signal looks like this  __||__________________| |__________________||___
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline popcornhoboTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Op Amp Difficulties... PLZ Help!
« Reply #7 on: February 18, 2010, 09:38:08 PM »
Wow thanks for all the help! I've learned a bit more about op amps and I think we found the problem. It is a servo output of an r/c receiver. Live and learn... sense we are on the subject would i be able to integrate the signal with an op amp integrator circuit?

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Op Amp Difficulties... PLZ Help!
« Reply #8 on: February 18, 2010, 09:57:04 PM »
Hi,

[...] would i be able to integrate the signal with an op amp integrator circuit?
Not in a sense that it would be useable.
But why not build an ESC or... What do you want to drive with the output?
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline popcornhoboTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Op Amp Difficulties... PLZ Help!
« Reply #9 on: February 18, 2010, 10:27:45 PM »
well I would like to be able to read the value into a micro controller, and then have the micro controller run an esc with its pwm output.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Op Amp Difficulties... PLZ Help!
« Reply #10 on: February 19, 2010, 06:26:08 AM »
Hi,

well I would like to be able to read the value into a micro controller, and then have the micro controller run an esc with its pwm output.
Ah, then you should let the controller look at the line itself (perhaps with a transistor stage in between if needed).
The controller should measure the width of the pulse (~1ms to ~2ms with 1.5ms being the center/off value).
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline popcornhoboTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Op Amp Difficulties... PLZ Help!
« Reply #11 on: February 19, 2010, 03:22:54 PM »
Oh, well if I can read the value in directly then that would be way better. I will have to mess around with it tonight and see what I can do. I am using an Arduino ATmega1280 if you are familiar. Maybe you can point me in the right direction :) I was think about using PulseIn() but that sounds really inefficient
« Last Edit: February 19, 2010, 03:36:18 PM by popcornhobo »

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Op Amp Difficulties... PLZ Help!
« Reply #12 on: February 19, 2010, 03:46:34 PM »
Hi,

I am using an Arduino ATmega1280 if you are familiar.
Unfortunately not.


Maybe you can point me in the right direction :) I was think about using PulseIn() but that sounds really inefficient
If PulseIn() is anything like what originated on the Stamp and you have time in your code to wait for it to happen, that should be fine.
I assume it's getting the width in µs (or perhaps in units of 10µs) with a wait parameter to tell how long to look for the pulse to start - but you probably know how it works.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


data_list