I am trying to use the Arduino to control a high-wattage (140W) solenoid. My first circuit design was simple driver circuit described on numerous websites that uses a 100k resistor between the gate and PWM source and 1M resistor between gate and ground (I would post a pic but can't because this is my first post). I used an IRL640, a high voltage, high amp, logic-level mosfet, and the voltage source was 18V.
What I discovered was that the drain voltage varied in a highly non-linear way with the duty cycle of the PWM signal from the Arduino. Short duty cycles would cause almost no voltage to be output, whereas at a certain duty cycle, the output voltage would ramp up quickly and reach 100% well before the duty cycle reached 100%. This problem persisted with different resistor values for the gate resistor, including no resistor. I guessed that this behavior was caused by slow switching times; the mosfet was turning a crisp PWM square wave into slowly undulating goo on output. I halfway confirmed this guess by slowing the Arduino PWM frequency to 31.25 hz, which improved the linearity of output voltage against PWM duty cycle but was still lacking.
A little research led me to understand that the Arduino may not provide enough current to charge the gate capacitor quickly. Could someone confirm this? I also understand that there are chips designed to provide control signals for mosfets. In other words, I may a chip to drive the mosfet that drives the solenoid. Confirmation of this hunch and or other suggestions would be appreciated. Thanks!
I suspect that your 100k series resistor in addition to the gate capacitance is acting like a low pass filter slowing the switching action. I would first either eliminate the series resistor or lower it to 200 ohms and see how that performs. There are gate driver chips that are designed to drive the gate faster using high current drivers.
Unfortunately, eliminating the series resistor doesn't solve the problem. Changing the resistor value has some effect, but I think I need to look into a mosfet gate-driver chip. I would love to hear some suggestions for that chip, as I'm a bit lost in the vocabulary (high-side, low-side, etc.).
Sounds like rubbish to me too, but here I am. Since I'm no longer a forum virgin, I can post this circuit diagram:
This is what I've implemented, except with an IRL640, a 5V gate signal from the Arduino and 18V supply. I've tried various values for R1 (including no resistor) without success. Yes, both the Arduino and the supply (and the mosfet source) are connected to the same ground.
If it's at all helpful, I can swap in a Darlington transistor (TIP120) for the mosfet, and if I short R1, I get a nearly linear voltage to duty cycle response. Ironically, this transistor is supposed to be designed for "low-speed switching." Unfortunately, it's only rated up to 65W.
Well you could disconnect the gate resistor from the Arduino and just driving it from your +5vdc supply and see if it switches on and off as you connect and disconnect the 5vdc?
That would kind of half-split the problem to see which direction to look next.
Try removing the 100K AND putting a 4K7 (or so) from the gate to the +5V of the Arduino.
Why are you driving this with a PWM signal? It's a relay so it should be on or off so just drive it with a digital signal. It will look rather odd trying to drive a high frequency through an inductor.
Unfortunately, it's only rated up to 65W.
That is the rating of what the device will dissipate NOT what power it will switch. To get the power dissipated multiply the current by the saturation voltage of the device. That is the voltage accross the device when it is fully on.
It's actually a solenoid, not a relay, and they're probably trying to use it as a linear actuator or variable valve. In that case there is probably a low chance of success since solenoids are generally designed for two position actuation, plus the high frequency through a coil issue.
If it's a valve, those are often activated by a real positionable actuator or PWMed quite slowly for more of a metered pulse effect.
You need to remove the 100K and either make it 0 or get a driver IC.
The charging time is determined by Q = t * I where Q is the total gate charge
listed in the FET datasheet. The 100K limits your current so you are probably getting charge times in the mS range. The longer the device is between the on/off states the
more power you dissipate. In this application the device does not dissipate
much power in the on state.
Have you looked at the gate signal with an oscilloscope? With a zero ohm resistor
you will be limited by the current the Arduino can deliver during switching.
You will be able to measure that with the oscilloscope. Since Q = t * I you
can measure t, Q is from the datahsset and you calculate I.
One more thing --- after measuring the drive current and gate signals with a zero
ohm resistor you need to put a series resistance back in your circuit for protection.
The series resistance is required to limit the current that can flow back into the Arduino
pin in the event of a fault. I would also at a zener clamp on the gate of the FET.