Skip to content
July 25, 2012 / ygramulqc

Quadrocopter control with selfmade smartphone app

A usual Android ™ smartphone includes all necessary technology to use it as a remote control for a quadrocopter.

  • Accelerometer and magnetometer to measure the attitude
  • Touch sensitive display
  • Bluetooth

The app does only have 300 lines of code without any optimizing. For attitude angle measuring the important methods are SensorManager.getRotationMatrix and SensorManager.getOrientation. With these information the pitch and roll input can be controlled. The position of a finger on the touch display can be determined with the method onTouchEvent(MotionEvent event). This is used to control yaw and thrust.

That’s all to control the QC. But most QC flight controls need some special stick position to arm their motors. For this a button or something similar is needed. If this button is pressed, the special stick positions are send for a couple of seconds to arm the motors. After that the control of the QC is as desribed.

 

 

Advertisements

14 Comments

Leave a Comment
  1. FordPrefect / May 19 2013 7:04 pm

    I have a simple question, what flight board are you suing for the QC and is the code open for the client app?

    • ygramulqc / May 20 2013 7:37 am

      At the end I used a DJI Naza flight board because it support very good stability in the air.
      I’m sorry, the code is not open. But there is a free app available from http://www.mobile2power.de which does something very similar.

      • FordPrefect / May 21 2013 12:01 am

        I am capable of writing my own client app code in either Java or C/C++, the issue is which flight control board to use to accomplish what I would like to accomplish FPV with two HD cameras horizontal and vertical, one mounted to a gimbel, and using Wi-Fi or 3G/4G dongle to communicate with IOS/Android device, just lie Parrott A. R. Drone 2.0.

  2. FordPrefect / May 21 2013 1:48 am

    lie=like

  3. FordPrefect / May 21 2013 3:26 am

    I might try this flight control board… what do you think ygramulqc?

    http://store.openpilot.org/developers/16-openpilot-revolution-kickstarter.html

    • ygramulqc / May 21 2013 7:01 pm

      OpenPilot is also really good and stable. I choosed DJI Naza because it’s easy plug-and-play and available.

  4. FordPrefect / May 23 2013 6:07 am

    OpenPilot is not plug and play, not sure if it has USB or Wi-Fi? How are you communicating with DJI Naza with the smart phone, Wi-Fi? I may take a look at this version Naza.

    http://www.uavproducts.com/product.php?id_product=188

    • ygramulqc / May 23 2013 7:37 pm

      I do not know what’s actually goes on the OpenPilot project. I communicate from the Smartphone with bluetooth to a bluetooth-arduino dongle which itself control the DJI Naza like a remote control receiver (PWM Pins).

  5. FordPrefect / May 24 2013 3:24 am

    Ygramulqc I appreciate you helping me out on this as much as you have, thank you, but I have something in mind and I will execute as soon as I know it is the right way to go, I will start with creating a secure Wi-Fi connection.

    Did you make your connection to the QC secure?

    I think I will set up a Wi-Fi Protected Access II (WPA2), secure login which will last for duration of flight, you would simply search with you IOS/Android device for your QC which you would assign a SSID like “QCFordPrefect” and connect to it after entering password, and start client app which will do all the per-flight configuration, ground station functions, and actual flying with real time FPV.

    Parrot A.R. Drone 2 uses ad hoc connection between 2 devices, I do not want to do that for obvious reasons, unsecured.

    Let me know what you think?

    • ygramulqc / May 27 2013 2:54 pm

      Shure, sound’s nice. I do not have any encription in my project setup. If you control the flightcontrol via WLAN, how is the WLAN connectect? Through an Adruino with WLAN? Or a Smartphone? .. but then the Smartphone need a USB or Bluetooth connection to the flightcontrol.

  6. FordPrefect / Jun 1 2013 2:37 am

    I will be using a WiFi connection, Wi-Fi Protected Access II (WPA2), secure login which will last for duration of flight, you would simply search with you IOS/Android device for your QC which you would assign a SSID like “QCFordPrefect” and connect to it after entering password, and start client app which will do all the per-flight configuration, ground station functions, and actual flying with real time FPV.

  7. scrypti / Dec 16 2014 12:41 am

    hey, i just recently came across this thread and it seems to describe my situation pretty well.
    I am planning to controll a quadrocopter via my smartphone, so basically i wanna code the logic all by my self (movement, hold, waypoints, …). I currently struggle with a solution for:
    1. controlling the hardware via some sort of software input from an android app
    2. connecting to the quadrocopter via wlan / bluetooth (for testing a usb connection would be fine)

    How did you solve these problems?
    Thanks in advance and sorry for necroing 😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: