It is used for electronic realization of four-axis unmanned aerial vehicle, balance car, robot and so on. And it is used for attitude judgment, and you can use your imagination to complete more and more interesting works.
The DMP built in MPU6050 realizes the attitude calculation of the carrier, which not only simplifies the code design, but also reduces the burden of MCU. MCU doesn't need attitude calculation process, so it has more time to deal with other events, which improves the real-time performance of the system. Through the hardware platform, the software simulates the real-time changes of three-axis gyroscope, three-axis acceleration and Euler angle. The results show that the attitude solution is stable and reliable.
Mpu6050 is generally used to provide attitude measurement and calculation during flight control operations. There are several important concepts in attitude solution, such as Euler angle and quaternion.
Euler angle: used to represent the rotation of moving objects around the coordinate axis in three-dimensional space. That is, the posture of an object per second can be expressed by Euler angle.
Quaternion: hypercomplex number, q=(q0, q 1, q2, q3), q0-bit real number, q 1, q2, q3 are imaginary numbers. It can be simply understood as a four-dimensional space, that is, adding a rotation angle to the original three-dimensional space. Quaternion can represent Euler angle, which is convenient to calculate, so quaternion is used to calculate. The compensation principle of acceleration and magnetometer is also mentioned here. You can refer to the principles and basic concepts mentioned on the Internet. I repeat here: the purpose of compensation is to make the world coordinate system and the rigid coordinate system completely coincide. On this basis, the compensation value is calculated and the rotation matrix, that is, quaternion matrix, is modified. The final result is to calculate the attitude of quaternion, that is, the value of each element in quaternion matrix. When solving quaternion according to the program in the above blog, Kp and Ki are used to control the speed of correcting rigid coordinate system. That is, adjust the speed of acceleration and magnetometer compensation (adjust the speed of error, and then adjust the coincidence degree between rigid coordinate system and world coordinate system)