# In-Orbit Attitude Determination of the UVSQ-SAT CubeSat Using TRIAD and MEKF Methods
## 2 UVSQ-SAT Attitude Determination Considerations
### Orbital Reference Frames and Attitude Representation  
#### 2.2.1 Orbital Reference Frames  
The following reference frames are required for the in-orbit attitude determination of the UVSQ-SAT CubeSat. They allow us to compute the satellite's attitude with respect to one of those frames. The reference frames are shown in Figures 3-5. We recall that the gyrometer measures an angular velocity in the body frame with respect to an inertial reference frame. Therefore, an essential reference frame defined here is the Earth-centered inertial (ECI) along with the Earth-centered orbit reference frame (OC). The reference frames are described as follows:  
* Earth-centered inertial (ECI). The reference frame is defined in blue in Figure 3 with an origin at the Earth's center of mass. The X-axis is defined as the vernal equinox axis  
Figure 2: Time series of the measurements for two orbits on 26 March 2021 from the three-axis magnetometer, the three-axis gyrometer, the photodiodes, and the ERS sensors.  
at J2000, the intersection between the equatorial and the ecliptic planes. The Z-axis is defined as the Earth rotation axis at epoch J2000. Finally, the Y-axis is defined according to the previous directions to create an orthogonal basis.
* Earth-centered Earth-fixed (ECEF). The reference frame is defined in red in Figure 3 with its origin at the Earth's center of mass. Its X-axis is defined at the intersection of the Greenwich prime meridian and the equator. Its Y-axis is the intersection of the equatorial plane and the 90\({}^{\circ}\) longitude. The Z-axis extends through the true north and south poles and coincides with the Earth's rotation axis.
* North East Down (NED). Assuming a WGS84 ellipsoid model of the Earth, the NED, defined in purple in Figure 3, is a local reference frame that moves the body frame's position in the ECEF. It is defined so that the X-Y plane is tangential to the surface of the ellipsoid at the given location in the ECEF. Given those conditions, the X-axis should point toward true North, the Z-axis toward the interior of the Earth, and the Y-axis will finalize the orthogonal basis.
* Earth-centered orbit reference frame (OC). The reference frame is defined in blue in Figures 4 and 5 and centered at the Earth's center, with the X-axis towards the perigee, the Y-axis along the semi-minor axis, and the Z-axis perpendicular to the orbital plane to complete the right-hand system. From the previous reference frame, it is thus necessary to define a local reference frame that will follow the satellite in its center. This reference frame is chosen for its logic with respect to the satellite motion as well as the possibility of taking into account the orbital velocity in order to correct the gyrometer of this frame.
* Orbit reference frame (O). The reference frame is defined such that its origin is located at the center of the spacecraft. The origin rotates relative to the ECI with an angular velocity of \(\omega_{0}\). Its Z-axis points towards the center of the Earth. The X-axis is perpendicular to the previous axis in the spacecraft's direction of motion. The Y-axis completes the right-hand system.  
Figure 3: Earth-centered inertial (ECI), Earth-centered Earth-fixed (ECEF), and North East Down (NED) reference frames.