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