Skip to content

Connecting an external controller

Fred G edited this page Mar 18, 2018 · 4 revisions

Connecting an external controller

Instead of using the on-screen controls, you can also connect an external controller like a PS3 Controller (or compatible).

There are several possible combinations how this works depending on how you connect to the Crazyflie:

Connection to Crazyflie Gamepad connection:
USB via OTG cable
Gamepad connection:
USB via USB hub
Gamepad connection: Bluetooth direct (only Sony phones) Gamepad connection: Bluetooth with root access and SixAxis Controller app
Crazyradio No Yes Yes Yes
Bluetooth LE Yes Yes Yes No

Connect a Playstation Controller over USB

In addition to the USB OTG cable, you'll also need:

  • USB Y-Cable
  • USB Hub
  • PS3 Controller (or compatible joystick/gamepad)

Setup

  1. Connect a USB Host (OTG) adapter to your Android device
  2. Connect a USB Y-cable with the USB Host adapter
  3. Connect a wall-plug with the (red) power plug of the Y-cable (you need external power)
  4. Connect the upstream port of a USB hub with the socket of the Y-cable
  5. Plug the Playstation controller and the Crazyradio into the USB hub
  6. In the Crazyflie Android app, change the controller to game pad
    • Preferences button → Controller Settings → Controller
  7. The Crazyflie Android client should say “Using game pad controller”
  8. Press the “PS” button and move the analog sticks (the pitch/roll/thrust/yaw on-screen values should change)

Connect a Playstation Controller (over Bluetooth)

In general, you cannot simply connect the Playstation controller to an Android phone, since Sony uses a special Bluetooth stack. It actually does work on certain Sony Xperia phones and tablets (e.g. Z2,Z3), because those phones have native support for connecting to Playstation controllers. With a Sony device you can even connect to the Playstation controller and the Crazyflie via Bluetooth at the same time.

Setup on Sony devices

  1. Go to Settings -> Xperia -> Dualshock3 Wireless Controller
  2. Start the wizard "How to connect a controller"
  3. Connect your PS3 controller to the Sony phone/tablet with an USB OTG cable
  4. At the end of the setup process your PS3 controller should be connected to your phone/tablet wirelessly

If you don't own a Sony phone, you can install the SixAxis Controller app (paid) instead.
Please note: your phone/tablet must be rooted for this to work.

If you use the SixAxis Controller app, you cannot connect to the Crazyflie 2.0 via Bluetooth while you are connected to the PS3 controller via Bluetooth.

Setup with SixAxis app

  1. Use the Sixaxis Controller app to pair and connect the Playstation Controller
    • You might have to press the “PS” button to activate the Playstation Controller
  2. In the Crazyflie Android app, change the controller to game pad (if you haven't done so yet)
    • Preferences button → Controller Settings → Controller
  3. Press the “PS” button and move the analog sticks (the pitch/roll/thrust/yaw on-screen values should change)

Connect a Taranis X9D (Plus) RC transmitter as controller

If you already own a Taranis X9D (Plus) RC transmitter and want to use it as a controller, it can be configured to work with the Crazyflie Android client.

Fortunately the transmitter is able to act as an USB Joystick (see https://opentx.gitbooks.io/manual-for-opentx-2-2/radio_joystick.html).

Create a new model for the Taranis X9D (Plus)

You should create a new model when using the Taranis as an USB Joystick:

  1. Turn off both internal and external TX modules
  2. Configure the thrust input (Weight 50% and Offset 50%)
    • otherwise the full travel of the axis assigned to thrust cannot be used
  3. Servos menu
    • invert Thrust (CH1)
    • invert Eleron (CH3)

Configure the Crazyflie Android client

Here are the necessary steps to configure the Crazyflie Android client:

  1. Turn on the Taranis
  2. Connect the Taranis with a USB cable and a USB host (OTG) adapter to the Android device
    • The Taranis screen should display a USB symbol when it's connected
  3. Check that all sticks are in center position
  4. Open the Crazyflie Android client
  5. Go to Preferences → Controller Settings and switch Controller to Gamepad
  6. Go to "Gamepad axis and button mapping" and configure the following axes
    • Right analog X axis should be AXIS_Y
    • Right analog Y axis should be AXIS_Z
    • Left analog X axis should be AXIS_RX
    • Left analog Y axis should be AXIS_X
  7. Depending on the mode you are using on the Taranis (Mode 1 or 2), set the Mode in the Android app
    • Preferences → Flight control settings → Mode

Use the Taranis X9D (Plus) with the Crazyflie Android client

  1. Before connecting to the Crazyflie, check that all axes are working (values should change in the Android app)
  2. Attention: Always make sure that the thrust stick is all the way down before connecting to the Crazyflie!
  3. Connect to the Crazyflie over Bluetooth
    • If you have a Crazyflie 1 you need to use a (powered) USB hub to connect both the Taranis RC transmitter and the Crazyradio USB dongle
  4. Fly the Crazyflie with the Taranis and have fun! :D