I have just finished my 2nd semester in mechatronic engineering (so yeah, I am kind of a beginner), and now I want to make a project on my own.
I want to build a quadcopter. In the beginning just rather simple.
However, I do not know how to program the motors (I know about programming servos). And everytime I search for it on Google, all I get is some DIY kit, or a link to an arduino site (Arduino Autopilot).
I am thinking about using this motor:
NXP P89V664 (based on the 8051 by Intel)
So basically, my questions are:
Could this setup work?
How do I program the motors?
- Like a servo? With PWM?
You cannot program a motor.
Perhaps you are asking the wrong question. The brushless motors themselves are nothing more than coils and magnets. There's nothing to program.
The ESC's can be programmed and controlled. To control an ESC (and by extension the motor it drives), you send it a PWM signal (like a servo) and it creates a corresponding range of motor speeds. Calibration of the ESC against your throttle ensures that the range of your throttle reflects the full range of the speed controller.
Furthermore, most ESCs have filters and other "logic" that can be programmed. Usually, this is done by listening to beeps and changing the input (eg. throttle stick), but you can also get cheap ESC programming cards to do it directly. The main features that can be programmed are the startup speed (ie, whether it immediately ramps up speed "hard", or if it starts more "softly" which protects geared motors from stripping the gears), whether the motor stops softly, or uses a "brake" to stop suddenly if you give it 0 input, and finally what voltage to cut-off power at.
Hope this helps
Well, obviously I mean how to program the microcontroller to control the motors.
But let's say I don't want to use a programming card, but only the MC. Do I just program them like I would a servo? A PWM with a period of 20 ms, and a signal of 1-2 ms?
The microcontroller cannot control the motors. The motor would draw far too much power and burn out your uC very quickly. The uC controls an ESC which in turn controls the motor.
Vernon Barry has posted some good info on flashing ESC firmware. Search on his name and/or "SimonK". This is where you'll find good details about interfacing/programming ESCs.
Keep in mind however that many of the newer ESCs from HobbyKing no longer contain ATMEL chips (which can be flashed with open frimware like SimonK), but instead contain SILABS chips which cannot be flashed (or at least not with SimonK firmw). The problem of course is that the "old" ESCs and the "new" ESCs look identical and there's no way to know if they changed chips. So while say the old 30A HK ESCs were programmale, the batch I just received last week had changed without any external indication (same model, same casing, same labels, same price.... different chip - *sigh*)
That's crappy news. Do you know which chip they're using now?
Hi Rene -
Have a look at this course at Rice University:
In previous years, they built every part of a quad rotor from scratch, including all motor control. It looks like they buy the airframe now, but they still create their own controller(s) and write their own code.