How to drive a MOSFET at say 20,000 hz

Status
Not open for further replies.

KrisKasprzak

Well-known member
All,

I've been struggling for 3 years trying to figure out how to drive a mosfet at say 20,000 hz. My set up is a simple test board where my load is a power resistor drawing 3 amps at around 15 volts. The problem I'm running into at frequencies above 500 hz is that the mosfet gets extremely hot after 3-4 seconds (like 2nd degree burns on your finger hot). Running pwm at low hz (500) the mosfet runs fine and cool--only issue is the nasty buzz at that low frequency. I want to run higher frequency, but can't figure out how. i have a snubber diode across the resistor but, it makes no difference regarding temp.

Goals: vary current from 0-4 amps at 15 volts, using a teensy 3.2.

Here's what I've tried

Teensy with analogWrite on pin 6, with pwm frequency at 20,000 hz and these hardware configurations:

1. I've tried connecting teensy pwm pin directly to the mosfet gate, mosfet got very hot after 2-3 sec

2. I've tried using an optoisolator to get higher gate voltage, mosfet still runs hot

3. I've tried using a bjt transistor to get higher gate voltage, mosfet still runs hot

4. I've tried a special mosfet driver ir2125, i can't even get that thing working.

My knowledge of deciphering data sheets and electronics is quite limited, and im very frustrated with what should be a simple task. Maybe it's the mosfet i've selected, maybe mosfets can't be driven at high frequencies, i really have no clue. Mosfet i'm using is https://www.digikey.com/product-det...0P04P4L03AKSA1/IPP120P04P4L03AKSA1-ND/5960348 , but heck i'll try anything at this point

Can someone do me a huge favor and draw up a schematic with part numbers so i can run a mosfet at say 20,000 hz?


Thanks in advance.

Kris
 
You definitely need a driver chip between the Teensy and that mosfet's gate.

The difficult part is you have a P-channel mosfet. Pretty much all the gate driver chips are designed for N-channel mosfets.
 
The difficult part is you have a P-channel mosfet.

Something odd... How is a Teensy PWM pin driving a P-Channel FET even at 500 Hz from +15 volts? Can Kris show the circuit he currently uses (pen and paper and digital photo). Also, what is this circuit trying to achieve? If there is a buzz, then audio is involved somewhere (?). It sounds like some form of variable power supply mode - presumably outputing less than +15v. The solution needs to know what this actual achievement goal is.

Optoisolator might work - but this would need enough capacitive drive - probably needs extra beef to drive the gate. Any power MOSFET has large relative gate input capacitance - probably this FET has between 10nF and 15nF. The solution must provide this capacitive charging current at a fast rate if this is going to be efficient (low temp loss) at higher audio frequency PWM.

Another factor is sufficient gate voltage (above 3v3 volts) to get it into the low "on resistance" range, otherwise "I squared R" loss is going to be high. Another lower powered driver FET in N-Channel mode (driven by Teensy) could work, or even a suitable transistor, and let that drive the P-Channel FET gate.

Need better problem definition first. What is the solution driving?
 
Here's my "wiring diagram". I got the idea from the web, from what i gather, when the opto is in an off state, Gate sees +12 through a resistor and shuts mosfet off (P-channel), when opto goes on, gate takes least path of resistance hence goes low (mosfet with 0 at gate goes on).

The more i read about MOSFETs the more i think at high switch frequencies, it takes a lot of current to drive them--since my little opto can't supply, i'm told the MOSFET is kept in the linear region.

Thanks for the gate driver, but i really have no idea how to implement that (resistor values, caps, etc.). Like I said i'm out of my domain of expertise. 20180912_191922.jpg
 
What i'm trying to build is an automatic batter charger for a lead acid battery. Store-bought ones work but I'm seeing variances in how much they charge so I want to experiment with charge rates and charge voltages so I can squeeze every electron in that's possible--batteries drive a small race car, hence capacity is everything to me. My initial prototype was based on a NANO and worked, but the buzz is killing me and I'm not sure batteries getting charged at 490 hz is good for them. If I use a higher PWM, mosfets get extremely hot. I can charge at set constant currents, top at constant voltages, the sky is the limit but, those darn Arduinos have so many limitations (I can't set a pwm frequency, memory. etc), hence I'm moving the charger to a Teensy. Until I figure out how to drive a mosfet at 20,000 hz, I'm stuck.
 
Try this. I made it up just now... but pretty sure it'll help. :)

mosfet_driver.jpg

If you don't have 2N2222 and 2N2907 transistors, substituting 2N3904 & 2N3906 might work but with reduced drive to the mosfet gate.

The 10 ohm and 470 pF snubber circuit and 1N4148 diode may not be necessary if you have a purely resistive load. But as you switch a mosfet faster, even the stray inductance of wires can become a serious issue that causes high voltage ringing that can destroy the mosfet. I recommend putting those parts in for safety while experimenting. Place them close to the mosfet drain to minimize inductance in the wiring.

When you build this, try to avoid any coupling between the parts connected to the 2N3904's base and collector. Extreme measures aren't needed, just make sure you leave a small physical gap, rather than having that 1K resistor right next to the 4.7K or 470 pF at the input.

Edit: Opps... I forgot an important detail in the schematic. You *must* have a power supply decoupling capacitor. Ideally it should be connected close to the collectors of the 2N2222 and 2N2907, and you want to minimize the wire length between this capacitor and the mosfet source lead. The value isn't critical. 0.1 uF should work. Any value that's 10X or more the mosfet's get capacitance should be fine. But it must be a ceramic or good quality plastic film (not the stacked metalized type) because it needs to provide the huge pulse of current that flows through those transistors into the mosfet gate!
 
Last edited:
PS "You *must* have a power supply decoupling capacitor" Is that just a cap between +12 and GND? but connected to the 2907 ground and the 2222 +12 right? I'll be printing circuit boards if i can get this circuit to work.
 
Yes, the decoupling capacitor is between +12V and GND.

But really, think of the capacitor as connected to the collectors of those 2 transistors and the mosfet source pin. During the fraction of a microsecond where the mosfet switches from off to on, or on to off, the 12V supply is a world away. All the action happens between that capacitor, those 2 transistors and the mosfet gate.

Long after the deed is done, the 12V power slowly recharges that capacitor over a time of microseconds. On the rapid scale of (hopefully) only a couple dozen nanoseconds, that recharge is pretty much forever. The circuit quickly moves electrons between the decoupling capacitor and the mosfet gate capacitance. You need a good capacitor and the main thing that matter is it's able to respond very fast... which means ceramic material and short wires.
 
No, not like that. Connect to the collectors of *both* transistors. As drawn, it's connected to the collector of the NPN 2N2222, but connected to the emitter of the PNP 2N2907. That won't work. It must be connected to both collectors.

Use only 1 capacitor. Looks like you might have drawn 2. Only 1 is needed to supply the short-duration current.
 
I really dont see how to connect given "connected to the collectors of those 2 transistors and the mosfet source pin" I can see connecting across collectors but how to do that AND the mosfet source pin.

maybe this?

Untitled.png
 
Yes, that's correct.

I really dont see how to connect given "connected to the collectors of those 2 transistors and the mosfet source pin"

The mosfet source and the NPN collector are both connected to 12V. There is literally no way to connect to one without also making a connection to the other, since both go to 12V. But the wire lengths matter. Both of these should have the shorted practical connection to the capacitor.

The 1K resistor is also connected to 12V. The length of its wire isn't important.
 
Kris, are you trying to charge 12v batteries - or 6 volt batteries - or some other value? Are you charging these one by one or in a series or parallel combo? For a good solution, it is important to know.

Where is the original +15 volts? You can't charge 12 volt lead-acid batteries from +12v. You need at least +13 (and a bit more).

And what was "buzz-ing" originally? That "buzz" might be the clue as to why your P-Channel was heating up.

Looking at the last circuit diagram, you show a LOAD connected directly to the DRAIN of the P-Channel FET. Its not just a resistor. Its a battery. Maybe the battery is dragging the DRAIN voltage low when the FET is trying to turn hard on - that will affect the switching efficiency. Maybe the battery/FET is a direct short of the positive power rail - and that is causing the power supply to "buzz"? This suggests adding a small resistance (but high wattage) in series with the output battery lead.

Something has to take the difference in the two voltages, or you may end up with a big flash and a lot of black carbon :)
 
It is very educational to experiment with things so I'm not arguing against that. If you want a near-term practical solution, you can buy adjustable CC-CV supplies (constant current / constant voltage) which are useful for battery charging. You can set the max voltage and max current independently. Some even have a fancy digital display. Except for the "buck/boost" type, they will need an external power input of at least a few volts above the maximum output you want. https://www.amazon.com/Converter-DROK-Adjustable-Regulator-Transformer/dp/B078Q1624B

I had one of these- briefly- but it turns out connecting a large 12V battery with reverse polarity will not do it any good :(

Here is a "buck boost" type that can deliver output voltage higher or lower than input (of course still not more power out than power in)
Possibly unwanted behavior: whenever you disconnect input power and reconnect, it resets output to 0 V.
https://www.amazon.com/Converter-DROK-Buck-Boost-Adjustable-Regulator/dp/B0789QVKKF
 
Last edited:
@JBeal, that's actually where i started off. I have a CC/CV converter but there was no way to programitically control either. I need to be able to adjust either depending on conditions. Here's the display for my charger: phase 1 is CC until the battery reaches a certain voltage, then i charge at CV until a certain current, then CC until....the method and limits show are not optimal, energy that went into the battery is lower that if I chose other limits. The instability at the initial CC is due to PWM trying to maintain 3 amps and 1 PWM value will change it that much. That's they type of experimenting I need to be able to do.

a.jpg
 
You got the mosfet working at fast PWM, right? (seen on another thread)

Any chance to share details of whatever driving circuit ended up working? Might really help others who later find this thread by search or google.
 
Yes, i got something working.

I'm still waiting on parts to make the circuit you supplied for a P-Channel.

In the meantime, I created a circuit with a dedicated MOSFET driver and N-Channel mosfet--not what I need but more for testing. I can get 0-95% PWM up to 60,000 (could probably drive faster though), https://www.digikey.com/product-detail/en/infineon-technologies/IR2125PBF/IR2125PBF-ND/1928154. It took several hours in experimenting with the correct cap values to get the driver to even work--application of this stuff just isn't documented well. I'll draw up a diagram later.
 
PS since it took me 3 year of fiddling to get this working, i may actually create a YouTube vid. I can't believe how hard it was to get this simple circuit working....
 
Status
Not open for further replies.
Back
Top