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 *leader following* attitude control of spacecraft.

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 |
---|---|

SCi, SCi | Spacecraft i |

qi | Attitude quaternion vector of SCi, SCi, qi = [q_{1} q_{2} q_{3}| q_{4}]T |

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

Vector part of qi, | |

Antisymmetric of qi | |

q | Stacked vector of more than one quaternion vectors |

qoff | Stacked vector of more than one offset quaternion vectors |

Ω, Π | Quaternion dynamics plant matrix |

P | Quaternion dynamics Laplacian-like plant matrix |

ω | Angular velocity |

τ | Control torque |

J | Inertia matrix |

L | Laplacian matrix |

P | Laplacian-like stochastic matrix |

In | Then n × n identity matrix |

The set of m × m positive definite matrices | |

Cone avoidance constraint matrix | |

i | Rotation matrix corresponding to qi |

Fixed coordinate (Inertial) frame with origin at SCi’s center | |

Rotational coordinate (Body) frame with origin at SCi’s center | |

Vector of obstacle in | |

Vector of obstacle in | |

Vector of the jth obstacle in | |

Vector of the SCi’s camera in | |

Vector of the SCi’s camera in | |

⊗ | Kronecker multiplication operator |

⊙ | Quaternion multiplication operator |

⊖ | Quaternion difference operator |

t_{0} | Initial time |

tf | Final time |

xi | Position vector of SCi, SCi |

x | Stacked vector of n position vectors |

(xij)off | Offset vector between i and j |

xoff | Stacked vector of n 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 *xi*(*t*_{0}) ∈ *i* = 1⋯*n*, initial attitudes represented by quaternions *qi*(*t*_{0}), generate a sequence of consensus trajectories that drive the team to a consensus attitude *q*(*tf*) while satisfying exclusion, avoidance and norm constraints.

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, *relative offset quaternions* can be applied so the consensus attitude can be a desired formation attitude, e.g. each spacecraft can point at 5^{°} away from each other about the z axis. The second problem is that of *avoidance* 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.

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 *semidefinite program* (SDP), which is augmented with some convex quadratic constraints written as *linear matrix inequalities* (LMI).

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 *SCi* denote spacecraft *i*, and *SCi*’s attitude *qi* (see Table 1 for definitions). Also, let

or

The constraint is *non-convex* and *quadratic* and should be *convexified* 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,

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, [*q*_{1} *q*_{2} *q*_{3}]*T* is a vector representing the axis of rotation in the Cartesian (*x*, *y*, *z*) coordinates and *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 *q*^{−2} is the conjugate of *q*^{2} and ⊙ is defined in Table 1. *Q*^{2} is defined as

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

The rotational dynamics for the *ith* quaternion is

where

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

The dynamics of the rotational velocity *ωi* is

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

where *j* = 1, 2, 3, for the *ith* rigid body. Combining Eqs. (9) and (11) in stacked vector form yields

It is the task of controller synthesis to determine the Ξ*i* and Ψ*i* to obtain the torque *τi* that stabilizes the system.

### 3.2. Basic consensus theory

The *Consensus*-based algorithms are distributed protocols based on *communication graphs*, which can drive the states of a team of communicating agents to an agreed state or a common state. The agents (or vehicles) *i* (*i* = 1, ⋯, *n*) 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 *i* as *xi*; **x** 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]

When ‖*xi* − *xj*‖ → (*xij*)*off* as *t* → ∞, ∀*i* ≠ *j* then consensus has been achieved. A more comprehensive presentation of the mathematical basis of consensus (including graph theory), can be found in [16].

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**(*t*) is a Laplacian-like matrix and **q**(*t*) = [*q*^{1}(*t*), *q*^{2}(*t*)⋯*qn*(*t*)]*T*. More analysis of **P**(*t*) follows in the next sections.

## 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**(*t*) in Eq. (14) is synthesized (by an optimization process) at each time step to drive **q**(*t*) to consensus while satisfying quaternion kinematics. The components of **P**(*t*) are

where Λ*i*(*t*) > 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 **L** = [*lij*] (*i*, *j* = 1, ⋯, *n*), which gives **P**(*t*) its Laplacian-like behavior.

We shall now prove the stability of **P**(*t*), 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].

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

**Theorem 1**: For a *symmetric-definite* pencil **A** − *λ***B**, there exists a nonsingular *S* = [*s*_{1}, ⋯, *sn*] such that

Moreover, **A***si* = *λi***B***si* for *i* = 1, ⋯, *n*, where *λi* = *ai*/*bi*.

**Lemma 1**: For any time *t*, the eigenvalues of **P**(*t*) are *γiηi*(*t*). Here, *γi* are the eigenvalues of Γ and *ηi*(*t*) the eigenvalues of Λ(*t*). It can therefore be observed that **P**(*t*) has only four zero eigenvalues, the rest of its eigenvalues are strictly positive.

**Proof:** To find the eigenvalues of **P**(*t*), consider a scalar λ such that for some nonzero vector s

Eq. (18) defines a *symmetric-definite generalized eigenvalue problem* (SDGEP), where Γ − *λ*Λ^{−1}(*t*) defines a matrix pencil. Theorem 1 therefore immediately implies that the eigenvalues of **P**(*t*) are *γiηi*(*t*). One can also easily observe that due to the property of the Laplacian matrix **L**, **P**(*t*) has positive eigenvalues except for four eigenvalues. This proves the claim.

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

**Proof:** for simplicity, let us assume that there are no offsets, i.e. **q***off* = 0 (or (*qoff*)*i* = [0 0 0 1]*T* ∀ *i*). Note, when **q** has entered the *consensus space* *nullspace* of **P**(*t*), i.e. the set of all **q** such that **P**(*t*)**q** = 0. Therefore, once **q** enters

Suppose that **q** has not entered **q***T*Γ**q**; V > 0 unless

where *z* = Γ**q** ≠ 0 for **q** approaches a point in *t* → ∞, which proves the claim. Eq. (19) is true as long as **L** is nonempty, i.e. if some vehicles can sense, see, or communicate with each other all the time.

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

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

where

is the rotation matrix corresponding to the *qi*(*t*) at time *t*; *antisymmetric matrix* [21].

For simplicity let us consider a single *SCi* with a single camera, *m* (possibly, time-varying) obstacles, *SCi* is re-orientating. Then according to [3], the resulting attitude constraint of Eq. (2) can be written as

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 *qi*(*t*) to satisfy the constraint *t* ∈ [*t*_{0}, *tf*], so it is used to find a collision-free *SC* (*SCj*) can be near *SCi*, then another obstacle vector *SCj*) defined in *SCi*. To address such a practical issue, we present a mechanism to calculate *SCj* but defined in *r*, centered on *SCi*. If such an intersection exists, it defines *SCi*.

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

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

Given *SCi* in *SCj* in *p*_{1} and terminating at *p*_{2}, a point *p* = [*px py pz*]*T*on [*p*_{1}, *p*_{2}] can be tested for intersection with a sphere centered at *p*_{3} with radius *r* [22]. Thus, for any *p*(*t*) exists at time *t* with the sphere centered on *r*, 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.

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 *SCi* is therefore

where *y* other neighboring *SC,* which *SCi* can communicate with at time *t*. Moreover, since we are going to apply consensus quaternion protocol Eq. (29), norm constraints must be enforced as follows:

Eq. (30) is the discrete time version of *qi*(*t*)*Tqi*(*t*) = 1 or **q**(*t*)*T***q**(*t*) = *n* for *SC*, iff ‖*qi*(0)‖ = 1 ∀ *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 *qi*(0) of *SCi*, (*i* = 1, ⋯, *n*), find a sequence of consensus quaternion trajectories that satisfies the following constraints:

Once the next safe quaternion trajectory *τi* and angular velocity *ωi* to rotate the *SCi* optimally to

## 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, *SC*_{1} and *SC*_{2} are attempting a reconfiguration to Earth (either changing orientation to Earth or pointing an instrument to Earth). The initial quaternions of *SC*_{1} and *SC*_{2} are

Three thrusters of *SC*_{1} in

A single thruster of *SC*_{2} in

We want ^{°}, and avoid ^{°} while both are maneuvering to their desired final attitudes. Figure 3(a) shows the avoidance between thrusters of *SC*_{1} and *SC*_{2} during reorientation to Earth: *SC*_{2} cannot reconfigure to the desired *SC*_{2}. Figure 3(b) satisfaction of avoidance constraints: the sudden jumps to and from −1 indicate times when any of *SC*_{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), *SC*_{2} cannot reconfigure exactly to the desired *SC*_{2} or *SC*_{1}.

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

In this experiment, *SC*_{1}, *SC*_{2}, and *SC*_{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 *SCi*, a sensitive instrument *SCi* has a thruster pointing to the opposite of *SC* by 30^{°} 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 *k*. 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 *qf* = [−0.8167 0.4807 − 0.2396 0.2112]*T*. This is the normalized average of the initial attitude quaternions, which proves that consensus is achieved.

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

To test the capability of the consensus algorithm in formation acquisition, *SC*_{1}, *SC*_{2}, and *SC*_{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.