Building a DIY Regulated Buck Converter using no ICs

MrAl

Joined Jun 17, 2014
13,726
Is my new idea the comparator idea that you had, i chose my switching frequency to be 100kHz
Well the comparator idea is much simpler. You use a rectangular wave generator (similar to a square wave) to charge a capacitor, then quickly discharge it. That gives you a kind of curvy ramp.
The curvy ramp goes to one input of the comparator, the other input gets the voltage reference for setting the pulse width. The output of the comparator is a PWM signal that varies almost linearly with a change in reference input.
The wave generator is also a comparator set up as a simple oscillator that generates a pulse width that has almost the same time period as the time period of the frequency you want to use. So say the period you are using is 10ms, then the pulse width would be maybe 9.9ms or something like that. During the 9.9ms the cap is charging, and during that remaining 0.1ms the cap is discharged. Then the cycle repeats.
This was used in a professional design I was working a long time ago back in the early 1980's. It was very stable even when feedback was added.

I also used this idea for a PWM for use with a triac controller to control a 15 amp AC motor. There was no feedback in that design however.

I might be able to draw the circuit at some point, but you should think about this first anyway and see what YOU can come up with given this new information. Part of learning involves thinking for yourself, sometimes very deeply. It can also be very rewarding when you come up with something that actually works well.
 

kami100

Joined Apr 30, 2025
6
So i am trying to build this circuit using nothing but basic components (RLC) with a 555 timer for the PWM and Op Amps for feedback to ensure it is regulated. It needs to be able to take an input of 20V +- 4V and output a steady 5V@0.5A. My idea is to take a voltage divider at the buck converter power stage output and feed it along with a constant reference voltage to an op amp to amplify the error. Then that signal would be put into pin 5 of the 555 timer to control the Duty cycle. I have attached my circuit and I am unsure why Proteus is giving me logic 0 throughout the circuit and not functioning the way i intend it too. Any ideas on how to fix it would be greatly appreciated. I will attach my schematic as a screenshot.

  1. Use 555 timer in fixed-frequency mode (astable) with fixed R1, R2, and C.
  2. Use an op-amp as a comparator:
    • One input = scaled-down output voltage via voltage divider.
    • Other input = reference voltage (e.g., from a Zener or divider).
  3. Use the op-amp output to drive a transistor (NPN) that connects/disconnects pin 4 (reset) of the 555:
    • This enables/disables the PWM pulse, adjusting effective duty.
    • Or use it to short R2 momentarily to alter duty cycle.

Or better yet:

  • Scrap the 555 PWM control attempt via pin 5, and instead use the op-amp to drive a MOSFET directly as a comparator PWM controller, or control a PWM generator IC more suited for regulated switching (e.g., TL494, SG3525).
 

Thread Starter

RebelliousResistor

Joined Mar 18, 2025
18
  1. Use 555 timer in fixed-frequency mode (astable) with fixed R1, R2, and C.
  2. Use an op-amp as a comparator:
    • One input = scaled-down output voltage via voltage divider.
    • Other input = reference voltage (e.g., from a Zener or divider).
  3. Use the op-amp output to drive a transistor(NPN) that connects/disconnects pin 4 (reset) of the 555:
    • This enables/disables the PWM pulse, adjusting effective duty.
    • Or use it to short R2 momentarily to alter duty cycle.

Or better yet:

  • Scrap the 555 PWM control attempt via pin 5, and instead use the op-amp to drive a MOSFET directly as a comparator PWM controller, or control a PWM generator IC more suited for regulated switching (e.g., TL494, SG3525).
This sounds similar to the design i posted recently on post #39. I fully scrapped the pin 5 idea and im using a op amp and a comparator with a ramp in order to create the pwm for the mosfet but im somehow not getting it to work as intended
 

Thread Starter

RebelliousResistor

Joined Mar 18, 2025
18
Well the comparator idea is much simpler. You use a rectangular wave generator (similar to a square wave) to charge a capacitor, then quickly discharge it. That gives you a kind of curvy ramp.
The curvy ramp goes to one input of the comparator, the other input gets the voltage reference for setting the pulse width. The output of the comparator is a PWM signal that varies almost linearly with a change in reference input.
The wave generator is also a comparator set up as a simple oscillator that generates a pulse width that has almost the same time period as the time period of the frequency you want to use. So say the period you are using is 10ms, then the pulse width would be maybe 9.9ms or something like that. During the 9.9ms the cap is charging, and during that remaining 0.1ms the cap is discharged. Then the cycle repeats.
This was used in a professional design I was working a long time ago back in the early 1980's. It was very stable even when feedback was added.

I also used this idea for a PWM for use with a triac controller to control a 15 amp AC motor. There was no feedback in that design however.

I might be able to draw the circuit at some point, but you should think about this first anyway and see what YOU can come up with given this new information. Part of learning involves thinking for yourself, sometimes very deeply. It can also be very rewarding when you come up with something that actually works well.
Thank you for the idea. Ive connected that up now and is this the kind of curvy wave that you were talking about? Ill attach my circuit and the oscilloscope output. Its a 555 timer in astable mode producing a ~50% duty cycle and that is charging a capacitor, the yellow is the 555 output and the green is the capacitor charging which i think is the curvy wave you meant? Kind of a shark fin shape? Ill be implementing this in my actual circuit now and ill post the results1746179749945.png
 

Attachments

Irving

Joined Jan 30, 2016
5,183
That's the idea, but you don't really need R5/C4. If you look at pins 2 & 6 you'll see a 'curvy wave' that traverses between 1/3VCC and 2/3VCC - you can use that directly with just adjustments to the comparator settings. But you really need more of a sawtooth, a slow rise and a fast fall. Here's an example, with DC set to 10%, 50% and 90%. Its not completely linear because its curvy. To make it linear you need to charge via a constant current source, not a resistor.

1746197800426.png
1746197851079.png1746197913610.png


Incidentally, unless there's a specific reason, for low voltage, ground-referenced signals as here you should have your 'scope inputs (virtual or real) set to DC rather than AC; although not critical at these levels/frequencies AC can introduce or hide issues, AC is useful in certain measurements; for example, looking at the 100mV AC ripple on top of a 50v power rail, where you are not interested in the DC voltage.
 

Thread Starter

RebelliousResistor

Joined Mar 18, 2025
18
That's the idea, but you don't really need R5/C4. If you look at pins 2 & 6 you'll see a 'curvy wave' that traverses between 1/3VCC and 2/3VCC - you can use that directly with just adjustments to the comparator settings. But you really need more of a sawtooth, a slow rise and a fast fall. Here's an example, with DC set to 10%, 50% and 90%. Its not completely linear because its curvy. To make it linear you need to charge via a constant current source, not a resistor.

View attachment 348274
View attachment 348275View attachment 348276


Incidentally, unless there's a specific reason, for low voltage, ground-referenced signals as here you should have your 'scope inputs (virtual or real) set to DC rather than AC; although not critical at these levels/frequencies AC can introduce or hide issues, AC is useful in certain measurements; for example, looking at the 100mV AC ripple on top of a 50v power rail, where you are not interested in the DC voltage.
Ahhh i see now, what do you think would be a good frequency for this? If im not mistaken this would control the switching frequency as well right? Because this curvy wave goes into the comparator with the Vref on the other input and will output the pwm
 

MrAl

Joined Jun 17, 2014
13,726
Thank you for the idea. Ive connected that up now and is this the kind of curvy wave that you were talking about? Ill attach my circuit and the oscilloscope output. Its a 555 timer in astable mode producing a ~50% duty cycle and that is charging a capacitor, the yellow is the 555 output and the green is the capacitor charging which i think is the curvy wave you meant? Kind of a shark fin shape? Ill be implementing this in my actual circuit now and ill post the resultsView attachment 348268

Hi,

Yes, that's the waveform and you may be able to use the idea of taking that off of one of the existing caps, but you have to watch out for effects of noise injection into that pin which may cause problems.
You also might consider that you may not have as much leeway for setting the shape of the curvy wave. With the extra R and C, you can make the wave straighter, which results in better linearity. It may not matter in your application though you just have to check that.
For example (just some values thrown out there), if R was 1k and C was 0.1uf, you may get a very curvy wave, but if you make C=0.2uf, you can get a less of a curve if you also set the operating point a little lower. That's because for the chosen frequency, the threshold will be along a straighter section of the wave, and that would be because you no longer use the very upper part of the wave which shows the most curvature.
During the first time constant, the wave is pretty straight. After that, the wave curves more and more, and so the gain changes a lot. During the first time constant the gain does not change too much. You might also get away with operating within the first two time constants. It all depends on the rest of the circuit too.

That said, the wave for the 555 does not look that bad by itself, so noise injection may be the only concern.
 

Irving

Joined Jan 30, 2016
5,183
but you have to watch out for effects of noise injection into that pin which may cause problems.
Hmmm, not one I've encountered. The internal resistor chain on a 555 is 3 x 5k setting the thresholds at 1/3 and 2/3Vcc and Thresh pin is a high-impedance input to a comparator bypassed to ground by the timing capacitor so not much scope for noise there and running in parallel with another comparator shouldn't be an issue. I've used this approach several times over the years. There might be an issue if the timing currents were very small, ie very large resistors in the megaOhms range with a smallish C, but 555 design recommendations suggest that's not a good solution anyway..
 

MrAl

Joined Jun 17, 2014
13,726
Hmmm, not one I've encountered. The internal resistor chain on a 555 is 3 x 5k setting the thresholds at 1/3 and 2/3Vcc and Thresh pin is a high-impedance input to a comparator bypassed to ground by the timing capacitor so not much scope for noise there and running in parallel with another comparator shouldn't be an issue. I've used this approach several times over the years. There might be an issue if the timing currents were very small, ie very large resistors in the megaOhms range with a smallish C, but 555 design recommendations suggest that's not a good solution anyway..
Hi there Irving,

Oh yes thanks for reminding me about the 1/3 and 2/3 of Vcc voltage levels for the cap charging and discharging. That is used to provide immunity to power supply voltage variance which keeps the frequency constant. That was a cool idea for the design.
Yes, the noise may not be a problem.

One of the requirements is that the capacitor has to discharge fast in order to get up to near 100 percent PWM duty cycle. For the 555 that would depend highly on the discharge transistor. The ideal waveshape is a ramp followed by a quick discharge, then repeat.

I am going to look into the effects of only discharging to 1/3 of Vcc, as for most of the ones I did the capacitor was discharged to nearly zero volts before the next cycle started.
I am not sure if limiting the charge voltage to 2/3 of Vcc is a good idea either, but it could work. With a 3v supply that would be an operating range max of 1v to 2v which is a range of 1v. With a 5v supply that would be 1.666v to 3.333v which gives us a range of 1.666 volts.
With the other methods and limiting the range to 2/3 of Vcc, all the ranges double from that above. Not sure if it makes much difference but the wider the range the better, for what it's worth.
 

Irving

Joined Jan 30, 2016
5,183
One of the requirements is that the capacitor has to discharge fast in order to get up to near 100 percent PWM duty cycle. For the 555 that would depend highly on the discharge transistor. The ideal waveshape is a ramp followed by a quick discharge, then repeat.
This is the biggest limitation of using a 555. The discharge input is current limited so even if the discharge resistor is zero the fall time is a few uS. This makes a true 0 - 100% PWM virtually impossible, especially above say 20kHz (50uS), where the fall time is bordering on 10%+! To improve on this its possible to use /OUT or DIS to drive, for example, a high-current gate driver to discharge C fast, but by the time you've added that complexity you might as well junk the 555 and do it with just a couple of comparators.
 

MrAl

Joined Jun 17, 2014
13,726
This is the biggest limitation of using a 555. The discharge input is current limited so even if the discharge resistor is zero the fall time is a few uS. This makes a true 0 - 100% PWM virtually impossible, especially above say 20kHz (50uS), where the fall time is bordering on 10%+! To improve on this its possible to use /OUT or DIS to drive, for example, a high-current gate driver to discharge C fast, but by the time you've added that complexity you might as well junk the 555 and do it with just a couple of comparators.
Yeah the name of the game is always "tradeoff", the thorn in the side.
 
Top