Driving FET gate

Go To Last Post
29 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've been doing something in testing and throw-away project which is, I know, bad - or at least incorrect. But it's been working really well, and I thought I'd get some feedback on the practice.

I've got a good number of FETs that I've taken off of motherboards - ridiculously low Rds, even at low voltages - Vgs threshold around 1.5v, and < 10milliohm with a Vgs of 4.5v. And when you can get 10, 15, or 20 at a time, they're certainly a good find.

The practice is that I've been connecting the AVR output pin directly to the base without anything in between. I know that a resistor should be used, for current limiting - or at least to prevent ringing. But things have been working quite well.

The AVRs haven't self-destructed or (seemingly) been damaged by the brief in/outrush of current, and for simple PWM dimming, I dunno if I'd see any external effects from the ringing or not. Unfortunately, I do not have access to a scope, or I'd take a look at what's going on directly.

So... just how bad (or not-so-bad) is this?

Last Edited: Fri. Oct 19, 2007 - 09:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It sounds like you are having fun and there is nothing wrong with that. And it can not be bad if you are learning by experimenting. What you are doing is fine, I know at lot of so called engineers who are all theory no no practice. If they can't get it to work on paper they give up. They even criticize me for not doing the theory first.You got to let the smoke out and burnt fingers heal (most of the time).

I'm not an expert on driving FETS from Micros but there are plenty of references in the forums to this.
I normally put a low value resistor (100) to limit ringing and this seems to work OK.

JUST KEEP SAFE (lower than 40V DC).

73's
Roy
VK5ASY

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, it's a good idea to have a close look at old MoBo's. I salvaged a lot of these fets too. And have a look at their driver too: magnificent stuff :)

Basically there is nothing wrong with connecting the fet's gate (not base) to an AVR I/O pin. It's unlikely that the AVR will get damaged. But if you look at the spec's of these fets, you'll find that their gate-capacitance can be as high as 3000 pF. This means a high in-rush current for the AVR-pin. So a direct connection from pin to gate means an overload-condition for the pin on each edge of the (PWM) signal.

To drive the fet as fast as possible, and yet staying within the spec's, a resistor of 270 ohm should be placed between pin and fet. There is a drawback: the transition-time increases, so the fet will dissipate a bit more than without the resistor.

This kind of questions are better asked in the General Electronics-forum btw

Cheers

Nard

Edit
Okay RAS, next time I will type faster :)

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BJTs have a base, FETs have a gate.

Basically it all boils down to how fast switching speed you need. But you are right, the peak current when changing the state of the output pin would only be limited by internal device resistances, I have no idea how the AVR can handle this. The FET will propably survive, but if too much resistance is put in series, the longer it takes for the FET to turn fully on or off, so more power is wasted into heat.

So it's kind of a tradeoff. With 100 ohms, the current can be too low to switch the FET properly at high frequecies. Without the resistor the AVR might suffer if high pulsed currents are used repeatedly. But the AVR output pin internal resistance might just be enough to limit this so it does not blow up. I used 10R to switch power to LCD display every now and then.

You can also use some kind of gate driver, or build it with discrete components (PNP and NPN transistors as emitter followers, at least 1 resistor), but this will drop the gate voltage by 0.7V, so the FET might not turn fully on.

- Jani

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Other than the already mentioned shunts, don't forget a pullup or pulldown resistor for the Gate. Once you've initialized your AVR IO pins you don't need it anymore, but the Gate is floating between turning on the power and switching the driving IO pin to output.

Have fun,
Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jepael wrote:
BJTs have a base, FETs have a gate.

Basically it all boils down to how fast switching speed you need. But you are right, the peak current when changing the state of the output pin would only be limited by internal device resistances, I have no idea how the AVR can handle this. The FET will propably survive, but if too much resistance is put in series, the longer it takes for the FET to turn fully on or off, so more power is wasted into heat.

Doh! I did call it a base, didn't I. I'll have to watch myself. :D

Just for fun, while I was waiting for replies, I whipped out a little buck converter on the breadboard, with an inductor, schottky, and cap taken from a power supply, and a pair of 1-watt LEDs for a load.

Concerning the switching speed, if I run my AVR at 8 MHz and no prescalar on the 8-bit timer, the rise/fall on the FET doesn't seem quite fast enough - setting an OCR value of 1 gives me *nothing* from the LEDs, and going to 5 gives me just a little.

On the other hand, with a prescalar of 8, a value of 1 does light up, and going 1->2->3, etc., things work as expected.

The same held true with or without a 1k resistor in series with the gate.

What surprised me the most was the non-linearity in duty cycle vs. current - changing the OCR from 10 to 20 gave me nearly a 300% increase in current, 20->40 gave about a 110% increase, and 30->60 gave me a 600% increase. The current does, at least on time scales measured by my meter, stay rock-solid.

Of course, this is a massively unoptimized design, particularly since I don't know the value of the inductor.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's because a LED, just like a normal diode, has a very steep V/I curve; a very small increase in voltage will dramatically increase the current.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should include a gate series resistor to slow the rate of switching. If the switching is fast, the feedback from the Drain (through the Gate-Drain capacitance) can cause oscillation, if you're lucky it's just a short bit of ringing. This leads to radio emissions up at a few hundred MHz and of course the associated heating which depends on the load.

GK

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jayjay1974 wrote:
That's because a LED, just like a normal diode, has a very steep V/I curve; a very small increase in voltage will dramatically increase the current.

Good point. I hadn't thought of that.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

According to the ATMEGA48 data sheet, at 5V and 20MHz, the system clock has a rise time of 500nS. I had to scratch some rust off the noodle for this one. Assuming the rise time of the I/O pin can't exceed the fastest documented rise time in the system then dV = 5V and dt = 500nS. With a 3000pf gate capacatance, that's 30mA(t). That won't hurt an I/O pin. The pin is current limited to drive an LED directly. So, an output high will only show about 2 volts on the pin if sourcing an LED. Since it's AC, I would make sure you have good bypass caps (> 10X gate C) on all VCC pins.

You should not have any problems.

official AVR Consultant
www.veruslogic.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I am just a technician so there is a very good possibility that I am not understanding something, but... If the AVR clock is 20MHz that means the clock period is 50nS - 50 x ten to the negative ninth, correct? How can the system clock have a rise time ten times longer than the system clock total period. Like I said, I am probably totally confused about something.

edit: Okay, I reread the post, are you saying the rise time of an I/O port pin is 500nS? That would make sense.

Regards,
Steve

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gr82bdad wrote:
According to the ATMEGA48 data sheet, at 5V and 20MHz, the system clock has a rise time of 500nS. I had to scratch some rust off the noodle for this one. Assuming the rise time of the I/O pin can't exceed the fastest documented rise time in the system then dV = 5V and dt = 500nS. With a 3000pf gate capacatance, that's 30mA(t). That won't hurt an I/O pin. The pin is current limited to drive an LED directly. So, an output high will only show about 2 volts on the pin if sourcing an LED. Since it's AC, I would make sure you have good bypass caps (> 10X gate C) on all VCC pins.

You should not have any problems.

Thanks for the input, I appreciate it. I do have one question, though - it sounds as if you're saying that the output pins are internally current-limited. Is that correct? I wasn't aware that they were.

Bypassing is overboard, if anything. Since I have piles of caps around, I tend to through them in quite liberally. Between the +5v line, +12v line, and the buck itself, I have a little over 10,000 uF in electrolytics, and a bunch of .1 uF ceramics scattered around. All of my 'spare' (not currently in use) ceramics just get stuck in the +/- lines on my breadboard to boot.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gr82bdad, I will try to find that spec of 500 ns, but I never saw it before ....

What I *did* see on scope, is the very high slewrate on I/O pins. Much faster than 500 ns .... it was more like: less than 20 ns.

@Klave: ringing needs short rise- and fall-times, and a transmission-line. Driving a fet-gate of 3000 pF from an IO-pin with less than 10 cm track, I think there will not be much ringing. OTOH, driving a 100 cm cable, and "terminate" that with 3000 pF gate-capacitance .... that will cause ringing indeed.

The capacitance between Drain and Gate is IMO not the cause for oscillation: that capacitance behaves like a pig :) : if you try to push it forward, it will resist; if you in your despare try to pull its tail to get it back in the pigeon house, it will try to move forward. Getting back to fets: you drive the gate high, fighting the gate-source capacitance, after some time it will let you win, fet starts to conduct, drainvoltage drops, and now the capacitance between drain and gate will make you life hard one more time: the falling-drainvoltage will for a short while cancel your driving force on the gate. As long as you're more persistent than the capacitance, you will manage ....
Turning the fet off: simular story

A pig-cap, that's what it is :)
(or a donkey-cap, if that suits you better)

Nard

edit: speedy posters here ... while I wrote the pigs-tale

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
ringing needs short rise- and fall-times, and a transmission-line

Not so, I've failed EMC because of it! No transmission lines in site. 60KHz SMPS with 220MHz emissions from HC gates driving power FETs. If your drive impedance is high enough you are OK, I usually use about 200 ohms but it depends on the application.

GK

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

How can the system clock have a rise time ten times longer than the system clock total period.

Good question. I got this from table 26-1 in the mega48 data sheet. I thought it was referring to the internal clock, but it is referring to external clock. The maximum rise time is 500nS. Obviously a 20MHz oscillator won't have that long of a rise. But the answer to your question is all about the rise time of the pin and, that was the only info I could find regarding rise time of any clock.

However, after looking some more, I found table 26-3 that says the SPI clock output in master mode has a rise time of 3.6nS. That would merit special layout consideration notes in our schematics.

In section 10.1 the statement reads "Each output buffer has symmetrical drive characteristics with both high sink and source capability. The pin driver is strong enough to drive LED displays directly." There are limits to the total current of course, but if you put an output high to source the anode of an LED, you won't see the full output high voltage on the pin you will see the forward bias voltage of the LED. There is short circuit protection on an output port, so I don't think you will harm it - it might draw a bit more current.

But, in my production products, the gate has a resistor.

official AVR Consultant
www.veruslogic.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Klave wrote:

Quote:
Not so, I've failed EMC because of it! No transmission lines in site
OK, I should have been more precise. I assumed it would be understood. A designer needs to be aware of the fact that a pcb-track gets transmission-line properties if frequency-domain and length of the track have a "considerable" value.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
A designer needs to be aware of the fact that a pcb-track gets transmission-line properties if frequency-domain and length of the track have a "considerable" value.

That's true but nothing to do with the oscillations I'm talking about. FETs can oscillate because of the fast edges at the output and circuit parasitics. This appears as ringing and the way around it is to slow the edges with a series resistor at the input.

The circuit parasitics include the track inductances, capacitances and the interaction with the load turn-on characteristics of a power MOSFET. This is especially bad for big power FETS.

The startup period is the cap charge time.
The next period is the turn-on period of the fet when the output voltage falls fast and dramatically. This is when the oscillations occur. With oscillations this can become quite a long period
The final period is when the gate voltage reaches its final value and all is stable again.

Its quite complicated and circuit dependent so I say, slow the input and avoid the problem.

GK

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The EMV possible problem is reason enough to include an resistor. It depends on the HF poperties of the layout wether you get ringing or not. Real oscillations are rare, but can cases damage the circuit (the MOSFET or even something else)in extreme cases. A nasty side effect is that a typical 40 MHz scope will not show 200 MHz Oscillations at all, except that nothing works as expected. It depends on the country you live but it can get expensive if the authorities come around looking for an illegal radio station.

And finaly small resistor close to the Fet is all it takes to be on the save side.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Klave: Aha ! Now I understand your concern. You're right ... thanks for enlighting me on that (I was still at the input)

So when we take all considerations into account, that gate-resistor is a good thing to implement.
Usefull discussion. Thanks guys.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, one final question: How large or small of a resistor is useful? I've seen some designs where they were driving large currents to the gate, and the resistor was just a few ohm, around 3 or 4, if I recall. Is that enough to prevent the problems?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's a balance: slower switching means more losses in the fet; fast switching: IO-current out of spec, and, as Klave explained: EMC.

What are you using the pwm for ?
If it's to control f.i. led's: then there is no need for high pwm-frequencies, 1000 Hz is good enough.
If it's for SMPS, other considerations are in the game too ....

So: what is the project ?

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I didn't really have any particular project in mind, it's something I've done in various things. I'm nothing more than an amateur hobbyist, none of this tomfoolery will ever appear in a commercial product. :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Driving fets from avr-io-pin, i use 270 ohm if the pwm is 10 kHz or less; if i need pwm for a SMPS, running @ 50 - 200 kHz, I use 100 ohm.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nard is correct. He gave you the standard consultant answer... "It Depends." Sharp edges are good for efficiency, but bad for EMC. More rounded corners are good for EMC, but can effect the circuit performance. as you go with more slope on the edges, your FET is operating more in the analog region, you may need to consider your heat sink as the FET will have more losses. So, a simple resistor change can be far reaching in the design.

If you don't think that EMC from your project is worth worring about, check this out.

http://wzus.ask.com/r?t=p&d=us&s=a&c=a&l=dir&o=0&sv=0a30051a&ip=42373864&id=80A01ABB18ED774C820426EEADA12FE0&q=toshiba+van+Rossman&p=1&qs=167&ac=29&g=1831v34QoJKODx&en=te&io=2&ep=&eo=&b=alg&bc=&br=&tp=d&ec=10&pt=Technology%20News%3A%20News%3A%20Toshiba%20TV%20Emits%20Aircraft%20Emergency%20Signal&ex=&url=&u=http://www.technewsworld.com/story/37435.html

Sorry for the long URL. I don't know how to fix this.

official AVR Consultant
www.veruslogic.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Nard is correct. He gave you the standard consultant answer...

:lol: :lol:

But the good thing is that I explain which things to consider!

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

But the good thing is that I explain which things to consider!

That is true, but then, you've probably never been to the "Consulting 101" seminar. :D :lol:

official AVR Consultant
www.veruslogic.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is there a formula to calculate this resistor, not only asumptions an pick a value in the air?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Is there a formula to calculate this resistor, not only asumptions an pick a value in the air?

Look for information on this on the manufacturers websites.

I find the application notes of International rectifier very usefull. www.irf.com

It´s not that simple if you want to calculate:
You have to take care of the
* gate-source capatcitance
* gate-drain capacitance, additionally creating a miller-capacitance while switching
* switching voltage
* switching frequency
* switching losses......

Klaus
********************************
Look at: www.megausb.de (German)
********************************

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

repeat wrote:

Quote:
Is there a formula to calculate this resistor, not only asumptions an pick a value in the air?
It's not a random pick at all. The recommendations so far are values based on experience and parameters for that specific application. Like Klaus says, there are a lot of things that have to be taken into account. And probably the list is even longer.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips