Thursday, February 24, 2011

Managing MOSFETs

So as a continuation from the last post, I'm going to explain the usage (and then the proper usage) of Metal Oxide Semiconductor Field Effect Transistors, or MOSFETs.

For those of you not familiar with transistors, it is essentially a gate controlled by electricity.  It has three pins, the collector, the base, and the emitter.  As the names would imply, current goes into the collector and out of the emitter.  However, it is normally closed, allowing no electricity to run through it.  You open it up and therefore allow current to flow by pushing current into the base.  The common analogy is a water faucet.  The cool thing here is, you can control larger currents with smaller ones.  So if you 1/100th of an amp into the base, you could control 1A with it.  Cool right?

Now MOSFETs are a special type of transistor.  They are controlled with an electric field rather than a current.  So rather than having to constantly supply a current to the base, also called the Gate on the MOSFET, you apply a voltage to it which charges an internal capacitor in the FET and the resulting electric field allows much larger currents to flow through the MOSFET.  Because you only need to supply enough current to charge the internal capacitor instead of a constant one, MOSFETs can be more power efficient in the long run.  They also have the capability to control much larger currents than normal transistors.

I'll be honest, I didn't know much about MOSFETs when I went into this project, but, being the persistent little bugger that I am, I decided to forge ahead anyway.  (I bet you can see where this story is going already)  Anyways, I used a lot to figure out what exactly I was doing.  It's very helpful and tells you a lot of detailed stuff that most other h-bridge explanations won't go into.  Since I'm not nearly as eloquent as the H Bridge website, and since I'm generally busy, I won't go into a detailed explanation of the H Bridge here.  Suffice to say it's a way to control the direction of a motor.  It generally consists of 4 switches, in my case MOSFETs, and by turning on two at a time you can control which way the motor travels.  He's a picture from the H Bridge Secrets website.

If Q1 and Q4 are on, the motor goes one way, and if Q3 and Q2 are on, the motor goes the other way.  I'll from here on out refer to them as upper left and right, and lower left and right.

Now as for the types of MOSFETs I could use, there are P Channel and N Channel MOSFETs.  The differences are that P FET is closed and allows no current through (from the Source pin to the Drain pin) when the Gate pin is held low, and an N FET allows no current through (from Drain to Source this time) when the Gate pin is high.  Due to the fact that N FETs are easier to produce, have a lower resistance, more on that later, and are plain cheaper, I'll be using four of those.

Probably the most important thing to keep in mind when designing an H Bridge is the current draw of the motors you are using.  For the first revision of my bridge, I used the Fisher Price Motor spec spreadsheet found at the following link.

I then decided to use the 12V graph on the second page of that spreadsheet.  So if you look at the general information listings you can see that the stall current of the motor is 148A approximated to 150A.  This means that when the motor is forced to stop turning, like when jeep hits a wall, that's the amount of current that the motors draw.  I wanted to build an H Bridge capable of handling this current and so I searched for the necessary parts.  Looking through them all, I settled on buying 10 IRL7833's so that I would have enough for two H Bridges and then two spares in case something went wrong.  Little did I know things would end very poorly.

I won't go into much detail about how I designed and built the H Bridge, because I didn't put much thought into it and it did not end well.  It was basically scrapped together using an old perforated PCB board, some old romex wire, and a ton of solder.  Here are some pictures.

If you look closely you can see how that the wire is pretty burnt and two of the MOSFETs burst.  There was a lot of smoke and my basement smelled for a while.

Having read several pages on H Bridges, I assumed that the old wire was the problem and went to Radioshack and bought two spools of 12AWG wire.  Only when I couldn't fit the wire into the holes of the PCB board did I decide to post onto a forum and ask for help.

The forum is actually a very nice place, and having recently joined, I decided to post my questions there.  Since I have no shame and already feel really stupid for having made so many mistakes, I'll post the direct link to my thread right here.  I'm Gumbercules, btw.

Essentially I made a boatload of errors, and the very helpful people on the forums had no lack of advice to give me.  To name a few things I did wrong, I:

  1. Didn't turn on the upper MOSFET's all the way
  2. Misread the motor curves on the spreadsheet
  3. Didn't read all of the way through the thread from which I received the spreadsheet
  4. Probably did an awful job of soldering things
  5. Used improperly rated MOSFET's
I'll try and address each of these issues in the next few posts.

No comments:

Post a Comment