Basic Bipolar Transistor Biasing to Switch a MOSFET - Page 1
Forum section: electronics / beginners

author: K1JOS
author_rank: Regular Contributor
timestamp: November 21, 2014, 02:04:41 am
content: 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?

author: Paul Price
author_rank: Super Contributor
timestamp: November 21, 2014, 02:58:46 am
content: 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.

author: K1JOS
author_rank: Regular Contributor
timestamp: November 21, 2014, 03:25:01 am
content: 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?

author: Paul Price
author_rank: Super Contributor
timestamp: November 21, 2014, 03:34:13 am
content: 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.

author: LukeW
author_rank: Frequent Contributor
timestamp: November 21, 2014, 04:54:31 am
content: 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) / IBIC= IB* hFEVB= 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) / ICICwill 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.

author: K1JOS
author_rank: Regular Contributor
timestamp: November 21, 2014, 01:13:16 pm
content: 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 equationQuoteI get a value of R around 1.8 MegOhmPlease help !!

author: Zero999
author_rank: Super Contributor
timestamp: November 21, 2014, 01:18:43 pm
content: 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.

author: nuno
author_rank: Frequent Contributor
timestamp: November 21, 2014, 01:26:10 pm
content: Quote from: K1JOSTransiently, 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.

author: K1JOS
author_rank: Regular Contributor
timestamp: November 21, 2014, 02:04:06 pm
content: Hero - i was thinking of switching times about 10-20 HzNuno - 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 !!

author: Seekonk
author_rank: Super Contributor
timestamp: November 21, 2014, 10:01:36 pm
content: 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.

author: K1JOS
author_rank: Regular Contributor
timestamp: November 22, 2014, 05:46:52 pm
content: 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.

author: nuno
author_rank: Frequent Contributor
timestamp: November 22, 2014, 05:54:41 pm
content: Quote from: K1JOS on November 21, 2014, 02:04:06 pmSorry, 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)= IDx VDSx Fswx (ton+ toff) x 0.5Fswis switching frequency, tonand toffthe swithing times of the FET.

author: K1JOS
author_rank: Regular Contributor
timestamp: November 22, 2014, 10:09:31 pm
content: 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.5P = 10A x 12v x 20,000,000 x 0.0000001 x 0.5Does that seems right? The IRF5210 is rated continuous 200W with proper heat sinking.

author: Seekonk
author_rank: Super Contributor
timestamp: November 22, 2014, 10:15:06 pm
content: Quote from: K1JOS on November 22, 2014, 05:46:52 pmAfter you build it let us know how that works out for you.https://www.eevblog.com/forum/Smileys/default/smiley_laughing.gif

author: LukeW
author_rank: Frequent Contributor
timestamp: November 23, 2014, 01:03:55 am
content: 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.

author: nuno
author_rank: Frequent Contributor
timestamp: November 23, 2014, 02:50:07 am
content: Quote from: K1JOS on November 22, 2014, 10:09:31 pmIt's not; the switching speed depends on how much current you use to drive the FET.QuoteForget 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.

author: K1JOS
author_rank: Regular Contributor
timestamp: November 23, 2014, 04:16:50 am
content: 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.

author: nuno
author_rank: Frequent Contributor
timestamp: November 23, 2014, 04:41:22 am
content: 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, withmuchless heat (also called "synchronous rectification").Take a look here:http://www.modularcircuits.com/blog/articles/h-bridge-secrets/

author: Seekonk
author_rank: Super Contributor
timestamp: November 23, 2014, 03:59:11 pm
content: 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.