skalpt / quadcopter-1

First attempt at building an autonomous quadcopter for indoor flight
1 stars 0 forks source link

Transistors vs. MOSFETs for motor drivers #1

Open skalpt opened 11 years ago

skalpt commented 11 years ago

I have been reading up on transistors vs. MOSFETs for motor drivers. As a general rule of thumb, you need a driver that can handle 3-4 times your actual load(1). This is especially the case for a DC motors because they are subjected to a high inrush current when the motor first begins to rotate. This is because the motors starting current is only limited by the very low resistance value of the motors windings(2).

So I have been thinking about different ways to measure the max inrush current, and this is what I have come up with:

  1. Stalled current is equivalent to inrush current(3). So we could pump the full 3.7V through the motor (no PWM) while holding the shaft to stop it from spinning, and measure the current flowing through it.
  2. We can measure the resistance through the coil of a stationary motor and use Ohm's law to find the stationary current (I = V/R).
  3. If anyone has access to an oscilloscope we could plot out the actual current being drawn.

Either way, I don't believe our BC337 transistors rated at 800mA(4) are going to be sufficient to drive our DC motors which we measured running at 700mA on 83% PWM. Even if they miraculously don't burn out, I would imagine the motor's torque will be significantly reduced by the inrush current being limited. I will order some IRFD014 MOSFETs tonight, they are capable of supplying 1.7A continuous and 14A pulsed(5). However it will be a few weeks before I receive the components so let's see how the BC337 transistors go in the meantime.

We should also keep our eyes out for any other transistors/MOSFETs that might fit the requirements. It is going to be tricky because our needs are quite specific:

Apparently most MOSFETs are not compatible with the first and/or second points(6).

References: (1) http://www.8051projects.net/lofiversion/t10341/shorting-mechine-control-using-at89c51.html (2) http://www.electronics-tutorials.ws/transistor/tran_7.html (3) http://en.wikipedia.org/wiki/Inrush_current (4) http://www.futurlec.com.au/Datasheet/Transistor/BC337.pdf (5) http://www.futurlec.com.au/Datasheet/Transistor/IRFD014.pdf (6) http://forum.allaboutcircuits.com/showthread.php?t=45871

alairian commented 11 years ago

The majority of FETs also pack a heatsink, which means they don't apply for point 3 as well... Maybe check out power transistors? They're still BJT transistors, so they're quick, and don't have a heat sink. Downside is they're a bit more expensive.

I've got a few different types of transistors we can play with - I've actually driven motors with BC548s (rated ~300mA) fairly well in the past. I doubt they'll work for our purposes, but we can try them out and see how we go.

We could also look at motor driving ICs - the BEAM robotics community are fond of the 74AC240. I'll do some digging for options.

skalpt commented 11 years ago

Power transistors are an interesting option. I was looking at a few on Futurlec but a lot of them have base current ratings in excess of 1A. I am assuming this means that, although they can handle relatively large currents, they are not particularly efficient amplifiers (the cheap ones, anyway). The great advantage of MOSFETs is that the gate is voltage-based rather than current-based, so you don't need to worry about it's amplifying ability, only whether 5V will be enough to saturate the gate. That is my understanding, anyway.

I've actually driven motors with BC548s (rated ~300mA)

That is interesting. The theory says that it is not possible, but then the datasheets tend to be pretty conservative.

Yeah motor driver ICs are worth a look at. They are on the expensive side but many of them have multiple channels so we could use one chip to drive all four motors, for example: http://www.futurlec.com.au/Others/L293.jsp. The 74AC240 looks like it only supports up to 50mA, unless the datasheet I'm looking at is for something completely different: http://www.futurlec.com.au/74AC/74AC240.jsp

skalpt commented 11 years ago

Just came across these specs on the Crazyflie quadcopter, a very similar design to ours (although at 5x the price): http://wiki.bitcraze.se/projects:crazyflie:hardware:explained#motor_drivers

They note that the most important property of a MOSFET is the on resistance (Rdson) because it affects the amount of power the motors can make use of. According to the datasheet, the IRFD014 has an on resistance of 0.2 Ohms @ 10V/1A. However I don't know what the on resistance would be at 2.8V/0.8A for comparison with the Crazyflie specs. Might be worth measuring that when the component arrives in 2-3 weeks. Should also check some of the other transistors that we will be experimenting with in the meantime.

alairian commented 11 years ago

Yeah, I'd forgotten that power transistors usually need to be paired with smaller transistors in low current situations... A 4 channel motor driver IC sounds promising - the one you found isn't too expensive either, given that we'd only need 1 of them, rather than 4 of something else. The '240 is used alot for walking robots, because it can be hacked to do a variety of wierd and wonderful things - including providing ~500mA to a single motor if wired correctly. Using a dedicated motor driver IC would be much mroe efficient though.

All that said though, I'm on the side of FETs at the moment - especially now that we've got a working example. We can work out a lot in theory from Ohm's law for the comparison, but I often find data from testing is not what's expected (hence my ability to drive motors from a 548). I can't find the Crazyflie MOSFET on Futurlec, I'll look around my other suppliers to see if we can source it - might be easier than doing hours of testing just for comparison.

skalpt commented 11 years ago

From issue #2:

Reading up more on MOSFET threshold voltages(1), it appears that 2.0V - 4.0V is the minimum voltage range required to open the gate. In fact, going back to the IRFD014 datasheet(2), the "Vgs vs. Id" graph only starts at 4V, and requires at least 4.5V before it will allow 1A through the drain. So it looks like we are back to the drawing board to find a suitable motor driver, specifically one that allows at least 1A at 3.3V@20mA.

skalpt commented 11 years ago

I have not given up on MOSFETs yet. It looks like there are some logic-level FETs out there, the trick is finding one that meets all of our requirements. The IRFD014 was nice because it came in a 4-pin DIP package which would have been convenient for inserting straight into a PCB, breadboard, etc. Most of the other packages I am coming across are either TO-220 (too big) or SMD (too small).

So I am starting to think some of the SMD variants mightn't be too hard to work with. Most are only 3 or 4 pins so it's not like we would be sitting there trying to solder 30-odd pins to surface mount pads (done that before, not fun). Check this little guy out for 42c, with a Vgsth (gate threshold voltage) of 1.0V - 2.0V and a rating of almost 3A when Vgs=3.3V. Or for 79c we could upgrade to this one with similar specs but a much higher current rating at low voltages, about 10A when Vgs=3.3V which is more than enough for our requirements. Then there is this one which seems to combine the best of both worlds, costing 42c and providing about 8A at 3.3V.

The main question I have with these (or any) MOSFETs is that 3.3V is never going to be enough to switch them fully on. So next we need to look at the Rds to see if it is low enough to be a reasonable motor driver(1). That last component has an Rdson of 0.1 Ohms. Ok great that seems nice and low, but considering Vgson=5.0V, what is the Rds going to be at 3.3V (when the FET is in a partially on state)? I don't believe the datasheet has enough information to answer this. But given the promise of the rest of the specifications, it is probably worth ordering in a few of these and experimenting for ourselves?

skalpt commented 11 years ago

Had another look at the datasheet(1) for the SI2300 MOSFET in the HJ Toys V997 Mini Pet, it is a bloody nice component. Vgsth is a tiny 0.76V, and at Vgs=2.5V, Rdson is only 0.08 ohms! So perhaps we should see if we can source the same component for our project. Unfortunately it seems to be hard to find. We could go direct to manufacturer here but historically I've found that these Chinese suppliers tend to get peeved at hobbyists ordering small quantaties, even if you satisfy the MOQ.

Here are some other manufacturers who supply the component and claim to offer MOQs of 10 or less: http://www.alibaba.com/product-gs/619928273/SI2300_VISHAY_Part.html http://www.alibaba.com/product-gs/668804116/Original_SI2300_01_01_05_06.html http://www.alibaba.com/product-gs/473381473/_MOSFET_SI2300.html http://www.alibaba.com/product-gs/579051662/_TRANSISTOR_SI2300.html http://www.alibaba.com/product-gs/1148498530/mosfet_transistor_SI2300_SOT_23.html

Alternatively, here is a list of authorised distributors, who will be more expensive but easier to communicate with: http://www.findchips.com/avail/?part=si2300&partner=18&utm_source=18&utm_medium=Link

alairian commented 11 years ago

I've had similar issues with suppliers, even if they agree to do a small order, delivery usually takes forever. I had a quick look at the resellers, they don't seem horribly expensive, although some seem to have a MOQ of 3000, which is a few more than we need... The FET looks nice, and personally I don't mind annoying Chinese suppliers, as long as we get our parts in good time :-P

skalpt commented 11 years ago

Had a look into the PMV31XN from the Crazyflie spec(1). According to the datasheet(2) it has an even lower Rdson than the SI2300, 0.053 ohms max when Vgs=2.5V. It also looks like they can be purchased from RS Online, who are running a free delivery offer at the moment. Unfortunately their site has been down for the past 12 hours so I'm not sure what the component price is yet.

skalpt commented 11 years ago

Unfortunately their site [RS Online] has been down for the past 12 hours so I'm not sure what the component price is yet.

Component price is $0.286 (incl. GST) with a MOQ of 20. I have already ordered 20.

If we manage to get these FETs driving the chunky YM2706 DC motors(1) from Session 2 then this case is closed. That said, figure 3 of the datasheet(2) is a bit worrying... looks like the upper limit of the safe operating area is only 500mA when VDS=3.7V and PWM=100%?

In case we run into problems I have ordered some IRLR024(3) from Futurlec. They have a much better safe operating area for what we are after, but a higher Ron which might cause issues with PWM. The SI2300 datasheet(4) doesn't even define a safe operating area that I can see.

alairian commented 11 years ago

Nice, we should be well stocked with MOSFETs then... On a side note, the values on the data sheet for that motor are significantly different to those that we measured when running the motor on the weekend - something we need to remember when pairing it up with a driver. That being said, we'll only really know when we try it out.

skalpt commented 11 years ago

the values on the data sheet for that motor are significantly different to those that we measured when running the motor on the weekend

The driver is one concern, the other concern is that if these motors are running way over spec we may observe a rather short lifespan. Then of course there is the question of whether these motors are even capable of lifting themselves of the ground :)

alairian commented 11 years ago

I think the motors could lift themselves, we saw some pretty serious thrust with that propeller on Saturday. That said, only testing will tell :-)

skalpt commented 11 years ago

Well, I just purchased a small piece of square dowel from Bunnings today. I know this thread is called "transistors vs. MOSFETs" but I'm thinking we do away with all of that for now and wire four motors directly to the battery. We can attach the motors to the ends of a cross-piece made out of the dowel and hold four pieces of string equal distances apart as if we were flying a kite. In fact, we should even be able to tug on the strings to fly it like a kite. We can call it quadKite ;)

alairian commented 11 years ago

That sounds awesome, and we'll get some good data about the capabilities of our motors as well. Great idea.

skalpt commented 11 years ago

The square dowel weighs a total of 88g, probably fine for the big motors but the pager motors will need a smaller, lighter frame.

So, I came up with this, which weighs about 23g:

skalpt commented 11 years ago

Ok so I hadn't really thought that design through properly. Clearly it would not make it off the ground, as the propellers would only be pushing air down onto the cardboard tubes. Even if some of the air flowed around the tubes, it would be highly inefficient.

My daughter will be thrilled with her new cardboard frisby...

alairian commented 11 years ago

Perhaps we could try with thinner bits of cardboard... Have a go with the dowel and big motors though, should be fun. Just make sure we tie it down, otherwise we may have to travel a bit to get the thing back :-P

skalpt commented 11 years ago

I do like the idea of making a frame out of thick cardboard, if we had access to the right type of material. It would take some clever thinking to find the weak points and strengthen them in the right ways. Of course, by the time we were done we might find that the PCB idea would be quicker to design, probably about the same weight and definitely more durable. Either way I agree that we start with the wooden quadKite.

On a note more relevant to this thread's original subject, I received the PMV31XN's from RS today. They are small... I mean really small. That said I have measured the pins as about 2mm apart, so the 1.05mm drill on the mill might still be ok to etch the SMD pads.

alairian commented 11 years ago

Wow, that is small... Those are SMD aren't they? If they are, the mill should be able to handle it fairly easily as 2mm clearance is more than enough for a small engraving cutter. The problem comes if we have to drill holes, as the mill has a tendency to cut away slightly more than it needs to, meaning that on a really small pad the drill hole can cut away most of the copper on the pad... But at any rate I'll have a better idea of what could happen when i see the part in person ;)

skalpt commented 11 years ago

SMD. No holes :)