Frequently used notations in this chapter.

## Abstract

Space missions involving multi-vehicle teams require the cooperative navigation and attitude slewing of the spacecraft or satellites, for such purposes as interferometry and optimal sensor coverage. This introduces extra constraints of exclusion zones between the spacecraft, in addition to the default exclusion constraints already introduced by damaging or blinding celestial objects. In this work, we present a quaternion-based attitude consensus protocol by using the communication topology of the spacecraft team. By using the Laplacian matrix of their communication graph and a semidefinite program, a synthesis of a time-varying optimal stochastic matrix P is done, which is used to generate various consensus and cooperative attitude trajectories from the initial attitudes of the spacecraft. The concept of quaternion-based quadratically constrained attitude control is then employed to satisfy cone avoidance constraints, where exclusion zones are identified, expressed as linear matrix inequalities (LMI), and solved by semidefinite programming (SDP).

### Keywords

- attitude path planning
- consensus
- exclusion
- optimization
- LMI

## 1. Introduction

Attitude control is the process of making a spacecraft, e.g. a satellite to point toward a specific direction of interest, and attitude path planning is an essential part of space missions. Some current and future space missions require the deployment of teams of spacecraft for such purposes as interferometry and sensor coverage, e.g. [1, 2]. The general problem of attitude control (AC) is important, not only in the navigation of satellites but also of other spacecraft [3], aircraft, and robots. For this reason, the topic has been studied extensively in the literature, e.g. [4, 5, 6, 7, 8, 9, 10].

Attitude path planning is a challenging problem and becomes more challenging when it involves multiple spacecraft. First, they are moving at very high speed in highly dynamic environments, subject to external constraints such as blinding celestial objects, which can damage onboard sensors. Secondly, because they are in a team, they must be careful with each other when changing attitude, so as not to collide with each other and damage appendages. We consider a team of networked spacecraft, which share some common objectives, where consensus theory based on graph Laplacians can be applied [11, 12].

Spacecraft attitude dynamics is usually represented by unit quaternions because quaternion dynamics do not encounter the singularities associated with other representations. However, quaternion dynamics are non-linear, which makes it difficult to apply Laplacian-like dynamics directly to quaternions.

Next, we consider some previous work on constrained attitude path planning. In [4], attitude control was formulated as a quadratically constrained optimization problem. Linear matrix inequalities (LMIs) and semidefinite programming (SDP) were employed to solve it for a multiple spacecraft scenario in [6]. In [10], spacecraft attitude stabilization on a sphere was studied. The control torques required for effective attitude stabilization were reduced from three to two. In [12], a consensus-based approach was applied in distributed attitude alignment of a team of communicating spacecraft flying in formation. In [13], a Laplacian-based protocol implemented using the * modified Rodriquez parameters*(MRP) was employed in

*attitude control of spacecraft.*leader following

However, none of these aforementioned works apply consensus theory directly to quaternions, except our previous works [7, 8, 9]. In addition, only [4, 6, 7, 8, 9] tackle the important problem of attitude cone avoidance constraints. Moreover, the works [4, 6, 7] were developed for spacecraft in the same coordinate frame, which does not have a direct practical implementation unless developed further.

To handle the difficulty of nonlinearity in quaternion kinematics, we cast the Q-CAC problem as a semidefinite program, which is subject to convex quadratic constraints, stated as LMI. Then a series of Laplacian-like matrices are synthesized, which satisfy the constraints and enables the spacecraft achieve consensus with exclusion. We employed available optimization software tools such as Sedumi [14] and Yalmip [15] running inside MATLAB^{®}, for simulation.

Moreover, the solution presented here was developed for the realistic scenario of spacecraft in different coordinate frames, making it practical to implement directly. Therefore, the contributions of this chapter are aspects of our previous works [7, 8, 9], which are: (1) development of a quaternion consensus protocol; (2) incorporating dynamic cone avoidance constraints into the consensus framework; (3) providing a mathematical convergence analysis for the quaternion-based consensus framework; (4) extending the approach to multiple spacecraft in any coordinate frames, thereby making it more suitable for practical implementation.

The rest of the chapter is organized as follows: The problem statement is in Section 2, followed by brief mathematical preliminaries in Section 3. The solution technique and convergence analysis are in Section 4, numerical simulations in Section 5, and conclusion in Section 6. Notations frequently used in this chapter are listed in Table 1. The words * obstacle, avoidance, exclusion, exclusion vector*may be used interchangeably in this chapter.

Notation | Meaning |
---|---|

, _{i} | Spacecraft |

^{i} | Attitude quaternion vector of , , _{i} = [^{i}_{1} _{2} _{3}| _{4}]^{T} |

^{−i}or ^{i∗} | Conjugate of ^{i} |

Vector part of , ^{i} | |

Antisymmetric of ^{i} | |

Stacked vector of more than one quaternion vectors | |

^{off} | Stacked vector of more than one offset quaternion vectors |

Ω, Π | Quaternion dynamics plant matrix |

Quaternion dynamics Laplacian-like plant matrix | |

Angular velocity | |

Control torque | |

Inertia matrix | |

Laplacian matrix | |

Laplacian-like stochastic matrix | |

_{n} | Then × identity matrix |

The set of × positive definite matrices | |

Cone avoidance constraint matrix | |

^{i} | Rotation matrix corresponding to ^{i} |

Fixed coordinate (Inertial) frame with origin at ’s center_{i} | |

Rotational coordinate (Body) frame with origin at ’s center_{i} | |

Vector of obstacle in | |

Vector of obstacle in | |

Vector of the obstacle in ^{th} | |

Vector of the ’s camera in _{i} | |

Vector of the ’s camera in _{i} | |

⊗ | Kronecker multiplication operator |

⊙ | Quaternion multiplication operator |

⊖ | Quaternion difference operator |

_{0} | Initial time |

_{f} | Final time |

^{i} | Position vector of , _{i} |

Stacked vector of position vectors | |

()^{ij}^{off} | Offset vector between and |

^{off} | Stacked vector of offset vectors |

The consensus space for |

## 2. Problem statement

The problem of attitude reconfiguration of a team of communicating spacecraft with avoidance constraints can be stated as follows. Given a set of communicating spacecraft with initial positions at * x*(

^{i}

t

_{0}) ∈

*= 1⋯*i

*, initial attitudes represented by quaternions*n

*(*q

^{i}

t

_{0}), generate a sequence of consensus trajectories that drive the team to a consensus attitude

*(*q

*) while satisfying exclusion, avoidance and norm constraints.*t

_{f}

There are two aspects of the problem stated above: the first is a * consensus*problem, wherein it is desired to drive the attitudes to a collective consensus attitude, or to various formation attitudes. For bare consensus, the final consensus is that each spacecraft should eventually point to the average of the initial attitudes. However,

*can be applied so the consensus attitude can be a desired formation attitude, e.g. each spacecraft can point at 5*relative offset quaternions

^{°}away from each other about the z axis. The second problem is that of

*constraints. This is also important for the team, because spacecraft usually have appendages, some have thrusters that emit plumes, and some have instruments that can be damaged by blinding celestial objects or by the appendage or plume of a team member.*avoidance

However, the ordinary consensus protocol was not developed for quaternion dynamics. It violates the non-linearity of quaternion kinematics and the quaternion norm preserving requirement. Moreover, the ordinary consensus algorithm also does not incorporate collision avoidance in * adversarial*situations; this is a Q-CAC problem. Thus, in this paper, we present aspects of our previous works [7, 8, 9, 16], where we combined consensus theory with constrained optimization to solve the problems stated above. We cast the problems as a

*(SDP), which is augmented with some convex quadratic constraints written as*semidefinite program

*(LMI).*linear matrix inequalities

We present a quaternion consensus protocol that computes a consensus attitude trajectory each time step, and a Q-CAC optimization procedure, which decides whether it is safe to follow the computed attitude trajectory or not. When generated trajectories are unsafe, it computes a new set of quaternion vectors that avoid collision and the cycle repeats until consensus is achieved.

To understand the avoidance aspect, we begin with a simpler illustration of the spacecraft Q-CAC problem with a single spacecraft and a single obstacle (exclusion) vector, as shown in Figure 1.

Let * SC*denote spacecraft

_{i}

*, and*i

*’s attitude*SC

_{i}

*(see Table 1 for definitions). Also, let*q

^{i}

or

The constraint is * non-convex*and

*and should be*quadratic

*for it to be represented as a LMI. The convexification was provided in [4], using the quaternion attitude constraints formulation developed in [3] for a single-spacecraft single-obstacle scenario. For that solution,*convexified

In [7, 8, 9, 16], we extended the previous avoidance solution to multiple spacecraft. Then we developed a consensus theory of quaternions and appended the new avoidance protocols. We further solved the problem for spacecraft and dynamic obstacles in different coordinate frames to make the solutions more suitable for practical implementation. Next, we present the basic mathematical preliminaries.

## 3. Mathematical background

In this section, we consider the two basic mathematical theories relevant to this chapter.

### 3.1. Quaternion-based rotational dynamics

It is convenient to use unit quaternions to represent the attitude of a rigid body rotating in three-dimensional space (such as spacecraft or satellite) because quaternions are not susceptible to the problems of singularities inherent in using Euler angles [17].

The quaternion is a four-element vector

Here, [_{1} _{2} _{3}]is a vector representing the axis of rotation in the Cartesian (

^{T}

*,*x

*,*y

*) coordinates and*z

q

_{4}is a scalar representing the angle of rotation, of the quaternion. The difference between two quaternions

q

^{1}and

q

^{2}can be represented in multiplication terms as

where ^{−2} is the conjugate of ^{2} and ⊙ is defined in Table 1. ^{2} is defined as

It follows that the transformation of ^{1} to ^{2} was achieved by the rotation quaternion * q*.

^{d}

The rotational dynamics for the * i*quaternion is

^{th}

where

Euler’s first-order discretization of Eq. (6) gives

The dynamics of the rotational velocity * ω*is

^{i}

Euler’s first-order discretization of Eq. (10) is

where * j* = 1, 2, 3, for the

*rigid body. Combining Eqs. (9) and (11) in stacked vector form yields*i

^{th}

It is the task of controller synthesis to determine the Ξand Ψ

^{i}

*to obtain the torque*

^{i}

*that stabilizes the system.*τ

^{i}

### 3.2. Basic consensus theory

The * Consensus*-based algorithms are distributed protocols based on

*, which can drive the states of a team of communicating agents to an agreed state or a common state. The agents (or vehicles)*communication graphs

*(*i

*= 1, ⋯,*i

*) are represented by vertices of the graph and the edges of the graph are the communication links between them. Denote the state of a vehicle*n

*as*i

*;*x

^{i}

**is the stacked vector of the states all vehicles in the team, then for systems modeled by first-order dynamics, the following first-order consensus protocol (or similar protocols) have been proposed, e.g. [18, 19]**x

When ‖* x* −

^{i}

*‖ → (*x

^{j}

*)*x

^{ij}

*as*

^{off}

*→ ∞, ∀*t

*≠*i

*then consensus has been achieved. A more comprehensive presentation of the mathematical basis of consensus (including graph theory), can be found in [16].*j

However, the basic consensus protocol Eq. (13) cannot admit quaternions directly. Thus, to extend Eq. (13) to attitude quaternions, the following consensus protocol for quaternions was proposed in [7]

where ** P**(

*) is a Laplacian-like matrix and*t

**(**q

*) = [*t

q

^{1}(

*),*t

q

^{2}(

*)⋯*t

*(*q

^{n}

*)]*t

*. More analysis of*

^{T}

**(**P

*) follows in the next sections.*t

## 4. Solutions

We present solutions to the problem statement in Section 2 [7, 8, 9, 16]. The solution involves four steps: (1) synthesis of consensus attitudes for multiple spacecraft; (2) formulation of Q-CAC in different coordinate frames; (3) determining obstacle vectors in different coordinate frames; (4) integration for consensus based Q-CAC.

### 4.1. Synthesis of consensus attitudes for multiple spacecraft

To develop consensus for quaternions, we adopt an optimization approach. The Laplacian-like stochastic matrix ** P**(

*) in Eq. (14) is synthesized (by an optimization process) at each time step to drive*t

**(**q

*) to consensus while satisfying quaternion kinematics. The components of*t

**(**P

*) are*t

where Λ(

^{i}

*) > 0 is an unknown positive definite optimization matrix variable, whose components are chosen by the optimization process. Matrix Γ is composed of components of the Laplacian*t

**= [**L

*] (*l

_{ij}

*,*i

*= 1, ⋯,*j

*), which gives*n

**(**P

*) its Laplacian-like behavior.*t

We shall now prove the stability of ** P**(

*), i.e. that Eq. (14) does indeed achieve consensus. Note that all the theorems, lemmas and proofs in this section had been presented in [7].*t

Recall the following standard result on a * matrix pencil*[20].

** Theorem 1**: For a

*pencil*symmetric-definite

**−**A

λ

**, there exists a nonsingular**B

*= [*S

s

_{1}, ⋯,

*] such that*s

_{n}

Moreover, * s* =

_{i}

λ

_{i}

B

*for*s

_{i}

*= 1, ⋯,*i

*, where*n

*=*λ

_{i}

*/*a

_{i}

*.*b

_{i}

** Lemma 1**: For any time

*, the eigenvalues of*t

**(**P

*) are*t

*(*γ

_{i}η

_{i}

*). Here,*t

*are the eigenvalues of Γ and*γ

_{i}

*(*η

_{i}

*) the eigenvalues of Λ(*t

*). It can therefore be observed that*t

**(**P

*) has only four zero eigenvalues, the rest of its eigenvalues are strictly positive.*t

** Proof:**To find the eigenvalues of

**(**P

*), consider a scalar λ such that for some nonzero vector s*t

Eq. (18) defines a * symmetric-definite generalized eigenvalue problem*(SDGEP), where Γ −

*Λ*λ

^{−1}(

*) defines a matrix pencil. Theorem 1 therefore immediately implies that the eigenvalues of*t

**(**P

*) are*t

*(*γ

_{i}η

_{i}

*). One can also easily observe that due to the property of the Laplacian matrix*t

**,**L

**(**P

*) has positive eigenvalues except for four eigenvalues. This proves the claim.*t

** Theorem 2:**The time-varying system Eq. (14) achieves consensus.

** Proof:**for simplicity, let us assume that there are no offsets, i.e.

q

*= 0 (or (*

^{off}

*)*q

^{off}

*= [0 0 0 1]*

^{i}

*∀*

^{T}

*). Note, when*i

**has entered the**q

consensus space

*of*nullspace

**(**P

*), i.e. the set of all*t

**such that**q

**(**P

*)*t

**= 0. Therefore, once**q

**enters**q

Suppose that ** q**has not entered

q

*Γ*

^{T}

**; V > 0 unless**q

where * z* = Γ

**≠ 0 for**q

**approaches a point in**q

*→ ∞, which proves the claim. Eq. (19) is true as long as*t

**is nonempty, i.e. if some vehicles can sense, see, or communicate with each other all the time.**L

### 4.2. Formulation of Q-CAC in different coordinate frames

Any rigid appendage attached to the body of the * i*spacecraft, e.g. a camera, whose pointing direction is

^{th}

where

is the rotation matrix corresponding to the * q*(

^{i}

*) at time*t

*;*t

*[21].*antisymmetric matrix

For simplicity let us consider a single * SC*with a single camera,

_{i}

*(possibly, time-varying) obstacles,*m

*is re-orientating. Then according to [3], the resulting attitude constraint of Eq. (2) can be written as*SC

_{i}

Its LMI equivalent according to [4] is

In Eq. (23), * μ*is chosen to ensure

where

for * j* = 1, ⋯,

*.*m

Eq. (22) defines the set of attitude quaternions * q*(

^{i}

*) to satisfy the constraint*t

*∈ [*t

t

_{0},

*], so it is used to find a collision-free*t

_{f}

*(*SC

*) can be near*SC

_{j}

*, then another obstacle vector*SC

_{i}

*) defined in*SC

_{j}

*. To address such a practical issue, we present a mechanism to calculate*SC

_{i}

*but defined in*SC

_{j}

*, centered on*r

*. If such an intersection exists, it defines*SC

_{i}

*.*SC

_{i}

Figure 2 illustrates the scenario. _{1} and _{2} are in their different coordinate frames relative to Earth. A thruster attached to _{1} body frame is at _{1} and _{2} are spheres representing the coordinate frames from which their attitude evolves. If both spacecraft are close enough, then vector _{2}, whereby the intersection defines _{2}. The requirement is that as _{2} changes its attitude from _{0} to * q*,

_{f}

### 4.3. Determination of obstacle vectors in different coordinate frames

Given * SC*in

_{i}

*in*SC

_{j}

p

_{1}and terminating at

p

_{2}, a point

*= [*p

*]*p

_{x}p

_{y}p

_{z}

*on [*

^{T}

p

_{1},

p

_{2}] can be tested for intersection with a sphere centered at

p

_{3}with radius

*[22]. Thus, for any*r

*(*p

*) exists at time*t

*with the sphere centered on*t

*, then*r

*will therefore depend on the application at hand, but must be proportional to the urgency of avoiding obstacle vectors originating from other spacecraft.*r

The above formulation effectively decentralizes the problem. Therefore, each spacecraft can solve the problem by communicating with its neighbors and/or using its own sensors. Euler first order discretization of Eq. (14) is

The decentralized dynamics for any * SC*is therefore

_{i}

where * y*other neighboring

*which*SC,

*can communicate with at time*SC

_{i}

*. Moreover, since we are going to apply consensus quaternion protocol Eq. (29), norm constraints must be enforced as follows:*t

Eq. (30) is the discrete time version of * q*(

^{i}

*)*t

*(*

^{T}q

^{i}

*) = 1 or*t

**(**q

*)*t

^{T}

**(**q

*) =*t

*for*n

*, iff ‖*SC

*(0)‖ = 1 ∀*q

^{i}

*.*i

### 4.4. Integration for consensus based Q-CAC

Using semidefinite programming, the solutions presented previously be cast as an optimization problem, augmented with a set of LMI constraints, and solved for optimal consensus quaternion trajectories. We consider the algorithm in discrete time. Given the initial attitude * q*(0) of

^{i}

*, (*SC

_{i}

*= 1, ⋯,*i

*), find a sequence of consensus quaternion trajectories that satisfies the following constraints:*n

Once the next safe quaternion trajectory * τ*and angular velocity

^{i}

*to rotate the*ω

^{i}

*optimally to*SC

_{i}

## 5. Simulation results

Due to limitation of space, we present three results for attitude multi-path planning in different coordinate frames. More results can be found in [7, 8, 16].

### 5.1. Dynamic avoidance in different coordinate frames without consensus

In this experiment, _{1} and _{2} are attempting a reconfiguration to Earth (either changing orientation to Earth or pointing an instrument to Earth). The initial quaternions of _{1} and _{2} are

Three thrusters of _{1} in

A single thruster of _{2} in

We want ^{°}, and avoid ^{°} while both are maneuvering to their desired final attitudes. Figure 3(a) shows the avoidance between thrusters of _{1} and _{2} during reorientation to Earth: _{2} cannot reconfigure to the desired _{2}. Figure 3(b) satisfaction of avoidance constraints: the sudden jumps to and from −1 indicate times when any of _{2} and therefore was replaced with

This experiment demonstrates that when both constraints are in conflict the avoidance constraint is superior to the desired final quaternion constraint. As seen from (a), _{2} cannot reconfigure exactly to the desired _{2} or _{1}.

### 5.2. Consensus-based dynamic avoidance in different coordinate frames

In this experiment, _{1}, _{2}, and _{3} will maneuver to a consensus attitude. The initial positions are

A set of initial quaternions were randomly generated, with the following data:

In the direction of the initial attitude * SC*, a sensitive instrument

_{i}

*has a thruster pointing to the opposite of*SC

_{i}

*by 30*SC

^{°}during the entire period of the maneuvers. From the generated initial quaternions, there is possibility of intersection of the thrusters of

SC

_{1}and

SC

_{3}, with

SC

_{2}, and the thruster of

SC

_{2}may damage

SC

_{1}or

SC

_{3}at any time

*. Figure 4(a) shows the solution trajectories; (b) shows the avoidance graph, which shows that constraints are not violated; (c) shows the consensus graph. The final consensus quaternion is*k

*= [−0.8167 0.4807 − 0.2396 0.2112]*q

_{f}

*. This is the normalized average of the initial attitude quaternions, which proves that consensus is achieved.*

^{T}

### 5.3. Consensus-based attitude formation acquisition with avoidance

To test the capability of the consensus algorithm in formation acquisition, _{1}, _{2}, and _{3} will maneuver to a consensus formation attitude. Relative offset quaternions were defined to enable the sensitive instruments to point at 30^{°} offsets from each other about the z-axis. The previous set of initial data for

Like the previous experiment, we want the sensitive instruments to avoid the thruster plumes emanating from each of the two other * SC*by an angle of 30

^{°}. The trajectories are shown in Figure 5(a) and (b) shows the avoidance graph; no constraints are violated, and (c) shows the consensus graph. The final consensus quaternions are

The differences of these quaternions are 30^{°} apart about the same axis.

## 6. Conclusion

We presented a solution, which we previously developed, to the problem of attitude path planning for multiple spacecraft with avoidance of exclusion zones, by combining consensus theory and Q-CAC optimization theory. Using the solutions, a team of spacecraft can point to the same direction, or to various formation patterns, while they avoid an arbitrary number of attitude obstacles or exclusion zones in any coordinate frames. We also provided the proof of stability of the Laplacian-like matrix used for the attitude synchronization. Simulation results demonstrated the effectiveness of the algorithm. Current work is underway to implement the algorithms using rotorcraft.