Attitude maneuvers avoiding forbidden directions

Many space missions require the execution of large-angle attitude slews during which stringent pointing constraints must be satisfied. For example, the pointing direction of a space telescope must be kept away from directions to bright objects, maintaining a prescribed safety margin. In this paper we propose an open-loop attitude control algorithm which determines a rest-to-rest maneuver between prescribed attitudes while ensuring that any of an arbitrary number of body-fixed directions of light-sensitive instruments stays clear of any of an arbitrary number of space-fixed directions. The approach is based on an application of a version of Pontryagin’s Maximum Principle tailor-made for optimal control problems on Lie groups, and the pointing constraints are ensured by a judicious choice of the cost functional. The existence of up to three first integrals of the resulting system equations is established, depending on the number of light-sensitive and forbidden directions. These first integrals can be exploited in the numerical implementation of the attitude control algorithm, as is shown in the case of one light-sensitive and several forbidden directions. The results of the test cases presented confirm the applicability of the proposed algorithm.


Introduction
To point a space telescope from one observation target to the next, large-angle attitude changes are typically required. For thermal and power reasons, but also to prevent straylight from reaching the instruments on board, a number of constraints on the pointing directions for the telescope and possibly other light-sensitive devices must be obeyed during such attitude maneuvers. This raises the issue of planning attitude maneuvers, desirably optimal in some sense, compatible with the pointing constraints. This question has been studied for some time [1][2][3][4] and has, in recent years, attracted renewed interest [5][6][7][8][9][10] due both to new demands from space missions and to progress in control-theoretical methods. In this paper we show that the control-theoretical approach used in Ref. [2] for the case of a single lightsensitive direction and a single forbidden direction can be extended to the case of an arbitrary number of such directions.
Our approach differs from other approaches recently proposed to tackle the problem. It is not a path-planning algorithm as in Refs. [11][12][13][14] and hence does not need to cope with the high computational load of such algorithms (especially if fine grids are used) and the necessity of a smoothing algorithm to remove sharp turns from the solutions found. Our approach is geared towards finding an open-loop algorithm rather than a feedback law; in this regard it differs from approaches such as Ref. [1], [15], or [16], which use artificial potential fields and Lyapunovtype feedback controls. In contrast to these approaches, ours does not exhibit the problem of local minima. Moreover, as opposed to solution methods such as the ones in Ref. [11] or [12], our approach is completely independent of any choice of attitude parametrization. In fact, the solution is derived in a coordinate-free way which makes full use of the geometric structure inherent in the problem, and the numerical calculations required can be performed in any system of coordinates (Euler angles, Rodrigues parameters, quaternions), thereby avoiding singularities or ambiguities of any such coordinates. Finally, our approach can handle an arbitrary number of forbidden directions and an arbitrary number of telescope axes.
2 Problem formulation By a coordinate system, we always mean a right-handed orthonormal system. Let (e 1 , e 2 , e 3 ) be a space-fixed coordinate system, which is used as a fixed reference frame. Let (g 1 (t), g 2 (t), g 3 (t)) be a time-dependent coordinate system rigidly attached to the spacecraft considered, where the components of g i (t) ∈ R 3 are taken with respect to the space-fixed system (e 1 , e 2 , e 3 ). The matrix g(t) = (g 1 (t)|g 2 (t)|g 3 (t)) with columns g i (t) is called the attitude of the spacecraft at time t; it is an element of the three-dimensional rotation group SO(3). (The notation "g" for the attitude matrix is reminiscent of the word "group" and emphasizes the crucial fact that attitudes are treated as elements of a Lie group.) The (space-referenced) angular velocity of the spacecraft at time t is the unique vector ω s (t) ∈ R 3 such thaṫ g i (t) = ω s (t) × g i (t) for all t. This can be rewritten aṡ g(t) = L(ω s (t))g(t) where in general, given any vector u ∈ R 3 , we write so that L(u)ξ = u × ξ for all ξ ∈ R 3 . From the point of view of attitude control it is more natural to express the angular velocities (and the torques governing them) in terms of the body-fixed system, because the location of the momentum wheels or gas jets used for attitude control is known in the body-fixed system, and because the matrix expression of the inertia tensor is time-invariant with respect to the body-fixed system, but not generally with respect to the space-fixed system. We thus introduce the body-referenced angular velocity so that ω b (t) = g(t) −1 ω s (t). Theṅ which implies that the attitude kinematics are given by Eq. (4):ġ Equation (4) is a differential equation evolving on the rotation group SO(3) which is left-invariant in the sense that if t → g(t) is a solution of this differential equation, then so is t → γg(t) for any fixed element γ ∈ SO(3). (Loosely speaking, Eq. (4) is a linear differential equation evolving on the nonlinear space SO(3).) To perform, during a given time-interval [0, T ], an attitude maneuver steering the spacecraft from a given initial attitude g 0 to a specified target attitude g T , we must choose t → ω b (t) in such a way that the solution of Eq. (4) satisfying the initial condition g(0) = g 0 also satisfies the target condition g(T ) = g T . In addition, we assume that there are unit vectors d 1 , . . . , d m ∈ R 3 , representing the coordinate expressions of forbidden directions with respect to the space-fixed system, and unit vectors b 1 , . . . , b n ∈ R 3 , representing the coordinate expressions of pointing directions of on-board telescopes (or other light-sensitive devices) with respect to the body-fixed system. Note that the pointing direction of the ℓ-th telescope in the space-fixed system is g(t)b ℓ , where 1 ⩽ ℓ ⩽ n. We assume that each of the telescopes b ℓ is required to never point towards any of the forbidden directions d k , so that d k ̸ = g(t)b ℓ for all times t and all indices 1 ⩽ k ⩽ m and 1 ⩽ ℓ ⩽ n, preferably with a safety margin. We will interpret the functions t → ω i (t) as control variables. Thus the problem we want to address in this paper is as follows: Given a time interval [0, T ], an initial attitude g 0 ∈ SO(3), a target attitude g T ∈ SO(3), forbidden directions with coordinate representations d 1 , . . . , d m ∈ R 3 in the spacefixed system and on-board telescopes with coordinate expressions b 1 , . . . , b n ∈ R 3 in the body-fixed system, find a control law t → ω b (t) such that the solution of the initial value probleṁ satisfies g(T ) = g T and ⟨g(t)b ℓ , d k ⟩ < 1 for all t ∈ [0, T ] (and preferably even ⟨g(t)b ℓ , d k ⟩ ⩽ c kℓ with given constants c kℓ < 1) where 1 ⩽ k ⩽ m and 1 ⩽ ℓ ⩽ n.
Note that the constants c kℓ can be chosen to impose safety margins on the pointing constraints: If the ℓ-th telescope is to maintain a minimum angle φ kℓ from the k-th forbidden direction, we can choose c kℓ := cos(φ kℓ ).

Motivation of the solution approach
To invoke the power of optimal control theory, we cast our problem as the question of choosing angular velocities t → ω i (t) satisfying Eq. (5) and the conditions thereafter while minimizing an integral with a function q : (0, T ) → (0, ∞) satisfying q(t) → ∞ as t → 0 and t → T and functions χ kℓ : where c kℓ ⩽ 1 and χ kℓ (x) → ∞ as x → c kℓ . The idea behind this choice of cost functional is as follows: • using the angular velocities (rather than the torques) as control variables simplifies the dynamics, allowing us to use the elegant theory of invariant control systems on Lie groups; • the factor q(t) makes nonzero values of the angular velocities at the start and the end of the maneuver prohibitively expensive, ensuring the execution of a rest-to-rest maneuver and hence imposing boundary conditions on the angular velocities which, in a physical sense, are state variables, but are formally used as control variables; • the quadratic term ω 1 (t) 2 + ω 2 (t) 2 + ω 3 (t) 2 ensures a "smooth" attitude slew and is easy to handle mathematically; • since ⟨gb ℓ , d k ⟩ is the cosine of the angle between the ℓ-th telescope direction and the k-th forbidden direction, the factors involving the functions χ kℓ make close approaches of any of the space telescopes to any of the forbidden directions prohibitively expensive, thereby ensuring abidence by the constraints (with a safety margin which can be controlled by the choice of the values c kℓ ). We note that the algorithm can be adapted to the case of nonzero angular velocities at the start and at the end of the maneuver by simply replacing the term 2 with suitably specified functions u i . We also note that no optimization with respect to fuel efficiency, magnitude of torques, or maneuver duration is involved; torque constraints need to be implicitly incorporated by specifying a sufficiently large maneuver duration T . Thus optimal control theory is used as a means to an end rather than as a tool to satisfy a prescribed performance criterion. More specifically, the problem is formally recast as an optimal control problem in standard form: 4 Implementation of the solution

Application of Pontryagin's Maximum Principle
To solve the above optimal control problem, we invoke a version of Pontryagin's Maximum Principle tailored to invariant control systems on Lie groups [17,18] which yields the result that if t → ω b (t) is an optimal control steering the systemġ = gL(ω b ) between given attitudes over a time interval [0, T ] while minimizing where Writing Taking the derivative on the left-hand side using the product rule, this becomeṡ Writing Ω = (Ω 1 , Ω 2 , Ω 3 ) T and noticing that  Eq. (11) becomes Introducing the vector-valued function Eq. (13) readsΩ Thus by eliminating the adjoint variables from Pontryagin's Maximum Principle, we arrived at a differential equation which any optimal control t → Ω(t) and resulting optimal trajectory t → g(t) must satisfy. Rewriting Eq. (4) asġ = q −1 gL(Ω), we thus obtain a coupled system of differential equations for the functions t → g(t) and t → Ω(t) for which a solution satisfying the boundary conditions g(0) = g 0 and g(T ) = g T is sought.

Existence of first integrals
Rather than immediately solving this boundary value problem numerically, we want to investigate whether or not the system of differential equations obtained in this way admits first integrals (whose existence could then be used to reduce the numerical load). As will become apparent in a moment, such first integrals can be obtained from solutions of the linear differential equatioṅ X + 2⟨Φ, Ω⟩X = 0 (16) • We claim that X := ∥Ω∥ 2 is a solution of Eq. (16) and note thaṫ so that Eq. (16) becomesẊ +αX = 0. Multiplying by e α shows that (d/dt)(e α X) = 0, which means that e α X is constant. Thus the general solution of Eq. (16) is of the form X = C/e α for some constant C, which means Equation (19) can be written as C = X · F (g) where F : SO(3) → R is defined by Thus for each solution X of Eq. (16) the quantity X(g, Ω)F (g) is a first integral for the boundary-value problem on SO(3) × R 3 we need to solve, namelẏ g = gL(q −1 Ω),Ω + 2⟨Φ, Ω⟩Ω = Φ∥Ω∥ 2 , Note that if m = n = 1, then there are three first integrals, and the system is completely integrable. This special situation was exploited in Ref. [2] to reduce the boundary problem to the much simpler problem of determining three integration constants (which could even be done in a non-iterative way), which is no longer possible in the general case.

Numerical solution scheme exploiting first integrals
Here we want to consider the case of an arbitrary number m of forbidden directions, but from now on we restrict ourselves to the case n = 1, i.e., the case that there is only one telescope direction b to be considered. In this case there are two first integrals C 1 = ∥Ω∥ 2 · F (g) and C 2 = ⟨b, Ω⟩ · F (g). The constraint C 2 = ⟨b, Ω⟩ · F (g) is linear in Ω and hence can be solved for one of the components of Ω, say Ω 3 = f (Ω 1 , Ω 2 , g). Plugging this into the other constraint C 1 = ∥Ω∥ 2 · F (g) yields an equation of the form Ω 2 1 + Ω 2 2 = R(g) 2 , which, using polar coordinates, allows us to write with a scalar function w. Taking derivatives and plugging in the differential equation for Ω yields a differential equation for w, which has the formẇ(t) = W (g(t), w(t), t; C 1 , C 2 ), and the time derivatives of Ω 1 and Ω 2 can be expressed in terms of w. Thus our original boundary-value problem can be replaced by a new boundary-value problem of the forṁ g = gL(V (g, w, t; C 1 , C 2 )),ẇ = W (g, w, t; C 1 , C 2 ), In this new boundary-value problem, two of the six functions sought are constants, so that the knowledge of the existence of two first integrals is built into the numerical solution scheme. Without loss of generality, we may assume that b = (0, 0, 1) T , which simply amounts to making the telescope axis the z-axis of the bodyfixed system used. Under this assumption, the second constraint becomes C 2 = Ω 3 ·F (g), and the first constraint then becomes and hence where R(g) := C 1 · F (g) − C 2 2 F (g) This implies that the constants C 1 and C 2 must be such that C 1 · F (g(t)) ⩾ C 2 2 for all times t. Consequently, C 1 > 0 and Remark. Since n = 1, we simply write χ k instead of χ kℓ where ℓ = 1. If we choose χ k (x) = 1/(1 − x) for all k then F (g) ⩾ m/2 for all g ∈ SO(3). Hence in an iterative numerical scheme, we may choose the initial values for C 1 and C 2 such that C 2 2 /C 1 ⩽ m/2, which implies that Eq. (26) will hold at least during the first iteration.
Rewriting Eq. (27) in terms of Euler angles, we find thaṫ To derive the remaining equation for w, we observe that tan(w) = Ω 2 /Ω 1 . Taking on both sides of this equation the derivative with respect to t, we find that and hence, using 1 + tan(w) 2 = (Ω 2 1 + Ω 2 2 )/Ω 2 1 , arrive at Eq. (30): We can now solve the boundary value problem Eq. (23) with a straightforward shooting method. To do so, we need the partial derivatives of the state variables with respect to the parameters C 1 , C 2 , w 0 , and these are obtained via the variational equations, which we are now going to derive. Let us write F (C 1 , C 2 , w 0 ) := F (g(C 1 , C 2 , w 0 )) and R(C 1 , C 2 , w 0 ) := R(g(C 1 , C 2 , w 0 )).
We are now ready to write down the variational equations.
If p is any of the parameters C 1 , C 2 , and w 0 then ∂α ∂p and ∂β ∂p On the other hand, for p = C 2 we find that To determine the variational equations for w, we write If p = C 2 or p = w 0 then ∂w ∂p For p = C 1 we obtain Note that the variational equations (33)-(39) express the time evolutions of the partial derivatives ∂x/∂p of all state variables x ∈ {α, β, γ, w} with respect to all parameters p ∈ {w 0 , C 1 , C 2 } involved. Based on specified initial estimates for the parameters, these variational equations are then numerically integrated along with the system equations as part of a shooting procedure in which, after each iteration, the parameter estimates are updated via in order to match the attitude at the end of the maneuver with the target attitude. The shooting procedure is stopped when the numerically computed target attitude residual is sufficiently small. The size of this residual is measured in terms of its Frobenius norm The termination criterion used in the following test cases is chosen to be ∥g(T ) − g T ∥ F < 0.1, and the numerical integration is carried out with a classical Runge-Kutta method using the step size h = 0.04.

Simulation results
We present three test cases to show the applicability of our algorithm. In all cases, the telescope direction (in the body-fixed system) is b = (0, 0, 1) T , and there are four forbidden directions. The target attitude g T and the initial attitudes g In all three cases forbidden directions are chosen in such a way that an eigenaxis slew from g 0 to g T is not admissible, because the telescope points towards one of the forbidden directions during such a slew. This prevents the execution of an eigenaxis slew and necessitates finding a replacement maneuver which avoids the forbidden directions. The forbidden directions in the first case are chosen to be The forbidden directions in the second case are chosen to be  As stated before, the data in each case are such that a simple eigenaxis slew is inadmissible. An admissible replacement maneuver, avoiding all forbidden directions, is then found with our algorithm, using the choices T = 10, q(t) := 1/[t 2 (T − t) 2 ] and χ k (x) := 1/(1 − x) for 1 ⩽ k ⩽ 4. All maneuvers are visualized, with the forbidden directions marked as red dots on the unit sphere. See Fig. 1 for the first, Fig. 2 for the second, and Fig. 3 for the third test case. In each case, the diagram on the left shows the eigenaxis slew between the prescribed attitudes, which violates one of the pointing constraints, whereas the diagram on the right shows the replacement maneuver avoiding the four forbidden directions.
Finally, we evaluate the numerically obtained solutions for the chosen test cases. In each of the Figs. 4, 5, and 6, the left-hand side shows the optimal body-referenced angular velocity profiles obtained. Assuming the geometry of the (fictitious) spacecraft under consideration to be a cylinder with radius r = 1 (m) and height h = 3 (m) and a homogeneously distributed mass of m = 400 (kg), we obtain the inertia tensor We then use Euler's equations to find the torques which effect these angular velocities and hence give rise to the attitude maneuvers as visualized on the right-hand sides of Figs. 4-6. In Tables 1-3, the values of the parameters w 0 , C 1 , C 2 , and the Frobenius norm of the target attitude residual are shown for each iteration in each of the test cases. The initial guesses for the parameters and the resulting Frobenius norm of the target attitude residual are shown in iteration 0.

Conclusions
An open-loop control law was derived which effects a spacecraft attitude slew from a specified initial attitude to a specified target attitude in such a way that close proximity of a finite number of sensitive directions (telescope axes, camera axes, etc.) to any of a finite number of forbidden directions is avoided. Safety cones around each of the forbidden directions can be incorporated as control specifications. The approach is based on a version of Pontryagin's Maximum Principle tailor-made for optimal control problems on Lie groups. Both a smooth execution of the attitude slew and the avoidance of the forbidden directions are ensured by a judicious choice of the cost functional. The control law is derived in a coordinate-free way and does not rely on any specific choice of attitude representation. First integrals were identified and exploited in the implementation of the control law. The feasibility of the chosen approach was confirmed by numerical examples.

Karlheinz
Spindler studied mathematics, mechanics, and history at the Technische Hochschule Darmstadt (Germany). After obtaining his Ph.D. degree in mathematics, he spent two years as a visiting assistant professor at Louisiana State University in Baton Rouge (USA) and then worked for five years in the Flight Dynamics Department of the European Space Operations Centre (ESOC) in Darmstadt. He currently teaches mathematics and data processing at the Hochschule RheinMain (formerly Fachhochschule Wiesbaden). In addition to his research and teaching activities, he is also the founder and co-organizer of a continuing education seminar on technical, didactical, and historical aspects of mathematics. He won the first prize in the Hessian Award for Excellence in Teaching 2022. E-mail: karlheinz.spindler@hs-rm.de Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
The images or other third party material in this article are included in the article's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.
To view a copy of this license, visit http://creativecommon s.org/licenses/by/4.0/.