Propeller Current Control Question: 0 - 300 mA /12 VDC???
idbruce
Posts: 6,197
Hello Everyone
My present project includes a 12 VDC solenoid that requires a variable current of 0 - 300 mA. I would like to optically isolate the solenoid circuit from the Propeller chip. I was contemplating using a 4N25 optocoupler in conjunction with a NPN transistor to control the solenoid.
With this type of circuit, is it possible to obtain the needed current control by simply setting up a counter to single ended NCO/PWM?
Thanks in advance.
Bruce
My present project includes a 12 VDC solenoid that requires a variable current of 0 - 300 mA. I would like to optically isolate the solenoid circuit from the Propeller chip. I was contemplating using a 4N25 optocoupler in conjunction with a NPN transistor to control the solenoid.
With this type of circuit, is it possible to obtain the needed current control by simply setting up a counter to single ended NCO/PWM?
Thanks in advance.
Bruce
Comments
I'm running much larger 24V solenoids directly from a PuppySolo module, the one with the tiny cheap dual 8-pin SMD MOSFETs. The reason that others have such problems is probably more to do with layout and wiring and possibly insufficient power-supply filtering but you only need the basics here. Just don't try to feed the return of the solenoids through the Prop's ground.
This project will be using a Propeller Proto Board, so I would need a through hole MOSFET. Do you have a compatible MOSFET in mind?
Thanks for the response Peter.
Bruce
Might just be easier to use a bipolar switching transistor. If you need that opto isolator use it to drive a nice super-beta switching transistor - I've used STX724's before, 30V 3A and TO92 package...
Do you want linear operation, Simple PWM, or Current regulated PWM ?
(300mA.& 12V is in the realm of Linear)
If you are looking for best force control (which 0-300mA suggests) then Current feedback, removes the 12V and Thermal effects of the Solenoid coil as error sources.
Interesting parts.
For those, I'd avoid PWM, as that may disturb the linear control, and use linear current regulation, and something like a TO220 to TO247 package power device.
Simplest current control from a Prop, is a R-RC Divider DAC to give say 0..300mV, and an OpAmp + Logic Level MOSFET, with a Source sense resistor.
eg 1 Ohm will give 300mA at 300mV - Op(+i) goes to 0..300mV DAC, and Op(-i) goes to Source sense and Op(op) drives the Fet gate.
The DAC LPF gives natural pin protection.
Or you could use a Voltage Follower regulator like a LT3080, but it is more costly than a OpAmp+Mosfet. (or even Power NPN)
It looks as though I will have to do quite a bit more research to get a better grip on this. I was hoping that it was going to be something simple such as quickly switching the current on and off.
Perhaps I will call SMC and ask them for additional suggestions.
Bruce
What's simpler than a couple of resistors, an OpAmp, and a TO220 'something' ?
You need quite good precision if you are driving a Linear Valve like this, and do not want to add to the error bands.
They do not even specify the Coil resistance, so saturated drive is out. (plus doing that has poor temperature behavior)
I imagine it is very simple, once you know how to do it correctly, such as theory, selecting the proper components, etc... Like I said, I will have to do quite a bit more research, because I have never used an OpAmp before.
NOTE TO SELF: Additional reference here http://arduino.cc/forum/index.php?topic=61792.0
Here is an example circuit, it is a common design. Q1 can be NPN or Logic level MOSFET
http://www.uchobby.com/wp-content/uploads/2008/02/opamptransistorsink.gif
Or, look at the LT3080 data sheet.
One of them "DUH" moments
Although not previously mentioned in this thread, this solenoid will control the air flow to the micro grinder that will be used for my CNC PCB Drilling Machine (which can be seen below), for the primary purpose of controlling spindle speed.
This project has been in the works for well over two years and I am now on the third unfinished design of my PCB Drilling Machine However this design is completely different than the previous two designs, and it should be much easier to build as compared to the other designs, without having the proper equipment for machining. If only I had a lathe
Well anyway, I am now working on the Z axis for the new machine, if I can get passed this point, I think the rest should be pretty easy. All I can say is that I have been doing a lot of research into old threads lately, and WOW, that valve sure has a nice price tag
Bruce
losses - in other words you'll have an induction heater rather than a proportional solenoid!
However the fix is relatively easy I believe - add a "proper" inductor in series that's rated for your PWM frequency and smooths the current enough.
For instance a 30mH inductor at 20kHz will reduce ripple to about 10mA. Also you can enclose the PWM side of things and reduce possible EMI
from the cable to the solenoid.
[edit: freewheeling diode essential, preferably schottky]
Yea, the datasheet does not really include any suggestions for driving this solenoid, but the charts seem rather informative. I still have not called the manufacturer for suggestions, but I am now thinking more along the lines of a LM317 and a digital pot. However, I could be completely wrong about this
http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2FPTO%2Fsearch-adv.htm&r=1&f=G&l=50&d=PALL&S1=04737882&OS=PN/04737882&RS=PN/04737882
While it wasn't my project I was consulted on the control of an analog driven solenoid valve. In this case it controlled water flow through a heat sink for parts testing. Essentially it was part of a temperature control scheme.
We used PWM to control the current through the solenoid. As I recall it was running at about 1KHz. (It's been about 20 years so maybe it was 5KHz to 10KHz??). Anyway, this worked very well. We did it with both the expensive "Store bought" linear valve and a cheap standard valve and both worked nicely.
The standard valves come in 2 basic flavors:
1. Poppet valves. These have positive pneumatic feedback which greatly increase the hysteresis. These are completely unsuitable for use in the linear region.
2. Needle valves. These have no positive pneumatic feedback. OK, they may have some friction though. And not completely linear. But they were quite repeatable.
To be fair our system was not open loop, it was closed loop and used feedback from a temperature sensor to control the current through the solenoid through PWM.
You might want to use a tachometer circuit to sense your tiny turbine's speed.
or
A shunt resister to measure the average current as jmg suggests.
Even in open loop you could use a small lookup table to convert desired speed vs. PWM % for the cheap valves.
I have not seen the solenoids get hot due to Eddy currents caused by PWM operation. Sure, it must be there to some extent, but was insignificant compared to the expected resistive losses. The temperature rise was the same as when driven with a DC supply.
The basic circuit looks exactly the same as a "Buck" converter. In this case the inductor is the solenoid and the load is the winding resistance. As Mark_T says the freewheeling diode is required.
PWM is a much better choice than a linear regulator as I would think no heat sink would be required.
The linear pass transistor would be required to dissipate at least (12V / 2) * (0.3A / 2) = 0.9W thermal.
Duane J
As you can imagine, I do not want to guess at a solution, especilly when a $100 valve is at risk, so I have been doing quite a bit of research. According to the documentation that I have found, pertaining to proportional solenoid valves, some people have had very good results with PWM control, and others have had a little better than mediocre results. Even though I do not want to guess at a solution, I am sure it will take a little experimentation to find the right solution.
It is nice to have a wide array of input on this subject from some very knowledgable people.
Thanks for your input Duane.
Bruce
just posted something similar here http://forums.parallax.com/showthread.php?143961-quot-Forth-of-the-Forth-quot-Challenge-(in-December)&p=1147561&viewfull=1#post1147561
with a schema, and some code a few posts before.
OF course the bipolar transistors can be replaced by matching FETs.
Thanks... I appreciate your input and schematic.
Bruce