Author Topic: High speed Mosfet switch: need help  (Read 2088 times)

0 Members and 1 Guest are viewing this topic.

Offline girishjiTopic starter

  • Contributor
  • Posts: 42
  • Country: pl
    • girish
High speed Mosfet switch: need help
« on: October 03, 2022, 10:11:54 am »
I am trying to design a switch that can turn on/off a 5V supply (500 mA load) using a 3v3 GPIO pin of a mcu. It should switch within a microsecond or so. The switch will be turned off/on at 10kHz (every 100 us).

I tried BSS138 N channel enhanced Mosfet, connected the Gate directly to GPIO pin (without gate resistor), connected Source to ground (low side switch) and Drain to 5V pin. It takes 35 us to switch. Too long. I am not sure what is causing delay. The gate capacitor should charge up quickly given the specs. Maybe it needs a complicated driver circuit.

Is there a better solution?
 

Offline Marian_elf

  • Contributor
  • Posts: 17
  • Country: ro
Re: High speed Mosfet switch: need help
« Reply #1 on: October 03, 2022, 10:20:03 am »
Are you sure that GPIO pin has a fast enough transition?
Meaning without any load on it, does it has a fast enough rise time?
How about with some resistive or capacitive load on it?
Does the rise time change?
A basic schematic of what you are testing could help.

I am asking this because that mosfet seams very fast ( much faster that needed ), and it should work.
« Last Edit: October 03, 2022, 10:22:24 am by Marian_elf »
"What's right is what's left if you do everything else wrong" - Robin Wiliams.
 
The following users thanked this post: girishji

Offline redkitedesign

  • Regular Contributor
  • *
  • Posts: 111
  • Country: nl
    • Red Kite Design
Re: High speed Mosfet switch: need help
« Reply #2 on: October 03, 2022, 11:01:26 am »
With 3.3V Vgs, and 500mA Id you are in, or close by the linear region of this FET (where it turns into a voltage (Vgs) controlled current(Id) source).

Look at figure 1 in the OnSemi datasheet.

You could try to see what happens with a 50mA load, or look for a newer FET with better characteristics.
 
The following users thanked this post: girishji

Offline Marian_elf

  • Contributor
  • Posts: 17
  • Country: ro
"What's right is what's left if you do everything else wrong" - Robin Wiliams.
 
The following users thanked this post: girishji

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5871
  • Country: de
Re: High speed Mosfet switch: need help
« Reply #4 on: October 03, 2022, 07:22:57 pm »
I wonder how a 360 mA device is supposed to switch 500 mA. Lots of open questions here, should probably be moved to "Beginners".
« Last Edit: October 03, 2022, 08:22:07 pm by Benta »
 
The following users thanked this post: girishji

Offline Marian_elf

  • Contributor
  • Posts: 17
  • Country: ro
Re: High speed Mosfet switch: need help
« Reply #5 on: October 04, 2022, 02:58:06 am »
...btw i'm not sure why OP is shorting the BSS138 from 5V to ground?

That wasn't clear to me either, that's why i've asked for a basic schematic of what was done...
"What's right is what's left if you do everything else wrong" - Robin Wiliams.
 

Offline girishjiTopic starter

  • Contributor
  • Posts: 42
  • Country: pl
    • girish
Re: High speed Mosfet switch: need help
« Reply #6 on: October 05, 2022, 07:55:21 am »
Sorry for late reply as I have to leave town for a few days. Fee corrections:
1) the load I put was drawing 5ma and not 500ma before D of mosfet (low side switch). My design requires up to 500ma but I was experimenting with small load and BSS 138 only because I happen to have this mosfet in my possession.
2) The schematic I used is like this except Rg is 0 : https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSQhm7DAXk7D8jhWPxXrkD_bS1DY3rRFS614A&usqp=CAU

When I get back I will experiment with Rg value that draws 20ma from GPIO pin (max allowed by blackpill).

 I am only measuring switch-on time here. I wait for 2ms for it to switch off before measuring again, hoping it is enough time for gate capacitor to discharge before switching on again.

Q: Is anyone convinced that ‘enhanced logic level N mosfet’ can switch in nanoseconds as they advertise without driver circuit? I assume ‘logic level’ to mean 3v3 or 5v at the gate.

From datasheets, these mosfets need considerable charge to be provided to the gate capacitor for them to switch on fully. They need a jolt at the gate to make them switch on in nanoseconds. No GPIO pin can provide this. If they happen to have low charge requirements at the G they will have higher resistance across DS, which means you need high voltage (say 10v) at G to drive these without major power loss. I want to avoid a complicated driver circuit or IC  if I can avoid. Am I missing anything?




« Last Edit: October 05, 2022, 07:59:24 am by girishji »
 

Offline redkitedesign

  • Regular Contributor
  • *
  • Posts: 111
  • Country: nl
    • Red Kite Design
Re: High speed Mosfet switch: need help
« Reply #7 on: October 05, 2022, 09:28:32 am »
The total gate charge for this FET is about 2nC. Assuming you have 20mA drive strength, that yields (2nC/20mA) = 0.2us/V. Thus the gate should be at 3.3V in about half a us.

If yours take 35us, there is something else going on. Too much gate resistance so you don't make the 20mA I would guess.
 
The following users thanked this post: girishji

Offline Marian_elf

  • Contributor
  • Posts: 17
  • Country: ro
Re: High speed Mosfet switch: need help
« Reply #8 on: October 05, 2022, 09:41:55 am »
That is why i suggested those tests on the GPIO pin it's self, you need to confirm it's fast enough both without any load on it, and with the mosfet's gate connected to it, thus you need to see if the mosfet it's self is the problem, or the drive is. Single shot capture on the rising edge, look at the transition time between the ground level and Vcc, see if it is much smaller then needed or for some reason it isn't. If let say without anything connected to that pin, the rising time is fast enough ( should be so ) but with the gate connected the rising time becomes much larger, than you do need a driver ( you can test this with any mosfet you decide to use, just to be sure ).

There are SOT23 drivers that would do the job perfectly, very fast, logic level compatible inputs, and very low component count.
More so, you can power them from a higher voltage ( let say 5V ), and still have a 3,3V control but more drive voltage to the gate, and less losses ( conduction and switching ).
You can even improvise a 2 transistor totem poll but i would choose a sot23 driver anytime i would need one.
« Last Edit: October 05, 2022, 09:44:34 am by Marian_elf »
"What's right is what's left if you do everything else wrong" - Robin Wiliams.
 
The following users thanked this post: girishji

Offline girishjiTopic starter

  • Contributor
  • Posts: 42
  • Country: pl
    • girish
Re: High speed Mosfet switch: need help
« Reply #9 on: October 06, 2022, 07:48:53 am »
@reddkitedesign I think your calculation is dubious. Equation is exponential, not linear. There is a dV/dt in there. Besides gate resistance itself is a function of Vgs.
 

Offline girishjiTopic starter

  • Contributor
  • Posts: 42
  • Country: pl
    • girish
Re: High speed Mosfet switch: need help
« Reply #10 on: October 06, 2022, 07:57:10 am »
@Marian_elf it is futile to test GPIO pins (without load) for sharp edge of pulse, except for defects. I tested on couple of ST32f4 boards and same behavior. It appears 3v3 is not sufficient to rapidly charge the gate capacitor. I haven’t seen examples on internet of anyone achieving nanosecond switch on with 3v3 at the gate.
Maybe a driver circuit is the answer.



 

Offline redkitedesign

  • Regular Contributor
  • *
  • Posts: 111
  • Country: nl
    • Red Kite Design
Re: High speed Mosfet switch: need help
« Reply #11 on: October 06, 2022, 08:58:40 am »
@reddkitedesign I think your calculation is dubious. Equation is exponential, not linear. There is a dV/dt in there. Besides gate resistance itself is a function of Vgs.

My calculation gives an order of magnitude. And look carefully: I calculate 2nC/20mA = 0.2us/V. Which is of course wrong, it should be 0.1us/V. You can just as easily do 20mA/2nC = 10MV/s. Which the dV/dt you were looking for.

Gate resistance of the BSS138 is a few ohms. At 20mA, that would give maybe 0.1V voltage drop over the resistance. Not relevant compared to the 3.3V power supply, by the time it will materially affect the charge current the gate is already way over the threshold voltage and the FET is solidly conducting.

The exponential formula can be ignored. Unless there is some material gate resistance, or your GPIO is not putting out 20mA. Did you configure the pin for maximum drive strength/fastest operation?


Just to verify I'm not talking out of any orifice here I measured a board I've got laying around. It has a ATMEGA4809 CPU, so its 5V and not 3V3. And the FET is an 2N7002. It drives an red led with series resistor.

Switching time is about 0.6 us. 2N7002 gate charge is about 1nC. Microchip doesn't spec GPIO pin drive impedance, but is specs 15mA for a part at 5V. So it is in the same magnitude as I calculated for your situation.
« Last Edit: October 06, 2022, 09:29:13 am by redkitedesign »
 
The following users thanked this post: girishji

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5907
  • Country: es
Re: High speed Mosfet switch: need help
« Reply #12 on: October 06, 2022, 03:13:23 pm »
That's a pretty weak fet, with Vgs=4.5V Rds is 3.5ohm, so at 3.3V Rds will be even higher.
Find a better fet suitable for the job!
There're specific fets meant to work well with logic voltage levels of 3-5V.

You can also try a MOSFET driver, they're cheap and will switch waaaay faster.
Use the higher gate voltage you can, 5v will switch faster than 3.3V and so on.
There's little to no gain over 12V, that's a typical working Vgs, also you want to avoid getting too close to the absolute limit of 18-20V.

Today I tested a TC4452 driver, switching a 1200V GW38IH130D IGBT which has a fairly large gate capacitance of ~3nF.
Using 12V for VDD and adding a little overkill capacitor bank of 6x100nF ceramic caps at VDD pin to stand the heavy switching current spikes, it was able to toggle the gate at 1MHz without much effort with rising/falling times of 75/50ns, which I find crazy for a transistor of this size.

Of course this frecuency is not practical, the transistor spends a lot of time in the edges causing power loses and heating, the actual frecuency will be about 25KHz.
« Last Edit: October 06, 2022, 04:00:01 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: girishji

Offline girishjiTopic starter

  • Contributor
  • Posts: 42
  • Country: pl
    • girish
Re: High speed Mosfet switch: need help
« Reply #13 on: October 08, 2022, 08:51:18 am »
Solved.
I connected a resistor between Gate and GPIO pin and now it is switching within 1us both ways (on/off). Current to Gate is now capped at 20ma because of resistor.

Connecting GPIO pin directly to gate was the problem. Maybe there was a spike in current that briefly shutoff GPIO pin.

I still need to chose a better FET with higher drain current capability, but thanks everyone for various suggestions.
« Last Edit: October 08, 2022, 09:00:48 am by girishji »
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2391
  • Country: gb
  • Recovering Electrical Engineer
Re: High speed Mosfet switch: need help
« Reply #14 on: October 08, 2022, 09:05:57 am »
I cant find wattage in any datasheet....
 

Offline Marian_elf

  • Contributor
  • Posts: 17
  • Country: ro
Re: High speed Mosfet switch: need help
« Reply #15 on: October 08, 2022, 10:27:17 am »
@Marian_elf it is futile to test GPIO pins (without load)...

Testing is never futile, in fact you can never have too much testing, it's the only way to really understand a problem.
Besides i said to test it both with and without capacitive load, it would have gave you a base line for comparison of how it can react when dealing with capacitive loads.

Solved.
I connected a resistor between Gate and GPIO pin and now it is switching within 1us both ways (on/off). Current to Gate is now capped at 20ma because of resistor.

You haven't done your research very well, theory says you should never drive a mosfet without a gate resistor ( even BJT's need base stopping resistors ). Plus, that GPIO pin maybe just does not do capacitive loads, for that you should check the datasheet of the device.
Testing with the scope always tells you things you simply cannot find by guess work on the forum as it has been done thus far on this topic.

I still need to chose a better FET with higher drain current capability, but thanks everyone for various suggestions.
In reply number 3 here i already posted a link with a wide selection of possible mosfets from digikey, any of that list should do the job just fine.
Still, check each one's info and datasheet and choose whatever seams to be the best suited.
"What's right is what's left if you do everything else wrong" - Robin Wiliams.
 
The following users thanked this post: girishji

Offline Marian_elf

  • Contributor
  • Posts: 17
  • Country: ro
Re: High speed Mosfet switch: need help
« Reply #16 on: October 08, 2022, 10:31:41 am »
I cant find wattage in any datasheet....

"What's right is what's left if you do everything else wrong" - Robin Wiliams.
 

Offline girishjiTopic starter

  • Contributor
  • Posts: 42
  • Country: pl
    • girish
Re: High speed Mosfet switch: need help
« Reply #17 on: October 08, 2022, 03:39:59 pm »
Testing with the scope always tells you things you simply cannot find by guess work on the forum as it has been done thus far on this topic.

I don't disagree, but I don't own an oscilloscope! The cheap ones from Aliexpress can barely do 100khz sampling. I believe you need an expensive one to do sub-microsecond measurements. I have been measuring time indirectly through a phototransistor. I am new to electronics. If I encounter another situation like this I will get a scope.

« Last Edit: October 08, 2022, 03:41:31 pm by girishji »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf