# Intersatellite and Downlink Agile Attitude Maneuvers
## 5 Attitude Maneuvering for Downlink Connection
### Command Attitude  
The spacecraft attitude is referred to the Earth-centered inertial frame (ECI), associated with the following vectrix:  
\[\underline{\underline{N}}= \begin{bmatrix}\dot{c}_{1}&\dot{c}_{2}&\dot{c}_{3} \end{bmatrix}  \tag{37}\]  
The final objective is in defining the commanded attitude, identified by \(\underline{\underline{C}}\), in both phases, i.e., tracking and reorientation. In order to achieve correct pointing, a specified spacecraft body axis (i.e., \(\hat{k}_{c}\)) must be aligned with the relative position vector that points from the spacecraft center of mass to the ground station. As a first step, in the ECI-frame the ground station location is identified using spherical coordinates,  
\[\vec{r}_{T}= \begin{bmatrix}\dot{c}_{1}&\dot{c}_{2}&\dot{c}_{3} \end{bmatrix}\begin{bmatrix}r_{\oplus}\cos\phi\cos\xi\\ r_{\oplus}\cos\phi\sin\xi\\ r_{\oplus}\sin\phi\end{bmatrix}  \tag{38}\]  
where \(r_{\oplus}\) is the Earth radius, whereas \(\xi\) is the absolute longitude and \(\phi\) is the latitude of the ground station. The absolute longitude \(\xi\) is defined by the sum of the geographical longitude \(\lambda_{G}\) and the Greenwich sidereal time \(\theta_{G}\),  
\[\xi=\lambda_{G}+\theta_{G} \tag{39}\]  
where  
\[\theta_{G}=\theta_{G_{0}}+\omega_{\oplus}(t-t_{0}) \tag{40}\]  
In Equation (40), \(\theta_{G_{0}}\) is the Greenwich sidereal time at epoch \(t_{0}\), while \(\omega_{\oplus}\) is the Earth rotation rate. In the ECI-frame, the spacecraft position vector \(\vec{r}_{S}\) can be written in terms of orbit elements,  
\[\vec{r}_{S}= \begin{bmatrix}r&0&0\end{bmatrix} R_{3}(\theta_{t})R_{1}(i)R_{3}( \Omega) \begin{bmatrix}\dot{c}_{1}\\ \dot{c}_{2}\\ \dot{c}_{3}\end{bmatrix}  \tag{41}\]  
where \(R_{j}(\chi)\) denotes the elementary rotation about axis \(j\) by angle \(\chi\); angles \(\theta_{t}\), \(i\), and \(\Omega\) are the instantaneous argument of altitude, inclination, and right ascension of the ascending node (RAAN); \(r\) is the instantaneous orbit radius. The argument of latitude equals  
\[\theta_{t}=\omega+\theta_{*} \tag{42}\]  
where \(\omega\) and \(\theta_{*}\) represent, respectively, the argument of perigee and the true anomaly. The commanded attitude is defined through the following relations:  
\[\hat{k}_{c} =\frac{\vec{r}_{T}-\vec{r}_{S}}{||\vec{r}_{T}-\vec{r}_{S}||} \tag{43}\] \[\hat{t}_{c} =\frac{\hat{k}_{c}\times\hat{c}_{3}}{||\hat{k}_{c}\times\hat{c}_{3 }||}\] (44) \[\hat{j}_{c} =\hat{k}_{c}\times\hat{t}_{c} \tag{45}\]The commanded attitude reference frame is illustrated in Figure 3. Using Equations (43)-(45), the unit vectors of the commanded attitude are resolved in the ECI-frame, and the rotation matrix that relates the commanded reference frame \(\underline{\underline{\mathsf{C}}}\) to the inertial reference frame \(\underline{\underline{\mathsf{N}}}\), denoted with \(\underset{c\gets N}{R}\), can be found in closed form. The next step is to obtain the analytical expression of the commanded angular velocity and its time derivative, starting from the kinematics equation for \(\underset{c\gets N}{R}\)  
\[\underset{c\gets N}{R}=-\tilde{\omega}_{c_{\mathsf{C}}\gets N} \tag{46}\]  
leading to  
\[\tilde{\omega}_{c}=-\underset{c\gets N}{R}\underset{N\gets c}{R} \rightarrow\underline{\omega}_{c}^{(\mathsf{C})} \tag{47}\]  
Equation (47) allows finding the closed-form expression of the three components of \(\underline{\omega}_{c}^{(\mathsf{C})}\), once \(\underset{c\gets N}{R}\) and \(\underset{c\gets N}{R}\) are known.