Building an Arduino powered quadcopter
The purpose of this project was to test and learn how to build a PID controller by using an Arduino to balance a drone using PID controls.
The arms of the quadcopter were made out of 3d printed segments joined together with epoxy in order to keep weight low. Battery, motor and other mounts/ joints were all 3D printed. All 4 brushless motors were flash hobby D2836, and all were driven by 30A ReadyToSky ESCs. In the center of the drone, an Arduino Nano, gyroscope, radio receiver, and 5V power supply were all soldered onto a PCB.
The drone was orientated in a way so the 2 motors on one arm would control the X rotation, the other 2 motors would control the Y rotation, and all 4 would control the Z rotation. Separate PID control would be calculated for all X Y and Z rotations.
Each PID control would have the following variables: proportional integral and derivative gains, Integral max/min in order to prevent wind-up, acceptable angular error, and calculation intervals.
Using both the Arduino servo and MPU6050 libraries, the code would calculate the current angular position of the drone, calculate the inputs from a radio controller, calculate the PID, Add the base power from the radio controller and the PID for each motor, and write a PWM signal to ESC's