# Spacecraft attitude determination

Spacecraft attitude determination is the process of determining the orientation of a spacecraft (vehicle or satellite). It is a pre-requisite for spacecraft attitude control. A variety of sensors are utilized for relative and absolute attitude determination.

## Sensors
### Relative attitude sensors

Many sensors generate outputs that reflect the rate of change in attitude. These require a known initial attitude, or external information to use them to determine attitude. Many of this class of sensor have some noise, leading to inaccuracies if not corrected by absolute attitude sensors.

#### Gyroscopes

Gyroscopes are devices that sense rotation in three-dimensional space without reliance on the observation of external objects. Classically, a gyroscope consists of a spinning mass, but there are also "ring laser gyros" utilizing coherent light reflected around a closed path. Another type of "gyro" is a hemispherical resonator gyro where a crystal cup shaped like a wine glass can be driven into oscillation just as a wine glass "sings" as a finger is rubbed around its rim. The orientation of the oscillation is fixed in inertial space, so measuring the orientation of the oscillation relative to the spacecraft can be used to sense the motion of the spacecraft with respect to inertial space.

#### Motion reference units

Motion reference units are a kind of inertial measurement unit with single- or multi-axis motion sensors. They utilize MEMS gyroscopes. Some multi-axis MRUs are capable of measuring roll, pitch, yaw and heave. They have applications outside the aeronautical field, such as:
* Antenna motion compensation and stabilization
* Dynamic positioning
* Heave compensation of offshore cranes
* High speed craft motion control and damping systems
* Hydro acoustic positioning
* Motion compensation of single and multibeam echosounders
* Ocean wave measurements
* Offshore structure motion monitoring
* Orientation and attitude measurements on Autonomous underwater vehicles and Remotely operated underwater vehicles
* Ship motion monitoring

### Absolute attitude sensors

This class of sensors sense the position or orientation of fields, objects or other phenomena outside the spacecraft.

#### Horizon sensor

A horizon sensor is an optical instrument that detects light from the 'limb' of Earth's atmosphere, i.e., at the horizon. Thermal infrared sensing is often used, which senses the comparative warmth of the atmosphere, compared to the much colder cosmic background. This sensor provides orientation with respect to Earth about two orthogonal axes. It tends to be less precise than sensors based on stellar observation. Sometimes referred to as an Earth sensor.

#### Orbital gyrocompass

Similar to the way that a terrestrial gyrocompass uses a pendulum to sense local gravity and force its gyro into alignment with Earth's spin vector, and therefore point north, an orbital gyrocompass uses a horizon sensor to sense the direction to Earth's center, and a gyro to sense rotation about an axis normal to the orbit plane. Thus, the horizon sensor provides pitch and roll measurements, and the gyro provides yaw. See Tait-Bryan angles.

#### Sun sensor

A Sun sensor is a device that senses the direction to the Sun. This can be as simple as some solar cells and shades, or as complex as a steerable telescope, depending on mission requirements.

#### Earth sensor

An Earth sensor is a device that senses the direction to Earth. It is usually an infrared camera; nowadays the main method to detect attitude is the star tracker, but Earth sensors are still integrated in satellites for their low cost and reliability.

#### Star tracker

A star tracker is an optical device that measures the position(s) of star(s) using photocell(s) or a camera. It uses magnitude of brightness and spectral type to identify and then calculate the relative position of stars around it.

#### Magnetometer

A magnetometer is a device that senses magnetic field strength and, when used in a three-axis triad, magnetic field direction. As a spacecraft navigational aid, sensed field strength and direction is compared to a map of Earth's magnetic field stored in the memory of an on-board or ground-based guidance computer. If spacecraft position is known then attitude can be inferred.

## Estimation

Attitude cannot be measured directly by any single measurement, and so must be calculated (or estimated) from a set of measurements (often using different sensors). This can be done either statically (calculating the attitude using only the measurements currently available), or through the use of a statistical filter (most commonly, the Kalman filter) that statistically combine previous attitude estimates with current sensor measurements to obtain an optimal estimate of the current attitude.

### Static attitude estimation methods

Static attitude estimation methods are solutions to Wahba's problem. Many solutions have been proposed, notably Davenport's q-method, QUEST, TRIAD, and singular value decomposition.
Crassidis, John L., and John L. Junkins.. Chapman and Hall/CRC, 2004.

### Sequential estimation methods

Kalman filtering can be used to sequentially estimate the attitude, as well as the angular rate. Because attitude dynamics (combination of rigid body dynamics and attitude kinematics) are non-linear, a linear Kalman filter is not sufficient. Because attitude dynamics is not very non-linear, the Extended Kalman filter is usually sufficient (however Crassidis and Markely demonstrated that the Unscented Kalman filter could be used, and can provide benefits in cases where the initial estimate is poor). Multiple methods have been proposed, however the Multiplicative Extended Kalman Filter (MEKF) is by far the most common approach. This approach utilizes the multiplicative formulation of the error quaternion, which allows for the unity constraint on the quaternion to be better handled. It is also common to use a technique known as dynamic model replacement, where the angular rate is not estimated directly, but rather the measured angular rate from the gyro is used directly to propagate the rotational dynamics forward in time. This is valid for most applications as gyros are typically far more precise than one's knowledge of disturbance torques acting on the system (which is required for precise estimation of the angular rate).

## Position/location determination

For some sensors and applications (such as spacecraft using magnetometers) the precise location must also be known. While pose estimation can be employed, for spacecraft it is usually sufficient to estimate the position (via Orbit determination) separate from the attitude estimation. For terrestrial vehicles and spacecraft operating near the Earth, the advent of Satellite navigation systems allows for precise position knowledge to be obtained easily. This problem becomes more complicated for deep space vehicles, or terrestrial vehicles operating in Global Navigation Satellite System (GNSS) denied environments (see Navigation).