Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Op-amp Circuit with virtual Ground

  1. Mar 26, 2015 #1
    Hi everyone,
    I'm trying to implement the attached circuit. (the .txt is for http://www.falstad.com/circuit/)
    Since I only have a single power supply and I ultimately want to drive this with a battery I am powering the opamp with a virtual ground.
    Using a voltage divider to achieve this.
    Opamp VCC+ connected to + of power supply
    Opamp VCC- connected to - of power supply
    Ground in circuit connected to middle of voltage divider.

    The problem I am having is when I turn the circuit on, the output correctly outputs for about 1/4 of a second and then gets stuck high. As far as I can tell the circuit is wired correctly, and I am at loss what could be causing this behaviour.
    Hoping someone might be able to point out the errors of my way.
    Is what I'm trying to do even possible??
    Thanks :)

    *edit* the output of the left and middle op-amps are supposed to be sin waves, according to Falstad they are about 1.4mV p-p
    The right most op-amp just amplifies the signal to a level that I can use.

    Attached Files:

  2. jcsd
  3. Mar 26, 2015 #2


    User Avatar

    Staff: Mentor

    Why does the right-most opamp have positive feedback? Are the +/- terminals reversed?

    What do you want to do with this circuit? Virtual grounds are a pain, IMO. Much better if you can use single-supply opamps and keep the signal between the power rail and ground...
  4. Mar 26, 2015 #3


    User Avatar
    Science Advisor

    If this is just two resistors, that is probably your problem. The virtual ground needs to be very stable. I would use a fourth op-amp connected as a buffer to produce the virtual ground.
  5. Mar 26, 2015 #4
    Thanks for the suggestions Berkeman,

    I'm trying to build a circuit to generate an AC current so we can field test current sensing Toroids so we can fully commission stuff.
    They get tested prior to leaving the panel shop with an AC power supply but then the panels will quite often sit out in the field for months before they are ready to be used.

    Svein I actually have capicitors across the resistors to help smooth out noise. Not sure if that would help the ground remain stable (read that off of a circuits forum about using virtual grounds)

    Tinkering with the circuit I think I've figured out my issue. One of my 10uF capacitors is bad. I swapped them for 1uF ones and the circuit operates as intended, just at a higher frequency
  6. Mar 26, 2015 #5


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    Just for future reference, In this case, noise isn't the issue. Voltage stability, specifically the lack of, when using a resister divider is the issue
    the + or - voltage rails will continually fluctuate with every variation in current that the 2 rails draw. This is why voltage regulator IC's are used
    so as to produce a stable voltage over a range of variations of current

    if this circuit you are doing is to become a permanent one, rather than just an experimental setup, I would strongly suggest you
    consider the use of regulators

  7. Mar 27, 2015 #6
    I get that voltage regulators would be a better choice. If they decide that this is something that they'll use I'll look into a more proper way to do it.
    I am a little confused about the voltage stability. I understand why they rails fluctuate. But do the cap's across the resistors not help smooth that out?

    I attached a little (cheap and portable) Oscope across the + and neutral rails with out the 47uF Caps across the resistors in the voltage divider:

    With the caps

    I'm just making sure I understand what is going on :) I worked with 1 lab partner through all of school. He was the circuits guy, I was the math and programming guy :)
    On our last design project we had 2 12v batteries arranged to get +12, -12 volts. My partner used a regulator to give us a +5v rail, but then still had caps across the +5 and neutral rails. When I asked about it, he implied that it was to help compensate for the fluctuations due to varying draw on the rails.

    Thanks for all your help :)
  8. Mar 27, 2015 #7

    jim hardy

    User Avatar
    Science Advisor
    Gold Member

    The trouble with a resistive divider is when any current flows into or out of that virtual ground , it loads the divider shifting the voltage away from halfway between rails.. That gives unwanted feedback.

    One fix is to connect to your divider an opamp wired as follower, use output of that amp as virtual ground. It'll handle a few milliamps without shifting.
    Another is to use an audio amp like LM833 . It automatically sets its output pin halfway between rails and will handle a few amps of current.
    http://www.engineering.uiowa.edu/sites/default/files/ees/files/NI/pdfs/00/71/DS007145.pdf [Broken]
    Last edited by a moderator: May 7, 2017
  9. Mar 27, 2015 #8


    User Avatar
    Science Advisor

    That's called an oscillator.

    Irrespective of any issues with the voltage divider ground, I don't see any way that the original circuit you posted can work. It has (approx) infinite gain positive feedback at DC.

    You should take a look at the circuit for a "Wein bridge" oscillator, it's has a very simple single opamp implementation. I've used it in the past, and with a jfet (as a voltage variable resistor) to stabilise the gain/amplitude it was very reliable.
  10. Mar 27, 2015 #9


    User Avatar
    Science Advisor

    That is "Wien bridge" (Wien = Vienna, Wein = wine).
    There is nothing essentially wrong with the circuit (except for problematical virtual ground). It is called a state-variable oscillator. The positive feedback on the rightmost op-amp creates a comparator with hysteresis, so he gets a square wave out.
    One small reservation: Most state-variable oscillators I have seen are slightly more complicated (Google "state variable oscillator circuit").
  11. Mar 27, 2015 #10


    User Avatar
    Science Advisor

    Yes I understand that. I still think that there is a problem with the implementation (as shown in the cct diagram in the op), due to the DC positive feedback. Just because it's a state variable implementation doesn't change the fundamentals regarding stability.

    EDIT: Whoops I just took another look at the circuit and it's not positive feedback. Late at night here, and for some reason when I first looked at it I thought there was "double inverted" feedback. But now that I look again I see that the first stage is non-inverting in regard to the feedback signal. My mistake.
    Last edited: Mar 27, 2015
  12. Mar 27, 2015 #11
    Thanks for all the feedback, if it turns out that they will actually use this in the field I will implement the proper way.
    I just have a feeling this is something that the field guys say they will use but never actually end up using. Hence why I wanted to spend no money (for additional components) and little time on it.
    The oscillator works well enough despite being held together with chewing gum and duct tape (lol its in a prototype board currently)
  13. Mar 27, 2015 #12


    User Avatar
    Science Advisor

    To be honest I've used a voltage divider ground (capacitor bypassed) like that many times without any issues. Particularly in an application like this, where the load current is ac. As long as you have capacitors in parallel with the voltage divider resistors so that the ac impedance of the ground is low, then it can work well. :)
  14. Mar 27, 2015 #13


    User Avatar
    Science Advisor
    Gold Member

    I would not rely on that circuit at all. In theory the 2 op-amps on the left will be stable. Together they have a gain of one at DC and much less than a gain of one as the frequency goes up. What's up with the output taken from the left op-amp? The problem with that if you really want it as an output is that when 2 separate op-amps are used together to form the negative feedback there really is no guarantee what the voltage is between stages. Suppose for the sake of argument that the open loop gain of the first stage is around 100 (seriously exaggerated low for the sake of discussion) and the second one has an open loop of 100,000. It all works out in the end with the feedback as far as the last op-amp in the chain goes but the voltage at the output of the first op-amp will be different if the op-amps were swapped even though together they have a stable gain.

    The right most op-amp does in fact form a schmitt trigger with the positive feedback. I suspect what you see on the scope is an UNWANTED oscillation. I have made oscillators similar to this but in order to do so the output of the schmitt trigger has to feedback to something. Basically you want to form a triangle wave generator using something similar to the left op-amp in the schematic and use the output of the schmitt trigger to drive the input of that. Off the top of my head you may need to invert the output of the schmitt trigger before it drives the triangle wave generator. The circuit posted does not even look like an oscillator to me. I looked a long time at it but I can't see an oscillator.
    Edit: Doing it the way I described shouldn't require any virtual ground.
  15. Mar 27, 2015 #14
    The left most output isn't being used. I started with Falstad's Sine Wave Generator which has a sine and a cosine output. One of which i've used as an input to the third op-amp. The other isn't being used for anything. I realize that if I use it to drive something it'll will affect the operation. I should've removed it from the schematic prior to posting :)
  16. Mar 27, 2015 #15


    User Avatar
    Science Advisor

    This type of circuit is sometimes seen where sine wave and square wave signals are needed.

    The left two op-amps make a phase shift oscillator with sine wave output. The amplitude is limited by symmetrical clipping at the op-amp power supply voltage rails. There will be some harmonic distortion of the sine wave as a result.

    The right hand side op-amp is a schmitt-trigger producing a square wave with amplitude, again set by the op-amp power supply rails.

    The sine wave oscillator employs three equal phase shifts, each of 60°. Each RC integrator is buffered or lightly loaded, so the frequency will be largely independent of the power supply voltage. As designed there is a phase shift of about 60° plus the schmitt-trigger hysteresis delay between the sine and square waves.

    If the left hand op-amp is removed then the remaining middle op-amp should be rewired as a Sallen-Key two pole low pass filter with the third pole in the feedback loop, or the sine wave oscillator should become a Wien Bridge circuit.

    How best to design the circuit would require specification of the frequency, purity, phase and amplitude of the required signals.
  17. Mar 27, 2015 #16


    User Avatar
    Science Advisor

    Ok, so you're not using either of the (quadrature) sine wave outputs. In that case there are much easier ways of building a square wave oscillator.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook