It is not uncommon to see people asking about how to balance a quadricopter using MPU-6050. It's also common to see people answering that a PID controller is needed. However, people doesn't say how.

In my case, I've already managed to combine data of accelerometer and gyroscope with a complementary filter. Also, I've already studied about PID in college. What I don't get is:

The input is voltage signal to the motors, the output is quadricopter's tilt angle and the setpoint is 0 (no tilt angle), right? The error operated by the PID is the difference between setpoint and output. So, how will my system know how to operate in the motor in order to make tilt angle closer to zero? I guess I have to implement my own logic to speed up some motors and slow down others, according to the error. But, if I have to do so, I don't see why PID is necessary. If I haven't, I don't get how motor is balanced according to the error. Could someone clarify how PID could work or share another solutions?

  • \$\begingroup\$ PID is a complex mix of software tuned to match the inertia/torque/rotation/position on all 3 axis of mechanical hardware. We can try to help you, but altogether this is a broad topic involving many skills and math. We will point to links to help you as we find them. Show us some diagrams and we will put more effort into helping you. NOTE: This maybe rejected as being to broad and complex a project for us to spend much time on it. \$\endgroup\$
    – user105652
    Commented Jul 10, 2016 at 2:59
  • 5
    \$\begingroup\$ You've got things a bit mixed up. The input to your PID is the signal from your MPU-6050, the output from your PID is the control voltage to your motors. \$\endgroup\$
    – brhans
    Commented Jul 10, 2016 at 3:00
  • \$\begingroup\$ Consider doing some reading on practical implementation of control systems, including PID-type ones. \$\endgroup\$ Commented Jul 10, 2016 at 4:25
  • \$\begingroup\$ But am I gonna have 1 PID for each motor? \$\endgroup\$
    – Jean Pablo
    Commented Jul 10, 2016 at 18:01
  • \$\begingroup\$ I have done some research and this is too complex a project for a beginner. Heck, it would take a ATE expert a year to complete a basic version. VTC due to the amount of hardware expertise and software needed. It is much more than PID loops and motors. It is at least a uKernel with lots of sub-routines. \$\endgroup\$
    – user105652
    Commented Jul 10, 2016 at 22:51

1 Answer 1


There are tho worlds in controll theory: open-loop (ger. Steuerung), closed loop (ger. Regelung). These two worlds can be joint together with addition. enter image description here

The picture above is a depiction where open and closed loop are binded together. A PI controller only adds some correction to the setpooint derived from LUT (static characteristics) aka feedforward compensation. The stability of closed loop isn't affected, because the feedforward component is open loop - You must take care that you don't make an accidental loop from PV.

  • \$\begingroup\$ Thanks! Some things are still not clear in my mind, but I'll try to understand them better and get back here. \$\endgroup\$
    – Jean Pablo
    Commented Jul 10, 2016 at 16:58
  • \$\begingroup\$ But am I gonna have 1 PID for each motor, or for each axis? \$\endgroup\$
    – Jean Pablo
    Commented Jul 10, 2016 at 18:31

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.