Arduino Uno Bluetooth Flight Control

Hello,

I'm currently building a quadcopter with lightweight recyclable materials such as tin and balsa wood. I have also purchased 4 motors and 4 ESCs.

A friend of mine suggested that I would be able to program the Arduino board to control these motors. I was just wondering if any of you had any tips or pointers to help me get started? I have limited programming experience and this will be my first time using the Arduino board. I've searched around for some similar projects, but a lot of them are using Ardupilot or such.

I would appreciate any pointers or links to help me on my way. Thanks a lot for your time!

I'm sure if you googled "arduino quadcopter" - you would find a ton of links.

Also - you're going to need more than just an Arduino to control the motors - you also need a device called an "IMU" (Inertial Measurement Unit) - basically it can sense gravity and acceleration, so it can properly balance and orient the machine.

There's also this (long) thread:

Arduino BlueCopter

Hi cr0sh,

I have googled for this but I found a lot of ArduPilot projects, and the BlueCopter you mentioned is programmed with a Leonardo board, not an Uno.

So I also need to have an IMU along with the ESCs? Any other materials that I would need, or any other resources? Thank you for your help.

You will need a battery and charger. If you want remote control you will need a radio. If you want autonomous flight you will need a GPS.

Have battery and charger. What kind of radio are we talking about here?

And any advice on programming the Arduino Uno to power the motors? Thank you all.

Check out Multiwii. It is a flexible flight controller program designed for use with several different types of atmega chips (uno, leonardo...)

You just need to figure out the correct board type you have to select, add the sensors you are using, the correct wiring configuration. (top motor to pin X, left motor to pin Y ....) , and set up your remote control settings. Its a little complicated but nothing that can't be figured out if you stop and read it. All the settings are in the config file, and the processing software also helps verify you have it set up correctly before doing a live test.

Downloaded MultiWii but haven’t really messed with it.

Progress update: Made airframe out of balsa wood ad propellers out of aluminium. Tested propellers with ESC and motor using this code

#include <Servo.h>
Servo esc;

void setup () {
esc.attach(9);
esc.write(63);
}

void loop () {
esc.write(63);
}

I had to esc.write(180) before the motor fired up, and after that 63 was the initial value to get it going.

Few questions. 1)Does the value 63 mean anything or is it just the initial value to get things going for the motor? 2)How would I go about writing an interface to change the motor speed?

Glad I’m making progress and hope to hear from you soon,

-MCH

There is nothing significant about the value 63 as far as the ESC is concerned. The ESC will have a minimum value at which the motor will start and you seem to have found it.

Please do not test your code with the propellers attached. I can practically guarantee that that if you do you will have an accident at some time.

As to an interface to change the value that is where the radio comes in. The obvious choice is an RC receiver and transmitter but other options are available. Look at the videos by iforce2d on YouTube for ideas and code Cheap-ass quadcopter playlist,

So I guess to remote control the quadcopter I need to buy a receiver? Which ones are cheap and reliable? Also how feasible is programming an interface on a cell phone? I'm also guessing I would need a bluetooth shield for that? Any tips or links to programming the interface to a cell phone? How would I go about doing this? Thank you.

Long story short I did my capstone project for a quadcopter.

You can do all of that but it wouldn’t be safe to actually do it. I made a processing program, used a iphone app to send data over internet to my processing program, that then sent it through serial (XBEE) to the quad. But I never used it to fly it.

But at the end of the day, writing code from scratch to make a flying quadcopter is very hard. Serial and especially Bluetooth connection types are not reliable enough, if the connection breaks it may take several seconds or more to reconnect which is far to late if your flying something.

At the end of the day I designed the hardware boards that could take pre-written flight controller software (multiwii) to make it fly.

Use this concept on something like a toy car or robot, something that won’t natively hurt others or itself if the connection is lost.

For Quads, use pre-written software to fly it.

Ok, good points harddrive.

So basically MultiWii is pre-written software I can configure using my Arduino Uno, correct?

Correct me if I'm wrong, but instead of bluetooth I'll just use a regular RC which consists of the transmitter (RC itself) and receiver (usually comes with RC).

So I don't really need a IMU unless I'm planning on getting autopilot? Because some people say you do and some say you don't which is why I'm really confused...

I have airframe, 4 motors, 4 ESCs, propellers, Arduino Uno, battery.

When it comes to RC I'll need 4 channel at least because of the 4 motors of a quadcopter, yes? And I would just modify the MultiWii code to suit my needs?

Thank you.

-MCH

R/C remote controllers use channels (4 or 6 is standard) but that is not related to the number of motors. Its the number of controls you have. One for throttle, one for yaw, pitch, arming the quad and so on.

Technically you can control the ESC from any pin on an arduino, but the hobby industry has a standard pin configurations so programs like MultiWii will be compatible with there hardware.

If you have 4 motors its just 4 wires signal wires + GND's . In MultiWii you would pick the QuadP or QUADX option because you have 4 motors. Once you have all the options in the software selected, upload it to the board. Then open the MulitWii processing program, it will help let you know what options you pick, how to wire the motors to the board and so on. Make sure you have the motor rotations correct.

Without propellers you can pretty easily play with it before trying a real test. If something doesn't respond properly no harm will happen.

If your going to do all this be prepared for the worst. Its not unheard of for people to obliterate there quads within a few minutes of take off.

You should do some research on Quad-copters on hobby sites to get a feel for what's required. For cheap equipment Hobby King is ok.

If you want to manually control the ESC without a R/C remote you can use the Servo commands as a basic input. Most ESC need to be programmed before use, read the instructions on yours. Its mostly the min/max values it will respond to. If you can get that done (you need to do it quickly for it to accept it) then you can use servo commands to rev your motors.

Any advice on getting started on how to program the control interface? After hooking up 4 ESCs to motors, in Arduino I have managed to program all of them and can control their speed. But how do I make a remote control interface? Through like a phone, or do I need a commercial remote controller?

Did you try the link I posted in reply #7 ?

Mostly got everything figured out, still want to program a flight controller to the quad using Bluetooth. Installed both ArduinoRC and ArduDroid on my Android, was struggling with the code though. I've connected JY-MCU to the Arduino board and same with all 4 ESCs and motors. I can control the motors without bluetooth but getting an interface using the apps is where I'm stuck. Any help would be appreciated.

-MCH