So, what’s the special sauce in a vrm that allows it to compensate like that?
The full answer requires roughly a 3rd year's course in Electrical Engineering. I'll try to summarize, but I'll inevitably miss a concept or two.
-
Transistors are the fundamental answer. Various VRMs are made from different transistors, but the core concept is that they have 3 pins: input, control, and output. The voltage on "control" controls the voltage on "output" (which is drawn from "input"). Fully understanding transistors is... difficult. So lets not talk about transistors, at least not at the beginner level.
-
Instead of discussing raw transistors, there's a combination of transistors called an 'OpAmp', which is easier to understand. This has 5 pins: positive-voltage-source, negative-voltage-source (usually tied to ground), PlusInput, MinusInput, and output. Ideally, the OpAmp creates "output = Infinity * (PlusInput - MinusInput)". Yes, you heard me, times infinity. In practice, it is "only" times 10-million or maybe times 100-million, but just pretend its times infinity, its so much easier to understand.
-
If you create a negative-feedback loop (that is, connect "output" to "MinusInput"), then the infinities cancel out and now PlusInput controls the voltage. Seriously, check the math. Say "A" is the gain (which is infinity), then...
- output = A * (PlusInput - MinusInput)
Except MinusInput is output, we connected them together. So replace it with output.
- output = A * (Plus - output)
Shuffle stuff around...
-
output = A * Plus - A * Output
-
A * Output - output = A * Plus.
-
(A - 1) * output = A * Plus
-
(A - 1) / A * output = Plus
If "A is infinity", then infinity-1 is infinity. (lol, yeah, math works like that. Infinity is a funny number), so this means that...
- (infinity-1) / (infinity) * output = plus
- (infinity) / (infinity) * output = plus
- output = plus
Now no matter what the output tries to be (which is changing because of changing resistances), the OpAmp will magically "hold" the voltage from plus and react in time.
Yes, this works. Yes, it sounds stupid, the math works and I've made many creations that do this kind of analysis. In practice, since the gain is "only" 10-million, you get: 9,999,999 / 10,000,000 * output = plus, but that's small enough that we can ignore the error.
- To provide a "constant" voltage into the PlusInput, we use a Zener Diode. Zener Diodes work by "breaking" on purpose. As it turns out, you can manufacture diodes to "breakdown" consistently at a particular voltage. You can buy ZenerDiodes that break down at specific voltages, which means that the Zener Diode's output will always be the same voltage.
Zener Diode + OpAmp is probably the simplest conceptual design for a voltage regulator. Real life VRMs include more features, like overcurrent protection and other detection. But you can imagine how additional OpAmps with just the right magic / wiring can provide these features.