Big data tracking and automatic measurement technology for unmanned aerial vehicle trajectory based on MEMS sensor

The usage of unmanned aerial vehicles (UAVs) is rapidly increasing in the current era as these devices are capable enough in providing unique solutions in applications such as inspection of environment, identification of disaster, rescue operations, and defense systems. For the governance of the flight missions in a complex defense environment, the usage of these systems necessitated a sound command over data mining process. The large volume of data is generated by UAVs and processing of this data is a challenging issue. The existing data tracking and management systems are expensive and complex. For defense systems, smarter solutions are needed to process the large volume of data at low cost and with high accuracy. Therefore, a technique of tracking the data generated by UAV and automatic measurement of trajectory based on micro-electro-mechanical systems sensor in UAV has been proposed in this paper to provide inexpensive solutions to overcome the problems of the existing data tracking and processing systems. An iterative learning control algorithm is utilized in UAV to ascertain the disturbance and modeling errors. The finest characteristics of the Kalman filter technique are used for estimations of UAV trajectory. The quadratic performance function is introduced in discrete equation to solve the model error disturbance. Then on the basis of gyroscope data, the quaternion differential equation is formulated. The gradient descent process is also used to speed up the processing of UAV data. The results depict that the proposed technique has the lowest data tracking error of the UAV trajectory (0.09%) and has good measurement accuracy of 92%. The proposed method also reduces time complexity and searches the solution space in a faster manner.


Background study
Small UAVs have shown considerable utilization in numerous fields such as rescue operations, environmental exploration, relief operations, and defense systems. Small UAVs are now mostly employed in vast open and outdoor situations, relying upon built-in GPS units (Alteriis et al. 2020). However, as the application fields of small UAVs are increasing, the UAV technology has to be confronted with challenging environments such as unstable GPS signal, barriers of buildings tunnels, or interior areas (Song et al. 2019). Small UAVs are therefore important to independently sense the environment with their integrated sensors rather than relying upon GPS systems. For locating the things, obtaining the vital information and positioning the defense equipment, many integrated components are used in UAVs such as sensors, scanners based on laser technology, accelerometers, and gyroscopes. However, the smaller UAVs are lacking of high-precision due to the tiny load capacity. The solution of this problem is to integrate lightweight and affordable MEMS sensors with greater precision in small UAVs.
Drone technology has achieved much advancement in recent years due to the advent of latest technologies, evolution of MEMS sensors, refined microprocessors, high-energy lithium polymer (LiPo) batteries, and condensed actuators (Liu et al. 2018a). In the beginning, the immature technology led to slow development of UAVs. In recent years, the advancements in aerial technologies have gradually increased the application value of UAVs and broaden the development prospects for quad-rotor helicopters (Lei et al. 2011). Since the quad-rotor helicopter is a nonlinear system and each channel has strong coupling characteristics, the designing of the flight control system is a cumbersome process. In addition to it, quad-rotor aircraft tends to be miniaturized to enhance their usage in defense and security systems safely (Zogopoulos-Papaliakos et al. 2021;Dobrokhodov 2015). Due to small volume and low power consumption, a MEMS sensor is used in the UAV controller but there are large deviations between the actual and projected values of the sensors. Therefore, it is inevitable to analyze the sensor capability, calibrate the senor data and mining of the obtained data to infer the relevant information.

Related works
Many research approaches exist in the literature on the development of UAVs. This subsection provides detailed study on the existing literature. The authors have emphasized on analysis and verification of the performance features of MEMS-based low-cost navigation sensors (Haytham et al. 2015). During a GPS signal failure, the inertial sensors' performance is also evaluated whether it can provide accurate information in case of loss of GPS signal. The scientific study has demonstrated a successful way of compensating for MEMS sensor errors (Gross et al. 2010). It has been discovered that the structure of the neural network gets increasingly intricate throughout a UAV flight, imposing an additional computational strain on the navigation system's microcomputer. Hence, usage of simple algorithm is promoted to reduce the extra computational strain on the navigation system. The study presented in Ning et al. (2018), demonstrate an inertial navigation system that uses a modified Kalman filter in conjunction with a neural network to reduce the computational load on UAV system. During the process of calculating the approximation of navigation parameters, the suggested Kalman filter in combination with neural networks produces more accurate results in lesser time. However, the operational noise characteristics are not considered in Kalman filter-based model, hence the practical utility of this method in real-time environment needs more testing and more results to prove its efficacy.
In (Schmitz et al. 2016), the authors have suggested an enhanced Kalman filtering approach with a radial-based function to reduce the impact of the dynamic environment on UAV trajectory in the absence of GPS signal. The results reveal that by utilizing this method, the impact of dynamic fluctuations in the noise characteristics of the UAV after the loss of the GPS signal can certainly be reduced. However, this method increases the computational complexity remarkably but an attempt has been made to provide solution to the existing problems of GPS loss. In (Liang and Liang 2011), the authors have proposed a network of UAVs outfitted with electronic investigation sensors. Using a shadowing model, the distance between the sources to destination is determined. The data collection is performed by a fusion center to provide the directions to UAV for further course of action. The efficiency of the technique is tested by the simulation environment with the target emitted at high frequencies.
In paper (Liu et al. 2018b), the authors have introduced a motion planning method in which multiple UAVs work together to track a target by maximizing their communication and exchanging the information. The goal is to strike a balance between the gathered data and inferences drawn from the data. The data are collected through sensors. Reliable contact with the base station has to be maintained throughout the flight. The simulation findings reveal that the transmission tuning can improve the fusion process and target estimation accuracy significantly. In paper (Koohifar et al. 2017), the authors have introduced an intriguing technique as predictive control method that allows a swarm of UAVs to jointly pinpoint the source or the target. The usage of a receding horizon technique is also made in the research study to identify the best route for the target. An extended Kalman filter is used to regulate the rough calculations or estimations of the target point; and the D-optimality criterion is used to optimize the UAV trajectory. In (Mavrommati et al. 2018), the authors have introduced a receding horizon control technique for controlling multiple target locations. The drone can be used to handle multiple targets and can be used in diverse applications due to capability of controlling multiple target locations simultaneously.
In paper (Pourroostaei et al. 2021), reinforcement learning is utilized to locate UAV routes in smart farms. The UAV takes the advantage of remote sensing for exploring the environment and finding the most appropriate paths to target locations. This method reduces the energy consumption of resources. It also reduces the sensing latency to locate the target locations. In (Jianfang et al. 2017), Multi hypothesis tracking (MHT) approach is proposed to track the targets. Firstly, a time frame is picked for the tracking set and then its cost is determined. The trajectory data collected in fragments are merged to form a dataset. Then analysis is made on the basis of dataset and it is found that the proposed MHT approach works effectively. In (Samir et al. Jan. 2020), the UAV trajectory and resource allocation are jointly optimized. The authors have developed a sub-optimal technique using convex approximation to retrieve the results for bigger datasets. The performance is measured by comparing the results of the proposed scheme with two benchmarked greedy algorithms using two metrics of distance and deadline.
The purpose of Shirinzadeh et al. (2014) is to control the attitude on a predefined trajectory. The authors propose and design an anti-swing algorithm for controlling the load. This paper is segregated into two sub-works. In the first sub-work, dynamics model is designed on the basis of Newton-Euler method, and in the second sub-work, a nonlinear strategy is used to control the attitude of the UAV. The performance is evaluated by nonlinear simulations. The authors (Dawkins and DeVries 2021) present the control design of a micro-UAV with airfoils. The usage of trim analysis is made to identify diverse flight conditions. The proposed design stabilizes the UAV through transitions. The performance evaluation of the control approach is made through flight simulations. The controller can track the trajectory even in uncertain conditions. In (Feng et al. 2018), a novel landing technique for micro UAVs is proposed for safe landing even in uncertain conditions. A dynamic modeling-based system architecture is devised in micro-UAV. The Kalman filter method is also used for optimal localization, and implementation of predictive control to guide the trajectory path to UAVs. The results are tested in real-time environment with uncertainties to prove the viability of the proposed work.
The above methods either increase the time complexity or the solution-space complexity. Hence, there is a need to device new mechanisms for accurate tracking of trajectory of UAVs and to handle data mining problems of UAVs for accurate tracing of targets. Therefore, to address the problems of the existing literature, the tracking of UAV trajectory and automatic measurement method based on MEMS sensor have been proposed in this paper.

Contributions of the paper
• This paper presents the analytical study on big data tracking of UAV trajectory. • A technique of tracking the UAV trajectory and automated measurement of trajectory errors based on MEMS sensor has been proposed. • The method is devised to compensate the high operational cost and error rate of existing tracking systems integrated in UAVs. • The iterative learning algorithm is utilized to ascertain the disturbance caused by unusual events. • The modeling errors are determined on the basis of simplified dynamics of the UAV. • The finest characteristics of the Kalman filter are also integrated in the proposed mechanism.
• Experimental simulations have been performed to determine the accuracy of the projected method using MATLAB and trajectory prediction is performed in real-time environment also.

Organization of the paper
In Sect. 1, the background details of the research study, related works and the contributions of this paper are discussed. The proposed efficient big data tracking and involuntary UAV trajectory measurement method is described in Sect. 2. Section 3 highlights experimental results and analysis of the results. Section 4 discusses the summary of the paper.

Big data tracking of UAV trajectory
The kinetic model of the quad-rotor unmanned helicopter is the basis of the research in flight control algorithms. In our model, first of all, the basic working principle is introduced, and the coordinate transformation matrix of the airframe coordinate system and an inertial coordinate system is defined. The mathematical model of the system is established by the knowledge of rigid mechanics and Newton's laws. The propellers of the flight system of quadrotor are symmetrically distributed at the front, rear, left, and right ends on the airframe, and the four rotors are on the same plane. The power of flight comes from four motors rotating at high speed. The attitude and trajectory of a quad-rotor air vehicle can be controlled by adjusting the rotational speed of propellers. Rotor 2 and rotor 4 rotate counterclockwise, while rotor 1 and rotor 3 rotate clockwise. The pitching motion and forward motion can be formed by changing the speed of propeller 1 and propeller 3. Similarly, the rolling motion and lateral motion can be generated by changing the speed of propeller 2 and propeller 4. Thus, the lift and attitude control force of aircraft can be formed.
Since the quad-rotor helicopter has six degrees of freedom in space, but only four driving inputs; changing the rotation speed of any propeller will lead to the change of two attitude angles (Huang et al. 2020). According to the structural features of the quad-rotor unmanned helicopter and the relationship between the altitude changes of quadrotor and the rotation speed of each rotor, its basic motion can be divided into four basic modes: 1. Vertical movement It mainly includes three flight states: vertical ascending, descending, and hovering flight. When the quad-rotor fuselage is in a balance state, the helicopter can rise or fall by increasing or decreasing the rotating speed of the four rotors in equal measure.

Pitching movement
Pitching movement is required to keep the constant rotating speeds of rotor 2 and rotor 4. Meanwhile, it increases or decreases (by using rotor 1) and decreases or increases (using rotor 3) at the same time, but the total lifting force of four propellers remain unchanged. Thus torque along the axis-y is generated. The pitching movement of four rotors can be realized. Moreover, the forward and backward movement of aircraft can be comprehended using the coupling effect.

Rolling movement
Rolling movement is required to keep the constant rotating speed of rotor 1 and rotor 3, and increase or decrease (using rotor 2) and decrease or increase (using rotor 4) at the same time, then the torque along the axis-x is generated, so that the rolling movement of four rotors can be realized. Due to the coupling effect, the left and right movements of aircraft can also be comprehended.

Yawing movement
Yawing movements is to increase or decrease by using rotor 1 and rotor 3 rotors, and decrease or increase the rotor speed at the same time by using the torque in opposite direction generated by the forward and reverse rotors. The torque in the overall direction of the helicopter body around the axis z can also be changed.
All moving objects in the universe are relative. There is no movement for a single object. The position and attitude of an object in space are determined relative to another object, so the concept of reference coordinate system is generated. To establish the kinematic model of quad-rotor helicopter and control the attitude (Zear and Ranga 2020), it is necessary to introduce the definitions of two common coordinate systems. a) East-North-Up coordinate system E: We select a point on the ground as the reference origin and take the horizontal plane as xoy plane. The east direction is the positive direction of X-axis. Rotate it at 90 degrees clockwise. The north direction is the positive direction of Y-axis. The vertical horizontal direction is the positive direction of Z-axis. b) Aircraft-body coordinate frame B: The center of mass of the quad-rotor helicopter is taken as the origin. The line between rotor 1 and rotor 3 is the axis-x. The direction of rotor 1 is the positive direction of axis-x. The direction of rotor 2 is the positive direction of axis-y. The straight line passing through the origin and perpendicular to the plane xoy is taken as the positive direction of axis-z.
The attitude of a rigid body describes the relative direction between two coordinate systems. The transformation of the rigid body from one attitude to another can be expressed by the relative rotation transformation matrix of two coordinate systems. There are many ways to express the attitude, including quaternion, Euler angle, Euler axis/ angle, and direction cosine matrix (Zear and Ranga 2020). Each method has its advantages and disadvantages. At present, the quaternion and Euler angles are commonly used (Kangunde et al. 2021). The main advantage of Euler angle representation is simple and intuitive, it needs three parameters (/, h, W) to represent rolling angle, pitching angle, and yawing angle (Roh and Kang 2018). The disadvantage is singularity and gimbal lock, plus there are a lot of trigonometric function operations in the calculation with complex computations. The quaternion representation does not have these problems, and the computational complexity is also low, therefore it can be widely applied in the aerospace field and 3D animation fields. Hence, we are using quaternion representation in our work.
The attitude representation of the proposed trajectory method is as follows: (1) Euler angle representation Euler angle is used to describe the orientation of the rigid body in 3-D Euclidean space. The orientation of a rigid body is set according to the order of rotation of three Euler angles in the reference system. The main rotation matrices rotating around x-axis, y-axis, and z-axis are respectively expressed in Eqs. (1), (2) to (3) .
The final attitude transformation matrix of a rigid body is related to the order of three rotations. In this article, the order of rotation of axis Z À Y À X is adopted. The attitude transformation matrix is shown in Eqs. (4) and (5).
(2) Quaternion representation Quaternion is a mathematical concept invented by Irish mathematician Hamilton in 1843. It shares some similarities to a complex number. Quaternion is composed of three imaginary numbers and one real number. The basic expression is shown in Eq. (6).
In the formula, q 0 , q 1 , q 2 , and q 3 are the four components of Q where q 0 is the scalar part. The vector part consists of q 1 ; q 2 ; q 3 ½ T , which are represented by the symbol q. Corresponding to the two-dimensional space of complex numbers, if the simplest hypercomplex set such as quaternion is considered as multi-dimensional real number space, and then the quaternion can denote a 4-D space. The quaternion that is used to represent the attitude meets the constraints in Eq. (7), which is also known as the unit quaternion.
The multiplication symbol of a quaternion is denoted by , the multiplication rule of a quaternion can be expressed in Eq. (8).
Meanwhile, the following rules are defined in Eq. (10).
The air propulsive force for the four-rotor UAV drive where the propeller rotates at high speed is the only power of aircraft. The vertical force of the propeller is derived in Eq. (11). The reverse moment is expressed in Eq. (12).
In general, the motor used by four-rotor helicopters is a brushless dc motor, which can be approximately described by the first-order inertia link. The mathematical model of DC motor is shown in Eq. (13).
For the kinetic equation of the aircraft, the main theoretical methods include the Euler-Lagrange formula and the Newton-Euler formula. In this paper, the Newton-Euler formula is used to deduce the kinetic Eq. (14).
By analyzing the force of four-rotor aircraft, it can be observed that the force acting on the aircraft mainly comes from three sources: the lift force F T generated by the rotor wing, the gravity force F G of the aircraft, and the air resistance force F D in flight. The resultant external force in the total inertial coordinate system can be expressed in Eq. (15).
The formula C e b denotes the directional cosine matrix from the airframe coordinate system to the inertial coordinate system. The air resistance, the lift force of the rotor, and the gravity vector are shown, respectively, in Eqs. (16), (17) and (18).
The inertia tensor of a rigid body in space can be expressed as in Eq. (19).
To simplify the system model, it is assumed that the mass center of the four-rotor helicopter is in the center of the airframe, and its structure has good symmetry. If the inertia tensor matrix is a diagonal matrix, the inertial product in Eq. (19) will be I xy ¼ I yx ¼ I zx . Combined with the optimal iterative learning method, the estimated model error is compensated based on disturbance, and then UAV trajectory tracking is accomplished.

Automated measurement technology of UAV trajectory based on MEMS sensor
The proposed method assumes that the guidance controller is in charge of the task execution of UAV mission. The iterative learning control algorithm handles the controller's output. The predicted model rectifies the errors caused by disturbances by combining with the ideal iterative learning procedure. The flight controller receives the updated commands and executes them by adjusting the UAV's control surfaces, as shown in Fig. 1. Based on the analysis of Sect. 2.1, the error function is established. Firstly, the acceleration of gravity and the intensity of the magnetic field in the ground reference coordinate system must be converted to the aircraft-body coordinate frame. This conversion is based on the rotation matrix. Then, the acceleration value and magnetic field intensity measured by accelerometers and magnetometers in the coordinate system are subtracted, so that the error function can be obtained. Acceleration error function defined in Eq. (20): The formula b e q _ denotes the quaternion from the ground reference coordinate system E to the airframe coordinate system B; g _ e is the acceleration of gravity in the ground reference coordinate system, and it should be standardized: is the acceleration value measured by the accelerometer in the airframe coordinate system, which is expressed in Eq. (21): The acceleration error function is shown in Eq. (22): According to the derivation of Eq. (23), its Jacobian matrix can be obtained.
Error function of magnetometer is represented in Eq. (24).
Combined with the above analysis, a differential equation is established by the measured value of the gyroscope, and a set of quaternions has been obtained by solving this equation. Then, the error functions of the accelerometer and magnetometer are recognized. The gradient descent method is used to solve this error function, and a set of quaternions can be obtained. According to the existing Fig. 1 Basic block diagram of complete UAV theories, there are always some errors in the measured values irrespective of the trajectory methods, types of sensors, and hardware used in UAVs. Therefore, it is necessary to fuse these quaternions to get more accurate quaternions, and to get more accurate measurement results. The attitude fusion expression based on the gradient is shown in Eq. (25).
In the above formula: b e q x is the attitude quaternion solved by gyroscope quaternion differential equation; c b e qD k ð Þ is the attitude quaternion solved by gradient descent method; 1 À c ð Þ and c are the weights of two attitude quaternions.
l=T k is set as the convergence rate of c b e qD k ð Þ, and it also represent the measurement error of the gyroscope. Based on the convergence rate and divergence angle of optimal attitude solution, Eqs. (26) and (27) can be obtained.
To ensure the accuracy of the gradient descent technique, it must be ensured that the convergence rate of this method is faster than the moving speed of the object. Once the motion speed of an object is more than the convergence rate of the gradient descent system, the tracking ability will be lost. To ensure that the convergence rate of the gradient descent method is sufficiently large, the step length must be sufficient. If the step length is sufficiently large, then a must be sufficiently large. In this way, if the object moves at a high speed, the algorithm can track it. If a is very large, it will lead to the poor static performance of the system (Roh and Kang 2018). When a is large, l k ð Þ is large in the relevant formula. Therefore, the previous quaternion can be ignored, and it can be simplified as shown in Eq. (28). Similarly, Eq. (29) can be simplified by handling value of a. b e q r k ð Þ ¼ Àl k ð Þ rf rf k k ð28Þ After substituting the values of a in the above formulas, the final attitude fusion equation of the gradient descent method can be obtained as displayed in Eq. (30).
The direction of the magnetic field in the ground coordinate system is constant. The intensity of the magnetic field changes with the change of UAV position in flight. Meanwhile, the strength of the magnetic field in the ground coordinate system is also changing. It is very easy to be disturbed by the environment. In the process of practical application, it is necessary to know the magnetic field intensity in the coordinate systems of ground reference (Giordan et al. 2020;Lin et al. 2017). It is unnecessary to measure directly the magnetic field intensity but to use the magnetometer to measure the magnetic field intensity (Tang et al. 2019). Firstly, it is converted to the coordinate system of the ground reference, and the magnetic field intensity in the coordinate system of ground reference is obtained, and then it is converted to the airframe coordinate system for error correction. If the magnetic field intensity measured by the magnetometer in the coordinate system is The gradient descent function is utilized to process the data speedily, and to obtain the optimal quaternion. Lastly, the two quaternions are fused by a MEMS sensor. Thereafter the measurement results can be obtained by Eq. (33).

Results and analysis
To verify the comprehensive usefulness of the proposed method, a simulation-based experiment has been performed in MATLAB and Simulink. According to the dynamic model of the quadrotor, the disturbance and unmodeled error of the system are estimated in the neighborhood space by the finest characteristics of the Kalman filter. The MATLAB/Simulink is used to evaluate the learning algorithm. The tracking results of the fourrotor unmanned helicopter under various trajectories are given by simulation so that the effectiveness of the proposed algorithm can be evidenced. After finishing the theoretical simulation, an experimental platform for the flight control system of the four-rotor UAV is built. According to the measurement characteristics of the MEMS sensor, the sensor is calibrated to obtain the final experimental results.
(1) Tracking error of UAV trajectory After analyzing the above experimental data as shown in Table 1 and Fig. 2, it can be seen that the tracking error of the UAV trajectory of the proposed method is the lowest as compared to the AGTVF (Air-ground time varying formation) method demonstrated in Zhou et al. (2019) and TTA (Target trajectory algorithm) method demonstrated in Lin et al. (2017). The proposed method can be employed in small drones to get the more accurate trajectory path.
(2) Running time/(min): Based on the simulated experimentation, the running time of three methods has been compared. The comparison results are shown in Table 2. The samples are collected after 100 iterations each. The running time does make sense when trajectory is generated and target has to be achieved along with the handling of huge data generated by the UAV for updating the information. The execution time is measured in minutes.
According to the analysis of experimental data, as shown in Table 2 and Fig. 3, it can be analyzed that the execution time of the measurement methods is changing with the increase in number of samples. The running time of the proposed method is the lowest among the three methods considered for comparative research study. Hence the simulation results prove the efficiency and superiority of the suggested trajectory method.  All the methods consume energy during execution for generating trajectory and for achieving targets. Energy is the foremost factor in UAV-based applications. The UAV can transmit the information until it has reserved energy to perform the tasks. The life of UAV operations depends upon the consumption of energy by UAV during performing the operation. More consumption of energy leads to poor performance of UAV and lower consumption of energy certainly increase the lifespan of UAV operations. Hence, we have tried to reduce computational complexity to reduce the execution time and to increase the energy efficiency of the UAV. The results presented in Fig. 4. reveals that the TTA method outperforms the AGTVF method and our work outperforms TTA method. The standard or minimum energy consumption is also mentioned as benchmark to compare the energy consumed by respective methods considered for the research study.
However, there could be more parameters for comparison of the existing trajectory methods and the proposed trajectory prediction method but we have considered the aforementioned parameters for the comparative study in our research work. It is observed that our suggested trajectory tracking method outperforms other methods with respect to execution time, consumption of energy, and measurement error of trajectory path. In future, we can include more parameters in our research study to check the robustness of our proposed method.

Conclusions
Due to flexibility, good motility, high safety, simple structure, miniaturization, and low-cost, the UAVs are utilized in many applications and the utility of UAVS has attracted the attention of many researchers to perform the research studies in UAVs and aligned areas. The demand for UAVs is increasing for locating the places and objects remotely in defense systems. UAVs can certainly provide information regarding security threats in armed and defense services. In recent years, with the advent of the aerial robots, the advancements in quad-rotor UAV are also arising day by day especially in defense and scientific fields. This paper focuses on four-rotor helicopter trajectory tracking measurement, multi-sensor data fusion method, and data processing method of the sensor to improve the UAV trajectory for quad-rotor-based helicopter. The findings of the proposed research reveal that the proposed technique is more accurate and outperforms the existing techniques. The proposed method has the lowest big data tracking error of the UAV trajectory with 0.09% and has good measurement accuracy, according to the experimental results obtained in simulated environment. The proposed method has the shortest running time of 1.6 min as compared with the two other methods considered for comparative study. The energy consumption of the proposed work is also minimal as compare to other methods. The future work will focus on the development of the hardware platform for flight control systems. It is necessary to use sensors with more precision and better filtering algorithms. Meanwhile, computer vision should also be added to enable the aircraft for identifying the location and altitude more precisely. The path planning of a four-rotor helicopter can also be incorporated, and the proposed method can be paired with the iterative learning methods to improve the UAV's performance.

Declarations
Conflict of interest The authors declare no conflict of interests. Fig. 4 The energy consumption by the proposed and other methods