1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Why Opamp with potentiometer?

Discussion in 'General Electronics Chat' started by sagh, May 5, 2014.

  1. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,572
    Likes:
    950
    Location:
    Canada, of course!
    The latest schematic shows a low power LM358, not a 741 opamp. The latest frequency is shown as 2kHz which might not be possible with an LM358 since it has slew rate limiting when its output is trying to be 20Vp-p.
     
  2. sagh

    sagh Member

    Joined:
    May 5, 2014
    Messages:
    211
    Likes:
    0
    I totally agree with you the output should be obtainable with 1v. I didn't still test input of less than 1v . with 1v input I got 0.5v at the output of one current mirror and almost 0.3v at the output of another current mirror. The output of both current mirrors were supposed to be 1v (when resistors at the output of current mirror and resistors at the output of first buffer were 10k). It's possible current mirrors can't handle it which is very strange to me. why? when the output of current mirrors aren't right the very last output voltage wouldn't be correct. this time I couldn't see the voltage of output because of some problems with my solderless breadboard. but I 'm sure about the voltages of current mirrors which don't work ok.

    In general with R4= R5= 1k(resistors at the output of current mirrors) and R2=R3=10k (resistors at the output of first buffers) I got results as they should be. I just wanted to change R4 and R5 to 10k to get a better gain. With these changes I have a gain of 10 in LTspice and it's very strange to me why can't I have almost same result in real life? I think I have to switch from solderless breadboard to PCB because most of my problem are because of my breadboard and jump wires I have to spend so much time to get this circuit working.

    I did this and had a gain of 10 from the below circuit. I guess 741 works ok my problem might be current mirrors.
     

    Attached Files:

    Last edited: Jun 18, 2014
  3. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,315
    Likes:
    1,230
    Location:
    Cardiff, Wales
    Breadboarding the circuit may well account for unexpected gain values. I just ran a sim with a stray 10 mΩ connected between the bases of the two transistors of a current mirror. The result was a ~50 dB increase of the common mode gain.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,572
    Likes:
    950
    Location:
    Canada, of course!

    Another problem caused by a solderless breadboard.
    In addition to intermittent contacts, interference pickup and oscillation.
     
  6. sagh

    sagh Member

    Joined:
    May 5, 2014
    Messages:
    211
    Likes:
    0
    I'm still thinking about what makes the output of current mirrors to have 0.5v while 1v is applied to non inverting terminal of one of first buffers and the non inverting terminal of other buffer is grounded. It's very strange why can't current mirrors handle changes in resistors value?
     
    Last edited: Jun 20, 2014
  7. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,572
    Likes:
    950
    Location:
    Canada, of course!
    1) Your transistors are not matched.
    2) Your transistors have different temperatures.
    3) Your resistors are not identical.
    4) A solderless breadboard has intermittent contacts and has the resistance of its tangled connecting wires.
    When you change the resistance in the emitter circuit of a transistor then its Vbe changes and its voltage gain changes a lot.

    An IC is made on a single wafer so the transistors are matched very well and are very close together so their temperatures are identical. Their connecting wires are extremely short with extremely low resistance.
    Frequently transistors and resistors on an IC are laser-trimmed so that their specs are perfectly identical.
     
  8. sagh

    sagh Member

    Joined:
    May 5, 2014
    Messages:
    211
    Likes:
    0
    This circuit has 4 npn transistors and 4 pnp transistors. I used one transistor array (Tpq2907) for pnp transistors and one transistor array (Mpq2222) for pnp transistors. So pnp transistors and npn transistors are matched.
     
  9. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,049
    Likes:
    961
    Location:
    NJ
    Hi,

    You have a problem, so something is wrong. When something is wrong it doesnt always obey basic theory because there is a fact or set of facts missing from all the arguments. To fill in the facts, you MUST make measurements.

    For example, there could be something wrong with one or more of the transistors in either IC. If that was the case then you would see a change in the current through the current mirror output(s).

    If there is something wrong with the output of the op amp, then test the op amp. Test it where it stands if you use a plugboard.

    As others have noted, when dealing with circuits that depend highly on exact voltages (current mirrors, op amps) a plugboard could mess everything up because there will be unknown small voltage drops in various places. I ran into this problem too when trying to calibrate a digital volt meter that was assembled on a solderless breadboard (plugboard). Even moving the breadboard around a little changed the reading because the wires would move ever so slightly, and that changed the voltages drops in various places in the circuit. It's impossible to do it on a plugboard because of this. The readings could easily change by 10mv, which is far too much for a digital volt meter that has to read 5 volts with 4 decimal place accuracy (like 4.675 volts for example). It's also too much for a current mirror, and can cause large offsets with op amps. Even thermal DC bias on some IC pins causes problems, even with excellent connections, because the offset is generated right in the wires, and it is DC not AC so that means we get an additional unwanted offset.

    As a test of the op amp input buffer, you can ground the center of the two 10k that are in series. See what happens.
    You should really try to start to think about how you can resolve these little problems yourself via making measurements. Think about what could go wrong, then make some measurements.
    If the op amp has an offset, it is caused by something. Make measurements until you find something that does not agree with theory, then investigate.
    Watch for intermittent results in the measurements which could indicate a connection is bad somewhere.
    Jiggle the wires around a little, see what changes in the measurements. Track it down to one wire or several wires. Build it on a real breadboard (soldered) if needed.

    You can also use a PC board with DIP patterns with sockets mounted on the board. You can plug in the IC's that way, and then solder leads to the PC board itself, making jumpers where needed. This isnt optimum either, but it's better than a solderless breadboard.
    The board is made with socket holes for the IC sockets, and breakout clad patterns for the IC's that break out the pins to individual solder pads. You can then solder to the solder pads using wires or components to make all the connections. With this arrangement when you move the board around not much changes, and the connections are better.
     
    Last edited: Jun 20, 2014
  10. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,572
    Likes:
    950
    Location:
    Canada, of course!
    Those transistor arrays are obsolete and have not been made for many years. Their datasheet does not say the transistors are matched and does not show matching spec's. The datasheet says that the darlington arrays have four separate chips. The datasheet does not say if the transistor arrays use a single chip or uses four chips.
     
  11. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,049
    Likes:
    961
    Location:
    NJ
    Hello again,

    Analog devices makes matched transistors on a single substrate. They make dual and quad types. Price starts at around 7 dollars USD for a dual or quad package, SMD type packages.

    The current package being used surely does not contain matched transistors. What the effects will be is more DC offset, but there may be a simpler problem with the op amp output so that should still be investigated.

    For an AC amplifier offset is not always a problem because there are usually coupling capacitors anyway. As long as the offset does not cause saturation of any stage.
     
  12. sagh

    sagh Member

    Joined:
    May 5, 2014
    Messages:
    211
    Likes:
    0
    Ok, I make measurments to find out what's wrong with the circuit. As op amps placed before current mirrors are working good I guess something weird happens in transistors of current mirrors. I would try to get the voltages of emitter-collector of transistors Maybe they are saturated due to the changes. Even though it's unacceptable to me. in practice every thing is messed up becase of changes in resistor values while in LT spice everything is ok.
     
  13. sagh

    sagh Member

    Joined:
    May 5, 2014
    Messages:
    211
    Likes:
    0
    You mean mpq2222 and tpq2907 don't have matched transistors, right? From what part of datasheet can I make sure transistor arrays contain matched transistors?
     
  14. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,049
    Likes:
    961
    Location:
    NJ
    Hi,

    About the mismatched transistors...
    You have to buy transistors that say they are matched on the data sheet. Take a look at MAT14 for example made by Analog Devices.
    But there could still be another problem other than that.

    About the spice programs...
    Well in any spice program assumptions are made about the parts in order to provide a working environment that in spite of the assumptions is still able to tell us important things about a circuit. By using typical parts, we can still study the effects of changes in those assumptions simply by altering the components of the models or even the external parts. In this way we can get familiar with the circuit in a way that would be much harder without the spice program. Think a resistor value that is off by 1 percent is messing things up? Change it in the spice circuit and see if you get the same results with the simulation as you did with the messed up measurement in real life. Want to know how the mismatch of transistor emitter base junctions affects the output? Add a tiny battery of 1 to 10 percent of the voltage of the typical base emitter voltage in series with the base then ask the question: "How much does this change my circuit output?". If the answer is: "A lot" then you might be in trouble with the circuit, but if the answer is: "Not too much" then you might be ok with it. The answer could even be: "It changes a lot, but i think i can try doing this other thing that will help compensate for the mismatch". Here a little inventiveness wins the day, but it is also possible that it could be very hard to fix in another way so we might need matched transistors after all.
    A mismatch in some components is sometimes hard to fix. Perhaps look at the internal schematic of an op amp that has offset null input terminals.
     
  15. sagh

    sagh Member

    Joined:
    May 5, 2014
    Messages:
    211
    Likes:
    0
    What do you mean? what problem?
     
  16. sagh

    sagh Member

    Joined:
    May 5, 2014
    Messages:
    211
    Likes:
    0
    Resistor value mismatch doesn't change the simulation result. Adding a battery (0.06v) does change the result a lot but I'm not 100 percent sure that I place the battery as you meant.
     
  17. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,315
    Likes:
    1,230
    Location:
    Cardiff, Wales
    Eh? Mismatching the input resistors (10k) by 10% results in a ~100 dB change in the common mode gain at low frequencies !!
     
  18. sagh

    sagh Member

    Joined:
    May 5, 2014
    Messages:
    211
    Likes:
    0
    I changed them by 1% not 10.
     
    Last edited: Jun 20, 2014
  19. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,049
    Likes:
    961
    Location:
    NJ
    Hi,

    Another problem such as like we talked about, the connections on the plug board not being very good.

    A mismatch in only one of the input resistors by 1% would cause a CMRR of 46db, which is less than what the data sheets says for most of the op amps we've looked at so far. That means we would not be measuring the CMRR of the op amp, we'd be measuring the CMRR caused by the resistors mostly. And that's with a perfect op amp. So we'd turn a perfect op amp into an op amp with CMRR only 46db just by changing one resistor. You can see why this is so important.

    If you want to match sure the resistors are matched then get some 0.1 percent resistors or else if you have a bunch of resistors of the same value you can go through them and match them using a good Ohm Meter or a voltage divider. Find at least two sets of two that are very very close in value.

    For your convenience, here is the transfer function for the single op amp set up as differential amplifier with a finite open loop gain Aol:
    Vout=(Aol*(Va*R2*R4-Vb*R2*R3+Va*R2*R3-Vb*R1*R3))/((R2+R1)*(Aol*R4+R4+R3))

    and here is the same with infinite open loop gain (for other theoretical purposes):
    Vout=(Va*R2*R4-Vb*R2*R3+Va*R2*R3-Vb*R1*R3)/((R2+R1)*R4)

    where
    R1 is the input resistor to the non inverting terminal,
    R4 is the input resistor to the inverting terminal,
    R2 is the resistor that goes to ground,
    R3 is the feedback resistor,
    Aol is the open loop gain,
    Va is the input voltage to the non inverting input,
    Vb is the input voltage to the inverting input,
    Vout is the output voltage.

    Those expressions allow us to examine the effects of any mismatch condition without needed a simulator.
    We could do the same for the current mirrors, but that's a little more complicated because we need the expressions for the transistors.

    BTW, thanks to whomever changed the title of this thread for the spelling error. I was so sick of seeing the incorrect spelling ha ha :) Thanks.
     
    Last edited: Jun 21, 2014
  20. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,315
    Likes:
    1,230
    Location:
    Cardiff, Wales
    Even that will certainly change the CM gain. LTspice shows a CM gain increase at 100Hz of ~85 dB when the input resistors are mismatched by only 0.1%. In real life, matching all discrete gain-affecting components to better than 0.1% will be very difficult.
     
  21. sagh

    sagh Member

    Joined:
    May 5, 2014
    Messages:
    211
    Likes:
    0
    I would try to increase the gain of circuit by means of last stage I'm going to change 10k to 100k so at this stage I have two 1k resistors and two 100k resistors. No matter what happens to cut off frequency of this circuit. I just want to get gain of 10.
     

Share This Page