2.2 How To: Flyver Hack a Copter

Tihomir Nedev edited this page May 19, 2015 · 1 revision

How to:

Hack a common copter and make it Flyver ready

Tricopter, quadcopter, hexacopter, octacopter with IOIO OTG board

Flyver currently works only with quads!

The radio controlled copters have a common base. We decided to benefit from that and create an easily hackable solution for building a software independent layer with SDK - Flyver SDK.

This is a walkthrough to get you started with hacking your copter and start using Flyver with it.

All ready to fly copters have:

  • Frame
  • Brushless DC motors
  • Electronic speed controllers (ESCs)
  • Power supply board
  • Radio Control (Transmitter and receiver)
  • Control Board, sensors and GPS
  • Lipo Battery

From this standard setup we should remove the components we don't need. Those are the Radio Control and the control board along with the motion sensors and GPS. We will replace them with an Android smartphone and IOIO OTG board.

Flyver copter base:

  • Frame
  • Brushless DC motors
  • Electronic speed controllers (ESCs)
  • Power supply board
  • Lipo Battery
  • IOIO OTG Board
  • Smartphone

IOIO OTG board:

Android Smartphone:

  • Android 4.2+
  • Acceleromenter, Gyroscope, Compass
  • Barometer
  • GPS

Start hacking:

Full connection schematics:

Schematics

Note! This is full schematics of how things are connected and linked together. In real life you won't use breadboard to connect your setup. If you are using the Flyver devkit you will only need to assemble the drone kit and connect the IOIO without doing soldering on the IOIO board itself. Please check how a practical connection will look like in ImageTop, ImageBottom, ImageJST.

1.Open your copter

Expose the motors and the motor drivers (ESCs)

  • Remove all the components we don't need (if they are available):
    • Original control board
    • Radio receiver board
    • GPS
    • Compass
    • Antennas and other unused leads

Info: The motor drivers aka electronic speed controllers (ESCs) are used to provide enough current and the right signal to spin the brushless motors.They usually have 3 different set of cables: (1) Black and red thick cables used to connect to a battery or the power supply board. (2) Three same colored thick cables (sometimes colored) connected to the brushless motor. (3) Set of three colored (white or yellow, red and black) thin cables used to connect them to the radio receiver or the controller board.Very often the red cable is removed and you are left with black and white (or yellow) cables. We will use the black and white cables to connect to the IOIO OTG board.

Note! Color code of the cables might be different but this is the idea. If colors are different, you are on your own to figure out which are which (easy).

If you don't know their direction, you could put them on the right pin after you are able to spin them with Flyver and check their direction. Alternatively, this could be done through the setting in the software.

2.Connect the IOIO

Power the IOIO: To power the IOIO OTG you will need 5-15Volts. You could use the JST-PH 2 pin female connector, the bare wires of which you could solder to your battery connector on the power supply board (2 or 3 cell lipo only). If you are using 4 cell battery, find another voltage source to power up the IOIO board. This could be the red wire of a ESC, which normally provides output of 5 volts(measure first).
On most of the models' power supply board there is a 3 wire cable which provides 5 volts with which you could power the board too.

Battery status signal: It is great when you could measure the status of the battery. We have taken care of that. To measure battery voltage and status (%) we are using the analog-to-digital converter (ADC) found in most of the microcontrollers. IOIO OTG has ADC which has input of max 3.3 volts. We cannot measure the overall voltage or single cell voltage as this will cause damage on the board. Therefore, we have to scale it first. To do that we are using a simple circuity called voltage divider. You could downscale a voltage to the values you need by using only two resistors. The problem with this is that everyone would have different scale factor and therefore the end apps won't show the same battery status no matter what device you are using. To avoid this would be better to use the recommended values for the two resistors.
*R1 = 32K Ohms
*R2 = 5.5K Ohms
If you are powering the IOIO with a connector straight from the battery, you could attach your voltage divider on the Vin, GND and Pin 46 (signal) on the IOIO. Or if you are powering the IOIO from alternative power source, you will need to take the battery voltage signal (unscaled) from your power supply board.

USB Connection

The smartphone is connected to the board via USB cable. The IOIO OTG board comes with USB OTG cable. This cable is special 5 pin USB from which the relationship between the IOIO and the smartphone is setup. The USB device could be a host or a peripheral. This is like the server-client relationship in web.

IOIO OTG as a host: This is the recommended configuration. You setup your IOIO as a host by connecting the USB OTG cable to it. Then you connect the smartphone to the USB OTG cable. In this configuration the IOIO acts like a host device. The smartphone starts charging. This mode is supported by most of the smartphones. NB! When configured in this mode, USB Debugging on the smartphone should be turned OFF.

Smartphone as a host: This will work only on some Android devices. By using this mode your smartphone is the host of the IOIO board. One of the benefits of this setup is that you are no longer required to turn off your debugging mode which makes development and testing easier. The second benefit is that now you could use a USB OTG hub. This means that now you can plug many external USB devices in your smartphone and therefore use them on the drone. This includes USB storage, usb cameras, usb radio modules, and many more. A new door for modularity is opened.

Connecting the motors:

The Quadcopter in X configuration has four motors which we indicate as FCW, FCCW, RCW, RCCW. The motors are connected to their ESCs and the ESC leads should go into the IOIO. The best way to connect them in by using 3 x 4 male pin headers. They are already connected in the devkit. One row of the pin headers should be soldered to pin 34-37 on the IOIO, while the other could be left hanging. The middle row should not be connected. And the last row should be soldered together and grounded. Check ImageTop, ImageBottom, ImageJST.
You could see the colour code and the way the ESC connectors should be connected to the IOIO.

QuadcopterX drawing

For quadcopter those are:
* Front clockwise spinning motor - pin 34
* Front anticlockwise spinning motor - pin 35
* Rear clockwise spinning motor - pin 36
* Read anticlockwise spinning motor - pin 37

3.Secure the smartphone case to the frame

_You could attach the phone with a appropriate plastic case on top or bottom of the copter. In the base case scenario, phone's cameras will be free to use. Attach the phone facing forward of the copter. The best way to attach the phone is with strong adhesive velcro straps. This is setup is secure enough with a new piece of velcro but additional over the phone strap won't hurt.

4.Install the Flyver Test App

Install the Flyver Test App you could find on the Flyver-Apps repo on a good Android phone. This app runs on the drone itself.
It is a good starting point to start playing with your drone and confirm that it runs properly.

5.Install the Flyver RC App

Flyver RC is used as a remote control for the Hello Flyver App. It should be installed on the second Android phone and used to control and test your Flyver drone.

6.Start playing!

  • Place your phone on board and connect it with the usb cable.
  • Open the Flyver RC app
  • Connect the drone's battery. Flyver Test App should start.
  • Setup the phones into the same wifi network and add the IP setting into the Flyver RC app.
  • You are ready to go. _Note that to control the pitch and roll of through the Flyver RC you need to constantly press the left-hand side button of the app. The app uses the motion of the RC phone to control the device.
  • From the settings of the RC App PID values and other options could be set. Note that this is very important for achieving a steady flight. In the future all settings will be autoconfigured through automatic procedures, but now using other devices will be some effort to setup.

Have Fun!

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.