The Tobit-Unscented-Kalman-Filter-Based Attitude Estimation Algorithm Using the Star Sensor and Inertial Gyro Combination

For the orbit operation of spacecraft, due to environmental factors, a star sensor installed on the spacecraft must have data censoring, which greatly reduces the attitude determination ability of the traditional combined-attitude-determination algorithm. To address this problem, this paper proposes an algorithm for high-precision attitude estimation based on a Tobit unscented Kalman filter. This is on the basis of establishing the nonlinear state equation of the integrated star sensor and gyroscope navigation system. The measurement update process of the unscented Kalman filter is improved. The Tobit model is used to describe the gyroscope drift when the star sensor fails. The latent measurement values are calculated using the probability statistics, and the measurement error covariance expression is derived. The proposed design is verified via computer simulations. When the star sensor fails for 15 min, the accuracy of the Tobit unscented Kalman filter based on the Tobit model is improved by approximately 90% compared to the unscented Kalman filter. Based on the results, the proposed filter can effectively estimate the error caused by the gyro drift, and the method is effective and feasible, provided there is theoretical support for the engineering practice.


Introduction
In engineering applications, sensor measurement has often been saturated, or there has been no output due to disturbance and occlusion, which affects the available measurement range of a detector, causing censoring failure. If a censored measurement result is treated as a normal measurement value or a truncated measurement result is completely discarded, the estimation result may differ significantly from the normal value of a censored area. In a satellite attitude-determination system, due to the influence of the space environment, a star sensor can fail, and the output measurement result can be lost [1]. In the process of the integrated navigation of a star sensor and an inertial gyro, when the data of a star sensor are censored, the inertial navigation information is generally used to determine a satellite's attitude. However, due to the accumulation of the inertial navigation error over time, the resulting satellite attitude error is large [2]. In addition, censoring the star sensor output data can significantly reduce the attitude determination ability of the common attitude-determination algorithms, such as the extended Kalman filter (EKF), particle filter (PF), and unscented Kalman filter (UKF) [3][4][5][6]. In [7], the ANFIS theory is introduced to solve the combined navigation problem of a star sensor being in a transient navigation failure state, which has a large amount of reserved information and a complex calculation. In [8], a set of Bernoulli distribution random variables are used to model the delay sensor, and a piecewise analysis is proposed to modify the EKF, but it is not real time. In [9], a modified Square Root Unscented Kalman Filter (MSRUKF) is developed and used to estimate and control the angular velocity and attitude of a rigid gyro-less satellite in the presence of external disturbances and sensor faults. This method has a large amount of retained information and complex calculations, as well as the use of additional components, which increases costs. In [10], Soken and Hajiyev studied the robust UKF by introducing a scaling factor to adjust the gain of the Kalman filter, thereby weakening the impact of the abnormal measurements on filtering solutions. However, the proportion factor must be determined based on experience, which may lead to poor or biased filtering solutions. In this paper, to continue the real-time functioning and simplicity of the Kalman filter, a Tobit model is introduced to describe the measurement state.
The Tobit model was first proposed by economist James Tobin in 1958 to accurately simulate household expenditure [11,12]. The subsequent work proposed the many off-line estimation methods of the Tobit model [13][14][15][16][17][18][19]. Bethany Allik calculated the estimation deviation of the standard Kalman filter using the Tobit model [13][14][15]. It was assumed that there was no Jacobian matrix of the censored data of the EKF, and the steep discontinuity of the censored PF data caused a massive computational burden; the UKF had low computational overhead but was not robust enough on the censored interval. In [16], the censored and uncensored data were clearly separated and treated differently. The proposed solution represented an iterative maximum likelihood solution, which required using the measured historical data. In addition, it had a heavy computational burden and high memory requirements, thus reducing the Kalman filter performance. The Kalman filter introduced in [17][18][19] treated the censored measurement data as intermittent measurement data. This method provided a minimum state error variance and assumed that the missing measurement was not related to the state value. It can obtain a reasonable estimation result by using a complex state transition model. However, when a conserved measurement result is related to the state value, a biased estimation will be caused. In recent years, the Tobit model has been used more and more widely. The trajectory roll rate is estimated using the Tobit Kalman filter (TKF) with the aid of the enhancement technique and orthogonal projection principle [20,21]. The TKF is used to estimate the hidden state vectors in human skeletal tracking [22]. The Adaptive Tobit Kalman Filter (ATKF) is tested in an IoT positioning application and improve the estimation and tracking of variables with censored sensor data [23]. The Tobit unscented Kalman Filter (TUKF) is used to solve the target tracking problem with limited detection distance [24]. The Tobit model generally handles state quantities of one dimension [25]. However, in the problem of satellite-integrated navigation attitude determination, the state quantities are multidimensional. In summary, this paper presents the TUKF algorithm based on the Tobit model to improve the high accuracy attitude determination capability of the satellite platform when the star sensor fails.
This article proposes a TUKF that combines the Tobit model with the UKF, overcoming the impact of truncation measurement on attitude determination performance. This method uses the attitude kinematics equation and the gyro measurement equation to rewrite the state equation, and further describes the state estimation of the attitude error. Based on this, the statistical information of the truncated measurement is used to approximate the probability density function (PDF), and the error covariance matrix is calculated to make the estimation error closer to the true value and further improve the attitude determination accuracy. This method overcomes the limitations of the classical UKF by estimating and adjusting system noise statistics online. The simulation experiments were conducted in the integrated navigation of star sensors and gyroscopes with failed star sensors to evaluate the performance of the TUKF.
The remainder of this paper is organized as follows: Section 2 presents the Tobit model and the measurement model of a star sensor and a gyroscope integrated navigation. Section 3 outlines the TKF algorithm. Without data censoring, it shows the equivalence of TKF and the standard Kalman filter. Additionally, the TUKF is proposed using the covariance and expectation of the system state estimation. Additionally, the simulation results are presented in Section 4. The conclusions are drawn in Section 5.

Tobit Model
The Tobit model is a mathematical model describing data truncation proposed by James Tobin in [11]. The continuous variable is sometimes truncated or censored. If the intercepted value is directly used, it will lead to inconsistent estimators. Therefore, the probability density of the mixed distribution needs to be derived before estimation.
When there are censored data of a measurement model, the state equation and measurement equation of the model can be expressed as follow [13]: where x k is the state vector; A is the state transition matrix; C is the measurement matrix; ω k and v k are mutually independent Gaussian white noises, having the covariances of Q and R, respectively; σ is the standard deviation; τ is the censored value of the Tobit model; y k is the estimated measurement; and y * k is the latent measurement. The Bernoulli random variable µ is introduced to simulate the measurement in the censored and uncensored areas. The measurement value at t τ time is µ k (l) = 1 (l = 1, 2 . . . m), after censoring for time t τ , µ k (l) = 0. The measurement model of the Bernoulli variable is expressed as follows: At a given time point, the probability of the lth measured element is the expected value E(µ k (l)), where µ k (l) is a R m * m diagonal matrix when the matrix representation is used. The measurement equation is provided by: In the Tobit model, it is necessary to reconsider the distribution of y k . The distribution of the censored data with functional noise distribution is provided by: where where φ and Φ are the PDF and the cumulative distribution function (CDF) of the standard normal distribution, respectively; δ is the unit impulse function; u(α) is the unit step function; and when α ≥ 0, u(α) = 1, but when α < 0, then u(α) = 0. For the PDF of the actual measured data, the mathematical expectation and covariance are as follows [11]: where

Attitude Measurement Model Based on Star Sensor and Gyro
In the integrated navigation process of a star sensor and a gyro, when the star sensor fails, the attitude determination process of the spacecraft is transformed into the attitude estimation process based on the gyro's data. Since the gyro error accumulates over time, a gyro drift compensation algorithm is used to correct the estimated attitude value, and the spacecraft attitude is obtained under the condition of missing star sensor data in a short time.
The measurement data of a gyro are provided by [26]: where ω = ω x ω y ω z T is the output angular velocity of a gyroscope; u = u x u y u z T is the true angular velocity of the gyroscope relative to the inertial system; b is the gyrorelated drift value; b 0 is the constant gyro drift value, b 0 ∈ R 3 * 1 ; d(t) is random drift, and d ∈ R 3 * 1 ; and n 1 is the Gaussian white noise with the zero mean. The random drift of the gyro satisfies the following condition: where n d is white noise. According to the attitude dynamics and kinematics of a satellite [27], the state equation of an attitude determination system is provided by: .
where q = [q 4 q 1 q 2 q 3 ] T , q 4 is a scalar value; q = [q 1 q 2 q 3 ]; and are the attitude quaternion and attitude angular velocity of the satellite body coordinate system (B) relative to the orbital coordinate system (O x 0 y 0 z 0 ), respectively; is the extended angular velocity; and Due to the lack of star sensitivity data, the star sensitivity prediction quaternion is used to replace the censored star sensitivity measurement data as follows: where Z denotes the actual measured data; q eout is the output measurement quaternion when the star sensitivity is normal; t τ is the time when the star sensor data are missing; and t end is the time when the star sensor outputs attitude recovery.

Tobit Kalman Filter Algorithm Framework
In this section, a TKF method for short-time spacecraft attitude determination when the spacecraft is in a nearly circular orbit and star sensor data are missing is proposed. First, the gyro drift is estimated from the measured data of a star sensor in the period before the period where data are missing. Considering the influence of the amount of missing data, the model error is determined using statistical information on the censored data to minimize the covariance of the estimation error. Finally, the model error is compensated to obtain accurate attitude information.
The quaternion estimation error is defined as an algebraic error by ∆q = q −q. ∆q is only a mathematical description [28], and the corrected quaternion is provided by: The state prediction model represents the integration on the time interval of [t − ∆t, t], and the prediction model of a system state is defined as follows: Substituting Equation (9) into Equation (12) yields: . where The difference between the angular velocity calculated from the star sensor measurement data and the gyro measurement result represents the gyro drift value, and it is expressed as follows: Based on Equations (15)- (17), the state equation can be rewritten as follows: n q (t) is the measurement error of the star sensor.
In the improved system, the gyroscope drift value is considered as the measured value. Considering the high-precision measurement performance of a star sensor, the prediction error is calculated using the star sensor measurement data at time (t + ∆t) as reference data. Based on Equation (18), the latent measured value in Equation (1) can be rewritten as follows: where y * and R is the measurement noise covariance matrix.
Moreover, τ is the measured value at the time of star sensor failure.
The system state estimation performance is affected by the statistics of truncation measurement data. Therefore, the main objective of the attitude determination TKF method is to consider the statistical information of censored measurement data fully to estimate the latent information accurately.
The TKF method under the integrated navigation system is as follows [14]. The prior estimation of a system state and its probability distribution can be, respectively, expressed as follows: The prediction equation of the system state is defined by: where x k−1|k−1 is the estimated value at time (k − 1). The covariance of the state error of a given measurement value and state information at time (k − 1) is expressed by: where ψ k−1|k−1 is a prior estimation of the state error covariance, and Q is the system noise covariance matrix. The optimal Kalman filter minimizes the state error covariance (ψ k|k ). The following update steps minimize the state error covariance.
The estimation equation is where Rxỹ k is the cross-covariance between the measurement error and the current system state, and Rỹỹ k is the variance of the measurement error; they are calculated by: where E(y k ) is calculated by Equation (7), and E(y k ) ∈ R 4 * 1 .
According to Equation (26), it holds that: and then the Kalman gain is computed by: Next, calculate the measurement error by: Then, the covariance of the system state estimation is expressed by: the cross-covariance between the measurement error is computed by: The cumulative distribution of the measured data represents a function of the distance between the invisible measured variable and the threshold. The expectation of µ k (l) is calculated by: where Cx k (l) is the lth element of the measurement vector, and σ(l) is the variance of the noise on this element. For simplicity, the following assumptions are made.

Assumption 1.
It is assumed that the quantity of the measured data is irrelevant; therefore, R is a diagonal matrix, and it holds that: cov(y k (d), y k (l)) = 0, ∀d = l.
Assumption 2. The state prediction represents a sufficient and accurate estimation of the censored data probability, and it is provided by: According to and obtain For the same token, the variance of the measurement error is determined as: Next, substitute the optimal Kalman gain into Equation (32) to obtain a simplified covariance update equation as follows: When the state value is far away from the censored region, the TKF algorithm can be transformed into the standard Kalman filter [13]: The TKF represents a generalized Kalman filter.

Improved Tobit Unscented Kalman Filter Algorithm
The TUKF is based on the traditional Kalman filter, using the sigma point set to calculate the expectation and variance after the unscented transformation (UT), and using the Tobit model to calculate the expectation and variance of relevant measured values in the attitude determination process.
First, the UT transformation is performed, and the corresponding weight value is calculated using [29]: where the superscript m is the mean, c is the covariance, the subscript is the number of sampling points, and λ = α 2 (n + k) − n.
Next, define a sigma point set as follows [29]: Then, the state equation is transformed by the UT, the sigma points are substituted into the nonlinear state function, and the one-step predictive state value and predictive covariance matrix value are obtained by weighting.
The prediction equation of sigma point set is where X represents the state value of the Sigma point set.
The predicted sigma point is provided by [29]: Further, the error covariance is calculated by: The prediction equation of the sigma point is defined by: The variance of the measurement error is provided by: The cross-covariance between the measurement error and the current system state is provided by: The status values and covariance matrix values are updated as follows: x k|k = x k|k−1 + K k (y k − E(y k )).

Simulation
In this part, some simulations were carried out to compare the accuracy of the different algorithms, and the influence of the Tobit model on the estimated value was analyzed when the measured value was truncated.

Comparison between the Straight Kalman Filter and the Tobit Kalman Filter
The dynamic equation of the simulation system was shown in Equation (54), w k−1 and v k were Gaussian white noise with a zero mean value, the variance were Q = 10 −11 , R = 1, the truncation threshold was τ = 0, the initial values were set as x 0 = −0.2, P 0 = 1, and the number of iterations was 1000, as shown in Figures 1 and 2.  From the analysis results in Figures 1 and 2, it was found that many of the observed data were set to 0 due to truncation, but TKF eventually converges to the true value, and the straight Kalman filter (SKF) [30] eventually had a nearly constant deviation from the true value. It proved that the Standard Kalman Filter is a biased estimate under the Tobit  From the analysis results in Figures 1 and 2, it was found that many of the observed data were set to 0 due to truncation, but TKF eventually converges to the true value, and the straight Kalman filter (SKF) [30] eventually had a nearly constant deviation from the true value. It proved that the Standard Kalman Filter is a biased estimate under the Tobit model, and the deviation was proved in Equation (7). TKF can successfully converge be- From the analysis results in Figures 1 and 2, it was found that many of the observed data were set to 0 due to truncation, but TKF eventually converges to the true value, and the straight Kalman filter (SKF) [30] eventually had a nearly constant deviation from the true value. It proved that the Standard Kalman Filter is a biased estimate under the Tobit model, and the deviation was proved in Equation (7). TKF can successfully converge because it calculated the probability distribution of the observations under the Tobit model in advance and made corresponding corrections during the updating process of a linear Kalman filter, predicted the hidden information under the Tobit model, and used this information to complete the unbiased estimation.

Comparison between the Extended Kalman Filter and the Tobit Extended Kalman Filter
The Tobit extended Kalman filter (TEKF) is described in [13]. Due to space limitations in the article, it will not be repeated here. The dynamic equation of the simulation system was shown in Equation (55), w k−1 and v k were Gaussian white noise with zero mean value, the variance were Q = 0.04, R = 1, the truncation threshold was τ = −2, the initial values were set as x 0 = 0.2, P 0 = 1, and the number of iterations was 200, as shown in Figures 3 and 4.
The analysis of the results in Figure 3 shows that many of the observed data were set to −2 due to truncation, but, while the EKF results were divergent, the TEKF can still maintain a good tracking effect in the end. In terms of the results, the only difference between the two was the prior knowledge about the observed data. The TEKF recalculated the numerical characteristics of the observed values based on the Tobit model, while EKF was still the assumption of the Gaussian continuous distribution. Therefore, there were deviations in the working process and the deviations accumulate in the time-varying system, leading to divergence. In addition, after many tests, it was found that the robustness of EKF and TEKF was not good enough.     The analysis of the results in Figure 3 shows that many of the observed data were set to −2 due to truncation, but, while the EKF results were divergent, the TEKF can still maintain a good tracking effect in the end,. In terms of the results, the only difference between the two was the prior knowledge about the observed data. The TEKF recalculated the numerical characteristics of the observed values based on the Tobit model, while EKF was still the assumption of the Gaussian continuous distribution. Therefore, there were deviations in the working process and the deviations accumulate in the time-varying

Comparison between the Unscented Kalman Filter and the Tobit Unscented Kalman Filter
The simulation used the same system in Section 4.2, and the results are shown in Figures 5 and 6.
In the process of the simulation experiments, the TUKF achieved good tracking results. Compared with the TEKF, the TUKF also achieved better results. The analysis showed that the higher error of the TEKF comes from the Taylor expansion, which only carries out first-order approximation and ignores the results of other orders. system, leading to divergence. In addition, after many tests, it was found that the robustness of EKF and TEKF was not good enough.

Comparison between the Unscented Kalman Filter and the Tobit Unscented Kalman Filter
The simulation used the same system in Section 4.2, and the results are shown in Figures 5 and 6.    In the process of the simulation experiments, the TUKF achieved good tracking results. Compared with the TEKF, the TUKF also achieved better results. The analysis showed that the higher error of the TEKF comes from the Taylor expansion, which only carries out first-order approximation and ignores the results of other orders.

Simulation Analysis of TUKF in Attitude Determination
The flow chart of the TUKF is shown in Figure 7.

Simulation Analysis of TUKF in Attitude Determination
The flow chart of the TUKF is shown in Figure 7.   The proposed design is verified via simulation experiments in the MATLAB software environment. The parameters were set as follows: the star sensor and gyro strap-down installation coordinates coincided; the gyro measurement white noise was set to n 1 = 5deg/h(3σ); the initial value of the gyro drift was set to d(0) = [0.5, 0.5, 0.5] T deg/h; the standard deviation of white noise was n d = 0.1deg/h(3σ); the gyro constant drift was b 0 = 1deg/h(3σ); and the measurement noise of a star sensor was s = 1 (3σ). The initial attitude angle was ϕ 0 = [−40, 5, −34] T deg; the initial value of the three-axis angular velocity was ω 0 = [0.05, 0.0003, 0.02] T deg/s; and the star sensor output frequency was 10 Hz, simulation duration was 2000 s, star sensor attitude failure data truncation occurred at 400 s, and the measured value at this truncation time was the truncation threshold τ.

Measurement Error Covariance Matrix Effect on Filtering Performance
The assumption is that the measurement error covariance information was known before, but, in this process, the measurement error fluctuation changed when the star sensor failed. Set the duration of the star sensor failure to 15 min. Then, the measurement error covariance was assumed artificially, and three conditions of R = n 1 2 ·I 4×4 , R = n 1 2 ·10 −2 ·I 4×4 , and R = n 1 2 ·10 −4 ·I 4×4 were analyzed. In this system, a combination of star sensors and gyroscopes was considered to determine the attitude. The term 'no integration' in Figures 8-10 refers to using a gyroscope to determine attitude in the truncated region and using the traditional star sensors and gyroscope combinations to determine the attitude at other times. The star sensor was available at 0-400 s and 1300-2000 s while the values at other times were truncated and the attitude determination ability was affected.  The simulation results of the 15 min star sensor attitude loss showed that, after the star sensor data loss, the equivalent measurement error covariance was close to the actual situation, and the UKF error slowly diverged over time, as shown in Figure 8. When the covariance of the equivalent measurement error deviated from the actual situation, the filtering effect of the UKF degraded and was equivalent to the error caused by the gyro drift, as shown in Figures 9 and 10. After the star sensor was output normally following the star sensor data being regressed, the closer the measurement error covariance was to the actual situation, the shorter the UKF error convergence time was, as shown in Figures 9 and 10. Further, it can be seen in Figure 8 that, when the covariance of the equivalent measurement error deviated from the actual situation, the UKF filtering effect converged slowly. In contrast, the TKF and TUKF based on the Tobit model could accurately estimate the measurement value through probability statistics calculation and estimate the measurement error covariance in real time, showing a higher filtering estimation accuracy and stronger robustness than UKF.
Further, according to σk = ∑ n i=1 (y ik ) 2 n , where k = 1, 2, 3, n is the number of output quantities and the estimated attitude obtained by 50 operations. The mean square error results of the attitude obtained via different algorithms during the period of missing star sensor data under different measurement error covariance values are presented in Table 1. Compared with the UKF algorithm, the accuracy of the TUKF algorithm was improved by approximately 90% when the star sensitivity data were missing, which indicated the high filtering estimation accuracy of the proposed algorithm based on the Tobit model and confirmed the above results.
(c) The simulation results of the 15 min star sensor attitude loss showed that, after the star sensor data loss, the equivalent measurement error covariance was close to the actual  Figures 8-10 clearly indicated that the errors of the TKF and the TUKF were relatively stable. At the truncation moment, the UKF error increased with the gyro drift, and the TKF and the TUKF can almost accurately tracked the spacecraft's attitude. Table 1 shows that, under different measurement error covariance differences, the attitude estimation error of the TUKF was 60 , and the TKF was 80 in the truncated region. This filter had a certain degree of robustness, meaning it was considered stable.

Star Sensor Data Missing Duration Effect on Filtering Performance
The failure duration of a star sensor is uncertain during the orbit operation of spacecraft. The measurement error covariance was R = n 1 2 ·I 4×4 . According to the missing star sensor data of different durations, the mean square error results of the integrated navigation attitude in the missing period of the star sensor data obtained by 50 operations were simulated, and the results were shown in Figure 11.  . During the period of star sensor failure, the mean square error of the spacecraft attitude estimation for TKF and TUKF was relatively stable compared to the UKF, and it was believed that the TKF and the TUKF was convergent. Further, as presented in Figure 11, the filtering estimation accuracy of the TUKF algorithm was higher than that of the TKF algorithm. This was because the TUKF algorithm performed the UT transformation near the estimated points to obtain the mean and covariance of the obtained sigma point sets and then directly mapped the sigma point sets, using the statistical information of the truncated measurement to approximate the state PDF; thus, the estimated attitude was closer to the true value than the TKF algorithm. The simulation results verified the effectiveness of the above methods and had certain engineering applications.
Consequently, when the time of the star sensor fails is less than 2 min, the traditional During the period of star sensor failure, the mean square error of the spacecraft attitude estimation for TKF and TUKF was relatively stable compared to the UKF, and it was believed that the TKF and the TUKF was convergent. Further, as presented in Figure 11, the filtering estimation accuracy of the TUKF algorithm was higher than that of the TKF algorithm. This was because the TUKF algorithm performed the UT transformation near the estimated points to obtain the mean and covariance of the obtained sigma point sets and then directly mapped the sigma point sets, using the statistical information of the truncated measurement to approximate the state PDF; thus, the estimated attitude was closer to the true value than the TKF algorithm. The simulation results verified the effectiveness of the above methods and had certain engineering applications.
Consequently, when the time of the star sensor fails is less than 2 min, the traditional combined attitude determination algorithm UKF can be used for attitude estimation; when the time of the star sensor fails is longer than 2 min, the TUKF algorithm has higher filtering estimation accuracy and stronger robustness. However, in the real situation, there are few cases where the star sensor fails is longer than 24 min, and the more information missing, the more parameters need to be considered. Therefore, the problem of combined attitude determination with long-time star sensor data missing needs to be further discussed.

Conclusions
This paper proposes the TUKF based on the star sensor and inertial gyro combination. Aiming at the attitude output in the period before the star sensor becomes invalid, the missing information is estimated based on probability statistics using historical measurement data to overcome the difficulty of missing star sensor data. The proposed algorithm can accurately estimate the latent measurement values using the probability statistics calculation and the measurement error covariance in real time, showing a small performance loss compared to the UKF, the TKF, and using only gyro estimation. Therefore, the proposed TUKF algorithm can control the error between the estimated curve of the spacecraft attitude parameters and the true value of the spacecraft attitude in a short time under the condition of a short-term data loss, thus ensuring good real-time attitude determination effect of the system on the orbiting spacecraft, provided that there is theoretical support for the engineering practice. In this method, it is assumed that the prior information of the gyro drift is known; however, many factors affect gyro drift in actual orbit operation, and then affect the accuracy of the attitude determination. Therefore, further follow-up research on the calculation of gyro drift is required. Data Availability Statement: Data to support the conclusion of the manuscript are included in the manuscript. Additional data are available upon reasonable request to the corresponding author.

Conflicts of Interest:
The authors declare no conflict of interest.