{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,10,12]],"date-time":"2025-10-12T01:05:14Z","timestamp":1760231114865,"version":"build-2065373602"},"reference-count":31,"publisher":"MDPI AG","issue":"17","license":[{"start":{"date-parts":[[2022,8,25]],"date-time":"2022-08-25T00:00:00Z","timestamp":1661385600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"National Natural Science Foundation of China","award":["61801231","62071238","17KJB510020"],"award-info":[{"award-number":["61801231","62071238","17KJB510020"]}]},{"name":"Natural Science Foundation of Higher Education of Jiangsu Province","award":["61801231","62071238","17KJB510020"],"award-info":[{"award-number":["61801231","62071238","17KJB510020"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Sensors"],"abstract":"<jats:p>With the development of modern industry, small UAVs have been widely used in agriculture, mapping, meteorology, and other fields. There is an increasing demand for the core attitude-solving algorithm of UAV flight control. In this paper, at first, a novel attitude solving algorithm is proposed by using quaternions to represent the attitude matrix and using Allan variance to analyze the gyroscope error and to quantify the trend of the error over time, so as to improve the traditional Mahony complementary filtering. Simulation results show that the six-axis data from the initial sensors (gyroscope and accelerometer) agree well with the measured nine-axis data with an extra magnetometer, which reduces the complexity of the system hardware. Second, based on the hardware platform, the six-axis data collected from MPU6050 are sent to FPGA for floating-point operation, transcendental function operation, and attitude solution module for processing through IIC communication, which effectively validates the attitude solution by using the proposed method. Finally, the proposed algorithm is applied to a practical scenario of a quadrotor UAV, and the test results show that the RMSE does not exceed 2\u00b0 compared with the extended Kalman filter method. The proposed system simplifies the hardware but keeps the accuracy and speed of the solution, which may result in application in UAV flight control.<\/jats:p>","DOI":"10.3390\/s22176411","type":"journal-article","created":{"date-parts":[[2022,8,30]],"date-time":"2022-08-30T01:37:55Z","timestamp":1661823475000},"page":"6411","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":16,"title":["Attitude Solving Algorithm and FPGA Implementation of Four-Rotor UAV Based on Improved Mahony Complementary Filter"],"prefix":"10.3390","volume":"22","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-7366-1972","authenticated-orcid":false,"given":"Yanping","family":"Zhu","sequence":"first","affiliation":[{"name":"School of Electronics and Information Engineering, Nanjing University of Information Science and Technology, Nanjing 210044, China"}]},{"given":"Jing","family":"Liu","sequence":"additional","affiliation":[{"name":"School of Networks and Telecommunications Engineering, Jinling Institute of Technology, Nanjing 211199, China"}]},{"given":"Ran","family":"Yu","sequence":"additional","affiliation":[{"name":"School of Electronics and Information Engineering, Nanjing University of Information Science and Technology, Nanjing 210044, China"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-9823-8361","authenticated-orcid":false,"given":"Zijian","family":"Mu","sequence":"additional","affiliation":[{"name":"School of Electronics and Information Engineering, Nanjing University of Information Science and Technology, Nanjing 210044, China"}]},{"given":"Lei","family":"Huang","sequence":"additional","affiliation":[{"name":"School of Electronics and Information Engineering, Nanjing University of Information Science and Technology, Nanjing 210044, China"}]},{"given":"Jinli","family":"Chen","sequence":"additional","affiliation":[{"name":"School of Electronics and Information Engineering, Nanjing University of Information Science and Technology, Nanjing 210044, China"}]},{"given":"Jianan","family":"Chen","sequence":"additional","affiliation":[{"name":"School of Electronics and Information Engineering, Nanjing University of Information Science and Technology, Nanjing 210044, China"}]}],"member":"1968","published-online":{"date-parts":[[2022,8,25]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","unstructured":"Holness, C., Matthews, T., Satchell, K., and Swindell, E.C. (2016, January 10\u201315). Remote sensing archeological sites through Unmanned Aerial Vehicle (UAV) imaging. Proceedings of the 2016 IEEE International Geoscience and Remote Sensing Symposium (IGARSS), Beijing, China.","DOI":"10.1109\/IGARSS.2016.7730748"},{"key":"ref_2","doi-asserted-by":"crossref","unstructured":"Ammann, N., and Theil, S. (2018, January 3\u201310). Using an UAV for testing an autonomous terrain-based optical navigation system for lunar landing. Proceedings of the 2018 IEEE Aerospace Conference, Big Sky, MT, USA.","DOI":"10.1109\/AERO.2018.8396469"},{"key":"ref_3","doi-asserted-by":"crossref","unstructured":"Aslan, M.F., Durdu, A., Sabanci, K., Ropelewska, E., and G\u00fcltekin, S.S. (2022). A Comprehensive Survey of the Recent Studies with UAV for Precision Agriculture in Open Fields and Greenhouses. Appl. Sci., 12.","DOI":"10.3390\/app12031047"},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"103475","DOI":"10.1016\/j.autcon.2020.103475","article-title":"An approach for the automated extraction of road surface distress from a UAV-derived point cloud","volume":"122","author":"Zeybek","year":"2021","journal-title":"Autom. Constr."},{"key":"ref_5","doi-asserted-by":"crossref","unstructured":"Avola, D., Cinque, L., Diko, A., Fagioli, A., Foresti, G.L., Mecca, A., Pannone, D., and Piciarelli, C. (2021). MS-Faster R-CNN: Multi-Stream Backbone for Improved Faster R-CNN Object Detection and Aerial Tracking from UAV Images. Remote Sens., 13.","DOI":"10.3390\/rs13091670"},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"1214","DOI":"10.1109\/TCST.2015.2480012","article-title":"UAV State Estimation Using Adaptive Complementary Filters","volume":"24","author":"Marantos","year":"2016","journal-title":"IEEE Trans. Control Syst. Technol."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"14282","DOI":"10.1109\/JSEN.2020.3007210","article-title":"A Coupling Method of Geomagnetic Aided Inertial Attitude Errors","volume":"20","author":"Deng","year":"2020","journal-title":"IEEE Sensors J."},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"103258","DOI":"10.1016\/j.jvcir.2021.103258","article-title":"Development of scale and illumination invariant feature detector with application to UAV attitude estimation","volume":"79","author":"Djerida","year":"2021","journal-title":"J. Vis. Commun. Image Represent."},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"107833","DOI":"10.1016\/j.compchemeng.2022.107833","article-title":"Iterative EKF as a controller in novel MPC formulation: First principles model based IEKF-MPC for SISO systems","volume":"163","author":"Kamesh","year":"2022","journal-title":"Comput. Chem. Eng."},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"106975","DOI":"10.1016\/j.ast.2021.106975","article-title":"Low-cost MIMU based AMS of highly dynamic fixed-wing UAV by maneuvering acceleration compensation and AMCF","volume":"117","author":"Guan","year":"2021","journal-title":"Aerosp. Sci. Technol."},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"103728","DOI":"10.1016\/j.robot.2021.103728","article-title":"Multi-UAV trajectory planning using gradient-based sequence minimal optimization","volume":"137","author":"Xia","year":"2021","journal-title":"Robot. Auton. Syst."},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Deibe, \u00c1., Nacimiento, J.A.A., Cardenal, J., and Pe\u00f1a, F.L. (2020). A Kalman Filter for Nonlinear Attitude Estimation Using Time Variable Matrices and Quaternions. Sensors, 20.","DOI":"10.3390\/s20236731"},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"1490","DOI":"10.1109\/TRO.2018.2864788","article-title":"Supervisory Control of Multirotor Vehicles in Challenging Conditions Using Inertial Measurements","volume":"34","author":"Bangura","year":"2018","journal-title":"IEEE Trans. Robot."},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Wu, B., Wang, D., and Poh, E.K. (2010, January 9\u201311). Decentralized attitude coordinated control without velocity measurements for spacecraft formation. Proceedings of the IEEE ICCA 2010, Xiamen, China.","DOI":"10.1109\/ICCA.2010.5524126"},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"2555","DOI":"10.1109\/TAC.2011.2108490","article-title":"Quaternion-Based Hybrid Control for Robust Global Attitude Tracking","volume":"56","author":"Mayhew","year":"2011","journal-title":"IEEE Trans. Autom. Control"},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"93937","DOI":"10.1109\/ACCESS.2019.2927010","article-title":"An Actuator Fault Detection and Reconstruction Scheme for Hex-Rotor Unmanned Aerial Vehicle","volume":"7","author":"Wang","year":"2019","journal-title":"IEEE Access"},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Bessaad, N., Qilian, B., Yuding, D., and Lin, L. (2018, January 11\u201313). An Adaptive Multi-Sample SINS Attitude Algorithm. Proceedings of the 2018 IEEE International Conference on Information and Automation (ICIA), Wuyishan, China.","DOI":"10.1109\/ICInfA.2018.8812352"},{"key":"ref_18","doi-asserted-by":"crossref","unstructured":"Dan, L., and Guowei, G. (2019, January 3\u20135). Design of Attitude and Heading Reference System Based on DSP and STM32. Proceedings of the 2019 Chinese Control and Decision Conference (CCDC), Nanchang, China.","DOI":"10.1109\/CCDC.2019.8832979"},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"180","DOI":"10.1016\/j.procs.2020.02.045","article-title":"Design and Implementation of a Dual-IP Core UAV Flight Control System Based on Qsys","volume":"166","author":"Zhang","year":"2020","journal-title":"Procedia Comput. Sci."},{"key":"ref_20","doi-asserted-by":"crossref","first-page":"1318","DOI":"10.1109\/LGRS.2019.2944460","article-title":"Development of an Attitude Transformation Method From the Navigation Coordinate System to the Projection Coordinate System","volume":"17","author":"Liu","year":"2020","journal-title":"IEEE Geosci. Remote Sens. Lett."},{"key":"ref_21","doi-asserted-by":"crossref","first-page":"728","DOI":"10.1109\/TRO.2012.2184951","article-title":"On Coordinate-Free Rotation Decomposition: Euler Angles About Arbitrary Axes","volume":"28","author":"Piovan","year":"2012","journal-title":"IEEE Trans. Robot."},{"key":"ref_22","doi-asserted-by":"crossref","first-page":"903","DOI":"10.1109\/7.40731","article-title":"Extension of Euler\u2019s theorem to n-dimensional spaces","volume":"25","year":"1989","journal-title":"IEEE Trans. Aerosp. Electron. Syst."},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"124","DOI":"10.1109\/TRO.2006.886829","article-title":"Adaptive Identification on the Group of Rigid-Body Rotations and its Application to Underwater Vehicle Navigation","volume":"23","author":"Kinsey","year":"2007","journal-title":"IEEE Trans. Robot."},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"533","DOI":"10.1109\/TNNLS.2013.2277540","article-title":"A Class of Quaternion Kalman Filters","volume":"25","author":"Jahanchahi","year":"2014","journal-title":"IEEE Trans. Neural Netw. Learn. Syst."},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"53","DOI":"10.1109\/70.127239","article-title":"Quaternion kinematic and dynamic differential equations","volume":"8","author":"Chou","year":"1992","journal-title":"IEEE Trans. Robot. Autom."},{"key":"ref_26","doi-asserted-by":"crossref","first-page":"2659","DOI":"10.1109\/TIM.2013.2258769","article-title":"Not Fully Overlapping Allan Variance and Total Variance for Inertial Sensor Stochastic Error Analysis","volume":"62","author":"Li","year":"2013","journal-title":"IEEE Trans. Instrum. Meas."},{"key":"ref_27","doi-asserted-by":"crossref","first-page":"586","DOI":"10.1109\/JMEMS.2019.2921607","article-title":"Origins and Mechanisms of Bias Instability Noise in a Three-Axis Mode-Matched MEMS Gyroscope","volume":"28","author":"Hiller","year":"2019","journal-title":"J. Microelectromechanical Syst."},{"key":"ref_28","doi-asserted-by":"crossref","unstructured":"Rahardjo, J., Rizqi, M., Prasetya, N.I., Prima, D.A., Rachman, A., Wibowo, A.T., Winardi, S., Widodo, A., and Gumelar, A.B. (2020, January 19\u201320). Combination of Hardware and Microservices-based VR Game Controller using Mahony Filter. Proceedings of the 2020 Inter-national Seminar on Application for Technology of Information and Communication (iSemantic), Semarang, Indonesia.","DOI":"10.1109\/iSemantic50169.2020.9234197"},{"key":"ref_29","doi-asserted-by":"crossref","unstructured":"Dharmawan, A., Ashari, A., Aprilia, A.G., and Handayani, A.M. (2018, January 7\u20138). Auto VTOL System on Quadrotor Using Madgwick Quaternion Kalman Filter and LQR. Proceedings of the 4th International Conference on Science and Technology (ICST), Yogyakarta, Indonesia.","DOI":"10.1109\/ICSTC.2018.8528613"},{"key":"ref_30","doi-asserted-by":"crossref","first-page":"2470","DOI":"10.1109\/TITS.2018.2866637","article-title":"EKF-Based Visual Inertial Navigation Using Sliding Window Nonlinear Optimization","volume":"20","author":"Heo","year":"2019","journal-title":"IEEE Trans. Intell. Transp. Syst."},{"key":"ref_31","doi-asserted-by":"crossref","unstructured":"Wang, M., Guan, L., Gao, Y., Xu, X., Chen, X., and Xiong, D. (2018, January 5\u20138). UAV Attitude Measurement based on Enhanced Mahony Complementary Filter. Proceedings of the 2018 IEEE International Conference on Mechatronics and Automation (ICMA), Changchun, China.","DOI":"10.1109\/ICMA.2018.8484522"}],"container-title":["Sensors"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1424-8220\/22\/17\/6411\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,11]],"date-time":"2025-10-11T00:15:14Z","timestamp":1760141714000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1424-8220\/22\/17\/6411"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2022,8,25]]},"references-count":31,"journal-issue":{"issue":"17","published-online":{"date-parts":[[2022,9]]}},"alternative-id":["s22176411"],"URL":"https:\/\/doi.org\/10.3390\/s22176411","relation":{},"ISSN":["1424-8220"],"issn-type":[{"type":"electronic","value":"1424-8220"}],"subject":[],"published":{"date-parts":[[2022,8,25]]}}}