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

$$q = \begin{bmatrix} q\_1 \ q\_2 \ q\_3 |q\_4| \end{bmatrix}^T. \tag{3}$$

ω\_ i 1 ω\_ i 2 ω\_ i 3

¼

J i <sup>2</sup> � J i 3 � �ω<sup>i</sup>

J i <sup>3</sup> � J i 1 � �ω<sup>i</sup>

J i <sup>1</sup> � J i 2 � �ω<sup>i</sup>

J i 3 J i 2 ωi

J i 1 J i 3 ωi <sup>2</sup> � <sup>J</sup> i 2 J i 3 ωi <sup>1</sup> 0

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

<sup>j</sup> is the moment of inertia, ω<sup>i</sup>

the three principal axes j = 1, 2, 3, for the i

τi ð Þk ωi ð Þ k þ 1

2 6 4

qi ð Þ k þ 1


ωi

3 7 5

¼

<sup>0</sup> <sup>J</sup> i 2 J i 1 ωi <sup>3</sup> � <sup>J</sup> i 3 J i 1 ωi 2

2ωi <sup>3</sup> <sup>þ</sup> <sup>τ</sup><sup>i</sup> 1

3ωi <sup>1</sup> <sup>þ</sup> <sup>τ</sup><sup>i</sup> 2

1ωi <sup>2</sup> <sup>þ</sup> <sup>τ</sup><sup>i</sup> 3 i 1

i 2

i 3

ωi 1 ωi 2 ωi 3

1=J i

ð Þþ <sup>k</sup> <sup>Δ</sup>tJτ<sup>i</sup>

ð Þ<sup>k</sup> <sup>Δ</sup>tJΨ<sup>i</sup>

Multi-Spacecraft Attitude Path Planning Using Consensus with LMI-Based Exclusion Constraints

0 1=J

<sup>1</sup> 0 0

i <sup>2</sup> 0

> i 3

http://dx.doi.org/10.5772/intechopen.71580

ð Þk , (11)

<sup>j</sup> is the control torque, along

τi 1 τi 2 τi 3

(10)

51

(12)

0 01=J


th rigid body. Combining Eqs. (9) and (11) in stacked

ωi ð Þk qi ð Þk

" #


ð Þk

ð Þk

<sup>x</sup>\_ðÞ¼� <sup>t</sup> L xð Þ� <sup>t</sup> <sup>x</sup>off � �: (13)

ð Þ<sup>k</sup> � �ω<sup>i</sup>

Ξi

Δt 2 Πi

ð Þþ <sup>k</sup> <sup>Δ</sup>tJΞ<sup>i</sup>

It is the task of controller synthesis to determine the Ξ<sup>i</sup> and Ψ<sup>i</sup> to obtain the torque τ<sup>i</sup> that

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

; 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


<sup>j</sup> is the rotational velocity and τ<sup>i</sup>

ð Þ<sup>k</sup> <sup>Ψ</sup><sup>i</sup>

ð Þk I<sup>4</sup>

i 1 J i 2 ωi 1

ð Þ¼ <sup>k</sup> <sup>þ</sup> <sup>1</sup> <sup>I</sup><sup>3</sup> <sup>þ</sup> <sup>Δ</sup>tΥ<sup>i</sup>

<sup>I</sup><sup>3</sup> <sup>þ</sup> <sup>Δ</sup>tΥ<sup>i</sup>

� �=J

� �=J

� �=J

<sup>3</sup> <sup>0</sup> � <sup>J</sup>


where J i

vector form yields

stabilizes the system.

xi

3.2. Basic consensus theory

been proposed, e.g. [18, 19]

Here, [q<sup>1</sup> q<sup>2</sup> q3] <sup>T</sup> is a vector representing the axis of rotation in the Cartesian (x, y, z) coordinates and q<sup>4</sup> is a scalar representing the angle of rotation, of the quaternion. The difference between two quaternions q<sup>1</sup> and q<sup>2</sup> can be represented in multiplication terms as

$$\begin{aligned} \eta^d &= \quad q^1 \odot \eta^{-2} = \eta^1 \odot \begin{bmatrix} -q\_1^2 & -q\_2^2 & -q\_3^2 & -q\_4^2 \end{bmatrix}^T\\ &= \quad Q^2 \eta^1. \end{aligned} \tag{4}$$

where q�<sup>2</sup> is the conjugate of q<sup>2</sup> and ⊙ is defined in Table 1. Q<sup>2</sup> is defined as

$$\boldsymbol{Q}^{i} = \begin{bmatrix} q\_4^i & q\_3^i & -q\_2^i & -q\_1^i \\ -q\_3^i & q\_4^i & q\_1^i & -q\_2^i \\ q\_2^i & -q\_1^i & q\_4^i & -q\_3^i \\ q\_1^i & q\_2^i & q\_3^i & q\_4^i \end{bmatrix} \tag{5}$$

It follows that the transformation of q<sup>1</sup> to q<sup>2</sup> was achieved by the rotation quaternion qd . The rotational dynamics for the i th quaternion is

$$
\dot{\eta}^i = \frac{1}{2} \Omega^i \eta^i = \frac{1}{2} \Pi^i \omega^i,\tag{6}
$$

where

$$
\Omega^i = \begin{bmatrix}
0 & \omega\_3^i & -\omega\_2^i & \omega\_1^i \\
\omega\_2^i & -\omega\_1^i & 0 & \omega\_3^i \\
\end{bmatrix} \tag{7}
$$

$$
\begin{bmatrix}
\end{bmatrix}
$$

$$
\Pi^i = \begin{bmatrix}
q\_2^i & -q\_1^i & -q\_4^i \\
q\_1^i & q\_2^i & q\_3^i
\end{bmatrix} \tag{8}
$$

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

$$
\eta^i(k+1) = \eta^i(k) + \frac{\Delta t}{2} \Pi^i(k) \omega^i(k). \tag{9}
$$

The dynamics of the rotational velocity ω<sup>i</sup> is Multi-Spacecraft Attitude Path Planning Using Consensus with LMI-Based Exclusion Constraints http://dx.doi.org/10.5772/intechopen.71580 51

ω\_ i 1 ω\_ i 2 ω\_ i 3 2 6 6 4 3 7 7 <sup>5</sup> <sup>¼</sup> J i <sup>2</sup> � J i 3 � �ω<sup>i</sup> 2ωi <sup>3</sup> <sup>þ</sup> <sup>τ</sup><sup>i</sup> 1 � �=J i 1 J i <sup>3</sup> � J i 1 � �ω<sup>i</sup> 3ωi <sup>1</sup> <sup>þ</sup> <sup>τ</sup><sup>i</sup> 2 � �=J i 2 J i <sup>1</sup> � J i 2 � �ω<sup>i</sup> 1ωi <sup>2</sup> <sup>þ</sup> <sup>τ</sup><sup>i</sup> 3 � �=J i 3 2 6 6 6 4 3 7 7 7 5 ¼ <sup>0</sup> <sup>J</sup> i 2 J i 1 ωi <sup>3</sup> � <sup>J</sup> i 3 J i 1 ωi 2 J i 3 J i 2 ωi <sup>3</sup> <sup>0</sup> � <sup>J</sup> i 1 J i 2 ωi 1 J i 1 J i 3 ωi <sup>2</sup> � <sup>J</sup> i 2 J i 3 ωi <sup>1</sup> 0 2 6 6 6 6 6 6 6 6 6 6 4 3 7 7 7 7 7 7 7 7 7 7 5 |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl} Υi ωi 1 ωi 2 ωi 3 2 6 6 4 3 7 7 5 þ 1=J i <sup>1</sup> 0 0 0 1=J i <sup>2</sup> 0 0 01=J i 3 2 6 6 6 4 3 7 7 7 5 |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl} J i τi 1 τi 2 τi 3 2 6 6 4 3 7 7 5 (10)

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

The quaternion is a four-element vector

50 Advanced Path Planning for Mobile Entities

The rotational dynamics for the i

where

Here, [q<sup>1</sup> q<sup>2</sup> q3]

q ¼ q<sup>1</sup> q<sup>2</sup> q3jq<sup>4</sup> � �<sup>T</sup>

and q<sup>4</sup> is a scalar representing the angle of rotation, of the quaternion. The difference between

two quaternions q<sup>1</sup> and q<sup>2</sup> can be represented in multiplication terms as

<sup>¼</sup> <sup>Q</sup><sup>2</sup>

<sup>Q</sup><sup>i</sup> <sup>¼</sup>

qd <sup>¼</sup> <sup>q</sup><sup>1</sup><sup>⊙</sup> <sup>q</sup>�<sup>2</sup> <sup>¼</sup> <sup>q</sup><sup>1</sup><sup>⊙</sup> �q<sup>2</sup>

where q�<sup>2</sup> is the conjugate of q<sup>2</sup> and ⊙ is defined in Table 1. Q<sup>2</sup> is defined as

qi <sup>4</sup> qi

qi <sup>2</sup> �qi

qi <sup>1</sup> qi

th quaternion is

�ω<sup>i</sup>

�ω<sup>i</sup>

ωi <sup>2</sup> �ω<sup>i</sup>

q\_ <sup>i</sup> <sup>¼</sup> <sup>1</sup> 2 Ωi qi <sup>¼</sup> <sup>1</sup> 2 Πi ωi

<sup>Π</sup><sup>i</sup> <sup>¼</sup>

ð Þ¼ <sup>k</sup> <sup>þ</sup> <sup>1</sup> qi

<sup>Ω</sup><sup>i</sup> <sup>¼</sup>

qi

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

The dynamics of the rotational velocity ω<sup>i</sup>

It follows that the transformation of q<sup>1</sup> to q<sup>2</sup> was achieved by the rotation quaternion qd

0 ω<sup>i</sup>

<sup>1</sup> �ω<sup>i</sup>

�qi <sup>4</sup> q<sup>i</sup>

�qi <sup>3</sup> �q<sup>i</sup>

> qi <sup>2</sup> �q<sup>i</sup>

> qi <sup>1</sup> q<sup>i</sup>

is

ð Þþ <sup>k</sup> <sup>Δ</sup><sup>t</sup> 2 Πi ð Þ<sup>k</sup> <sup>ω</sup><sup>i</sup>

<sup>3</sup> �ω<sup>i</sup>

<sup>2</sup> �ω<sup>i</sup>

<sup>1</sup> 0 ω<sup>i</sup>

<sup>3</sup> �qi 2

<sup>4</sup> qi 1

<sup>1</sup> �qi 4

<sup>2</sup> qi 3

<sup>3</sup> 0 ω<sup>i</sup>

<sup>2</sup> ω<sup>i</sup> 1

<sup>1</sup> ω<sup>i</sup> 2

<sup>3</sup> 0

3

�qi <sup>3</sup> qi

<sup>T</sup> is a vector representing the axis of rotation in the Cartesian (x, y, z) coordinates

<sup>1</sup> � <sup>q</sup><sup>2</sup>

<sup>3</sup> �q<sup>i</sup>

<sup>4</sup> q<sup>i</sup>

<sup>1</sup> q<sup>i</sup>

<sup>2</sup> q<sup>i</sup>

<sup>2</sup> � <sup>q</sup><sup>2</sup>

� �<sup>T</sup>

<sup>2</sup> �qi 1

<sup>1</sup> �qi 2

<sup>4</sup> �qi 3

<sup>3</sup> qi 4 <sup>3</sup> � <sup>q</sup><sup>2</sup> 4

<sup>q</sup><sup>1</sup>, (4)

: (3)

, (6)

ð Þk : (9)

(5)

(7)

(8)

.

$$
\omega^i(k+1) = \left(\mathbf{I}\_3 + \Delta t \boldsymbol{\Upsilon}^i(k)\right) \omega^i(k) + \Delta t \boldsymbol{l} \boldsymbol{\tau}^i(k), \tag{11}
$$

where J i <sup>j</sup> is the moment of inertia, ω<sup>i</sup> <sup>j</sup> is the rotational velocity and τ<sup>i</sup> <sup>j</sup> is the control torque, along the three principal axes j = 1, 2, 3, for the i th rigid body. Combining Eqs. (9) and (11) in stacked vector form yields

$$
\underbrace{\begin{bmatrix} \tau^i(k) \\ a^i(k+1) \\ q^i(k+1) \end{bmatrix}}\_{\mathsf{T}(k+1)} = \underbrace{\begin{bmatrix} \Sigma^i(k) & \Psi^i(k) \\ \mathbf{I}\_3 + \Delta t \Upsilon^i(k) + \Delta t \mathbf{J} \Xi^i(k) & \Delta t \mathbf{J} \Psi^i(k) \\ \hline & \frac{\Delta t}{2} \Pi^i(k) & \mathbf{I}\_4 \end{bmatrix}}\_{F(k)} \underbrace{\begin{bmatrix} a^i(k) \\ q^i(k) \end{bmatrix}}\_{\mathbf{T}(k)} \tag{12}
$$

It is the task of controller synthesis to determine the Ξ<sup>i</sup> and Ψ<sup>i</sup> to obtain the torque τ<sup>i</sup> 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]

$$
\dot{\mathbf{x}}(t) = -\mathbf{L}\left(\mathbf{x}(t) - \mathbf{x}^{\text{off}}\right). \tag{13}
$$

When <sup>k</sup>xi � xj k! (xij) off as <sup>t</sup>! <sup>∞</sup>, <sup>∀</sup><sup>i</sup> 6¼ <sup>j</sup> 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]

$$\dot{\mathbf{q}}(t) = -\mathbf{P}(t)(\mathbf{q}(t)\ominus\mathbf{q}^{-\text{off}}),\tag{14}$$

Lemma 1: For any time t, the eigenvalues of P(t) are γiηi(t). Here, γ<sup>i</sup> are the eigenvalues of Γ and ηi(t) the eigenvalues of Λ(t). It can therefore be observed that P(t) has only four zero

Multi-Spacecraft Attitude Path Planning Using Consensus with LMI-Based Exclusion Constraints

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

ð Þt s: (18)

http://dx.doi.org/10.5772/intechopen.71580

th spacecraft, e.g. a camera, whose pointing

ð Þt , (20)

ð Þt � is the antisymmetric matrix [21].

ð Þt � (21)

i

= [0 0 0 1]<sup>T</sup> ∀ i).

Γq;V>0

(19)

(t)

53

<sup>Γ</sup><sup>s</sup> <sup>¼</sup> <sup>λ</sup>Λ�<sup>1</sup>

Eq. (18) defines a symmetric-definite generalized eigenvalue problem (SDGEP), where <sup>Γ</sup> � <sup>λ</sup>Λ�<sup>1</sup>

has positive eigenvalues except for four eigenvalues. This proves the claim.

Proof: for simplicity, let us assume that there are no offsets, i.e. qoff = 0 (or (qoff)

Suppose that q has not entered C, then consider a Lyapunov candidate function V = q<sup>T</sup>

<sup>V</sup>\_ <sup>¼</sup> <sup>q</sup><sup>T</sup>Γq\_ <sup>þ</sup> <sup>q</sup>\_ <sup>T</sup>Γq,

¼ �2q<sup>T</sup>ΓΛð Þ<sup>t</sup> <sup>Γ</sup>q,

¼ �2zTΛð Þ<sup>t</sup> z,

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

unless q∈C. Then,

direction is v<sup>I</sup>

rotation

where

communicate with each other all the time.

4.2. Formulation of Q-CAC in different coordinate frames

vB cami

<sup>4</sup>ð Þ<sup>t</sup> <sup>2</sup>

ðÞ¼ <sup>t</sup> <sup>R</sup>�<sup>1</sup>

� 1 I<sup>3</sup> <sup>þ</sup> <sup>2</sup>q<sup>i</sup>

Any rigid appendage attached to the body of the i

<sup>R</sup>iðÞ¼ <sup>t</sup> <sup>2</sup>q<sup>i</sup>

is the rotation matrix corresponding to the qi

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)

Note, when <sup>q</sup> has entered the consensus space <sup>C</sup> <sup>¼</sup> <sup>q</sup>jq<sup>1</sup> <sup>¼</sup> <sup>q</sup><sup>2</sup> <sup>¼</sup>; <sup>⋯</sup>; <sup>¼</sup> qn , then <sup>q</sup>\_ <sup>¼</sup> 0. <sup>C</sup> is the nullspace of P(t), i.e. the set of all q such that P(t)q = 0. Therefore, once q enters C it stays there.

> ¼ �q<sup>T</sup>ΓPð Þ<sup>t</sup> <sup>q</sup> � <sup>q</sup><sup>T</sup>Pð Þ<sup>t</sup> <sup>T</sup>Γq, ¼ �q<sup>T</sup>ΓΛð Þ<sup>t</sup> <sup>Γ</sup><sup>q</sup> � <sup>q</sup><sup>T</sup>ΓΛð Þ<sup>t</sup> <sup>Γ</sup>q,

where z = Γq 6¼ 0 for q∉C. This implies that q approaches a point in C as t! ∞, which proves the claim. Eq. (19) is true as long as L is nonempty, i.e. if some vehicles can sense, see, or

cami in inertial frame, can be transformed to the spacecraft fixed body frame by the

ð Þ<sup>t</sup> <sup>q</sup><sup>i</sup>

(t) at time t; qi

ð Þ<sup>t</sup> <sup>T</sup> � <sup>2</sup>q<sup>i</sup>

<sup>4</sup>ð Þ<sup>t</sup> qi

<sup>i</sup> ð Þ<sup>t</sup> vI cami

eigenvalues, the rest of its eigenvalues are strictly positive.

where P(t) is a Laplacian-like matrix and q(t)=[q<sup>1</sup> (t), q<sup>2</sup> (t)⋯qn (t)]<sup>T</sup> . More analysis of P(t) follows in the next sections.
