I've designed the following amplifier circuit to amplify a DAC signal (sorry for the non-standard opamp symbol):

enter image description here

It's a power amplifier which amplifies a microcontroller DAC signal 0-5VDC and very low current, to 0-22VDC, with current draw up to 2.5A. That would be a gain of approximately 4.4. The input voltage only changes several dozen times per second. Let's say 100Hz to be safe. But it needs to operate over a wide range of (fluctuating) loads. Load could be from 5 ohms to 5 megaohms for example.

It simulates just fine with the default PMOS component, which I suppose is an ideal FET. But when I add all "real" components in, I get oscillation occuring. How might I stabilize this? How accurate is a simulation in such things compared to a real circuit?

Is there anything else that looks like it could be an issue in this circuit, for example part choice, voltages, etc?

LTspice v4.22s schematic download: enter link description here


I've made some changes based on mostly trial and error, but educated by the replies below. I managed to remove the oscillation fairly quickly, but, I have no idea why adding a capacitor in each of these locations solved the problem. I needed both of them, and I needed to fine tune their values a bit.

Greatly reduced oscillation using a combination of ideas

This is for a power supply so the new voltage spike at the beginning is rather disastrous. Here is a closeup of it now with a resistor added in series with C1 to stop it oscillating:

Closeup of voltage spike

  • \$\begingroup\$ Please add the characteristics of your amplifier (gain, bandwidth ...). \$\endgroup\$ – MAC Feb 26 '15 at 6:42
  • \$\begingroup\$ Added above, just below the screenshot of LTspice. \$\endgroup\$ – Ryan Feb 26 '15 at 6:47
  • \$\begingroup\$ I'm not sure how to make the screenshot be able to zoom in, but I can view the full size if I right click it and go to "open image in new tab" in Chrome. \$\endgroup\$ – Ryan Feb 26 '15 at 6:51
  • \$\begingroup\$ Add the spice file, will help us to simulate and check the output \$\endgroup\$ – AKR Feb 26 '15 at 6:53
  • \$\begingroup\$ R4 appears non-productive (remove it) -> It causes 10 x (OpAmp_out - Vbe_Q1) to appear on the MOSFET gate. That's fine if you are using that as your main means of getting something like 10 x Vin at the output and the output is a current amplifier - as was the case in your prior question and circuit - BUT you are now using "proper" voltage feedback via R3 / R2 and the two methods are fighting AND the MOSFET is not a current amplifier per se so the two are fighting. | So remove/short R2. Later you may want a resistor in Q1c and a zener clamp on the PFET gate but probably OK without for now. \$\endgroup\$ – Russell McMahon Feb 26 '15 at 9:59

A bare bones OP-AMP is "close-to-unstable" in a lot of circumstances (even in very simple circuits). There is a parameter called phase margin and this informs the reader that at unity gain, the inverting input is significantly close to being non-inverting - phase margin tells you how close the inverting input has become a non-inverting input.

For instance, a typical op-amp might have a phase margin of 40 degrees. This means that instead of the inverting input producing a 180 degrees shift (i.e. true inversion) it is more like 40 degrees.

This of course will be at a high frequency where the op-amp's characteristic has dropped to unity gain i.e. far above where you would consider using it normally. But it's still there in any op-amp circuit you might design.

If you add transistor amplification (say 20dB) after the op-amp output (and before the feedback), you will now have a phase margin that is 40 degrees at a gain of 20dB and, if you determined what the phase margin is at a higher frequency (one where the extra 20dB is eroded to zero dB) you'll almost certainly find that the phase margin passes thru zero degrees and therefore you have created an oscillator!!

Here is a similar question/answer

EDIT - I've added a picture of the open-loop gain and phase of a medium speed op-amp to consider: -

enter image description here

This graph is the basic operation of the op-amp in question (AD8605) and is irrespective of how you apply feedback and how much you apply. The only point is that the red line (gain) will rise maybe 10dB when you put transistors within the feedback loop.

With the red line rising by 10dB, the unity gain crossing point is around 30MHz - what is the new phase margin - it's probably about -40 degrees i.e. well past the point of stability. Look at the graph - with sufficient gain added inside the feedback loop, this device (AD8605) will oscillate at about 25MHz.

Lower the gains in your transistor circuits is my advise.

  • \$\begingroup\$ Hmm, this seems like really good advice. Reading the link you sent, I think I largely understand it. However, what I don't understand is what they call "frequency". Isn't my frequency always below 100Hz, in that case the entire issue is a non-issue? If not, how can I calculate the frequency? \$\endgroup\$ – Ryan Feb 26 '15 at 9:55
  • 1
    \$\begingroup\$ Your desired operating frequency may be quite small and easily dealt with by an op-amp but the op-amp doesn't respect or know your circuit aims; it just does what it does best. It doesn't understand that you have added transistors to it's output and it doesn't know it isn't meant to be an oscillator. \$\endgroup\$ – Andy aka Feb 26 '15 at 10:13
  • \$\begingroup\$ How can I decrease the gain of the transistors? I don't exactly understand how I'm controlling their gain at all. If this graph means anything, the transistors are adding a lot more than 10dB: i.imgur.com/hvfqtOD.png \$\endgroup\$ – Ryan Feb 27 '15 at 2:13
  • \$\begingroup\$ I'd use an emitter resistor in Q1 - this will dramatically reduce the gain of Q1. Why on earth do you have that capacitor in series with the gate - this will prevent the circuit operating correctly because there is no DC control in the loop. \$\endgroup\$ – Andy aka Feb 27 '15 at 11:42
  • \$\begingroup\$ Simply because after hours of trying different things, it's what worked. In the simulator at least adding a capacitor on the emitter of Q1 doesn't really have an effect. In fact, Russell told me to remove that entirely (it's there on the original schematic above) \$\endgroup\$ – Ryan Feb 27 '15 at 14:06

The LM358 device is unity gain compensated. That means: This opamp is stable down to unity gain with a stability margin which will be "acceptable". Unity gain is identical with loop gain=open-loop gain of the oamp (due to 100% feedback). However, in your case, the loop gain is even larger than the open-loop gain of the opamp (feedback factor with gain). In addition, both transistors add phase shift to the loop which is very critical. Thus, no surprise that the circuit oscillates.

You can stabilize the circuit connecting a R-C series combination BETWEEN both input terminals of the opamp. The corresponding values values depend on the real frequency response of your cicuit (loop gain). Therefore, can you show the simulation of the loop gain response?

  • \$\begingroup\$ Sure here is a zoomed in version i.imgur.com/VyCq6zs.png \$\endgroup\$ – Ryan Feb 26 '15 at 10:15
  • \$\begingroup\$ So around 30Khz? Here's an FFT, there are also some harmonics going up approx 30Khz each band i.imgur.com/CMRDxDo.png \$\endgroup\$ – Ryan Feb 26 '15 at 10:17
  • \$\begingroup\$ Am I trying to implement a filter like a Sallen-Key low pass filter to remove the high frequency components? When I try to add filtering like you say, it just shifts where and how frequent those oscillation frequencies occur, but they don't seem to diminish. \$\endgroup\$ – Ryan Feb 26 '15 at 10:30
  • \$\begingroup\$ No - filtering does not help at all. You must inhibit oscillations from the beginning (loop gain compensation). \$\endgroup\$ – LvW Feb 26 '15 at 10:53
  • 1
    \$\begingroup\$ Ryan, an ac analysis is a small-signal analysis in the FREQUENCY domain. Here, the frequency is tuned from low frequencies (1Hz or so) to very large frequencies (100 MHz). Use log. tuning and 100 points/decade. Try to become familiar with the simulator options! \$\endgroup\$ – LvW Feb 26 '15 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.