# 6DOF ECEF (Quaternion)

Implement quaternion representation of six-degrees-of-freedom equations of motion in Earth-centered Earth-fixed (ECEF) coordinates

**Library:**Aerospace Blockset / Equations of Motion / 6DOF

## Description

The 6DOF ECEF (Quaternion) block Implement quaternion
representation of six-degrees-of-freedom equations of motion in Earth-centered
Earth-fixed (ECEF) coordinates. It considers the rotation of a Earth-centered
Earth-fixed (ECEF) coordinate frame (*X _{ECEF},
Y_{ECEF}, Z_{ECEF}*) about an
Earth-centered inertial (ECI) reference frame (

*X*). The origin of the ECEF coordinate frame is the center of the Earth. For more information on the ECEF coordinate frame, see Algorithms.

_{ECI}, Y_{ECI}, Z_{ECI}## Limitations

This implementation assumes that the applied forces act at the center of gravity of the body, and that the mass and inertia are constant.

This implementation generates a geodetic latitude that lies between ±90 degrees, and longitude that lies between ±180 degrees. Additionally, the MSL altitude is approximate.

The Earth is assumed to be ellipsoidal. By setting flattening to 0.0, a spherical planet can be achieved. The Earth's precession, nutation, and polar motion are neglected. The celestial longitude of Greenwich is Greenwich Mean Sidereal Time (GMST) and provides a rough approximation to the sidereal time.

The implementation of the ECEF coordinate system assumes that the origin is at the center of the planet, the

*x*-axis intersects the Greenwich meridian and the equator, the*z*-axis is the mean spin axis of the planet, positive to the north, and the*y*-axis completes the right-handed system.The implementation of the ECI coordinate system assumes that the origin is at the center of the planet, the

*x*-axis is the continuation of the line from the center of the Earth toward the vernal equinox, the*z*-axis points in the direction of the mean equatorial plane's north pole, positive to the north, and the*y*-axis completes the right-handed system.

## Ports

### Input

### Output

## Parameters

## Model Examples

## Algorithms

The origin of the ECEF coordinate frame is the center of the Earth. In addition, the
body of interest is assumed to be rigid, an assumption that eliminates the need to
consider the forces acting between individual elements of mass. The representation of
the rotation of ECEF frame from ECI frame is simplified to consider only the constant
rotation of the ellipsoid Earth (ω* _{e}*) including
an initial celestial longitude (

*L*(0)). This excellent approximation allows the forces due to the Earth's complex motion relative to the “fixed stars” to be neglected.

_{G}The translational motion of the ECEF coordinate frame is given below, where the applied
forces [*F _{x} F_{y}
F_{z}*]

^{T}are in the body frame and the mass of the body

*m*is assumed constant.

$${\overline{F}}_{b}=\left[\begin{array}{c}{F}_{x}\\ {F}_{y}\\ {F}_{z}\end{array}\right]=m\left({\dot{\overline{V}}}_{b}+{\overline{\omega}}_{b}\times {\overline{V}}_{b}+DC{M}_{bf}{\overline{\omega}}_{e}\times {\overline{V}}_{b}+DC{M}_{bf}\left({\overline{\omega}}_{e}\times \left({\overline{\omega}}_{e}\times {\overline{X}}_{f}\right)\right)\right)$$

where the change of position in ECEF $${\dot{\overline{x}}}_{f}$$ is calculated by

$${\dot{\overline{x}}}_{f}=DC{M}_{fb}{\overline{V}}_{b}$$

and the velocity of the body with respect to ECEF frame, expressed in body frame $$({\overline{V}}_{b})$$, angular rates of the body with respect to ECI frame, expressed in body frame $$({\overline{\omega}}_{b})$$. Earth rotation rate $$({\overline{\omega}}_{e})$$, and relative angular rates of the body with respect to north-east-down (NED) frame, expressed in body frame $$({\overline{\omega}}_{rel})$$, are defined as

$$\begin{array}{l}{\overline{V}}_{b}=\left[\begin{array}{c}u\\ v\\ w\end{array}\right],{\overline{\omega}}_{rel}=\left[\begin{array}{c}p\\ q\\ r\end{array}\right],{\overline{\omega}}_{e}=\left[\begin{array}{c}0\\ 0\\ {\omega}_{e}\end{array}\right],{\overline{\omega}}_{b}={\overline{\omega}}_{rel}+DC{M}_{bf}{\overline{\omega}}_{e}+DC{M}_{be}{\overline{\omega}}_{ned}\\ {\overline{\omega}}_{ned}=\left[\begin{array}{c}\dot{l}\mathrm{cos}\mu \\ -\dot{\mu}\\ -\dot{l}\mathrm{sin}\mu \end{array}\right]=\left[\begin{array}{c}{V}_{E}/\left(N+h\right)\\ -{V}_{N}/\left(M+h\right)\\ -{V}_{E}\u2022\mathrm{tan}\mu /\left(N+h\right)\end{array}\right]\end{array}$$

The rotational dynamics of the body defined in body-fixed frame are given below, where
the applied moments are [*L M N*]^{T}, and the
inertia tensor *I* is with respect to the origin O.

$$\begin{array}{l}{A}_{bb}=\left[\begin{array}{c}{\dot{u}}_{b}\\ {\dot{v}}_{b}\\ {\dot{\omega}}_{b}\end{array}\right]=\frac{1}{m}{\overline{F}}_{b}-\left[{\overline{\omega}}_{b}\times {\overline{V}}_{b}+DC{M}_{bf}{\overline{\omega}}_{e}\times {\overline{V}}_{b}+DC{M}_{bf}\left({\overline{\omega}}_{e}\times \left({\overline{\omega}}_{e}\times {\overline{X}}_{f}\right)\right)\right]\\ {A}_{b}{\text{}}_{ecef}=\frac{{F}_{b}}{m}\\ {\overline{M}}_{b}=\left[\begin{array}{c}L\\ M\\ N\end{array}\right]=I{\dot{\overline{\omega}}}_{b}+{\overline{\omega}}_{b}\times (I{\overline{\omega}}_{b})\\ I=\left[\begin{array}{ccc}{I}_{xx}& -{I}_{xy}& -{I}_{xz}\\ -{I}_{yx}& {I}_{yy}& -{I}_{yz}\\ -{I}_{zx}& -{I}_{zy}& {I}_{zz}\end{array}\right]\end{array}$$

The integration of the rate of change of the quaternion vector is given below.

$$\left[\begin{array}{c}{\dot{q}}_{0}\\ {\dot{q}}_{1}\\ {\dot{q}}_{2}\\ {\dot{q}}_{3}\end{array}\right]=-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.\left[\begin{array}{cccc}0& {\omega}_{b}\left(1\right)& {\omega}_{b}\left(2\right)& {\omega}_{b}\left(3\right)\\ -{\omega}_{b}\left(1\right)& 0& -{\omega}_{b}\left(3\right)& {\omega}_{b}\left(2\right)\\ -{\omega}_{b}\left(2\right)& {\omega}_{b}\left(3\right)& 0& -{\omega}_{b}\left(1\right)\\ -{\omega}_{b}\left(3\right)& -{\omega}_{b}\left(2\right)& {\omega}_{b}\left(1\right)& 0\end{array}\right]\left[\begin{array}{c}{q}_{0}\\ {q}_{1}\\ {q}_{2}\\ {q}_{3}\end{array}\right]$$

Aerospace Blockset™ uses quaternions that are defined using the scalar-first convention.

## References

[1] Stevens, Brian, and Frank Lewis.
*Aircraft Control and Simulation, 2nd ed*. Hoboken, NJ: John
Wiley & Sons, 2003.

[2] McFarland, Richard E. "A Standard Kinematic Model for Flight simulation at NASA-Ames." NASA CR-2497.

[3] "Supplement to Department of Defense World Geodetic System 1984 Technical Report: Part I - Methods, Techniques and Data Used in WGS84 Development." DMA TR8350.2-A.

## Extended Capabilities

## See Also

6DOF (Euler Angles) | 6DOF (Quaternion) | 6DOF Wind (Quaternion) | 6DOF Wind (Wind Angles) | Simple Variable Mass 6DOF ECEF (Quaternion) | Custom Variable Mass 6DOF (Euler Angles) | Custom Variable Mass 6DOF (Quaternion) | Custom Variable Mass 6DOF Wind (Quaternion) | Custom Variable Mass 6DOF Wind (Wind Angles) | Simple Variable Mass 6DOF ECEF (Quaternion) | Simple Variable Mass 6DOF (Euler Angles) | Simple Variable Mass 6DOF (Quaternion) | Simple Variable Mass 6DOF Wind (Wind Angles)

**Introduced in R2006a**