# ESP32-Flight-controller2 **Repository Path**: qq5541/esp32-flight-controller2 ## Basic Information - **Project Name**: ESP32-Flight-controller2 - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-08 - **Last Updated**: 2025-12-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ESP32 Flight Controller I have chosen ESP32 as a flight controller mainly because of its cost, WiFi & BLE capabilities. Which one can exploit to integrate with ROS. --- ## Watch Tutorial videos #### How to Make? [![How to Make?](https://img.youtube.com/vi/1zZbk0xWIrc/0.jpg)](https://youtu.be/1zZbk0xWIrc) #### Dorm Flight [![Dorm flight](https://img.youtube.com/vi/2goVaf8LJQM/0.jpg)](https://youtu.be/2goVaf8LJQM) #### How I stabilized the flight. [![Flight stabilisation](https://img.youtube.com/vi/PweCWXNrxg0/0.jpg)](https://youtu.be/PweCWXNrxg0?si=KJHE-g0SIH3p4Ixf) #### Understanding PID Controller [![Understanding PID Controller](https://img.youtube.com/vi/dMRDzicSvXk/0.jpg)](https://youtu.be/dMRDzicSvXk?si=4SlX_EvzxvCbH7zv) #### Tuning of PID Controller Gains via ESP32 Webserver WiFi [![Tuning of PID Controller Gains](https://img.youtube.com/vi/kl3Dlm11AEQ/0.jpg)](https://youtu.be/kl3Dlm11AEQ?si=NrJVn8WFx9-ViMtl) --- ## Testing Before attempting flight, ensure all components are functioning correctly by testing them individually using the codes provided in the **testing folder**: - Use **/ESP32-Flight-controller-/test/reciever_pwm_esp32/reciever_pwm_esp32.ino** to verify the signals from the receiver and transmitter. - Use **/ESP32-Flight-controller-/test/measure_angles_from_mpu/measure_angles_from_mpu.ino** to confirm the IMU is measuring angles accurately. - Use **/ESP32-Flight-controller-/test/motor_calibration_esp32/motor_calibration_esp32.ino** to calibrate all ESCs and ensure motors are properly synchronized. - Use **/ESP32-Flight-controller-/test/Voltage_measurement_esp32/Voltage_measurement_esp32.ino** to validate the voltage sensing circuit. This part is not yet impleneted in the main Flight controller (Can be skipped). - Use **/workspaces/ESP32-Flight-controller-/test/anglemode_flightcontroller_ver3.1_PID_values_tuning_webserver/anglemode_flightcontroller_ver3.1_PID_values_tuning_webserver.ino** to tune the PID gains of your drone. Do this step when you have calibrated your drone and ensured proper motor direction, propeller direction is as per the hand drawn cirucit diagram in **/ESP32-Flight-controller-/resources/Circuit diagram _HANDDRAWN_ only IMU_01.pdf** --- ## Flying Before flying the drone, follow these steps: 1. **IMU Calibration** - Run the calibration code from the **/ESP32-Flight-controller-/src/Gyro_accelerometer_calibration.ino** to calibrate the IMU. Ensure the quadcopter is on a level surface during this process. - Record the calibrated values generated by the calibration code, check the serial monitor. 2. **Update the Main Flight Code** - Enter the calibrated IMU values into the **/ESP32-Flight-controller-/src/Anglemode_flightcontroller_ver3.1.ino** code's void Setup() with these values before uploading it to the ESP32. 3. **Tune PID gains** - Refer the PID tuning video in the above YT links and tune your quadcopter, refer the **/ESP32-Flight-controller-/test/anglemode_flightcontroller_ver3.1_PID_values_tuning_webserver/anglemode_flightcontroller_ver3.1_PID_values_tuning_webserver.ino** code for seamless WIFI pid gains tuning. For a F450 frame the PID values should be more or less the same as the values in the original code. For other drone frames it might varry in a slight manner. 3. **Prepare for Flight** - Double-check motor rotations and propeller orientations as per the schematic. - Ensure all connections are secure. 5. **Safety First!!!!** -The quadcopter motors and propellers possess significant destructive energy. Always: - Conduct initial tests outdoors. - Verify that all propellers are installed in the correct direction and that motor rotations match the schematic. - Recheck motor and propeller functionality before uploading the main flight code. 5. **You're Ready to fly!** - Perform an initial outdoor test for safety. --- ## References - [Joop Brooking](https://www.youtube.com/@Joop_Brokking) - [Carbon Aeronautics](https://youtube.com/@carbonaeronautics?si=-DZ1Sz5sgNruoJgR)