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.

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:
- Add GPS
- Improve motor control by doing real-world hardware tests to achieve more accurate model
- Turn the flight controller into assembled PCB
- Implement superior attitude controller to PID
- Attach a camera and do other projects with the drone