Archived #embedded #hardware #C

Drone

A quadcopter built from scratch, frame to flight controller.

LanguageC
RoleAuthor
Stack CAltium Designer2.4 GHz radio3D printing

A working quadcopter, built over a school year. Not from a kit: the frame was 3D-printed, the board was laid out in Altium Designer, the flight controller was written in C, and the radio link ran on 2.4 GHz.

The control loop #

The PID loop is where the project got difficult. A quadcopter has no passive stability. It does not glide and it does not settle, so if the loop is wrong the aircraft is on the floor within a second, and you get very little information about why.

Tuning it was mostly a lesson in how far a correct-looking implementation can be from a working one. The maths was fine. The behaviour was not, and the gap was in things I had not thought about: sensor noise, loop timing, what happens when a motor saturates.

That is also the project that made me want to work close to the hardware. Doing the mechanical, electrical and firmware sides of one small system is a good way to find out which parts you actually like.