Design and implementation of a real time attitude estimation system with low cost sensors / Projeto e implementação de um sistema de estimação de atitude em tempo real com sensores de baixo custo

Roney D. da Silva, Heloise Assis Fazzolari, Diego Paolo Ferruzzo Correa


Getting the attitude of drones, underwater vehicles or other six degree of freedom (DoF) devices is one of the most challenging tasks in the project of navigation control systems. For this reason, many projects use proprietary software or are limited to simulations. This work presents a complete system for attitude deter- mination capable of provide estimated attitude and calibrated measurements using MEMS, with a low-cost and low-power microcontroller. The accelerometer and magnetometer are calibrated online on the embedded system using least squares method without any external devices. The states estimation is computed with a fast algebraic quaternion algorithm (less than 1.8ms) using an additive linear Kalman Filter and model measurements.


Inertial Sensors, ESP32, MPU-9250, Attitude, Strapdown platform


Baroni, L. (2017). Kalman filter for attitude determination of a CubeSat using low-cost sensors, Com- putational and Applied Mathematics 37(S1): 72–83.

Bonnet, S., Bassompierre, C., Godin, C., Lesecq, S. and Barraud, A. (2009). Calibration methods for inertial and magnetic sensors, Sensors and Actuators A: Physical 156(2): 302–311.

Castillo, P., Lozano, R., Dzu, A. E. and Dzul, A. E. (2005). Modelling and Control of Mini-Flying Machines, Springer-Verlag GmbH.

Duarte, C. T., Roquette, P. C. C., Dur˜ao, C. R. C., de Lima, K. G. and Oliveira, R. L. (2020). M´etodo da regress˜ao linearmu´ltipla aplicado na calibra¸c˜ao de sensores inerciais // Multiple linear regression method applied in calibration of inertial sensors, Brazilian Journal of Development 6(10): 75363– 75371.

Espressif (2020). ESP32 Series Datasheet, version 3.4 edn, Espressif Systems, Shanghai, China.

Feng, K., Li, J., Zhang, X., Shen, C., Bi, Y., Zheng, T. and Liu, J. (2017). A new quaternion-based kalman filter for real-time attitude estimation using the two-step geometrically-intuitive correction algorithm, Sensors 17(9): 2146.

Frosio, I., Pedersini, F. and Borghese, N. (2009). Autocalibration of MEMS accelerometers, IEEE Transactions on Instrumentation and Measurement 58(6): 2034–2041.

Groves, P. D. (2015). Navigation using inertial sensors [tutorial], IEEE Aerospace and Electronic Systems Magazine 30(2): 42–69.

Guennebaud, G., Jacob, B. et al. (2010). Eigen v3,

Guo, S., Wu, J., Wang, Z. and Qian, J. (2017). Novel MARG-sensor orientation estimation algorithm using fast kalman filter, Journal of Sensors 2017: 1–12.

InvenSense (2016). Mpu-9250 product specification, Technical report, InvenSense, Inc., 1197 Borregas Ave, Sunnyvale, CA 94089 U.S.A.

Kim, J., Kang, M.-S. and Park, S. (2009). Accurate modeling and robust hovering control for a quad–rotor VTOL aircraft, Journal of Intelligent and Robotic Systems 57(1-4): 9–26.

Kuncar, A., Sysel, M. and Urbanek, T. (2016). Calibration of triaxial accelerometer and triaxial magne- tometer for tilt compensated electronic compass, pp. 45–52.

Kuncar, A., Sysel, M. and Urbanek, T. (2017). Calibration of low-cost three axis accelerometer with differential evolution, in R. Silhavy, R. Senkerik, Z. Kominkova Oplatkova, Z. Prokopova and P. Sil- havy (eds), Artificial Intelligence Trends in Intelligent Systems, Springer International Publishing, Cham, pp. 178–187.

Madgwick, S. O. H., Harrison, A. J. L. and Vaidyanathan, R. (2011). Estimation of IMU and MARG ori- entation using a gradient descent algorithm, 2011 IEEE International Conference on Rehabilitation Robotics, IEEE.

Markovsky, I., Kukush, A. and Huffel, S. V. (2004). Consistent least squares fitting of ellipsoids, Nu- merische Mathematik 98(1): 177–194.

Merayo, J. M. G., Brauer, P., Primdahl, F., Petersen, J. R. and Nielsen, O. V. (2000). Scalar calibration of vector magnetometers, Measurement Science and Technology 11(2): 120–132.

Oliveira, A., Correa, D. F. and Altuna, J. (2020). Dynamic modelling and control of unmanned aerial vehicle of the quadrotor type.

Pedley, M. and Stanley, M. (2014). Magnetic calibration, Technical report, Freescale.

Sabatini, A. (2006). Quaternion-based extended kalman filter for determining orientation by inertial and magnetic sensing, IEEE Transactions on Biomedical Engineering 53(7): 1346–1356.

Schiffler, M., Queitsch, M., Stolz, R., Chwala, A., Krech, W., Meyer, H.-G. and Kukowski, N. (2014). Calibration of SQUID vector magnetometers in full tensor gradiometry systems, Geophysical Journal International 198(2): 954–964.

Spinka, O., Kroupa, S. and Hanzalek, Z. (2007). Control system for unmanned aerial vehicles, 2007 5th IEEE International Conference on Industrial Informatics, IEEE.

Titterton, D. and Weston, J. (2004). Strapdown Inertial Navigation Technology, Institution of Engineering and Technology.

Valenti, R. G., Dryanovski, I. and Xiao, J. (2015). Keeping a good attitude: A quaternion–based orientation filter for imus and margs, Sensors 15(8): 19302–19330.

Valenti, R. G., Dryanovski, I. and Xiao, J. (2016). A linear kalman filter for MARG orientation estimation using the algebraic quaternion algorithm, IEEE Transactions on Instrumentation and Measurement 65(2): 467–481.

Voos, H. (2006). Nonlinear state-dependent riccati equation control of a quadrotor UAV, 2006 IEEE Conference on Computer Aided Control System Design, 2006 IEEE International Conference on Control Applications, 2006 IEEE International Symposium on Intelligent Control, IEEE.

Won, S. P. and Golnaraghi, F. (2010). A triaxial accelerometer calibration method using a mathematical model, IEEE Transactions on Instrumentation and Measurement 59(8): 2144–2153.

Zhong, Y., Xu, Y., He, N. and Yu, X. (2018). A new drone accelerometer calibration method, 2018 37th Chinese Control Conference (CCC), IEEE.



  • There are currently no refbacks.