Op amp and MOSFET oscillation

Discussion in 'Analog & Mixed-Signal Design' started by ebeowulf17, Aug 9, 2018.

  1. ebeowulf17

    Thread Starter Distinguished Member

    Aug 12, 2014
    2,568
    475
    So, just for fun and mental exercise, I'm experimenting with designing my own MOSFET based regulator. It's mostly worked, except that I had weird oscillations that I can't make sense of. Adding a resistor eliminated it, but I don't understand why. Is this a realistic outcome, or an artifact of me not simulating this properly? Assuming this is a logical behavior, can you give me some insights into why? I imagine this is probably well documented, so if you would prefer to point me to existing documents instead of spelling it all out for me, I welcome that.

    Here is the circuit when it's oscillating:
    Voltage-Reg_scratch_06b-1.png

    Here's a closer detail of the oscillation at its worst:
    Voltage-Reg_scratch_06b-2.png

    And here's the cleaned up version with just one extra resistor:
    Voltage-Reg_scratch_06.png
     
  2. ebp

    Well-Known Member

    Feb 8, 2018
    2,245
    784
    Old saying: "If you build an amplifier it will oscillate and if you build an oscillator it will amplify."

    Youse is playin' a game o' noughts an' crosses an' losin'. Poles and zeros. You have one and need the other. This is "classical" closed-loop control system behavior. What you are seeing is real.

    Try doing some frequency response plots. Also do transient plots and look closely at not only the final output but what the op amp is doing. These should give you some clues. You may find it helpful in transient runs to simply fix the input voltage and put step changes in the output resistance (i.e. a steady resistive load in parallel with one that is switched in and out) to "perturb" the system - force it to react so you can zoom in on the behavior when it does.
     
    ebeowulf17 likes this.
  3. ebeowulf17

    Thread Starter Distinguished Member

    Aug 12, 2014
    2,568
    475
    Sweet, I'll try the frequency response plots first and see what I can see.

    Also, just to clarify, I didn't doubt that the oscillation was realistic - I'm just amazed that such a tiny amount of resistance could make such a big difference in trying to eliminate it! Maybe when I get a better handle on how and why the oscillation is happening in the first place, it'll become more obvious why such little resistance seems to go a long way!

    Thanks!
     
  4. danadak

    Well-Known Member

    Mar 10, 2018
    1,907
    395
    Two issues -

    1) Primary issue is that OpAmp is not designed for large Cload, which the
    MOSFET gate presents, typically 640 pF. So a few ohms in series with
    OpAmp out and Gate would definitely help.

    2) You addition of an R in series with output load helps to decouple the large
    Cload, C1, 10 uF, which affects loop phase margin.

    Regards, Dana.
     
  5. crutschow

    Expert

    Mar 14, 2008
    20,245
    5,732
    Most op amps are internally compensated to be stable with any amount of negative feedback, but the MOSFET's extra gain plus the phase shift from the output capacitor means the compensation is now marginal to maintain stability.
    You need some addition external compensation.
     
  6. danadak

    Well-Known Member

    Mar 10, 2018
    1,907
    395
    If you look at this OpAmp open loop vs freq response, looks to be
    single pole response. But then this graph very telling -

    upload_2018-8-9_19-10-48.png

    Looks like Zo of OpAmp with the 100 pF load is staring to cause issues. In
    fact the SS transient response shows some onset phase margin problems.
    Now add to that another 600+ pf load (MOSFET Gate C) onto the output
    Zo of OpAmp and you can go to the bank its going to, at best, have very lousy
    SS response. Eg. lots of ringing, etc..

    And then add the bulk cap reflected back thru MOSFET and even more
    lost phase margin.

    Regards, Dana.
     
  7. ebp

    Well-Known Member

    Feb 8, 2018
    2,245
    784
    One thing to try with the resistor is to move it from where it is to being between the bottom of the output capacitor and common. It isn't quite the same circuit, but close. In the new position, it is more conspicuous as being capacitor ESR, which puts a zero in the filter. Of course it makes no difference which side of the cap the resistor is on.

    Your circuit isn't terribly different from some low-dropout regulators. Some of the middle-generation types were extremely fussy about output capacitor ESR. If the ESR was either too high or too low, stability was compromised. Newer ones generally have an upper limit on ESR but not a lower limit, so you don't have to fiddle about selecting just the right capacitor or actually adding a discrete resistor in series with the cap. When tantalum caps were commonly used it wasn't too difficult to find one with the right ESR. When SM ceramic caps in "high" values became popular and cheap, ESR choice vanished.
     
  8. ebeowulf17

    Thread Starter Distinguished Member

    Aug 12, 2014
    2,568
    475
    Very interesting! I'll try the alternate resistor placement and see how it reacts. Hadn't thought about the ESR - it's so easy to forget important details when modeling circuits! It would be nice to get the anti - oscillation resistor out of the power path.

    As for this circuit's resemblance to an LDO regulator, I'm glad to hear it. That's what I was shooting for, but I wanted to do it from scratch just as a mental exercise. If I needed one for a critical application, I'd buy the right IC for the job, or refer to app notes... but just for fun I wanted to see how far I could get this one on my own.
     
  9. Bordodynov

    Well-Known Member

    May 20, 2015
    1,983
    598
    I agree with Danadak. When I made a four-channel stabilizer (1.5V, 3V, 5V and 6V), I set a ceramic capacitor 10μF for each output and a 0.1 ohm resistor in series with it.
    Unfortunately, not all spice models of operational amplifiers correctly reflect the output impedance and one can get a not reliable result.
    See
    2018-08-10_08-37-34.png
     
  10. ebeowulf17

    Thread Starter Distinguished Member

    Aug 12, 2014
    2,568
    475
    This is cool - lots of great info here. I have a lot of reading and studying to do! Prior to this thread, I'd never heard of "poles and zeros." l was vaguely familiar with single vs. multi-pole filters, but without really understanding what it meant.

    I've done a bunch of searching and found lots of articles on poles and zeros, as well as some app notes on op amp compensation and stabilization.

    In addition to the obvious electronics applications, it looks like understanding system response feedback loops in these terms might help me better understand other closed loop systems. I'm very interested in pressure/flow/temp control systems, especially fuzzy logic. If l can apply these same concepts to those systems, it should dramatically improve my ability to code control systems.

    Looks like there's no need for calculus (whew!) but plenty of algebraic transformations to wrap my head around. I'm way out of practice, so the math all looks daunting, but not impossible.

    Anyway, thanks for all the great responses so far. If you have any specific article or app note recommendations for a beginner like me, I'll check them out. If not, I'll keep muddling through the ones I've already found.
     
  11. ebeowulf17

    Thread Starter Distinguished Member

    Aug 12, 2014
    2,568
    475
    Moving the resistor works great! I didn't have time last night to get into frequency response plots or get a better look at the timing and phase relationships involved, but will try to dig deeper this weekend. Thanks!
     
Loading...