Electrical – Quadcopter balance with MPU-6050

accelerometerbalancingdronegyroscopequad-copter

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?

Best Answer

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.