Abstract
To ensure the high measurement accuracy, the star sensor must be accurately calibrated before use. Which calibration method is selected to complete the calibration of parameters and how to improve the precision of parameters calibration is the key to achieve high precision attitude measurement of star sensor. Aiming at the problem that the accuracy of the traditional calibration algorithm is greatly affected by the initial value, a parameter calibration algorithm based on hybrid WOA-LM algorithm is proposed. This algorithm can dynamically fuse levenberg-Marquardt (LM) algorithm with Whale Optimization Algorithm (WOA). By making full use of the global search ability of WOA algorithm and the local optimization ability of LM algorithm, the problems of traditional algorithm relying on the initial value, easy to fall into local convergence, low WOA algorithm’s calibration efficiency and calibration results are solved. Compared with WOA method, Li method, and the two-step method, this method has better performance. Simulation and experimental results show that this method can optimize all parameters of the star sensor with high accuracy and efficiency.
Keywords
Introduction
Star sensor (also called a star tracker) is a kind of equipment used for high-precision attitude measurement in most spacecraft missions [1–3]. The star sensor has the characteristics of high precision, automatic sensing, and no time drift, and can be used to determine the attitude of orbiting spacecraft and interplanetary spacecraft [4]. The measurement accuracy of the star sensor is mainly affected by the estimation of model parameters. In order to achieve high precision attitude determination, calibration before the launch of the star sensor is essential.
Two calibration methods are generally used: night sky calibration and laboratory calibration [4]. Night sky calibration uses a star sensor installed on a high-quality telescope driver, which points to the zenith and calibrates the star sensor using the data from the night sky [3–5]. However, due to the influence of atmospheric observation and refraction, the accuracy of this method is limited. Laboratory calibration uses star sensors and star simulators mounted on precision turntables for data acquisition [7, 8]. Obviously, laboratory calibration is generally more accurate than night sky calibration and the calibration process is more convenient [6]. Thus, existing laboratory calibration methods can be roughly classified into two categories [4]. The first class implements the imaging model, while the second class uses polynomials to describe the correlation. The first classification method uses a simplified imaging model using only internal parameters [9–13]. These methods focus on intrinsic parameters such as optical distortion and ignore extrinsic parameters [4]. Unlike the first classification method, the polynomial fitting method uses two-order or higher-order polynomials to describe the correlation, and the parameters involved have no physical significance[14, 15]. However, due to the introduction of installation and adjustment errors, fixed errors are inevitable in this case.
Inspired by the calibration theory of classical cameras, the integrated imaging model of the star sensor is established based on internal and external parameters to solve the above problems [4]. Wei [4] proposed a two-step method to calibrate the star sensor parameters. Firstly, the focal length and center point are estimated by using the distortion-free model, and then the distortion is optimized by using the model. However, it takes up a large amount of storage space, computes too much, has low accuracy for nonlinear and multi-objective problems, and is greatly affected by the initial value. Xiong [16] and Li etc [17] proposed methods to solve the parameters of star sensor by establishing complete models. However, it is inevitable that there are various error couplings and the accuracy is not high.
Based on the above problems, this paper proposes a star sensor parameter calibration method based on WOA-LM algorithm, which makes full use of the optimization ability of WOA-LM algorithm and solves the problems of initial value dependence, easy to fall into local convergence, low calibration efficiency and poor calibration results in the above methods. It is of great significance to improve the guidance accuracy.
The research content of this paper is as follows. Section 2 describes the integrated modeling. The mathematical model of the original WOA is presented in Section 3. Section 4 introduces the calibration method using WOA-LM algorithm in detail. To validate the performance of the proposed method, simulation and real data experiments were conducted in Section 5. We conclude in Section 6.
Integrated model
A laboratory calibration device for a star sensor [16] is demonstrated in Fig. 1. The single-star simulator is composed of a starlight generator and an optical tube to simulate real starlight. The star sensor is mounted on a two-axis rotary table which can accurately generate distinct angles, simulating starlight coming from different directions [16].
As shown in Fig. 2. The star sensor follows the same imaging process as other cameras [16]. The integrated model of internal and external parameters is basically consistent with the model in the Ref [17]. Represents the direction vector of the incident star in the camera coordinate O
m
- X
m
Y
m
Z
m
as V
m
= (v1, v2, v3)
T
, the focal length of the star sensor is f
c
, the pixel size is (D
x
, D
y
), and the optical main point position is (u0, v0), the coordinate (x′, y′) of the star point on the star sensor image sensor plane is the following model:
Considering the influence of distortion, the coordinates of real imaging points are the following models:
Where (δx, δy) represents the distortion in the x,y directions. The specific expressions of these two distortions are as follows:
Where q1, q2 are the radial distortion parameters and p1, p2 are the tangential distortion parameters. In general,f c , u0, and v0 are distortion parameters, and q1, q2, p1 and p2 are inherent parameters of the integration model.

Laboratory calibration equipment for star sensor.

Integrated model of star-sensor calibration.
The direction vector of the incident star can be shown as follows:
Where v
s
refers to the direction vector of starlight emitted by the star simulator in the zero coordinate O
r
- X
r
Y
r
Z
r
of the rotary table (with axes X
r
and Y
r
being two rotation axes). R
mr
refers to the installation deviation of the star sensor, which is the transformation matrix from the zero coordinate system of the rotary table to the star sensor coordinate system. R
rot
is the rotation matrix of the operation of the rotary table. Starlight vector v
s
can be expressed as follows:
Where α is azimuth angle and β is inclination angle. During the installation of the star sensor, the deviation is inevitable. R mr is the star sensor installation deviation matrix, which can be obtained by the following continuous rotation matrix:
Where R (x
r
, φ1), R (y
r
, φ2), and R (z
r
, φ3) are rotation matrices, indicating that the rotation angle of x
r
axis is φ1, the rotation angle of y
r
axis is φ2, and the rotation angle of z
r
axis is φ3. φ1, φ2, and φ3 are the variables with an obvious deviation of star sensor installation. We assume that the horizontal rotation angle is θ1, and the vertical rotation angle is θ2. The rotation matrix m
rot
can be showed as follow:
The principle of parameter calibration of star sensor is to minimize the mean square root distance between the image point coordinate value (x′, y′) obtained by the star sensor imaging model and the measured value (x, y) of the actual image. Therefore, the corresponding minimization function is taken as:
Where (x
i
, y
i
) is the real pixel coordinate obtained by the star sensor imaging model for the i th star point. Without considering the influence of distortion,
Whale Optimization Algorithm (WOA) is proposed by Mirjalili [18], Lewis (2016). The following is a mathematical model of WOA.
Mathematical model of WOA
WOA is a new meta-heuristic swarm intelligence optimization algorithm to solve optimization problems. It is derived from the feeding behavior of humpback whales in the bubble net. The model of bubble-net feeding behavior is shown in Fig. 3.

Bubble-net feeding behavior of humpback whales.
The hunt for humpback whales can be modeled mathematically in two stages [18].
The humpback whales searching prey is represented by the following Equations (10) and (11)
Where
Where vector
Where t is the current iteration, X* is the position vector of the current optimal solution, and
As shown in Fig. 3, humpback whales prey on fish groups with a logarithmic conical spiral motion. The mathematical model is as follows:
Where represents the distance from the ith whale to its prey (the best solution so far), l is a random number in[- 1, 1], b is the constant that defines the shape of the logarithmic spiral.
In the process of attacking, whales show both attack modes. Therefore, assuming that they have a 50% probability of contracting and enveloping mechanism, and their positions are updated by a spiral model with the same probability, the model can be modeled as:
Where p is a random number in [0, 1].
LM Star sensor calibration model set up
It’s well known that Equation (9) is the objective function that needs to be minimized. In the iteration process of the LM algorithm [19], its initial parameters are first established. After K + 1times iteration, the X(k+1) is [20]
Where d(k) is a vector of convergence rate, I is a n order unit matrix, c
k
, an arithmetic number, is the weight coefficient of I, it determines the convergence rate of X(k). After the first iteration, then ck+1 = c
k
/ - b. b represents the growth factor of c
k
, which determines the growth rate of c
k
, and b > 1 represents positive growth. At this point, the initial weight coefficient c
k
=c1=0.01. A
k
is the first-order partial derivative matrix of f(k). In addition,
According to Equation (9), use the values of X(k) and X(k+1) to calculate the objective function. Their results were also compared as follows:
then calculate iteration accuracy with
Where ɛ is the permissible error, ɛ>0, it is defined as 0.01. If inequality (22) is incorrect and inequality (23) is correct, the iteration is stopped and the final result X final = X(k+1) is obtained. Similarly, if both inequalities (22) and (23) are correct, the iteration is stopped and the final result X final = X(k) is obtained.
The hybrid WOA-LM calibration algorithm can dynamically fuse LM algorithm with whale optimization algorithm to minimize the error of nonlinear star sensor calibration model. Whales represent search agents, and their positions represent calibration parameter values that need to be optimized. Therefore, according to the number of calibration parameters, whales move in 1-D, 2-D, 3-D or hyper dimensional space by changing their position vectors. When beginning to hybrid WOA-LM algorithm, the WOA is called to generate the initial parameter X. Equation (9) is then used to determine the fitness of all whales. The fitness function is used to measure the spatial position of the individual whale, and the foraging strategy is used to constantly update the individual position of the whale until the optimal spatial position X* of the whale is obtained. Substitute the generated parameter X* into the LM algorithm model to solve the optimal solution X final . In the LM algorithm, each iteration is based on Equation (18) and (19). According to inequality (22) and (23), the optimized parameter X final is obtained by stopping the iteration. The final result X final will be applied to the optimized star sensor calibration model. The logical flow of the proposed star sensor calibration is presented in the following subsection (see Fig. 4).

Flow chart of hybrid WOA-LM based Star sensor calibration method.
In this paper, the proposed method is verified by simulation data and actual data. Section 5.1 shows the results about the data size and the centroid noise level. Real data experiments were carried out in section 5.2.
Simulation results using the proposed method
In this section, we use simulation data to evaluate the performance of the proposed method. In the simulation experiment, we need to consider the star centroid estimation error of pixel. Generally speaking, the estimation error of stellar centroid pixel is related to the intensity distribution of the stellar image and the estimation method of the stellar centroid [17]. In most cases, the signal distribution of stars can be presented as Gaussian distribution [21, 22], and Gaussian function is a good method for centroid estimation in the normal range of stellar images [23, 24].
Therefore, the Gaussian distribution can be considered as the center estimation error in most cases. In our simulation experiment, the precise position of the centroid of the star in the pixel is added with Gaussian noise distribution to simulate the real situation.
The simulated star sensor has the following properties. The focal length of the star sensor is 35.042mm. The star sensor camera with a pixel size of 5.5 μm×5.5μm and a resolution of 1,024 pixel × 1,024 pixel was simulated to acquire the star images. The main position of the star sensor is considered to be at (988, 997) pixels. The coefficients of the radial and tangential distortions were:p1=-4.012e-05,p2=-3.544e-05, q1=-3.957e-05,q2=6.731e-07. The installation error between the turntable and the star sensor is set as φ1=-0.0032, φ2=-4.598e-04. We set the attitude of the star sensor by adjusting rotary table, from left to right, and from top to bottom to obtain the sampled star points in the detection plane of the star sensor. We get 197 data points in total, one sample point for every 2 degrees. The following experiments in this chapter are carried out under the above basic configuration.
In order to further test the performance of our proposed method, we conducted the following two groups of experiments: the performance of this method in terms of centroid noise level and data size is evaluated in section 5.1.1-5.1.2 respectively. In section 5.1.1, zero mean centroid noise with standard deviations of different values is added to the position of star points. In the two experiments, we compare the performance of the proposed with that of WOA method, Li’s method [17], and two-step method [4]. We used the RMS reprojection error [25, 26] to evaluate the calibration results.
The performance with respect to the centroid noise
In this experiment, its performance relative to the centroid noise is tested. Gaussian noise with a mean value of 0 and standard deviation of σ is added to the accurate position of star image centroid in the pixel. The noise level varies from 0.02 pixel to 0.14 pixel. The data size of 197-star points was evenly distributed on the detection plane. Each noise level was tested 30 times to calculate the mean square root error of the re-projection. As shown in Fig. 5, as the noise level added to the star increases, the root means square value of the re-projection error increases. Compared with the other three methods, the proposed method has a minimum correction error at the same noise level. As the noise increases from 0.02 pixel to 0.14 pixel, the re-projection error RMS of the proposed method increases from 0.049 pixels to 0.192 pixels, while the WOA method increases from 0.170 pixels to 0.237 pixels. The RMS of the re-projection error of the two-step method increased from 0.072 pixels to 0.231 pixels and Li’s method increased from 0.094 pixels to 0.252 pixels. Therefore, if we want to get better results, the best way is to reduce the noise.

Calibration results versus the centroid noise.
This experiment studies the performance related to the number of data points. The number of data points ranged from 60 to 197. For the position of star points, we add 0 mean centroid noise, and the standard deviation is 0.04 pixels. For each data size, 30 tests were performed and the root means square error of the re-projection was calculated. As shown in Fig. 6, as the amount of data increases, the RMS of the re-projection error of the four methods gradually decreases. As the data size increased from 60 to 197, the re-projection error RMS of our method decreased from 0.078 pixels to 0.063 pixels, while the WOA method increased from 0.168 pixels to 0.117 pixels. However, the RMS of the re-projection error of the two-step method decreased from 0.092 pixels to 0.083 pixels. The RMS of the re-projection error of Li’s method decreased from 0.134 pixels to 0.098 pixels. Compared with the four methods, the proposed method has a minimum calibration error under the same data quantity. Experimental results show that a small number of data points can obtain accurate calibration results by using the proposed method.

Calibration results versus data size.
We did a real calibration experiment in this section. The calibration data of the star sensor are collected using a turntable and a star simulator. The whole calibration data acquisition process is carried out in a dark room to eliminate the interference of stray light. The two axes of the turntable rotate at different angles to guarantee that the entire plane of the image sensor covered by the stars. The star sensor acquires the star image and calculates the star spot position (x, y)of the image. The centroid coordinates of the star points are transmitted to the data acquisition computer through the communication interface of each rotating position of the turntable. We repeated the data collection process 30 times. Then, the average value of the data is used as the calibration data point. The actual experimental data are shown in Table 1.
Real calibration data in the experiment
Real calibration data in the experiment
To verify the comprehensive performance of the proposed method, our method is compared with WOA method, Li’s method, and two-step method. Table 2 shows the results of the comparison of the four methods. We still use the RMS of the reprojection error to evaluate the performance of these methods. From Table 2, the RMS of WOA method is 0.124 pixels. Because the accuracy of the whale optimization algorithm is not high, it has fallen into the characteristic of local optimum, which leads to its poor calibration result. Our method has the RMS of the re-projection error of 0.039 pixels, which is more accurate than Li method with RMS of the re-projection error of 0.098 pixels. Li method adopted the levenberg-Marquardt (LM) algorithm for calibration. On the one hand, if the initial parameters are not well selected, Li method is prone to fall into local optimization, resulting in low the RMS of the re-projection error. On the other hand, Li method took the observed star points with distortion as the input of each optimization step, thus generating additional errors for the estimated parameters. The re-projection error of the two-step method is 0.062 pixels. Our proposed method uses the whale optimization algorithm to get a good initial estimation, and levenberg-Marquardt algorithm to refine all parameters to get more accurate calibration results. The ideal calibration results are obtained by taking full account of the influence of various parameters. The results show that the method can estimate the parameters of the star sensor successfully.
Model comparisons result with real data
The residuals between the data points and the projection points verify the calibration result. The residual distribution is shown in Fig. 7. It can be shown that the direction and amplitude of the residual error are randomly distributed on the detection plane of the star sensor, which means that the systematic error has been reduced sufficiently. Therefore, the calibration result of this method is feasible.

Residual error of the star sensor.
In this paper, a new global optimization algorithm for the calibration of star sensors is proposed based on the classical camera calibration method. Firstly, the exploration ability of whale optimization algorithm was used to obtain the optimal parameter value, and then the local mining ability of the levenberg-Marquardt algorithm was used to optimize the optimal parameter value. The method considers the interaction of parameters and has high estimation accuracy. Compared with the WOA method, Li method and two-step method, our method has better performance. The experimental results of simulation and real data indicate that our method can acquire the precise parameters of the star sensor and can be used for the calibration of the star sensor in the laboratory.
Conflicts of interest
The authors declare no conflict of interest.
Footnotes
Acknowledgments
This work is supported by National Science Foundation of China under Grant No. 61563008, and the Project of Guangxi Nationalities Science Foundation under Grant No. 2018GXNSFAA138146.
