Frequently used notations in this chapter.

## Abstract

Some space missions involve cooperative multi-vehicle teams, for such purposes as interferometry and optimal sensor coverage, for example, NASA Terrestrial Planet Finder Mission. Cooperative navigation introduces extra constraints of exclusion zones between the spacecraft to protect them from damaging each other. This is in addition to external exclusion constraints introduced by damaging or blinding celestial objects. This work presents a quaternion-based attitude consensus protocol, using the communication topology of the team of spacecraft. The resulting distributed Laplacians of their communication graph are applied by semidefinite programming (SDP), to synthesize a series of time-varying optimal stochastic matrices. The matrices are used to generate various cooperative attitude maneuvers from the initial attitudes of the spacecraft. Exclusion constraints are satisfied by quaternion-based quadratically constrained attitude control (Q-CAC), where both static and dynamic exclusion zones are identified every time step, expressed as time-varying linear matrix inequalities (LMI) and solved by semidefinite programming.

### Keywords

- attitude maneuvre
- consensus
- exclusion
- optimization
- LMI

## 1. Introduction

Some current space missions already demanded the deployment of teams of spacecraft which cooperate synergistically for such purposes as interferometry and sensor coverage [1, 2]; and many future missions will. Activities such as interferometry and sensor coverage require cooperative attitude control (AC)—the process of making a team of spacecraft, for example, satellites to point toward a specific direction of interest. This makes attitude control an essential part of space missions [3]. Apart from spacecraft, AC is also important in the navigation of aircraft and robots; therefore, it has been studied extensively in the literature, for example [4, 5, 6, 7, 8, 9, 10, 11].

Basically, AC is a challenging problem, which becomes more challenging when multiple spacecraft are involved, in highly dynamic environments, and subject to external constraints such as blinding celestial objects such as the sun or some bright stars, which can damage onboard sensitive instruments. In addition, because of the close packing of spacecraft in a team, each of which has protruding appendages (e.g. thrusters and antennae), they must be careful with each other when changing attitude, in order to avoid collision with each other. When there is such a team of networked spacecraft which can communicate, then consensus theory based on graph Laplacians can be applied to achieve cooperation among them [12, 13].

The most common method of representing spacecraft attitude dynamics is by *unit quaternions*, mainly because quaternions do not encounter the singularities associated with other representations such as Euler angles and the *Modified Rodriques Parameters* (MRP). However, the non-linearity of quaternion dynamics makes it difficult to apply Laplacian-like dynamics directly to quaternions.

We shall now consider some previous work on constrained attitude control (CAC). A brief survey of the main method attitude representation is in [4]. Ref. [5] considers quadratically constrained attitude control (Q-CAC), where the exclusion problems are formulated as a quadratic optimization problem and solved using linear matrix inequalities (LMIs) and semidefinite programming (SDP). It was solved for a single-spacecraft single obstacle in [5] and for two spacecraft in [6]. In [7] an attempt was made to extend [5, 6] to more than two spacecraft and obstacles. In [7, 8, 9, 10], was extended to multiple spacecraft multiple obstacles in *different coordinate frames* (as the case of real spacecraft will be). An attempt was made in [11] to reduce the control torques required for effective attitude stabilization from three to two. This is applicable to underactuated spacecraft. [12] applies a consensus-based approach to distributed attitude alignment of a team of communicating spacecraft flying in formation, while [14] applies a Laplacian-based protocol to *leader-follower* attitude control of a team of spacecraft using the modified Rodriquez parameters.

Among the plethora of AC algorithms, only our works [7, 8, 9, 10] apply consensus theory directly to quaternions, and only [5, 6, 7, 8, 9, 10] tackle the problem of avoidance constraints. In addition, among the works [5, 6, 7, 8, 9, 10] only [8, 9, 10] were developed for spacecraft in *different coordinate frames*, which has direct practical implementation. The contributions of this chapter are therefore aspects of our previous works [7, 8, 9, 10], which include the following: (i) the development of a quaternion consensus protocol, (ii) incorporating dynamic avoidance constraints into the consensus framework using Q-CAC, (iii) mathematical convergence analysis for the quaternion-based consensus framework and (iv) solving the problem for the realistic scenario of multiple spacecraft in different coordinate frames, thus making it more suitable for practical implementation.

Note: the words *obstacle*, *avoidance*, *exclusion* and *exclusion vector* may be used interchangeably in this chapter. Table 1 lists frequently used notation 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 | |

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 multi-spacecraft attitude control with avoidance constraints can be stated as follows. Given the initial positions *xi*(*t*_{0}) ∈ ^{3} *i* = 1⋯*n*, initial attitudes represented by quaternions *qi*(*t*_{0}), of a set of communicating spacecraft *SCi*, generate a sequence of attitude consensus trajectories that drive the team to a consensus attitude *q*(*tf*) while satisfying avoidance and *norm* constraints.

The problem stated above consists of two parts: *consensus* and *avoidance*. For the consensus problem, it is desired to drive the attitudes of all *SCi* to a collective consensus attitude or to various *formation attitudes*. Consensus attitude means that each *SCi* should eventually point to the same direction, which is the average of the initial quaternions. Formation attitudes means *SCi* should finally point to various patterns, for example, each spacecraft can point at 5*o* away from each other about the z-axis. This we developed by introducing *relative offset quaternions* in the consensus framework. The second problem, *avoidance* constraints, is also important, because *SCi* usually have appendages, for example, some *SCi* have *thrusters* that emit hot plumes (plume impingement), and some have instruments that can be damaged by blinding celestial objects or by the appendage of another team member.

However, the ordinary consensus protocol violates the non-linearity of quaternion kinematics and the quaternion norm preserving requirement and therefore cannot be applied directly with quaternion dynamics. Also, the protocol ordinarily does not solve the problem of collision avoidance in *adversarial* situations. Thus, this chapter consists of aspects of our previous works [7, 8, 9, 10], where we developed a consensus theory of quaternions, augmented with Q-CAC-based collision avoidance mechanisms. We employed an optimization approach and cast the problems as a *semidefinite program* (SDP), augmented with some convex quadratic constraints (avoidance), written as *linear matrix inequalities* (LMI). The quaternion consensus protocol computes consensus attitude trajectories each time step, and the Q-CAC avoidance procedure decides which of the computed trajectories are safe to follow or not. Unsafe trajectories are discarded, and a new set of quaternion vectors that avoid collision is generated. The cycle repeats until consensus is achieved.

To understand the avoidance (exclusion) problem, let us illustrate with a simpler single-*SCi* single-obstacle scenario as shown in Figure 1. In the figure, the *SCi* must avoid (exclude) the Sun while rotating a photosensitive instrument from *q*_{0} to *qf*.

Let *SCi*‘s attitude *qi* (as defined in Table 1), and let

or

The constraint is a *non-convex quadratic* constraint; it was *convexified* in [4], which made it possible to be represented as a LMI using the quaternion attitude constraint formulation developed in [3] for a single-spacecraft single-obstacle scenario. In [4],

## 3. Mathematical background

In this section, we shall briefly consider the two basic mathematical theories relevant to this chapter. More comprehensive study and analysis are in [10].

### 3.1. Quaternion-based rotational dynamics

Because quaternions are free from the problems of singularities inherent in Euler angles and most other ways of representing rotations, 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) [15]. The quaternion is a four-element vector:

Here, [*q*_{1} *q*_{2} *q*_{3}]*T* is the vector part, representing the axis of rotation in the Cartesian (*x*, *y*, *z*) coordinates, and *q*_{4} is a scalar part, representing the angle of rotation of the quaternion in degrees. 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}. We used ⊙ here as a quaternion multiplication operator. And *Q*^{2} is defined as

Eq. (4) means that *qd* is the rotation quaternion that originally transformed *q*^{1} to *q*^{2} or, alternatively, *qd* is a rotation quaternion that can transform *q*^{1} to *q*^{2}.

The rotational dynamics for the *ith* quaternion is.

where

are the *plant* matrices of quaternion dynamics.

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

The dynamics of the rotational (angular) velocity *ωi* of *qi* is

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

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

The typical task of controller synthesis is to determine the torque *τi* that stabilizes the system.

### 3.2. Basic consensus theory

The problem of *consensus* theory is to create distributed protocols based on *communication graphs* which can drive the states of a team of communicating agents to a common state or an agreed state. Where the agents *i* (*i* = 1, ⋯, *n*) are represented by vertices of the communication graph; the edges of the graph are the communication links between them. Let the state of agent (vehicle) *i* be *xi*, and **x** is the stacked vector of all the states of the vehicles. For systems modeled by first-order dynamics, the following first-order consensus protocol (or similar protocols) has been proposed, for example [16, 17]:

We know that consensus has been achieved when ‖*xi* − *xj*‖ → (*xij*)*off* as *t* → ∞, ∀*i* ≠ *j*. A more comprehensive analysis of the mathematical basis of graph theoretic consensus theory can be found in [10].

Now we state the limitations of consensus theory that motivates our work. First, the basic consensus protocol Eq. (13) does not admit quaternions directly because quaternion dynamics are highly nonlinear. It violates quaternion unit norm requirements, and therefore we cannot practically apply Eq. (6) with consensus directly. To extend Eq. (13) to attitude quaternions, we proposed the following consensus protocol for quaternions [7, 8, 9, 10]:

Here, **P**(*t*) is a Laplacian-like stochastic matrix whose values are partially unknown, but a Laplacian-like structure is imposed on it by optimization, and **q**(*t*) = [*q*^{1}(*t*), *q2*(*t*)⋯*qn*(*t*)]*T*. We present more analysis of **P**(*t*) in the “Solutions” section.

## 4. Solutions

We present a four-step solution to the problem statement in Section 2 [7, 8, 9, 10], listed as follows: (1) development of a consensus protocol for quaternions, (2) development of collision avoidance behavior for quaternion consensus, (3) determining obstacle vectors in different coordinate frames and (4) integration of quaternion consensus with Q-CAC avoidance.

### 4.1. Development of a consensus protocol for quaternions

To handle the difficulty of non-linearity in quaternion kinematics, we develop a consensus protocol especially for quaternions. We adopt an optimization approach and cast the problem as a semidefinite program, which is subject to convex quadratic constraints, stated as linear matrix inequalities (LMI). Based on the current communication graph of any *SCi*, a series of Laplacian-like matrices **P***i*(*t*) are synthesized each time step to drive *qi*(*t*) to consensus while satisfying quaternion kinematics:

where *y* other neighboring *SC* which *SCi* can communicate with at time *t*. Euler’s first-order discretization of Eq. (15) is

where *Λi*(*t*) > 0 is an unknown positive definite optimization matrix variable, whose components are chosen by the optimization process. For analysis purposes, we shall now reconsider the collective quaternion consensus dynamics Eq. (14). The components of **P**(*t*) are

where Γ is composed of components of the Laplacian **L** = [*lij*] (*i*, *j* = 1, ⋯, *n*), which gives **P**(*t*) its Laplacian-like behavior, and *Λi*(*t*) > 0 is as previously defined.

We now present the proof of stability of **P**(*t*), that is, that Eq. (14) does indeed achieve consensus. Different versions of all the theorems, lemmas and proofs in this section had been presented in [7, 8, 9, 10]. Let us begin by recalling the following standard result on a *matrix pencil* [18].

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

Moreover, **A***zi* = *λi***B***zi* 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 *z*:

Eq. (20) 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*). It is also easy to observe (or show numerically) that due to the property of the Laplacian matrix **L**, **P**(*t*) has positive eigenvalues except for four zero eigenvalues. This proves the claim.

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

**Proof**: For simplicity, we shall assume no offsets are defined, that is, **q***off* = **0** (or (*qoff*)*i* = [0 0 0 1]*T* ∀ *i*). By consensus theory, when **q** has entered the *consensus space* **q**|*q*^{1} = *q2*=, ⋯, =*qn*}, then **0** (i.e. no vehicles are moving anymore). *nullspace* of **P**(*t*), that is, the set of all **q** such that **P**(*t*)**q** = 0. Therefore, **q** stays in

Suppose that **q** has not entered **≠** **0**), then consider a Lyapunov candidate function V = **q***T*Γ**q**; V > 0 unless **q** ∈

where *s* = Γ*q* ≠ 0 for **q** ∉ **q** approaches a point in *t* → ∞. This proves the claim. Eq. (21) is true as long as **L** is nonempty, that is, some vehicles can sense, see or communicate with each other all the time.

### 4.2. Development of collision avoidance behavior for quaternion consensus

Eq. (15) or (16) will indeed generate a consensus *qi*(*t*) for any *SCi*, but the system still needs to determine whether the trajectory is safe or not. This brings us to the issue of avoidance. Any rigid appendage attached to the body of *SCi*, for example, a camera, whose direction vector is *inertial frame*, can be transformed to the spacecraft fixed *body frame* by the rotation:

where

is the rotation matrix corresponding to the *qi*(*t*) at time *t*; *t*)^{×} is the *antisymmetric matrix* [19]. For a simpler analysis, let us consider a single *SCi* with a single camera, *m* (possibly, time-varying) obstacles, *SCi* is re-orientating. Then following Eq. (3), the resulting attitude constraint of Eq. (2) can be written as

Its LMI equivalent [5] is

where

and

for *j* = 1, ⋯, *m*.

Eq. (24) defines the set of attitude quaternions *qi*(*t*) to satisfy the constraint *μ* is chosen to ensure that

However, the solution presented above assumes that *t* is constant. In reality, this is not so. To address such a practical issue, we present a mechanism to calculate *SCj* but defined in *r*, centerd on *SCi*. If indeed such an intersection exists, it defines *SCi*.

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

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

Pursuing the issue of practicality further, given *SCi* in *SCj* in *p*_{1}, *p2*], originating at *p*_{1} and terminating at *p*_{2}, a point *p* = [*px py pz*]*T* on [*p*_{1}, *p2*] can be tested for intersection with a sphere centered at an external point *p*_{3} with radius *r* [20]. Therefore, for any *p*(*t*) exists at time *t* with the sphere centered on *r*, then *r* will thus depend on the current application but must be proportional to the urgency of avoiding obstacle vectors originating from other spacecraft. The above formulation effectively completes the decentralization of the avoidance problem which has already been partly decentralized by Eq. (16). Eq. (16) will be written in a semidefinite optimization program, which gives us the privilege to apply further constraints. Therefore, the *norm constraints* required by quaternion kinematics can be enforced as follows:

Essentially, Eq. (30) is the discrete time version of *qi*(*t*)*Tq̇i*(*t*) = 0 or **q**(*t*)*T**t*) = 0. This guarantees that *qi*(*t*)*Tqi*(*t*) = 1 or **q**(*t*)*T***q**(*t*) = *n* for *nSC*, iff ‖*qi*(0)‖ = 1 ∀ *i*.

### 4.4. Integration of quaternion consensus with Q-CAC avoidance

The integration of the quaternion consensus protocol with the Q-CAC collision avoidance in different coordinate frames is a two-stage process. First, the quaternion consensus protocol generates a set of consensus quaternion trajectories using Eq. (15) or (16). Then Eq. (25) tests whether the generated sequence is safe or not. If the next safe quaternion trajectory *τi* and angular velocity *ωi* to rotate the *SCi* optimally to

Using semidefinite programming, the solutions presented previously are cast as an optimization problem, augmented with a set of LMI constraints and solved for collision-free 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:

## 5. Simulation results

We shall present only three results for attitude multi-path planning in different coordinate frames due to limitation of space. These results will partly be found in [7, 8, 9, 10]. For the SDP programming and simulation, we used the available optimization software tools SeDuMi [21] and YALMIP [22] running inside Matlab^{®}.

### 5.1. Q-CAC avoidance in different coordinate frames without consensus

In this experiment *SC1*and *SC2* are changing their orientation to point an instrument to Earth. They are close to each other, and their thrusters can cause plume impingements to damage each other. Their initial quaternions are

Three thrusters of *SC1* in

A single thruster of *SC2* in

It is desired that *o* and avoid *o*, while both are maneuvering to their desired final attitudes. The trajectories obtained are shown in Figure 3 (a) and (b). 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), *SC2* cannot reconfigure exactly to the desired *SC2* or *SC1*.

### 5.2. Consensus with Q-CAC avoidance in different coordinate frames

In this experiment *SCi* (*i* = 1, 2, 3) will maneuver to a consensus attitude. Each carries a sensitive instrument *SCi*‘s initial attitude quaternion. In addition, each *SCi* has only one thruster pointing to the opposite (rear) of *SCi*‘s initial attitude. It is desired that the time evolution of the attitude trajectory of the sensitive instrument avoids the thruster plumes emanating from each of the two other *SC* by 30*o*. From the generated initial quaternions, there is possibility of intersection of the thrusters of *SC1* and *SC3*, with *SC2*, and the thruster of *SC2* may impinge on *SC1* or *SC3* at any time *k*.

The initial positions are

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

Figure 4 (a) shows the solution trajectories while (b) shows the avoidance graph; no constraints are not violated; (c) shows the consensus graph. The final consensus quaternion is *qf* = [−0.8167 0.4807 − 0.2396 0.2112]*T*, which is the normalized average of the initial attitude quaternions. This proves that consensus is indeed achieved by Eq. (16).

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

This experiment is to test the capability of the quaternion consensus algorithm in attitude formation acquisition. *SCi* (*i* = 1, 2, 3) will maneuver to a consensus formation attitude, with relative offset quaternions defined to enable the sensitive instruments to point at 30*o*offsets from each other about the z-axis. The previous set of initial data for *SC* by an angle of 30*o*.

The relative offsets are defined as

Figure 5 (a) shows the trajectories, while (b) shows the avoidance graph; no constraints are violated. Finally, (c) shows the consensus graph. The final consensus quaternions are.

The differences of these quaternions are 30*o* apart about the same axis. Clearly, the algorithm is capable of attitude formation acquisition with avoidance.

## 6. Conclusion

In this chapter, a method of consensus with quaternion-based attitude maneuver with avoidance, of multiple networked communicating spacecraft, was presented. The presentation is composed of aspects of solutions we previously developed, by combining consensus theory and Q-CAC optimization theory. The solutions enable a team of spacecraft to 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. The proof of stability of the Laplacian-like dynamics was also presented. Simulation results also demonstrated the effectiveness of the algorithm. We hope to implement the algorithms using rotorcraft and specialized hardware.