Hot!Voltage Regulator Control with DAC

Author
simong123
Lab Member No. 003
  • Total Posts : 1217
  • Reward points : 0
  • Joined: 2012/02/07 18:21:03
  • Location: Future Gadget Lab (UK Branch)
  • Status: online
2012/11/17 08:03:15 (permalink)
0

Voltage Regulator Control with DAC

Over time I have noticed a few people asking how to control, for example, a Buck regulator with a DAC over I2C or SPI for use in, for exmple, a PIC controlled Bench PSU or efficiently driving a Peltier cooler. (The Microchip MCP4725 is Ideal for this).
I have seen various methods proposed, including Digital Pot's, Op-Amps in the feedback loop, etc. However I have found that the simplest way is the best :)
The following circuit requires only 1 extra component (not including the DAC of course) - a simple Resistor.

How it works:-
It is best explained by considering the current into/out of the resistors where they attach to the regulator feedback pin.
The regulator will always drive the output such that the voltage at the feedback pin is at a fixed value (see datasheet for your regulator). In the case of the LM2670 pictured, it is 1.21V.
This being the case, the current through R1 (IR1) will be constant, and equal to the sum of the currents through R2 and Rb (Kirchoffs Law!)( note the current into the feedback pin will generate a small error, though as it is so low, it can usually be ignored ).
The current through Rb (IRb) is simply Rb x (DAC Output - 1.21V).
The current through R2 (IR2) equals IR1 - IRb
 
The voltage drop accross R2 (VR2) is then R2 x Ir2, which gives the Regulated Output Voltage as VR2 + 1.21V
 
A worked example:-
R1=1k33
R2=2k87
Rb=2k87
DAC Max Output = Vdd = 5.0V
 
For DAC input code = 0
 
IR1 = 1.21 / 1330 = 0.909mA
IRb = (0 - 1.21) / 2870 =  - 0.4216mA
IR2 = 0.909 - (-0.4216) = 1.3313mA
VR2 = 1.3313mA x 2870 = 3.82V
Regulated Output = 3.82+1.21 = 5.03V
 
For DAC input code = 4095
 
IR1 = 1.21 / 1330 = 0.909mA
IRb = (5.0 - 1.21) / 2870 =  1.3206mA
IR2 = 0.909 -1.3206 = -0.4108mA
VR2 = -0.4108mA x 2870 = -1.1790V
Regulated Output = -1.1790+1.21 = 0.03V
 
The output is linear for DAC values between these two.
The output of an actual test circuit (with the above resistor values) is displayed in the next image. Note that 0V at the output is not actually achieveable in real life, bottoming out at ~0.11V.

 
Pretty much any voltage range can be achieved, by adjusting the resistor values.
For example:-
R1=1k3
R2=2k0
Rb=6k8
gives an output voltage range of 1.96V - 3.43V.
 
R1=1k
R2=5k36
Rb=2k67
gives an output range of 0.08V - 10.12V

Note:- the above circuit is for illustration only. It does not contain any filtering or protection circuits. It is recommended that the DAC output is filtered as a minimum.  Care would have to be taken on inductor selection.
Legal stuff:- USE THE ABOVE CIRCUIT AT YOUR OWN RISK.
post edited by simong123 - 2012/11/17 08:13:16

Attached Image(s)

#1

9 Replies Related Threads

    DarioG
    humans, die, please
    • Total Posts : 53196
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: porcodioland
    • Status: offline
    Re:Voltage Regulator Control with DAC 2012/11/17 10:42:57 (permalink)
    4 (1)
    Interesting, thanks!
     
    I made a fully-linear (old-style) USB-controlled power supply some years ago... with a PIC and a DAC. It's on this forum too.

    happy palestine!! :)

    #2
    BrimarBob
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2016/11/03 17:44:11
    • Location: 0
    • Status: offline
    Re: Voltage Regulator Control with DAC 2017/04/13 05:53:00 (permalink)
    0
    Hi, This is a great article and I thought I had the answer to my problem but I am not so sure now.  I want to make a variable voltage supply from 0-400V.  The LR8 from MicroChip is a super device and I can use the output to drive a FET and get more power.  The LR8 Adj pin creates a ref voltage relative to the output and not ground so at the worst case, the voltage on that pin would be 400V.  I ruled out Digital pots for the same reason.  Any thoughts on how I can get my PIC to control the voltage of this supply?
    Thanks - Bob
    #3
    CinziaG
    morite
    • Total Posts : 3142
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Voltage Regulator Control with DAC 2017/04/13 10:33:19 (permalink)
    0
    Maybe an optoisolator driven via PWM?

    get my books!
    lulu.com search.ep?keyWords=greggio&type=
     
    #4
    PStechPaul
    Super Member
    • Total Posts : 1712
    • Reward points : 0
    • Joined: 2006/06/27 16:11:32
    • Location: Cockeysville, MD, USA
    • Status: offline
    Re: Voltage Regulator Control with DAC 2017/04/13 12:45:29 (permalink)
    3 (1)
    It's helpful to include links to special devices such as the LR8:
     
    http://www.microchip.com/wwwproducts/en/LR8
     
    http://ww1.microchip.com/downloads/en/DeviceDoc/20005399A.pdf (Oddly, title of this document is 8 bit ADC)
     
    Application notes: http://ww1.microchip.com/downloads/en/AppNotes/AN-H40.pdf
     
    It might be possible to use a high voltage MOSFET from ADJ to GND with perhaps a 1.2 k resistor from output to ADJ. Put something like a 420k resistor across the source and drain to limit maximum output to 420V. Then you may be able to adjust the gate voltage using PWM or a DAC to get Rds of 1k for 2.2 volts or 100k for 101.2 volts. But the linear range is rather sensitive.
     
    Better, perhaps, would be a BJT with a fairly stable hfe of perhaps 100. Adjust the base current via PWM or DAC through a resistor, and the output voltage should be adjustable, like this:
     


     
    #5
    BrimarBob
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2016/11/03 17:44:11
    • Location: 0
    • Status: offline
    Re: Voltage Regulator Control with DAC 2017/04/13 14:14:57 (permalink)
    3 (1)
    That's a very interesting suggestion to resolve my problem. I will investigate further and let you know how I get on. Linear performance is important as i dont want to have to monitor the input or to have to model the reponse. Thanks for your assistance.
    #6
    PStechPaul
    Super Member
    • Total Posts : 1712
    • Reward points : 0
    • Joined: 2006/06/27 16:11:32
    • Location: Cockeysville, MD, USA
    • Status: offline
    Re: Voltage Regulator Control with DAC 2017/04/13 22:32:08 (permalink)
    0
    It won't be very linear, and probably will drift with temperature and time, so output monitoring would be needed. You can make the response quite linear by adding an op-amp as follows:
     


     
    #7
    PStechPaul
    Super Member
    • Total Posts : 1712
    • Reward points : 0
    • Joined: 2006/06/27 16:11:32
    • Location: Cockeysville, MD, USA
    • Status: offline
    Re: Voltage Regulator Control with DAC 2017/04/13 23:05:30 (permalink)
    3 (1)
    Here is an implementation using an N channel MOSFET:
     


     
    #8
    BrimarBob
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2016/11/03 17:44:11
    • Location: 0
    • Status: offline
    Re: Voltage Regulator Control with DAC 2017/05/22 01:58:28 (permalink)
    0
    Thanks for your help.  I also had a chat with Microchip engineers and after some discussion and concerns over heat and power dissipation in some of the other components, I have decided to go for a hybrid circuit that uses the LR8 to produce a stable reference voltage at 425V and then an NPN transistor driven from the op-amp DAC/feedback comparator to vary the voltage drive to the FET output regulator.  It simulates will in LTspice and while not a great response time for voltage changes, it is manageable and the ripple is low enough to not cause measurement issues. I can't upload the image of the circuit as the forum wont let me :(  Happy to supply it on request. Of to build a prototype now ...
    #9
    PStechPaul
    Super Member
    • Total Posts : 1712
    • Reward points : 0
    • Joined: 2006/06/27 16:11:32
    • Location: Cockeysville, MD, USA
    • Status: offline
    Re: Voltage Regulator Control with DAC 2017/05/22 11:58:08 (permalink)
    3 (1)
    It would be helpful to have an image or the actual schematic. You should be able to upload to the Microchip server if the file size and type guidelines are followed. I usually upload images and files to my own web server and use links to those locations. If you like you can send files to me (PM or email) and I can post them. I'm interested in what you and the FAE came up with.

     
    #10
    Jump to:
    © 2018 APG vNext Commercial Version 4.5