Choosing series reistor for mosfet gate on a 328PB GPIO - Page 1
Forum section: electronics / beginners

author: trilerian
author_rank: Regular Contributor
timestamp: June 26, 2024, 09:03:17 pm
content: 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 50to 1k. 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 50resistor 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, so that could be added to the 50and 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, and the gate capacitance of the mosfets I am using are 11300pF. So, do I include the 125resistance of the output pin, I would say yes. I have 4 of these mosfets in parallel in my circuit, each with its own 220gate resistor. If I include the resistance of the output pin, then the resistance is 345. We start at 5V/345= 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, but I want to make sure my math is correct before doing this.If I choose the 1k, then at T(0) (with the 125resistance 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

author: trilerian
author_rank: Regular Contributor
timestamp: June 27, 2024, 01:41:54 am
content: Here is scope output on the gate using a 1kΩ resistor. I changed the PWM frequency to ~ 4kHz.

author: trilerian
author_rank: Regular Contributor
timestamp: June 27, 2024, 02:34:29 am
content: 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.

author: ArdWar
author_rank: Frequent Contributor
timestamp: June 27, 2024, 03:33:43 am
content: There's no one size fits all for RGselection. It's always a tradeoff between gate current / switching speed / switch node ringing and ultimately switching loses.Quote from: trilerian on June 26, 2024, 09:03:17 pmNo, you'll probably ends up burning your MOSFET if it switches significant amount of current.Quote from: trilerian on June 27, 2024, 02:34:29 amThat's expected, increasing switching frequency increases switching loses.Quote from: trilerian on June 27, 2024, 02:34:29 amYou probably misunderstood the FBSOA curve. Power MOSFET datasheet usually only show how much current it can survive doinga single pulseof 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.

author: WattsThat
author_rank: Frequent Contributor
timestamp: June 27, 2024, 04:02:40 am
content: 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.

author: ArdWar
author_rank: Frequent Contributor
timestamp: June 27, 2024, 04:13:05 am
content: 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 ~5Aper gate, with decent ~10V gate voltage since your RDS(ON)will probably be crap at 3.3 VG.

author: trilerian
author_rank: Regular Contributor
timestamp: June 27, 2024, 01:49:51 pm
content: Quote from: ArdWar on June 27, 2024, 03:33:43 amWell that makes much more sense.Quote from: ArdWar on June 27, 2024, 04:13:05 amI'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.Quote from: WattsThat on June 27, 2024, 04:02:40 amAgain, 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Ω.Quote from: ArdWar on June 27, 2024, 04:13:05 amMy 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 usinghttps://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 Id200A 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?

author: m k
author_rank: Super Contributor
timestamp: June 27, 2024, 02:28:11 pm
content: QuoteThe pin is not the beginning, it's in the middle.

author: xvr
author_rank: Frequent Contributor
timestamp: June 27, 2024, 08:31:29 pm
content: QuoteExactly 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.

author: trilerian
author_rank: Regular Contributor
timestamp: June 28, 2024, 05:53:30 pm
content: Quote from: xvr on June 27, 2024, 08:31:29 pmOk, 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

author: xvr
author_rank: Frequent Contributor
timestamp: June 28, 2024, 07:17:04 pm
content: 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