I designed a mini quadcopter which is about 4.5x4.5cm(Main Body). The main body is the PCB.
![enter image description here]
It weighs about ~20 grams with the battery. I'm using the MPU6050 with the DMP using the i2cDevLib. I am using raw radians for pitch, roll, and yaw these measures are read from the MPU6050's DMP. The motors are attached to the body using electrical tape(Black thing around motors). The motors are 8.5mm in diameter and are driven by a n-channel mosfet. The mode of control right now is bluetooth(HC-05 module). The code being used is my own. I have a control loop on all axes, the pitch and roll have the same values since the quadcopter is symmetrical. The problem I have is that PID tuning is next to impossible, the best I got was a ~2 second flight ([Video in slow-motion]).
At first I was using my own code for the control loop, but it wasn't as effective as the Arduino PID library.
The output of the PID loops are mapped to -90 to 90 on all axes. This can be seen in the code
myPID.SetOutputLimits(-90, 90); //Y angle myPID1.SetOutputLimits(-90, 90); // X angle myPID2.SetOutputLimits(-90, 90); // Yaw angle myPID.SetMode(AUTOMATIC); myPID1.SetMode(AUTOMATIC); myPID2.SetMode(AUTOMATIC);
My full code is below, but what do you think the problem is?