# Intersatellite and Downlink Agile Attitude Maneuvers
## 3 Nonlinear Attitude Control  
In this analysis, the commanded torque is identified by using the algorithm presented in [21, 26], which does not require perfect knowledge of the inertia matrix. This approach is based on the Lyapunov method and employs the rotation matrix as the attitude representation. The desired attitude is associated with vectrix \(\underline{\underline{C}}\). The attitude control algorithm aims at determining the control torque such that the actual attitude of the spacecraft, associated with \(\underset{N\gets B}{R}\) pursues the commanded orientation, identified by the rotation matrix \(R_{c}:=\underset{N\gets C}{R}\). In this study, a tracking maneuver is considered, and the commanded frame \(\underline{\underline{C}}\) is pursued. The commanded torque is obtained by using the algorithm presented in [21, 26], and is given by  
\[\underline{\underline{T}}_{c}=-\int_{c}^{(n)}\!\!\!\tilde{\mathcal{O}}\underline {\underline{\omega}}-\int_{c}^{(n)}\!\!\!(K_{1}\underline{\underline{S}}+ \tilde{\mathcal{O}}_{e}\underline{\underline{\omega}}-R_{c}^{T}\underline{ \underline{\omega}}_{c}^{(C)})-k_{p}\,\underline{\underline{S}}-K_{v}( \underline{\underline{\omega}}_{e}+K_{1}\underline{\underline{S}}) \tag{9}\]  
Equation (9) represents a feedback control law, which supplies the commanded torque in terms of the variables \(R\) and \(\underline{\underline{\omega}}\). In Equation (9) \(k_{p}\) is a constant, positive quantity, \(K_{1}\) is a constant, diagonal, positive-definite matrix, \(K_{v}\) is a positive-definite matrix, \(\int_{c}^{(n)}\) is the estimate of \(\int_{c}^{(n)}\). Vector \(\underline{\underline{S}}\) is related to the displacement of the actual attitude matrix \(R\) from \(R_{c}\),  
\[\underline{\underline{S}}=\sum_{i=1}^{3}a_{i}\big{(}R_{c}^{T}\underline{ \underline{\varepsilon}}_{i}\big{)}^{\sim}\,\underline{\varepsilon}_{i} \tag{10}\]  
where \(a_{i}\) (\(i=1,2,3\)) denote arbitrary positive constants, whereas \(\underline{\varepsilon}_{i}\) represents the \(i-th\) column vector of the canonical basis. The time derivative \(\dot{\underline{S}}\) is  
\[\dot{\underline{S}}=\sum_{i=1}^{3}a_{i}[(R_{c}^{T}\underline{ \underline{\varepsilon}}_{i})^{\sim}\underline{\underline{\omega}}_{e}]^{\sim }\,\underline{\varepsilon}_{i} \tag{11}\]  
Let \(L\) be an operator that takes a (\(3\times 1\))-vector as the input and yields a (\(3\times 6\))-matrix, whereas \(\underline{\underline{\gamma}}\) collects the momenta and products of inertia, i.e.,  
\[L(\underline{\underline{\omega}})= \begin{bmatrix}\omega_{1}&0&0&0& \omega_{3}&\omega_{2}\\ 0&\omega_{2}&0&\omega_{3}&0&\omega_{1}\\ 0&0&\omega_{3}&\omega_{2}&\omega_{1}&0\end{bmatrix}  \tag{12}\] \[\underline{\underline{\gamma}}= \begin{bmatrix}J_{11}&J_{22}&J_{33}& J_{23}&J_{13}&J_{12}\end{bmatrix} ^{T} \tag{13}\]  
The preceding two definitions lead to  
\[\int_{c}^{(n)}\underline{\underline{\omega}}=L(\underline{\underline{\omega} })\underline{\underline{\gamma}} \tag{14}\]  
Let \(\underline{\underline{\gamma}}\) be the vector that contains the estimate of \(\underline{\underline{\gamma}}\) and \(Q\) a constant, diagonal, positive-definite matrix. The governing equation that describes the time evolution of \(\underline{\underline{\gamma}}\) is [21]  
\[\underline{\underline{\gamma}}=Q^{-1}[L^{T}(\underline{\underline{\omega} })\tilde{\mathcal{O}}+L^{T}(K_{1}\underline{\underline{S}}+\tilde{\mathcal{O}} _{e}\underline{\underline{\omega}}-R_{c}^{T}\underline{\underline{\omega}} _{c}^{(C)})](\underline{\underline{\omega}}_{e}+K_{1}\underline{\underline{S}}) \tag{15}\]  
Gain selection takes advantage of the following formulas [21, 26]:  
\[k_{p}=\frac{\alpha_{0}}{\text{trace}(\bar{A})} \tag{16}\]\[K_{v}=\beta_{0}\left[ \begin{array}{ccc}\frac{1}{1+|\omega_{1}|}&0&0\\ 0&\frac{1}{1+|\omega_{2}|}&0\\ 0&0&\frac{1}{1+|\omega_{3}|}\end{array}