四旋翼飞行器的运动控制关键在于对飞行过程中的实时姿态角控制;目前实时姿态角信息还不能直接测量出来;为了能利用已有的传感器数据解算出更准确的姿态角,通过物理实验详细分析了四旋翼飞行器姿态角的解算和滤波算法;首先,通过联立欧拉方向余弦矩阵与四元数矩阵,得到用四元数表达的姿态角表达式;然后,结合加速度计和磁强计实时测量的数据,分别采用互补滤波和卡尔曼滤波两种方法来补偿四元数结果,分别分析如何选取最佳参数,并对比分析了两种滤波方式的优缺点;在一定精度要求范围内,这两种滤波方式都能获得更加准确的姿态角,但是互补滤波相对卡尔曼滤波有一定的解算时延;因此在精度要求一般的系统中,这两种滤波方式都可以用来求解姿态角,卡尔曼滤波方法则更适于对实时性要求更高的系统.
The key of quadrotor' s motion control is to the control of the attitude angle in real time when flying. The attitude informa tion can not be measured directly at present, in order to get more accurate attitude angle with the existing sensor data, in this article, quadro tor attitude calculation and filtering algorithm are analyzed at large through physical experiments. First, to gain the attitude angle expressed in quaternion by combining the Euler orientation cosine matrix and the Quaternion matrices. Then, to compensate the quaternion by comple- mentary filter and Kalman filter with the data measured by accelerometers and magnetometers, and to analyze separately how to select the best parameters, then to analyze comparatively what the advantages and disadvantages are of these two methods. In a certain range accuracy requirements, both of these two filtering methods can get more accurate attitude angle, but the complementary filter has a certain time delay than Kalman filter. So the two filtering methods can be used for solving attitude angle in those system whose accuracy requirements are low, Kalamn filtering method is more suitable for the demand for higher real--time performance.