1. Introduction
The Attitude Determination and Control System (ADCS) plays an essential role in all spacecraft missions. A high-performance spacecraft ADCS is usually more expensive, such as those that use star trackers, gyroscopes, and momentum exchange devices as attitude actuators. Small low-cost spacecraft, on the other hand, are being considered for several types of missions. Because of their dependability, low cost, lightweight, and energy efficiency, these spacecraft typically employ low-cost components such as magnetic rods and magnetometers [
1,
2,
3]. A worldwide survey of small satellite missions revealed that the foremost commonly used sensors are sun sensors and magnetometers. Furthermore, about
of the nanosatellites have magnetic rods for active magnetic attitude control [
4]. There are, however, some challenges. The magnetic rods usually suffer from poor accuracy and instantaneous under actuation [
5,
6]. The generated torque is constrained to be in the plane that is orthogonal to the ambient magnetic field vector. Therefore, a three-axis magnetic attitude control is merely possible if the orbit sees a magnetic field variation that is sufficient to ensure the spacecraft stability, which is a requirement that is usually fulfilled in inclined orbits [
1]. Furthermore, as mentioned in [
7], there are additional restriction criteria on the spacecraft inertia tensor to ensure controllability.
Measuring the spacecraft’s external magnetic field using magnetometers serves two purposes. The first is to use magnetic field data to compute the magnetic dipole moment (attitude control) and the second purpose is to estimate the spacecraft attitude and rate. There are several approaches that can be used for the latter purpose. Psiaki et al. [
8] proposed an Extended Kalman Filter (EKF) for attitude, rate, and constant disturbance torque estimation based on magnetic field measurements and their time derivatives. Tortora et al. [
9] proposed a fast angular rate estimation scheme using magnetometer readings, assuming that the inertial ambient magnetic field vector does not significantly change during the short sampling time. An analytic approach is used in [
9] that does not require attitude information. Humphreys et al. [
10] developed a spinning spacecraft with wire booms, a filter, and smoother based on magnetometer information for estimating the attitude, rate, and boom orientations. Abdelrahman and Park employed magnetometer measurements and their time derivatives with Sigma-Point Kalman Filter for spacecraft three-axis attitude control and rate estimation. This filter’s capability in estimating the attitude is better than 5 deg, and the rate error is on the order of 0.03 deg/s in each axis [
11]. In the above-cited studies, the magnetometer measurements are compared with the geomagnetic field information from a high-order Earth magnetic field model, such as the World Magnetic Model (WMM) or the International Geomagnetic Reference Field (IGRF) or (T89) model. It is worth noting that these models are used for calibrating magnetometers also as in [
12,
13,
14,
15]. Based on magnetometer and Sun sensor information, Soken and Sakai [
16] developed an inertial vector attitude estimate approach for small spacecraft. The technique starts with a basic attitude determination using the TRIAD approach, then introduces the estimated attitude to an Unscented Kalman filter for accurate estimation via magnetometer calibration in real-time. Altuntas et al. [
17] proposed a cascaded filtering scheme in which the QUEST method was employed to update the Multiplicative Extended Kalman Filter at low angular rates with just magnetometer readings. Ivanov et al. [
18] developed, uploaded to SiriusSat-1, and analyzed an extended Kalman Filter in real time to follow the magnetometer bias induced by the onboard magnetic dipoles in order to improve the accuracy of attitude motion estimates. The attitude of a spacecraft spinning at about orbital speed is measured with 3–4° accuracy, with magnetometer bias estimation accuracy in the 400 nTesla range [
18]. Using magnetometer and sun vector readings, Pourtakdoust et al. [
19] constructed a modified Square Root unscented Kalman filter with bounded noise characteristics for attitude and angular rate estimation. Furthermore, the authors proposed a strategy for optimizing the installed sensor orientation in order to decouple the residual signal, which impacts attitude estimate accuracy [
19]. To that purpose, several recent research studies, such as [
20,
21,
22], have employed magnetometer readings to determine attitude.
Other different sensors for low-cost missions, such as the Sun sensor, Earth horizon and even the gyroscope are utilized for attitude estimation as in [
23,
24]. There is a variety of attitude estimation techniques that can be found in the survey of nonlinear attitude filtering methods in [
25], and also in the review on the quaternion-based methods for spacecraft attitude determination in [
26].
Magnetometer measurements are also used in feedback control in several algorithms of spacecraft attitude stabilization, and detumbling maneuver, as in [
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42] and in the survey papers by Silani and Lovera [
1], and by Ovchinnikov and Roldugin [
43]. In these algorithms, the control analysis and design assume continuous-time magnetometer measurements and continuous actuation of the magnetic rods. The fact is magnetometer measurements are often degraded by the time-varying magnetic field generated by the currents in magnetic rods and other spacecraft electronics. Furthermore, the measurements themselves are prone to several types of errors; these errors include null-shift error, the non-linearity error, non-orthogonality error, the sensor noise, hard-iron error and soft-iron errors, in addition to the static and time-varying biases [
12,
13].
One mitigation technique is to use a boom to have a physical separation between the magnetometer and the other spacecraft electronics [
44,
45]. The boom structure, however, results in more complexity for the whole spacecraft system. Another mitigation technique that is usually performed in small low-cost spacecraft missions is to operate the magnetic rods and the magnetometers at alternate times, to eliminate the effect of the rods on the magnetometers [
2,
46,
47]. Celani [
46] presented a magnetic state feedback attitude control law, taking into account the intermittent activation of the magnetic rods and magnetometers during the operation, where a systematic method is proposed for the choice of the sampling period of the updated command and in which, the generated dipole moment is on the basis of piece wise constant command. Celani [
46] assumed that the period that is dedicated to the magnetometer measurements is small enough to be ignored. Celani [
47] extended his work by considering the magnetometer measurement period during the design phase of the control law. A design method and systematic approach are obtained for the selection of the controller’s parameters and actuation interval length, respectively [
47]. The design analysis of magnetic attitude control systems usually neglects this intermittent operation of the magnetic rods, leading to under-estimation of the required maneuver time and the rod’s power consumption [
2]. Desouky and Abdelkhalik [
2] developed an algorithm featured by its low frequency in collecting magnetometer measurements with a higher magnetic rod duty cycle ratio. This algorithm resulted in improvements in the required maneuver time and magnetic rod power consumption at the expense of the required computational demands.
Motivated by the above challenges, this paper presents an attitude estimation and control algorithm that improves the maneuver time and power consumption that is required by magnetic rods. This algorithm estimates the spacecraft attitude, the spacecraft angular rate, and the magnetic field using a modified version of the Multiplicative Extended Kalman Filter (MEKF). The proposed approach uses a magnetometer, gyroscope, and a measurement for an inertial vector such as the direction of the Sun (Sun sensor). For threeaxis attitude control, it is assumed that only magnetic actuators are used. The proposed concept is to eliminate the need to turn off the magnetic rods, in some cycles, to increase the rod’s operation time. This is achieved by using the estimated magnetic field in these cycles instead of the measured one. The key concept of estimating the magnetic field starts by computing a pseudo magnetic field measurement, leveraging the existing spacecraft’s angular velocity feedback loop to probe the magnetic field. This pseudo-measurement is further refined inside the MEKF using a proposed simple magnetic field model. It is shown in this paper that the proposed algorithm can achieve improvements in the power consumption and the maneuver time. The proposed work is assessed via Monte Carlo simulations. The magnetic field estimation is validated using data from the CASSIOPE spacecraft obtained through its telemetry system.
This paper is an extension of the work in [
3] and different than the work in [
2] in the following aspects: (1) computing the pseudo measurements of the magnetic field by measuring the spacecraft response to a known control command is implemented here from a geometric point of view, as opposed to the Tikhonov regularization technique used in [
2], (2) this work uses an attitude sensor, in addition to the magnetometers, in the MEKF, as opposed to using only magnetometers measurements in [
2], and (3) the computational load of the proposed work here is much less than that in [
2], and is comparable to the computational load of most exciting magnetic control techniques within the literature, as are going to be shown within the simulation results. This paper is organized as follows.
Section 2 briefs the spacecraft models. The proposed ADCS is presented in
Section 3.
Section 4 presents the Monte Carlo simulation results. A validation process using real telemetry data with detailed procedures to verify the proposed algorithm is presented in
Section 5.
2. Spacecraft Dynamic Model
This part contains standard information that is used to complete the presentation. Here the coordinate reference frames are presented, as well as the kinetic and kinematic models. For the attitude determination and control algorithm, the following reference frames are used:
Earth-Centered Inertial frame (ECI). The Earth’s center is the ECI frame origin. This reference frame is denoted i, and the earth rotates around its Z-axis. The X-axis points towards the vernal equinox, where the Y-axis complies with the right-handed triad system.
Satellite body frame: This frame’s origin is at the satellite’s centre of mass. The axes are chosen to align with the central principal axes of the spacecraft. The body frame is denoted b.
In the remainder of this paper, represents a matrix, bold symbols represent vector such as , is a skew-symmetric matrix whose elements are the elements of the vector that represents the cross product of , where is a vector, represents an estimation of the vector , represents an error vector added to vector to obtain the estimated vector , as , represents a unit vector in the direction of the vector , and represents the linearization point of the vector function (the linearizion process is carried out at ). The represents vector defined in the inertial frame i. For notation simplification, any vector without a pre-superscript is defined in the (b) frame. The represents the angular velocity of the (b) frame with respect to the (i) frame , expressed in the (b) frame.
The spacecraft attitude in this study is represented by the quaternion to avoid singularity. The attitude kinematics can be written as:
where
is the spacecraft angular velocity of the body frame with respect to the inertial frame, expressed in the body frame. The vector
is the quaternion, and
. Let
. The matrix
is unity matrix. The transformation matrix
from the
i to the
b frame is computed using the quaternion as follows:
The attitude dynamics of a rigid spacecraft are expressed using Euler’s equations as follows [
48,
49]:
where
denotes the spacecraft inertia matrix. As previously stated, the inertia matrix
is fixed in the body frame and is a diagonal matrix since the body frame is aligned with the principal axes. The disturbance torque
here represents the sum of the solar radiation torque
, the aerodynamic torque
, the gravity gradient torque
, the residual magnetic torque
due to the residual magnetic field generated by spacecraft electronics including the magnetic These torque models are summarised in [
28,
42]. The control torque on the spacecraft,
, is here assumed to be due to only the three magnetic coils, and hence it is not feasible to create a torque along the magnetic field vector, since
where
and
represent the ambient magnetic field vector and dipole moment vector, respectively. A detailed description of The dipole moment model as a function of the current that is generated by the magnetic rods is presented in [
28,
42].
3. Attitude Determination and Control System
This section presents the proposed algorithm for spacecraft attitude stabilization and control. First, a reference ADCS algorithm is discussed highlighting the challenges that will be addressed in the proposed algorithm. This reference ADCS algorithm is utilized for comparison and performance evaluation of the proposed ADCS.
In the reference ADCS algorithm, the magnetic rods and the magnetometers are assumed to operate at alternate times, to avoid high noise on the magnetometers’ measurements during the operation of the magnetic rods. This alternate operation means that the magnetic rods operate with a certain duty cycle, as shown in
Figure 1. The sampling time
(sometimes referred to as the cycle period) depends on the rate of update in the control system.
Let
be the magnetic rods duty cycle which is the maximum time period in which the magnetic rods can be turned on, in one cycle period, and let
be the duty cycle percentage or ratio. Hence, we can write:
. Usually, each cycle period includes also a period for magnetometer measurements, a period for raising the magnetic rods currents from zero to the required value (
), and a period for magnetic rods desaturation dedicated to reducing the generated field in the rods. The fall period, in which the current drops to zero, is part of the desaturation period. The lower part of
Figure 1 shows several cycles of the magnetic rods and the magnetometer activation periods. The attitude estimation algorithm typically updates the estimates for the quaternion
, the spacecraft angular velocity
, and/or gyroscope bias
each cycle. The upper part of
Figure 1 shows the estimated and measured quantities, and the times at which they are collected. The measurements are: the angular velocity
, the magnetic field
, and the sun direction
.
Control algorithms that do not account for the above magnetic rod’s duty cycle usually underestimate the maneuver time and the rod’s power consumption [
2]. Increasing the duty cycle ratio
would reduce the actual maneuver time, and enhance the steady-state error and system stability [
6].
In this study, the proposed ADCS algorithm increases the activation time of the magnetic rods, i.e., the duty cycle ratio. This is achieved by estimating the magnetic field parameters at some of the cycles and hence eliminating the need for magnetic field measurements in these cycles. The lower part of
Figure 2 illustrates a scenario where the magnetic field is measured every three cycles while counting on the estimated magnetic field in the cycles that do not have magnetometer measurements at times
and
. At the core of the proposed ADCS is an algorithm that estimates the magnetic field in these cycles (at times
and
) when the magnetometer measurements are not available; this algorithm is presented in
Section 3.2. The upper part of
Figure 2 illustrates the measured and estimated quantities in each cycle. At each of the times,
and
, a calculated magnetic field
is used as a pseudo measurement input to the estimator to estimate the magnetic field
that is used for control. While, at times
and
, the direct true magnetic information measurements
are used for control and attitude estimation.
Hence, a longer duty cycle for the magnetic rods becomes possible. The equivalent duty cycle ratio
for the proposed ADCS can be computed as follows:
where
is the number of cycle periods between the real magnetometer measurements in the proposed algorithm.
The lower section of
Figure 2 depicts a situation in which
. Consider the following standard (reference) control algorithm:
and
[s]. The proposed control algorithm’s duty cycle would be
for
. Let
be the update frequency in the control system. For the sake of comparison,
is assumed constant in this research at the rate
, where
is the sampling time of the reference ADCS.
Section 3.1 presents the control law.
Section 3.2 presents the magnetic field pseudo measurement
computation algorithm. The modified Multiplicative Extended Kalman Filter used in the proposed ADCS is presented in
Section 3.3.
3.1. Control Law
In this paper, the PD-like control logic presented in references [
41,
50,
51] is adopted. The process of computing the control torque starts with computing a control term
, for inertial pointing maneuvers as follows:
where
is the quaternion error vector part between the desired attitude and the current one,
is the spacecraft angular velocity error between the desired rate and the current one,
is the proportional gain,
is the derivative gain, and
is a parameter introduced to limit the controller gains due to the time-varying nature of the ambient magnetic field and consequently limit the settling time of the attitude orientation. The control limit parameter is bounded:
. This control ensures that the equilibrium point is locally exponentially stable [
41,
50]. Due to the singularity caused by the cross product in Equation (
4) [
52], the required dipole moment cannot be determined from a given command control torque. Furthermore, the resultant torque is limited to acting directly in the plane perpendicular to the magnetic field vector for a given dipole moment. To solve this issue, consider
to be the desired torque vector, and
to be the torque vector equal to the projection of
on the plane perpendicular to the ambient magnetic field vector
. The vector
is located in the plane in such a way that the Euclidean norm of the residual vector (or the angle between the vectors
and
) is reduced [
1,
34]. Using the estimated magnetic field vector
, the required dipole moment, at times
and
in
Figure 2, is calculated as follows:
Combining Equations (
4) and (
7), the applied torque becomes:
where the matrix
is semi-positive definite, when
. In this case, the estimated magnetic field
is used for computing the required dipole moment, at times
and
in
Figure 2.
As demonstrated in reference [
53], this time-varying non-autonomous system is controllable over an indefinite time. The stability of such a system is discussed in various references, including [
54], where the generalized average theory was used to demonstrate that the trajectories of non-autonomous systems remain near to the trajectories of its average if
. As a result, the non-autonomous term
in this issue may be substituted by its average,
, which is defined as follows [
50]:
References [
50,
53] show that when
, the average matrix
is positive definite. Further, if we assume that the equilibrium is at
and
, then reference [
55] shows that, as time goes to infinity, the control law guarantees
and
go to equilibrium. Moreover, it was shown in references [
41,
50,
51] that this control law guarantees local asymptomatic stability at the equilibrium point, given the positive definiteness of
. References [
55,
56] as well prove this asymptomatic stability using a Lyapunov approach, assuming that
is bounded by
, and that
is a decreasing function of
and
[
57]. The above-mentioned analysis about the control law (
6) assumed that the magnetic rods are operated in a continuous mode by ignoring the duty cycle effect. Desouky and Abdelkhalik [
6] presented analytically that increasing the duty cycle ratio will reduce the attitude steady-state error. Which can be considered another benefit of the proposed work here.
3.2. Computation of Magnetic Field Pseudo Measurement
The following discussion is dedicated to finding the best guess of the ambient magnetic field vector around the spacecraft when the magnetometer measurements are not available. This best guess,
, is used as a pseudo measurement. Knowing the kinetic model of the spacecraft (Equation (
3)) it is possible to use the angular velocity measurements to obtain an estimate for the spacecraft applied torque,
. This torque
is then used to compute the pseudo measurement of the magnetic field
.
The numerical evaluation of
has a significant impact on the accuracy of the obtained results in this approach. Hence, the five-point stencil method [
58] is used to evaluate the time rate of change of
. The formula for computing
is:
where
h is the time step of the angular velocity measurement. It is worth noting that increasing the number of points for the stencil method leads to more accuracy in estimating the applied torque at the expense of the computational cost. According to Abramowitz [
58], the inaccuracy of the five-point stencil approach is of order
compared to
for the two-point difference method. It is assumed in this study that five gyroscope readings are taken within
, see the upper part of
Figure 2. It is also assumed that an average torque value is constant within each
period. It is noted that this assumption of having a frequency of gyroscope measurements collection at least five times higher than the control command frequency, is a reasonable assumption, as discussed in [
24].
Gyroscope drift rate bias, random walk, scaling factor error, non-linearity error, and misalignment error can all affect gyroscope measurements. In this study, all of the aforementioned errors—aside from the drift rate bias—are treated as a single normal distribution error with a zero mean. This is a reasonable assumption given that the manufacturer often provides the gyroscope’s noise characteristics. On the other hand, gathering several gyroscope observations over an extended period of time is one method for determining the drift rate bias vector. These observations can be compared to those from other sensors, such as star tracker readings, that reveal information about the angular velocities of the spacecraft, where the bias vector can be estimated using an estimation method, such as the least squares method. In accordance with the manufacturer’s recommendations, such as once a month, this procedure can be repeated to update the drifting bias.
However, numerous estimating approaches can estimate the bias in cases where another sensor that provides data on the angular velocities of the spacecraft is unavailable, as is the situation in this work. Such as the Kalman filter, where the manufacturer or customer laboratory studies provide the noise characteristic of the gyroscope inaccuracies and drift bias. In this work, whenever the gyroscope measurements are available, an EKF
is employed to estimate the spacecraft’s angular velocity and bias vector. Between times
and
, this EKF
outputs the estimated angular velocity that is needed to compute the
that is shown in the upper portion of
Figure 2. It is important to remember that updating the drift rate bias onboard can be implemented periodically to lessen the computing load once an adequate assessment of the drift rate bias has been calculated. However, in this study, evaluating the bias vector will be completed at each sampling time in an effort to provide an idea of the worst-case scenario, in terms of computation load, regarding the use of the proposed work.
It is worth noting that the five-stencil approach effectively reduces the drift bias error’s impact on the computation of the . For instance, failing to account for drift rate bias /hr may result in an error when computing equal (2.68 × [rad/s].
The derivative of the angular velocity
can be computed using Equation (
10). Then, an estimation of the torque
can be computed using the Euler dynamic model Equation (
3). Equations (
7) and (
8) imply that the torque, dipole moment and magnetic field vectors are orthogonal to each other in the ideal case when
. Assuming that
remains close to
, and given
and
, it is possible to compute the pseudo measurement vector,
, from a geometric point of view. The unit vector of the
vector can be computed as follows:
In addition, the magnitude of the pseudo measurement of the ambient magnetic field vector can be computed as follows:
Therefore, the pseudo measurements of the ambient magnetic field vector are:
Further analysis over the computation of
is carried out to check the effect of the error in the torque and the dipole moment vectors,
and
, respectively. The torque error is due to the noises in the gyro measurements and the errors in modeling the external disturbance torques such as gravity gradient, residual dipole moment, and aerodynamic drag, in addition to the sensitivity of the spacecraft dynamic model to the uncertainty in the moment of inertia. The error in the dipole moment vector
is due to the uncertainty in the actuator’s model and the noises and digitization process in the measured commanded current to the actuators. The estimate of the torque applied on the spacecraft is expressed as:
Therefore, the torque error vector is as follows:
The most dominant term in Equation (
15) on the right-hand side is the first term. Therefore, Equation (
15) can be approximated as follows:
where a bound
on the ambient magnetic field error vector,
, is added. To make this analysis easier to visualize, we express the error in each vector in terms of the corresponding angle. The angle
is the angle between the computed torque
and the true torque
. While the angle
is the angle between the estimated dipole moment vector
and the true dipole moment vector
, see
Figure 3. Considering
Figure 3, it is possible to express the error vector in the ambient magnetic field,
in terms of the angle
as follows:
where the angle
between the optimal
vector and the true one
should be kept under a threshold angle
.
Figure 4 shows the typical relation between the angles
and
for different values of
where
is presented on the right vertical axis. For a wide range of the angle
, there is almost no change in the angle
. In the same figure, the relation between the angles
and
for different values of
is plotted, where
is presented on the left axis. The correlation between
and
is strong; consequentially
has a significant impact on
, in compliance with Equation (
16).
The angle
can be used as a measure for the accuracy of computing the estimated torque
. Neglecting
,
Figure 5 shows the angle
history for a test case scenario. In that test case, there is an agreement between the computed torque and the true one to an acceptable accuracy as demonstrated in
Figure 5. The angle error
between the two vectors is very small. Hence, it can be concluded that the error in
is small in the estimation process described above, and hence the error
is small. This completes the process of computing the vector of the geomagnetic field
, and completes the calculations needed in the proposed control algorithm.
3.3. Attitude Estimation
The continuous-discrete MEKF in [
59] is modified here to estimate the following: the attitude quaternion
, the angular velocity
, and the magnetic field
.
The measurements used by this MEKF are the angular velocity from the gyroscope, the direction of the sun from the sun sensor, and magnetic field pseudo measurements
at times
and
, see
Figure 2. For inertial pointing maneuvers, the state vector is
, and the error state vector is
, where
is the quaternion vector part error. Let
be the a prior estimate from the propagation step, and
be the posterior estimate from the update step. The propagation and update steps of the MEKF are presented below.
3.3.1. State Propagation
During the propagation step, the angular velocities and the quaternion state variables are integrated numerically, using a 4th order Runge–Kutta integration for the nonlinear kinetic Equation (
3), and for the kinematic model in Equation (
1), to obtain a prior estimate of the angular velocities
and the quaternion
. The magnetic field state, however, will be propagated using a simple model as shown below.
It is assumed here, that the derivative of the
vector in the inertial frame does not change (i.e.,
) during the propagation of the magnetic field vector
. This assumption is acceptable for a small time step [
9]. Consider the posterior estimated magnetic field vector
, computed at the time step
. The quaternion conjugate of the posterior quaternion update at the time step
is
. Then we can write:
where
is the transformation matrix from the body frame to the inertial frame at the time step
. The
can be transformed to the body frame using the transformation matrix
; hence for small time step we can assume that
, and hence
; we can then write:
Equation (
19) can be used to propagate the magnetic field vector to acquire a prior estimate of the magnetic field
at step time
k. The covariance matrix
propagates in time according to the Joseph form [
59], which has been shown to be numerically stable but requires more computational power [
59]. In the interest of having a simpler numerical implementation that requires less computational power, the following approximation is adopted [
59,
60]:
where
is the discrete-time process covariance matrix, and
is the state transition matrix. In order to find the state transition matrix
, a linearization for this model is carried out as detailed below.
The derivative of Equation (
19) is as follows:
where
[
49]. It is worth noting that the same derivative equation can be obtained using the transport theorem as follows (assuming
) [
49,
61,
62]:
The linearized first-order Taylor expansion version of Equation (
22) results in the small-signal dynamic equation of the magnetic field as follows:
Using Equation (
3), the small-signal dynamic equation of the angular velocity becomes:
The quaternion small-signal dynamic equation is:
The state transition matrix can be approximated as
for small time step
[
63], where
is the Jacobian matrix. The Jacobian matrix can be computed from Equations (
23)–(
25) to give:
where
where the nominal values
are the a priori propagated values of the state vector.
3.3.2. State Update
A linearization of the measurement model about the a priori state estimate is here carried out for use inside the MEKF. The sun sensor measurement is
, where:
Assuming small angles, the transformation matrix can be approximated as
. Using this approximation, the error in the sun direction can be approximated as follows:
The linearized small error measurement model about the apriori state estimate can be written as follows:
where
is the small-signal (error) measurement vector. At each measurement time, a Kalman gain is computed using Equation (
31).
The states error vector
is computed as follows:
where
and
are the measurements from the gyroscope and sun sensor respectively. The
is the bias vector that will be estimated using the equations of the EKF
that are given in
Appendix A. The update step is carried out for each of the
,
, and
states differently. The quaternion is updated using a quaternion multiplication as shown in Equation (
33).
where ⊗ represents the quaternion product. The term
is used for preserving the quaternion normalization of the computed quaternion error
, as shown in Equation (
33).
The magnetic field
, on the other hand, is updated in two steps. Recall that the propagation step of
in Equation (
19) used
. Now that
is available, the latter is used to achieve a better propagation of
. This is carried out as follows:
. Then the magnetic field is updated using this new propagated vector
along with the error in magnetic field vector
, which is computed using the associated part of the Kalman gain and the measurements (or pseudo measurements), Equation (
32):
where the spacecraft angular velocity is updated using the standard approach in Equation (
35).
The estimated angular velocity bias vector (in the intervals
) from EKF
is used here to update the angular velocity and will not be estimated at times
to reduce the computational cost. The estimation error covariance matrix
is updated as follows:
3.4. Stability and Performance of the Modified MEKF
The estimation error covariance matrix , which could turn into a non-positive matrix throughout the propagation and update processes, is one of the elements that affects the stability of the MEKF. Numerical instabilities could cause this. In order to confirm the stability, the eigenvalues of the matrix are always confirmed to be positive during the simulation of the Monte Carlo runs in the following section.
Performance of the filter is significantly influenced by the kind of measurement and process noise errors. The performance of the filter might be substantially hampered by inaccurate noise error representation. In order to obtain the best approximation, a filter tuning method is typically used to modify the filter’s parameters. It is possible to tune filters offline using numerical optimization methods or online using adaptive algorithms [
64]. However, according to [
64], manual optimization is more common in practise. To give the measurements the maximum weight possible during manual optimization, choose small values for the measurement error covariance matrix, smaller than what the manufacturer or a laboratory test supplied. After that, modify the original estimate and process the noisy covariance matrices to obtain an acceptable level of performance. The method is then repeated until the needed performance is achieved, as noted in [
64]. According to the statistical analysis of the outcomes of the Monte Carlo simulation, a manual optimization approach for the covariance matrices is used and validated in this study.
4. Numerical Simulations
The goal of this section is to compare the proposed algorithm in this paper, which is shown in
Figure 2, to a reference standard algorithm. In the reference algorithm, both the magnetic rods and the magnetometers are turned on, alternately, during each cycle period, as shown in
Figure 1. Monte Carlo (MC) simulation is conducted for this comparison. To highlight the impact of the proposed algorithm compared to the reference one, the output results from the proposed algorithm are normalized by the results from the reference algorithm. The hardware configuration and spacecraft parameters are the same for both algorithms and are similar to those in reference [
2].
Table 1 shows both the spacecraft parameters and sun-synchronous orbital parameters.
The orbital position and velocity of the spacecraft are propagated in time using a model that accounts for the J2 gravitational effect. For orbit propagation, the J2000 inertial frame of reference is used. The orbit propagator output is used to calculate the spacecraft’s location with regard to the earth and sun, as well as the aerodynamic density and geomagnetic field.
To replicate the uncertainty in the spacecraft and environment models, a random Gaussian process is applied. An additional Gaussian random-direction torque is provided to address unknown torque sources, modeling flaws in the gravity gradient torque model, and inertia uncertainty in Equation (
3). The mean value of this torque is chosen to be zero, with a standard deviation of
[N
m]. The uncertainty in the spacecraft inertia tensor when computing the torque in
Section 3.2 is modeled as an additive Gaussian variable with a mean of
. The simulation parameters are presented in
Table 2. The measurements of the sun sensor and the magnetometers are assumed to have random Gaussian noises and a static bias. The mean value of this white noise is adjusted to zero for both the sun sensor and the magnetometer, with standard deviations of
and
[Tesla], respectively. The gyroscope is assumed subject to a drift bias and stochastic white noise. This white noise’s mean value is set to zero, with a standard deviation of
[rad/s].
The parameters of the control algorithms are as follows: and . Therefore, the control command frequency is , and the gyroscope measurements frequency is selected to be . The control gains are: , , and . A confirmation window of 5-min is utilized after settling to the specified attitude.
4.1. Case Study
Before presenting the statistical MC analysis, the results from a sample run for the proposed ADCS algorithm are presented. In this example, each of the satellite’s initial angular velocity (true and estimated), and the initial attitude (true and estimated) are selected randomly. The simulation runs for 10 orbits. To make this presentation more clear, the attitude error will be represented in terms of the principal rotation error angle
between the current attitude and the desired one.
Figure 6 shows the principal rotation error angle for the reference case and the proposed algorithm with
, (labeled “Ref” and “Proposed
” respectively). As shown in
Figure 6, the proposed algorithm is able to settle at the desired attitude faster than the reference algorithm. Further notice, as can be shown for the zoom part of
Figure 6, that the average attitude steady-state error of the proposed algorithm is less than the one from the reference case. This is due to increasing the duty cycle of magnetic rods that leads to decreasing the steady state error as analyzed in [
6].
Figure 7 depicts the time behavior of the satellite’s angular velocity magnitude of the body frame. The figure shows that almost a zero angular velocity magnitude is preserved by the proposed algorithm after settling the spacecraft at the specified attitude.
Figure 8 represents the magnetic field time history of the estimated and true values. As are often seen, a good match has been achieved. Later, six parameters will be presented to assess the ambient magnetic field estimation performance.
The above simulation is repeated for several values of the proposed algorithm. In this section, two parameters are used for comparison. The first parameter is the Power Consumption (PC) of the magnetic rods. The second parameter is the Maneuver Time (MT), which is defined here as the time until the spacecraft’s attitude is less than error around the desired attitude plus the confirmation window of five minutes in which the spacecraft attitude remains within the error bounds. Regarding the Computational Load (CL) of the proposed algorithm, a measure of the total computational time per maneuver is computed using the Matlab built-in function (tic/toc). The above three parameters are computed for the proposed algorithm, and then are normalized w.r.t. the same parameters of the reference algorithm.
Figure 9 shows the normalized maneuver time (
), the normalized power consumption (
) (on the left axis) and the normalized computational load (
) (on the right axis,) for different values of
. The
and
are always less than 1, which means less power consumption and less maneuver time compared to the reference algorithm, for all
. Both the PC and the MT improve (decrease) as
increases, up to a point. As
increases beyond the value of 6, the change in
becomes very small. For example, the proposed duty cycle is
at
, while at
, it is
, see Equation (
5). Increasing
, however, increases the CL as shown on the right vertical axis in
Figure 9.
For further assessment of estimating the ambient magnetic field, six parameters are used. The first is the correlation coefficient (CC) between the estimated and true values of the magnetic field. When the CC is close to 1, it indicates a strong correlation, and when the CC is close to 0, it indicates weak correlation. The scatter index (SI) indicates statistically how the computed quantity is scattered around the true one, the smaller the SI the higher is that the performance. The normalized root mean square error (NRMSE), mean absolute error (MAE), bias, and root mean square error (RMSE) are also computed for the obtained simulation data.
Figure 10 shows the change of the CC with
on the left axis. On the right axis, the NRMSE and SI are depicted. The CC is close to 1, and the SI and NRMSE are very small, indicating a strong correlation with less scattering between the estimated and the true magnetic fields.
Figure 11 shows the bias, RMSE, and MAE. The variation of all parameters confirms that the lower the
the better ambient magnetic field estimation. In the following Monte Carlo analysis, the
value is selected to be 6 which means
compared to
in the reference algorithm.
4.2. Monte Carlo Simulation Analysis
Results are here presented for 45,000 Monte Carlo runs; 22,500 for the reference algorithm and 22,500 for the proposed algorithm. Normal distribution is used for noises seeds, with a different distribution for each run.
The 22,500 categories have different initial angular rates (true and estimated), and initial quaternion (true and estimated), from all other categories. These values are generated randomly and are equivalent for both algorithms. So, the results are reported in terms of improvement percentage in PC, MT, and CL. Here, the percent improvement
is computed as follows:
where
represents the MT or the PC or the CL, the subscript
P represents the computed
values for the proposed ADCS, the subscript
R represents the computed
values for the reference ADCS, and
represents the percentage improvement in the
. As a measure of the estimation error, the CC, SI, NRMSE, MAE, Bias, and RMSE are computed and averaged. All the disturbance torques mentioned in this paper are simulated.
Table 3 shows the estimate of the magnitude of these disturbance torques, in the worst-case of the entire MC runs.
Figure 12 depicts the Gaussian distribution and histogram of
.
Figure 12 shows that the maneuver time of the proposed algorithm is significantly less than that of the reference case. In some cases, the proposed algorithm achieves
of about
, whereas in other cases there is almost no improvement, compared to the reference algorithm. The mean value of the
is
, with
standard deviation.
In terms of power consumption, the proposed algorithm increases the mean value of the
significantly as shown in
Figure 13. The
, using the proposed algorithm, goes up to about
in some cases. The mean value for the
is
, with a
standard deviation.
The computational load is computed for the whole maneuver. Overall, the proposed algorithm has a higher computational load compared to the reference algorithm because of the additional computations in evaluating and in the MEKF magnetic propagation step. It is noticed that the computational load of the proposed algorithm roughly needs about more computational resources at every time step. It should be noted that, while this approach provides an approximate estimate of the CL when run on the Matlab environment, it does not explain the CL of the suggested technique when run on flying hardware. In reality, the technique may be considerably more effective in terms of CL after implementation than Matlab suggested, since the CL may be substantially improved throughout the implementation.
However, when the savings in the maneuver time are significant, the computational time of the proposed algorithm becomes less than that of the reference algorithm, simply because the whole maneuver is completed in a significantly shorter period of time, and hence the computations stop much sooner compared to the reference algorithm. This observation is evident in
Figure 14, where there is a strong correlation between the
and the
.
Finally, regarding the estimated magnetic field parameters within the above MC simulations, all six parameters are computed as follows. Each one run resulted in a time history for and vectors. The six parameters are computed for each component of resulting in three components. For each run, an average of the three components is computed.
The mean and standard deviation values for the six parameters for the entire MC runs are presented in
Table 4. The results show a strong correlation and less scattering in these MC runs.
5. Verification Using Real Data
This section is devoted to validating the estimation of the magnetic field. Real telemetry data from the CASSIOPE spacecraft are used for verification. The CASSIOPE is a multimission satellite from Canadian Space Agency (CSA). Its objectives are space weather operation and high-speed communications concepts verification [
44,
65]. Three-star trackers are used for attitude determination. Two magnetometers are installed on two different booms. The magnetic rods’ maximum dipole moment is 30 [Am
] and they have activated alternately with the magnetometers, with a duty cycle of
.
The technical team provided real telemetry information for the ground station tracking maneuvers, that is performed on 21 February 2019. These telemetry data consists of the time history of angular velocity measurements , magnetic field measurements , reaction wheels torques , magnetic rods torques , controller dipole moment , control term or designed torque and Ephemeris. The designed torque is the magnetic controller output. The Ephemeris includes the attitude (in terms of the Euler angles roll, pitch and yaw,) the spacecraft position and velocity in an inertial frame, latitude, longitude, and altitude (in the World Geodetic System 1984 (WGS84) frame, and in the Earth-centered inertial (J2000) frame). The telemetry data sampling time is s, whereas the Ephemeris sampling time is 5 s, for two maneuvers with periods 200 s and 360 s, respectively. The duty cycle will be s as a result.
The star tracker provides the attitude. Therefore, no attitude estimation is performed in this verification process. However, this attitude information will be used in Equation (
18) to propagate the magnetic field.
The CASSIOPE is modeled in this paper as a rigid body, and its moments of inertia are optimized to account for unmodeled structural flexibility. The initial inertia tensor matrix is given as follows:
The magnetic field estimation verification process is as follows:
- (1)
Computing the pseudo measurement
as described in
Section 3.2. The spacecraft angular velocities provided by the gyroscope have bias and noise. Hence a batch optimization process is first conducted to estimate this bias. This optimization process searches for the spacecraft’s initial angular velocity that minimizes the difference between the true attitude
(obtained from the star trackers) and the propagated one
(obtained using the attitude kinematics Equation (
1)). The objective function
J is:
The bias vector is here assumed to be the difference between the mean value of the propagated angular velocity (using the initial angular velocity output from the optimization process) and the measured angular velocity from the gyroscope (the mean value of a polynomial fit for the measurements). This step is performed on just one occasion only. Therefore the output unbiased angular velocity measurements are shown in
Figure 15 and
Figure 16, (labeled “Unbiased Measurement”).
- (2)
An Extended Kalman Filter (EKF) is used to estimate the noises from these unbiased angular velocity measurements. The EKF uses the following three diagonal covariance matrices: initial state covariance
, measurement noise error covariance
, and process noise error covariance
, where
means a diagonal matrix whose diagonal elements are
x. The covariance matrices are chosen manually, as indicated in the
Section 3.4, which follows the procedure provided in [
64]. Euler Equation (
3) is used for propagating the spacecraft angular velocity in the EKF, while the unbiased angular velocity is used as the measurement input to the EKF. The output angular velocity from EKF is shown in
Figure 15 and
Figure 16. The equations of this EKF are given in
Appendix B.
- (3)
The numerical calculation of the spacecraft angular speed derivative
using the five-stencil approach requires at least five consecutive angular velocity readings, in one cycle period (in which the torque is constant). Therefore, interpolation is employed to compute these velocities. Once the
is computed numerically, the pseudo measurement
is computed as discussed in
Section 3.2.
- (4)
Another EKF is used for magnetic field estimation, where the pseudo measurement
is the EKF input measurement. The magnetic field propagation model Equation (
18) propagates the magnetic field. The following three diagonal covariance matrices are used: initial state covariance
, measurement noise error covariance
, and
is used as the process noise error covariance. The equations of this EKF are given in
Appendix C.
It is worth noting that the two EKFs can be combined together. However, they are implemented separately in this study.
For the first
s maneuver, using
,
Figure 15 shows the un-biased angular velocity measurement versus the estimated one using the EKF. The matching proves that the rigid body Euler model can reasonably render the CASSIOPE dynamics.
Figure 17 shows the comparison between the X components of each of the real magnetic field measurement (labeled “True"), the pseudo measurement
(labeled “Computed",) and the EKF estimated values (Labeled “Estimated").
Figure 17,
Figure 18 and
Figure 19 render the good performance of the estimation process in the X, Y, and Z directions, respectively. The six-validation parameters are computed for different values of
and the results are plotted in
Figure 20 and
Figure 21. The results here are in agreement with the conclusions from the Monte Carlo analysis; the lower the
the better the magnetic field estimation accuracy.
Another maneuver of
s duration is also verified. The angular velocities histories are shown in
Figure 16. The magnetic field estimation values compared with the pseudo measurements and the true measurement are plotted in
Figure 22. The magnetic field estimation accuracy is good, as evident from
Figure 22. This is also confirmed by the values of the six validation parameters, which are listed in
Table 5, for this maneuver, using
.