One of the most important goal of this project is to obtain a hovering drone. In order to get this, we are using PID controlers.
Three values are computed, based on data returned by the Kalman filter (Yaw, Pitch, Roll) .
Three PIDs are used, the error being the difference between the setpoint (altitude and three angles) and the measurement. The integral part is useful to have a copter exactly obeying our commands: it takes into account and corrects motors and propeller discrepancy.
Then, we use neutral values for each motors, and we modify them before sending to the motors, as follows:
- The result of the pitch PID is added to the motors 0 and 1 and removed from 4 and 5,
- The result of the roll PID is added to the motors 2 and 3 and removed from 6 and 7,
- The result of the yaw PID is added to the even numbered motors and removed from the odd numbered. The propellers are indeed not rotating in the same direction, thus this modification allows the copter to rotate on himself.
Thanks to it, we got some rather good results.
Without user control:
Thrust controlled with the remote: