I just explored an easy scheme to design a high precision programmed adjustable power.
In this scheme, there is no needs to make a complex PWM circult, just a liner or switcher adjustable voltage regulator and a resister network, a DAC, and a MCU. Resister network change DAC output voltage into feedback voltage and let adjustable voltage regulator regulate output voltage itself.
Outputting an fixed voltage by using resister to control regulator may be easy, but there is a little challenge to output adjustable voltage. My mates used to use digital potentiometer to adjust output voltage, but digital potentiometer is too instable. Lucky, DAC with a resister network works better, and they can provide high precision output witch depends the resolution of DAC.
In this figure, voltage of the node feedback is fixed by the Vref (OR Vsense) of regulator.LM2576 is 1.23V, TPS5432 is 0.808V.
When there is voltage difference between Vout of DAC and Vref of regulator, the difference sets up an current in R2. Then the current through R1 to the ground. This adjustable current could change the resistance because voltage between Vref and GND is fixed and no current will go into Vref pin duo to the virtual short and virtual open of the error amplifier inside of the regulator chip.
Now it's time to value R3, R2, R1. Make sure that the output range of this regulator (Vout) and DAC (Vdac) , and Vref by checking the datasheet of part.
Then, list two equation.
Three unknown resistance, but two equation, we must assume the value of R3. 10K is very common.
Then check the Idac.max to make sure that DAC will not overloaded.
[Update 2014/Tue/22] PS: Three terminal regulator, such as LM317 is not available to this equation because the 1.25V is between Ref pin and out pin.
To be continued.