Connect with us

DAC zero code = zero volts, best way??

Discussion in 'Electronic Design' started by John, Jul 24, 2006.

Scroll to continue with content
  1. John

    John Guest

    Instead of manually adjusting a pot (voltage divider) to set the
    desired current level through a servo loop (op-amp driving a FET), I'd
    like to use a PIC controlling a DAC. My problem is that even
    rail-to-rail DACs only go down to a few millivolts, not true zero
    volts, when the DAC code is zero. This few millivolts prevents me
    from setting my current levels low enough for my use. I have a bunch
    of servo loops and it adds up quickly.

    I was thinking that I could have the PIC multiply the desired DAC
    output code by X and then set up a resistor voltage-divider on the
    output of the DAC to divide the voltage by that same X amount (before
    going on to the servo loop's op-amp). This would reduce the zero-code
    output voltage level by X times and give me a much lower minimum
    current level for each servo loop. Using my existing setup, I can set
    X = 30 or so, maximum.

    Is this a reasonable way to reduce the effect of the DAC output not
    being able to reach a true zero volts? Is there a better way? Level
    shifting of some kind?

    Thanks!
    -- remove SPAMMENOT for e-mail responses --
     
  2. John

    John Guest

    Forgot to mention, I have a +5V supply to the PIC and DAC and a +1V
    reference to the DAC. No negative voltages available.
    -- remove SPAMMENOT for e-mail responses --
     
  3. Phil Hobbs

    Phil Hobbs Guest

    Hmm. Why not post a schematic on a.b.s.e?

    Cheers,

    Phil Hobbs
     
  4. Ben Jackson

    Ben Jackson Guest

    ["Followup-To:" header set to sci.electronics.basics.]

    I can't tell if your problem is that you can't hit zero or that
    you just can't get *close enough* to zero. In other words, is
    the code '1' too high (or too coarse) or is '0' too high for '0'.

    If you want to scale the output ('0' still not 0V, but '1' lower
    and each step finer) then an output divider is fine. However, mind
    the input impedance of your next stage. If you are relying on a
    buffer built into the DAC to drive your next stage, the relatively
    high output impedance resistor divider is going to need another
    buffer. That buffer, even if *IT* is rail-to-rail is going to cause
    you more offset/scale problems near 0 again.
     
  5. Tim Wescott

    Tim Wescott Guest

    You mention in your add-on that you have no negative voltages available.
    You may find that the easiest and most compact solution you can do is
    to supply a negative rail so you _can_ bring your voltages down to some
    true zero.

    An alternative is to supply yourself with a virtual ground. Normally
    I'd choose a voltage that's 1/2 my supply voltage (less if I'm using el
    cheapo op amps like the LM358 that go close to ground but only approach
    the top rail to within 2V or so). It sounds like you don't need to
    servo on the negative side, so you may be able to do OK with a 0.5V, or
    some other low value which you know your DACs can always fall below. If
    you need a really precise zero you'll have to develop this voltage
    carefully.

    If you don't need an exact amount of shift you can drive a resistor
    through a diode. This will always put you one diode drop below the DAC
    output, but you will learn amazing things about how much a diode drop
    can vary with current and temperature. This technique also won't work
    if your following stages are dumping current into the resistor.

    --

    Tim Wescott
    Wescott Design Services
    http://www.wescottdesign.com

    Posting from Google? See http://cfaj.freeshell.org/google/

    "Applied Control Theory for Embedded Systems" came out in April.
    See details at http://www.wescottdesign.com/actfes/actfes.html
     
  6. Why not make a small negative voltage? Have one of the PIC outputs
    generate a square wave, couple the output with a nice cap and
    follow with a rectifier, regulator etc.
     
  7. John

    John Guest

    Yea, I shold have posted the circuit. It's Win Hill's recommended
    circuit from a while ago and has worked well when manually adjusting
    the pot off the reference.

    I'm using a .005-ohm shunt so if the DAC (MCP4921) can only drop to
    10mV with a DAC code of zero (instead of 0.000V) then each FET will
    set up to pass (0.010mV/0.005 ohms) = 2 amps per FET as the minimum
    current level I can set. Too high. I can't increase the resistance
    of the shunt anymore (current level is too high) so I was thinking I
    could drop the DAC's min. output voltage with a voltage divider.

    Using my example of divide-by-30 resistors on the output of the DAC,
    the 10mV output for a DAC code of zero would drop to 0.33mV. This
    would give me a min. current level of 67mA through each FET. Not
    ideal, but I could live with that.

    I'll look over the other ideas brought up in other posts. I'm sure
    I'll have a couple more questions though. :)





    SHUNT = 0.005 ohm, 1%, 5W
    R6 = 1K, 1%
    .. Vcc R2, R3 = 49.9K, 1%
    .. | R4, R5 = 10K, 1%
    .. R1
    .. |
    .. +------, Vcc ,-----+-----
    .. | | | LT1013 | x |
    .. 1V REF POT <-+--R2--+-----|+\ D |
    .. | | | | | >--+--R6-- G |
    .. -+------+-, | | ,--|-/ | S |
    .. | | | | | === C1 | |
    .. low-level | | | | | | | |
    .. signal GND +--|--R3--|--+----|---+---R5----+ |
    .. | | | | | |
    .. | | | | SHUNT |
    .. | | | | | y |
    .. | | '--R4---+-------------+-----|-+--- RTN
    .. | | | |
    .. | | | |
    .. | | Vcc ,-----+ |
    .. | | | | | |
    .. | +--R2--+-----|+\ D | |
    .. | | | | >--+--R6-- G | |
    .. | | | ,--|-/ | S | |
    .. | | | | | === C1 | | |
    .. | | | | | | | | |
    .. GND +--|--R3--|--+----|---+---R5----+ | |
    .. | | | | | | |
    .. | | | | SHUNT | |
    .. | | | | | | |
    .. | | '--R4---+-------------+-----|-+
    .. | | | |
    .. : : etc etc - N stages : :
    .. : : : :
    -- remove SPAMMENOT for e-mail responses --
     
  8. Rich Grise

    Rich Grise Guest

    I vote with this - that's what I'd do if I needed a "real" zero.
    Admittedly, the last time I did this I already had the negative
    supply, but as Frank writes, enough negative volts for bias should
    only cost a few parts.

    Good Luck!
    Rich
     
  9. Tim Wescott

    Tim Wescott Guest

    "A rectifier"?

    Two caps, two diodes:

    ||
    o----||--o--->|---.
    || | |
    | V
    |
    '---|<----o-----O -Vout
    |
    ===
    |
    V

    With reasonable op amps and not-too-strict requirements you may not need
    to regulate, either. Check you power supply rejection ratio, and
    consider a simple RC filter to decouple the ripple.

    --

    Tim Wescott
    Wescott Design Services
    http://www.wescottdesign.com

    Posting from Google? See http://cfaj.freeshell.org/google/

    "Applied Control Theory for Embedded Systems" came out in April.
    See details at http://www.wescottdesign.com/actfes/actfes.html
     
  10. Jamie

    Jamie Guest

    you need some small amount of - Voltage.
     
  11. Jamie

    Jamie Guest

    you need to use a + - rail supply so that you can balance
    the op-amp at zero.
     
  12. Oh sure, that must be a language problem. Rectifier and diode are the same
    thing for me. I certainly didn't mean a bridge-rectifier. There is a
    nice improvement half way down this page:
    http://murray.newcastle.edu.au/users/students/1999/c9221792/doubler.htm
     
  13. John

    John Guest

    You may find that the easiest and most compact solution you can do is
    I'm beginning to think that may be the case. The neg voltage ripple
    might be a problem though but testing will tell.

    Yea, might get ugly quick though. A quick&dirty true neg. voltage or
    fully regulated one (if needed) seems to be my best bet so far.

    Thanks!
    -- remove SPAMMENOT for e-mail responses --
     
  14. John

    John Guest

    Why not make a small negative voltage? Have one of the PIC outputs
    Thanks for the recommendation and the ckt! I'll check some specs and
    whip up a prototype to test.
    -- remove SPAMMENOT for e-mail responses --
     
  15. PeteS

    PeteS Guest

    If you use a charge pump at -5V (you have +5V available) and then
    regulate to -3.3V (or some other arbitrary value more suitable in your
    view, but at least 1.5V away from the rail) you should be able to keep
    the negative rail ripple quite manageable.

    I have found the charge pumps work perfectly well from -Vin to -Vin + 1
    across the load range of perhaps 100mA. With a followon LDO, that
    should work perfectly well.

    Cheers

    PeteS
     
  16. almo

    almo Guest

    I'd just tie one of the unused I/O pins to the DAC output via a
    resistor. I think you can set the I/O pin to high impedence. Then,
    when you want to go to 0 volts (ground,) just let the second I/O pin be
    a digital output and set it to "0" and draw the voltage to ground (sink
    the current.)

    Almo
     
  17. First of all you are a stupid top poster, and secondly the OP
    wants to get rid of the last few mV so your idea is totally
    worthless.

    PLONK and good riddance.
     
  18. almo

    almo Guest

    Hey...I'm only in 7th grade. Cut me some slack.

    Hey...I'm only in 7th grade. Cut me some slack.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-