Let's build a drone !

I enjoy learning how to build things. The following chapters embody the contents of the “Let's build a drone !” series of articles focused upon the custom development of a quad rotor UAV, commonly referred to as a drone. More specifically, the main focus of our attention will be upon the development of inertial platform stability and flight control system software, running on a micro-controller or micro-processor, that interfaces with the ESC's, BLDC motors and other digital servo control systems.

Our software development system will consist of a Windows PC hosting a VirtualBox Debian Linux Guest VM on a 12GB vdi (virtual disk image). That way we have easy access to the best of both worlds. Initial development began with a Freescale FRDM-KL25Z development board. The Kinetis MKL25Z integrates a 48MHz ARM Cortex-M0 uC and was able to support 2 PID controllers @ 50Hz sample rate and a 3-axis accelerometer + 3-axis gyroscope quaternion gradient descent iterator @ 100Hz sample rate. Dissatisfied, I migrated to an Nucleo-64 development board integrating a 180-MHz STM32F446 ARM Cortex-M4 uC. In this instance, performance of the quaternion gradient descent iterator could be increased to a 400Hz sample rate but with no processing bandwidth cycles to spare. Impatient now, the decision was made to finally bite the bullet and ditch the measly uC's in favour of a MMU equipped AM3358 1GHz ARM Cortex-A8 uP running real-time Linux Xenomai on the BeagleBone Green platform. The ultimate goal is the achievement of an 800Hz quaternion iterator sample rate coupled to 2 PID controllers @ 400Hz sample rate. With this architecture, processing bandwidth will certainly no longer be a problem.

Let's build a drone !

Quaternion gradient descent feedback control system

Quaternion gradient descent on the FRDM-MKL25Z mbed platform

Quaternion gradient descent on the Nucleo-64 STM32F446 mbed platform

Bare Metal on ARM Cortex-A8

Configuring a Debian Linux VirtualBox guest

Configuring the GNU ARM cross compiler tool chain on Linux

Installing and compiling u-boot and the mkimage tools

Compiling the Linux kernel for AM335x on BeagleBone Green

Compiling Xenomai

Creating an initial RAM disk (initrd)

Creating an embedded Linux root file system (RFS)

The AM335x boot sequence

Bootable SD/MMC card preparation for the AM335x with sfdisk

Bootable SD/MMC card preparation for the AM335x with fdisk