# Signal Conditioning for the Kalman Filter: Application to Satellite Attitude Estimation with Magnetometer and Sun Sensors

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

- Sensors & Drivers: It gives the direction vector of the Earth’s magnetic field (Bmm, σmm) and the direction vector of the Sun (Sss, σss). The vectors are measured in Satellite Body Reference Frame (SBF). In addition, the ADCS should know the system time (t, σt).
- Space Models: Based on a set of mathematical models, namely a model of orbital propagation [6], a model of Earth magnetic field [7] and an orbital model of Earth [8], the ADCS calculates the orbital position (P, σp), a direction vector of the Sun (Ssm, σsm) and a direction vector of the Earth’s magnetic field (Bwm, σwm). The vectors Ssm and Bwm should be referenced to the Earth Centered Inertial Frame (ECI) [8].
- Quaternion Determination: The quaternion (q, σq) that describes the satellite orientation would be computed from measured vectors and calculated vectors. It will be shown in this article that ill conditioned problems can appear.
- Kalman Filter: In order to estimate the system state, the Kalman filter proceeds iteratively, with two steps in each iteration. The first step is prediction of state (Xp, σxp), and the second step is correction of that prediction (X, σx). The correction is based on the quaternion just determined at the time of correction.
- Control Algorithm: The attitude controller should generate a control signal (U, σu) for the actuation. The controller takes into account the estimated state (X, σx) and a reference signal (F, σf).

## 2. Background

#### 2.1. Attitude Representation with Quaternions

#### 2.2. State Variable Models

#### 2.3. Kalman Filter

## 3. Attitude Estimation with the Kalman Filter

#### 3.1. Attitude Behaviour

- ω is the angular velocity vector of the satellite in body axes;
- J is the tensor of inertia;
- τ is in body axes the vector of torques applied to the satellite: it includes perturbations and control actions;
- $\Xi \left(\omega \right)=\left[\begin{array}{ccc}0& -{\omega}_{3}& {\omega}_{2}\\ {\omega}_{3}& 0& -{\omega}_{1}\\ -{\omega}_{2}& {\omega}_{1}& 0\end{array}\right]$.

#### 3.2. Observability Issues

#### 3.3. Discretization

## 4. Quaternion Determination. Conditioning

#### 4.1. Quest

#### 4.2. Problems Related to Singularities

#### 4.3. A Solution Based on Conditioning

## 5. Aspects of the Application to a Satellite

#### 5.1. INTA Nanosat-1B Satellite

#### 5.2. Measurement Noise and Sensors

#### 5.2.1. Magnetometer

#### 5.2.2. Sun Sensors

#### 5.3. Process Noise

#### 5.3.1. Input and Perturbation Noise

_{MT}, has been decided considering the satellite inertia. The MDM of the satellite, MagDip

_{SAT}, was first been estimated on ground for checking whether it can be cancelled by the actuators; however, it must be estimated again once in orbit. Since the characteristics of the orbit were known, the maximum value of the Earth’s magnetic field (as felt by the satellite), |B

_{max}|, is known. With this information it is possible to evaluate the maximum values of actuation and perturbation torques. Concerning the actuation signal, a 1% of its maximum value would be assigned to error, being Q

_{MT}its variance. With respect to the MDM, it would be not modeled by now, so a 100% of its magnitude would be assigned to error, being Q

_{PER}its variance.

#### 5.3.2. Discretization Noise

_{DIS}, Q

_{MT}and Q

_{PER}. In total, the variance of the process noise, Q, would be:

**B**alignment singularities.

#### 5.4. Magentic Dipole Estimation

_{SAT}with the angular velocity. The magnetic dipole should be estimated in flight. The idea is to make it part of the complete state to be estimated. A new state dynamics equation is written as follows:

_{SAT}would be not observable. Fortunately, the magnetic field (as seen by the satellite) has two complete rotations per orbit; this makes possible to estimate different dipole components in different parts of the orbit, as shown in Figure 12 (curves that converge to true values).

## 6. Conclusions

## Acknowledgments

## Author Contributions

## Conflicts of Interest

## References

- Wertz, J.R. Spacecraft Attitude Determination and Control; Kluwer Academic Publisher: Dordrecht, The Netherlands, 1978. [Google Scholar]
- Sidi, M.J. Spacecraft Dynamics & Control; Cambridge University Press: Cambridge, UK, 1997. [Google Scholar]
- Kalman, R.E. A new approach to linear filtering and prediction problems. J. Basic Eng.
**1960**, 82, 35–45. [Google Scholar] [CrossRef] - Kalman, R.E.; Bucy, R.S. New results in linear filtering and prediction theory. J. Basic Eng.
**1961**, 83, 95–108. [Google Scholar] [CrossRef] - Diebel, J. Representing attitude: Euler angles, unit quaternions, and rotation vectors. Matrix
**2006**, 58, 1–35. [Google Scholar] - Hoots, F.R.; Roehrich, R.L. Models for Propagation of NORAD Element Sets. Spacetrack Report No. 3. December 1988. Available online: www.celestrak.com/NORAD/documentation/spacetrk.pdf (accessed on 2 August 2016).
- Maus, S.; Macmillan, S.; McLean, S.; Hamilton, B.; Nair, M.; Thomson, A.; Rollins, C. The US/UK World Magnetic Model for 2010–2015. NOAA Technical Report NESDIS/NGDC 2010. Available online: www.geomag.bgs.ac.uk/documents/WMM2010_Report.pdf (accessed on 2 August 2016).
- Vallado, D.A. Fundamentals of Astrodynamics and Applications; Springer Science & Business Media: Berlin, Germany, 2003. [Google Scholar]
- Wen, J.Y.; Kreutz-Delgado, K. The attitude control problem. IEEE Trans. Autom. Control
**1991**, 36, 1148–1162. [Google Scholar] [CrossRef] - Shuster, M.D. A survey of attitude representations. Navigation
**1993**, 8, 439–517. [Google Scholar] - Lefferts, E.J.; Markley, F.L.; Shuster, M.D. Kalman filtering for spacecraft attitude estimation. J. Guid. Control Dyn.
**1982**, 5, 417–429. [Google Scholar] [CrossRef] - Trawny, N.; Roumeliotis, S.I. Indirect Kalman Filter for 3D Attitude Estimation; Technical Report Number 2005-002; Department of Computer Science & Engineering, University of Minnesota: Minneapolis, MN, USA, 2005; Volume 2. [Google Scholar]
- Crassidis, J.L.; Markley, F.L. Predictive filtering for attitude estimation without rate sensors. Adv. Astronaut. Sci.
**1996**, 93, 1021–1038. [Google Scholar] [CrossRef] - Edwan, E.; Knedlik, S.; Loffeld, O. Angular motion estimation using dynamic models in a gyro-free inertial measurement unit. Sensors
**2012**, 12, 5310–5327. [Google Scholar] [CrossRef] [PubMed] - Hamzah, N.H.; Yaacob, S.; Muthusamy, H.; Hamzah, N. Comparative Study of Extended Kalman Filter and Particle Filter for Attitude Estimation in Gyroless Low Earth Orbit Spacecraft. In Advanced Computational Methods for Knowledge Engineering; Springer International Publishing: Berlin, Germany, 2015; pp. 95–106. [Google Scholar]
- Crespillo, O.G.; Cuccci, D.A.; Khaghani, M. Unscented Kalman Filter for Angular Rate Estimation in Gyro-Free Inertial System. In Proceedings of the ION GNSS+ 2016, Portland, OR, USA, 12–13 September 2016.
- Yang, Y. Spacecraft attitude determination and control: Quaternion based method. Ann. Rev. Control
**2012**, 36, 198–219. [Google Scholar] [CrossRef] - Wahba, G. A least squares estimate of spacecraft attitude. SIAM Rev.
**1965**, 7, 409. [Google Scholar] [CrossRef] - Shuster, M.D.; Oh, S.D. Three-Axis attitude determination form vector observations. J. Guid. Control
**1981**, 4, 70–77. [Google Scholar] [CrossRef] - INTA NanoSat-1B at eoPortal Directory. Available online: https://directory.eoportal.org/web/eoportal/satellite-missions/n/nanosat-1b (accessed on 2 August 2016).
- Díaz-Michelena, M. Small Magnetic Sensors for Space Applications. Sensors
**2009**, 9, 2271–2288. [Google Scholar] [CrossRef] [PubMed] - Pita, L.C.; San Roman, S.E.; Giron-Sierra, J.M.; Barriga, J.R.; de Vicente, P.D.; Jerez, M.A. Getting more performance from INTA NanoSat-1B truncated pyramid Sun sensors. IEEE Sens. J.
**2014**, 14, 1867–1877. [Google Scholar] [CrossRef] - Polo, O.R.; Esteban, S.; Cercos, L.; Parra, P.; Angulo, M. End-to-end validation process for the INTA-Nanosat-1B Attitude Control System. Acta Astronaut.
**2014**, 93, 94–105. [Google Scholar] [CrossRef]

**Figure 2.**Real (dots) and estimated (solid) angular velocities in a simulated case, where a Kalman filter observer based on Equations (19) and (20) was used. The filter is not able to correctly estimate the velocity components, since the model used is not observable.

**Figure 3.**Real (dots) and estimated (solid) angular velocities in a simulated case, where a Kalman filter observer based on modified –observable– model was used. The filter now is able to correctly estimate the velocity components, since the model used is observable.

**Figure 4.**Good vector configuration (

**Left**), and ill conditioned vector configuration (

**Right**) for determining the attitude. The problem in the configuration on the right side is that a small error in a vector generates a considerable rotation error.

**Figure 5.**Top plot shows determined (dots) and estimated quaternion (solid) in a simulation with noisy observation vectors. Bottom plot shows simulated (dots) and estimated (solid) angular velocity. Notice the accommodation problem of the Kalman filter.

**Figure 6.**Result of the proposed calculation of quaternion variances, taking the same simulated example as in Figure 5. Top plot shows determined (dots) and estimated quaternion (solid). Bottom plot shows simulated (dots) and estimated (solid) angular velocity. In this case the filter isolates ill condition measurements and reduces accommodation.

**Figure 7.**The plot on top shows the variances of the determined quaternion. The plot in the middle shows the main components of the covariance matrix of Kalman filter for the angular velocity. The plot at the bottom shows the main correction gains of Kalman filter for the angular velocity.

**Figure 8.**INTA NS-1B ADCS sensors and actuators. On the left hand side: Sun sensors (truncated pyramids) are on the equatorial border and on top panel of the satellite. On top right: The complete magnetometer; on bottom left: Three magneto-torquers attached to a box.

**Figure 10.**Experimental setup to evaluate Sun sensor drivers. In this case the Sun sensor is suffering shadow and albedo effect.

**Figure 11.**NS-1B attitude estimation using Kalman filter without magnetic perturbation modelling. The angular velocity estimation (solid line) does not converge to simulation due to magnetic dipole perturbation.

**Figure 12.**NS-1B attitude estimation (solid line) using Kalman filter including dipole moment estimation. It can be noticed that there are some MDM observability problems, causing divergences in some time intervals.

Variable | Magnitude | Error % | Variance |
---|---|---|

|MagDip_{MT}| | 0.5 A·m^{2} | |

|MagDip_{SAT}| | 0.02 A·m^{2} | |

|B_{max}| | 0.5 × 10^{−4} Teslas | |

τ_{MT} ≤ |B_{max}|·|MagDip_{MT}| | 2.5 × 10^{−5} N·m | 3σ = 1% | Q_{MT} = 6.9444 × 10^{−15} |

τ_{PER} ≤ |B_{max}|·||MagDip_{SAT}| | 1 × 10^{−6} N·m | 3σ = 100% | Q_{PER} = 1.1111 × 10^{−13} |

© 2016 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC-BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Esteban, S.; Girón-Sierra, J.M.; Polo, Ó.R.; Angulo, M.
Signal Conditioning for the Kalman Filter: Application to Satellite Attitude Estimation with Magnetometer and Sun Sensors. *Sensors* **2016**, *16*, 1817.
https://doi.org/10.3390/s16111817

**AMA Style**

Esteban S, Girón-Sierra JM, Polo ÓR, Angulo M.
Signal Conditioning for the Kalman Filter: Application to Satellite Attitude Estimation with Magnetometer and Sun Sensors. *Sensors*. 2016; 16(11):1817.
https://doi.org/10.3390/s16111817

**Chicago/Turabian Style**

Esteban, Segundo, Jose M. Girón-Sierra, Óscar R. Polo, and Manuel Angulo.
2016. "Signal Conditioning for the Kalman Filter: Application to Satellite Attitude Estimation with Magnetometer and Sun Sensors" *Sensors* 16, no. 11: 1817.
https://doi.org/10.3390/s16111817