Quadcopter with Custom Flight Controller

C, C++, MATLAB, Simulink, FreeRTOS

Main project image

Built and programmed a quadcopter with a custom flight controller built around an ESP-32.

CAD & Modeling

I built and programmed a quadcopter with a custom flight controller. I began the process by choosing electronic components and creating a basic CAD model of the design. After estimating the weight, moment of inertia, and motor parameters, I created a model of the drone and its sensors using MATLAB and Simulink. This helped me plan the structure of the control system and determine initial tuning parameters. For the first iteration, I used basic filters and Riemann integration for the attitude estimation, and PID for the control.

Image of drone CAD Image of Simulink model of drone and control system

Custom Flight Control Code

For the flight controller I opted to use an ESP32 devboard, along with an external chip containing a 6 axis IMU and a magnetometer. The flight control code was programmed in C using FreeRTOS based on parameters determined from the Simulink modeling. It has interrupt-driven IMU data reception, and tasks to receive controller input wirelessly, estimate the attitude using an EKF, and generate control inputs for the motors using the PID controllers. The code can be found on my github.

Flight

The Future

Other improvements I might make in the future: