Designing my first buck regulator (help!) - Page 1
Forum section: electronics / beginners

author: sparkydog
author_rank: Regular Contributor
timestamp: July 14, 2023, 08:26:02 pm
content: Okay, so when it comes to switching voltage regulators, I know higher frequency = better, but I was looking at the data sheet for a UC3842...QuoteTranslation: You¹ can't prototype this and you areWAYover your head.(¹ By "you", I mean "me", in case that wasn't obvious...)Right. So, an LM2574 is still pretty intimidating, but looks like Imightbe able to figure one out without going away for four years to get a master's degree in EE. However, I remain deeply confused on how to properly size the ancillary components. It doesn't help that the data sheet calls for electrolytic caps, specifically, yet most of the information I've seen elsewhere recommends ceramic and/or extremely low capacitance values that don't seem to exist in electrolytic caps.Questions:If my application for this is powering a pair of ATtiny5s and... basically nothing else, do Ineedhigher frequency switching, or is 52 kHz plenty?How much inductance do I need? The data sheet recommends 680 µH, but IIUC that gives ~80 mA ripple current. Ithinkmy load (recall; two ATtinyX5s) is ~25 mA, which is a little scary, but OTOH I don't really understand what the inductor ripple currentmeans. Another source pointed me at the 10 mH (~5.6 mA ripple) currently in the schematic.How do I know what to use for C2? Is 220 µF enough? (IIUC, one of the criteria is that C2 must be able to absorb the ripple current. UHE1E221MPD is rated for 640 mA.)

author: mariush
author_rank: Super Contributor
timestamp: July 14, 2023, 09:18:41 pm
content: Switching regulators like LM2574 , LM2596, LM2576 and so on are ancient designs, outdated, and not worth using unless you already made a product with them and you're too lazy to redesign the board.You can get much better switching regulators which requires less external components and run at higher frequencies, which means you can use smaller inductors and ceramic capacitors.The LM2574 requires an electrolytic capacitor on the output because of the properties of electrolytic capacitors, some ESR is required in order to be stable.For example, AP62305 only requires an inductor and a bunch of ceramic capacitors, and it's factory configured for 5v fixed output voltage:https://www.digikey.com/en/products/detail/diodes-incorporated/AP63205WU-7/9858424- or you could get the adjustable version :https://www.digikey.com/en/products/detail/diodes-incorporated/AP62200WU-7/10491524But yeah, because it runs at high switching frequency you can't use it on a prototyping board, and you need to pay attention to layout (see suggested layout at the bottom of datasheet)If my application for this is powering a pair of ATtiny5s and... basically nothing else, do I need higher frequency switching, or is 52 kHz plenty?An ATtiny on its own will probably consume under 5mA ... things you connect to it will often consume more, for example 5-10mA for a LED, stuff like that.How much inductance do I need? The data sheet recommends 680 µH, but IIUC that gives ~80 mA ripple current. I think my load (recall; two ATtinyX5s) is ~25 mA, which is a little scary, but OTOH I don't really understand what the inductor ripple current means. Another source pointed me at the 10 mH (~5.6 mA ripple) currently in the schematic.The 80mA ripple current is not the same thing as the output current of the regulatorThe datasheet contains explanations :https://www.ti.com/lit/ds/symlink/lm2574.pdf

author: ArdWar
author_rank: Frequent Contributor
timestamp: July 15, 2023, 02:56:30 am
content: Please always consult the datasheet for proper component selection and sizing. LM2574 gives recommended inductor size in figure 24. Although lacking that you can calculate the expected inductor size formostbuck converter by the formula below:$$L=\frac{V_{out}\times(V_{in}-V_{out})}{V_{in}\times F_{sw}\times K\times I_{out}}$$K is the ratio between inductor ripple current and output current. Consult datasheet again for proper value (Figure 19 in LM2574 datasheet), althoughmostdesign aims between 0.3 and 0.6 range. Pick lower bound value for lower output ripple, or higher bound value for smaller inductor. Using your case as example (12 Vin, 5 Vout, 0.1 Iout, 52k Fsw, 0.9 K), the equation agree with the recommended inductor sizing chart. A whooping 680uF.Please note that using such large and old buck converter for such low load current is kind of almost missing the elephant in the room. LM2574's quiescent current can easily reach 5-10 mA. It doesn't support PFM or pulse skipping which means its switching loses don't reduce that much with lower output current. Such converter also often struggle to maintain regulation at low output current. It might not even work with less than 10mA output load. Considering the whole system consumption it might even ends up less efficient than linear regulator.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 15, 2023, 06:45:18 am
content: Advicing against solderless breadboard or wirewrapping does not imply mere mortals can't do it. You probably already can solder. All you need is take a piece of unetched copper clad board acting as ground plane and start soldering parts on it, minimizing wire lengths (preferably directly component to component).Also remember that basic physical equations always work. Buck can be fully designed by applying di/dt = V/L! For example, if you choose Iout = 1A and Iripple = 40%, that will be di= 400mA. If you choose 12V->6V, that will be 50% duty cycle in CCM. If you choose 100kHz (just for illustration), then t_period = 10µs, and t_on = 50% of that, or 5µs. During on-time, there would be 6V across the inductor (input voltage being at 12V and output capacitor at 6V, see buck schematic). Therefore, you can calculate: 400mA/5µs = 6V / L; solve for L.No need for anything fancier than that.Remember the importance of low-ESR, low-ESL (i.e.,placed close) input capacitor for buck converter. Output capacitor having some ESL (distance) is less critical because it's in series with the L anyway.

author: Faranight
author_rank: Unknown
timestamp: July 15, 2023, 07:03:41 am
content: Yes, there should nominally be a combination of ceramic and electrolytic capacitors present. The MLCC's act as high frequency bypass caps that limit the ripple while electrolytics act as bulk capacitors that affect the transient response i.e. when load is suddenly removed/applied to the buck. The low-ESR MLCC's should be placed as close as possible to the switcher IC pins, and the switch-inductor-output cap loop area should be made as small as possible to avoid EMI problems. This is why you normally do not want to place such components on a breadboard, but use a properly designed PCB instead. Also, you may want to consider switching to a synchronous buck IC that gets rid of the schottky diode and is a bit more energy-efficient.Frequency-wise, most switching regulators that I've used work in range of about 300 kHz to 1.2 MHz. Higher frequency is better because it allows you to use smaller components and results in lower output voltage ripple. But as frequency goes up, inductive effects start to dominate, which limit how high you can go with the frequency.

author: ArdWar
author_rank: Frequent Contributor
timestamp: July 15, 2023, 08:06:42 am
content: You can still breadboard at 52 kHz with satisfactory result, although you may still want to use half-assembled method. Like said before, at least solder the input caps and freewheeling diode close by. Those two components also probably one that you rarely change anyway. Saving grace is that those old switcher don't have blazing fast dv/dt sw node.

author: MrAl
author_rank: Super Contributor
timestamp: July 15, 2023, 09:57:27 am
content: Quote from: sparkydog on July 14, 2023, 08:26:02 pmHi,There are so few parts in a circuit like with the LM2576 that you can use a perf board and point to point wiring and get very good results. I've actually did this a number of times for various power circuits.These chips are easy to use that is what makes them so nice. For the LM2576 for example you can get away with a 100uH inductor. For the output cap it depends on how much ripple your circuit to be powered can tolerate. Start with 1000uF.To get even a smoother output, include a small post LC filter. An added inductor even only 2uH and added second cap 100uF can snuff out some of the high frequency ripple and get the output to be much better. This second filter is added to a finished design, while the output from the first cap 1000uf is used for feedback not the output from the second cap the 100uf. It's an important point that the post LC filter is not in the feedback path.You can also add current feedback so you can add current limiting, and isn't too hard to do using just one small transistor.

author: MathWizard
author_rank: Super Contributor
timestamp: July 15, 2023, 02:01:25 pm
content: Computer PSU's are usually single sided PCB's, the PFC and PWM switching is usually under 100kHz.If you exactly copied the layout for something like that, onto protoboard, so any loops stay the same size, and used the right size wire or solder traces, would there be any real difference or downside ?What about making +500kHz SMPS test/experiment circuits on breadboards ? I never tried to measure a breadboard with my LCR meter. Is there greater risk of damaging parts ? Or do they just not work as good, like square wave gate drives getting rounded out ?

author: Terry Bites
author_rank: Super Contributor
timestamp: July 15, 2023, 04:00:18 pm
content: Intimidating how?The design process uses basic year 7 or year 8 algebra.MrAl is right, a bit of perf board is fine for this switcher.Have you heard of "WEBENCH-CIRCUIT-DESIGNER"It a free on line psu design app. Check it out.It will recomend other ics, but if you create an account with TI, you can bend it to your will.I works great belive me.