Programming an Embedded Quadcopter Flight Controller

By Michael Delaney

Published: December 2018

In the fall of 2017, I traveled to Shenzhen as part of a school program to learn about engineering and technology in the electronics capital of the world. As a 16 year old maker with no clue what to expect, I got on a plane and shipped off to a remote technological paradise on the outskirts of the city center. After almost a full day of plane flights, 3 hours on a bus, and 4 security checkpoints, we arrived. My classmtes and I were tasked with designing and programming our own cellphones from scratch— solely using parts available in the Huaqiangbei electronics markets. The markets themselves were a veritable oasis of vendors selling individual components from resistors to screws to any other parts imaginable.

I spent the majority of the first week in Shenzhen helping to teach my classmates about the basics of electronics and embedded programming; however, I would argue that this adventure taught me more about electronics and design than I ever could have expected. This experience was life-changing, but it demonstrated to me that despite the ceaseless tinkering in the closet workshop of my bedroom, I am still taking the first steps when it comes to engineering. 

When I returned from Shenzhen with renewed confidence from working alongside my peers, I set out to challenge myself with a new project… I had some experience with “First Person View” multirotors and loved the process of assembling and flying them. There is something remarkable to me about being able to strap on a pair of “virtual reality” goggles, grab a remote, and watch myself fly as if I were actually sitting in the cockpit of a drone.

Recorded Quadcopter First-Person Video Clip
Recorded video from the perspective of FPV goggles

I became obsessed and started building smaller versions so I could fly anywhere. The small size and low mass of these micro-scale quadcopters allow them to sustain flight using very small motors, which consume less power and are significantly safer to use indoors and around other people. My obsession with these devices motivated me to want to learn more about the systems and processes controlling quadcopters through designing and programming my own.

These factors of size and safety were quite important to me since I would be doing a significant portion of the quadcopter development at school, but I soon learned this small design comes with its own frustrations…

Design Process

Programming the flight controller broke down into three major phases of development. All of these steps are essential to the successful flight of the quadcopter and could be described, in laymen’s terms, like so:

  • Where is the device? (Position Measurement)
  • Where do you want it to go? (Receiving information from the remote)
  • Figuring out how it will get there. (Determining how fast to spin the motors using a PID algorithm)

The first two steps are questions about the environment, this includes determining the current position of the quadcopter and receiving a command from a remote telling the device what direction to go. Finally, the last statement is the process of performing a few calculations to determine how fast it needs to spin the motors to move to the position indicated by the remote. Pretty simple, huh?

In reality, there are a few challenges that need to be overcome before the device will ever be able to get off the ground, both physical and programming based.

If you are interested in learning more about the process of designing the hardware and circuitry of the quadcopter flight controller, I highly recommend you take a look at my upcoming article on “Designing an Embedded Quadcopter Flight Controller.”

Now that you understand the basic aspects of designing such a project and some of the design decisions I made in this process, let’s talk about how this project can become a reality… 

Click the arrow below to proceed to the next page!