Introduction: Kinect Controlled Quadcopter
We developed a method for piloting an Arduino-controlled quadcopter using a Microsoft Kinect. The Kinect tracks a user’s hand gestures and converts them to X, Y, Z coordinates. This output is then transmitted to the quadcopter via two Xbee modules (since each can only put out two PWM signals), which control the quadcopter.
All code found here.
- 4x: Turnigy 2826-6 2000kv motor from HobbyKing
- 1x: 7x3.8 Turnigy slow fly prop R/H rotation 4 pack from HobbyKing
- 1x: 7x3.8 Turnigy slow fly prop standard rotation 4 pack from HobbyKing
- 1x: Hobbyking sk450 glass fiber frame from HobbyKing
- 1x: Arduino Uno R3 from Amazon
- 4x: Hobbyking 50A red brick electronic speed controller from HobbyKing
- 1x: 5000mAh Turnigy 3S 20C Lipo Battery from HobbyKing
- 1x: IMAX B6 charger from HobbyKing
- 1x: 100-240v 5A hobbyKing power supply from HobbyKing
- 1x: Kootek GY-521 MPU-6050 3-axial gyroscope and accelerometer from Amazon
- 1x: SainSmart Xbee shield module for Arduino Uno from Amazon
- 4x: XBee 1mW Wire Antenna - Series 1 (802.15.4) from Amazon
- 2x: SainSmart XBee USB Adapter for Arduino UNO from Amazon
- 1x: Xbox Kinect for Windows from Amazon
Step 1: Assemble Quadcopter
Constructed frame – attached arms to body
Added the four motors to the arms
Added speed controllers and the rest of the components
Constructed wiring harness
- Four powers
- Four grounds (handle 30 amps)
- Two powers and two grounds for Arduinos (handle 500 milliamps)
Step 2: Kinect Outputs Coordinates
Unfortunately, the Aeroquad software needs analog values. In order to achieve this, we used a capacitor (0.47 uF) and resistor (82k Ohms) to create an RC filter to boost the voltage from 0 to 3V. This allows us to convert the Kinect values to usable Aeroquad controls.
Download and installation instructions of OpenNI can be found on their website here: http://www.openni.org/
OpenNI works best with Processing which can be downloaded here: https://processing.org/download/
After extracting the OpenNI library into processing, one can find the hand tracking program within the example files by navigating to: *\Processing\libraries\SimpleOpenNI\examples\OpenNI\Hands\Hands.pde
Step 3: Get Quadcopter Flying
Step 4: Transmitting Data to the Quad Over Xbees
Once your quadcopter is flight capable its time to turn to actually getting our Kinect data to the copter. In order to do this we will need a number of things:
Processing running OpenNI
Two XBee explorers
In order for the processing sketch controlling the hand movements to be read by Arduino, we need to make it such that processing data can be sent to and used by Ardunio. This is accomplished through the Processing for Arduino library available here: http://playground.arduino.cc/interfacing/processing. After installing the library as per the instructions one can use the examples listed to begin interfacing between Processing and Arduino.
With this library installed, we were able to link up our modified example of Hands with an Arduino sketch. You can find our modified Hands example, called QuadCopter_HandTracking.pde in our GitHub page.
We linked this file with an Ardunio sketch which reads the values of the Kinect sensor (output on the Arduino via digital pins) through Analog pins after running them through an RC filter in order to boost the voltage from 0 to 3v. This sketch can also be found in our GitHub page.
Both this sketch, and the receiving sketch utilize Bill Porter's EasyTrasfer library, which can be found here: http://www.billporter.info/2011/05/30/easytransfer-arduino-library/
At this point it's time to turn our attention to Xbees. We used Series 1s for our project. In order to configure the XBees, one needs X-CTU installed. It can be found here: http://www.digi.com/support/kbase/kbaseresultdetl?id=2125
To connect to a XBee first click Text/Query under PC Settings to make sure the program can read your XBee. If it throws you an error, make sure the Baud rate is set to the appropriate rate (9600 is the default, note this must be changed whenever and XBee's individual Baud rate is changed). Once successfully tested, click Read under Modem Configuration and X-CTU will populate the screen with the parameters currently written to the XBee. Format the XBees in the following manner and then click write (the process for connecting a different is the same as the first):
-PAN ID = 3002 (can be any ID you want, just make sure it matches that of the air XBee)
-Destination Address Low = 1
-MY 16-bit Source Address = 2 (Basically, to link two XBees the DL & MY of each must be the opposite of one another)
-Interface Data Rate = 6 - 57600
-Sample Rate = 14
-PAN ID = 3002
-Destination Address Low = 2
-MY 16-bit Source Address = 1
-Interface Data Rate = 6 - 57600
-Sample Rate = 14
Once your XBees are all set, hook one up to the ground circuit and the other to the air circuit. The sketch for the air Arduino can be found on our GitHub page.
On your flight board, connect the pins laid out in the sketch to their corresponding S pins, you don't have to worry about the + or - pins in this case. For reference, in our terms THRO = throttle, AILE = roll, ELEV = pitch, and RUDD = yaw.
Once done, open up the AeroQuad Configurator and begin transmitting. It may be necessary to reset both the air and ground boards: you'll know data is ready to be received when the values shown within the Transmitter Data display all hover near 1500 (1250 for throttle and 1000 for aux).