Author Topic: Choosing series reistor for mosfet gate on a 328PB GPIO  (Read 503 times)

0 Members and 1 Guest are viewing this topic.

Offline trilerianTopic starter

  • Regular Contributor
  • *
  • Posts: 177
  • Country: us
Choosing series reistor for mosfet gate on a 328PB GPIO
« on: June 26, 2024, 09:03:17 pm »
Choosing series reistor for mosfet gate on a 328PB GPIO...

Ok, data sheet for the 328PB says there is a max allowable current of 40mA.  Doing some searching there are many that say keep it to 20mA.  Ok fine.  With a mosfet there is gate capacitance that we have to take into account.  Lots of searching on that gives lots of different views about adding series gate resistors.  But regardless, I'm going with the "it is a good idea".  The problem I am running into is a definitive answer to the value of said gate resistor.  I see answers ranging from 50 \$\Omega\$ to 1k \$\Omega\$.  So I thought about this and since the gate is essentially a capacitor, putting a series resistor on the gate seems like it is calculated like an RC filter.  So with this equation: I=Vb/R*e^−t/RC, we can figure out the current in an RC filter. Or at least I think we can... At T(0) the expression simplifies to I = Vb/R.  But you almost always see people saying that the gate capacitance matters for choosing the resistor, but at T(0) the capacitance means nothing.  Only when you "close" the circuit and T increases does the rest of the expression come into play.   So if we say we use a 50 \$\Omega\$ resistor for the gate, at T(0) that would be 100mA, and too much for the pin.  Now there is a resistance on the output of ~ 125 \$\Omega\$, so that could be added to the 50 \$\Omega\$ and now you are at 28.6mA.  Ok, so that is fine.   But the question, does this really need to be evaluated for T(0)?  The reason the question comes up is really to determine how many parallels mosfet gates can be driven from one GPIO.  And then to determine switching speeds that can be used... Default on pin 3 is 490Hz, but you can change that.

Here is my current value for my gate resistors.  220 \$\Omega\$, and the gate capacitance of the mosfets I am using are 11300pF.  So, do I include the 125 \$\Omega\$ resistance of the output pin, I would say yes.  I have 4 of these mosfets in parallel in my circuit, each with its own 220 \$\Omega\$ gate resistor.  If I include the resistance of the output pin, then the resistance is 345 \$\Omega\$.  We start at 5V/345 \$\Omega\$ = 14.5mA.  So that is fine for 1 or 2, but I have 4.  So roughly 60mA.  But I have had no issues with this circuit, no issues with the output pin.  That current is transient, after 2us the current is down to 8.7mA. 

Alright, my plan is to change these gate resistors to 1k \$\Omega\$, but I want to make sure my math is correct before doing this.

If I choose the 1k \$\Omega\$, then at T(0) (with the 125 \$\Omega\$ resistance from the pin) it would be 4.44mA per mosfet, so under 20mA for all 4.  Great.  the RC constant would be 13us, 5 constants would be 65us, which is a frequency of roughly 15kHz.  So as long as I keep the switching frequency under 15kHz, I assume I would be fine?

Thanks
 

Offline trilerianTopic starter

  • Regular Contributor
  • *
  • Posts: 177
  • Country: us
Re: Choosing series reistor for mosfet gate on a 328PB GPIO
« Reply #1 on: June 27, 2024, 01:41:54 am »
Here is scope output on the gate using a 1kΩ resistor.  I changed the PWM frequency to ~ 4kHz.

 

Offline trilerianTopic starter

  • Regular Contributor
  • *
  • Posts: 177
  • Country: us
Re: Choosing series reistor for mosfet gate on a 328PB GPIO
« Reply #2 on: June 27, 2024, 02:34:29 am »
Well, changing the frequency to 4kHz made the mosfets hotter, faster.  Interesting that passing the same amount of current they get hotter at a higher frequency switching, yet at the same time the SOA with higher switching frequencies are a broader area. 
 

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 529
  • Country: sc
Re: Choosing series reistor for mosfet gate on a 328PB GPIO
« Reply #3 on: June 27, 2024, 03:33:43 am »
There's no one size fits all for RG selection. It's always a tradeoff between gate current / switching speed / switch node ringing and ultimately switching loses.

So as long as I keep the switching frequency under 15kHz, I assume I would be fine?
No, you'll probably ends up burning your MOSFET if it switches significant amount of current.

Well, changing the frequency to 4kHz made the mosfets hotter, faster.  Interesting that passing the same amount of current they get hotter at a higher frequency switching.
That's expected, increasing switching frequency increases switching loses.

yet at the same time the SOA with higher switching frequencies are a broader area.
You probably misunderstood the FBSOA curve. Power MOSFET datasheet usually only show how much current it can survive doing a single pulse of specified width. It says nothing about current at frequency.
Yes, it's kind of misleading, but it's been that way practically since the beginning.
« Last Edit: June 27, 2024, 04:06:29 am by ArdWar »
 

Offline WattsThat

  • Frequent Contributor
  • **
  • Posts: 776
  • Country: us
Re: Choosing series reistor for mosfet gate on a 328PB GPIO
« Reply #4 on: June 27, 2024, 04:02:40 am »
Presenting a solution to the wrong question…

You're solving for how hard you can load the 328 output pin when you should be solving for how much gate drive current is required to meet the mosfet operating requirements, given its on resistance, load current and switching rate. Then you know how much gate drive current is required. Then multiply by four because you're driving four devices in parallel and you quickly realize you need a proper gate driver IC.

Just because you can drive a single, properly selected logic level mosfet gate with a GPIO pin doesn’t mean you should, much less four of them in parallel.
 
The following users thanked this post: m k

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 529
  • Country: sc
Re: Choosing series reistor for mosfet gate on a 328PB GPIO
« Reply #5 on: June 27, 2024, 04:13:05 am »
Now thinking about it (and actually reading the wall of OP text), it sounds like good time to pick a proper gate drive.

OP seems to want to switch large current (implied with four parallel FET), with large MOSFET (implied with the ridiculous Ciss) at fairly high switching frequency.
This usually means you need very large gate current in the order of ~5A per gate, with decent ~10V gate voltage since your RDS(ON) will probably be crap at 3.3 VG.
« Last Edit: June 27, 2024, 04:14:51 am by ArdWar »
 

Offline trilerianTopic starter

  • Regular Contributor
  • *
  • Posts: 177
  • Country: us
Re: Choosing series reistor for mosfet gate on a 328PB GPIO
« Reply #6 on: June 27, 2024, 01:49:51 pm »
You probably misunderstood the FBSOA curve. Power MOSFET datasheet usually only show how much current it can survive doing a single pulse of specified width. It says nothing about current at frequency.
Yes, it's kind of misleading, but it's been that way practically since the beginning.

Well that makes much more sense.

Now thinking about it (and actually reading the wall of OP text), it sounds like good time to pick a proper gate drive.

OP seems to want to switch large current (implied with four parallel FET), with large MOSFET (implied with the ridiculous Ciss) at fairly high switching frequency.
This usually means you need very large gate current in the order of ~5A per gate, with decent ~10V gate voltage since your RDS(ON) will probably be crap at 3.3 VG.

I'm a little lost on this statement.  Granted I see the need for a gate driver, but I haven't gone through the process of picking one out.  Might as well give it a try, but I don't understand the 5A requirement here.  Aside from the capacitive load I thought the gate had no load, completely voltage driven. 

Presenting a solution to the wrong question…

You're solving for how hard you can load the 328 output pin when you should be solving for how much gate drive current is required to meet the mosfet operating requirements, given its on resistance, load current and switching rate. Then you know how much gate drive current is required. Then multiply by four because you're driving four devices in parallel and you quickly realize you need a proper gate driver IC.

Just because you can drive a single, properly selected logic level mosfet gate with a GPIO pin doesn’t mean you should, much less four of them in parallel.

Again, I'm a little lost.  Is there some load that the gate produces beyond the "capacitor" that is made between the gate and substrate?  I'm not against figuring out a gate driver, I just want to know why I need it.  The mosfets I am using operate just fine with 4.6V-5V Vgs.  The RDS on is somewhere around 1.3-1.5mΩ. 

Now thinking about it (and actually reading the wall of OP text), it sounds like good time to pick a proper gate drive.

OP seems to want to switch large current (implied with four parallel FET), with large MOSFET (implied with the ridiculous Ciss) at fairly high switching frequency.
This usually means you need very large gate current in the order of ~5A per gate, with decent ~10V gate voltage since your RDS(ON) will probably be crap at 3.3 VG.

My interest in this hobby has started with RC car applications.  So yeah, ridiculous power in an extremely small package, and to make it even more of a challenge, I am in the racing side of RC cars.  People don't want big bulky equipment, it is a pain to transport to the track and back home.  So my design was oversized on the mosfets so I could keep RDSon down to a minimum. 
As I said before, RDSon @4.5-5V is fine, there is not a significant difference between 4.5V and 10V with RDSon.  I mean there is, but it is less than 1.0mΩ.  Here is the datasheet of the mosfet I am using https://www.mouser.com/datasheet/2/196/Infineon_IPP013N04NF2S_DataSheet_v01_00_EN-3011955.pdf.  I went through a few different mosfets before landing on this one.  I'm sure there are better choices out there, but there are a lot of data sheets to go through as well.  At some point you have to say this is good enough... 

My requirements:
Up to 45A continuous Id
200A 500ms pulses.  pulses will not be in shorter increments than 10 seconds. 
Switching frequency doesn't really matter, I was just testing 4kHz, but the stock pwm of the 328pb at 490Hz is completely fine for this application.
5V logic level compatible Vgs with low RDSon so it can be driven with the 328PB pwm pin.

I chose the mosfet based on my requirements.  The only thing I didn't really have a good grasp on was the resistor for the gate.  I just went with what someone told me to do.  Now I am trying to sort out what should actually go there.

From my experimentation, and this is my preferred method of learning, I learned that at a 4kHz switching frequency the wave is attenuated what seems to be too much.  Which I also found odd because the 3db cutoff of the RC low pass that is created is 12.5kHz.  Anyway, this setup caused the mosfets to jump from 30°C to 50°C in about 2 seconds.  I am measuring the temp at the junction of the drain tab and a heatsink with an NTC thermistor using the steinhart equation and the values from the datasheet.  So this isn't a truly calibrated thermister, I assume there can be some error here on the temp...  Also this caused my PID controller to "hunt" a bit more.  So 4kHz switching with a 1kΩ resistor is not quite the right choice. 

I changed the switching frequency back to 490Hz and left the 1KΩ resistors in.  The system is stable, the temperatures are what they normally are with the 220Ω resistors, and I will post a pic of the generated waveform. Only a small amount of attenuation on the rising edge.  If my thought process is not way off in my OP, then I think I would be fine with 470Ω gate resistors. 

As to ringing, yeah, I've not devoted any significant amount of time researching ringing yet.  It's on my list, but I have so far gone with a lower switching frequency to avoid ringing, as that is what the internet said to do.  I'm not even sure how to measure it, or what the symptoms of ringing are...


Alright, all of that said...  Yes, I do want to find a proper gate driver.  There are a couple of reasons for this.  One, I want to learn to do that, lol.  But also my requirements are changing.
New requirements.
Same Id requirements.
3.3V logic as I am moving to either an STM32F411 or an ESP32 (undecided as of yet).
Move to smd mosfets.

The only issue is the input voltage to the system can vary from 12-15VDC.  I don't know anything about gate drivers, can they put out a pwm 10V with varying Vin or will I need to regulate the supply voltage for the gate driver?


 

Offline m k

  • Super Contributor
  • ***
  • Posts: 2232
  • Country: fi
Re: Choosing series reistor for mosfet gate on a 328PB GPIO
« Reply #7 on: June 27, 2024, 02:28:11 pm »
Quote
Just because you can drive a single, properly selected logic level mosfet gate with a GPIO pin doesn’t mean you should,

The pin is not the beginning, it's in the middle.
Advance-Aneng-Appa-AVO-Beckman-Danbridge-Data Tech-Fluke-General Radio-H. W. Sullivan-Heathkit-HP-Kaise-Kyoritsu-Leeds & Northrup-Mastech-REO-Simpson-Sinclair-Tektronix-Tokyo Rikosha-Topward-Triplett-YFE
(plus lesser brands from the work shop of the world)
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: ie
    • LinkedIn
Re: Choosing series reistor for mosfet gate on a 328PB GPIO
« Reply #8 on: June 27, 2024, 08:31:29 pm »
Quote
Is there some load that the gate produces beyond the "capacitor" that is made between the gate and substrate?
Exactly for this reason - to charge gate capacitor FAST. MOSFET power loss is maximum in the switching moments. When S-D voltage changed and Drain current also changed. Dissipated power proportional to I*V, so it has maximum in a middle of switching period. Outside of switching I or V almost zero, and power loss is minimum.
So, to reduce power loss to minimum transistor should be switched at maximum speed. Maximizing Gate current will minimize switching time.
 

Offline trilerianTopic starter

  • Regular Contributor
  • *
  • Posts: 177
  • Country: us
Re: Choosing series reistor for mosfet gate on a 328PB GPIO
« Reply #9 on: June 28, 2024, 05:53:30 pm »
Quote
Is there some load that the gate produces beyond the "capacitor" that is made between the gate and substrate?
Exactly for this reason - to charge gate capacitor FAST. MOSFET power loss is maximum in the switching moments. When S-D voltage changed and Drain current also changed. Dissipated power proportional to I*V, so it has maximum in a middle of switching period. Outside of switching I or V almost zero, and power loss is minimum.
So, to reduce power loss to minimum transistor should be switched at maximum speed. Maximizing Gate current will minimize switching time.

Ok, so how do I go about choosing a gate driver? I've looked at a bunch of data sheets this morning and most of them still suggest a resistor on the output, which creates that RC time constant, so you are still limiting the current on the output.  How do I choose what current I want on the output to charge the gate capacitor?

Also, can I use a one channel driver and connect to all 4 mosfets, I think this should be fine, cause I'm doing that already... 

Anyway, here is a part that I think will work...  UCC27517AQDBVRQ1, data sheet:  https://www.ti.com/lit/ds/symlink/ucc27517a-q1.pdf?ts=1719596856162&ref_url=https%253A%252F%252Fwww.mouser.com%252F
« Last Edit: June 28, 2024, 05:55:56 pm by trilerian »
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 371
  • Country: ie
    • LinkedIn
Re: Choosing series reistor for mosfet gate on a 328PB GPIO
« Reply #10 on: June 28, 2024, 07:17:04 pm »
This driver is ok. About using one driver for 4 mosfets - you can use it, but turn on/off time will be 4 times longer.
Resistor shoud at least limit current on output at rated driver pulse current. For 5V/4A driver it should be 1.25 Ohm. If you will connect multiple mosfets to driver use 1 resistor and connect all mosfets pins in parallel
 
The following users thanked this post: trilerian


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf