PWM to drive IRL530?
Kirk Fraser
Posts: 364
I found a circuit under the Propeller topic to drive an IRL530.
http://forums.parallax.com/showthread.php?t=124471&highlight=IRL530
What modifications would enable it to drive from a Stamp using PWM (pulse width modulation) to give a variable voltage out of the IRL530?
Or would it be easier to stick with a serial output to DAC to OpAmp to IRL530 that was posted here 5 years ago? A more direct route without the extra chips would save lots of errors. Thanks!
http://forums.parallax.com/showthread.php?t=124471&highlight=IRL530
What modifications would enable it to drive from a Stamp using PWM (pulse width modulation) to give a variable voltage out of the IRL530?
Or would it be easier to stick with a serial output to DAC to OpAmp to IRL530 that was posted here 5 years ago? A more direct route without the extra chips would save lots of errors. Thanks!
Comments
The PWM command produces a rough series of pulses, originally designed to be filtered with a capacitor to provide a variable signal voltage.
However, I've used the command and IRL-type transistors to drive motors and proportional hydraulic valves quite nicely.
http://forums.parallax.com/attachment.php?attachmentid=43806&d=1161810605
The example you attached is for on-off switching of a relay which is not what PWM is used for.
Here's my code. Stamp pgm.txt
Here's a circuit attempt.
And another: PropValveDriver.gif
My current goal is to make a hydraulic rotary actuator do a simple back and forth swing test without pulling the mounts out of the concrete which was happening with a simple JK-flip flop circuit. My program may not be tweaked perfectly for smooth S-curve reversals yet but it's on the right track judging by LED responses to the 10K pot position sensor.
What you need is something 20KHz or slower to drive the transistors. This could be simulated on the Stamp with PULSOUT in a loop, perhaps, with SEROUT and some cleverly selected data, or the same but with the data line of SHIFTOUT. None of these work-arounds are especially good, however.
-Phil
The input to the mosfet has to be a PWM signal such as generated by the PWM command, but without the capacitor shown in the example.
Come directly out of the Stamp pin, go through some resistance (say 1K) and connect directly to the gate of the mosfet. Do not use the capacitor. Also have about 15K connected from gate to source.
Now the transistor will switch fully on and off according to the PWM pulse stream and the valve will respond according to its mechanical response time.
Cheers,
-Phil
Despite your apparent success in doing as you describe, I'm afraid I still have reservations about your methodology. The PWM output frequency of the BS2 at 50% is 113 KHz. The gate capacitance of the IRL530 is 930pF. Here's what happens when you drive a 1000pF load through a 1K resistor from the BS2's PWM output:
What this trace illustrates is that the MOSFET will be spending a large amount of time in it's linear region -- neither fully on nor fully off -- and possibly overheating as a consequence. The situation will be even worse with other BASIC Stamps, which have faster "PWM" outputs.
Unfortunately, upon trying them with a BS2, I've not been able to obtain satisfactory results from either SHIFTOUT, SEROUT, or PULSOUT (which I suggested in an earlier post). Perhaps the best way to obtain the desired lower frequency is with the classical triangle-wave generator and comparator, with a lowpass-filtered "PWM" driving one comparator input. ... or just drive the MOSFET using PWM via a MOSFET driver chip that can switch the gate capacitance fast enough.
-Phil
I'd hate to tell the client that his machine hasn't been operating all these years!
At 100 ohms, the rise and fall times to 90% and 10% are about 1/10 the pulse period at 50% duty with a BS2. I measured a peak charge current of 30 mA and peak discharge of 40 mA on the BS2 pins, which is a bit high for a BS2 to endure consistently. At 220 ohms, the rise and fall times double and the currents decrease to a more manageable 18 mA and 23mA. Without a heavy load and with proper heatsinking, 220 ohms might be okay. This all changes, of course, with other Stamp versions.
-Phil
Is there another transistor or product than the IRL520, IRL530 that everyone can agree will do proportional control easily? Thank you.
I think your best bet is to use the IRL530 with PWM and a MOSFET driver chip, like the MIC4420. This will permit the Stamp to drive the MOSFET without stretching the Stamp's output current specs to switch the MOSFET gate at full speed.
-Phil
Would a uln2803 be a good choice to drive mosfets, like the above mentioned irf530's or irf510's?
-Phil
while I set this up in the shop, what are the specs on the valve you'll be driving? I don't think the current drawn by th eproportional valve will overload the mosfet.
Phil,
The MIC4420 is ordered, thank you!
stamptrol,
The valve data sheet is http://www.sterling-hydraulics.com/files/pdf/JP04C31.pdf but the coils are stamped with 24VDC 14W instead of 18W. There is no spike overload for the IRL530 as I drove it by JK flip-flop for an hour at a time. Not sure if there will be a heat overload trying to maintain a proportional position. Thank you!
I had remembered doing a project years ago but got tied up with other stuff and am only getting back to trying it on the bench.
Anyway, the circuit works fine with the stamp pin driving the the mosfet gate through a 470 to 1K resistor. A 15K resistor ties gate to source on the mosfet. Diode reverse connected across the motor.The motor runs smoothly and the IRL520 transistor I had available doesn't heat up when running a 12 volt motor. I think the original poster's intent was to drive a proprotional valve at a much lower current.
Heres the code that I used to test.
' {$STAMP BS2sx}
' {$PBASIC 2.5}
main:
PWM 5,150,50 ' change the 150 to change speed, the 50 can be lowered slightly if desired.
PAUSE 20 ' depending on the length of the rest of the program, remove this pause
GOTO main
Cheers
Transfer to an apparently obsolete Stamp project board with soldered point to point wiring fails no matter what I've tried. The output is always 24V on both although the program only allows one side to be powered at a time. I cleared the Stamp output pins from being the problem. I had to replace the IRL530's and added 1K resisters plus 0.1 uf capacitors between the pins and gates to get a straight 5V or less out depending on the program. Then I tried 0.1 caps between gate and ground, plus output and ground. I cut out the extra caps and tried the 15K between gate and ground. Somehow the gates seem connected with 5V out of both Stamp pins so 24V comes out of the IRL530's. I can't see a thing wrong with it. With the extra caps the volt meter seemed to slowly discharge the "off" side down to produce an output of about 19V while the "on" side was doing 24V.
Does this resemble a problem you've encountered? Is my only option to make a custom PCB to minimize possible wiring problems? Thanks.