Differential amplifier

Discussion in 'General Electronics Chat' started by m121212, Jul 28, 2011.

  1. m121212

    Thread Starter Active Member

    Jul 24, 2011
    71
    0
    I was having a little difficulty debugging a diff amp today thought maybe the forum could help.

    I have a textbook diff amp with a gain of 7, based on an LM324D, configured as shown in the drawing.

    The supplies are set to +12 and ground.

    The input is a sense resistor that's carrying between 0 and 20 amps, or between 0 and 20 mV across it's terminals.

    For debugging, I left out the source resistor, and connected the input voltages to a function generator set to 1kHz sine wave, 40 mVpp, and 20mV DC offset.

    I wasn't able to get a scaled version of the input at the output of the diff amp. I just got some strange noisy signal.

    I tried using a larger input signal, but this did not solve the issue. The datasheet for the TI lm324d says "Common-Mode Input Voltage Range
    Includes Ground, Allowing Direct Sensing Near Ground."

    The remaining opamps in the quad pack are used in following stages, or have their inputs properly terminated.

    Any debugging ideas would be greatly appreciated!

    Thanks
    m121212
     
  2. PeeSeeBee

    Member

    Jun 17, 2011
    43
    7
    The feedback should go to the inverting input. You have your input terminals transposed.
     
    m121212 likes this.
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    And once you straighten out those terminals it still ain't a gonna work, as it will then be an inverting amplifier attempting to output 0.02 * -7 = -0.14 volts, which is a bit outside of it's single supply range of zero minimum.

    As the sense resistor is connected to your common ground you don't need a diff amp there, a simple non-inverting amp will do. You'll have to change the FB resistor to 6K to get the same gain.
     
    m121212 likes this.
  4. m121212

    Thread Starter Active Member

    Jul 24, 2011
    71
    0
    Thanks for your replies!

    After looking at your comments, I realized that I sent you an incorrect schematic. The corrected schematic is attached.

    The non inverting input is on the high side of the sense resistor.

    My concern is that the 20 mVpp (or 40 mVpp with the function generator) is too small to amplify in this configuration. I will check if we have better luck with a larger voltage.

    Any other ideas?
     
  5. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    LMV324 has a maximum power supply voltage rating of 5.5V. If you want to use 12V, you need to switch to LM324 or some other op amp.
    Input offset voltage will be a potential problem (no pun intended).
     
    m121212 likes this.
  6. m121212

    Thread Starter Active Member

    Jul 24, 2011
    71
    0
    When I put in a 1 Vpp with 0.5 V offset, I get a signal that looks like it was scaled by 7 at the output.

    There is some saturation on the low side at 340 millivolts. Now it makes sense that the 40 mVpp * 7 signal wasn't showing up at the output.

    I tried to find some indication of this on spec sheet, but wasn't sure which electrical characteristic defines how low the output can go with respect to the bottom rail. The spec sheet is here: http://focus.ti.com/lit/ds/symlink/lm324.pdf

    I will try to make the bottom rail go much lower than zero, hopefully that will fix things.
     
  7. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    So you are not using LMV324? Please try to make your schematic accurate before posting it.
    Input offset voltage might still be a problem. You might get lucky on a one-off.
     
    m121212 likes this.
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    [eta]
    I didn't see Ron_H's post before I wrote the following. I saw LMV324 in the schematic, so was referring to that opamps' datasheet instead of the LM324. Your results will not be good with the LM324; even with a large feedback resistor the output response near ground won't be very linear.

    One problem you'll encounter is the input offset of the opamp. It's usually somewhere around 2mV for this opamp, but it may be as high as 9mV over the full temperature range, making it difficult to subtract the output offset. Keep in mind that the input offset is multiplied by the gain.

    Another is that when you are right up against the power rails, even very small current requirements cause the amplifier to not be able to reach the rail. You're using 1k/7k resistors; if you increased them by tenfold you'd reduce the output current requirements by the same factor.

    At any rate, you need to know what your precise output voltage is when the input is grounded (0v reference), and then what your output voltage is when your input is at the maximum that it will be.

    Then go here:
    http://focus.ti.com/docs/toolsw/folders/print/resistor-calc.html
    and let the free calculator tell you what values to use. Select the E96 values, as you want the best accuracy that you can get.

    You click on the link that reads: "Initiate RESISTOR-CALC" above the "Order Now"

    You're going to need a precision positive voltage reference in order to be able to compensate for the input offset voltage using that opamp, as there is no method provided to otherwise adjust the offset. If the voltage reference is not precise, it will throw your readings way off.

    After you've obtained the resistance values needed, you can use this calculator to see what resistors you will need to to put in series/parallel combinations to get the required resistance:
    http://www.qsl.net/in3otd/index.html

    If you want this circuit to be more accurate over temperature, you are going to need a better opamp to start off with that has a much lower offset.
     
    Last edited: Jul 28, 2011
    m121212 likes this.
  9. m121212

    Thread Starter Active Member

    Jul 24, 2011
    71
    0
    Thanks again for all the responses. Sorry for being unclear on the schematic; I'm using the LM324D. Adding that part in EagleCAD puts an incorrect label on the drawing; I will try to fix that.

    Moving to dual supply rails (+/- 12v) solves all of the problems you described. Thankfully I don't have to worry too much about the input offset in this application.

    Your description of compensating for input offset is still very useful. I can probably refer back to this in the future for applications where accuracy is more important!
     
  10. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    7 millivolts of input offset will look like 8 amps of input error.
     
    m121212 likes this.
  11. m121212

    Thread Starter Active Member

    Jul 24, 2011
    71
    0
    You mean 7 mV input offset will look like 7 amps of input error?

    That's true; but this is just one of the gain and shift stages in a larger circuit. Later, I have some comparators with potentiometers that allow for an adjustment of levels.

    I'm not building a measurement device; I'm just monitoring some levels to see if they cross a threshold. That threshold can be set arbitrarily with a pot, so I have some flexibility in the behavior of the op amps.
     
  12. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    And of course you have someone to adjust the pot when the offset voltage changes, correct?
     
    m121212 likes this.
  13. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    No, I mean 7mV input offset will look like 8 amps of input error. Do the math.
    Input offset drift is 30uV/°C max, which translates to 240ma/°C max.
     
    m121212 likes this.
  14. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    m121212 likes this.
  15. m121212

    Thread Starter Active Member

    Jul 24, 2011
    71
    0
    Excellent advice. Thanks again for the tips.

    In what configurations would one not have to worry about input offset? If it's always an issue, does that make the 324 a poor general purpose amplifier?
     
  16. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    "General purpose" should not be confused with "every purpose." It has more meaning if used as synonymous with "non critical."

    A .001 ohm resistor means you are seeing 1mV per amp, and you need an offset insignificant when compared to that voltage. Sarge found one nice amp, I am sure there are others.
     
    m121212 likes this.
Loading...