FET as a digital pot
Sapphire
Posts: 496
I'm working on a project to control a fairly high voltage solenoid with the goal of using a FET as a variable resistance to control the current. Today this is done with a 2W multi-turn pot, but that is inconvenient for making adjustments to the current. The current needs to be controlled to regulate the solenoid pull.
So I came up with the following sketch of what I want to do. But I don't have a lot of FET experience, and was hoping to get some advice from the forum members on this design. I wish to use a digital pot to control the FET in its linear region, over a range of about 10-200 ohms. If the FET, solenoid or switch need to move, that's okay, they are all just in series. I started out this way thinking I needed to have the source at ground so the gate is properly driven. Is this correct? Any suggestion on what type of FET/JFET/MOSFET should be used?
The SPST switch (actually a relay but shown as a switch for simplicity) can be open or closed at any time by a separate process.
Any suggestions or comments appreciated!
So I came up with the following sketch of what I want to do. But I don't have a lot of FET experience, and was hoping to get some advice from the forum members on this design. I wish to use a digital pot to control the FET in its linear region, over a range of about 10-200 ohms. If the FET, solenoid or switch need to move, that's okay, they are all just in series. I started out this way thinking I needed to have the source at ground so the gate is properly driven. Is this correct? Any suggestion on what type of FET/JFET/MOSFET should be used?
The SPST switch (actually a relay but shown as a switch for simplicity) can be open or closed at any time by a separate process.
Any suggestions or comments appreciated!
Comments
-Phil
Thanks. I should have mentioned that the duty cycle is very low, the solenoid is on for only 10 seconds every few minutes via the switch, which is not controlled by the BS2. I can take care of the heat dissipation. Since we are already using a BS2 for other functions, continuous PWM isn't really an option (although I will keep that in mind for when we upgrade processors).
Why would the output be non-linear based on the gate voltage if I keep within the linear range of the FET? This is something I don't fully understand.
If you must operate the solenoid in analog fashion, this is the circuit to use:
Here, the solenoid current is monitored by the transistor's emitter resistor (R), whose voltage is fed back to the op amp. The voltage on the pot's wiper (V) will range from 0V to 5V * R2 / (R1 + R2). The current in the solenoid, therefore, will equal V / R.
-Phil
As Phil rightly mentioned, this should be done with PWM, even if you could control it in a linear fashion it will get very hot, a lot hot, even in a few seconds. How about using the digital pot to control the PWM of a 555 timer instead? This will be very efficient and you will only need a very small MOSFET as I get by quite nicely with dual MOSFETs in SO8 driving large solenoids.
Here's a schematic of a PWM 555 I grabbed from the net although I would completely ignore the MOSFET they used but otherwise it's similar.
Perhaps older devices are better behaved for analog use? Just a thought - I used 2SJ48 &
2SK133 Hitachi MOSFETs in an audio amplifier I built in the '80's.
Either way the on-resistance of any FET isn't easy to control without feedback as the threshold voltage is
very variable between devices.
However for low voltage circuits BJTs are often more convenient since an emitter follower only drops 0.7V,
a source-follower would be more like 2 to 4V.
Anyway here we really have a requirement for current control, not resistance control, and a programmable
current-sink circuit is the correct approach.
As for PWM, this totally depends on whether the solenoid core is laminated or not. If its laminated you
can PWM and not get significant heating in the core. Solid core and PWM risks overheating the core with
iron-losses - however higher frequency PWM should mean less current/flux ripple so the losses may go down to
something acceptable - perhaps some experimentation needed. However always worth thinking of a solid-cored
solenoid as a transformer with a shorted secondary.
This is the reason mains AC solenoids are typically of laminated construction.
stamp.
Sure sounds like a job for the Propeller rather than the Stamp if you want to control the current in each solenoid easily. With 4 PWM outputs you could easily just drive the gate of a MOSFET directly for absolute minimum parts. If you persist with the Stamp you will need PWM drivers and digital pots for each solenoid, and that's way more complicated. I definitely would not recommend the analog approach unless you had big heatsinks as they will get hot very quickly when you try to control the current in that awkward fashion. In fact even if you really wanted or needed to use the Stamp you could still plonk a Prop chip down simply for PWM control of 4 solenoids (or more) and talk to the Prop with a simple serial command over one I/O line for all 4 solenoids.
Optos aren't designed to drive the solenoids directly and as long as you observe good grounding practices you should need them either.
The Stamp PWM command is meant for this approach. It charges up the capacitor C1 to the desired steady voltage, and then the PWM command becomes an input so that C1 holds that voltage until you reset it or refresh it.
PWM 0, 61, 255 ' applies 24% PWM at Vin for 290ms, then holds
The capacitor is charged to 24% of 5V (=1.2V), and that through feedback holds 1.2V across R2=8Ω, and that gives 150mA in the solenoid.
Quantitatively you are asking for solenoid currents between 0.15A and 0.36A. (That is based on 180Ω for the solenoid in combination with the original series resistance values from 10 to 200 ohms, and 68V supply). The resulting power levels in Q1 and R2 are manageable, and you said also it would be low duty cycle.
I've done PWM with the Stamp just like you showed for a simple A/D converter! You're right on the currents, and I calculated a 5W BJT too. Duty cycle is very low.
Peter,
Prop may be a option, and will consider that as well. The device already has a BS2 in it with spare pins, so that was my starting point.