AndroCopter - use your smartphone as an autopilot !

Hi all,

I would like to present my latest project, a scratch-built quadcopter with a special autopilot: an Android smartphone !

The phone is onboard (under the battery), and actually computes how to stabilize the drone. Of course, a phone cannot be connected directly to the ESCs, so an Arduino ADK bridges the two.

The idea came from the fact that smartphones now feature a lot of nice components useful for a drone. For example, the Nexus 4 used in this project has:
-sensors: accelerometer, gyrometer, magnetometer, barometer, GPS.
-wireless communication: Wi-Fi, 3G.
-2 cameras.
-a powerful quad-core processor, with a GPU.

For the moment, I can fly it manually from a laptop, with a XBox gamepad. I am currently implementing the vertical stabilization, using the barometer. The next step is the GPS. I am also thinking about implementing an optic flow algorithm, for indoor stabilization.

All the source code can be found on Google Code, in case someone is interested.



I would love feedback!

Views: 13461

Comment by Gary Mortimer on October 26, 2013 at 3:05am

Here's some feedback, love it well done!

Comment by Hugues on October 26, 2013 at 3:21am

Excellent. C'est genial. As-tu développé le code seul sur le smartphone ? Ou as-tu porté des algortihmes d'autres codes sources ?

Je suppose que le controle du PC au drone se fait par wifi, quelle est ta portee ?

Bravo en tout cas!

Comment by Andrew Tridgell on October 26, 2013 at 3:39am

Hi Romain,

Nicely done!

You might like to know that I've been working on a port of the APM code to Linux, initially targeting the Beaglebone Black and the RaspberryPi.

It would also be possible to build the APM code for Android, which would give you a lot more features than your code, and I think would make a very interesting experiment.

I suspect a port using the NDK wouldn't be too hard. The main trick would be getting the scheduling consistent enough for good flight control. For the Beaglebone port I'm using the RT preempt kernel patches, which may be difficult to get on an Android phone.

Cheers, Tridge

Comment by Romain Baud on October 26, 2013 at 4:11am

Thank you for your feedback !

@Hugues: all the smartphone source code has been written by me. It is not so long, it's about 1000 lines of code. I have not tested the Wi-Fi range yet, but I expect it to be up to 100m in favorable conditions, like the AR-Drone.

@Andrew: it may be possible to port the APM on Android, but the main issue is the lack of real-time. On AndroCopter, the control loop is supposed to have a period of 5 ms (sensors max sampling rate), but in practice, some loops can last more than 20 ms ! I ignore if APM can handle this. The goal of this project was to use a "stock" phone, without customization (it is not even "rooted"), so I don't want to try to install a RT Android kernel.

Comment by lot on October 26, 2013 at 9:29am

Hi Romain!

Congratulations for your Androcopter, flies ver well!

I'm doing another project that uses a smartphone as a flying platform: Flone

I'm using Multiwii+BlueToothModule instead the wiring communication between android and Arduino, because it's cheaper and lighter.

I already have an Arduino ADK so I will like to test your software soon.

Our plan is using the multiwii code as a failsafe if android fails. Also we are writting  an Android app for piloting with another smartphone. Video feed works well until 300 meters, but new smartphones can operate also in the 5Ghz band, that covers more distance.

Witch communication protocol are you using? MAVLink?

There are very cheap persicope lenses in ebay for the upper camera that works very well. 

If you want to test our frame that is designed to carry a smartphone there are the files for a laser cutter:

Bon chance!

Comment by Jesus A on October 26, 2013 at 1:11pm

Great Romain

I wrote some time ago on the drones-discuss groups about this. You've just brought it to life!! 

It gives a lot of power in terms of connectivity (integrated GSM) and the ability to write "plugins" for the androcopter allowing image recognition with the on board camera and a lot more high demanding processing stuff that cannot be done in APM/Pixhawk


Comment by Romain Baud on October 26, 2013 at 3:10pm

@lot: I've already seen the Flone project before. It seems nice and cute! Using a Multiwii board is probably the safest option, but for this build, I really wanted to use as little external electronics as possible.

For the moment, I am using a simple custom protocol to communicate with the computer. This is only temporary, since the objective is to use MAVLink, to be able to use QGroundControl.

Thanks for the periscope tip. This is a nice way to use both cameras of the phone.

Comment by Edwin on October 26, 2013 at 10:39pm

That's neat! Congratulations on achieving stable flight.

Comment by Jesper Andersen on October 27, 2013 at 1:37am

Nice project - I'm doing something a bit similar using an android phone as the high level computer system for drones (see more at I've done a lot of experimenting and I thought I would like to give you a few watch outs :)

1) Using the Android to do the IMU part is a bit "dangerous" because in contrast to risc based computing systems like arduino, the number of calculations needed to do corrections on a copter based drone, can vary and you might run into instability.

2) Even though I also use the built in sensors in the Android phone, I have also realized that some of the sensors are below the standard required for this type of application. Many phones have a very unprecice GPS, magnetometer etc.. I've actually started to use external sensors of better quality, interfacing with the phone using I2C. Also, phones do not shield their magnetometer from interference from motors, esc's etc, which can result in your drone flying in the wrong direction.

I'm have the advantage of working in a mobile solutions company, which gives me access to many different android phones, and through experimentation, I've learned that many devices are of such poor quality, that they are not suited for this kind of application.

But this is a very interesting project - maybe you could do a little post now and then, so we can get some insight.

Even though APM is great, it's nice to see that somebody is doing their own thing - variety is always a good thing :)

Best of luck :)

Comment by Meez on October 27, 2013 at 6:59am

Now that's awesome! so we dont need to buy an AP anymore in the future. But hey, how to answer those calling during flight?



You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service