利用MPU6050三轴加速度获取欧拉姿态角

最近用到了MPU6050进行姿态估计,现将其中MPU6050三轴加速度读数求解欧拉姿态角的推导过程记录如下:

首先将MPU6050固联的载体坐标系b系与导航坐标系n系重合。即将图1的姿态旋转至图2中的左半图的位置,经过偏转ψ-俯仰θ-横滚φ后达到现有姿态,即图2中右半图的位置。

利用MPU6050三轴加速度获取欧拉姿态角_第1张图片

图1 MPU6050固联的坐标系

利用MPU6050三轴加速度获取欧拉姿态角_第2张图片

图2  变换前后的姿态

 

在当前姿态处于平衡状态时,MPU6050的所固联的载体坐标系b系三轴加速度ax,ay,az为重力加速度g在其载体坐标轴上的分量。

g=\sqrt{a_{x}^2{}+a_{y}^2{}+a_{z}^2{}}\qquad(1)

在旋转前,重力加速度完全沿导航坐标系的Zn轴,而Xn,Yn轴分量为0。可以认为是同一个向量在这两个坐标系中的不同坐标表示。其变换关系即为欧拉角表示的旋转矩阵。

 

\begin{bmatrix} a_{x}\\ a_{y} \\ a_{z} \end{bmatrix} =C_{n}^{b} \begin{bmatrix} 0\\0 \\ g \end{bmatrix}

\begin{bmatrix} a_{x}\\ a_{y} \\ a_{z} \end{bmatrix} =\begin{bmatrix} cos\theta cos\psi &cos\theta sin\psi &-sin\theta \\ sin\phi sin\theta cos\psi-cos\phi sin\psi&sin\phi sin\theta sin\psi+cos\phi cos\psi &sin\phi cos\theta \\ cos\phi sin\theta cos\psi+sin\phi sin\psi &cos\phi sin\theta sin\psi-sin\phi cos\psi &cos\phi cos\theta \end{bmatrix} \begin{bmatrix} 0\\0 \\ g \end{bmatrix}\qquad(2)

\begin{bmatrix} a_{x}\\ a_{y} \\ a_{z} \end{bmatrix} = \begin{bmatrix} -gsin\theta\\gsin\phi cos\theta \\ gcos\phi cos\theta \end{bmatrix} \qquad(3)

由上式可知,俯仰角:

\theta=-\arcsin \frac{a_x}{g}=-\arcsin \frac{a_x}{\sqrt{a_x^2+a_y^2+a_z^2}}

\theta=-\arctan \frac{a_x}{\sqrt{a_y^2+a_z^2}}

横滚角:

\theta=\arctan \frac{a_y}{a_z}

而偏航角无法通过(3)式得出。

MPU6050中,偏航角只能通过陀螺仪输出的角速度积分获得。

如有错误,敬请指正。

参考:

MPU6050的数据获取、分析与处理

https://zhuanlan.zhihu.com/p/20082486?columnSlug=devymex

 

 

你可能感兴趣的:(导航,MPU6050,加速度求解姿态角)