Portfolio

illustrations illustrations illustrations illustrations illustrations illustrations illustrations

Quadcopter 2015

Published on Jan 01, 2015 by debnera on arduino

Quadcopter 2015

Quadcopter 2015

Arduino based quadcopter, controlled with an Xbox 360 controller

GitHub Repository

Theme: Create quadcopter from scratch, with as little help as possible
Project duration: Several months
Team size: 1
My task: Everything (solo project: planning, selecting hardware, soldering, flight controller (coded in C), controller (Python), etc…)

This project consists of three distinct parts: The physical quadcopter, Arduino-based Flightcontroller and Python-based Controller.

The quadcopter is designed to be controlled with a laptop and a gamepad (Xbox 360 controller) through Bluetooth. I chose Bluetooth, because it is commonly found in laptops and smartphones. If everything works nicely with a laptop, I might try to implement the controlling with a smartphone by using the integrated motion sensor. The Bluetooth however has a very limited range of 10 meters, but it should be quite easy to switch to other protocols.

Background

I have seen people creating quadcopters and so I wanted to prove myself I can make one too. I wanted to do it with as little guidance as possible. I didn’t even want to look at existing code implementations or physical builds. I chose Arduino Uno as my platform, so I could attach the 6-axis motion sensor MPU-6050 and RF-module by myself.

Status

Currently the quadcopter is waiting for its second flight attempt. It should be flyable once I get the PID values right. However I don’t want to rush it, as the cheap frame seems very fragile. I have a backup frame, but it is not that easy to change it.

First flight attempt

The first flight attempt revealed that my code really needs tools for adjusting PID values on the fly. The quadcopter barely got a few centimeters off the ground and it was spinning violently around it’s yaw-axis. Most probable causes are way too high PID values and/or wrong sign in the stabilization algorithm. Initial PID values seemed to be at least 5 times too high. It was taking so much time to change the PID values that I decided to modify the code before the next attempt.

Quadcopter build

This is the only part where I really should have looked at existing builds. I didn’t realise that not every part is going to fit together nicely. I ended up having to drill and improvise in order to get the motors to fit. The end result is not as stable as I wanted it to be.

MicroprosessorArduino Uno
  

—|—|—
Frame
| 330mm|

Motors
| 4x 1200kv brushless outrunner|

ESC4x Hobbyking YEP 18A
  

Props
| 8”x4.5
| The motors are recommended for 9”-10” props, which are too large for this frame

Battery
| 2200mAh 3 cell 35C LiPo
|

Accelerometer/Gyro
| MPU-6050
|

RF
| HC-05 Bluetooth module
| Range is specced at 10 meters

Flightcontroller

I coded the flightcontroller with C++ for Arduino. The only external code I’m using is I2Cdev, which is used for communicating with the MPU-6050.

The Invensense MPU-6050 also has a powerfull Digital Motion Processor (DMP), which makes it easy to fetch the current angle of yaw, pitch and roll axes. Without the DMP I would have had to use a Kalman filter to combine information from the gyro and accelerometer.

Controller

The controller is made with Python and PyQt5. I’m also using PyGame as a library for the Xbox 360 controller.


Similar Stories