# Analytical Attitude Guidance Planner for Multiple Ground Targets Acquisitions
## 4 Attitude Point-to-Point Generator
#### 4.2.1 APPG-Step 2
Then, putting \(b_{3}\) and \(b_{4}\) in the first equation of Equation (31), \(b_{5}=6\theta_{f}/t_{f_{2}}^{5}\) is evaluated and the expressions of \(b_{3}\) and \(b_{4}\) as a function of \(t_{f_{2}}\) are obtained as \(b_{3}=10\theta_{f}/t_{f_{2}}^{3}\) and \(b_{4}=-15\theta_{f}/t_{f_{2}}^{4}\). Thus, the six \(b_{j}\) coefficients can be summed up as a function of the final time \(t_{f_{2}}\) and boundary conditions as  
\[ \begin{cases}b_{0}=b_{1}=b_{2}=0\\ b_{3}=10\,\theta_{f}/t_{f_{2}}^{3}\\ b_{4}=-15\,\theta_{f}/t_{f_{2}}^{4}\\ b_{5}=6\,\theta_{f}/t_{f_{2}}^{5}.\end{cases}  \tag{32}\]  
The final time \(t_{f_{2}}\) is a free parameter and must be selected in order to calculate the coefficients \(b_{3}\), \(b_{4}\) and \(b_{5}\) defining a trajectory matching the constraint conditions. Since the direction of the rotation is fixed, the \(i^{th}\) component of the angular velocity and acceleration is no longer free to vary independently from the other components. As a consequence, constraint conditions can be imposed only on the magnitude of \(\mathbf{\omega}(t)\) and \(\dot{\mathbf{\omega}}(t)\). If the problem had been in a \(2D\) space, as shown in Figure 6a, the maximum magnitude of the angular velocity would have been a function of the angle \(\delta\). Since the unit vector \(\hat{\mathbf{e}}\) intersects the square side normal to the \(x\) axis, \(\omega_{x}=\omega_{max}\), \(\omega_{y}=\omega_{x}\tan\delta\), and \(\|\mathbf{\omega}\|_{max}=\sqrt{\omega_{x}^{2}+\omega_{y}^{2}}=\omega_{x}\sqrt{1 +\text{tan}^{2}\delta}=\omega_{max}\sqrt{1+\text{tan}^{2}\delta}\). Performing the analysis along all directions and considering a cube in the 3D space, as in Figure 6b, the same logic can be applied. The components \(\omega_{x}\), \(\omega_{y}\), and \(\omega_{z}\) are linked together by  
\[ \begin{cases}\tan\delta=\dfrac{\omega_{y}}{\omega_{x}},\\ \tan\eta=\dfrac{\omega_{z}}{\sqrt{\omega_{x}^{2}+\omega_{y}^{2}}}.\end{cases}  \tag{33}\]The \(i^{th}\) component of the angular velocity normal to the plane intersected by the unit vector \(\mathbf{e}\) is imposed to reach the maximum value. For instance, in Figure 6b, \(\omega_{x}=\omega_{max}\) since the rotation axis (represented with the color green), intersects the surface where the \(x\) axis is the normal vector. Then Equation (33) becomes a system with two unknowns and is therefore solvable. The physical constraints for the rest-to-rest guidance law are \(|\omega(t)|\leq\omega_{max}\) and \(|\dot{\omega}(t)|\leq\dot{\omega}_{max}\). This problem is similar to that treated in the previous step, but with the polynomials \(\omega(t)\) and \(\dot{\omega}(t)\) one degree higher. As aforementioned, the final time \(t_{f_{2}}\) of the polynomial is the free parameter and must be selected to calculate the coefficients \(b_{3}\), \(b_{4}\) and \(b_{5}\), defining a trajectory matching the imposed constrain conditions. The condition for which \(\omega(t)\) assumes its maximum can be evaluated by imposing \(\dot{\omega}(t)=0\),  
\[\dot{\omega}(t)=20b_{5}t^{3}+12b_{4}t^{2}+6b_{3}t=0 \tag{34}\]  
One root of Equation (34) is fixed in the initial instant \(t_{\omega_{max}}^{I}=0\), which is the boundary condition imposed in Equation (28). The other two solutions, which are the time instants \(t_{\omega_{max}}^{II,III}\) at which \(\omega(t)\) assume a maximum value, are found by solving a quadratic equation  
\[t_{\omega_{max}}^{II,III}=\frac{-3b_{4}\pm\sqrt{9b_{4}^{2}-30b_{5}b_{3}}}{10b_ {5}}. \tag{35}\]  
Using Equation (32) in Equation (35), the two solutions are obtained as  
\[t_{\omega_{max}}^{II,III}=\frac{3\pm 1}{4}t_{f_{2}}\quad\rightarrow\quad \begin{cases}t_{\omega_{max}}^{II}=t_{f_{2}}\\ t_{\omega_{max}}^{III}=t_{f_{2}}/2\end{cases}  \tag{36}\]  
The solution \(t_{\omega_{max}}^{II}\) is the boundary condition imposed at the end of the guidance law. Accordingly, only the condition \(|\omega(t=t_{\omega_{max}}^{III})|\leq\omega_{max}\) must be verified, which is a function of the variable \(t_{f_{2}}\).