How Can I Design a Digitally Controllable Constant Current Source?

Click For 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.
  • #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
 
Engineering news on Phys.org
  • #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
 

Similar threads

  • · Replies 20 ·
Replies
20
Views
7K
  • · Replies 6 ·
Replies
6
Views
8K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 19 ·
Replies
19
Views
5K
Replies
3
Views
397
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 31 ·
2
Replies
31
Views
5K
  • · Replies 15 ·
Replies
15
Views
9K