Shop OBEX P1 Docs P2 Docs Learn Events
Correct resistor for switching N Channel Mosfet — Parallax Forums

Correct resistor for switching N Channel Mosfet

James LongJames Long Posts: 1,181
edited 2007-05-02 15:49 in Propeller 1
I'm working on a design. I want to make sure I do not kill the Propeller.

I have a N channel mosfet that will be driven for PWM .....and need to place a resistor to ground. I know I must limit the short to ground for the prop.......and also have it switch fast enough.

Anyone can help me out....I just want to make sure...I don't kill the propellers pin.


Thanks,

James L

Comments

  • bambinobambino Posts: 789
    edited 2007-05-01 15:54
    Hay James,

    At least you caught that little neccesity. I downloaded a circuit for a brushless motor driver from wicopedia and it did not show a resistor on the source to gnd side of things. When I saw the power LED go dim I yanked out the battery quik enough to avoid any damages, but hay, My ticker ain't getting any younger!

    Any way I'd like to hear the answer to this too!
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-05-01 16:07
    The Propeller is a pretty robust design, while we dont recommend it, shorting an I/O does not have any adverse effect (did it for 12 Hours and it still worked, though I probably did shorten it's lifetime). So set the resistor according to the RC time constant you need the device to turn off by, you can actually measure this using the propeller:
     
             ^
             |
             /
             \  10K
             /
    In ------+
             |
          ||--  
    Out-+-||   
        / ||->
      R \    |
        /   ---
        |    -
       ---
        -
    

    By recording the number of cycles it takes between·switching Out to an input·and In switches high you can see what the switching time of the Mosfet is when using that value for the strap down resistor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • James LongJames Long Posts: 1,181
    edited 2007-05-01 16:16
    Paul,

    Thanks for the reply....I was just trying to keep from letting the little magic smoke out. I can never find a cheap way to put the smoke back in.

    James L
  • Tracy AllenTracy Allen Posts: 6,660
    edited 2007-05-01 16:28
    Hi James,

    There are two resistors. One from gate to ground to assure that the gate does not float and turn on inadvertently when the Prop pin is an input. The second resistor is from the Prop pin to the gate to limit current and also to protect the Prop in case of a fault condition.

    The first resistor is not a critical because it just needs to bleed off charge. Assuming that the Prop and the mosfet are not too far apart, any value from 10k to 1 meg would work fine.

    The resistor from the Prop to the gate is something less than 100 ohms, and that includes the internal output resistance of the prop pin. You don't want to make it too high, because it acts as an RC filter in combination with the input capacitance of the mosfet, and that in turn depends on the particular mosfet. This gate capacitance can be quite large, especially in the logic level mosfets that would turn on effectively with the 3.3 volts provided by the Prop, for example, the IRL530 has an input capacitance of 750pF maximum. The pulses from PWM on the Prop can be very narrow, in 12.5 nS time slots when clkfreq=80mhz. The time constant of 100 ohms with 730pf is 73 nS. That means that the mosfet would be hanging in the linear region of operation, and with frequent switching (frqa=2^31 for example, 50% PWM) it would get hot, and would never turn completely on or off. So you either have to choose(?) a mosfet with a much lower gate capacitance, or drive the gate much harder. There are buffer chips that are meant as mosfet gate drivers.

    If you connect the gate of the mosfet directly to the Prop pin, another issue is current. The current required to charge a 750pf capacitor to 3.3 volts is not much, but at 50% PWM, the driver has to do that 40million times in one second, and the total source and sinkk current that would be needed from the prop is substantial. With a quick calculation, I come up with 96 milliamps, which is not feasible.

    So, what mosfet?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-05-01 16:44
    Thanks Tracy,

    I thought about Rg, but when I returned to mention it, I see you already have [noparse]:)[/noparse].

    Hope you aren't finding your commute unbearable from all the rerouted traffic.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • James LongJames Long Posts: 1,181
    edited 2007-05-01 17:43
    Tracy,

    I'm looking at the Hexfet Mosfet IRLBA3803 (this is an International Rectifier Part)

    I have the datasheet....but I'm on a slow dialup.



    I'll try to post it.

    Thanks for the design help,

    James L

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-01 17:48
    James,

    Since you have a slower connection you can just link to a datasheet/picture/file on the internet in the future to save bandwidth. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • James LongJames Long Posts: 1,181
    edited 2007-05-01 17:51
    Great idea....thanks Chris.

    James L
  • Tracy AllenTracy Allen Posts: 6,660
    edited 2007-05-01 19:04
    The data sheet links through on the Digikey web site. That IRLBA3803 has a whopping 5000pf of input capacitance. (Ciss) Take that as an estimate, because it depends on test conditions, such as the drain-source voltage. The better estimate is the graph of gate charge vs gate voltage, presented as a graph later in the data sheet. But the Prop would have trouble driving that from an output pin at anything like the switching speeds required by the Duty mode of the counters.

    There are chips like the Micrel MIC4426 that Phil brought up in another context last week. Those chips are meant for driving capacitive loads and can supply up to 1.5 amps of instantaneous drive current, and have in input capacitance of only 6 pf. And a response time of 25 nanoseconds.

    However, I am still worried about all the response times. Were you planning to use Duty mode of the Prop counters? Even under the best conditions, the turn on and turn off time of the IRLBA3803 are much slower than the pulses produced by the duty mode, at least when the Prop clkfreq is driven from PLL16. Better might be constant frequency PWM made using the NCO mode instead, with a relatively low switching frequency. Prop counter duty mode is really better suited to generating an analog waveform, than it is at driving a power output directly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • James LongJames Long Posts: 1,181
    edited 2007-05-01 19:18
    Tracy,

    Since this is a new design.....it is totally flexible.

    I'm downloading the Micrel MIC4426 datasheet as I type.

    I haven't made a decision of what type of counter mode I was going to use. I have to say I'm dumb about counters....and have just started reading about them.

    I'm new in the electronic design game....and not formally trained .....so your help has been very valuable.

    This is the only thing the prop is going to drive. It basically will read an output of a rotary dip switch (hex) and use that to calculate the time needed for ramp (based on the dip) then ramp this Hexfet Mosfet up to that time....then turn it totally on.

    I'm not even sure how fast I'm going to run the propeller in this instance....it needs to have a pretty stable time frame...but doesn't need to run extremely fast.

    I know this is an extreme over kill for this type of circuit....but I like the propeller and price of it......I use if for just about all my designs.

    I'm learning....but you are showing me things I have not considered to this point. I'm thinking about going back to school for some of this.

    James L






    Post Edited (James Long) : 5/1/2007 7:32:34 PM GMT
  • crgwbrcrgwbr Posts: 614
    edited 2007-05-01 19:43
    Tracy Allen said...
    If you connect the gate of the mosfet directly to the Prop pin, another issue is current. The current required to charge a 750pf capacitor to 3.3 volts is not much, but at 50% PWM, the driver has to do that 40million times in one second, and the total source and sinkk current that would be needed from the prop is substantial. With a quick calculation, I come up with 96 milliamps, which is not feasible.

    Tracy, I am interested in the formulas you used to come up with the 96 mA figure. In a motor driver I'm designing, I put 9A gate drivers in place, so it should be enough. But, I'm not intierly sure, since the combined Ciss of the hexfets works out to 32,000 pF (32 mF). If you could post the formula you used, that would be great.

    Thanks,
    Craig

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I would love to change the world, but they won't give me the source code

    People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install Windows.

    I spent a minute looking at my own code by accident. I was thinking "What the heck is this guy doing?"
  • El PaisaEl Paisa Posts: 375
    edited 2007-05-01 19:55
    Here goes my 2cents.
    Most of the mosfets to reach saturation the VGS has to approach 9 volts unless the device have been designed for logic operation.
    Even for a logic designed device, 3 volts is not enough to drive the device into saturation.
  • crgwbrcrgwbr Posts: 614
    edited 2007-05-01 20:00
    I believe that 3 volts is enough if it is a CMOS device; but you are correct, if it is a TTL device.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I would love to change the world, but they won't give me the source code

    People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install Windows.

    I spent a minute looking at my own code by accident. I was thinking "What the heck is this guy doing?"
  • James LongJames Long Posts: 1,181
    edited 2007-05-01 20:02
    Tracy,

    Also .....while I'm here.....would it be better for me to use a different Hexfet/Mosfet or change to a lower amperage rated part and have multiples.....or continue with the one I have picked so far.

    Tha amperage demand of the system being driven is huge......so I must have a high amperage through put.

    James L
  • crgwbrcrgwbr Posts: 614
    edited 2007-05-01 20:05
    You could always use multiple hexfets in parallel.

    Craig

    Post Edit: By huge, how many amps do you mean. In that Motor driver project I mentioned, the throughput is 200A. That's medium power in my book.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I would love to change the world, but they won't give me the source code

    People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install Windows.

    I spent a minute looking at my own code by accident. I was thinking "What the heck is this guy doing?"
  • James LongJames Long Posts: 1,181
    edited 2007-05-01 20:15
    Craig,

    200 amps for me is huge....I'm designing with 180 amps now....but would like to go to about 450.

    James L
  • Tracy AllenTracy Allen Posts: 6,660
    edited 2007-05-01 20:44
    There is no way around it, a high current mosfet has a big gate with lots of capacitance. I don't have any alternative suggestions. I am the wrong person to ask for practical suggestions about high current drive. I hardly ever do anything over 1 amp!

    El Paisa is right-- many mosfets will not turn on effectively until the Vgs was 10 volts or more. Your IRLBA3803 is in fact a logic level device that claims a Vgs of 1 volt, but at that point it will only be passing a drain current of 0.25 milliamp. You have to look at the curves of drain current vs drain/source voltage, and see that at a Vgs of 3.5 volts the transistor saturates near 100 amps. But the stated resistance of 0.005 ohms probably doesn't occur until the Vgs is much higher. They show curves going off with 15 volts Vgs, and claim pulse current capabilities of 700 amps! It is just a TO220 package, so the power capabilities will have to be carefully circumscribed. You really have to peruse these data sheets.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Tracy AllenTracy Allen Posts: 6,660
    edited 2007-05-01 20:57
    The defining equation is
    Q=CV
    Q in coulombs, C in farads, V in volts.
    If you have a capacitance of 730 pf charged to 3.3 volts, you have 2409 picocoulombs transferred when the gate is driven from 0 to 3.3, and then transferred again when the gate is driven from 3.3 back to 0. Current is the amount of charge transfered per second. So if you transfer 2409 picocoulombs 40 million times a second, you have,
    2409E-12 * 40E6 = 0.09636 amp, 96 milliamp.
    That comes out of the Prop, sourced from the high side transistors, and then back into the Prop, sink on the low side transistors. Heat. Moreover, the Prop transistors can't supply 96 ma in any case, so they could not acheive that required current level at that frequency. But with a 9A gate driver, no problem.

    You can use the same formula to ballpark for the 32000 pf, also for a calculation of how long it takes to charge the gate on each transition. dt = C dV /I. The time to make the transition is proportional to the capacitance, the change in voltage required, divided by the available current.



    crgwbr said...
    Tracy Allen said...
    If you connect the gate of the mosfet directly to the Prop pin, another issue is current. The current required to charge a 750pf capacitor to 3.3 volts is not much, but at 50% PWM, the driver has to do that 40million times in one second, and the total source and sinkk current that would be needed from the prop is substantial. With a quick calculation, I come up with 96 milliamps, which is not feasible.

    Tracy, I am interested in the formulas you used to come up with the 96 mA figure. In a motor driver I'm designing, I put 9A gate drivers in place, so it should be enough. But, I'm not intierly sure, since the combined Ciss of the hexfets works out to 32,000 pF (32 mF). If you could post the formula you used, that would be great.

    Thanks,
    Craig
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • James LongJames Long Posts: 1,181
    edited 2007-05-01 21:00
    Tracy,

    I understand.....so I must include a driver for the mosfets. This system will not run over about 53 seconds at any given time....and it will have a long lapse of time between uses....(hours).

    I appreciate your input and insight to the design.

    James L
  • crgwbrcrgwbr Posts: 614
    edited 2007-05-01 22:07
    Tracy, I ran through your formula. With a gate capacitance of 32,000 pF and a gate drive voltage of 15v, it would require 19.2 amps. However, if I step the clkfreq down to 20 MHz (thus a max switching freq of 10,000,000 per sec), I could cut it down to 4.8A and still retain 19.5 KHz PWM freq with 10bit resolution.

    Thanks for the formula,
    Craig

    P.S. James, with high currents you must remember that even if the Id of a fet if 100A+, the TO-220 package can only handle 70A before it decrystallizes (melts). Therefore, you must run several fets in parallel. For example, 480A / 70A = 6.8 fets (ie: 7 minimum, 8 to be safe). Just make sure that they will all turn on at the EXACT same time, and that you have them all heatsinked properlly. Below, I'll put a few links that have helped me.

    Heat sinks homepages.which.net/~paul.hills/Heatsinks/Heatsinks.html

    Mosfets in General homepages.which.net/~paul.hills/SpeedControl/Mosfets.html

    Very Large BattleBot Speed Controller www.mcmanis.com/chuck/Robotics/projects/esc2/index.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I would love to change the world, but they won't give me the source code

    People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install Windows.

    I spent a minute looking at my own code by accident. I was thinking "What the heck is this guy doing?"

    Post Edited (crgwbr) : 5/1/2007 10:18:08 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-01 23:29
    James,

    For most real-world loads — especially if they're the least bit inductive — you don't need a PWM frequency anywhere near 10 MHz to drive them smoothly. I don't know what you're driving, but 20 KHz would be a high enough PWM frequency for most motors and solenoids. The Propeller's DUTY mode is a poor choice for driving these kinds of loads, due to its high output frequency and the resulting stress it places on the downstream MOSFETs. A bit-banging PWM routine in software would work much better.

    -Phil
  • mirrormirror Posts: 322
    edited 2007-05-01 23:30
    Tracy and others...

    Q=CV is such a valuable formula - I use it all the time together with Q=IT (which you included, but in it's differential form). You can very quickly get to ballpark figures even ignoring the differential side.

    So for example if you want to charge a capacitor to a voltage in an amount of time, then what's the current:
    Well since
    Q=CV and Q=IT
    then
    CV=IT
    and
    I=CV/T Capacitance in Farads, Volatge in Volts, Current in Amps, Time in Seconds, Q is in Coulombs.

    Now the above is not quite correct, because V varies as the capcitor charges, but you do get pretty close to the answer (certainly closer than an order of magnitude) without having to do any differential mathematics.
  • Tracy AllenTracy Allen Posts: 6,660
    edited 2007-05-02 15:49
    Yes, Q=CV and Q=IT, and I = C dV/dt are right up there with V=IR! They are the consitutive relations for the capaciitor and resistor. We might also add V = L dI/dt for the inductor.

    For PWM with a sinewave output, there are the magic sine waves, where a minimum number of transitions at precisely timed positions and durations is used to create the waveform. A magic sinewave might take only 44 transitions per quadrant. That would minimize the losses due to switching and driving the gate of the transistor at high frequency. It seems to me that a similar technique could apply to this situation where you only want to generate a single section of a sine wave, or an exponential, or a ramp or smooth pulse of any kind. In the case of the sinewave, the math behind choosing the times and positions had to do with minimizing the harmonic components. I'm not sure how one would proceed for an infrequently pulsed waveform. When Don Lancaster started out on that project years ago, he was doing it cut and try, empirical, and only recently added the sophisitcated math that can churn out the coefficients. Maybe for a short pulse the same sort of optimization would use a wavelet analysis. Wavelets are another set of functions like sine and cosine, that can be added up with successively higher frequency components, but they are better adapted to short or infrequent pulses.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.