Author Topic: Basic Bipolar Transistor Biasing to Switch a MOSFET  (Read 7022 times)

0 Members and 1 Guest are viewing this topic.

Offline K1JOSTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Basic Bipolar Transistor Biasing to Switch a MOSFET
« on: November 21, 2014, 02:04:41 am »
I would like to switch the gate of a power MOSFET (P-channel IRF5210)  to control the speed of a high current servo-motor (12vdc, surge 10 A).    I have seen general examples of switching the MOSFET gate from a PIC or Arduino using an NPN bipolar (2N3904) as shown in the attached schematic.   My basic transistor knowledge about keeping the 2N3904 near saturation would calculate the base resistor as:

R = (switching voltage * HFE) / (1.3 * load current)

And then  add a resistor about 10x the base resistor across the base and emitter.


But is this correct given that the MOSFET gate will have an insignificant gate current?  Also  which "switching voltage" do I use in the calculation?  When 2N3904 is cutoff, the MOSFET is off and 2N3904 collector is seeing 12v.   According to the 2N3904 datasheet at very low Ic < 0.1mA,  Vce = 1vdc) HFE is 40 .  This would mean using a base resistor in the megaohm range.  How should I select the base resistor in this case? 
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #1 on: November 21, 2014, 02:58:46 am »
You have too many R6's.

Just connect a 510-0hm resistor directly to the base of the 2N3904 from your output pin, and a 47k to ground B-E 2N3904.

Even a larger value(up to 5K) could also be used from the output pin to the base of the 2N3904.

You don't want to drive the 2N3904 with very low currents because you want  to charge/discharge the Gate-Source capacitance of the P-Chan MOSFET quickly or else the MOSFET heats up with a slow turn-on due to a very low 2N3904 drive current resulting in not turning on the MOSFET quickly because of slow charging of the Gate to Source capacitance. The idea is to quickly turn on the MOSFET and this means making sure the 2N3904 also develops a high collector current quickly.

« Last Edit: November 21, 2014, 03:31:36 am by Paul Price »
 

Offline K1JOSTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #2 on: November 21, 2014, 03:25:01 am »
Please explain what do you mean I have too many R6's? 

If I understand then R5 could be anything from 510 ohm up to 5K?  And R6 (between B-E to ground) 47K?

 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #3 on: November 21, 2014, 03:34:13 am »
You probably don't need R6 at all, unless you are faced with very high operating temperatures and very high electrical noise nearby. R6 is only giving an effect if the output pin is tri-stated or the whole controller circuit is turned off.

Yes, the values I suggested would be typical.
« Last Edit: November 21, 2014, 03:37:17 am by Paul Price »
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #4 on: November 21, 2014, 04:54:31 am »
Make R5 = 1k, and remove R6, it's not needed.
(If you were using a small N-channel FET you would need that R6 to bleed stored charge off the gate, but a BJT doesn't need it.)

If you want to get back to basic principles you can do it as follows, but if it was me I'd skip the math and just use 1k for any system like this with 5V logic driving a small BJT base, just as a rule of thumb and a very standard, common jellybean value.

 RB = (VMicrocontroller - VB) / IB
IC = IB * hFE
VB = VBE + 0V (E = ground), and say VBE = 0.6V.
Say VMicrocontroller = 5V, and say hFE is maybe about 100 (check datasheet, but it's always quite variable.)

R = (4.4V * hFE) / IC

IC will be a little more tricky to calculate, and it will be nonlinear as the FET gate is charged and discharged. Given the gate capacitance and the pull-up resistance you should be able to do a little math... I'll just leave that as a homework exercise.
 

Offline K1JOSTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #5 on: November 21, 2014, 01:13:16 pm »
Luke, thanks.  If you look at my schematic isnt Ic completely determined by R1?  Since only negligible current is going off to the gate, then the 10K R1 at 12v would lead to Ic on the 2N3904 of 1.2mA.  Using your equation
Quote
RB = (VMicrocontroller - VB) / IB
IC = IB * hFE
VB = VBE + 0V (E = ground), and say VBE = 0.6V.
Say VMicrocontroller = 5V, and say hFE is maybe about 100 (check datasheet, but it's always quite variable.)

R = (4.4V * hFE) / IC

I get a value of R around 1.8 MegOhm  ???

Please help !!
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19523
  • Country: gb
  • 0999
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #6 on: November 21, 2014, 01:18:43 pm »
What frequency are you planning to switch the motor on/off? Is this for PWM speed control?

The pull-up resistor on the MOSFET's gate will make the turn off time very slow, which would cause excessive power dissipation if the frequency is anthing above a few 100Hz.
 

Offline nuno

  • Frequent Contributor
  • **
  • Posts: 606
  • Country: pt
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #7 on: November 21, 2014, 01:26:10 pm »
Quote from: K1JOS
If you look at my schematic isnt Ic completely determined by R1? 
Transiently, no. When the BJT turns ON, it discharges the gate capacitance; current flowing here is only limited by "parasitic" resistances and inductances (BJT C-E resistance, FET G-E cap ESR, wiring inductance, etc etc, adding up to little resistance to current flow).

Not sure how you control the speed of a servo-motor by ON/OFF on it's power supply, but if you're driving just "a motor", you need at least a diode in paralell with it for the recirculating current, or your circuit will "blow" up.
 

Offline K1JOSTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #8 on: November 21, 2014, 02:04:06 pm »
Hero - i was thinking of switching times about 10-20 Hz

Nuno - so to figure out that intial discharge current from the gate, the datasheet should give me an idea where to start that calculation?

thanks to all - I am learning a lot !!
 

Offline Seekonk

  • Super Contributor
  • ***
  • Posts: 1938
  • Country: us
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #9 on: November 21, 2014, 10:01:36 pm »
One thing you might learn is that switching 10A near a micro can do strange things when there is a ground loop.  That is why I suggest using an opto isolator.  I use them a lot with my UNO and it allows me to put the FET 30 feet away, closer to what I want to control. A 330 ohm to operate the LED, 1K pull down emitter drive to the N FET, collector to 12V.

Does the motor have to be grounded to the 12V negative?  Almost no one uses P FETs.  N FETs are available in almost every piece of junk. People are always throwing out those small computer UPS when the battery dies.

The diode serves no purpose as it is used.  Diode has to be parallel with the motor or your first time will be the last time from turn off spike.
 

Offline K1JOSTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #10 on: November 22, 2014, 05:46:52 pm »
I didn't include a reverse diode to handle the motor off inductor effect as the IRL5210 HEXFET has its own "ISM Pulsed Source Current integral reverse p-n junction diode rated at -140 amps.  These are for my single project use pretty inexpensive on Ebay.   I placed an the external reverse diode across my 12v supply input for protection to a not shown branch off for a 12v to 5v regulator to handle the Arduino supply, etc.

 

Offline nuno

  • Frequent Contributor
  • **
  • Posts: 606
  • Country: pt
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #11 on: November 22, 2014, 05:54:41 pm »
Nuno - so to figure out that intial discharge current from the gate, the datasheet should give me an idea where to start that calculation?

Sorry, I don't know how to calculate that. Depends also on how fast the BJT turns on. It doesn't mean the current spike is bad for the BJT. In general I would put a small value resistor to limit that current, but more because higher gate currents => faster FET switching => higher voltage spikes.

There's an approximation formula (by excess) I find useful, for the power dissipated by switching alone with an inductive load:

Pd(sw) = ID x VDS x Fsw x (ton + toff) x 0.5

Fsw is switching frequency, ton and toff the swithing times of the FET.
« Last Edit: November 22, 2014, 06:02:54 pm by nuno »
 

Offline K1JOSTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #12 on: November 22, 2014, 10:09:31 pm »
THanks Nuno,

Looking at your formula and the datasheet -- T(on) + T(off) is under 100nsec.  For 12vdc at 10A continous, the Power would not go above 120 W until the switching frequency went beyond beyond 20 MHz??

Pd(sw) = ID x VDS x Fsw x (ton + toff) x 0.5
P = 10A x 12v x 20,000,000 x 0.0000001 x 0.5

Does that seems right?   The IRF5210 is rated continuous 200W with proper heat sinking.

 

Offline Seekonk

  • Super Contributor
  • ***
  • Posts: 1938
  • Country: us
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #13 on: November 22, 2014, 10:15:06 pm »
I didn't include a reverse diode to handle the motor off inductor effect as the IRL5210 HEXFET has its own "ISM Pulsed Source Current integral reverse p-n junction diode rated at -140 amps.

After you build it let us know how that works out for you. https://www.eevblog.com/forum/Smileys/default/smiley_laughing.gif
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #14 on: November 23, 2014, 01:03:55 am »
I agree that high-side switching does seem unusual unless there's a good reason why you need it.

Low-side switching with an N-channel (or NPN) device is simpler and more common.
 

Offline nuno

  • Frequent Contributor
  • **
  • Posts: 606
  • Country: pt
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #15 on: November 23, 2014, 02:50:07 am »
Looking at your formula and the datasheet -- T(on) + T(off) is under 100nsec.
It's not; the switching speed depends on how much current you use to drive the FET.

Quote
The IRF5210 is rated continuous 200W with proper heat sinking.
Forget it, you'll never get anywhere near that. The TO-220 package alone is tipically rated for 50W, but there are other limits like bounding wire (the wires attaching the die to the package, which are very thin). Those datasheet values are for a device in a heatsink kept at 25ºC (hint: they use some kind of "cryogenic" bath stuff to achieve that) and with the die at its maximum temperature of 175ºC (which you wouldn't do anyways due to the difficulty of keeping the guy at that temperature and the largely reduced device lifetime) or whatever it says in the datasheet, someone correct me please.
 

Offline K1JOSTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #16 on: November 23, 2014, 04:16:50 am »
I am guilty of not providing all the details as I didnt want to complicate my original question.  I am trying to replicate a commercial control board no longer available.  It was popular and widely used for many years without problems.  It has two IRL540N and two IRF5210 in an H bridge to switch a 12vdc antenna rotor/motor in either a clockwise or counterCW direction.  The motor draws about 7-8A in constant use and about 10A on startup and can rotate a load of 150lbs.  Each HEXFET only has a 2" x 0.5"x 0.125" aluminum to air heatsink strip bent in an L-shape and screwed to each HEXFET.  Admittedly the duty cycle is ON continuosly for no more than a few minutes per 360 degree rotation.  The board has a LM2594 5v regulated  supply and a PIC18F that controls motor direction selection via one of pair of BC817 NPN's.    It does NOT have any other external diodes for inductor kickback protection and hundreds if not thousands of these controllers have been manufactured in the past working fine just using the HEXFET internal reverse diode protection design.  It also has a RS484 circuit for a remote control using a very odd handshaking protocol.  I want to build a near identical design (but no schematic available) so I have spend a lot of time reconstructing the schematic from an existing working board.  I want to replace the BC817 SMD's with thru-hole and use an Arduino Uno instead of the PIC and get rid of the RS485 aspects.  I am hoping to etch my first PCB with this project.  I asked in another thread about PCB copper thickness as I was surprised to see the HEXFET source and drain traces use only 2mm wide in most places.

So thats the whole show.  I am pretty confident that this is a robust design given its long successful past history.  Thanks for all of the (mostly) good advice as this has been and continues to be a steep learning curve for me.
 

Offline nuno

  • Frequent Contributor
  • **
  • Posts: 606
  • Country: pt
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #17 on: November 23, 2014, 04:41:22 am »
A MOSFET full H-Bridge has diodes "all over the place", so they are indeed there :) . Furthermore, the FETs themselves can (additionally) be used for the current re-circulation, with much less heat (also called "synchronous rectification").
Take a look here: http://www.modularcircuits.com/blog/articles/h-bridge-secrets/
« Last Edit: November 23, 2014, 04:44:03 am by nuno »
 

Offline Seekonk

  • Super Contributor
  • ***
  • Posts: 1938
  • Country: us
Re: Basic Bipolar Transistor Biasing to Switch a MOSFET
« Reply #18 on: November 23, 2014, 03:59:11 pm »
In a proper H bridge, two FETs are always on.  That "shorts" out the motor, Hence a diode.  For the very short transition period, the internal diode of the FET can be used in some cases.    That 140A has a one in a circle after it.  The secrets of the ages is found in that ONE.

In your circuit the turn off pulse of likely 300V will travel through the FET diode and through the gate resistor.  Once that voltage goes much above 20V the gate will be blown out.  In the best result the transistor avalanches C-E and recovers, maybe it shorts out.  Worst case it shorts C-B and blows out your micro.  What I like about electronics is that it always knows what to do.  We have to wonder.

So you are the antenna guy.  Hope you haven't decided to use that resettable breaker.  Those are just good to prevent fires. So how did this turn to a single FET?  Maybe you told us.  Frankly my eyes glaze over after a couple sentences.  It is just blah,  blah, blah, blah, blah after that.  Had you taken my advice on that thread, it would have been done by now.

So get yourself a $8 UNO, there is nothing simpler to use and write 20 lines of code.  Use a N FET with an opto isolator with the diode across the FET.  Sample the current with a less than .1 ohm resistor in the source.  Filter that with a resistor and a cap and read the A/D value.  With a potential thousand counts, 50-100 will be enough to decide a current limit.   A DPDT relay to set direction and a couple time delays to prevent nasty arcing.   Use the UNO 490hz PWM to ramp up and down the motor.  No need to tear up the gearbox or antenna with rapid movements.  Four days at most for an extreme neophyte to do this.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf