1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Help:Digitally controlled current source

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by abicash, Apr 28, 2009.

  1. abicash

    abicash Member

    Joined:
    Feb 12, 2007
    Messages:
    432
    Likes:
    3
    Hello

    I am in the thought process for a new project where one of the modules is to design a Digitally controlled constant current source (50mA-1A in steps of 10mA).
    I am thinking about using the Silab's C8051F021 with a 100ksps sampling rate 12-bit-ADC and 12-bit-DAC.

    I am looking for some starters/pointers on designing the CC Digital control.

    Please help as usual.

    Thanks and regards
     
  2. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
  3. abicash

    abicash Member

    Joined:
    Feb 12, 2007
    Messages:
    432
    Likes:
    3
    Hello again Sceadwian

    Thank you so much.I will take a look

    Thanks and regards

    EDIT:

    After taking a look at the ckt I have a few questions (if you may :))

    1)If the Load is a short ckt,what is the profile of the current.(i mean whats the response time)..I see you raised a question of frying the LED's

    2)Is it linear over 8bit?
    3) Whats the resolution of o/p current..

    All these q's based on presumption that you built this one...

    Thanks and regards
     
    Last edited: Apr 28, 2009
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US

    It's linearity is that of the opamps+DAC (should be nearly perfect)

    The frying the LED was only a theoretical question, I have built the analog version of this (No DAC it uses a POT instead) and it works fine.

    The resolution from a 12 bit DAC at 1amp max current is going to be 240µ amps. At 8 bits it'll be 3ma
     
    Last edited: Apr 28, 2009
  6. abicash

    abicash Member

    Joined:
    Feb 12, 2007
    Messages:
    432
    Likes:
    3
    I asked about the frying thing since I am going to use this as a switched (not SMPS) current of set currents for a set time (50msec to 500msec) ...one time only..

    So i was thinking about the response...Will it settle in that time?
     
  7. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    The settling speed will be determined by the opamp you use and any delay in the feedback loop, though I'm not sure how it'll react to highly reactive loads. What will you be feeding the current into? Actually, as was pointed out to me technically this is a current sink, so what will you be pulling it out of?
     
  8. abicash

    abicash Member

    Joined:
    Feb 12, 2007
    Messages:
    432
    Likes:
    3
    Yes thats the idea ..i mean current sink

    And the load would be a low ohms nichrome wire (1-5ohms)

    I want to give a preset current for a preset time impulse.

    Say if i set it at 50msec for 50mA...the load should get just that.
     
  9. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,139
    Likes:
    566
    Location:
    AZ 86334
    I reran the sim with a "short" (1mΩ) as a load.

    Note the dissipation in the FET.

    Note that V(s) follows V(c).

    I(R1) {your load} is equal to I(R2) {because FET's gate current is ≈ 0}.

    The voltage divider R4-R3 scales the DAC's voltage to 1V at V(c).

    The linearity is as good as the linearity of the DAC itself.
    With an 8 bit DAC, you would be able to produce 2^8=256 steps. If you need higher resolution, get a 10bit or 12bit DAC.
     

    Attached Files:

  10. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Why do you want variable current and pulse width?
    You're better off simply PWM'ing the nichrome at the maximum voltage/current you can provide and changing the duty cycle to adjust heating. Losses in the fet are less then, and it's FAR more effcient.
     
  11. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,139
    Likes:
    566
    Location:
    AZ 86334
    He will still want something like my circuit unless his primary power supply provides the current limiting. He can do the PWM by loading the DAC with a finite current value followed by a "zero" value at a rate determined by the controlling processor. Reducing the duty-cycle using processor-controlled PWM would proportionally reduce the dissipation in the NFET.
     
  12. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    I don't get it, the only thing using a variable current source (like the one posted so far) is to limit current, but it DOES NOT limit current, it bypasses it to the FET, it's still used. Straight PWM to a heating element actually reduces power consumption. If it's nichrome wire, it's a heater, the thermal constant of the element will act as a 'low pass' So there's no reason to adjust the current at all, you just adjust the PWM width.
     
  13. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,139
    Likes:
    566
    Location:
    AZ 86334
    Ok, lets make up some numbers. Suppose the resistance of his nichrome wire is 0.01Ω. Suppose his primary power supply is 12V. Based on Ohm's law (other thread :D), the peak current would be 12/0.01 = 1200A. If you consider the on-resistance of a large NFet, it might add 50mΩ so that would reduce the current to 12/0.06 = 200A.

    Seems to me, you want some current limiting somewhere :)
     
  14. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    No. Just pulse the led VERY shortly.
    The power supply itself will limit the current. You're assuming wrongly that a power supply will supply infinite current.
     
    Last edited: Apr 28, 2009
  15. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    Our OP said:
     
  16. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Which isn't bad at all, even worst case (1ohm) that's only 12 watts. Might not even need to heatsink the fet.
     
    Last edited: Apr 28, 2009
  17. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    144 watts for the resistor, but a 10mΩ FET would only be dissipating 1.5W at 100% duty cycle.
     
  18. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    Oh man my brain must be off today. Your numbers are right roff mine are completely wrong =O
     
  19. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    Only because I already had my coffee today.:eek:
     
  20. abicash

    abicash Member

    Joined:
    Feb 12, 2007
    Messages:
    432
    Likes:
    3
    Hello all

    Thank you for all the useful responses.

    Yesterday my 7 month son was down with fever so couldn't reply.He is still cranky..so I am just giving you some details of what I need.

    I would not worry with the dissipation since as I said earlier that this is going to be on for a max of up to 500ms.
    This is NOT a heater as you have misinterpreted.This is a test instrument for a wire that has the profile of a nichrome wire.

    For this i set up a current from 50mA to 1000mA and the time period for which this flows and then press fire.
    I get some data through an ADC to the computer terminal where some graphs are plotted and some calculations are done and a result a printed or stored.

    Thanks and regards
     
  21. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,139
    Likes:
    566
    Location:
    AZ 86334
    Depending on the total wire loop resistance, you could reduce the 12V battery in the circuit I posted to something like 5V, thereby reducing the dissipation in the NFET.
     

Share This Page