I'm using my own code to create a quadcopter robot. The hardware part is done but I need to balance the copter.

The original video demonstrating the problem was shared via dropbox and is no longer available.

I have tried to play with the speed of each motor to get it balanced. It didn't go. I actually have a gyro and accelerometer onboard. But how shall I adjust the motor speed based on these values? What are the rules that I should beware of?

Is there any better solution other that try and error? Where shall I begin? Any tips?

  • $\begingroup$ The video link appears to have died... $\endgroup$ Jun 28, 2017 at 8:26
  • 1
    $\begingroup$ This is why I don't like links to private videos hosted on dropbox @Greenonline. At least if it had been uploaded to youtube, it would most likely still be available. $\endgroup$
    – Mark Booth
    Jun 28, 2017 at 9:49

1 Answer 1


I believe a little Googling and you will find several of the existing controller boards have open source. For example I made a small change to hobby kings KK board last week, compiled it and it was fine (look for firmware 1.5 in the files tab). I think openAero is also readily available.

I sure would not try and start from scratch, but if you do, it is multiple PID loops on each axis, mixed with control signals from the receiver. Roll and pitch vary by changing motor speed as you guessed. Yaw is changed by changing opposite rotating pairs of motors. altitude is controlled by changing all motors at once. What code I have looked at leads me to believe you probably should be comfortable with euler angles in order to fuse sensor data from gyros and acceleration (which may or may not be I2C so learn that to if you are not familiar with it).

  • $\begingroup$ Just a followup; ran across some nice flowcharts you might find interesting; $\endgroup$
    – Spiked3
    Jan 20, 2013 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.