@lordmax2 Hi Max,

On a basic flight controller there are two main modes of operation, there's what's known as acro/gyro/rate mode and stabilise/auto-level mode.

In *acro* mode the sticks control the *rate* of rotation of the aircraft. This mode requires only a *gyro* sensor, that's why this mode is known by various names.

Acro mode is essentially how most aircraft joysticks work and is the mode preferred by most experienced pilots, since it allows for free flowing expressive control. However, it does require some practice to fly, as the pilot has to control all aspects of the flight envelope.

A 3-axis gyroscope measures roll, pitch and yaw rate of rotation, this can be in degrees/s or radian/s.

Implementing acro mode is relatively straightforward.

Auto-level mode allows the roll and pitch sticks to control the aircraft's angle in degrees or radians, say Â±45Â°, rather than its rate (in degrees/s or radians/s). When the pilot lets go of the sticks and allows them to return to 0Â°, the aircraft will return to level flight, hence the name auto-level or stabilise. Auto-level is often used by beginners, as it's much easier to fly in this mode, since the flight computer is controlling rate of motion.

Auto-level is where things become much more mathematically complex, firstly because it's necessary to track the aircraft's orientaion (or angles) relative to a fixed world frame. Also, the roll, pitch and yaw are interdependent on each other, so for example if you pitch up 45Â° and yaw 90,Â° your aircraft is now in a roll at a 45Â° angle. This is much more complicated than it first appears. Secondly, because it's necessary to use sensor fusion to combine the gyroscope with the accelerometer, to provide a roll and pitch angle estimation. This employs sensor fusion techniques such as the complementary or (extended) Kalman filter.

Keeping track of the aircraft's rotation in 3D space is traditionally done using either a Direct Cosine Matrix (DCM) or Quaternions (4-dimensional complex numbers). Although, it's also possible to simplify the mathematics somewhat by using Euler angles together yaw cross-coupling between roll and pitch, in other word feeding some of the yaw rotation into the roll and pitch angles.

Using the MPU6050's Digital Motion Processor (DMP) combines both the aircraft orientation and sensor fusion, to generate the angles without having to implement everything yourself.