Mini Quadcopter PID problem

Hello Everyone,

I designed a mini quadcopter which is about 4.5x4.5cm(Main Body). The main body is the PCB. 

3691194893?profile=originalIt 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. 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 below)

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 will be attached and pasted below, but what do you guys think the problem is?


QuadCode.ino

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Like I said your P value is too high try something like : 2

  • I guess your P parameter is too high.
    Very funny project by the way !

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…