Maker Pro
Maker Pro

MOSFET switching time...

Someone suggested that to ensure my MOSFET completely turns off (
switching app. about 10-40 Hz) to put a resistor between the gate and
the source. I was wondering, however, will this slow down the on/off
time (excuse my novice terminology)? Thanks for any help. Lucas.
 
T

Tim Wescott

Jan 1, 1970
0
Someone suggested that to ensure my MOSFET completely turns off (
switching app. about 10-40 Hz) to put a resistor between the gate and
the source. I was wondering, however, will this slow down the on/off
time (excuse my novice terminology)? Thanks for any help. Lucas.
What's driving the gate of your MOSFET? If it's a pin off of a
microprocessor (or nearly any other IC) then your gate-source resistor
won't do much.

How such a resistor would affect the switching speed would depend on
what's driving the gate, but in general it would speed up turn off and
slow down turn on -- the question is whether the difference would be
significant or vanishingly small.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google? See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
 
Thanks for the reply,
My MOSFET is being indirectly driven by my printer port on my PC. I say
indirectly because im actually using my printer port to engage a 2N3904
transistor to allow 10V (instead of my printer port's 3.5V) engage the
MOSFET.

Im using the MOSFET to control the speed of a motor using PWM from my
PC. The problem is, however, when I run my MOSFET at 10Hz it performs
ok, but when I run it at, say, 40Hz it chokes because I think because
my MOSFET isn't actually going on and off like it should. Anyway,
thanks for you help, any more Ideas welcome.

- Lucas
 
K

kell

Jan 1, 1970
0
Someone suggested that to ensure my MOSFET completely turns off (
switching app. about 10-40 Hz) to put a resistor between the gate and
the source. I was wondering, however, will this slow down the on/off
time (excuse my novice terminology)? Thanks for any help. Lucas.


You can turn a mosfet on just by touching the gate with your finger,
and it will probably stay on even after take your finger off (try it).
Mosfets aren't like bipolars. They don't just turn off by themselves.
Mosfets need a little encouragement turning off. If you drive the
mosfet with something that both sources and sinks current then you are
fine. But if the drive is source-only, use the gate-source resistor.
 
Thanks for the quick response, but I still have a question (sorry for
my inexperience). My question is, what exactly is meant by source and
sink and how do I know if my supply is or isn't "sink-only"? Like i
said, im using a 2N3904 to drive the MOSFET, so my intuition tells me
that when my printer port is "off" I am actually driving the MOSFET
gate to ground. Is this what you mean by sinking? I could be wrong.
Lucas
 
T

Tim Wescott

Jan 1, 1970
0
Thanks for the quick response, but I still have a question (sorry for
my inexperience). My question is, what exactly is meant by source and
sink and how do I know if my supply is or isn't "sink-only"? Like i
said, im using a 2N3904 to drive the MOSFET, so my intuition tells me
that when my printer port is "off" I am actually driving the MOSFET
gate to ground. Is this what you mean by sinking? I could be wrong.
Lucas
When you reply from Google Groups it can be difficult to do so in
accepted USENET format. Please read the link at the bottom of this mail
for guidance on doing it right with Google.

A current source will deliver current by pulling its output high. A
current sink will take it away by pulling its output low. If your '3904
is connected with the emitter to ground then it'll do a fine job of
turning the MOSFET off.

If you can get your hands on an oscilloscope I'd suggest looking at the
various voltages, preferably all at once. You have three to worry about
directly: the voltage out of the printer port, the voltage at the buffer
transistor's collector, and the voltage at the MOSFET drain. It would
be hard to build a circuit too slow for 40Hz, but it can be done. More
likely your PC isn't keeping up -- but you really need a scope to tell
you that.

If you could post a link to a schematic, or use AACircuit to make an
ASCII-art schematic, you'd get a critique.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google? See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
 
Tim said:
When you reply from Google Groups it can be difficult to do so in
accepted USENET format. Please read the link at the bottom of this mail
for guidance on doing it right with Google.

A current source will deliver current by pulling its output high. A
current sink will take it away by pulling its output low. If your '3904
is connected with the emitter to ground then it'll do a fine job of
turning the MOSFET off.

If you can get your hands on an oscilloscope I'd suggest looking at the
various voltages, preferably all at once. You have three to worry about
directly: the voltage out of the printer port, the voltage at the buffer
transistor's collector, and the voltage at the MOSFET drain. It would
be hard to build a circuit too slow for 40Hz, but it can be done. More
likely your PC isn't keeping up -- but you really need a scope to tell
you that.

If you could post a link to a schematic, or use AACircuit to make an
ASCII-art schematic, you'd get a critique.

Here is my circuit...

18V 8A (for motor)

+
|
.---.
+10V | L |
| | o |
.-. | a |
10 K | | | d |
| | '---'
'-' |
| ||-+ Power
MOSFET
| ||<- IRF501
o------------------||-+
100 k | |
___ |/ |
Vin -----|___|------------| 2N3904 ===
From prt. |> GND
port 3.5V |
|
===
GND

p.s. I hope the format is better?!? Im confused what the "right" usenet
format is, sorry.
 
L

Luhan

Jan 1, 1970
0
Thanks for the reply,
My MOSFET is being indirectly driven by my printer port on my PC. I say
indirectly because im actually using my printer port to engage a 2N3904
transistor to allow 10V (instead of my printer port's 3.5V) engage the
MOSFET.

Im using the MOSFET to control the speed of a motor using PWM from my
PC. The problem is, however, when I run my MOSFET at 10Hz it performs
ok, but when I run it at, say, 40Hz it chokes because I think because
my MOSFET isn't actually going on and off like it should. Anyway,
thanks for you help, any more Ideas welcome.

You don't have a speed problem with the MOSFET - not at 40Hz. How are
you generating the timing with the PC? Normally, it is difficult at
best to create timed signals on a computer with a massive opperating
system do who-knows-what with your processor time.

Luhan
 
Luhan said:
You don't have a speed problem with the MOSFET - not at 40Hz. How are
you generating the timing with the PC? Normally, it is difficult at
best to create timed signals on a computer with a massive opperating
system do who-knows-what with your processor time.

Luhan

You're right, it is a "taboo" to use a PC to control timing aspects of
a circuit. Basically, I am using code to set a pin on my prt. port
high, then pausing for some time, then setting it low, pause etc... I
can set my frequency by specifying the "pause" times. Anyway, I would
be curious to see how bad the computer actually does at this job. Guess
i would need a scope for that. oh well, thats how I am creating my PWM.
Thanks, Lucas.
 
S

Spehro Pefhany

Jan 1, 1970
0
Here is my circuit...

18V 8A (for motor)

+
|
.---.
+10V | L |
| | o |
.-. | a |
10 K | | | d |
| | '---'
'-' |
| ||-+ Power
MOSFET
| ||<- IRF501
o------------------||-+
100 k | |
___ |/ |
Vin -----|___|------------| 2N3904 ===
From prt. |> GND
port 3.5V |
|
===
GND

p.s. I hope the format is better?!? Im confused what the "right" usenet
format is, sorry.

The gate drive circuit is fine as-is provided you don't start trying
to do a 20kHz PWM on the motor. But you should have a fairly fat catch
diode across the motor or you'll likely kill the MOSFET in short
order. A little less likely, but so could spinning the motor backwards
at higher than full unloaded speed.


Best regards,
Spehro Pefhany
 
T

Tim Wescott

Jan 1, 1970
0
Here is my circuit...

18V 8A (for motor)

+
|
.---.
+10V | L |
| | o |
.-. | a |
10 K | | | d |
| | '---'
'-' |
| ||-+ Power
| ||<- MOSFET
o------------------||-+ IRF501
100 k | |
___ |/ |
Vin -----|___|------------| 2N3904 ===
From prt. |> GND
port 3.5V |
|
===
GND
Your NPN will turn off a little slowly, but 'a little slow' in this case
should be on the order of microseconds, not 10's of milliseconds (you
can speed this up with a resistor from base to ground, and a lower value
base resistor). You are correct that the NPN should pull the gate down
sharply, unless you have a really low Hfe NPN in there -- lowering the
base resistor to 10k wouldn't go amiss, but probably won't fix your problem.

The 10K pullup working against the MOSFET gate is a little slow, too,
but even with some Miller effect it should be way faster than 40Hz.

Take Spehro's advise about a catch diode, by the way.
p.s. I hope the format is better?!? Im confused what the "right" usenet
format is, sorry.
It is better. Some of the original post would have been good for
context, but it's better.

The idea is that you should assume that your post is the only one
available -- newsgroup servers often discard older messages, and
newsreaders rarely show anything but the one message being looked at.
So you should quote enough of the old thread that your message makes
sense by itself, with your bit tacked on the end or interspersed.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google? See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
 
V

vic

Jan 1, 1970
0
Spehro said:
The gate drive circuit is fine as-is provided you don't start trying
to do a 20kHz PWM on the motor. But you should have a fairly fat catch
diode across the motor or you'll likely kill the MOSFET in short
order. A little less likely, but so could spinning the motor backwards
at higher than full unloaded speed.

IRF510s have a built in free wheel diode.
Their gate capacitance is 135pF according to the datasheet, which
excludes a low switching time on this part.

My guess is that you're using sleep or equivalent to generate the
delays. Timers on modern operating systems usually run at 100Hz, so at
40Hz you're getting close to the limit. Try using a different technique
for your delays, like for loops. You'll get 100% CPU usage with this but
you can't get precise timings without sacrifice :)

vic
 
S

Spehro Pefhany

Jan 1, 1970
0
IRF510s have a built in free wheel diode.

Really? And even if you enjoy avalanching the poor thing, what if the
motor inductance is more than ~600uH @8A?



Best regards,
Spehro Pefhany
 
G

Genome

Jan 1, 1970
0
Here is my circuit...

18V 8A (for motor)

+
|
.---.
+10V | L |
| | o |
.-. | a |
10 K | | | d |
| | '---'
'-' |
| ||-+ Power
MOSFET
| ||<- IRF501
o------------------||-+
100 k | |
___ |/ |
Vin -----|___|------------| 2N3904 ===
From prt. |> GND
port 3.5V |
|
===
GND

p.s. I hope the format is better?!? Im confused what the "right" usenet
format is, sorry.

Yes, what the other people say. You definitely need a catch diode across the
load to stop you from avalanching the mosfet, like Speff says. You really
need to reduce that 100K resistor, like Tim says.

Your 2N3904 has a hfe of 70min at IC=1mA. Take 0.6V Vbe of 3.5V and you have
2.9V on your 100K resistor and the Ib is 29uA. Times 70 gives you a maximum
2mA collector current. Yes that does swing 10K through 20V but it's a little
bit marginal when you could gaurantee it with 10K.

Your other worry is that when you switch your computer off, if the printer
port output goes high impedance, then your circuit will default to being ON.
Also the IRF510 is only rated for about 5A continuous and that assumes
serious heatsinking.

DNA
 
L

Luhan

Jan 1, 1970
0
You're right, it is a "taboo" to use a PC to control timing aspects of
a circuit. Basically, I am using code to set a pin on my prt. port
high, then pausing for some time, then setting it low, pause etc... I
can set my frequency by specifying the "pause" times. Anyway, I would
be curious to see how bad the computer actually does at this job. Guess
i would need a scope for that. oh well, thats how I am creating my PWM.
Thanks, Lucas.

Because Windows is a timesharing system, the computer is not always
running your program. It goes bye-bye often to do many other things.
As you try to generate higher frequencies, the effect is more
noticeable. Basically, it just does not work for PWM.

You can use it for I2C and some other protocols because the exact
timeing is not critical, only the releative times of the clock and data
signals. It is often used to do very low cost PIC programmers for the
same reason.

Luhan
 
Thanks for the reply,
My MOSFET is being indirectly driven by my printer port on my PC. I say
indirectly because im actually using my printer port to engage a 2N3904
transistor to allow 10V (instead of my printer port's 3.5V) engage the
MOSFET.
Im using the MOSFET to control the speed of a motor using PWM from my
PC. The problem is, however, when I run my MOSFET at 10Hz it performs
ok, but when I run it at, say, 40Hz it chokes because I think because
my MOSFET isn't actually going on and off like it should. Anyway,
thanks for you help, any more Ideas welcome.

You might try some external pwm circuit with some counter if you want to keep
it simple.
The better approach is proberbly to use a mcu (avr/pic) to drive this. That
way you do away with any timeing issues.

There's also the dos way. Then you will be controlling on a per cycle basis.
On pentium cpus you might want to look into RTC clock. That counts up for
every cycle.
 
T

Terry Given

Jan 1, 1970
0
Spehro said:
Really? And even if you enjoy avalanching the poor thing, what if the
motor inductance is more than ~600uH @8A?



Best regards,
Spehro Pefhany

LOL :)

Cheers
Terry
 
T

Terry Given

Jan 1, 1970
0
Genome said:
Yes, what the other people say. You definitely need a catch diode across the
load to stop you from avalanching the mosfet, like Speff says. You really
need to reduce that 100K resistor, like Tim says.

Your 2N3904 has a hfe of 70min at IC=1mA. Take 0.6V Vbe of 3.5V and you have
2.9V on your 100K resistor and the Ib is 29uA. Times 70 gives you a maximum
2mA collector current. Yes that does swing 10K through 20V but it's a little
bit marginal when you could gaurantee it with 10K.

Your other worry is that when you switch your computer off, if the printer
port output goes high impedance, then your circuit will default to being ON.
Also the IRF510 is only rated for about 5A continuous and that assumes
serious heatsinking.

DNA

I'd also change the gate pullup from 10k to 1k. Or better yet, smack in
a buffer. I doubt its too much of a problem even right up there at 40Hz,
but 10k wont be winning many arguments with miller capacitance (Cgd)
when the FET tries to switch.

PCs are shit for timing. My computer guy couldnt give me a guaranteed
1ms tick under windows....

Hilarious when you consider my cpu will do a floating point multiply in
a few ns.

Cheers
Terry
 
V

vic

Jan 1, 1970
0
Terry said:
LOL :)

Cheers
Terry

Hmmm ... looks like I made a fool of myself ... I was told this was a
free wheel diode, apparently it is not, so would you care to explain ?

thx,
vic
 
S

Spehro Pefhany

Jan 1, 1970
0
Hmmm ... looks like I made a fool of myself ...

Not at all.
I was told this was a
free wheel diode, apparently it is not, so would you care to explain ?

Sure. When the MOSFET is 'on', current flows from the supply to drain
to source. When the MOSFET starts to turn off, the voltage at the
drain will *rise* to higher than the supply rail (due to motor
inductance), most likely limited in this case by the avalanche voltage
of the MOSFET. That dumps some energy (high current at high voltage,
so quite high instantaneous power) into the MOSFET. The absolute
maximum single pulse energy for the given part number is only 0.019J.
PM motors don't tend to be as high inductance as solenoids so you
might actually get away it, but it's not a good idea.

A freewheel diode across the load will limit the drain voltage to a
volt or so above the positive rail, and the diode itself will
dissipate very little power because the voltage is so low. In case
you're wondering, the energy stored in the inductance gets used up in
the motor, which is usually where you want it anyway.

The diode you see in the MOSFET datasheet (body diode) won't conduct
unless the voltage at the drain drops below ground. That is actually
possible under some conditions with a motor (for example if you
mechanically overdrive the motor at faster than full speed or if the
motor supply was suddenly pulled down with the motor spinning the
back-EMF could cause the body diode to conduct). The result would be
braking. But that diode is of no help dealing with the motor
inductance.


Best regards,
Spehro Pefhany
 
Top