Help: Voltage regulator Adj pin theory / examples - Page 1
Forum section: electronics / beginners

author: tifkat
author_rank: Regular Contributor
timestamp: August 13, 2020, 09:12:57 am
content: Hi all,Have watched Dave's PSU design videos (a few times now), trying to understand how the Adj pin works. There are so many videos on YT about how to wire up the voltage divider as described in the datasheets, but nothing seems to really explain how the Adj pin uses this.I have hear terms like Reference Voltage bandied about, and was wondering if the regulator acts by increasing or decreasing the output to get Vref on the Adj pin (ie tries to keep Adj input at 1.2v). Also there are a bunch of examples which discuss how the uA OUTPUT of the Adj pin can be thrown away in the demonstrated equation, and this confuses me. Is it input or output?My interest is in learning how MCU based controller boards can use a rotary encoder and software controlled circuits to put the right voltage (?) on the trace for Adj.Dave kind of talks around it, but nothing specific, or in depth. "Just set the required Vin here and you're set" doesn't explain it enough for me.Would I be able to get useful data out of a simulator? I have nothing to wire up and test with.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 13, 2020, 12:17:47 pm
content: A regulator like LM317 works by adjusting output to keep VREF between OUT and ADJ.Note that voltage is a difference, and the regulator of course can only sense what's between its pins. It's sitting "on top of" whatever the ADJ pin is biased to, and doesn't know any more than that.You can make a digitally programmed regulator by setting the ADJ voltage with a DAC, probably with an op-amp to increase the voltage range covered (since most DACs operate at logic voltages i.e. 3.3 or 5V, but you probably want 0-15V range or something).At that point, the regulator is only serving two functions:1. Voltage follower. In normal operation, the output is always a constant difference (more or less) from the input (this being the VREF), so it's not a perfect following, but any change in the input is reproduced perfectly at the output: the voltage gain is 1.2. Current limiter and thermal protection. When heavily loaded, the LM317 (and many similar regulators) reduces the output above some current, thus limiting output. And if the device gets too hot, it will shut down entirely, until it cools off and restarts, etc.Note that under limiting conditions, it might not hurt to have a diode from ADJ to OUT, so that a heavy load can shunt the ADJ voltage, rather than the driver trying to force ADJ high while the reg is crying uncle. Check the ratings and see if this is necessary.Which also means the ADJ driver should be current limited, which is usually the case when an op-amp is used (check the ratings and performance).At this point, with an op-amp and follower, you really don't need much; the reg is just a follower for the most part. It gives you limiting, which is nice. But it's also not very powerful. It's not much more effort to replace it with a bigger power transistor -- which won't have perfect voltage following, as its base-emitter or gate-source voltage varies with load current and temperature, but the op-amp can take feedback from the output, correcting for that. Current limit and thermal shutdown circuitry needs to be added, a small bother.And then you have any old linear power supply.As for the DAC, that can take several forms:- Proper DAC IC (or peripheral in an MCU so equipped). This is programmed through various means (parallel bus, serial SPI or I2C, etc.), and sets an analog voltage or current at its output. (The current-out types typically are paired with another op-amp to convert it to a voltage. This could be the same amp doing the output scaling.)- Digital pot or R-2R ladder. This is an array of switches and resistors, in a convenient architecture for varying a signal voltage. Often used for multiplying a signal by a digital parameter (e.g., live audio times a volume setting), but it works perfectly fine varying a fixed VREF. (Really old DACs really were nothing more than R-2R ladders and switches; they're more of a relic these days, with integrated buffers being common now.)- PWM DAC. Use a PWM channel from an MCU or timer, to generate a fraction of VREF. Filter the PWM waveform out, and you're left with smooth DC. Downside: quite slow, due to that filter. But for a DC power supply, that's most likely perfectly fine. Note that PWM straight from a logic device, has a VREF of whatever its output voltages are (typically VDD and VSS). This can be buffered with a logic gate on a more precise supply (VREF), or analog switches (going between VREF and GND), to give a more accurate level.Tim

author: tifkat
author_rank: Regular Contributor
timestamp: August 13, 2020, 01:37:16 pm
content: Quote from: T3sl4co1l on August 13, 2020, 12:17:47 pmDoes this mean Vout=Adj + Vref? (or more descriptively: Vout - Adj = Vref: The (potential) difference between Vout and Adj is maintained at/to be Vref ) Trying to understand what "between" means.This would explain the case when 0v is applied to Adj results in 1.2v out, where vRef is 1.2v.If this is constant across the Vin range, 28.8v on Adj would result in 30v Vout, or 3.8v on Adj would result in 5v out etc, where vRef is 1.2v

author: rust_collector
author_rank: Newbie
timestamp: August 13, 2020, 02:19:54 pm
content: it will do whatever it can with the output, to keep the voltage from it to the adjust pin at the vref value.between is here:

author: tifkat
author_rank: Regular Contributor
timestamp: August 13, 2020, 03:07:35 pm
content: Quote from: rust_collector on August 13, 2020, 02:19:54 pm

author: free_electron
author_rank: Super Contributor
timestamp: August 13, 2020, 03:32:14 pm
content: A regulator is basically an opamp in non inverting configuration. it's reference is set by an internal structure ( typically a bandgap reference of 1.2 volts , or , in modern regulators , 0.9 or even 0.65 volts or lower )So : such a system will move its output to create the same voltage on the ADJ pin. only then is the system in balance.You do NOT apply a voltage at the ADJ pin. the regulator does that , through the resistor divider. The divider ratio sets a 'gain' factor. For example : for every volt at the output we get 0.1 volt at the adj pin. so , to reach 1.2 volt at the adj pin we need 12 volt at the output.To go to your example where you want to use a microcontroller to set the output : that doesn't work . You would have to manipulate the internal reference ! or you have to manipulate the gain factor. You can manipulate the gain factor using a digital potentiometer.But you are better off making an amplifier and control the 'input ( reference ) voltage.There are Ic's that do this work. they are called tracking regulators. The output tracks the input multiplied by a gain factor.

author: magic
author_rank: Super Contributor
timestamp: August 13, 2020, 08:46:29 pm
content: Quote from: tifkat on August 13, 2020, 01:37:16 pmThat's exactly how LM317 works. It passes current from IN to OUT until OUT reaches 1.25V above ADJ.You can tie ADJ to ground or set it to any arbitrary voltage and the output will be 1.25V higher than that.But the typical application is to connect a divider to ADJ and effectively multiply the 1.25V by the division ratio.

author: David Hess
author_rank: Super Contributor
timestamp: August 13, 2020, 10:48:19 pm
content: I can understand your confusion and it comes about because floating regulators like the 317 are wired upside down in the conventional sense.Normally one thinks of a voltage reference referenced to ground, really common, followed by an error amplifier. But floating regulators like the 317 have their voltage reference referenced to their output, so the adjustment pin which is the input to the error amplifier is fixed below the output by the reference voltage instead of fixed above ground.Draw a conventional regulator circuit and then flip it upside down.

author: tifkat
author_rank: Regular Contributor
timestamp: August 13, 2020, 11:18:09 pm
content: So I've got how the regulators work now. Thanks for all of your input.Now I have a question about the use of VREF. Typically, I see circuits with a specific voltage applied at an input, and that's used as a reference, hence VREF. But in regulators like the LM317, this doesn't seem to be the case. It's almost like the device requires a minimum voltage to operate, and so that's a fixed value which MUST be considered in EVERY calculation performed during it's operation, so the VREF term is used in a DE FACTO manner, even though it's not a discrete input voltage used as a reference.Does this sound about right? It feels like conceptually, it's some sort of 'esoteric' knowledge owned by insiders and used by people who know, but someone trying to learn isn't considered when a quick explanation is give. Like an industry idiosyncrasy.I am in no way being critical, just getting my head around how specific terms can be 'overloaded' in their use, and can cause confusion for those who don't know.

author: tifkat
author_rank: Regular Contributor
timestamp: August 14, 2020, 02:16:52 am
content: Doing my own search on uses of Vref, turns up the there are actual components sold as a 'Vref'. Some sort of silicon implementation.From this, I assume that Vref, is essentially a voltage supplied to a circuit, which is used as a 'reference' in the operation of a circuit.There are also 'Vref circuits', which can be built from discrete components which are used to supply a stable voltage, or an adjustable voltage, which is use for the Vref. So there are Vref circuits, which are also termed 'Vref', for short.Then there are the silicon implementations of these circuits, presented in a THT or SMD package, which is sold as 'a Vref'. "This Texas Instruments Vref can be adjusted to supply a wide....."Am I understanding correctly, or just confusing myself?

author: ledtester
author_rank: Super Contributor
timestamp: August 14, 2020, 05:29:21 am
content: "Vref" comes from the way electrical quantities are named. In print it would appear as \$V_{\text{ref}}\$ -- i.e. a "V" with a subscript of "ref".The "V" means it refers to a voltage.The "ref" subscript indicates that voltage plays the role of a reference in the circuit. Usually this means that voltage is fixed or at least constant throughout the operation of the circuit.A "voltage reference" is a circuit or device which produces a fixed voltage as an output. A power supply also produces a fixed output voltage, but voltage references are much simpler devices and are not designed to supply a lot of current. instead they are engineered for high precision of the target voltage, low noise, temperature stability, low power requirements among other qualities. The outputs of voltage references are usually voltage dividers and the high impedance inputs of devices like op-amps and comparators.So a voltage marked "Vref" in a circuit usually comes from a voltage reference device. In the LM317 there is a 1.25 bandgap voltage reference in the chip.

author: magic
author_rank: Super Contributor
timestamp: August 14, 2020, 05:34:41 am
content: Voltage references normally are circuits which output some fixed voltage.LM317 doesn't really have any 1.25V voltage reference inside; such voltage wouldn't be possible to generate because it's 1.25V below the other power supplies available to the chip (IN and OUT). It can only measure the voltage externally applied to the ADJ input (the ADJ input is high impedance) and decide whether it's -1.25V already or not enough yet.LM317 can be made into a (low precision) 1.25V reference by connecting ADJ to ground.

author: ledtester
author_rank: Super Contributor
timestamp: August 14, 2020, 05:46:20 am
content: Quote from: magic on August 14, 2020, 05:34:41 amOk - perhaps I read too much into the Wikipedia article. The LM317 does have a bandgap reference which is used to produce a stable 1.25V reference voltage -- what exactly that reference is is another question.https://en.wikipedia.org/wiki/LM317#Voltage_regulator

author: magic
author_rank: Super Contributor
timestamp: August 14, 2020, 06:11:29 am
content: As a general rule, Wikipedia isalwayswrongThere is a schematic in the datasheet so whoever wrote that paragraph is welcome to show us where this "stable reference voltage of 1.25V" and that "feedback-stabilized amplifier" are, exactly.But you are right in the sense that I may be overcomplicating things. You can actually imagine that there is a small 1.25V voltage reference inside powered by the IN and ADJ pins (and that's why 50µA always flows out from ADJ) and a unity gain voltage follower opamp powered by IN and OUT (so it's quiescent current flow to OUT) which buffers that 1.25V-above-ADJ reference voltage to the OUT pin. If you imagine that, your understanding of LM317's behavior will not be wrong. But it's a convenient lie

author: newbrain
author_rank: Super Contributor
timestamp: August 14, 2020, 11:14:06 am
content: Quote from: magic on August 14, 2020, 06:11:29 amThis looks suspiciously as a part of a bandgap reference, hanging on the ADJ terminal on one side and a current mirror on the other...EtA: and the TI datasheet is probably as wrong as Wikipedia...

author: Circlotron
author_rank: Super Contributor
timestamp: August 14, 2020, 11:36:25 am
content: Quote from: rust_collector on August 13, 2020, 02:19:54 pmThis is the correct pinout:

author: magic
author_rank: Super Contributor
timestamp: August 14, 2020, 12:03:57 pm
content: Quote from: newbrain on August 14, 2020, 11:14:06 amTI datasheet looks right (although I recommend caution with TI schematics, see OP-07) and Wikipedia is wrong.There is not a single place in this circuit where the reference voltage of 1.25V with respect to ADJ ever exists, except for the output node. If the output node is not in regulation (shorted to ground, thermal throttling, whatever) then nothing inside is at 1.25V, unless by accident.The circled circuit is so-called Brokaw cell. The two common base transistors generate collector currents which are equal if and only if ADJ is exactly 1.25V below their bases, connected to OUT. The rest of the circuit tries to equalize their currents.Okay, one thing I got wrong is that ADJ is not really high impedance. Common base input impedance is low and the resistors only increase it to some 12kΩ (about 0.6V / 50µA).editLM317 regulation loop is actually very simple. Right above the Brokaw cell is a current mirror which subtracts the cell's currents and generates voltage swings at the high impedance node on the left side. This node drives a string of five PNP and NPN emitter followers which ultimately drive the output.