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

*(MRP). However, the non-linearity of quaternion dynamics makes it difficult to apply Laplacian-like dynamics directly to quaternions.*Modified Rodriques Parameters

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

*attitude control of a team of spacecraft using the modified Rodriquez parameters.*leader-follower

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

*and*exclusion

*may be used interchangeably in this chapter. Table 1 lists frequently used notation in this chapter.*exclusion vector

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

, _{i} | Spacecraft |

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

^{−i}^{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 | |

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 multi-spacecraft attitude control with avoidance constraints can be stated as follows. Given the initial positions * x*(

^{i}

t

_{0}) ∈

^{3}

*= 1⋯*i

*, initial attitudes represented by quaternions*n

*(*q

^{i}

t

_{0}), of a set of communicating spacecraft

*, generate a sequence of attitude consensus trajectories that drive the team to a consensus attitude*SC

_{i}

*(*q

*) while satisfying avoidance and*t

_{f}

*constraints.*norm

The problem stated above consists of two parts: * consensus*and

*. For the consensus problem, it is desired to drive the attitudes of all*avoidance

*to a collective consensus attitude or to various*SC

_{i}

*. Consensus attitude means that each*formation attitudes

*should eventually point to the same direction, which is the average of the initial quaternions. Formation attitudes means*SC

_{i}

*should finally point to various patterns, for example, each spacecraft can point at 5*SC

_{i}

*away from each other about the z-axis. This we developed by introducing*

^{o}

*in the consensus framework. The second problem,*relative offset quaternions

*constraints, is also important, because*avoidance

*usually have appendages, for example, some*SC

_{i}

*have*SC

_{i}

*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.*thrusters

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

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

*(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.*linear matrix inequalities

To understand the avoidance (exclusion) problem, let us illustrate with a simpler single-* SC*single-obstacle scenario as shown in Figure 1. In the figure, the

_{i}

*must avoid (exclude) the Sun while rotating a photosensitive instrument from*SC

_{i}

q

_{0}to

*.*q

_{f}

Let * SC*‘s attitude

_{i}

*(as defined in Table 1), and let*q

^{i}

or

The constraint is a * non-convex quadratic*constraint; it was

*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],*convexified

## 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, [_{1} _{2} _{3}]is the vector part, representing the axis of rotation in the Cartesian (

^{T}

*,*x

*,*y

*) coordinates, and*z

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 ^{−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 * q*is the rotation quaternion that originally transformed

^{d}

q

^{1}to

q

^{2}or, alternatively,

*is a rotation quaternion that can transform*q

^{d}

q

^{1}to

q

^{2}.

The rotational dynamics for the * i*quaternion is.

^{th}

where

are the * plant*matrices of quaternion dynamics.

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

The dynamics of the rotational (angular) velocity * ω*of

^{i}

*is*q

^{i}

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

where * i*rigid body along the three principal axes

^{th}

*= 1, 2, 3. Combining Eqs. (9) and (11) in stacked vector form yields.*j

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

^{i}

### 3.2. Basic consensus theory

The problem of * consensus*theory is to create distributed protocols based on

*which can drive the states of a team of communicating agents to a common state or an agreed state. Where the agents*communication graphs

*(*i

*= 1, ⋯,*i

*) 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)*n

*be*i

*, and*x

^{i}

**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]:**x

We know that consensus has been achieved when ‖* x* −

^{i}

*‖ → (*x

^{j}

*)*x

^{ij}

*as*

^{off}

*→ ∞, ∀*t

*≠*i

*. A more comprehensive analysis of the mathematical basis of graph theoretic consensus theory can be found in [10].*j

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

*) is a Laplacian-like stochastic matrix whose values are partially unknown, but a Laplacian-like structure is imposed on it by optimization, and*t

**(**q

*) = [*t

q

^{1}(

*),*t

*(*q

^{2}

*)⋯*t

*(*q

^{n}

*)]*t

*. We present more analysis of*

^{T}

**(**P

*) in the “Solutions” section.*t

## 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 * SC*, a series of Laplacian-like matrices

_{i}

P

*(*

^{i}

*) are synthesized each time step to drive*t

*(*q

^{i}

*) to consensus while satisfying quaternion kinematics:*t

where * y*other neighboring

*which*SC

*can communicate with at time*SC

_{i}

*. Euler’s first-order discretization of Eq. (15) is*t

where * Λ*(

^{i}

*) > 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*t

**(**P

*) are*t

where Γ is composed of components of the Laplacian ** L** = [

*] (*l

_{ij}

*,*i

*= 1, ⋯,*j

*), which gives*n

**(**P

*) its Laplacian-like behavior, and*t

*(*Λ

^{i}

*) > 0 is as previously defined.*t

We now present the proof of stability of ** P**(

*), 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*t

*[18].*matrix pencil

** Theorem 1**: For a

*pencil*symmetric-definite

**−**A

λ

**, there exists a nonsingular**B

*= [*Z

z

_{1}, ⋯,

*] such that*z

_{n}

Moreover, * z* =

_{i}

λ

_{i}

B

*for*z

_{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*γ

_{i}

*and*Γ

*(*η

_{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*t

*such that for some nonzero vector*λ

*:*z

Eq. (20) 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}

*). It is also easy to observe (or show numerically) that due to the property of the Laplacian matrix*t

**,**L

**(**P

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

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

** Proof**: For simplicity, we shall assume no offsets are defined, that is,

q

*=*

^{off}

**(or (**0

*)*q

^{off}

*= [0 0 0 1]*

^{i}

*∀*

^{T}

*). By consensus theory, when*i

**has entered the**q

consensus space

**|**q

q

^{1}=

*=, ⋯, =*q

^{2}

*}, then*q

^{n}

**(i.e. no vehicles are moving anymore).**0

*of*nullspace

**(**P

*), that is, the set of all*t

**such that**q

**(**P

*)*t

**= 0. Therefore,**q

**stays in**q

Suppose that ** q**has not entered

≠

**), then consider a Lyapunov candidate function V =**0

q

*Γ*

^{T}

**; V > 0 unless**q

**∈**q

where * s* = Γ

*≠ 0 for*q

**∉**q

**approaches a point in**q

*→ ∞. This proves the claim. Eq. (21) is true as long as*t

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

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

Eq. (15) or (16) will indeed generate a consensus * q*(

^{i}

*) for any*t

*, 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*SC

_{i}

*, for example, a camera, whose direction vector is*SC

_{i}

*, can be transformed to the spacecraft fixed*inertial frame

*by the rotation:*body frame

where

is the rotation matrix corresponding to the * q*(

^{i}

*) at time*t

*;*t

*)*t

^{×}is the

*[19]. For a simpler analysis, let us consider a single*antisymmetric matrix

*with a single camera,*SC

_{i}

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

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

_{i}

Its LMI equivalent [5] is

where

and

for * j* = 1, ⋯,

*.*m

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

^{i}

*) to satisfy the constraint*t

*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

*but defined in*SC

_{j}

*, centerd on*r

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

_{i}

*.*SC

_{i}

The scenario is illustrated in Figure 2, where* SC*and

_{1}

*are shown in their different coordinate frames relative to Earth. A thruster attached to*SC

_{2}

*body frame is at*SC

_{1}

*and*SC

_{1}

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

_{2}

q

_{0}to

*,*q

_{f}

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

Pursuing the issue of practicality further, given * SC*in

_{i}

*in*SC

_{j}

p

_{1},

*], originating at*p

_{2}

p

_{1}and terminating at

p

_{2}, a point

*= [*p

*]*p

_{x}p

_{y}p

_{z}

*on [*

^{T}

p

_{1},

*] can be tested for intersection with a sphere centered at an external point*p

_{2}

p

_{3}with radius

*[20]. Therefore, for any*r

*(*p

*) exists at time*t

*with the sphere centered on*t

*, 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*r

*required by quaternion kinematics can be enforced as follows:*norm constraints

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

^{i}

*)*t

*(*q ̇

^{T}

^{i}

*) = 0 or*t

**(**q

*)*t

^{T}

*) = 0. This guarantees that*t

*(*q

^{i}

*)*t

*(*

^{T}q

^{i}

*) = 1 or*t

**(**q

*)*t

^{T}

**(**q

*) =*t

*for*n

*, iff ‖*nSC

*(0)‖ = 1 ∀*q

^{i}

*.*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 * τ*and angular velocity

^{i}

*to rotate the*ω

^{i}

*optimally to*SC

_{i}

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 * q*(0) of

^{i}

*, (*SC

_{i}

*= 1, ⋯,*i

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

## 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 * SC*and

_{1}

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

_{2}

Three thrusters of * SC*in

_{1}

A single thruster of * SC*in

_{2}

It is desired that 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),*

^{o}

*cannot reconfigure exactly to the desired*SC

_{2}

*or*SC

_{2}

*.*SC

_{1}

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

In this experiment * SC*(

_{i}

*= 1, 2, 3) will maneuver to a consensus attitude. Each carries a sensitive instrument*i

*‘s initial attitude quaternion. In addition, each*SC

_{i}

*has only one thruster pointing to the opposite (rear) of*SC

_{i}

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

_{i}

*by 30*SC

*. From the generated initial quaternions, there is possibility of intersection of the thrusters of*

^{o}

*and*SC

_{1}

*, with*SC

_{3}

*, and the thruster of*SC

_{2}

*may impinge on*SC

_{2}

*or*SC

_{1}

*at any time*SC

_{3}

*.*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 * q*= [−0.8167 0.4807 − 0.2396 0.2112]

_{f}

*, which is the normalized average of the initial attitude quaternions. This proves that consensus is indeed achieved by Eq. (16).*

^{T}

### 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. * SC*(

_{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*i

*offsets from each other about the z-axis. The previous set of initial data for*

^{o}

*by an angle of 30*SC

*.*

^{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 30apart about the same axis. Clearly, the algorithm is capable of attitude formation acquisition with avoidance.

^{o}

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