Flight controller for quadcopter

Hi all,

I am going to make my own flight controller for a quadcopter with an arduino + IMU. I have choosen nearly all the components (IMU, motors, ESCs, props, battery…) but I have still a few questions:

  • I will use 4S battery (something like this http://www.hobbyking.com/hobbyking/store/__11920__Turnigy_nano_tech_3000mah_4S_25_50C_Lipo_Pack.html) to power the motors (4 cells of 3.7V in parallel) 4*3.7V = 14.8V. For the UNO the recommended input voltage is 12V and the limit is 20V. So what should I do to power the arduino with this battery?

  • For the radio I will use a 6 Channels, 2.4Ghz radio (like this one: http://www.hobbyking.com/hobbyking/store/_24969__Turnigy_6X_FHSS_2_4ghz_Transmitter_and_Reciever_Mode_2.html). However I haven’t seen any tutorials or examples to make a radio like this to work with an Arduino… I am sure this have have been done a lot though.

  • Last question: The choice of which Arduino board :). I don’t know what to choose between the Uno and the Mega. I need 4 PWM outputs for the 4 motors, 2 Analog for the IMU (connected via I2C bus), for the radio I don’t know yet. So far I thought that the pros of the Mega for my project were (tell me if what I am wrong!): More calcul capacity, More size for the code (I don’t have any idea of what the size of my code will be :roll_eyes:), More pins to add more features later. The main pro of the UNO was the reduced size.

Any advice would be greatly appreciated,
Thanks!

Have you considered using one of the Arduino clones designed for use in autonomous flying drones? That would give you all the sensors you'd need - and the software too, if you didn't want to develop that yourself from scratch.

Yeah I considered it but I prefer to develop the most by myself. This way I can learn more.

Anybody has any ideas for any of the 3 questions ? :roll_eyes:

Are you trying to make a remotely controlled quadcopter where everything is controlled directly by the operator via the radio, or is this device going to be autonomous/autopilot etc? In other words, what are you using the RC system for?

In the end I want to do both. There will be 2 ways of controlling it.

  • An attitude (orientation) control mode: you can control the altitude and the orientation of the quadcopter thanks to the RC transmitter.
  • An autonomous quadcopter mode: the quadcopter is stabilized (it is hovering) for null input of the RC transmitter. And then, with the RC transmitter you can control position. Basically it's a position control mode.

I hope this makes sense!

In both modes the RC signals from the user would need to be received by the Arduino and used to control a closed loop control system that performed whatever flight mode and action you commanded.

The Arduino is capable of receiving the standard servo control signal output by a hobby radio receiver (you can plug the Arduino in to the receiver in place of one or more servos) and it is also capable of generating the servo control signal (you can plug the servo into the Arduino instead of into the receiver). This part is relatively straight forward and you will have no trouble finding examples showing the hardware and software involved.

Managing the instrumentation to determine the current position and orientation, and Implementing the flight control algorithms to control them, are much harder. Other people have already implemented these parts and there are open source solutions you could adopt, but if you're planning to implement your own you have better be prepared for this to take a lot of effort.

I know that this going to be hard and will take a lot of time but I am prepared to that! I know some open source solutions (AeroQuad, ArduPlane, MultiWii, etc) but I have got some months with lot of free time so I am ready to do it.

I have both pratical and theoretical knowledge about control theory. However I will use an already written code to process the data from the IMU. I have got an 9 DOF IMU (MPU-9150) and some code has already been written to compute the position and orientation from the raw data. (https://github.com/Pansenti/MPU9150Lib)

GoussLegend: In the end I want to do both. There will be 2 ways of controlling it.

  • An attitude (orientation) control mode: you can control the altitude and the orientation of the quadcopter thanks to the RC transmitter.
  • An autonomous quadcopter mode: the quadcopter is stabilized (it is hovering) for null input of the RC transmitter. And then, with the RC transmitter you can control position. Basically it's a position control mode.

I hope this makes sense!

Lots of sense.

The first operating mode is maybe not seemingly intuitively, the more difficult one. Gaining manual flying skills for a quad is a time consuming and often frustrating process with lots of aircraft damage until you advance enough on the learning curve. Many can succeed easier if under the tutelage of a an experienced trainer using a proven aircraft, where the trainer can 'take control over' as you gain skills.

The second operating mode can be easier, as you imply, by using proved designs and proven software. Designing and building and coding a quad from scratch is a most challenging undertaking. Using proven design and code is the way to start out.

Good luck and have fun and don't let setbacks get you down.

Lefty

I'd love to see how you did with this. I have a Mega, a Due, and an Uno floating around, that I wanted to use for a similar project. The toughest part for me is matching the receiver signals without a scope. While you can use a multiwii, or one of the Mega clones quite well, it is more fun to know exactly how this stuff works. Let me know if you get a sketch together. I'll try to mimic your project and help you develop it where i can.

Thanks!

Hi,

Yeah I made the quad fly, you can see the pics, link to the source code and doc here => http://forum.arduino.cc/index.php?topic=202878.msg1494912#msg1494912

To deal with the receiver signal, I wrote my code based on this website: rcarduino.blogspot.com. It's pretty well explained.

Cheers,

Hi-

Im currently doing a project nearly Identical to yours. Im just curious on what control system you used? e.g. accelerometer/gyro? PID/what terms? Just curious what you modeled the control architecture on. Thanks on advance.

-Nick

Hi,

The main control loop is a simple PID (with anti windup) loop which controls the roll, pitch and yaw angles. An inner PID rate loop runs at 500Hz to control the rate of the angles. Tuning of the PID gains was done experimentally. The actual attitude of the quadcopter was obtained by using a complementary filter to merge the accelerometer and gyroscope data.

source code can be found here => https://github.com/GoussLegend/quadcopter

Hope this helps, Romain

Hi. Can you update with some pics. I want to put something together quick to learn to fly and then work on autopilr ect.

What exact boards did you use? What is the modern equivelant?

This thread old but still releven and showed top 5 on google.

Cant I just use a smart phone or tablet?

What clones can I buy off ebay righ now to build this.

I want basicly a droid like the parrot. fly with gps and rx wifi ect but for now getting flyings what I need to concentrate on. well kinda both aha.