When considering the idea of building a Quad Copter, I decided that I would like to build as much of the thing as possible. That would give opportunity for learning, and I've always wanted to design and make a PCB. Great!
This speed controller is going to drive a Dong Yang Servo D3536-11 brushless DC motor (as pictured) as I managed to source four with propellers for a decent price on eBay.
I did a lot of reading, and came across a few interesting articles, and stories. This document (authored by Ward Brown from Microchip) however takes the prize as the most useful thing I've found so far. Don't expect to understand it immediately if you're coming in fresh - I certainly didn't.
Having read around, and after a good long think about this, I decided to start working out the design of my circuit. I took a lot of 'inspiration' from the circuit on pages 29 and 30 of the Microchip document, my design isn't identical, but certainly bears some resemblance. Then again - how many ways can you wire up a set of push-pull MOSFETs?
Whilst designing the circuit, I kept a simulator close at hand. I found this simulator by Paul Falstad to be really great and very helpful.
My speed controller has some key requirements:
My familiarity with AVRs, and bad experience with PICs leads me directly to Atmel's site. I have used talent from the MSP430 range in the past, but found some things frustrating while developing for them. As I have everything I need to develop for an AVR processor, I think I will.
Key concerns are:
The 'go-to' AVR is the ATMega328p. It's good, but it's also bit large, and does more than I need. I've used the ATTiny85 in the past, but its slim 8-pin figure doesn't give enough for this project. I have a small stash of ATTiny2313s laying around, but after careful consideration, I decided on the ATTiny26L.
The reason for this decision is partly... Because EAGLE PCB has the part. But partly because it has a far broader range on the timer's prescaler, and it also appears to have superior analog components which may well be important when measuring the back EMF.
For MOSFETs to operate in a switching fashion, you must give a gate voltage close to the Drain, or Source. In very broad terms, a voltage in-between will cause the MOSFET to have an intermediate resistance, and will cause it to heat up. This is not what we want, and as the output of the microcontroller will likely be about 3.3v (compared to the battery's 7.4v), it is exactly what we are going to get - unless we do something about it.