How to Write your own Flight Controller Software — Part 1

Why would You?

David Such

--

It is a reasonable question. There are a number of Open Source and proprietary quadcopter flight controllers with firmware available.

The problem is we want to use an Arduino board, to fit in with our other training programs. As soon as this becomes a constraint your options are very limited. In fact, your only real option is to write your own. So here we are.

Design a Drone

4 stories

Initially we attempted to port BetaFlight across to the Arduino Portenta H7, as this is designed for STM32 hardware and we know that writing your own flight controller firmware is tough and time consuming. We managed to get BetaFlight to compile for the H7 but because Arduino’s use a custom bootloader which is located right where BetaFlight normally sits in memory, flashing the firmware was problematic.

Portenta H7

4 stories

The lack of access to the BOOT and debug pins doesn’t help. We will keep working on that project but we need something that we can fly now, so the Raven Flight Controller software program was born.

The Hardware

Figure 1. Prototype Drone Hardware.

We will continue to use the 3D printed frame for our prototype (Figure 1 — code name Magpie). As the design matures, we will try a few different configurations to work out what is best. One of the issues with the current design is when you crash, you invariably break an arm. This requires the entire drone to be disassembled in order to replace the arm. Ideally you could just unbolt the arm and re-bolt a new one without…

--

--

David Such

Reefwing Software · Embedded Systems Engineer · iOS & Android Development · Robotics · Drones · Arduino · Raspberry Pi · Flight Control