针对传统无人机姿态解算方法过程复杂、计算量大、动态性能差的缺点,建立无人机姿态模型;采用陀螺仪对加速度计直接进行滤波的方法,设计出新的基于扩展kalman滤波的加速度滤波器;并且考虑到无人机非重力加速度的影响,对常规kalman滤波器进行了变噪声的改进。利用STM32微控制器和MEMS惯性单元搭建硬件平台进行对比实验。结果表明:在168 MHz时钟频率下,一次传感器数据读取和姿态解算总共耗时3.27 ms,数据更新率可达100 Hz。新算法飞行动态误差小于1°,而传统四元数法动态误差为2°左右;变噪声处理后静态瞬时偏差由4°降到1°。说明新算法的抗震效果和解算精度更好,可以为无人机自主飞行提供更准确的姿态信息。
Aiming at the disadvantages that the traditional attitude algorithm is complex in processing,lager in calculation and low in dynamic performance for the unmanned aerial vehicle( UAV),the attitude model of UAV was established. An accelerometer filter based on extended Kalman filter is designed using the method of filtering the accelerometer directly with the gyroscope. And the conventional Kalman filter is improved by varying-noise considering the influence of the non-gravity acceleration of UAV. The hardware platform is built with the STM32 microcontroller and the comparative experiment of MEMS inertial unit is carried out. The experimental results indicate that the time of reading sensor data and attitude solution costs 3. 27 ms in total at 168 MHz clock frequency,and the data update rate can reach 100 Hz. The dynamic error of the new algorithm is less than 1°,while the error of traditional quaternion methods is about 2°. After varying-noise processing,the transient deviation is reduced from4° to 1° without motor rotation. It demonstrates that the new algorithm obtains higher calculation precision and better anti-vibration effects,which can provide more accurate attitude information for the autonomous flight of UAV.