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.
  • #51
meBigGuy said:
So I would do the following:
1. Check the wiring of the pins and verify you are assigning them correctly
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.

Thank you, meBigGuy.
Here's what I can tell you. I replaced the power wire-wound resistor (7 ohms 15W) with a 10 ohms 1/4 W resistor and I noticed the following. The voltage across OUT and V+ is 24.4V which is just what I have across the pins 4 and 11 (V- and V+) of the LM324 (which replaces the OP117 in my circuit). This tells me the MOSFET is okay. In addition, I disconnected the MOSFET just to confirm this, connected a 272k resistor and I notice no voltage drop across OUT and V+.
With a 24.4V supply across the V- and V+ of the 324, I can read the 24.4V across the inversting input (pin 2) of the opamp). But there is no voltage between pin 3 and coomon ground. I have not tried this circuit with a bypass capacitor yet but it seems my program is the issue and not my connection. I sadly have no oscilloscope for now. Let me know if there is anything I am doing wrong. Thank you!
 
Engineering news on Phys.org
  • #52
I think you are very close to success.

Lexilighty said:
The voltage across OUT and V+ is 24.4V
Is that the voltage between OUT and V+, that is one reading with meter leads connected to those two spots,
or is it two equal readings one from each spot to circuit common?

It's a little confusing when you say "across ( two points)"
Do you mean
your two meter leads are connected to those two points and that's a single reading, which is what that wording suggests,
OR
you took two separate readings, one between each of those two points and circuit common?

It's less ambiguous to give one reading at a time, specifying the two points of measurement.24 volts across something will be taken in electronics circles as meaning 24 volts between its two ends.
24 volts at someplace will be taken to mean between that point and circuit common.
24 volts between two points is bulletproof wording.

Lexilighty said:
I can read the 24.4V across the inversting input (pin 2) of the opamp).
Okay, one meter lead is on pin 2, where's the other? I assume circuit common. 24 volts at that spot suggests R1 is not connected, or the 24 volt supply negative is not tied to circuit common.

Lexilighty said:
connected a 272k resistor and I notice no voltage drop across OUT and V+.
"no voltage drop " means you measured zero volts between the two points, or you saw no decrease in measured volts at either point ?
Eternal vigilance is the price of clarity.:)
MeBigGuy is a mighty good troubleshooter and explainer, just give him unambiguous info like this:
But there is no voltage between pin 3 and coomon ground.
 
  • #53
jim hardy said:
24 volts across something will be taken in electronics circles as meaning 24 volts between its two ends.
That's exactly what I meant.

jim hardy said:
Okay, one meter lead is on pin 2, where's the other? I assume circuit common. 24 volts at that spot suggests R1 is not connected, or the 24 volt supply negative is not tied to circuit common.
Guilty. I'll pay the so-called price of clarity. The other lead is on 24V supply negative.

jim hardy said:
"no voltage drop " means you measured zero volts between the two points, or you saw no decrease in measured volts at either point ?
I meant what I said, big Jim.

BTW, I like that vigilance "zinger"! Hehe!
 
  • #54
Lexilighty said:
I meant what I said, big Jim.
The voltage across OUT and V+ is 24.4V
hmmm...
so you read full power supply voltage between either end of 24 volt power supply and anything connecetd to circuit common (AGND) ?

Is Negative side of 24 volt power supply tied to AGND ?
Lexilighty said:
BTW, I like that vigilance "zinger"! Hehe!
Thanks - i was hoping you wouldn't be mad.
 
  • #55
jim hardy said:
so you read full power supply voltage between either end of 24 volt power supply and anything connected to circuit common (AGND) ?

Nope. I am reading between positive end of power supply and OUT. Are you suggesting I provide a separate common ground for the circuit?

jim hardy said:
Is Negative side of 24 volt power supply tied to AGND ?
No. If this is what you are suggesting, how do you do this? are you suggesting I use the AGND of the RIO?
 
  • #56
Lexilighty said:
Nope. I am reading between positive end of power supply and OUT. Are you suggesting I provide a separate common ground for the circuit?

but you also said
Lexilighty said:
Guilty. I'll pay the so-called price of clarity. The other lead is on 24V supply negative.

which i took to mean you got 24 volts in two different readings, one at each of these two places :
+24 to OUT
-24 to Pin 2

Lexilighty said:
No. If this is what you are suggesting, how do you do this? are you suggesting I use the AGND of the RIO?

Yes, that needs to happen.
Here's why:
Voltage is always between two points.
Your RIO makes volts between its DAC out pin and AGND.
Your LM324 op-amp senses volts between each of its input pins and its V- pin. It amplifies the difference between those two voltages.
So, when you write KVL around opamp input and R1 (or RIO DAC output)
a term appears for voltage between opamp's V- pin and AGND which must be defined.
To define it, some connection is required. A direct connection is simplest.

The LM324 is nice because it'll tolerate that direct connection , see "common mode input voltage" specs in datasheet - It goes all the way to zero which allows it to handle a direct connection..
http://www.ti.com/lit/ds/symlink/lm324.pdf

A 741 will not tolerate zero common mode volts so would require extra circuitry.

Connect -24 supply to AGND ,
right at bottom of R1 so that the load current returning to -24 doesn't flow through the physical segment of AGND wire lying between R1and RIO.
Connect opamp V- pin to same spot, or to RIO side of that connection but nearby. Idea is to keep load current return path away from opamp input.

wow I'm way too wordy. Somebody can summarize in twenty words, i'll bet.

keep us posted ?
 
  • #57
All measurements have to be relative to AGND. AGND has to be connected to myRIO GND. There has to be a common ground. All supply voltages are relative to GND. Everything is about GND. The only thing that really matters are the voltages relative to GND.

If you only have one +24V supply, then you have a problem. The opamp circuit you showed assumed there are two supplies, +15V relative to AGND, and -15V relative to AGND.

You can do this with a single supply, but you need a "rail to rail" opamp. The OP1177 can only go to within about 1V of its negative supply pin. You can connect V- of the OP1177 and the negative supply lead to AGND. The OP1177 output will not go all the way to ground, but it will almost turn the FET off. A 10K resistor from the opamp output to GND might help.

I'm not sure what will happen with the way it is connected now. The supply leads are theoretically "floating" relative to AGND, but in reality there will be paths to AGND. Not sure where it will stabilize.
 
  • #58
Alrighty. I have made a lot of progress in the past few hours. Thanks to youse. I have connected the 24V- to the AGND of the RIO and I have fixed my RIO code.
Now, I can vary the voltage on the analog out of the myRIO from 0 to 10V by increasing the number of digital words from 0 to 2047 bits total. The analog channel I am using on the RIO can do a max of 10V at 2047 bits total.
Ok. So I put a 60 ohms resistor as my R1 and I discover I have lost 10Volts across the entire circuit when I measure the voltage across V+ and OUT (I am reading 14V when I am at 2047 bits). I also notice that the voltage between Pin 2 or Pin 3 and common is now 10V, i.e. they are equal and conjugate. But on Pin 1, measuring voltage between this pin and AGND gives 14V. This is still not so clear to me.
Probably need a higher DC power supply in order to generate the exact 24V that can drive the solenoid valve?
Nevertheless, this has been a positive and rewarding experience. I will now try with, say, a 30 Volts supply and see what I can get out of this piece. Thanks Old Jim and MBG.
I appreciate your help so far. If you have more contributions, kindly let me know.
Cheerio!
 
Last edited:
  • #59
meBigGuy said:
You can do this with a single supply, but you need a "rail to rail" opamp. The OP1177 can only go to within about 1V of its negative supply pin. You can connect V- of the OP1177 and the negative supply lead to AGND. The OP1177 output will not go all the way to ground, but it will almost turn the FET off. A 10K resistor from the opamp output to GND might help.

I'm not sure what will happen with the way it is connected now. The supply leads are theoretically "floating" relative to AGND, but in reality there will be paths to AGND. Not sure where it will stabilize.

This might clarify MBG's statement about floating power supply, which i think is the biggest problem right now.

LM324 isn't quite rail to rail but it is bottom rail to 1.5 shy of top rail. That's why i suggested it.
Circuit might even work with 324 powered from +5...
but according to Kirchoff it doesn't stand a chance unless 24V supply can pull current out bottom of R1 and push it back up and around into load.

For that reason 24 volt supply negative side MUST be connected to bottom of R1 , which also is AGND.
LM324 can sense to ground and will sink to within millivolts of it.
 
  • #60
Lexilighty said:
But on Pin 1, measuring voltage between this pin and AGND gives 14V. This is still not so clear to me.
Pin 1 is output of the opamp, controlling Mr Mosfet.
that's ten volts across R1 plus four volts gate drive to turn on Mr Mosfet.
Coincidence that you got 14 volts two places...

Lexilighty said:
I also notice that the voltage between Pin 2 or Pin 3 and common is now 10V, i.e. they are equal and conjugate.
Good, that's how opamps "operate" , a good designer surrounds them with a network that enables them to make their inputs equal.

Observe ten volts = .165 amps X 60 ohms ---- well, within 1% .
Indeed any voltage across R1 subtracts from what's available to drop across load.
24 volt supply minus ten volts across R1 leaves 14 volts to be shared by Load and Mr Mosfet.
It looks like Mr Mosfet is politely taking only a small portion. Good mosfet.
I'd go back to 10 ohm R1 and tell Mr RIO to make 0 to 1.65 volts. That'll give you 0 to 165 milliamps and leave about 24 - 1.65=23.35 22.35 (oops) to drop across load. If your 24 volt supply can be adjusted up to around 26 you just might make it !
Keep on pushing ! This is how we learn. Beats computer simulatng, eh ?

old jim
 
Last edited:
  • #61
4 volts gate drive looks high for your mosfet
http://www.supertex.com/pdf/datasheets/VN3205.pdf
curve : Transfer Characteristics" page 4, middle left

something to look at when you've got it working well.

Congratulations on your perseverance and progress
 
  • #62
jim hardy said:
It looks like Mr Mosfet is politely taking only a small portion. Good mosfet.
Haha! I like the style of writing! :)

jim hardy said:
I'd go back to 10 ohm R1 and tell Mr RIO to make 0 to 1.65 volts. That'll give you 0 to 165 milliamps and leave about 24 - 1.65=23.35 to drop across load.

Okay. I have left the lab now but I will definitely give this a try tomorrow morning. Will also try to increase the voltage a bit as you say, big boss! :)

meBigGuy said:
You can do this with a single supply, but you need a "rail to rail" opamp. The OP1177 can only go to within about 1V of its negative supply pin. You can connect V- of the OP1177 and the negative supply lead to AGND. The OP1177 output will not go all the way to ground, but it will almost turn the FET off. A 10K resistor from the opamp output to GND might help.

I've got to say I have replaced the op-amp with the 3043 which I have heard is a better op-amp to the LM324. Basically the same as the 324 except that it handles common-mode input voltage better. Anyways, I will implement these suggestions tomorrow morning. Thank you!

Hope you guys don't let bugs bite. :-))
 
  • #63
Lexilighty said:
I've got to say I have replaced the op-amp with the 3043 which I have heard is a better op-amp to the LM324.
Sounds like an interesting gizmo to have in one's "bag of tricks",, maybe you'd point to a link for it? Bing didn't find it..
 
  • #64
I have no idea what is meant by "equal and conjugate" . They should just be equal.

There should be 0 volts measured between pins 2 and 3 of the opamp. If there is not, the opamp output will be railed to one side or the other.I totally don't understand this sentence

"Probably need a higher DC power supply in order to generate the exact 24V that can drive the solenoid valve?"

I thought you were trying to drive a constant current. You cannot vary the current across the solenoid AND maintain the voltage at 24V. The current through the solenoid valve is controlled by the varying voltage across it. Or, are you saying that the voltage being dropped across R1 prevents you from getting to as high a current you want?

If the latter is the case, you need to go to a lower valued resistor for R1. You can put a voltage divider between the myRIO and pin3 so you still get the same number of steps. Say, 10:1, so you have max 1V drop across R1. Or, 20:1, or whatever you want. The smaller R1 is, the less power it will waste.
 
  • #65
jim hardy said:
Sounds like an interesting gizmo to have in one's "bag of tricks",, maybe you'd point to a link for it? Bing didn't find it..
I typed an incorrect part number. It's the MC3403P. Looking at its datasheet once again tells me its split supply max is +/- 18V whereas I am doing +/24V. I will go back to the LM324 then.

meBigGuy said:
Or, are you saying that the voltage being dropped across R1 prevents you from getting to as high a current you want?

Yes. That's what I meant.

meBigGuy said:
You can put a voltage divider between the myRIO and pin3 so you still get the same number of steps. Say, 10:1, so you have max 1V drop across R1. Or, 20:1, or whatever you want. The smaller R1 is, the less power it will waste.

Thanks. Sounds like what Jim said early on. I will try these in the next few minutes and give you the breaking news. Hopefully, it will be good. :)
 
  • #66
meBigGuy said:
You can put a voltage divider between the myRIO and pin3 so you still get the same number of steps. Say, 10:1, so you have max 1V drop across R1. Or, 20:1, or whatever you want. The smaller R1 is, the less power it will waste.
Absolutely great thoughts.

It gives another benefit as well that popped into my alleged mind in middle of night ...
The RIO is an expensive part. The opamp and mosfet are inexpensive parts.
In the unlikely event of something going dreadfully wrong inside or around the opamp, like his input supply pin shorting to his V+ pin via internal failure or an external accident,
that voltage divider would keep the +24 out of Mr RIO's DAC pin which I'm sure he would appreciate.
So place your divider physically very near the RIO and run a wire (or a modest valued resistor) over to pin 3. A few K won't hurt anything because there's ideally no current into pin 3, so you can use a resistor as a non-ideal wire.
In other words, blow up the cheap parts first.

We once received some equipment that had a 1500 volt test point immediately adjacent an opamp input. You had to hold the meter's big fat high voltage test prod with one hand while you adjusted the 1500V supply with other hand.
When your meter test prod slipped off the test point it'd hit one of the opamp's input resistors destroying the opamp. So the boards racked up a terrible "failure rate" . Manufacturer was really embarrassed when we showed him.

Next to Lastly, a tiny amount of capacitance at voltage divider output will remove noise from RIO DAC out and might help keep the system stable.
You might put it from pin 3 to AGND. Shoot for a few micosecond time constant.lastly(really this time) that MC3403 looks like an equivalent for lm324.
It's max single supply is 36 volts.
Its datasheet has application hints like the 324's did years ago and i like that.
http://www.onsemi.com/pub_link/Collateral/MC3403-D.PDF pages 6 & 7
 
  • #67
Something strange happened this morning. After blowing up the MC3043, I built a new circuitry all with same configuration and I notice the voltage between the RIO and Pin 3 is 1.65V at max resolution (in the RIO program). I also notice that the voltage at pin 2 is 0.265V which is pretty weird considering it was 1.65V before the other circuit was blown.

jim hardy said:
So place your divider physically very near the RIO and run a wire (or a modest valued resistor) over to pin 3. A few K won't hurt anything because there's ideally no current into pin 3, so you can use a resistor as a non-ideal wire.

This I have done. I also found the resistor beside the power supply and turned up the voltage supply all the way to 26V. I have changed the base resistor to 10 ohms and I am reading same 0.265V across R1.Strangely, I am reading 1.39V across pins 2 and 3. I thought probably my FET was gone but the voltage across the Drain leg and the V+ of the supply is 25.89 telling me all is well here.

Summary: I have bottom leg of resistor, V- leg of OpAMP, and AGND of myRIO all connected together, The voltage I am reading on Pin 3 relative to AGND is correct as it was what I expected since 1.65V flows out of the RIO. But something doesn't seem right on Pin 2.
 
  • #68
Lexilighty said:
I thought probably my FET was gone but the voltage across the Drain leg and the V+ of the supply is 25.89 telling me all is well here.
So - all your power supply voltage is dropped across the load?
What would that say about the current through your load? What's voltage between drain and AGND ? I expect it's quite low.

Lexilighty said:
I have changed the base resistor to 10 ohms and I am reading same 0.265V across R1.
That says only 26.5 milliamps through R1?
So, have more than 100 milliamps from load sneaked around R1 ?? Or is only 26.5 milliamps flowing through load?

Lexilighty said:
Strangely, I am reading 1.39V across pins 2 and 3.
Hmmmm let's see here..
Pin 3 to AGND = 1.65
pin 2 to AGND = 0.265
difference being 1.65 - 0.265 = 1.385 , just what you measured.
Lexilighty said:
Strangely, I am reading 1.39V across pins 2 and 3.

IF and ONLY IF volts edit: between mosfet Drain(aka OUT) and AGND are low, like less than a volt or two,
THEN connect an ammeter set for at least 1 amp from Drain to 24v NEGATIVE.
I expect you'll read about 170 milliamps.
meaning current is sneaking around R1.
Which is bad news but bot the end of the world.

If you read only 26.5 miliamps then something has gone wrong with the valve , it's restricting current.
That's worse because the valve is I'm sure an expensive piece.

Assuming the valve is OK and we have a sneak path -- what could it be?

I have a thought. It stems from this warning in datasheet and i should have addressed it.
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.
First let's check a couple things.

All power off.
With ohm meter on RX100 scale, check resistance between :
Mosfet gate-source, both directions
mosfet gate-drain , both directions
mosfet source-drain, both directions
LM324 pin 1 to pin 4(V+),both directions
LM324 pin 1 to pin 11(V-), both directions

If you find any or all of above reading low ohms i won't be surprised.
It probably explains the current sneaking around R1.
But the fix will be pretty easy i think.
 
Last edited:
  • #69
PS
resistors tend to fail open
semiconductors tend to fail shorted

and see red edit in previous post
 
Last edited:
  • #70
jim hardy said:
IF and ONLY IF volts edit: between mosfet Drain(aka OUT) and AGND are low, like less than a volt or two,
THEN connect an ammeter set for at least 1 amp from Drain to 24v NEGATIVE.
Volts between OUT and AGND is 0.382. I measured the voltage from drain leg to RIO GND and it's same voltage between Drain and GND of RIO.
meBigGuy said:
The OP1177 output will not go all the way to ground, but it will almost turn the FET off. A 10K resistor from the opamp output to GND might help.
jim hardy said:
If you read only 26.5 milliamps then something has gone wrong with the valve , it's restricting current.
That's worse because the valve is I'm sure an expensive piece.
I'm reading 0mA. I am using the HP34401A multimeter since my Fluke was not giving me a reasonable reading (0 ~ 0.2mA and was highly unstable).

One thing though: I put the multimeter terminals across OUT and V+ with load connected and I see 26.2V. I disconnect and I get 25..9V. Meanwhile I am still having the voltage drop of 1.65V across the SET 10 ohms resistor. Pin 2 of Op-AMP is still 0.265V as before.

Ok. So to be sure my Valve is still of full integrity, I put a 24V across its terminals and it opened up for air flow. This means the circuit is the problem and not my valve.

jim hardy said:
Mosfet gate-source, both directions
23.5 ohms each way.

jim hardy said:
mosfet gate-drain , both directions
688 ohms each way

jim hardy said:
mosfet source-drain, both directions
673 ohms

jim hardy said:
LM324 pin 1 to pin 4(V+),both directions
792 ohms each way

jim hardy said:
LM324 pin 1 to pin 11(V-), both directions
33.5 ohms each way.

jim hardy said:
LM324 pin 1 to pin 11(V-), both directions
 
  • #71
Lexilighty said:
23.5 ohms each way.
Here's what i think happened...

That valve is a solenoid with lots of inductance.
When one attempts to suddenly stop current through an inductor , the inductor opposes that . You've heard of "inductive kick "?
I expected to see a warning for this in the valve datasheet, but didn't. Closest thing to it is that note i cited above. I emailed manufacturer asking about it, no answer yet.

Anyhow i think we have ruint the MOSFET and LM324.
Mosfet died, most likely from inductive kick but possibly from overheating.
LM324 died when mortally wounded mosfet let current flow out its gate into pin 1 . Observe LM324 can only sink 20 milliamps
so our path around R1 is through a burnt up LM324.
Observe on LM324 datasheet at http://www.ti.com/lit/ds/symlink/lm324.pdf
page 2, "amplifier schematic"
output pin goes to a PNP straight to V-, the "rake" symbol , with no resistor to limit current.
If it shorts we have path around R1: of out Mosfet gate edit into LM324 pin1, then straight to AGND.

Good thing you put the voltage divider in there !

Fix is three stage:
1. Eliminate inductive kick by connecting a common everyday diode , like 1N4001 or 1N4148, across valve terminals.
Be sure cathode (stripe) is on +24 side, anode to Load side.
That'll protect next mosfet against inductive kick.
2. Eliminate overheating of Mosfet.
Observe in mosfet datasheet at
http://www.supertex.com/pdf/datasheets/VN3205.pdf
curve "safe operating area" on page 3
it specifies case temperature of 25degC, room temperature
and at 100 miliamps only allows 8 volts drop
i'm sure we are overheating it
we need a bigger mosfet and a heatsink

3 (not mandatory but i'd do it) Protect LM324 against overvoltage on 24V supply
Move LM324's V+ from +24 to a +5 or +12 supply terminal coming from Mr RIO.
We only need to get out of LM324 1.65 volts for R1 and ~1.5 volts for gate drive to Mr Mosfet, total = 3.15 which LM324 should do from a 5V supply.

Now this one confuses me a bit
Lexilighty said:
One thing though: I put the multimeter terminals across OUT and V+ with load connected and I see 26.2V. I disconnect and I get 25..9V. Meanwhile I am still having the voltage drop of 1.65V across the SET 10 ohms resistor. Pin 2 of Op-AMP is still 0.265V as before.
1. Is SET 10 ohms R1 or is it part of the voltage divider ? Maybe you'd put up a current schamatic, I'm still going on this one which doesn't mention SET 10 :
lm324-design-png.77477.png


2.
Pin 2 of Op-AMP is still 0.265V as before
meaning we get current through R1 when valve is disconnected?
Where does that 26.5 milliamps come from? I'm guessing through a fried LM324.

Don't despair - we have so far succeeded in letting the smoke out of only cheap parts.
And we lucked out with MBG's voltage divider - THANKS MBG !

Does this make sense?
 
Last edited:
  • #72
Last edited:
  • #73
Thanks Old Jim. I will implement the suggestions when I get to the lab this morning. I am so grateful for your willingly offered expert advice. I've learned s!*t! :)
 
  • #74
And I will surely post an updated schematic once I get access to a scanner. And yes, the set resistor is the ohm bottom one. Is there a power MOSFET with heatsink that you'd recommend?

If I change the supply pins to either +/-5 or 12V, will we get enough 24V to drive the solenoid? I thought the solenoid works at a voltage of 24V and currents of between 100mA and 165mA? I am not clear about this.
 
Last edited:
  • #75
Lexilighty said:
If I change the supply pins to either +/-5 or 12V, will we get enough 24V to drive the solenoid? I thought the solenoid works at a voltage of 24V and currents of between 100mA and 165mA? I am not clear about this.

1. It's only the V+ supply pin for the LM324 that you'll move,
solenoid still goes from +24 to OUT(mosfet drain).
So it still gets its full voltage.
LM324 doesn't need 24 volts, all it need is enough to turn on Mr Mosfet.
Mosfet will turn on when gate is 1.5 volts > than source
and at 185 ma source will be at 1.65 volts, that's the voltage across R1
in electrical circles we use the phrase "voltage with respect to (a point in your circuit)", abbreviated "wrt"
and all wrt means is your meter's negative lead is placed on that point

so at 165 ma you'll have
top of R1 wrt AGND 1.65 volts
source of Mr Mosfet 1.65 volts wrt AGND because electrically that's the same point as R1 top
gate of Mr Mosfet about 3.15 volts wrt AGND , the 1.65 across R1 plus the ~1.5 to turn on mosfet

Since LM324 doesn't need to make much voltage why give him a blank check ? He only need 5 volts to make 3.5,
and if he melts inside there'll only be 5 volts that can break out and wreck something else.
SO 5 or 12 volt supply should be enough for him.

2. I will look for a mosfet.
Exact part is not critical,
at 100 milliamps i figure it'll dissipate about a watt
that's 14 volts across solenoid and ten across mosfet, ten volts X 1/10 amp is a watt
so look for a N channel in a case like this, it's called TO-220
you can probably find some in old dead computer power supplies or VCR's
200px-TO-220_Front_Coloured.svg.png

with ratings of at least an amp and 50 volts,
that's what your little TO-92 was rated for
but not 50 volts and an amp at same time, see its "safe operating area" curve.Then bolt a couple square inches of aluminum or copper to it , or find TO-220 heatsink.
I've been known to split and flatten half inch copper plumbing pipe for heatsink, works great. A thrift store aluminum cookie sheet is another source of aluminum sheet
Be aware good contact between heatsink and transistor case is important. Sand the heatsink smooth on the contact side and bolt it firmly.
Most any silicone grease in the joint will help.
Be aware heatsink will likely be at Drain voltage so keep it away from chassis...
unless you're lucky enough to find a mosfet with isolated tab. Then you can bolt it to chassis.3. Your perseverance ir commendable and rewarding to see.
I'm embarassed to have missed the mosfet power dissipation issue
and I'm guilty of assuming the solenoid had internal provision to suppress its inductive kick .
In higer circles "inductive kick" is called "flyback", a term left over from tube television days .

Thank you for your patience

We learn by doing. And you're doing great !
 
Last edited:
  • #76
jim hardy said:
so look for a N channel in a case like this, it's called TO-220
you can probably find some in old dead computer power supplies or VCR's

I found an NTE966 and luckily got a heatsink from a burnt circuit I smoked couple of weeks back. I know if functions as a current regulator (see page 2). On page 3, it says VIN, GND and VOUT as the terminals. I am assuming these are Gate, Source and Drain respectively.

One more thing, it does an AMP but not up to 50V. You think this is still good enough?
 
  • #77
Here's a robust mosfet that's available at Radio Shack for a couple bucks , half that mail order...
i figure you need to get going quickly.

IRF510
http://www.vishay.com/docs/91015/sihf510.pdf
http://www.radioshack.com/mosfet-irf510-transistor/2762072.html#&tab=tab2

looks like it needs a volt more gate voltage to turn on than does your VN3205
so the LM324 may or may not drive it with only 5 volt supply. But 12 would work great.

this one would probably work too though i couldn't find a very good datasheet on it
http://www.radioshack.com/nte2985-mosfet-power-n-channel-60v-30a/55052956.html
 
Last edited by a moderator:
  • #78
The NTE966 won't do?
 
  • #79
Lexilighty said:
I found an NTE966 and luckily got a heatsink from a burnt circuit I smoked couple of weeks back. I know if functions as a current regulator (see page 2). On page 3, it says VIN, GND and VOUT as the terminals. I am assuming these are Gate, Source and Drain respectively.

No, it's not a MOSFET at all
it needs 7 volts across itself so won't give you full current

from the fine print in that figure on page 2
the output voltage compliance would be the input voltage less 7 volts.
 
  • #80
Oh, the datasheet's page 2 deceived me. I will go pick up the IRF510 at a local store in my city this afternoon.
 
  • #82
I tried this with the IRF510 but I kept shorting the transistor somehow. Gate - Source resistance is almost zero all the time. I replaced the transistor with another IRF510 extra once and I can barely measure any voltage across OUT and V+. So I replaced this with the spare Supertex I was using before and the voltage drops across each opamp input is back to 1.65V and the voltage across OUT and V+ is 23.16 after taking my V+ supply to 30.89V. I have the V+ of the opamp now wired to +5V of the RIO and all GND are on the RIO. As meBIgGuy early on suggested, I put a 10k resistor between opamp output and GND and I got 1.451 voltage drop across it. I know the 23.16V comes from (30V of supply - 5V of RIO - 1.65V across Opamp input - 1.451 V across 10K resistor. Bear in mind that I am using the MC3043 opamp as opposed to the 324.
But here is a shocker, my valve gets powered but when I vary the voltage across the analog out of the RIO, I am not observing a change in air flow across the valve. Something beyond me.
 
  • #83
Lexilighty said:
I tried this with the IRF510 but I kept shorting the transistor somehow. Gate - Source resistance is almost zero all the time.
dont take offense at this
the Supertex has gate on middle lead, left to right S G D
the IRF has gate on outside , middle is drain, left to right G D S

it'd be real natural...
let me decipher the rest of your post it's a lot of observations to tie together...
 
  • #84
Lexilighty said:
I replaced the transistor with another IRF510 extra once and I can barely measure any voltage across OUT and V+.
so the IRF510 isn't conducting ?

Lexilighty said:
So I replaced this with the spare Supertex I was using before and the voltage drops across each opamp input is back to 1.65V and the voltage across OUT and V+ is 23.16
Sounds like the Supertex conducts but IRF doesn't. And sounds like the circuit worked with Supertex...at least long enough for you to measure equal voltage at opamp inputs.
Lexilighty said:
As meBIgGuy early on suggested, I put a 10k resistor between opamp output and GND and I got 1.451 voltage drop across it.
that's confusing - it would seem the opamp was trying to turn the mosfet OFF but couldn't... 1.45 volts to gate of mosfet whose source is at 1.65 should turn it off...
and that agrees with this observation
Lexilighty said:
But here is a shocker, my valve gets powered but when I vary the voltage across the analog out of the RIO, I am not observing a change in air flow across the valve.

It sounds like we are unable to turn ON the IRF
and unable to turn OFF the Supertex...

Need to split system logically in two so perhaps we can narrow down problem...
Lexilighty said:
but when I vary the voltage across the analog out of the RIO, I am not observing a change in air flow across the valve

Is opamp trying to control mosfet? Let's look.
BTW which mosfet is in there now ?

What is voltage at opamp output with RIO output at zero?
pin1 =
What are voltages at opamp inputs then?
+in pin 3=
-in pin 2=

What s voltage at opamp output with RIO output at max (calling for 165 ma ) ?
pin 1 =
What are voltages at opamp inputs then?
+in pin 3 =
-in pin 2 =

Hopefully that'll tell us which direction to go looking for trouble .
 
  • #85
Sorry to just pipe in occasionally. I'm not sure you are correctly looking at the issue of the solenoid voltage.

Regarding the voltage across the solenoid. It will not be 24V unless you are trying to drive max current. The 24V voltage is split between the MOSFET/R1 and the solenoid.

The full 24V supply is alway dropped across the solenoid/MOSFET/R1. If you are set to 0 current, there will be 0 volts across the solenoid, and 24V across the MOSFET. As you increase the current, the voltage across the solenoid increases (per ohms law, E=IR where R is solenoid resistance).

So, as you increase the current, the voltage across the MOSFET/R1 will DECREASE as more voltage is dropped across the solenoid.

Sorry if that was already understood.
 
  • #86
meBigGuy said:
Sorry if that was already understood.

Hey THANKS for piping in.

Most of us think in pictures and communicate in words.
Party A describes in words the picture in his mind,
Party B receives said words and from them paints a picture in his mind;
How closely do those two pictures resemble one another ? Depends on a lot of variables...
I'm very prone to mis-communication, mildly Asperger i think...So your observations and input are helpful.

I've been thinking about this last night.
Hypothesis:
Lexilighty said:
I tried this with the IRF510 but I kept shorting the transistor somehow. Gate - Source resistance is almost zero all the time.
Were the IRF installed assuming it has same pinout as the NN3205, which it doesn't,
Source would be at OUT , bottom of solenoid
Drain would be at opamp output pin 1
Gate would be at R1.
The mosfet's internal diode would be forward biased allowing solenoid current to flow into opamp output
probably wrecking opamp
and if it burnt pin 1 open internally, that'd put 30 volts source to gate exceeding its 20 volt rating
and the next mosfet wouldn't pass any current until its gate-source junction failed.

that hypothesis sort of agrees with this observation
I tried this with the IRF510 but I kept shorting the transistor somehow.
and with this observation
I replaced the transistor with another IRF510 extra once and I can barely measure any voltage across OUT and V+.
and I'm not quite sure what this one means
Gate - Source resistance is almost zero all the time.

so let's see whether he finds opamp still working and build from there?

From PF homepage:
PF values productivity
• Disciplined to remain on-topic
• Honest recognition of own weaknesses
• Solo and cooperative problem solving

He's SOOO close to success on this thing...
Again - THANKS, mBG

What're your thoughts ? Do you think this thing could be oscillating? Maybe look for AC across solenoid?edit duplicate post deleted
 
  • #87
jim hardy said:
Is opamp trying to control mosfet? Let's look.
BTW which mosfet is in there now ?
Right now, I have the VN3205 on the board. And BTW, I took cognizance of the connector pinouts of the IRF510 as against the VN3205, big Jim.
Everything I am testing for now is with the VN3205.
jim hardy said:
What s voltage at opamp output with RIO output at max (calling for 165 ma ) ?
pin 1 = 1.468V
What are voltages at opamp inputs then?
+in pin 3 = 1.659V (RIO out is at 1.65V)
-in pin 2 = 1.735

Hopefully that'll tell us which direction to go looking for trouble .[/QUOTE]

Alright.

Note, I am powering the Opamp from the RIO +15V and GND connectors. Voltage across R! is 1.698V
 
  • #88
More so, I saw the following, prompting me to think the shunt resistor should be across the motor and V+...and ground the source ?
 
  • #89
What s voltage at opamp output with RIO output at max (calling for 165 ma ) ?
pin 1 = 1.468V
What are voltages at opamp inputs then?
+in pin 3 = 1.659V (RIO out is at 1.65V)
-in pin 2 = 1.735

Great info! I should have known you'd catch the pinout but one has to ask to eliminate the question. No offense meant.
Good point on +15 for opamp, too.

From your readings
Opamp sees higher voltage on his - in than on his +in, so he should be driving his output as low as he can.
1.468volts doesn't sound real low,
but
a mosfet with its source at 1.698 volts
and his gate at 1.468 volts
shouldn't conduct.
-in pin 2 = 1.735... Voltage across R! is 1.698V
R1 and pin 2 are joined by a wire ? that's a lot of difference... out of curiosity, where is negative lead of 24 volt supply physically connected?
lm324-design-png.77477.png

Okay, it looks like opamp is trying to turn OFF the mosfet when we call for full current,
Does he try any harder when we call for zero current?
What is voltage at opamp output with RIO output at zero?
pin1 =
What are voltages at opamp inputs then?
+in pin 3=
-in pin 2=

Then let's help him and see if mosfet will turn off.
Jumper drain(or opamp pin 1) to AGND
and read again
out pin 1 =
+in pin 3 =
-in pin 2 =

volts ACROSS solenoid, and we'll check for AC in case we'e oscillatng
volts DC =
volts AC = ,, if there's enough to measure get frequency if your meter is so equipped.

now remove jumper from drain and repeat solenoid measurement
volts DC =
volts AC = ,, if there's enough to measure get frequency if your meter is equipped.

That'll tell us if mosfet is capable of following directions he gets from opamp. And hopefully whether he's oscillating.

Old troubleshooter technique - when nothing looks bad, make everything prove itself good.
I'm curious of that 1.4 volts at opamp out
and the 1.735-1.698 = 37 millivolts difference between R1 and pin 2
all GND are on the RIO.
Is there measurable voltage between physical bottom of R1 and GND ?
 
  • #90
Lexilighty said:
More so, I saw the following,
8878038400_1374862667.gif


Those parts across the motor are to absorb "flyback"
the resistor/diode combination let's you control how much kick there'll be by choosing resistor value
the diode/zener does same thing

we ought to have a diode across our solenoid, it'll both damp oscillation and save the mosfet when current is shut off quickly.We could measure current above mosfet by something called "high side sensing"
i don't think we need to get that extreme, though.

This should turn out to be something simple.
Mother Nature always makes us work hard for our lessons.
We humans seem to learn from our mistakes instead of from good examples like we should. At least i had to.

old jim
 
  • #91
jim hardy said:
Okay, it looks like opamp is trying to turn OFF the mosfet when we call for full current,
Does he try any harder when we call for zero current?
What is voltage at opamp output with RIO output at zero?
pin1 =1.492V
What are voltages at opamp inputs then?
+in pin 3= 0.048V
-in pin 2=1.7632

jim hardy said:
volts ACROSS solenoid, and we'll check for AC in case we'e oscillating
volts DC =
volts AC = ,, if there's enough to measure get frequency if your meter is so equipped.

jim hardy said:
Jumper drain(or opamp pin 1) to AGND
and read again
out pin 1 = 0.010V
+in pin 3 =0.036V
-in pin 2 =0.003V

jim hardy said:
volts ACROSS solenoid, and we'll check for AC in case we'e oscillatng
volts DC = 23.34V
volts AC = 0.6mV,, if there's enough to measure get frequency if your meter is so equipped.

jim hardy said:
Is there measurable voltage between physical bottom of R1 and GND ? 0.001V

jim hardy said:
R1 and pin 2 are joined by a wire ?
Directly beside the pin2 on the bread board.

BTW, pin 1 and GND are now 1.391V, piin 2 and GND now 1.594. Pin 3 is 0V with Vref of RIO at 0V and it's 1.654V with Vref of RIO at 1.654.
 
  • #92
I noticed something strange just now. The carbon-film resistor I have been using is 1/4W. Currently, at max voltage from RIO, we are passing 0.27W through it. Does this matter?
 
  • #93
Our Circuit is finally working. I realized I was not meeting the wattage requirement of the shunt resistor. I was passing a max voltage of 1.65V through a 10 ohms carbon-film resistor. That makes 165mA across the resistor at full throttle from Mr RIO. Power dissipated across R1 is 0.27W. Carbon-film resistor I was using was 1/4W.

It dawned on me to calculate this few minutes ago. So I replaced the 1/4W 10 ohms with a 7 ohms 15W and bingo! The circuit now works like a charm. There’s still a lot of oscillations in the circuit though. I figure a few caps would do to keep gentle transistor drain current stable. Cheers to perseverance. Mother nature always has a hard way of making us learn. Beats simulation, hehe!
 
  • Like
Likes dlgoff
  • #94
What is voltage at opamp output with RIO output at zero?
pin1 =1.492V
What are voltages at opamp inputs then?
+in pin 3= 0.048V
-in pin 2=1.7632
Great Scott !
Pin 3 went down meaning Mr RIO requested Mr Opamp to lower current.
Pin 2 didn't decrease meaning we still had current ?.
Neither did pin 1.
Looks like Opamp didn't try any harder to shut off current.

How about when w gave him some help ?
Jumper drain(or opamp pin 1) to AGND
and read again
out pin 1 = 0.010V
+in pin 3 =0.036V
-in pin 2 =0.003V
Aha, the plot thickens
Pin 2 went down, inferring we successfully turned off current through R1.

So the mosfet will turn off current if directed by opamp?
Are you thinking what I'm thinking - Mr Opamp isn't changing his output at all ?
(by the way - for now only run current zero or max because Mr Mosfet will overheat at mid-range currents)

meBigGuy suggested a long time ago a 10K resistor from pin 1 to ground.
That is called a "pulldown" because it helps pull the output voltage toward zero.
We went to the extreme and used a zero ohm pulldown resistor. It looks like that worked.

But my test wasn't bulletproof - we might have bypassed current around R1 again.

If you're not out of patience
would you lift drain wire from opamp pin 1 and briefly hook it to source, top of R1?
Does that drive R1 to zero volts?
Does it stop air out of solenoid?

Then take the gate wire off source.
Select on your DMM 200 milliamp scale
connect meter between that gate wire and AGND

If you get current out the gate wire, the mosfet is shot again

if you get no current out gate and solenoid air stops
then opamp is not living up to its promise of "output voltage can include the negative rail".

We'll try a 1K pulldown, or replace opamp.
I never used a 3403 and its specsheet is less than crystal clear
says in first page text that Vout can include negative supply
but page 4 note 5 says it needs a 10K pulldown resistor to do it.
Page 3 section "Output Voltage range " suggests Vout might go to only ~1.5V shy of negative supply and that's just what we are observing.

Fix may be as simple as a resistor from opamp pin 1 to gnd.
If it needs 10K i'd use 3K.

Does this make sense to you, Lex ?
What do you think, meBigGuy?
I've been known to criss-cross my logic - part of that Asperger i think.
Eternal vigilance is the price of accuracy !

Lexilighty said:
Pin 3 is 0V with Vref of RIO at 0V and it's 1.654V with Vref of RIO at 1.654.
Good - the expensive RIO and divider are okay

Lexilighty said:
BTW, pin 1 and GND are now 1.391V, piin 2 and GND now 1.594.
Just can't seem to get that pin 1 below 1.4volts , can we?

If you want, just try 1k from pin 1 to gnd. Above tests though should remove any lingering doubts about mosfet.

old jim, trying to be thorough
thanks for your patience
 
  • #95
Lexilighty said:
I noticed something strange just now. The carbon-film resistor I have been using is 1/4W. Currently, at max voltage from RIO, we are passing 0.27W through it. Does this matter?
It will not last long. If it smells bad it's probably failing.

Great news on your success - open resistor all the while?
 
  • #96
i'm having difficulty with system it seems to ignore "post reply"

oh well

congratulations on your success
can you describe the "oscillations" ?

Feel your Mosfet the VN2035 will overheat at currents around 100 ma
volts X amps must stay well below 0,56
 
  • #97
Lexilighty said:
Cheers to perseverance. Mother nature always has a hard way of making us learn. Beats simulation, hehe!

You made my day ---- Thank You !

if you've not discarded that carbon 10 ohm resistor,

how many ohms does it read now?

Shutoff current of your mosfet should be a milliamp or less
so your resistor should be 1500 ohms or more?
a pulldown resistor is probably still a good idea
as would be a stout mosfet on a heatsink
 
Last edited:
  • Like
Likes dlgoff
  • #98
jim hardy said:
how many ohms does it read now?

Shutoff current of your mosfet should be a milliamp or less
so your resistor should be 1500 ohms or more?

Actually, it's discarded :(

Right now, I am using a 7 ohms 15W wirewound resistor. Not entirely a bad choice!

And btw, I am using my last IRF510 after I have burned the remaining two I got yesterday. It's glued like a bad habit to a heat sink.

I will try with a 3k resistor to circuit ground as you have suggested.
 
  • Like
Likes jim hardy
  • #99
All that for a resistor... I'm a little embarrassed--- seems you mentioned someplace early on that it was 1/4 watt.
but we were moving in right direction. And it was fairly methodical.

One should use resistors at half their rating.

Lexilighty said:
Mother nature always has a hard way of making us learn
I've been learning from my mistakes for almost 70 years now and have built up a great repertoire of them.
How're you coming along ?

old jim
 
  • #100
Something stranger keeps happening though. I returned from an outing and tried to test once again and it seems the transistor, IRF510 is gone again. So I replaced it and I can vary flow across my solenoid valve from 1.17V to 1.65V using the 7 ohms. Bear in mind I am using the IRF510 and it has a heat sink.
I have a 2.9k resistor between pin 1 and GND, a diode is sitting on the +ve terminal of the valve to prevent inductive kick, and 0.1uF metallic film caps between pin 1 and GND/pin 4 and GND to shut off ripples.
Voltage across pin 1 and GND now 10V, pin 2/3 and GND now 1.298V and RIO supply is 1.295V. I have 1.273V across R1. So I am somewhere good on the opamp side.
But on the question of varying the voltage in the solenoid valve, I am doing more than the manufacturer required specs of 100mA and 165mA at 24V but the solenoid works. Maybe there is something I am missing.
At 7 ohms, my volt from RIO to drive 100mA to 165mA for the valve should be 1.15V to 0.665V but it seems this valve is requiring more volts. Hopefully I have not damaged the valve.
Again, your expertise will be appreciated, big Jim.
Thank you for your good insight all the while.
 
Last edited:

Similar threads

Back
Top