METHODS OF PREDICTING THE HEADING, PITCH AND ROLL ANGLES FOR AN UNMANNED AERIAL VEHICLE

The article discusses handicaps in predicting values of rotation angles with regard to Heading, Pitch and Roll for an Unmanned Aerial Vehicle. Within the simulation of the rotation angle values, the linear, polynomial and logarithmic methods were used. The programme source code was written in the numerical editor Scilab 5.4.1. The source data for investigation were recorded by a measuring device Trimble UX-5. The article provides results of comparing the real values of Heading, Pitch and Roll rotation angles to findings obtained from the prediction methods. Based on the conducted research, it was found that the largest value of standard deviation parameter in prediction of the rotation angles is for the angle of Heading, as it equals approximately 5 o , whereas the smallest ones are for the Roll and Pitch angles, equalling less than 1.4o.

flight stage of an aircraft, exploiting available numerical tools and mathematical algorithms.
The primary objective of this article is a possibility for presenting the methods of prediction of the HPR angles, as well as a verification of their results in comparison to the actual data, registered by an UAV. For this purpose, real readings of the HPR angles from the Trimble 5 platform were taken. In the simulation calculations, three methods of predicting the HPR values were used, i.e. the method of linear regression, the polynomial method and the logarithmic method.

Methods of research
In the framework of simulation of predicting the rotation angles, i.e. Heading, Pitch and Roll, three test methods were exploited, i.e.: • the linear regression method, • the polynomial method, • the logarithmic method.
The model of linear regression is described by dependence [5]: where: Y -stands for the value of the Heading, Pitch or Roll rotation angle, a -is a determined linear coefficient, X -indicates the number of the next measurement epoch, b -is a determined linear coefficient.

Introduction
A fundamental navigation aspect in the Unmanned Aerial Vehicle (UAV) technology is determination of coordinates and orientation angles in airspace. In the case of determining the UAV coordinates, the preferred method of positioning is the GNSS satellite technology [1], using code observations on the L1 frequency [2]. However, the UAV orientation during a flight mostly relies on readings from the IMU device, being part of the INS sensor. The IMU device has in-built accelerometers (to determine the aircraft acceleration along the three axes of the reference system) and gyroscopes (to determine three angles of rotation). Ultimately, the INS system provides six degrees of freedom within the navigational designation of the user's position with an integration based on GPS/INS data [3]. The Heading, Pitch, Roll (HPR) rotation angles refer to the internal aircraft system, representing the UAV turn, bank and rotation [4]. An important element in determining the HPR angles of rotation is also a simulation of predicting the UAV in-flight space orientation. This issue is crucial as it allows specifying the HPR angular values for an UAV in the following cases: • an entire loss of data from an UAV, • loss of UAV control due to mechanical damage or forces of Nature, • failure of a data link from an UAV to the flight operator, • loss of visual contact with an UAV.
The fundamental task of the user, when taking an advantage of the mechanisms of an UAV orientation prediction, is to restore, as closely as possible, the missing f -is a determined linear coefficient, X -indicates the number of the next measurement epoch, g -is a determined linear coefficient. The mathematical Equations (1), (2) and (3) are solved using the least squares method, as below [8]: where: A -matrix of partial derivatives, d q-designated parameters, l -vector of observation, v -residuals vector, The polynomial model is expressed by equation [6]: where: Y-stands for the value of the Heading, Pitch or Roll rotation angle, c -is a determined linear coefficient, X -indicates the number of the next measurement epoch, d and e are determined linear coefficients. The logarithmic model is expressed by formula [7]: where: Y-stands for the value of the Heading, Pitch or Roll rotation angle, recorded by the sensor Trimble UX-5 in a universal text format "log" [9]. The first stage of the experiment was to determine linear coefficients from Equations (1) to (3) for each HPR angle. The sought parameters from Equations (1) to (3) were determined based on the readings from 40 measurement epochs (epochs 1 to 40). The values of linear coefficients from Equations (1) to (3) are shown in Tables 1, 2 and 3. Furthermore, those Tables present the value of standard deviation of m 0 for each HPR angle and each test method. In all the cases, values of the m 0 parameter do not exceed 2 0 , which constitutes a boundary value of accuracy for the HPR angles from the metric of the Trimble UX-5 instrument. The largest values of the m 0 parameter occur for the Roll angle, being equal to approximately 1.5 0 and the lowest for the Pitch angle, being equal to approximately 1 0 .

Discussion
Within the discussion, the authors focused on the problem of extrapolation of the HPR angles' values. To N -matrix of a set of normal equations, L -vector of free terms, m 0 -standard deviation of residuals, n -number of measurements, k -number of designated parameters.
The mathematical model from Equation (4) is used for numerical calculations separately for each test method and independently of each HPR angle.

Research test and results
The scientific experiment was carried out for real data obtained from the Trimble 5-UX device. For the experiment, the authors selected 80 exemplary measurement periods, for which the sensor Trimble UX-5-determined the position, flight altitude and the HPR values. Figures 1 and 2 illustrate the horizontal coordinates and the UAV flight altitude, respectively. The UAV coordinates were determined by using the C/A code observations on the L1 frequency in the GPS system and were updated every 10 Hz. The UAV coordinates are referenced to the geodetic BLh frame and   The predicted values of the HPR angles are compared to the real readings of the orientation angles from the sensor Trimble UX-5 on the basis of the following dependence [9]: where: dH -difference between the extrapolated value from a given test method and the real value of the Heading angle from the Trimble UX-5 sensor, R pred -extrapolated value of the Heading angle based on Equations (5), (6) and (7), P real -recorded value of the Heading angle from the UAV device, nr -number of measurements, nr = 40, m H -the error associated with the extrapolation of results signifies the matching error of predicted results of the Heading angle with respect to the actual values from the sensor Trimble UX-5. dP -difference between the extrapolated value from a given test method and a real value of the Pitch angle from the Trimble UX-5 sensor, R pred -extrapolated value of the Pitch angle based on Equations (5), (6) and (7), P real -recorded value of the Pitch angle from the UAV device, m p -the error associated with the extrapolation of results signifies the matching error of predicted results of the Pitch angle with respect to the actual values from the sensor Trimble UX-5, this end, prediction of values of the HPR angles for the measurement epochs 41-80 was made. New values of the HPR angles for the prediction phase were specified based on the functional relationships.
• the linear regression method, where: Y-stands for the extrapolated value of the angle of rotation Heading, Pitch or Roll value for epochs 41 -80, f -linear coefficient determined for epochs 1-40, X pred -number of measurement epoch from 41 to 80, g -linear coefficient determined for epochs 1-40. dR -difference between the extrapolated value from a given test method and the real value of the Heading angle from the Trimble UX-5 sensor, R pred -extrapolated value of the Roll angle based on Equations (5), (6) and (7), P real -recorded value of the Roll angle from the UAV device, m R -the error associated with the extrapolation of results signifies the matching error of predicted results of the Roll angle with respect to the actual values from the sensor Trimble UX-5. Figure 3 shows the dH parameter values for the Heading angle based on Equation (8). Values of the dH parameter were determined for the linear regression method, the polynomial method and the logarithmic trend. In the linear regression model, the average value of the dH parameter is to reference results, the accuracy of Roll angle equals to 2 o and for Pitch angle more than 8 o , respectively. In addition, in paper [13], the MPC method was used in Ariel UAV model in Matlab Simulink environment. The algorithm is focused on differential equation for controlling the UAV dynamics. The paper presents good convergence between predicted and real time data, with difference less than 0.5 o for the HPR angles. In next article [14], the authors presented results of research for determination of the HPR angles in the prediction model. In that case, the Extended Kalman Filters based on GPS/INS fusion data was applied for prediction the HPR angles for UAV. The accuracy of presented method is about ±2 o . In paper [15], the authors presented different scenarios for simulating the HPR angles, especially, the data from gyroscope model, accelerometer model, as well as magnetometers were utilized in simulation of the HPR angles. The maximum orientation error of the Heading angle has reached up to ±30 o , whereas for Pitch and Roll it was close to ±10 o . The obtained results of comparison of HPR predicted values are better than results in papers [10] and [15]. In addition, the simulated values of the HPR angles (e.g. especially for the Roll and Pitch angles) are close to results included in papers [11] and [14]. Moreover, the obtained values of standard deviation of the HPR angles are lower than values in paper [12]. Only results from the MPC method from paper [13] are better than presented values of the HPR angles in this article. Finally, the presented method of estimation of the HPR angles is a good and correct solution for prediction model of the UAV orientation.

Conclusions
In paper, the scientific problem of comparison between simulated and real data of the HPR angles of a UAV was presented. Especially the scientific problem should be developed when the UAV object or navigational data from the UAV from flight mission would be lost. For that reason three scientific methods for recovery of the UAV orientation were applied in this paper, i.e. the method of linear regression, the model of the 2nd degree polynomial and the logarithmic trend.
For each test method, the values of the HPR angles were determined at the prediction stage and compared to the actual readings of the rotation angles from the device Trimble UX-5. The experimental test was performed for exemplary results of the HPR rotation angles from 80 measurement epochs. Based on the obtained findings, the following conclusions were formulated for accuracy of each research method: 1) the standard deviation term of linear regression method for the HPR angles is less than 1.4 o ; 2) the standard deviation of the 2 nd degree polynomial method for the HPR angles is less than 5 o ; 3) the standard deviation of logarithmic method for the HPR angles is less than 1.4 o . Figure 4 shows the dP parameter values for the Pitch angle based on Equation (8). Values of the dP parameter were determined for the linear regression method, the polynomial method and the logarithmic trend. In the linear regression model, the average value of the dP parameter equals 1.  In References there are many different algorithms for solving the problem of predication of the HPR angles values. For example, in paper [10] the author proposed to prediction of HPR angles in the two mathematical functions: polynomial and trigonometric. The maximum range between the real and predicted data of the HPR angles is close to ±23 o . In another paper [11], the authors present the Newton Euler's mathematical model for controlled the UAV position. The maximum difference between the real and model data of the HPR angles reaches up ±2-3 o . In the next paper [12], the authors described the MPC (Model Predictive Control) algorithm for quadrotor Unmanned Aerial Vehicle motion. In the research test, the Roll and Pitch angles were estimated in computer simulation. Based on comparison