The magic of DC-DC voltage conversion
lcamtuf.substack.com
lcamtuf.substack.com
Yeah, no.
1. Linear regulators do not introduce voltage ripple and by the nature of being variable resistors, they form a nice low-pass filter with the capacitors around it. For some sensitive designs, you use a switching converter to step down voltage to e.g. 5V, filter it and then use LDO to get it down to 3.3V with even more filtering.
2. Linear regulators are dirt cheap. And for e.g. USB devices drawing less than couple hundred mA @ 5V using a regulator to step it down to 3.3V would be an overkill.
Granted, recent Raspberry Pi Pico (for example) does use a switching regulator (unlike other boards in that form factor), but it also has led to complications with power supply ripple showing in ADC readings.
But sure, if you application needs higher efficiency, steps down by more than ~2V or pushes around a lot of current, switching regulator is a better choice.
Leakage current can dominate your design, and switching regulators often have lousy leakage current specs (to be fair, so do a lot of old school linear regulators). Furthermore, switching regulators often have to "spin up" while a linear regulator is just sitting there ready to go as soon as your MCU switches on.
In addition, switching regulators tend to be designed for higher currents and tend to have terrible efficiency at small currents (< 1mA). If your circuit uses a very small amount of current even when active, a linear regulator may be superior even for constant-on systems.
But spin-up time... Yeah that still sucks :)
Use case: I want to just have a solar panel + supercap into microcontroller for IoT stuff so I want to suck that cap dry and avoid batteries for temperature range reasons.
And if you don't mind coughing up when it counts... TPS7A02 is 25nA, $0.45/ku. Triple the price, but more than four orders of magnitude better leakage.
[0]: https://www.analog.com/media/en/technical-documentation/data...
Years later after I graduated and left the team, I heard that the folk that took over went through and replaced all the switching regulators with linear ones. I asked them why, and they said someone told them the quiescent draw was lower for linear regulators. I asked them if it was really worth the significantly reduced efficiency dropping from 12V to 3.3V, and they didn't seem to understand what I was talking about. Oops!
This sounds like a useful thing to learn from. Do you have the schematics?
High-end MCUs used to have separate voltage inputs to ADC, for power, and voltage reference.
Older ATX power supplies actually had very high quality 3.3V and 5V outputs because they were coming from linear regs.
I remember some USB gadgets were working in some mobos, but not the others depending on whether 5V was wired from the ATX power, or not
Used to? Almost every MCU I’ve seen recently has had distinct voltage references for the ADCs
Inductors are huge and (generally) off chip. If say your SOC has an AMS components, and PINs are a commodity, then you can't use anything but a Charge Pump and LDOs.
In most realistic designs you put multiple power supply rails in your designs because you need a lot of parts that don't need a lot of power but have different voltage requirements or might need voltage offset. In those cases linear regulators are perfect solution.
More than that, those power supply rails usually have standard voltages and there exist standard linear regulators that output those voltages to make everything even easier.
My strategy is to use linear regulators default and only use anything more complex on those voltage rails where I need to step the voltage up or where the inefficiencies would affect my design's performance significantly enough for me to care.
Oh, and use voltage dividers if you want to convert signal levels (unless it is fast signal and you care about signal integrity).
There are two main trouble spots in DC-DC converter design - protection and noise.
A switching power supply is a dead short across its input once the inductor has saturated. The switch, usually a power MOSFET, needs to turn off on every cycle before that happens. Otherwise, something will fail and probably burn out. Also, the failure mode of power MOSFETS is usually "on". So protection circuitry is needed. Fuses, current limiters, etc. This is why UL approval for switchers connected to the power line is important.
Switchers work by generating big inductive spikes. Those spikes are supposed to be directed into capacitors and smoothed out into DC. Without suitable filtering, spikes will be pushed into the power source, the load, and the RF spectrum. A few ferrite beads, Zener diodes, and small capacitors in the right spots will fix this. LTSpice simulation is useful in picking the component values. You're not done until both the current and voltage curves are flat.
Both are excellent resources and look at design from a bit different point of view.
I think the biggest problems with swithing designs are not what you have listed, although both noise and failure modes are a huge problem and main cause of concern (and cost) when certifying your designs.
The biggest problem is that they are just so damn complex and they have so damn complex characteristics over time and operating parameters. You might think you understand how a switching PSU works but that's just an illusion. There are people who spent their entire life specialising in switching PSU design and are still learning. At best we can understand how they behave within certain parameters and then try to make sure to shut it down safely when we leave those parameters.
Rather the opposite, actually! Most simple electronics or DIY stuff has rather trivial needs, like USB-sourced 5V->3.3V conversion at a few dozen mA. A simple LDO will cost you about $0.01 in bulk, so your total BOM is $0.03 once you include capacitors. The linked CUI VXO7803-500 module is closer to $2.00. An LTC3240 IC will cost you $1.00, and an AP63203 IC is at least $0.50 too.
Unless your application requires high efficiency, has significant voltage differences, or is handling large currents, there is no reason not to just throw in a dirt-cheap LDO.
PSA: Watch out for residual flux residue on your voltage dividers! I've seen parallel resistance as low as 50k. If your rails come up at the wrong voltage they can fry your expensive chips! Consider investing in packaged LDOs at the exact voltage you require.
Residual flux in combination with high resistances is especially scary because the regulator will appear to work "just fine" until some moisture is encountered. Such as when you're spraying R134a around looking for a problem elsewhere on the PCB. Water condenses on the flux near the divider resistors, and now you have (at least) two problems.
Another trap for young and old alike is putting your finger on the regulator IC to see how hot it's getting. Touch the 1M resistor next to it by accident, and now your 3.3V bus is more like six or eight volts...
1) LM317 and LM7805 are not LDOs. LM317 is a series regulator, which is way more flexible and has some infrequent but difficult-to-emulate use cases. LM7805 is a linear regulator but has substantial voltage drop relative to a modern LDO. Enthusiast/hobbyist space would do well to consider alternatives to the LM317/LM7805 if they're designing PCBs with surface mount components and very simple power rail needs, but for quick and dirty through hole designs there's few well-known alternatives that are truly LDOs - maybe MCP1700?
2) Enthusiast/hobbyist market isn't too sensitive to bulk pricing. Case in point: LM317 is about a dollar in hobbyist/enthusiast quantities, and LM7805 is comparable. TI lists 1ku TO-220 pricing at $0.65. You're definitely right for real products with mass manufacturing, but hobbyists don't generally haggle over pennies.
Tip for power supply stuff, derate the heck out of everything. Voltage current and power derate by 2X and you usually won't have issues.
See section 2: https://www.ti.com/lit/ml/slup239a/slup239a.pdf
They claim that the darlington voltage drop is ~2V which is suitable for 5V to 2.5V regulation, and then introduce 100mV with an NFET as low-dropout for cases where LiPO cells are 3.6 V, or 300 mV above industry standard 3.3V (or the new embedded expectation of 1.8V or 1.2V off a 2x 700mV cells).
However, what if I need to regulate 3.35 V to 3.3 V, do I need an Even-lower LDO (ELLDO)? That meants we have HDO (2V), LDO (.1V), ELLDO (0.05V), which becomes an absurdly semantic situation.
I think the confusion is that engineers picked the words and it is based on the technology of a current point in time. In their mind, the breakpoint is NFET dropout of 100mV, which is purely subjective. Although I could also argue that my example is silly because it is within the range of tolerance of most datasheets spec for Vin of 3.3V +/- 1%.
I still stand by the characterization of LM317 and LM7800 family as "not LDOs". Both devices are Darlingtons with at least two Vbe drops across the series pass element. On the continuum of LDO------Not_LDO, both LM317 and LM7800 are firmly on the Not_LDO side.
The rise of 3.3V devices created a demand to derive regulated power from a 5V rail. Traditional linear regulators are unsuitable for this because the dropout voltage is in the range of 2V. LM317, the most likely old school variable output candidate, is 3V drop and can't do the job either.
Another interesting point is its "generally" easier to buy/build constant current linear sources than constant current switching sources. Plenty of sensor applications where you want to mostly just limit to 4-20 mA or similar.
Final point to make is "generally" with massive hand waving and isolated exceptions, linear sources are harder to destroy via inductive loads and oscillating loads and ESD / EMI impacts.
If you're careful about the converter design (keep the high-current loops extremely short, use counter-rotating loops to tightly confine magnetic field within those short loops, use a soft-switching topology to reduce EMI and sharp edges at the switch node, switch quickly or use multiple parallel converters at different phase offsets to reduce magnitude of current ripple), you can get decently low noise. There's a good Jim Williams app note about this.[0]
But it's almost never worth it to do this, since there's LDOs with two or three orders of magnitude better noise voltage. There's a time and a place for a really low noise converter; usually EMI constrained galvanically isolated converters like medical supplies or scientific instruments need them and aren't too sensitive to the cost or development effort. But even then, you'll often find LDOs cascaded on the outputs just afterward, since a good LDO can add another two orders of magnitude of ripple rejection in the switching frequency band.
[0] https://www.analog.com/media/en/technical-documentation/appl...
Switching pre-regulators followed by a high PSRR LDO with some filtering can work here
Of course once I figured that out I found self-contained switching regulator modules like the RECOM R78-K and RPM series which are foolproof and cheap. Well the RPM modules were cheap at the time, but apparently they've doubled in price. Maybe that was an introductory thing or the supply chain got to them.
I've written my fair share of datasheets now, and while most of us are trying to do a good job and be clear and helpful, sometimes the stuff below the spec tables in the datasheet is, uh... less good than we'd like, for any number of reasons (inexperience, no time, someone left halfway through writing the datasheet, someone forgot to clean up copy-paste from the other datasheet with the slightly different thing, etc). I guess my point is: trust, but verify.
If not for being mechanical, I could imagine using a 48V motor and a 5V generator; both can be 95%-98% efficient.
(I think perhaps his irrigation pivot needs 3-phase power. I'm pretty sure all of his well pumps are run by de-tuned automotive engines converted to run on natural gas.)
Dips shouldn't kill it (unless it's inherently unstable) but spikes definitely can.
Spikes can be addressed with appropriate input protection. A big, low-value resistor with a TVS behind it should take care of spikes.
But this shouldn't be a difficult problem to solve. Converting 48V to ~5V is extremely common in PoE equipment. There are numerous off the shelf designs designed for it. It's likely you were looking in the wrong place (e.g. searching for "buck" instead of "flyback").
Most Wall AC Adapters will operate at 48V. This has been used by the ebike community for a while to power lights and accessories. I use an 120VAC molex hdd ac adapter to get 12V and 5VDC out of 48V batteries.
https://www.youtube.com/watch?v=FqT_Ofd54fo https://www.youtube.com/watch?v=AmfLhT5SntE
He also has good guides on digital audio processing and sensor fusion.
Highly recommended channel.
Articles like this that start from highschool circuits and move to professional discussion are super useful to refresh my memory neurons. DigiKey has a huge number of articles like this, which walk you from the naive circuit and then point out errors (e.g.: https://www.digikey.com/en/articles/how-to-power-and-control...)
More please!
Although it's from a different starting point (AC, not DC), after reading the article it seems they could use an AC->DC converter and then a charge pump.
Is that what they actually use? Or is there something easier/cleverer when starting from AC?
But switch mode power supplies are probably more efficient and highly miniturized, better adapted to different line voltages, etc. All around a better choice. Some sort of smarts are needed to work well with dimmers as well.
Also, the LED diodes themselves will often be multiple in series (a string), or series-parallel (several strings in parallel) depending on the bulb, that end up needing more than just 2V, anywhere from 12V to 60V or so per string of diodes.
Sometimes the high power diodes being used are themselves a series chain of diodes on a singular piece of silicon encased in a blob of phosphor, so that the diode package ends up needing 12V or so. These are often referred to as 'COB' diodes.
(apologies for the RAS syndrome, but saying 'LE diodes' or just 'LED' to refer to the individual light elements when talking about 'LED bulbs' is too confusing otherwise)
Switching DC/DC is generally what you want. Buck -> V down, boost -> V up, buck-boost -> V up or down (sometimes 2 PSUs or 1 with shared components).
I have a 90VDC to 12VDC 10A buck converter to power a train air horn on my electric scooter. It's in a solid-state, ruggedized, industrial form-factor that's potted into a heatsink.
There's actually a bunch of ways to make buck-boost style converters that can do both functions, like the cuk and sepic topologies. There's also bidirectional bridge converters that can change input and output direction - you see this a lot on hybrid vehicles (12V to 48V or vice versa) and electric vehicles (48V to 400V and vice versa).
There's a handful of projects where the size of the solar field is large enough to make it economic to step up from 400V or 800V bus. I've seen many 1000V buses, a few 1200V and 1500V buses. Honestly it's exactly the same circuits, just with higher voltage ratings; all your switching elements are still giant hockey pucks, you're still doing a three phase hex bridge, etc. The half-assed flyback is sometimes replaced with something a little less braindead.
On top of that they have to comply with a whole host of safety regulations, so even if the theoretical block diagram is as simple as you've outlined it the actual implementation is likely going to be a lot more complex and interesting.
Any pointers to where I can dig around without opening one up myself would be greatly appreciated, most of the youtube stuff is for very cheap or small gear.
Most of the inverter designs offload all the complexity to the software controller in an attempt to keep the power component choice and placement simple. The cool control stuff is mostly available in published IEEE papers, particularly from 2015-2020. It's not open-access, but it's definitely easier to get ahold of IEEE papers than a PV inverter. Once you know what you need to implement, the rest is just software engineering.
The commoditization of computing power, and the continuous decades of improvement in digital hardware performance per watt, has reduced numerous classes of analog problems to an exercise in fast enough bit-twiddling. I think in motor drives the big jump to simple hardware and beefy controller was directly downstream of the creation of usable 32-bit motor controller DSPs, along with software toolchains that made it possible to compile optimized C and C++ libraries for these architectures. Up to early 00's there just wasn't enough real-time computing power available for most of the market to take advantage of it, and what little did exist wasn't directly targeted at motor drives. But it is worth pointing out that the S-curve of digital adoption probably got started as far back as the mid-90s; the only people who could really take advantage of it back then were at the cutting edge with very expensive low-volume projects. I'm sure it felt like an overnight event, but it took a decade for motor drive DSPs and software toolchains to get good enough that most people felt compelled to switch.
ETA: oh gosh I forgot FPGAs happened then too, that probably had a lot more to do with it... Ah well, fun trip down memory lane :)
It's been very interesting watching as the compute gets cheap enough that we can start embedding it into the analog chips. The telecom chips all have DSPs in the ADCs and DACs and digital PLLs in the line cards, the battery management ICs all have microcontrollers for charge management and safety, you can buy radar ASICs for automotive proximity detection, there's gate drivers for SiC FETs in automotive traction inverters that incorporate redundant microcontrollers to do monitoring and fault detection/recovery for ASIL D compliance. So I'd add: the same way that software drives the marginal cost of complex math to near-zero, advances in digital circuitry and ease of incorporation into other analog designs drives the marginal cost of complex application requirements down. It's not quite as stark as software, but it's amazing how much quicker a single complex chip design becomes when you can digitize a subclass of the problems and solve them in real-time at virtually no cost on analog ASICs with built-in CPUs and DSPs. Analog hardware advances are extremely challenging by comparison, and can take years of R&D across a wide array of reliability and performance assessments before they become realized in designs.
Just don't make the basic mistake of reading the 25V maximum input voltage/ 1.5A maximum load current specs for an L7805 and thinking you can pull 1.5A at 5V from a 24V supply - it will quickly go up in smoke. You must understand the operating principals and what "thermally constrained" means.
How do these work?
Although suddenly I wonder why you wouldn’t just use four of them for 40 ohms, or eight for 80 ohms…
Can a mega pack battery output be converted 10kVDC without an AC step ?
Industrially, no. You're asking for an automotive ignition without a coil, pretty much not done.
Various logic chopping options exist to be technically correct. If you define a pulse as not being "AC" because its not a constant waveform or its not wall outlet 50 hz or 60 hz, then sorta kinda thats an engine ignition coil. If you define a tesla coil as not being AC because its a resonant ckt with a quarter wave antenna colocated, then sorta kinda sure no AC.
To answer your question more directly: stepping a battery's output to 10 kV is a good example of an application that would almost always be done with a dc/dc converter in an industrial application.
(Aside: "without an AC step" is slightly tricky. If by AC you mean 50 or 60 Hz, definitely can and should be avoided. But AC is generally used to refer to any non-constant voltage or current, and if that's what you mean then the answer is no since a dc/dc converter works by switching, which by definition means there's some sinusoidal voltage somewhere in the circuit.)
(Source: I used to design integrated circuits for industrial control.)
[1] https://en.wikipedia.org/wiki/High-voltage_direct_current
thanks. lots of good details in this thread.
> if by AC you mean 50 or 60 Hz, definitely can and should be avoided.
Yes, i meant avoiding the maintenance and losses of an actual transformer
The kind of DC-DC converters that work well for megabattery to 10kVDC conversion will look very different from the kind of DC-DC converters that step up your 3.3V rail to 5V for some low-power peripheral, and may actually have individual components that completely reverse current direction for more efficient current transfer. You pretty much need a transformer to handle the high power transfer and voltage ratio mismatch. Depending on the pack voltage you might use multiple stages cascaded, but typical 400V-800V packs can step up to 10kV in a reasonable number of turns (12-25). The battery pack side probably has IGBTs or SiC FETs driving some kind of large bridge switcher (or several parallel bridges); the 10kV side probably has some big chonker diodes in a rectifier bridge, though they conceptually could be replaced with synchronous switches if you could find thyristors with fast enough switching speed and better efficiency (usually it's not worth it). Technically this topology runs the transformer primary current in both directions (hence the rectifier at the output) so I guess this is the "AC" stage in the middle... But it's worth pointing out that the AC portion is incidental to operation, unlike something like a Tesla power wall using an AC inverter to feed power into the AC grid, and a grid-connected charger converting that back to DC.
As a visualization, the hydraulic ram pump[1] is the water equivalent of a DC boost converter[2]. At no point in the cycle does the water flow in reverse. Same with the DC boost converter.
It is true that in most cases the inductor current isn't changing direction though.
Any AC inside the circuit is due to imperfections, like the reverse recovery time of the diodes or similar.
Step 2: Stop shorting the inductor. Inductors cannot instantaneously change current, so the now-built-up magnetic field continues pushing current into the switching node. The magnetic field and the inductor current linearly ramp down over time.
The forced current will push charge onto the parasitic capacitance of the switch (from switch to ground), the inductor itself (from inductor output to inductor input), and the reverse diode capacitance (anode to cathode).
Since capacitor voltage is charge over capacitance, once enough charge is forced onto the capacitance at the switch node, eventually the voltage from the switch node to the output capacitance is high enough to turn the diode on in forward conduction. The rest of the inductor current is forced into the output capacitance until the remaining magnetic field in the inductor is depleted.
Step 3) Repeat very fast to reduce inductor size and ripple current required (100s of kHz or MHz speed). Vary the duration for which the inductor is shorted in step 1 according to how much charge you need to put on the output capacitor. You could figure this out open-loop by noting that output current at the high voltage side is in charge per second, output voltage is equal to charge over output capacitance, calculating the time taken for the ramp to grow and decay, etc. Or you could design a closed loop control scheme that looks at the output voltage and converts it to shorted duration for you (this is what most integrated circuit boost converters do).
In summary, you dump current into a inductor to build up a magnetic field, then you use the inductor's magnetic field to yeet current up over a large voltage difference.
Spin up a fly wheel then let it hit the dogs greatly amplifying the torque through stored kinetic energy similar to an inductor being dumped.
https://www.youtube.com/watch?v=xQzqNnWG21s
I always like how electricity can be compared to mechanical and hydraulic systems, it's not always perfect but there is obviously a lot of overlap between voltage, current, pressure, flow, torque and rpm. Power is the common thread.
Switching voltage regulators are just gearboxes for electricity.
Maybe you could even say LDOs are kind of like brakes on a car, since they throw away energy as heat to regulate speed.
LDO's as brake yes I see that.
However the analogy is never perfect even if useful.
How does this jive with conservation of energy though?
To keep things simple, imagine a lossless boost converter. In terms of power-in and power-out, a lossless converter has the same input and output power. If the converter output is doing real work (resistive load), the output power is equal to the output voltage times the load current. Therefore, at a lower input voltage, the converter sees a much higher input current than the load current - it has to, because power-in equals power-out. If it intuitively feels like you're pulling more energy out of the input capacitor than you're pushing into the output capacitor because of the temporary shorting of the inductor, remember - it's not lost to real work, just cleverly exploited by the transformation to magnetic field to losslessly overcome the difference in potential energy between the input charge at low voltage and the output charge at high voltage.
Energy in cap: E = 1/2 * C * V^2
C = Q / V
E = Q * V / 2
Energy in inductor: E = 1/2 * L * I^2
I = dQ/dt
I don't know how to write out the integral notation on HN, so you can fill in the blanks (sorry) - integrate the inductor current ramp up and ramp down portions, set equal to input charge pulled and output charge pushed, observe that energy is conserved with less charge at higher voltage on the output.Megavolts.
Aka static electricity.
https://en.m.wikipedia.org/wiki/Ebonite
Fun fact: ebonite is used to make fountain pens.