Development of Steady Aiming System Based on Kalman Filter and Coordinate Transformation

The aiming accuracy of the Unmanned Aerial Vehicles (UAV) Steadicam head can be affected by many factors, such as the state of the UAV during the actual flight and the installation error of the system related hardware. In order to eliminate the influence of objective factors on the UAV Steadicam, a Kalman filter aiming algorithm based on the coordinate transformation method is proposed to eliminate the attitude error of the UAV Steadicam and improve the accuracy of the system. The algorithm uses coordinate transformation to eliminate mounting errors and combines coordinate transformation and Kalman filtering methods to eliminate objective errors of the UAV in flight. The experimental simulation results show that our method can accurately give the amount of azimuth and pitch angle error compensation during the flight of the UAV, improving the accuracy of the UAV Steadicam head. Ultimately, the method is applied to the development of a real product.


I. INTRODUCTION
In recent years, most of the steady aiming systems have been equipped on various types of aircraft, vehicles, ships and mobile vehicles such as satellites [1], [2]. With the continuous innovation and development of modern military equipment and technology, steady aiming system are increasingly used in military operations, for example in the aiming and positioning of missiles and in the real-time tracking and positioning of targets in military operations with land vehicles such as tanks. The accuracy of the Steadicam platform is inextricably linked to the inertial measurement unit (IMU) installed. IMU's include gyroscopes, accelerometers and geomagnetism. These instruments are generally subject to certain installation errors, which can be greater under the influence of external factors, resulting in large deviations in the measurement process and causing inaccurate attitude information during steady state aiming [3].
The associate editor coordinating the review of this manuscript and approving it for publication was Hassan Tariq Chattha .
Currently, steady aiming system and related technologies are widely used in a variety of aerospace equipment, including vehicle-borne, airborne, naval, and bullet-borne [4]. For example, in the area of missile guidance, there are many imaging-guided guidance heads that use gyro-stabilised tracking platforms, such as the US AGM-65, the Russian X-29T, and the Israeli Sudden Eye. In terms of airborne stabilisation control equipment, the most representative is the Israeli ESP-600C unmanned airborne electro-optical reconnaissance platform, which leads the world in the accuracy of azimuthal rotation range, pitch, maximum angular velocity and angular acceleration.
The core technology of a steady aiming system is the estimation of the object's operational attitude and the design of its aiming algorithm. Current mainstream pose estimation methods generally include Kalman filtering, quaternion estimator algorithm, complementary filtering, Mahony and Madgwick algorithms [5], [6]. The Kalman filter is essentially a real time recursive algorithm for noise removal, delay reduction and target position estimation for dynamic target tracking and is highly valued in practical engineering applications because of its simplicity and small memory space requirements [7], [8], [9]. The Kalman filter and its many modifications have been widely used in the study of vehicle parameters and vehicle driving state estimation and is a common and effective estimation tool [10], [11], [12]. Although the Kalman filter is simple and effective, it can suffer from a lack of accuracy. For example, when the motion of the target changes suddenly, the Kalman filter will become less useful [13], [14], [15]. A natural question is: How can other new techniques be combined with the Kalman filter method so that the simplicity and practicality of the algorithm can be guaranteed and its accuracy can be improved? This paper will focus on this problem, and verify that the proposed algorithm is an effective enhancement to the shortcomings of the traditional Kalman filter algorithm through theoretical modeling, simulation experiments and application on the spacecraft Steadicam head.
There have been some results of research on combining Kalman filter methods with other new techniques. For example, in the literature [16], a back propagation neural network based fusion Kalman filtering algorithm is proposed for the real-time position prediction of UAV target tracking, which has higher accuracy and robustness in predicting the target centre position coordinates, and the UAV can stably track the moving targets on the ground. Then, for example, in the literature [17], a high-precision UAV positioning system that integrates an inertial measurement unit and ultra-wideband (UWB) with an adaptive extended Kalman filter (EKF) is proposed to solve the problem of unpredictable propagation conditions and time-varying operating environments, where oscillations in positioning performance caused by changes in measurement noise may lead to instability of the UAV. However, there are not many studies combining Kalman filtering methods with measurement algorithms and other related technologies in UAV Steadicam head. In fact, the errors generated during the measurement process are not only related to the accuracy of the instrument itself, but the accuracy of the measurement algorithm and the completeness of the test method also affect the accuracy of the measurement results to a large extent. One such measurement method is the co-ordinate transformation algorithm, which takes into account the co-ordinate links between different carriers' attitude information and uses a correlation matrix to represent this link and compensate for the errors caused by the installation. There are few reports on the combination of coordinate transformed attitude methods with Kalman filtering methods applied to Steadicam head and their associated software development.
Based on the above discussion, this paper eliminates the installation error by introducing the coordinate transformation algorithm to the input of the Kalman filter, and performs parameter design and simulation experiments based on the proposed algorithm, and finally applies the theoretical study to the actual product development. The next organization of this paper is as follows: in Section II, the Kalman filter stabilization algorithm based on the coordinate transforma-tion technique is proposed, the coordinate transformation algorithm and the Kalman filter algorithm are introduced respectively, and some parameters are set, and the data obtained from the coordinate transformation algorithm is used as the input of the Kalman filter for simulation experiments; in Section III, the simulation experimental results in Section II are firstly compared, analyzed and discussed to verify the feasibility of the proposed In Section III, the simulation results in Section II are compared and discussed to verify the feasibility of the proposed method. Then, the theoretical research results are applied to the actual product development; Section IV concludes the whole paper

II. MODELING
The Kalman filter algorithm, mainly by applying the linear system state equation, with input and output observations, performs optimal predictive estimation of the system state [18], [19], [20]. The optimal prediction estimation of the system state can also be considered as a filtering process because of the influence of system noise and interference in the observation process. The ''system state'' is the set of all inputs to the system in the past, i.e., the optimal estimate obtained in each update and the minimum deviation from the system perturbation. Each update is used as an input to the next Kalman filter, so that the entire behavior of the system can be determined through continuous iterations of updates [21], [22], [23].
From a review of related materials, it is understood that in the context of attitude parameter estimation selection for UAVs, a virtual angular accelerometer (VAA) based on the fusion of four MEMS IMU measurements was designed in the literature [24] by using angular acceleration for estimation and compensation of perturbations. In this paper, on the other hand, from the aspect of eliminating the installation error, i.e., the non-coincidence of body and turntable coordinates due to the installation error, an attitude solving model based on coordinate transformation is developed for this problem, and the attitude information measured by the inertial navigation system is compensated for the error, and the solved attitude information is also measured as the quantity of the filter model. The following is the data model for processing the Kalman filter input parameters.
The two-axis servo turntable and the electro-optical equipment together from the steady aiming system, so the general UAV Steadicam turntable is aligned in real time by controlling the angular movement of two degrees of freedom: azimuth and pitch. There are errors between the airframe and the turntable due to the installation itself, as well as the fact that the turntable is not guaranteed to be stable all the time during the flight of the UAV due to the bumps, making the errors even greater. The attitude information measured by the inertial navigation system cannot be directly applied to the coordinates of the turntable, which is measured here using a micrometer installation. The representation of this relationship matrix is described below, as well as a model for attitude solution based on the corresponding coordinate transformation of this relationship matrix [25], [26].
From the above, it is clear that the coordinate systems we need to use are the geographic coordinate system, the body coordinate system and the turntable coordinate system. The origin of each coordinate system is set as the projection of the turntable center on the ground, the center of the body, and the geometric intersection of the 2 rotation axes of the turntable.
Since the general vector projection between two different rectangular coordinate system has a certain transformation relationship, the transformation relationship is represented by a matrix. Given any vector of geographic coordinate system, the transformation relationship among geographic coordinate system, turntable coordinate system and body coordinate system is established, and then the relation matrix between body coordinate system and turntable coordinate system is obtained. The specific formula is as follows: Transformation relations between vectors in different right-angle coordinate systems: where, α, β and γ are respectively represented as the rotation of α Angle around z axis, β Angle around x axis, and γ Angle around y axis. L (α) , L (β) and L(γ ) are corresponding rotation matrices respectively. Following the principle of which axis the vector rotates around and the coordinates of which axis remain unchanged, there are the following rotation matrices: The conversion relationship between the geographical coordinate system, the turntable coordinate system and the body coordinate system is as follows: In Fig.1, L 1 , L 2 and L 3 represent the relationship matrices for the conversion between the three attitudes respectively.
Where matrix L 1 represents a relationship matrix for the conversion from geographical coordinates to the body coordinates; L 2 represents a relationship matrix for the conversion from geographical coordinates to turntable coordinates; and L 3 represents a relationship matrix for the conversion from the body coordinates to turntable coordinates.
It is also clear from Fig.1 that given a geographic coordinate system, the relationship between the body coordinates and the turntable coordinates can be calculated by taking any geographic coordinate vector as η 0 = x 0 y 0 z 0 T , setting the body coordinates as η 1 = x 1 y 1 z 1 T and the turntable coordinates as η 2 = x 2 y 2 z 2 T , then there is the following relationship between the turntable coordinates and the body coordinates: It can be obtained from Fig.1: According to (5), (6) and E (7), it can be obtained: namely: namely: L 3 in the above equation represents a relationship matrix for the non-coincidence of the body coordinates and the turntable coordinates due to the installation error, i.e. the relationship between the body coordinates and the turntable coordinates can be found as long as the information about them is known.
Then, the relation between geographic coordinates and turntable coordinates can be obtained as: where L 3 is denoted as:

III. MAIN RESULT A. COORDINATE TRANSFORMATION ALGORITHM
With the above matrix representation of body coordinates and turntable coordinates, a coordinate transformation algorithm based on this matrix representation is introduced here. Through the above, it can be seen that the attitude information of the airframe is measured by the inertial navigation system as L 1 (α 1 , β 1 , γ 1 ), where α 1 , β 1 , γ 1 are the yaw angle, 63786 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.
pitch angle and roll angle respectively, then it can be obtained from (1): namely: From (11), (12) can be obtained in order to eliminate the installation error, so that the stability of the rotary table and calculate the need to turn to the angle α r and β r , the specific calculation steps are as follows.
According to (11) and (12), angles α r and β r needed to be turned can be calculated in order to eliminate installation errors and make the turntable stable. The specific calculation steps are as follows.
Azimuth Angle α 0 and pitch Angle β 0 are used to define a unit vector I 0 in the geographic coordinates system: The projection of vector I 0 in the body coordinate system is: The projection of vector I 0 in the turntable coordinate system is: According to (11), (12), and simultaneous (16), (17), it can be obtained: According to (18) and the basic theory of trigonometric functions in spatial coordinates, the azimuthal angle, and the pitch angle, can be obtained as shown in (19) below: In this way, under the unit vector I 0 , when the body attitude information is L 1 (α 1 , β 1 , γ 1 ), the azimuth and pitch angles of the turntable need to be turned to α r angle and β r angle, respectively, to eliminate the error caused by the installation and make the attitude information used for turntable control more accurate.
The attitude information for turntable control obtained by eliminating installation errors is taken as the input of Kalman filter parameters. Here, the errors of each attitude Angle are introduced as the deviation of prediction state, which is called Gaussian noise deviation, denoted by W , also known as mean white noise.
At this point, the equation of state can be set as: where U is the current state of control, which we won't discuss here, set to 0; A and B are system parameter matrices; X is the predicted value of the system state, X is the predicted value of the current state, where: with W is process noise, and each element can be regarded as zero-mean white noise during simulation, so the final state equation is:

B. THE OBSERVATION EQUATION
The attitude information of the airframe measured by the inertial navigation system carried by the UAV is taken and used directly for the control of the turntable as the input of the observation parameters. However, considering that the UAV does not guarantee that the coordinates of the airframe will not change slightly at each brief moment during targeting and positioning, it is necessary to introduce a bias to offset this change, which is called Gaussian noise bias, denoted by V . This error is also called observation noise, which can be initially considered as zero. The observed value after the introduction of the error is used as an observed parameter input to the final Kalman filtering algorithm.
To sum up, the observation equation can be obtained as: where H is the measurement system parameter, here is the observation matrix, V is the measurement noise, Z is the observation value of the current system, where Z = α ′ β ′ γ ′ T . V is observation noise, and each element can be regarded as zero-mean white noise during simulation.

C. KALMAN FILTERING ALGORITHM
Discretization of the above established equation of state and observation equation can be obtained [27]: where, X k is the system state vector at k moment, X k−1 is the optimal value of the system state vector obtained at the last moment; k,k−1 is the system transition matrix, k−1 is the system noise matrix; Z k is the measured value at time k, and H k is the measurement matrix; W k−1 and V k represent the process noise and measurement noise respectively, that is, the zero-mean measurement white noise vector of the discretized system. X k , W k−1 , and V k are unrelated. Then, the basic equation of uncontrolled discrete Kalman filter is as follows: • One-step prediction equation of state: • One-step prediction of mean square error: • Filter gain equation (weight): • Filter estimation equation (K time optimal value): • Mean square error update matrix(K time optimal mean square error):

A. SIMULATION
In the UAV Steadicam head, due to a variety of factors such as the bumpiness of the body caused by weather changes during the flight of the UAV, and the error of the installation instrument and other factors, it will cause the body and the coordinates of the turntable not to overlap and not to complete the control of the turntable accurately, and its main influencing factor is the selection of attitude information for the turntable control. In order to verify the effectiveness of the above proposed algorithm, it is assumed that two attitude parameters are set as the input to the Kalman filter for a given system state. One is to not apply the algorithm of coordinate transformation mentioned above, i.e., the body attitude information is directly used for the control of the turntable as the input of the Kalman filter. The other one is to apply the coordinate transformation algorithm mentioned above to eliminate the error of the airframe attitude information, and the final solved attitude information is used as the input of Kalman filter.To make the research in this paper more convincing, the article simulates the variation of pitch and azimuth angles in the attitude angle of the UAV in a weak wind as well as in a strengthened wind environment, respectively.
Finally, the Kalman filter for this Steadicam head is simulated using MATLAB. The prediction estimation of the optimal attitude angle based on the elimination of the attitude angle error and the estimation of the optimal deviation value between the optimal attitude angle and the observed value are performed, and the simulation results are used to analyze whether the algorithm meets the requirements.
In this paper, several groups of parameters were designed through univariate analysis to simulate the above model. The specific design parameters are shown in Table 1:

1) SIMULATION OF A UAV IN A WEAK WIND
It is assumed that the initial estimate of the turntable coordinates in the above system state is the attitude information obtained after error compensation by the coordinate transformation algorithm after simulating the UAV flight process affected by a weak wind. However, for a real control system, it is not a strictly linear time-varying system, which leads to some deviation in the estimated state values. Therefore the  key values P, Q, R are introduced here. P is the initial value of the error covariance, which affects the initial convergence rate, the smaller the P, the more confidence in the current state, so set to P = 1; Q is the process variance, which reflects the angular variance of two consecutive moments, the smaller the Q, the easier the system converges, so set to Q = 1e−4; R is the measurement variance, which reflects the measurement accuracy of the inertial navigation system; if R is set too large, the Kalman filter response becomes slower, so it is set to R = 0.09.
The simulation results for the optimal attitude angles, i.e. azimuth and pitch, are shown below: As can be seen from Fig.2-5, the true attitude angle of the UAV in its original flight state is (120 • , 60 • , 80 • ), when encountering weak winds, the state of the UAV suddenly changes, resulting in a certain deviation in its attitude angle, i.e. (118 • , 63 • , 80 • ), so the amount of error compensation   needed for azimuth and pitch angle in an ideal state should be around and, but the error compensation obtained by the traditional Kalman algorithm is and, it can be seen that when  stored without considering When the installation error is not considered, the traditional Kalman filtering algorithm becomes less useful and does not provide an accurate error compensation due to the sudden change of the target state caused by the external environment, and the error compensation obtained is much smaller than the actual error compensation required.
Under the same conditions, the initial estimate of the coordinates of the turntable is obtained by using the coordinate transformation method to eliminate installation errors (120.2 • , 60.1 • , 80 • ), then the simulation results for the optimal attitude angles, i.e. azimuth and pitch, are shown in the following figures: As can be seen from Fig.6-9, it can be seen that the error compensation of azimuth and pitch angles should be 0.2 • and 0.1 • under ideal conditions, and the simulation results show that the error compensation obtained by the Kalman Filter algorithm with coordinate transformation is 0.165 • and 0.083 • , which is close to the expected error  compensation value and can solve the shortcomings of the traditional Kalman Filter algorithm very well.

2) SIMULATION OF A UAV IN A STRONG WIND
In order to make the experimental results more convincing, the target state is abruptly changed by simulating a change in the external environment, i.e. an increase in wind, i.e. strong wind, under the same conditions. The simulation results for the optimum attitude angles, i.e. azimuth and pitch, in the case of strong winds are then shown in the following figures: As can be seen from Fig.10-13, without considering the elimination of installation errors, the flight state of the UAV changes abruptly when the wind is simulated to increase, and the attitude angle produces a larger deviation into (116 • , 66 • , 80 • ), so the amount of error compensation required for azimuth and pitch angles in the ideal state is 4 • and 6 • around, as shown by simulation experiments, the error compensation obtained by the traditional Kalman algorithm is 0.015 • and 0.008 • , which is still far less than the expected The values. Therefore, it can be found that the traditional     Under the same conditions, the installation error is eliminated by means of a coordinate transformation, at which point the initial estimate of the turntable coordinates (120.5 • , 60.4 • , 80 • ) based on the coordinate transformation is obtained, and the simulation results for the optimal attitude angles, i.e. azimuth and pitch, are shown in the following figures: As can be seen from Fig.14-17, it can be seen that the error compensation for azimuth and pitch angles required by the co-ordinate transformed attitude angles in ideal conditions is around 0.5 • and 0.4 • , and the simulation results show that the error compensation obtained by the co-ordinate transformed Kalman filter algorithm is 0.455 • and 0.357 • , which is also close to the expected error values. It can be found that the Kalman Filter algorithm based on the coordinate transformation can still provide accurate error compensation when the wind environment is enhanced, which also proves that the research method of this paper is more effective than the traditional Kalman Filter algorithm.

B. DISCUSSION
The comparative graphs of the experimental simulation results in Section II above lead to the following table of simulation results: As shown in Table 2, within a targeting time period of 60s, when the effects of error are not taken into account, the measured optimal estimates of attitude angle are close to coincident with the true values (i.e. those measured directly by the inertial navigation system before the Kalman Filter input) most of the time, i.e. the error compensation of the resulting azimuth and pitch angles is very small when the external environment is influenced by weak or strong winds, i.e. 0.003 • and 0.005 • in the case of weak winds and 0.015 • and 0.008 • in the case of strong winds. As discussed at the beginning of our paper, the values measured directly by the inertial navigation system are subject to errors and cannot be used directly for control of the turn table, so the calculated optimal estimates almost coincide with the true values and do  not match the ideal state; when the coordinate transformation algorithm is used to consider eliminating the effects of errors, also under the influence of external environments such as weak or strong winds, it is found that the measured optimal estimates of attitude angle and the true The error compensation of the obtained azimuth and pitch angles is 0.165 • and 0.083 • in the case of weak wind and 0.455 • and 0.357 • in the case of strong wind, which is the error compensation for the attitude angle in our designed algorithm and coincides with the above mentioned non-coincidence between the ideal attitude information and the actual measured attitude information of the airframe. Therefore, the above simulation results also verify that the research method in this paper overcomes the shortcomings of the traditional Kalman Filter algorithm and is more accurate and effective than the traditional Kalman Filter algorithm in compensating for the errors in azimuth and pitch angles when the UAV is affected by the external environment and undergoes sudden changes in state during flight.  Through the above theoretical research, practical products can be developed to eliminate installation errors and facilitate the acquisition of more accurate attitude positioning information, as shown in Fig.18 and Fig.19 below.

V. CONCLUSION
In the UAV Steadicam head, the basic problem of precise control of the turntable is not achieved due to the influence of the weather and installation errors during the flight of the UAV, the Kalman filter algorithm is currently one of the most mainstream algorithms used for attitude estimation, however, the biggest problem of using this method is the lack of accuracy, so this paper proposes a Kalman filter stabilization algorithm based on the coordinate transformation method, this algorithm combines the coordinate transformation and Kalman filter algorithm together, so that the practicality and accuracy of the algorithm can be effectively improved. Algorithms based on coordinate transformations are used to eliminate the effects of mounting errors. The calculated attitude information is then used as attitude parameters for the input of Kalman filter to achieve more accurate prediction estimates. Experimental simulations show that the attitude information obtained from the attitude solution model based on a coordinate transformation is used as the input parameter of the Kalman filter to achieve more accurate turntable control, improve steady-state accuracy, and verify the reliability of the proposed method. Finally, it can be applied to the actual product development. This paper focuses on the design and analysis of a steady aiming algorithm to improve the aiming accuracy of the UAV by performing an azimuth and pitch angle error compensation for the rotational motion of the UAV. In future research work, we will also take into account the translational motion of the UAV and develop a more optimal algorithm design for the UAV's Steadicam head in all aspects.
LISHA MENG received the bachelor's degree in information and computing science from the Weifang College, in 2016. She is currently pursuing the master's degree in computer science and technology with the Guilin University of Technology. She is also a Research Student with the Guilin University of Technology. Her current research interests include computation, modeling, and simulation.
HAIHUA TANG received the master's degree in optical engineering from the University of Electronic Science and Technology of China in 2016. He has worked in software development and data analysis at Tencent Technology (Shenzhen) Company. Currently, he is responsible for teaching and research in the School of Information Science and Engineering at Guilin University of Technology. His research interests include computer application and software, machine learning, control, optical communication, and integrated optics.
LEI SHI received the B.S. and M.S. degrees in mathematics from Yunnan University, Kunming, China, in 2007 and 2010, respectively, and the Ph.D. degree in mathematics from the Nanjing University of Aeronautics and Astronautics, Nanjing, China, in 2020. He is currently a Lecturer with the School of Science, Guilin University of Technology, Guilin, China. His current research interests include chaos synchronization, discontinuous dynamical systems, neural networks, epidemic dynamics, and biomathematics.