As time goes by, new technologies are generated that in one way or another facilitate and optimize activities that are developed by human beings, for instance, unmanned aerial vehicles (UAVs), which can perform functions ranging from carrying out missions for search and rescue, and surveillance; until carrying out activities oriented to the collection of geological data [1–3]. A good example is the case of the Ingenuity UAV that is part of the Mars 2020 mission, which has the task of exploring the surface of the planet Mars to plan the best route for the Rover Perseverance to follow. To achieve this objective, it is necessary to develop an automatic flight system, which in turn requires a flight data acquisition system. These data can be processed by a closed control system (flight controller) and determine the orders to be followed by the aircraft's operating surfaces [1, 4].
The objective of the work is to know the status of the UAV during the flight (the flight parameters), as well as the aerodynamic characteristics that are calculated in real time, and to be able to determine the best UAV flight regime as well as to be able to serve as input signals for an automatic control system. The drone has been manufactured and programmed from scratch. Within the flight data we can find parameters such as: height, spatial position and geoposition, flight speed, consumption and performance of the brushless motor. Special care has been taken in obtaining the spatial position; since the use of Euler angles to describe the UAV's spatial orientation is exposed to the gimbal block, the system was programmed to obtain quaternions and is subsequently converted to Euler angles (for later visualization) using of the formulas exposed in . The microcontroller used is an ARM-Cortex M7 which is mounted on the STM32F103C8 board. This microcontroller together with the code, programmed in C, oversee instructions for the data acquisition to be written in the microSD, where they will be stored for posthumous analysis by the pilot. The microcontroller used has the following characteristics: 32 bit / ARM architecture and 64 KB flash memory. On the other hand, the code used has a series of libraries, corresponding to each of the sensors that we have used.
The results obtained in flight tests show that the system can collect flight data from takeoff to landing, calculating the aerodynamic characteristics in real time, and saving the data in real time in a microSD memory. The sensor data was observed to have one of the following two errors, random error, or dynamic error. To reduce these errors in future work, it is proposed to use complementary filters and Kalman filters. It was also observed that the speed of response is slower the more sensors are included in the system, so a real-time operating system will be developed to effectively manage the tasks (data collection from each sensor).