Quadcopter balancing.

Hello. I currently have a MPU 6050 (G521) IMU. I have a kalman filter, and have angle values from the IMU (not just acceleration but actual values for tilt. Like 0 is level, -5 is angled lower one end, 5 is the angled a little the oposite way etc). The angle readings all work, and are not super noisy. I also have integrated a PID library that I have attempted to tune. Finally I have build a PVC rig with a piece of wood with motors on both ends to test balancing in a controlled enviroment. I want to make it so that it balances flat. The balance rig is like a see-saw with two motors instead of seats. I am having alot of trouble making the see-saw balance.

Does anyone know of a general algorithm to make the two motors balance together?

The Setpoint of your PID would be 0 (level). The Input of your PID would be the current angle. The Output of your PID would indicate how to adjust the speed of the two motors: subtract the Output from the speed for the side that is high when the angle is positive and add it to the side that is low when the angle is positive. Then it's just a matter of tuning the PID.

    int speed = 1500;
    int output = PID(Input);
    leftSpeed = constrain(speed - output, 1000, 2000);
    rightSpeed = constrain(speed + output, 1000, 2000);
    leftESC.writeMicroseconds(leftSpeed);
    rightESC.writeMicroseconds(rightSpeed);