Drone Navigation

The aim of this project was to improve the accuracy of positioning a multi-rotor drone, such as a quadcopter, compared to what is achievable with its off-the-shelf GPS navigation. This was to be achieved by supplying distance data from three sensors via UHF radio signals. This would allow positioning to an accuracy of millimeters, compared to several meters for a GPS based system.
The drone software used for this was ArduPilot, an open source, embedded application written in C++, widely used on Arduino, PX4 and various other PCBs.
For most of project development the drone would be simulated by the MAVProxy software on both Linux and Windows desktop platforms.


Implementing circular flight mode

The first goal to solve was to implement an additional flight mode to be able to experiment with the existing code-base and adapt it to the needs of the project without removing any of the already working parts. The ArduPilot software was forked for this purpose, and the flight mode 18 added. This would first move a simulated quadcopter on a circular loop around a moving center. The circular path would first rely only on inertial data, updated by changing the GPS based center of the circle.

Screenshot from 2016-06-12 19:02:05
The center would move up and down resulting in a helix-shaped flight path, as can be seen in these images.
Screenshot from 2016-06-12 19:01:43

Editing loop for flight path with Blender3D

The next step after implementing the circular path was to be able to create any desired 3D shaped flight path. This was solved with a simple Python script, which was used to write a text file in the format of a navigation point list for MAVProxy from a 3D line created with Blender3D. The results can be seen in the image below. It is also possible to create multiple paths in one file and read out each one separately by using the correct assigned name for that particular line.
Screenshot from 2016-06-12 19:16:03

Qt based OpenGl 3D room for sensor testing

After the implementation of custom flight paths into the ArduPilot software, it was time to start testing the hardware. A simple OpenGl application was written for this purpose in the Qt Creator IDE. Positions of three stationary sensors would be entered into the GUI and their distances to each other and the moving quadcopter (target) would be fed to the application via a UART connection. The current target position would be calculated from this position via trilateration.

Screenshot from 2016-06-12 19:19:51

Substituting GPS input feed with sensor data

The last part of the project was then to take the above approach for sensor feed and position calculation and integrate it into the ArduPilot code base. A new mode (19) was created for this purpose, which combined the method for inserting custom flight paths developed at the beginning with a moving center determined by the sensor feed. The data would be sent by substituting the ArduPilot GPS feed in mode 19.