How Can I Design a Digitally Controllable Constant Current Source?

AI Thread Summary
The discussion focuses on designing a digitally controllable constant current source with a range of 0.25mA to 2mA, using an input voltage of 9 to 14 volts. Initial attempts with an LM317 and a digital potentiometer were unsuccessful, leading to the exploration of an LM334 and op-amp circuits. Participants suggest using a DAC for better current control and emphasize the importance of ensuring the digital potentiometer operates within its current limits. Issues with input bias current in op-amps were identified, with recommendations to provide a DC path to stabilize the circuit. The conversation concludes with successful prototyping using an analog potentiometer and plans for further refinement.
HHOboy
Messages
32
Reaction score
0
Hey guys,

I have been trying to design a constant current source that has a digitally controllable (μcontroller) range of maximum current outputs. Ideally the source would be able to be adjusted from .25mA to 2mA. The input voltage for the source would be in the range of 9 to 14 volts. Also I would like to be able to turn the source on and off fairly rapidly (40Hz) via a digital signal but have not really gotten to this aspect yet in my designs.

So far I have tried using an lm317 with a digital potentiometer to set the current level but have not had much success. Here is a picture of the basic circuit but in my case a 10kΩ digital potentiometer (MCP41010) is R1
lm317b.jpg


When testing the circuit with varying simulated load resistors for some reason the resistance of the load resistor has a large impact on the current that is drawn where it should be limited to a constant current assuming that the resistor is not too large and results in a current to a level smaller than the current sources level.
I believe there is a problem with the use of the digital potentiometer because I have had the circuit work with a regular analog potentiometer in its place. I do not know what the problem because I have measured the digital potentiometer's resistance with my multimeter and it seems to swing over the correct resistances with a code I wrote. Here is a rough arduino sketch to test it...

#include <SPI.h>

int bob = 10;

void setup()
{
pinMode(bob,OUTPUT);

SPI.begin();
}

void setvalue(int level)
{
byte command = B00010001;
digitalWrite(bob,LOW);
SPI.transfer(command);
SPI.transfer(level);
digitalWrite(bob,HIGH);
}

void loop()
{
int i = 0;
while(i<=255)
{
setvalue(i);
delay(1000);
i++;
}

while(i>=0)
{
setvalue(i);
delay(100);
i--;
}

}

I have also tried another method with a lesser know chip called the lm334 here is a pic of the basic design however I left off the amplifying transistor as well as R2 and R1 with R3 being the same digital potentiometer
http://www.bristolwatch.com/ccs/lm334.jpg

I had some success with this method as I got an output that could range from a current of .7mA to a current less than .01mA. One problem that I had was that I could not find an easy way to amplify the .7mA to 2mA because I am relativley new in electronics and do not have much experience with op-amp circuit design. The source also works by sinking current so that is also throwing me off. The only amplification method that I can figure is to use a PNP transistor as in the diagram but they all have gains that are much too high for my purpose.

It would be awesome if you guys have any suggestions for what I have already tried or any brand new ideas. I think my next attempt is to use a simple op-amp circuit with the digital potentiometer.
I was also looking into controlling the current with a pwm signal from the μcontroller but could not find much of anything.

Thanks for any help you can give!
 
Last edited by a moderator:
Engineering news on Phys.org
Digital potentiometers are not reliable as variable resistors, only as potential dividers.
That is because their temperature coefficient is not matched to an external resistor.

Do you need a steady current or is the on/off duty cycle current from a PWM OK?
You require 0.25 to 2mA, but in steps of what size, or how many steps do you need?
 
  • Like
Likes 1 person
Use a DAC. Use it to drive a voltage to current converter, or a current mirror.

There are current and voltage output DACs with variable reference inputs.
 
  • Like
Likes 1 person
I don't know for sure, but two things to check:

LM117 datasheet at
http://www.ti.com/lit/ds/symlink/lm117.pdf
figure 15 suggests the device needs minimum current of a milliamp or two and you're trying to use it down to [STRIKE]1.4[/STRIKE] 1/4 milliamp. Figure 47 places a limit of 120 ohms on R1. That's consistent with current range in table on page 6, parameter "Load Regulation" which shows minimum current of 10 ma.
Could it be i have datasheet for a different LM117 than you're using ?

also suggested is a bypass capacitor on input, fig 1.


Your MCP datasheet at
http://ww1.microchip.com/downloads/en/DeviceDoc/11195c.pdf
says it works fine as a rheostat, as you are doing, but section 4.1 (page 14) cautions you to limit current to 1 milliamp. You might get away with two...

So, first try your circuit with a couple different values of fixed R1 resistors to see whether your trouble lies with the digital rheostat or with the LM117's minimum current capability .
Latter seems to fit your symptom.

neat project. Hope you get it going.
 
Last edited:
  • Like
Likes 1 person
er, um, by the way - don,t exceed Vdd on that MCP rheostat, see line "Voltage Range" in DC Characteristics tables on pages 2, 3, and 4, and "Absolute Maximum Ratings" page 5.
 
edit - skip this post, i wasnt awake yet, see followup below old jim
I think my next attempt is to use a simple op-amp circuit with the digital potentiometer.

sounds good. 2ma is well within drive capability of everyday opamp. I like the LM324 for its universal availability and 25 cent price. And it'll work down to negative supply rail so single supply works well.

This thread has drawing of a current source i built decades ago:

https://www.physicsforums.com/showthread.php?t=580295

I needed 5 amperes hence the low ohm resistors and power mosfet.
Just wanted to show you the current sense method...

CUR_INJx.jpg


You could put your lamp where i have the the mosfet, forget the meter, and swap opamp's + & - inputs since we no longer invert with the mosfet...
Your digital pot would replace my R3R4.
Make current sense resistor (R1R2 ) = 2.5 K so 0 to 5 at wiper would give 2ma to zero current.

Observe the LM324 needs "headroom" so its supply must be a volt or two greater than lamp supply. I had +12 handy, +7 should work..

good luck !

old jim
 
Last edited:
edit - skip this post, i wasnt awake yet, see followup below old jim

oops - single supply LM324 may not sink 2ma at zero out, it needs headroom on that end too if it is to accept current...
here's a DN article about that
http://edn.com/design/analog/4331069/Current-source-enables-op-amp-s-output-to-go-to-ground

do you have some negative available for pin 11? A volt should do.

old jim
 
Last edited:
Wow ! Above two posts are what happens when one starts typing before his morning coffee...

LM324 will source 10 miliamps with ease

so a simple "follower with gain" would do your job

page 8 here
http://www.ehu.es/instru_virtualdaq/Planoak/LM324.pdf

figure "Non-inverting DC Gain"
lamp is R2
2.5K current sense is R1
0-5volts from your digital potentiometer into the + input gives 0 to 2 ma through your lamp

with three amplifiers left over !i'd like to delete those two prior posts...
but that's my vanity showing. Gotta own up to my mistakes.
Have a laugh on me !

old jim
 
Last edited:
Hey Jim, Thanks for the reply, I wasn't planning on having any negative voltages available but there is a possibility that I could. I like the op-amp design and will try prototyping it and see what I can do. I think that I will give up on trying to use the digital pot as a rheostat with the lm317 due to the points you made in your first posts.

Regarding meBigGuy's post I like the idea and researched it a bit. I found a temperature independant current follower design in this picture

200px-Simple_bipolar_mirror.svg.png


I tried prototyping this circuit and had some success, I used ~2.5kΩ for the input resistor in the diagram (5V / 2.5kΩ = .002A). I also attached the PWM output (5V max) of my μcontroller to the Vin terminal in the diagram without any filtering. For the transistors I am using two 2N5088. When I "short" the output of the source (no load resistor) I get exactly 2mA, as I do when I use small resistor values such as 220Ω. When increase the resistance to 2kΩ the current draw drops off to around 1.8 mA which isn't a huge problem but it would be nice if it were more steady over load resistance changes. Maybe I need to be using different transistors, or a fancier current follower.

One more thing, if I end up using the current follower method I will want to use a filter to keep the choppy PWM signal out of the output. I found this filter designed for 5volt PWM and was wonder what thoughts you guys have on it. I believe that the potentiometer on the far right is for volume control and I am planning on leaving it out (the filter was designed to filter PWM that drives a speaker).

dds_lowpass1251-360x89.jpg
 
  • #10
Hey Jim, saw your last reply after I finished writing mine, I will look for some LM324's I thought that I have some on hand and will begin prototyping it and let you know what happens.
 
  • #11
Hey Jim! I just got the circuit together and it is working great with an analog potentiometer and I expect it to work just as well with the digital potentiometer because it will not be in rheostat mode. I wanted to thank you for all of you and everyone else for all the help. I would consider this issue solved!
 
  • #12
If you can post a sketch we'd be interested to see it !

Congratulations on your progress, and thanks for sharing .
 
  • #13
Ok guys another question regarding this circuit. I am trying to use an oscillator circuit that I made in order to control the current source. The oscillator works fine but produces a signal with a DC offset, and the final output needs to be completely AC. In order to remove the offset I placed a .01μF ceramic disc capacitor in series with the output of the oscillator to the current source. I have attached a picture of the schematic for the oscillator circuit and current source.

Now normally the circuit does not work correctly because the opamp in the current source seems to stick to the upper supply rail. I was testing the circuit with my scope and found that when I probe the point between the capacitor and the opamp input and found that when it is probed then the output of the current source works as expected (verified with the other channel on the scope and a multimeter measuring the AC current output). I have made a video showing everything described here if you actually want to see what is going on on the scope. The video can be found here:

https://www.youtube.com/watch?v=t_LNwKp-bCU&feature=youtu.be

At first I thought something was very wrong with the design but the discovery with the scope leads me to believe that it may be an relatively simple fix and due to my little knowlage of AC circuits and opamps. Any help would be much appreciated. Thanks!
 

Attachments

  • IMAG0119.jpg
    IMAG0119.jpg
    21 KB · Views: 1,079
  • #14
Neat approach !

All opamps have a trait called "Input Bias Current" , a rather nondescriptive name. I've heard it called "Pump Out Current" which is a little more descriptive. What that is is a trickle of DC current that must be allowed to flow either into or out of the opamp's input pin.
Observe it's maybe 45nanoamps typical for Lm324, 200 max. Look at parameter "Input Bias Current" on this datasheet
http://www.ti.com/lit/ds/symlink/lm124-n.pdf

That small current produces a small DC voltage drop across the input resistor, notice if your input resistor were 1 megohm that'd be 45 millivolts.
But your input resistor is a capacitor which that small DC current will slowly charge to a substantial DC voltage , just as your 'scope shows..
The scope is probably 1 meg or 10 meg input and it provides the necessary DC path to circuit common for the input bias current. That's why it only works when your'e looking at it with scope.

When you study opamp tutorials you'll be cautioned about providing a DC path for those pesky bias currents. You just got to do it.

Patch a 1 meg from that opamp's + input to common and see if it straightens out.
 
  • #15
jim hardy has correctly spotted the DC input bias problem, but I still have a few concerns about this circuit.
Placing 1M from opamp +input to common may still make for a big offset voltage.
Rs * I_bias_max = 1M * 200nA = 0.2V

So instead consider moving the 0.01uF capacitor to between the digital pot and the op-amp that drives it.
That will both AC couple and provide a DC path to the opamp input through the digital pot.
At such a low frequency, you will need to increase the value of that coupling capacitor to 22uF.
As with your oscillator capacitors, it will need to be an AC capacitor, not a polarised electrolytic.

The 10k resistor remaining in series between the digital pot and the opamp +input is not needed.
It was there to correct the input voltage difference due to opamp input bias current.
10k * 200nA = 2 mV, which is unimportant, (and the wrong way), in this circuit.
Ideally it should have a value similar to “R” in parallel with the load resistance.
That is lower than the digital pot, so it is better to replace that 10k input resistor with a wire link.
 
  • #16
@ HHOboy.
Your oscillator is a low-pass feedback phase-shift oscillator.
I expect it to produce a sine-wave output clipped in amplitude by the (+) and (0) power supply rails.
To get an On–Off signal I would have expected you need a square-wave, not a sine-wave output.
With a phase-shift oscillator, that would require high-pass feedback elements, i.e. swapped R and C.
But there are much simpler controllable square-wave oscillators.

I believed that the original requirement was for a gated, 50% duty On/Off oscillator.
With Off being a Zero current, and On being a programmable current.

Now that you have AC coupling, there will be positive and negative controlled currents.
That will produce positive and negative output voltages across the load.
With the sine wave there will be a short low current period, there will be no 50% duty Off.

Maybe AC coupling with the 0.01uF capacitor was a distraction and should never have been inserted.
The 50% duty cycle problem being all along due to the sine-wave oscillator output.
 
  • #17
So instead consider moving the 0.01uF capacitor to between the digital pot and the op-amp that drives it.
That will both AC couple and provide a DC path to the opamp input through the digital pot.
At such a low frequency, you will need to increase the value of that coupling capacitor to 22uF.
As with your oscillator capacitors, it will need to be an AC capacitor, not a polarised electrolytic.

The digital pot needs to be handed signal that lies between its supply rails so i don't think it can handle negative . The cap needs to stay on its output side.

Agreed with Baluncore the 10K is not needed.

Since you're driving the rightmost LM324 as a follower, Zin is very high so the cap can remain small; Baluncore and i differ there..

At 40 hz a 0.01uf cap is 398kohms , so using a 1 meg resistor to provide return path for bias current won't hurt you frequency wise. You've already seen that with your scope.
frequency rolloff starts when Xc = R,
and
Xc = 1/(2∏fc) .

If you went to a 0.1uf cap and 100K resistor it'd assure offset due to max input bias current of 200na stays less than 20 millivolts (0.2ua X 1/10 meg = 20mv)

your youtube was great, you clearly stated the question and i enjoyed the 'scope work.

Nice Job. Keep us posted.
 
Last edited:
  • #18
Unfortunately I do not have bandwidth or capacity for youtube.
Does the oscillator generate a sine or a square wave ?
I still think AC coupling is the problem, not the solution.
 
  • #19
It was a very decent looking sine wave;
quadrature oscillator , fig 8 here
http://www.ti.com/sc/docs/apps/msp/journal/aug2000/aug_07.pdf


AC coupling with no provision for bleeding away bias current was sure enough the problem.
Shorting the cap should give him sinewave centered around ( 2.5 volts X pot setting)/(Rsense) .

Maybe he'll try it for us ?
 
  • #20
Sorry guys I had to work last night and this morning but now I have some free time. I put a 1MΩ resistor between the input of the opamp and ground as suggested and that has done the trick! Also I removed the 10kΩ resistor that you guys said was unnecessary and that seems fine as well.

I wanted to thank Jim for the excellent explanation of the pump out current, it makes sense and I can add it to the list of things I have learned from this project.

Regarding Baluncore thanks for the point that the 10KΩ resistor is unnecessary. Also the current output does need to be true AC not just alternating between 0V and 5V, and it does need to be a sine wave as well.

I have attached several pictures so that you guys can see the final product and so Baluncore can see the wave because of the youtube problems. The first picture is just the updated breadboard you may be able to see the 1MΩ resistor behind the cap on the left of the board, also I removed the 10kΩ resistor and replaced it with a wire connection. The second picture is the waveform that I get on the simulated load resistor(in this pic it is 2KΩ). The third picture is the same as the second but I raised the value of the load resistor to 4.7KΩ and you can see the corresponding increase in amplitude to maintain a constant current of approximately .30ma AC. Also it should be noted that I am not probing that capacitor in the second and third pictures, so the problem is fixed .

Now I plan on trying to reduce the distortion that can be seen on the top of the sine wave and bring the frequency closer to 40 Hz. I think that getting some more precise components for the oscillator and putting the circuit on a proper proto board will help some.

Thank you guys for all of your help I really appreciate it and learned a lot!
 

Attachments

  • IMAG0123.jpg
    IMAG0123.jpg
    33.3 KB · Views: 962
  • IMAG0124.jpg
    IMAG0124.jpg
    32.3 KB · Views: 933
  • IMAG0126.jpg
    IMAG0126.jpg
    52.8 KB · Views: 973
  • #21
It's useful to remember the key characteristic of an ideal constant current source or a Norton source: it looks like a high impedance/resistance.

The problem with many of the designs discussed is they are low impedance as seen looking into the current source which means they don't behave much like ideal current sources. The reason is most are implemented with an emitter or source as the output. Emitters, sources (and cathodes) are low impedance. This is the "fail" of using a conventional 3-terminal type of regulator. Thus they resemble ideal voltage sources or Thevenin sources.

What you want instead is a collector or drain (or anode) instead. Thus a current mirror is a good choice. Also you can flip a conventional 3-terminal implementation to output from a collector (usually by switching the NPN of a voltage regulator with a PNP and making some biasing/feedback modifications such as using current sensing to generate the feedback signal).
 
  • #22
HHOboy said:
I plan on trying to reduce the distortion that can be seen on the top of the sine wave
The flat top is due to the amplitude being set by the opamp output hitting the supply rail limits on the amplifier stage where you pick off the sine wave.

To greatly reduce the flat top you must limit the amplitude in the LPF after the take off point. That will allow all three low-pass filter stages in the feedback oscillator to remove the odd harmonic distortion before the signal is used.

Attached is a crude first approach to softer amplitude limiting.
 

Attachments

  • Amp_regulation.jpg
    Amp_regulation.jpg
    18.3 KB · Views: 890
  • #23
jsgruszynski said:
The problem with many of the designs discussed is they are low impedance as seen looking into the current source which means they don't behave much like ideal current sources.
I believe you are not considering that the load is in the negative feedback loop of the op-amp.
That is the game changer.
 
  • #24
Hey OldJim,

Your insight is really helpful. I'm doing something similar to what HHO did only this time I want a current source that can supply between 100 and 160 mA in steps of 5mA for use to control air flow in a pneumatic valve at 24V constant DC supply. Will appreciate your help. Thank you!
 
Last edited:
  • #25
So is the object to apply known current to (presumably the coil of) some device that controls airflow ?

What is the resistance of that device? In other words, will 24 volt supply have a few left over for the current controlling circuit ?

How are these "current steps" to be controlled ? Simple selector switch?

A simple LM317 voltage regulator with a current-setting resistor between OUT and ADJ pins seems easy...
http://diyaudioprojects.com/Technical/Current-Regulator/ see fig 2
probably should heat sink the LM317

do the arithmetic to size your parts for the power they'll have to handle.
 
  • #26
Thanks for your reply old Jim.
Yes, the object that controls airflow is the PVQ-33-5G-16-01 from SMC OPneumatics (page 9 of http://content.smcetech.com/pdf/PVQ.pdf)
The resistance really is nowhere explicitly stated only that it generates 4W at the 165mA max current and 0W at 0mA.
For the system I am designing, I am using the position of an object which is being tracked by a kinect camera as feedback to control the current. A digital rheostat would be ideal but from the earlier discussion on this thread, I hear it is not really as reliable as external pots "due to the temperature coefficient".
I desire for the current to be digitally controlled from my microcontroller but I would be glad to hear from you about any other ideas.
 
  • #27
  • Like
Likes jim hardy
  • #28
Well you can easily figure its resistance from power and current. I assume you're familiar with Ohm's law?
Lexilighty said:
4W at the 165mA max current and 0W at 0mA.
i come up with it'll use the whole 24 volts at 165ma. A higher supply, say thirty volts might be more convenient...
further, this line in datasheet sort of hints that a somewhat higher voltage source may be desirable:
Caution
Power Source Selection
This product makes proportional control possible with constant current.
If controlled with voltage, the output flow rate cannot be kept constant due to current fluctuation.
Use stable DC power source of sufficient capacity without much ripple.

Since you're using a closed loop high precision doesn't seem very important , you'll adjust current to put the object where it belongs ?I gather you'll want 13 discrete current values :: 100, 105, 110, 115... 160 ma?
That'll take only four binary bits .

Several different approaches come to mind.
There's plenty of good folks here with genuine expertise
i think it'd be good to hear from you what is your experience level, for that'll guide folks to recommend appropriate suggestions.
e.g. :
Is this a real hardware project or computer simulation ?
Is this a breadboard project or can you solder surface mount ?
Does your computer have logic level IO pins like an Arduino, PWM, or do you plan on serial ?

old jim

PS that's a really interesting valve you found.
Likewise MBG's Analog Devices current controller.
 
  • #29
Hi Old Jim,

Again thanks for your reply. To pick apart your questions sequentially, here are my answers:

(i) Yes, I'll adjust the current to put the object where it belongs;
(ii) It is a real hardware project;
(iii) Surface mount is not something I have done before but through-hole vero board projects is my area of expertise.
(iv) I am using the National Instrument's myRIO device for the functions you have described. I could do the PWM or serial on the myRIO.

My question, which approach would you recommend: to use the LM317 you earlier prescribed or go for the DAC of MeBigGuy? I am not so good at programming SPI devices which is why I am a tad wary of MBG's approach.
 
Last edited:
  • #30
Lexilighty said:
My question, which approach would you recommend: to use the LM317 you earlier prescribed or go for the DAC of MeBigGuy? I am not so good at programming SPI devices though which is why I am a tad wary of MBG's approach.

Looking at the National RIO information (which gives me overload), i see a couple of analog outputs.

So i think i'd try MBG's approach , because it looks like the RIO itself has a DAC that can do what the AD5446 does in that appnote.
You'll learn to use the DAC.
I once used a DAC that spoke only I^2C, ; stumbling up that learning curve was mildly painful but worthwhile.

You'll need a little more than 24 volt supply
and i'd try an inexpensive everyday opamp liike LM324, which has added advantage it's suitable for single supply.

Be advised I've never even seen a National RIO - so solicit second opinions.

Lastly that solenoid valve must have inductive and inertial time constants so be prepared to protect the pass transistor and maybe time-condition your feedback for stability.

old jim
 
  • #31
In addition to the above, I have an L298N dual H-bridge (http://www.ebay.com/itm/like/231419432905?lpid=82) with datasheet here: https://www.sparkfun.com/datasheets/Robotics/L298_H_Bridge.pdf.

I tried PWM on the outA to the valve last week but was not much successful. I could only achieve full on or full off scenario with those. I realize this might not be contributing to the conversation but I have a hunch I could control output current with this dual bridge since its datasheet says a related stuff about using it to control solenoid valves in the intro.
 
  • #32
Oops, I am just reading Old Jim's reply. Yes, I actually ordered the LM324 opamp yesterday. My question about this op amp is can it do up to 165mA load on its output?
If so, are you suggesting I use it to replace the AD8510 or OP1177 in the figures in MBG's post?
Thanks, Science Advisor! :)
 
  • #33
Lexilighty said:
My question about this op amp is can it do up to 165mA load on its output?

no, check its datasheet. There exist opamps that can deliver such current but they're expensive. I used LM12's, good for 8 amps, when they were only about $20 but last time i looked they'd gone up to over $80.

Lexilighty said:
If so, are you suggesting I use it to replace the AD8510 or OP1177 in the figures in MBG's post?

It'd replace the OP1177 .
Read up on that National Instruments computer you're using. If it has analog out,
then see fig 2 here, from that Analog device MBG linked: http://www.analog.com/static/imported-files/circuit_notes/CN0151.pdf
Do you see that the opamp is connected as a follower that will make 100milliamps per volt applied to pin 4 three? That stout FET handles the current for it.
 
Last edited:
  • #34
Oh yeah cool. I will be trying this out in the next few days when my order arrives. Once again, thank you!
 
  • #35
I think it was meBigGuy who solved this one.

If that National gizmo has its own internal DAC to make analog out , your task is simplified a lot.

I hope you'll keep us posted.
 
  • #36
I only picked the I2C device because it happened to be the first one that came up when I searched for high-current DAC and looked at google images. (my favorite method for finding circuit solutions)

Here is another one
http://cds.linear.com/docs/en/datasheet/3092fb.pdf can be controlled by a DAC, and can be paralleled (rated at 200ma max, 40V).
103_circuit_1.jpg


You will need to determine power dissipation though. Read the application section of the data sheet.

Building a PWM based variable source with an H bridge assumes you switch it on and off at a high rate (say 100Khz) and the duty cycle controls the average current. (you switch at a rate that is too high for the solenoid to respond to)
This becomes very efficient since you don't have to linearly dissipate all the power to drop the voltage. But, for 160ma max at 24V it probably is not worth the trouble.
 
Last edited by a moderator:
  • #37
meBigGuy said:
Building a PWM based variable source with an H bridge assumes you switch it on and off at a high rate (say 100Khz) and the duty cycle controls the average current.
Yes, I know.

meBigGuy said:
(you switch at a rate that is too high for the solenoid to respond to)
Okay.
meBigGuy said:
This becomes very efficient since you don't have to linearly dissipate all the power to drop the voltage

are you speaking of the LT3092 here?
meBigGuy said:
But, for 160ma max at 24V it probably is not worth the trouble.
I do not get this.
 
  • #38
The LT3092, or any other linear current source must dissipate some power in order to drop the voltage to a point where the correct current flows.

Let's say your load is constant resistence, 160ma at 24V. That means it is 150 ohms. When you drive it at 160ma, there is (theoretically) 0V across the source driver, so the source driver is dissipating 0 watts. The load is dissipating 3.8 watts. When you drive it at 80ma, there will be 12V across the source device, and 12V across the load meaning the source device is dissipating 0.96 watts.

If the source device is PWM, it is either fully on, dissipating little power, or fully off, dissipating 0 power, or switching between, dissipating some power. One major reason for using PWM is the reduced pwer consumption in the switching device. But, at your low power levels it probably is not worth bothering with.

But, that aside:

For any LT3092 application (or any other control device) you need to determine the maximum power consumption and from that, and the spec sheet, determine whether you need a heat sink. In the example in the LT3092 datasheet, there is this:

TJ = 50°C + (1.02W • 30°C/W) = 80.6°C which shows that for 1 watt and a 50C ambient in a DFN package (with the stated amount of copper and vias), the junction temp. will be 80.6C

You always have to deal with power dissipation issues in linear devices. Note also that you must consider the worst case resistance of your load device and max voltage of your supply. Designers often calculate with typical values and have issues.
 
  • Like
Likes Lexilighty
  • #39
Hi Jim, I got my component from digikey over the holiday but the components are not friendly to work with especially the current multiplier NTE4153. The AD5446 and AD8510 ICs are really small SOC and I cannot start enlarging this components via some component amplification now. Is there a way I can work around this with the LM324 IC and some other readily available power mosfets that can do the current multiplication?
I am running out of time.
 
Last edited:
  • #40
Well, back to figure 2 here:
http://www.analog.com/static/imported-files/circuit_notes/CN0151.pdf
LM324 instead of the OP177 using correct pins of course
and you're in luck the 324 doesn't need negative supply it'll work with V- to circuit common
and most any 1 amp n channel Mosfet
that'll do the current multiplication
just send volts to 324's + in and it'll cause the Mosfet to sink 100 ma per volt

Your RIO's dac i would think can provide the volts for Mr 324 and his mosfet to follow..
 
  • #41
Is the current rating of the power supply to supply the +Vcc on the 324 specific? In the Absolute Max Ratings on Page 2 of its datasheet above, it says 50mA but in note 6 on page 4, it says the input current should only exist when any of the voltage at any of the input leads is driven negative.
I have a 24V 15A Output DC Power Supply and I am trying to ensure my 324 is not smoked if I plug these into it. :)
 
  • #42
The "operational amplifier" if connected correctly will only draw what power it needs to "operate".

Sometimes we connect a circuit through a light bulb, to limit the current in case there's a wiring mistake. That'd probably not save the LM324, but 324 is an inexpensive part.

15 amps is a stout source. Does it have a current limit knob? Built in ammeter ? Bring voltage up slowly while measuring current...
 
  • #43
I put together the figure 2 circuit in the attachment
lm324 design.png
but instead of the DAC there, I used the myRIO's SPI connector (called MXP connector A). The current VI I have is here. So on the MOSFET side, I have it replaced with http://www.mouser.com/Search/ProductDetail.aspx?R=VN3205N3-Gvirtualkey68900000virtualkey689-VN3205N3-G .
So I run my program and as far as I can tell, the VI is perfect but I could not make any intelligent reading from the output terminal of the MOSFET. What could I be doing wrong?
 
Last edited by a moderator:
  • #44
Lexilighty said:
The current VI I have is here.
current2.png


What on Earth is that ?

This i understand:

lm324-design-png.77477.png

Did you connect a load between OUT and V+ ? You could measure either current through that load or voltage across R1
 
  • #45
jim hardy said:
What on Earth is that ?
That, big Jim, is the code that myRIO understands.

jim hardy said:
Did you connect a load between OUT and V+ ? You could measure either current through that load or voltage across R1

Is the load supposed to be across OUT and V+? I thought it should be between OUT and V- or common ground? In any case, I measured the voltage through the 7 ohms 15W resistor I am using and it is essentially zero. Something is definitely not adding up. I am using a Power resistor by the way.
 
  • #46
It seems what I am missing is a DAC receiver between the myRIO and the Op-AMP. I might have to order the AD5446 that can fit into a VERO Board. The one I got the other day was a very small DAC that was surface mount and was no good. I would look in electronic stores around me and see what I can get tonight. Thanks Old Jim. I'll update you on what I get.
 
  • #47
I'm just guessing here, but the myRIO has analog outputs, meaning there are DAC's onboard that can drive your opamp. You just need to determine how to program them.
Look at the Analog outputs section in your manual. (Maybe your myRIO has no analog?)

Post a link to the user manual for your particular device.
 
  • #48
meBigGuy said:
I'm just guessing here, but the myRIO has analog outputs, meaning there are DAC's onboard that can drive your opamp. You just need to determine how to program them.

You are right. It does have analog outs. The myRIO link is here. And yes, there are DAC's on board. I did send some numeric constant though one of the outputs of the Analog Outs last night and generated voltage between OUT and V+ in the circuit above but I could not notice any proportional flow in the solenoid valve I was using. There must be something I am missing.

I wonder if I need to interface a servant (which in this case would be the AD5446 or something of similitude) to the myRIO before I can get a proportional current n the output. It seems to me that the DAC on the myRIO is a MASTER only.
 
Last edited:
  • #49
Lexilighty said:
Is the load supposed to be across OUT and V+? YES YES YES ! I thought it should be between OUT and V- or common ground? No No No !
Take a close look at your circuit, just the right hand side.
Conventional current flows down into the terminal labelled "out"..
How does it get there ?
Start at top.
Current is pushed by power supply, down through a load to "out" terminal,
then the mosfet does its "sphincter" thing to restrict how much current is allowed to continue on down through the current measuring resistor R1.
Opamp senses voltage across R1 and varies the constriction of Mosfet to make volts at inverting input equal to Vref from your RIO.
Since there's no place for current to escape, all the current through the load must also go through the mosfet and R1.

So, Iout X R1 = Volts from your RIO.
Iout = (Volts from your RIO) / R1 = (Volts from your RIO) / 10 or 100 ma per volt

if you're an "electron flow" guy the logic is same, just start at bottom instead of top and pull current instead of push.

As you see I'm just not fluent in RIO's or today's computers in general
i used to fix them when they were built from 7400 series IC's (early 1970's)
but there's not much call anymore for brontosaurus veterinarians

so i'd enjoy hearing of your success with this project, maybe post a waveforrm ?
old jim
 
  • #50
The way the output circuit works is that any voltage on pin 3 of the OP1177 will appear on pin 2 due to the OP1177 operation. That means the same voltage that is on pin 3 will appear will be the voltage across R1. That voltage is relative to AGND.

The voltage across R1 means a current (Iload) is flowing through R1, and it MUST come from OUT, through the MOSFET.

There will be a higher voltage on the gate of the MOSFET in order to turn it on. (whatever Vgs needs to be to conduct the current).

If the circuit is unstable, you could never tell with a meter, and you could get any sort of reading. (I'm assuming you don't have a scope?)

Things that could cause instability include:
No bypass caps on the op amp supplies
OP1177 doesn't like the capacitive load of the MOSFET gate
Poor grounds

You definitely need good bypassing on this external board. Electrolytics with paralleled 0.1 or 1uF ceramics from all supplies to AGND. AGND needs to connect to the myRIO ground.

So I would do the following:
1. Check the wiring of the pins and verify you are assigning them correctly
2. Bypass the OP1177
3. Check the voltage at pin 3 when you program the DAC
3a. If it doesn't change, disconnect the OP1177 recheck the analog out, and find the cause
4. Verify the same pin 3 voltage appears at pin 2 for all pin 3 voltages
4a. If it doesn't match exactly, there are a few ways to proceed. I would remove the FET, change R1 to a larger resistor that the OP1177 can drive (10ma, so maybe 1K or 470 ohms if you only go to 5V), and verify the OP1177 is working correctly with no FET. If it does work correctly with no FET, there was probably a FET wiring error, or instability.
4b. You could also just try increasing R1 to see if it works at lower currents with the FET connected.
5. If the pin 2,3 voltages match, then it must be working. The load current will be Vpin2/R1.
 

Similar threads

Back
Top