• EEVblog #95 – Linear Regulators, Closed Loops, Simulations, & Brand Shenanigans

    A bit of a follow-on from the linear regular episode. Dave dances with a simple linear closed loop circuit he built, and bodges it up in LTspice to get a remarkably consistent result.
    Not really a tutorial, just a few random tidbits.

    Be Sociable, Share!

      About EEVblog

      Check Also

      EEVblog #961 – Monkey Debouncing

      How do you debounce a clapping monkey? Probes The Monkey makes his return. All about ...

      • G’Day Mate!! Great tips about changing components in the design of a circuit.
        This is been an issue for me lately, because here in Argentina, due to government import restrictions is getting NEAR IMPOSSIBLE to get certain parts from the local electronics stores, so I constantly have to use replacements, different brands, slightly different values of resistances, capacitors, etc. The result of these changes goes from a non working circuit to a barely usefull one in the best case scenario.
        The alternative of course is to simply get the parts from digikey or mouser, but not for us here in south america, because you have no certainties that those parts are going to pass the customs without you having to pay an astronomic sum of money.
        So, the conclusions:

        3- this import restriction thing REALLY TICKS ME OFF!!!, F..K THE GOVERMENT!!

        Over and out
        The Ranting Argentinian.

      • karma

        Great vdo Dave.
        Just let you know that it would be great if someday you do a tutorial about electronics simulations (any flavour of SPICE or similar) including recommended sw.
        Congrats again.

        • Consider it “on the list”.

          • Jay

            I have been watching some EE 40 lectures from UC Berkeley, and they tell their students to use LTSpice to do their homework. It’s free, and I think it would be cool to have some video tutorials around showing people how to get started with it.

            But what university students really need is an experienced pro showing them how Spice FAILS, so
            they will not trust it too much!

        • Great suggestion Karma. I would like to see some more spice examples and some practical examples where it could speed up design and troubleshooting. I usually just troubleshoot on the breadboard but it would be nice to have another technique in the back pocket.

      • I second karma’s request.

        Thanks for the great video, just the right amount of info for that little trap.

      • Bill

        Just curious, why would you ever roll your own regulator in this day and age?

        • If you can find a digitally adjustable regulator that goes down to 0V and is cheaper than an opamp and a transistor, please let me know!

          • Karl

            Almost every adjustable linear regulator can be digitally adjusted. You just drive an additional voltage or current from a DAC into the feedback.

            It boils down having to calculate three resistors. The two resistors forming the typical voltage divider for the feedback, plus one resistor connecting the DAC to the feedback. Nothing more than Ohm’s and Kirschhoff’s laws required.

            The old workhorse LM317 is even simpler, just drive the ADJ pin to Vout – 1.25 V. No calculation of regulator feedback resistors required.

            I like to use linear power regulators instead of power transistors for digitally adjustable power supplies, because they are cheap and I don’t have to think much about loop stability.

            PS. This is for the DIY bench power supply you plan?

          • George Herold

            LT3080? But cost is most likely higher.

      • Duck


        Great blog. I use circuits a lot like this myself. To tame those oscillations I generally try the following:

        1) Add a bit of capacitance across the feedback resistor.
        2) Increase the value of the base resistor between the op-amp output and the base of the darlington.
        3) The universal fix when all else fails is to add some noise gain compensation (i.e. a series RC) across the op-amp input terminals.

        • George Herold

          Yup, that’s great Duck, Does a bit of high frequency feed back that bypasses the transistor also help? (A 10pF cap from opamp out to inverting input.)

      • nbsr


        Interesting topic but a bit disappointing content. Sorry. It just feels like bad engineering, fiddling with some design parameters and hoping that the obtained solution works and is robust enough.

        I’d really like to see what caused the oscillation (a hand drawn bode plot with identified poles/zeros would be perfect), how to compensate the circuit (I’m not convinced that changing the amplifier yields a robust solution, if so, why?), what is the time response to load current or supply voltage steps (ringing, stability margin). All this can be done without referring to complicated math.

        Thumb up for showing that circuit simulators can be useful for solving practical problems. And, as always, for superb execution.

        • Strube09

          I agree W/ NBSR

          Great start to the blog on stability in loops, but as you opening tags always say ”
          a blog for any one interested in electronics design”. But mostly it is reviews and rants. Don’t get me wrong I do like those but I feel there is more rants and reviews than design blogs.
          Unfortunately when you get to some good meat it is very general. I would have like to see some basic calculations on the response and show a better explanation on why it is unstable. What is going on with the phase of the output and input? Maybe explain to some hobbyist that may not had much school on what is a pole and zero and how there can be multiple poles and zeros that affect the stability.

          Just my 2 cents.

      • Chris Jones

        There must be some extra phase shift in your feedback loop turning what should be negative feedback into positive feedback. I would suspect the darlington: the input device might be running at very low current which would make it slow. I suggest a resistor from each emitter to ground, to draw a known minimum current through each transistor.

        Also, the resistive divider in the feedback will have an equivalent output resistance, which with the op-amp input capacitance will make a RC phase shift. You can fix that like they do for the resistive divider in a scope probe, by putting a small cap across each resistor.

        The resistor in the base of the darlington in combination with the base capacitance would add some phase shift. If you don’t need the resistor then I’d get rid of it, if you do need it you could put a 1nF cap in parallel with it.

        If there is no way to get rid of the extra phase shift in your darlington, e.g. if you need to run the darlington at low current with huge load capacitors, then you could cheat, by making a separate feedback path around the op-amp that bypasses all of the slow circuitry. I would do this by un-doing all of the changes I suggested above (putting back the base resistor of the darlington, and getting rid of the caps across the resistors in the feedback divider), and then putting a cap (1nF or so) from the opamp output pin right to the op-amp inverting input pin. This would mean that you don’t get the benefit of closed loop regulation of the output voltage at high frequencies, but at least it could be made stable.


      • Chris Jones

        Oh, and Dave, we’re still waiting to hear from you on Jeri Ellsworth’s channel,

        Start the right hand video window, and join the IRC chat at the bottom.

        She’s away for work quite a bit, but when she’s there you can video call into the channel on skype, and we’ll heckle you via text to speech.


      • Robin F.

        Dave, I usually enjoy your videos but like nbsr said, this is just an example of bad engineering. Please, next time show us that you can do this properly as well: that a loop with two or three poles and lots of gain will oscillate, and that the way to fix this is to add a zero, move the poles around, or in extreme cases, reduce the loop gain. And yes, you have to take component tolerances into account, which means you’ll usually overcompensate it, so that it’ll also work with slightly different components.

        By the way, you also showed a common beginner’s error in using simulators. Circuits that oscillate will often appear stable at first, and only oscillate after numerical noise has shifted the operating point away (after 100 ms or so in your sim). It’s usually a good idea to start the sim with the supply voltage at zero initially, then ramp it up to the nominal supply voltage.

      • Great video. It’s totally where I am at with this part of the engineering woods.

        Just right for me.
        Eff the Siskel & Ebert types on here! 🙂 How’s their vlog coming along?

        Keep up the great work. Good variety!

      • dave

        Hi Dave,

        I really enjoy the blog. I love seeing designs in progress. I love the equipment reviews and rants as well.

        I’ll second the above post about the darlington. Darlingtons are famous for slow response, and always add a delay (phase shift) to the loop. As you found out, biasing the darlington pair to reduce the delay can work. This is one of those situations where you can try making a bode plot in the simulator, and see where the phase shift and the gain produce positive feedback, and also how you can fix the oscillation by modifying the rolloff profile (decreasing your gain, adding poles, reducing the phase shift) or the phase profile (biasing the transistors differently, different transistor, single power stage, etc.); and how you can make sure you have a good phase margin on your final design. I think even if your average beginner doesn’t understand all the details, they’d have an appreciation of some of the tools engineers use to solve everyday prolblems, and that’s part of what engineering is all about.


        • DB

          While it seems obvious, one simple thing I always try to keep in mind, is if the loop is oscillating, then the gain at 180 degree phase shift is greater than one.

          • Dave

            That’s assuming the gain decreases monotonically with frequency. Sometimes you get a lumpy open loop gain where it’s less than one at 180, but peaks again.


      • Michael Thompson

        I am not up to the point where I understand all of this, but because of this blog I try to muddle through.

        I always pick something up though, and THAT’S the supreme value of this blog for me.

        -of course if Dave should ever fall short then I can always go watch that episode where they blow up multimeters again!
        That never gets old.


      • Hi Dave.
        I’d love it if you could make a short lecture about those poles and zeroes one day, the practical aspects. I had the theory at university, but teacher was so bad that no one understood it.

      • Pyr0Beast

        Hello Dave,

        Why not simply connect the output of op-amp to a suitable mosfet and drive it in its linear region ?

        • Chris Jones

          Op-amps driving big MOSFETs are not without potential for trouble.

          When I was in school I used to like building stepper motor drivers and things like that, and one day I decided to change from my usual constant current sinks that used 2N3055s with resistors in the emitter to a new circuit. I was so confident I even etched a PCB instead of bread-boarding the circuit. I connected a LM324 op-amp to the gate of a big MOSFET and connected the inverting input of the op-amp to the source of the MOSFET with a current sense resistor from the source to ground. It oscillated like crazy because there is a pole in the compensation of the op-amp and there is another pole formed by the open loop output resistance of the op-amp and the capacitance of the MOSFET gate, giving very close to 180 degrees phase shift without considering all the parasitic poles elsewhere.

          The nice thing for this application would be a transconductance amplifier to drive the MOSFET gate. This would convert the voltage difference at the amplifier input into a current that would charge or discharge the MOSFET gate. ( Transconductance amplifiers are something that we use all the time inside chips but which is very rare as an open-market component, probably because the marketing department hasn’t heard of them yet. There were a few introduced in the 70’s, maybe that was before the marketing departments in semiconductor companies were set up.) That way, the pole due to the MOSFET gate capacitance would also serve as the compensation capacitor, making it much more stable.


          • nbsr

            Plus, if you use a PMOS transistor (like in LDO regulators) and a capacitor across its drain (output voltage) and gate pins you will end up with a nice feed-forward path (a zero) and enough BW to cancel out the high frequency output voltage ripple.

            This technique is a bit more difficult to use than compensating the loop with a dominant pole but it works very well. One thing to watch for are pole zero doublets that may cause settling issues.

      • Jeff

        The loop gain and phase was changed by using a different Op Amp and changing the actual circuit topology – the separate gain cell plus regulator isn’t equivalent to the merged version.

        Look at the data sheets for the MJD112 vs the 2N2222. The Hfe of the MJD112 is 12,000 nominal while the 2N2222 is 300 nominal. Based on just gain you might think you’d be “safe” but it’s the unity gain with phase that matters: either is already potentially unstable but the long pole (pun intended) in the tent becomes frequency response.

        The Ft is 25 MHz for the MJD112 and 300 MHz for the 2N2222! This is probably what pushes out the loop bandwidth to the point of instability. That combined with the change in circuit topology that adds 4x to the loop gain as well. Here’s a trivial bet: the oscillation frequency is between 25 and 300 MHz.

        As a former analog IC designer, I know you can do things from calculations and simulations but process of validations of those results is pretty detailed and tedious by hobbyist and newbie standards. A quick back-of-the-envelope suggests cutting the loop bandwidth down closer to 25 MHz would be a quick-and-dirty idea.

      • John M

        With only a 2-year degree in Electronics Technology from a Junior College here in California, I go . . poles? Zeros? huh? what? These topics were never covered in my technician classes. I got my degree in 1985. I checked my textbooks on OpAmp theory – nothing. I have a newer version (Malvino) textbook that mentions only briefly “Pole Frequency” in relation to Active Filters – a reference to the “s plane” – but simply mentioned it – no explanation. Of course, The Art of Electronics discusses the topic in more detail. John Martin

      • Shame on you Dave. It’s the emitter follower itself that’s oscillating. No matter how hard you try to compensate the opamp, it will keep oscillating.

        Base stopper resistors? Anyone? Just add a resistor in series with the base of Q2 next time and it will work fine. Something like 22R will do fine in your case. (just a wild guess that will not be to far off)

        Regards, Hendrik

      • PaVe

        what about to try to bypass R8 by a capacitor?

      The EEVblog Store is closed for the XMAS and New Year season. It will re-open mid January. US Customers can still order on Amazon.