Pointing-Error Correction of Optical Communication Terminals on Motion Platforms Based on a K-Nearest Neighbor Algorithm

High-precision pointing is a key technology in free-space optical communication, as it improves the acquisition probability and reduces the acquisition time. High-precision pointing of an optical communication terminal (OCT) on a motion platform is particularly important for establishing a global communication network. An OCT on a motion platform is subjected to both linear and nonlinear pointing errors. The present paper analyzes both types of pointing errors in detail. Linear pointing errors can be well corrected by the parameter model. This paper proposes a K-nearest neighbor (KNN) algorithm that corrects nonlinear pointing errors and verifies its effectiveness through tracking star experiments. After correcting the nonlinear pointing errors through KNN algorithm, the modified and actual open-loop pointing errors were 69.0 and 70.8 μrad, respectively, reduced from 87.3 and 91.9 μrad, respectively, in the parameter model. Thus, the proposed KNN algorithm can effectively improve the pointing accuracy of an OCT on a motion platform.

a communication link. High-precision pointing is important for improving the acquisition probability and reducing the acquisition time. Especially in long-distance point-to-point laser communications, extremely narrow laser beams require highprecision pointing. Applications of FSO communication on motion platforms are increasing alongside the establishment of global communication networks. Therefore, the high-precision pointing of an optical communication terminal (OCT) on a motion platform has become increasingly important. However, manufacturing and assembly errors leading to pointing errors are inevitable in OCTs. The pointing accuracy can be improved with high-precision mechanical structures, but this option is expensive. Algorithms that compensate for the pointing errors of OCTs on motion platforms are the most cost-effective solutions.
The pointing error sources of an OCT on a motion platform are similar to those on a fixed platform. The most important sources of pointing errors are linear error sources, which include geometric errors in the OCT and installation errors between the OCT and the attitude sensor. The pointing errors caused by linear error sources are called linear pointing errors. Geometric errors have been intensively studied in alt-az telescopes. Using the Denavit-Hartenberg (D-H) convention, Meeks [1] established a mount model for the correction of geometric errors. He et al. [2] used the mount model to compensate the geometric errors of a telescope in satellite-ground quantum experiments, and achieved a good correction result. Luck [3] studied the stability of the mount model. Fisk et al. [4] addressed the geometric errors of a gimbaled pointing system using a physical mathematical model. Based on geometric error research, He et al. [5] and Peng et al. [6] analyzed simultaneous geometric errors and installation errors, and established a model that corrects linear pointing errors of OCTs on motion platforms.
After correcting the linear pointing errors of an OCT on a motion platform, many pointing residuals remain. These residuals are considered as nonlinear pointing errors caused by nonlinear error sources. The nonlinear error sources consist mainly of random errors in the attitude measurements, linear approximation errors, and errors of unknown origin. To correct random errors in the attitude measurements, most researchers apply an integrated navigation system that improves the accuracy of attitude measurements. Shim et al. [7], Epple [8], and Wu et al. [9] used a global positioning system (GPS) and a strap-down inertial navigation system (INS) as an integrated navigation system for high-precision attitude measurement and initial pointing. The mechanism of other nonlinear error sources is unclear and such errors are difficult to correct.
Some scholars have attempted to correct the nonlinear pointing errors in alt-az telescopes. Huang et al. [10] eliminated the geometric and nonlinear errors in alt-az telescopes using a semiparametric regression model based on penalized least squares estimation. Yan et al. [11] corrected the nonlinear pointing errors of alt-az telescopes using the Allan variance method. However, the nonlinear pointing errors of OCTs on motion platforms are rarely studied. In this paper, the linear pointing errors of OCTs on motion platforms are corrected using a parameter model. Next, the residual nonlinear pointing errors are corrected using a KNN algorithm. The KNN algorithm is an important nonparametric machine-learning method for classification and regression [12]. Owing to its simplicity, effectiveness and intuitiveness [13], the KNN algorithm has been widely used in many fields such as pattern classification [14], feature selection [15], and outlier detection [16]. When implemented in tracking star experiments, the KNN algorithm effectively corrected the nonlinear pointing errors and stably improved the pointing accuracy of an OCT on a motion platform. Fig. 1 shows the structure of an OCT [10]. In an ideal OCT, the azimuth axis is orthogonal to the elevation axis, which is itself orthogonal to the line of sight (LOS). After simply calculating the guide values of the azimuth and elevation axes, the LOS of an ideal OCT can be driven to accurately point to the target. However, due to manufacturing and assembly errors, the structure of an OCT is non-ideal and the guide values calculated by the ideal method cannot accurately point the LOS toward the target. The pointing error is defined as the difference between the actual and ideal directions. The pointing errors of the azimuth and elevation axes are denoted by ΔA and ΔE, respectively ( Fig. 2 [10]), and are respectively calculated as

II. POINTING ERROR DEFINITION AND ERROR SOURCE ANALYSIS
where A and E are the encoder measurement values of the azimuth and elevation axes, respectively, when accurately pointing to the target. Usually, accurate pointing is considered achieved when a camera images the target at the center.Â andÊ are the guide values for the azimuth and elevation axes, respectively. To more accurately guide the OCT to the target and reduce the pointing errors, we must first analyze various pointing error sources and then compensate for the pointing errors and improve the accuracy of the guide values. An OCT on a motion platform is affected by many pointing error sources, both linear and nonlinear. The linear error sources dominate and mainly include geometric errors in the OCT and installation errors between the OCT and attitude sensor. The nonlinear error sources are subordinate and mainly include random errors in the attitude measurements, linear approximation errors, and errors from unknown sources. Geometric errors include non-orthogonality of the azimuth and elevation axes, azimuth and elevation bearing errors, azimuth and elevation encoder errors, misalignment of the optical axis, and tube flexure [6]. The azimuth and elevation encoder errors cause inaccurate measurements of the rotation angles of the azimuth and elevation axes. Other geometric errors are frame structure errors, which cause misalignments of the three axes of the OCT from their ideal positions. Installation errors cause deviations of the attitude sensor coordinate system from the ideal OCT three-axis coordinate system. Random errors in attitude measurements are introduced by sensor noise. The linear error sources are modeled using the small-angle approximations sin Δ ≈ Δ, cos Δ ≈ 1 and Δ · Δ ≈ 0, where Δ is the error angle. Errors caused by this approximation are called linear approximation errors. The remaining unknown errors cannot be described.
The pointing errors caused by linear and nonlinear error sources are called linear pointing errors and nonlinear pointing errors, respectively. Both error types must be well corrected for high-precision pointing. Linear pointing errors can be accurately represented by functions and can be well corrected by a parameter model. Nonlinear pointing errors cannot be accurately represented by functions and are usually corrected using nonparametric methods.

III. CORRECTION OF LINEAR POINTING ERRORS
The D-H convention [1] is the most commonly used method for error source modeling. Peng et al. [6] modeled the influence of each error source on pointing as a rotation matrix through the D-H convention. Applying small-angle approximations, they finally established a parameter model for linear pointing-error correction of an OCT on a motion platform. In the present paper, the parameter model is reorganized as follows [6]: In (2), A e and E e are the azimuth and elevation angles of the target in the Northeast celestial coordinate system, respectively. R, P and H are the roll, pitch and yaw angles of the OCT measured by the attitude sensor, respectively. (x c , y c , z c ) T is the unit direction vector of the target in the attitude sensor coordinate system. In (3), A c and E c are the azimuth and elevation angles, respectively, of the target in the attitude sensor coordinate system and are also the ideal guide values without considering the error sources. In (4), ΔA c and ΔE c are compensation terms for the pointing errors of the azimuth and elevation axes, respectively. p = (p 1 , p 2 , . . . , p 19 ) is the parameter vector related to the error angles of the error sources. In (5),Â L andÊ L are the guide values for the azimuth and elevation axes, respectively, estimated by the parameter model.
Equation (3) is a general formula for calculating A c . The value of A c ultimately depends on the quadrant of the coordinate point. In practical applications, since the parameter vector p is unknown, we need to first obtain the pointing errors of multiple stars by tracking and measuring the stars, then estimate the parameter vector p using the least squares method to obtain an accurate parameter model. Finally, we correct the linear pointing errors using the parameter model to obtain the guide values of the target.

A. Introduction of the KNN Algorithm
The parameter model corrects the linear pointing errors but does not remove the large nonlinear pointing errorsÂ L − A and E L − E. Here we propose a KNN algorithm that corrects the nonlinear pointing errors.
The KNN algorithm is a simple and effective nonparametric method that avoids complex physical modeling. Frequently used in classification and regression of multidimensional data, the KNN algorithm uses the nearest k known samples as the nearest neighbors to estimate the test sample. Fig. 3 shows an example of the KNN algorithm. In this example, the KNN algorithm selects the nearest five known samples as the nearest neighbors when estimating the test sample.
The KNN algorithm can be well applied to the correction of nonlinear pointing errors of OCTs on motion platforms. The nonlinear pointing errors of multiple stars are taken as the values of the known samples (in this case, the stars), and the target is taken as the test sample. The nonlinear pointing errors of the target are the values of the test samples to be estimated. The KNN algorithm corrects the nonlinear pointing errors through three main steps: distance measurement, weight calculation, and test sample estimation.

B. Distance Measurement
First we must determine the distance measurement method in the KNN algorithm. Our KNN algorithm adopts the Euclidean distance of the angle as the distance between two samples. In the attitude sensor coordinate system, let the azimuth and elevation angles of P 1 be A c1 and E c1 , respectively, and those of P 2 be A c2 and E c2 , respectively. The distance between points P 1 and P 2 is calculated as where

C. Weight Calculation and Test Sample Estimation
The weight is distance-dependent. First, the distances between the test sample and all known samples are calculated in the attitude sensor coordinate system using (6). The nearest k known samples are then selected as the nearest neighbor samples. The distances between the k nearest neighbor samples and the test sample are recorded as d 1 , d 2 · · · d k in ascending order and the corresponding values of the nearest neighbor samples are recorded as y 1 , y 2 · · · y k . The weight W Ti of each neighbor sample is then computed as a Gaussian-like function of distance: The distance-weighted KNN algorithm is widely used in classification and regression problems [17], [18]. The weight function is usually a decreasing function of distance; that is, a more distant sample from the test sample is assigned a smaller weight. (7) satisfies this property.
Next, the weight W Ti is normalized as follows to give a normalized weight w i : Finally, the estimated valueŷ of the test sample is obtained in terms of the normalized weight w i :

D. Determination of the k Value
The KNN algorithm requires only one parameter, k. A generalized cross validation (GCV) [19] method is applied to determine the parameter k. GCV is commonly used for determining the parameters of nonparametric estimation based on the known samples. The GCV method determines the k value by the following process.
Given n known samples with values y ti , these samples are self-estimated using the KNN algorithm. The estimated valuê y ti of each known sample is determined aŝ where y ij and w ij are the value and normalized weight, respectively, of the j-th nearest neighbor sample of the i-th known sample. As the nearest neighbor samples of each known sample are ordered by distance, the first nearest neighbor sample of a known sample is the known sample itself, with a normalized weight of w i1 . The GCV value GCV(k) is then defined as Next, the k is appropriately selected to minimize the value of GCV(k) as follows: where k select is the finally determined value of k.
In practical applications, the k values of the azimuth and elevation samples are first calculated by the GCV method. The nonlinear azimuth and elevation pointing errors are then respectively corrected with the KNN algorithm.

V. EXPERIMENT AND RESULTS
The effectiveness of the KNN algorithm for correcting the nonlinear pointing errors was verified in a specially designed OCT system (Fig. 4). The OCT system has star-tracking and data-recording functions and is equipped with a GPS/INS integrated navigation system for attitude measurements. The errors in the yaw, pitch, and roll angles of the GPS/INS system are 0.18 mrad (1σ), 0.09 mrad (1σ), and 0.09 mrad (1σ), respectively.
The algorithm was tested in a tracking star experiment. Initially, the OCT system was placed on a slope and rotated to change its attitude to simulate a motion platform. The OCT system then tracked and measured a large number of stars at different attitudes. These stars were used to calibrate the parameter model; therefore, they were called calibration stars. The calibration stars were also known samples for the KNN  algorithm. When the camera imaged a calibration star at the center, the OCT system automatically recorded the encoder values (A, E), the position angles of the star in the Northeast celestial coordinate system (A e , E e ), and the attitudes of the device (H, P, R). Fig. 5 is the polar diagram of the calibration stars in the INS coordinate system. As the KNN algorithm is based on nearest neighbors, the distribution density of the calibration stars in the INS coordinate system should be large and uniform to ensure sufficient neighbors for an estimated sample. The initial pointing error of the calibration stars before correction and the modified pointing error of the calibration stars after correction by the parameter model were calculated from the measured data, as shown in Figs. 6 and 7, respectively. The total pointing error δ total in the experimental results was calculated as  where δ azimuth (root mean square error, RMSE) is the azimuth pointing error and δ elevation (RMSE) is the elevation pointing error.
After correction by the parameter model, the k values of the azimuth and elevation samples were calculated by the GCV method, and the modified pointing error of the calibration stars after further correction by the KNN algorithm was obtained, as shown in Fig. 8.
Finally, to verify the actual open-loop pointing accuracy after correction by the KNN algorithm, the OCT system again tracked and measured some stars at other different attitudes and recorded the measurement data. These stars were called target stars. Fig. 9 is the polar diagram of the target stars in the

VI. CONCLUSION
An OCT on a motion platform is influenced by both linear and nonlinear pointing errors. The present paper analyzed both error types in detail. The linear pointing errors were well corrected by the parameter model. We then proposed a KNN algorithm for correcting the nonlinear pointing errors. The KNN algorithm is a nonparametric method that estimates a test sample with k nearest neighbor samples. The inter-sample distance in the KNN algorithm was measured by the angular Euclidean distance and the weights of the nearest neighbor samples were calculated using a distance-dependent Gaussian-like function. The parameter k was determined using the GCV method. The effectiveness of the KNN algorithm was verified in tracking star experiments. The linear pointing errors in the experimental data were first corrected by the parameter model. After correction, the initial pointing error of the calibration stars reduced from 1312.9 μrad to 87.3 μrad. After further correction using the KNN algorithm, the modified pointing error of the calibration stars was further reduced to 69.0 μrad. In addition, the actual open-loop pointing error of the target stars was reduced from 91.9 μrad after correction by the parameter model to 70.8 μrad after correction by the KNN algorithm. Thus, once the linear pointing errors are corrected with the parameter model, the KNN algorithm can effectively correct the nonlinear pointing errors to further improve the pointing accuracy of an OCT on a motion platform.