PID Stability - Quadcopter

I have my quadcopter all set up on a test rig to tune one axis at a time using the arduino PID library. I currently am just trying to get the two motors to balance each other out by setting the motors speed (with servo.writemicroseconds) to the controller's value +/- the PID output. It seems to want to balance here and there but then it will randomly overshoot right as it gets close to balancing. I have tried many techniques and combinations to tune the PID but I have had no success. Here are three quick videos and the code, if anyone has any suggestions or ideas that would be great:

Code:
See attachment in reply below

Adjusting only the P value:

Adjusting only the P value:

Adjusting P and I values:

Why did you put your code in the rubbish bin? Use Reply, and the Additional Options link (yeah, I know, it doesn't look like a link) to attach your code here.

Okay I attached the code below:

**Also I tried hardcoding in an offset for one of the motors because I saw another thread that had that suggestion. It seems a bit better now but still not having too much luck!

Quadcopter_V2.ino (11.6 KB)

I took the quad copter off of the wooden dowel and used string to tether it to the table while turning P, I, and D all to 0. I then tried to change the motor speeds by hand in order to get the quad copter to hover by balancing the two motor's speeds. It seems that the quad copter wants to fall towards one motor more than the other, I'm not too sure if it is that the frame is unbalanced, the testing rig is pulling it one way, or there is a problem with an ECS or motor.

Any other ideas guys?

Serial.println("Increased I ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");

Did you write that?

You realise that the serial output is seriously restricting the speed of your whole program? You are almost certainly filling up the serial buffer and blocking your program from running as quickly as it should.

For this kind of thing, I use the Serial.availableForWrite() function to find out if there's enough space available in the outgoing buffer. If there isn't, then I don't print anything for this loop and go back to taking another sample and controlling the copter. You should find that you're only printing data on every 4th or 5th loop.

I know it slows everything down but it shouldn't make a difference because I'm just using it for tuning right now? It isn't like it is being called all the time so it should be okay, right?

I will add in the "Serial.availableForWrite()" check and give it another go tomorrow when the battery is charged up.

Another question: Does anyone know any way to run the motors from the wall outlet? Obviously through a step-down of some type.I know the motors pull a lot of current and I haven't been able to find anything around my house that I could potentially use.

Well we would need to know things about the motors like their voltage and current. They look pretty small. I'd consider running it off USB power, at least for bench testing when it's not trying to lift itself.

The serial delays will be LARGE and RANDOM. Very bad for something that's trying to update the outputs consistently a hundred times per second.

I see, that makes sense.

Motors:
11V, 11.2A max

"ST2210 brushless motor"

MorganS:
Well we would need to know things about the motors like their voltage and current. They look pretty small. I'd consider running it off USB power, at least for bench testing when it's not trying to lift itself.

I think those motors are much too powerful to run off USB.

I wouldn't run a servo off USB power unless I were using a powered hub. Motors can do all sorts of nasty stuff to USB.