Close
0%
0%

OpAmp Buck Regulator

A quad OpAmp Makes a Buck Regulator

Similar projects worth following
The OpAmp Challenge:

A long time ago I made a buck regulator with a 555, so when I read the opamp challenge, I thought, let's do it with opamps. If the output current of the selected chip was high enough, we could even make a useful circuit without using a mosfet.

A buck regulator fundamentally pulses current through an LC filter, which makes a DC output.  

This project uses a quad opamp package to create a triangle wave which feeds into a comparator stage to create a PWM output.  The PWM output then goes through the LC filter to create a DC level.  That DC level is then sampled and fed back to the comparator to control the PWM width which regulates the output voltage.

In the name of technology, I used ChatGPT to help write the details (human edited for clarity and/or correctness):

--- Begin ChatGPT 

Design the basic buck regulator topology
The basic buck regulator topology consists of an input capacitor, an inductor, and an output capacitor. The input capacitor is connected to the input voltage source, and the output capacitor is connected to the output load. The inductor is connected between the output opamp and the output capacitor. This creates a low-pass filter that smooths out the output voltage.

The first opamp is configured as a Schmitt trigger, a circuit that produces a binary output based on the input voltage level. When the input voltage exceeds a certain threshold voltage, the output switches from a low state to a high state. When the input voltage drops below a different threshold voltage, the output switches from a high state to a low state. The hysteresis created by the two different threshold voltages helps to ensure that the output will not switch rapidly back and forth around the threshold voltage, which could cause instability and noise in the system.

Connect the output of the Schmitt trigger to an integrator circuit, opamp 2, which is simply an op-amp configured as a voltage follower with a capacitor (C) in the feedback loop. This will produce a triangle wave at the output of the integrator, with the frequency determined by the values of Rf and C.  By combining the Schmitt trigger and the integrator, you can create a triangle wave with precise control over its frequency and amplitude.

The output of the third op-amp, which is used as a comparator, will be a PWM signal that is proportional to the difference between the output voltage and the reference voltage.

The fourth op-amp will now be used as a voltage amplifier with a gain of 1.  A MAX6101 voltage reference chip will be used to create a reference voltage that will be compared to the output voltage. The output of this op-amp will be connected to the non-inverting input of the third opamp (comparator) to create a feedback loop to regulate the output voltage.

---End ChatGPT

The Schmitt Trigger and integrator forms a triangle wave at about 86kHz.  The triangular-wave frequency is determined by R11, C4 and the positive and negative saturation voltages of the Schmitt Trigger opamp.

opampSwitcherBOM.xlsx

BOM

sheet - 5.67 kB - 04/28/2023 at 02:55

Download

opampSwitcher.kicad_pcb

KiCad PCB file

kicad_pcb - 152.95 kB - 04/27/2023 at 12:52

Download

opampSwitcher.kicad_sch

KiCad Schematic

kicad_sch - 75.31 kB - 04/27/2023 at 12:52

Download

opampSwitcher.asc

LTSpice File

asc - 4.64 kB - 04/26/2023 at 03:25

Download

  • Is this the best choice?

    Aaron Lager05/21/2023 at 20:49 0 comments

    Well, after many investigations, it would appear that this opamp pulls a lot of current when it is oscillating.  The sim agrees with reality in this regard too.

    So, while it is a great regulator, and has great transient response, it is not efficient at all.  It is probably worse than most modern LDO chips.  

  • Testing

    Aaron Lager05/10/2023 at 03:52 0 comments

    Here is where the rubber meets the road.

    Purple is the input voltage 6V and yellow is the output voltage 3.3V

    Looks pretty smooth and 3.36V, hits the target...

    How about we zoom in a bit on that?

    Put the scope into AC mode and zoomed in on the vertical scale.  10.7mVpp and I only have one 47uF output capacitor installed!

    It's a switching regulator, so how efficient is it?

    With a 68 ohm resistor as the load, that makes 3.3^2 / 68 = 160mW output power (3.3V / 68 = 48mA ).

    The input power was between 6V * 94.8mA = 568mW and 11.3V * 68mA = 768mW

    That puts the efficiency at a measly 160mW / 768mW * 100 = 20% to 160mW / 568mW * 100 = 28%

    The opamp is getting quite toasty.  A quick look at the datasheet indicates each of the 4 amps should only consume ~1.75mA max. 

    Something else is amiss...

  • PCBs and parts have arrived

    Aaron Lager05/09/2023 at 01:31 0 comments

    Parts are here, PCBs are here...time to build.

    Some time passes......

    All the parts fit like a glove.

  • PCB Layout

    Aaron Lager04/23/2023 at 21:51 0 comments

    PCB layout done:

    All parts are on the top side. Total area is 1.8in-sq.

    And a cool 3D view of what to expect when it's built:

  • Totem Pole Output VS a FET Switch

    Aaron Lager04/23/2023 at 17:07 0 comments

    While doing a few final checks, I thought I'd check the currents from the opamp.

    Whoa!  The current is going plus and minus!

    This makes total sense, the output of the opamp is designed to sink AND source current.  We only want it to source current.  Adding  a diode to the output of the opamp will solve that.

    Much better, current is only going in one direction now.

    And our new kiCAD drawing:

  • Schematic Capture

    Aaron Lager04/23/2023 at 16:30 0 comments

    Satisfied with the simulations performance, it's time to start making it for real.

    Step one, schematic capture.  I use KiCAD 6, and found that there was an update to version 7 during the middle of drawing.  I was getting frustrated with how KiCAD deals with wires when dragging components around.  During my search for a solution, I found that version 7 is the solution.  Normally I don't update software in the middle of a project, but I took a calculated risk, and the transition was seamless. Score!

    I made three minor changes (as compared to the LTSpice schematic) as I was drafting the schematic.

    1. The 1.25V reference was changed.  The LT1389 is a 0.05% accurate part, and costs about $8 USD.  So I changed it to a MAX6101, 0.4% accurate and only $1.48 USD.
    2. The output capacitance.  Instead of a single component, I made room for three.  This will give more flexibility during testing.
    3. I also added a bypass capacitor for the opamp package and input connection.

  • Complete Regulator

    Aaron Lager04/19/2023 at 05:02 0 comments

    After a few nights plunking away on LTSpice, I finally had a working regulator.

    U4 is a Schmitt Trigger used to make a square wave.  R2, R3 shift the switching thresholds for it up into positive voltages.  R9, R6 set the thresholds and R10 moves them depending on if the next stage (U5) is ramping up or ramping down.

    U5 is the integrator, which converts the square wave input from U4 into a triangle wave output.  The output of which is fed back to the Schmitt Trigger to cause it to toggle.  Together they form a stable oscillator with a triangle wave output.

    Next is U6.  It compares the present value of the triangle wave to a threshold (feedback) value and  as that value changes, the output will toggle based on the portion of the triangle wave being fed into the negative input.  This creates the PWM.

    The PWM is then fed into the LC filter of the buck circuit, then R14,R15 sample the output voltage and feed it back into U1.  U1 acts as a comparator and compares the feedback voltage to the 1.25V reference U3.  If the Vout voltage is too high, then U1 will output a low value, and if it is too high it will output a higher value.

    V(n007) is the voltage divider node, going into U1 minus input.  V(pwm) is divided by 2 just to keep the graph more readable.

    And the ultimate test, the output (does it work?) 

    3.3V @ 110mA

    And less than 7mV of ripple:

    Time to make it for real!

  • Single Supply Operation

    Aaron Lager04/19/2023 at 04:28 0 comments

    A little breaking out of the maths for the Schmitt Trigger allowed me to move the thresholds from +/- voltages to all positive voltages.  And then I needed to shift up the integrator reference as well, by adding R7 and R8.

    Now we're cooking!  Rail to rail square wave output, integrated triangle wave, all on a single supply.

    Next stop threshold output from the triangle wave, gives us a fixed PWM.

  • TI's appnote

    Aaron Lager04/19/2023 at 04:10 0 comments

    In the original contest announcement comments, someone mentioned that TI had a great opamp guide, so I decided to check it out.

    Inside, it too had a section on making a triangle wave generator, which is a fundamental piece to making a PWM.

    The output of this circuit gave a much better square wave feeding into the integrator, and actually went rail to rail.  However it still required a dual power supply.

    The  first opamp is a Schmitt Trigger circuit used to make a square wave.  The square wave is then integrated by the second opamp circuit, which produces a triangle wave. The integrator is an inverting type, and its output is then fed back to the Schmitt Trigger to cause it to toggle as its thresholds are crossed.

    All that was left to do was to have the triangle output feed into a variable threshold detector and we have PWM action!  Followed by making all this work on a single supply.

  • Broad Overview of a buck regulator

    Aaron Lager04/19/2023 at 03:58 0 comments

    First I started with the major building blocks of a buck regulator:

    1. Oscillator
    2. PWM
    3. Feedback

    Poking around on the googles for opamp PWM, I ran across this great video series: Op-Amps, PWM

    I quickly fired up LTSpice and simulated the circuits.  It did work, but the waveforms were a little too off for my tastes.  And, more importantly, it required a dual supply to operate.

    Basic operation is as follows:

    The  first opamp is a oscillator circuit used to make a square wave.  The square wave is then integrated by the second opamp circuit, which produces a triangle wave.

    The search continues...

View all 10 project logs

Enjoy this project?

Share

Discussions

Kuba Sunderland-Ober wrote 05/29/2023 at 20:29 point

This is perhaps a demo of when an op-amp should not be used. A $0.50 quad comparator would do a much better job than an op-amp in this application, with some circuit changes of course. "I used ChatGPT to help write the details" Belated lol on that. Good one!

  Are you sure? yes | no

Aaron Lager wrote 05/29/2023 at 23:12 point

Thanks for the comment. If you followed the logs, you would see that I came to the conclusion that it's not efficient to use the opamps this way.

Your comment about using a quad opamp instead makes no sense, the design is using a quad opamp. If you look at the LTSpice file you can see all of them.  If you look at the Kicad files and the opamp datasheet you would also see this. I'm guessing you did neither. 

And finally, if you think ChatGPT can design a buck regulator using only opamps, you are mistaken. Or at least not with the amount of effort I was willing to put into the prompts. Go ahead and try it! 

  Are you sure? yes | no

Kuba Sunderland-Ober wrote 05/30/2023 at 17:40 point

Of course my comment makes no sense. Doofus me meant a quad comparator. Sorry about that! ChatGPT can't design much, but it has read a lot of other stuff and can paraphrase. Occasionally something useful comes out. I apologize for coming across too harsh :( My sense of humor was far away that day. I've amended my comment because it was dumb as bricks in retrospect.

  Are you sure? yes | no

Aaron Lager wrote 05/08/2023 at 12:45 point

Thanks! The parts are here and PCBs will be here shortly for the build to continue. 

  Are you sure? yes | no

Neal wrote 05/01/2023 at 17:39 point

I like your project.  The detailed design process is appreciated.  👍

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates