## Abstract

This paper develops a unified methodology for obtaining both the general equations of motion describing the rotational dynamics of a rigid body using quaternions as well as its control. This is achieved in a simple systematic manner using the so-called fundamental equation of constrained motion that permits both the dynamics and the control to be placed within a common framework. It is shown that a first application of this equation yields, in closed form, the equations of rotational dynamics, whereas a second application of the self-same equation yields two new methods for explicitly determining, in closed form, the nonlinear control torque needed to change the orientation of a rigid body. The stability of the controllers developed is analysed, and numerical examples showing the ease and efficacy of the unified methodology are provided.

## 1. Introduction

Traditional methods of controlling multi-body systems rely first on the development of the equations of motion of the system using the underlying principles of mechanics, and then on the development of the control design based on the underlying principles of control theory. This paper explores a unified approach based on Lagrangian mechanics to both the rotational dynamics and control of a rigid body. While the framing of Lagrange's equations of rotational motion in terms of quaternions has been carried out in the past (Nikravesh *et al*. 1985; Morton 1993; Udwadia & Schutte 2010*a*,*b*), it appears that Lagrange's formulation has not received much use in conventional rotational dynamics and control analysis. In contrast to past developments, the Lagrange equation of rotational motion derived in this paper is obtained by applying a simple three-step procedure that yields the equations of motion for general constrained mechanical systems. The key element in this three-step procedure is the use of the fundamental equation of constrained motion (Udwadia & Kalaba 1992, 1996) as demonstrated by Schutte & Udwadia (2011). In sequence, we then use the same methodology to carry out the nonlinear control design for rigid body rotational manoeuvres, thereby revealing a general and unifying framework for both dynamical modelling and nonlinear control design.

In the first part of the paper, using the fundamental equation of constrained motion, we derive an explicit formulation for rigid-body rotational dynamics by considering the unit quaternion as the generalized coordinate. Using the same general approach used to develop the rigid body equations of motion, we then develop a methodology for the rotational control of a rigid body. Consequently, we obtain, in closed form, the explicit control torque needed to control the orientation of a rigid body from any initial, at rest, orientation to any desired, at rest, orientation. This general methodology for developing closed-form controllers can be implemented in various ways, and in this paper two control strategies are presented for illustration. The first control strategy deals with simultaneously enforcing the quaternion unit norm constraint requirement along with the trajectory requirements needed to reach the desired orientation. The second control strategy enforces the necessary trajectory requirements independently from the unit norm requirement. In particular, it uses the permissible control structure developed by Schutte (2010) to apply the required nonlinear control torque. In permissible control form, the explicit control design space is arbitrary while the satisfaction of the quaternion unit norm requirement is guaranteed.

The closed-form equations of the nonlinear controllers make them amenable to detailed stability analysis. In terms of both rotational controllers, a detailed stability analysis is performed for the explicitly obtained equations of motion of the controlled rigid body. Numerical computations are also carried out to validate the analytical results for reorienting a rigid body that starts and ends at rest, illustrating the ease and efficacy with which the control methodology works.

## 2. Rotational dynamics using quaternions

Consider the problem of a rotating rigid body. For simplicity, we will assume that a right-handed coordinate frame is attached to the body with origin at the body's centre of mass. The coordinate frame is related to an inertial frame of reference by the rotational transformation
2.1
where *S* is an orthogonal rotation matrix. The elements of *S* are the direction cosines relating the basis vectors of to those of . We can express the matrix *S* as a function of the elements of a *unit* quaternion
2.2
by first considering the quaternion rotation operator
2.3
where *x*_{N}=(0,*x*_{N}) is a pure quaternion and *x*_{N} is a 3-vector whose components are those of a material point of the rigid body in the frame . Similarly, the pure quaternion *x*_{B}=(0,*x*_{B}) contains the 3-vector *x*_{B} whose components are in the frame . In equation (2.3), *u** is the quaternion conjugate; i.e. *u**=(*u*_{0},−** u**). Using vector notation, the quaternion

*u*=[

*u*

_{0},

*u*^{T}]

^{T}is defined as a unit quaternion if 2.4 In accordance with the rules of quaternion multiplication, we can write equation (2.3) in matrix–vector notation so that 2.5 where

*I*

_{3}is the 3×3 identity matrix and () is a skew-symmetric matrix containing the elements of the three vector (⋅). It follows that the time rate of change of equation (2.5) along with the orthogonality property

*S*

^{T}

*S*=

*I*

_{3}gives the classical definition 2.6 where is the absolute angular velocity of the rigid body with components in . In terms of the unit quaternion

*u*, equations (2.5) and (2.6) yield the transformation 2.7 The inverse relationship for a

*unit*quaternion can be found as 2.8 Finally, using equation (2.4) and the definition of the 3×4 matrix

*H*, it will be useful to define the identities 2.9 2.10 2.11 and 2.12

Without loss of generality, we now assume that the body-fixed coordinate axes are aligned along the principal axes of inertia of the rigid body whose principal moments of inertia are *J*_{i}, *i*=1,2,3. Using equation (2.7), the kinetic energy of the rotating body is given by
2.13
where the inertia matrix of the rigid body is defined as *J*=diag(*J*_{1},*J*_{2},*J*_{3}). This leads us to the central three-step procedure for determining the equation of motion of the rotating body (Schutte & Udwadia 2011).

The first step requires the development of the unconstrained equations of motion. To get these equations, we first assume that all the rotational coordinates that describe the configuration of the rigid body are independent of each other and then apply Lagrange's equation
2.14
Here, is an arbitrary generalized torque vector acting on the rigid body, which we shall describe in detail a bit later. Noting that and using equation (2.9), we have
2.15
Thus, the unconstrained equation of motion of the rotating rigid body is simply
2.16
We note that the mass matrix *M* in equation (2.16) is positive semi-definite (*M*≥0) as *H* is a 3×4 matrix. Therefore, *M* is not invertible as it is singular.

In the second step for obtaining the requisite equation of motion, we need to discern the constraints that appropriately model the system. In this step, the number of consistent constraints allocated may exceed the minimum number required. Here, we only have the coordinate constraint given by equation (2.4). Differentiating twice with respect to time, we can write equation (2.4) in the form 2.17 where denotes the inner product of its argument.

The third and final step of the three-step procedure uses the unconstrained equations of motion (equation (2.16)) and the constraints (equation (2.17)) to obtain the correctly modelled constrained equations of motion. Under the condition that the matrix (Udwadia & Phohomsiri 2006)
2.18
has full rank, this third step is carried out by first creating the auxiliary system (Udwadia & Schutte 2010*a*,*b*)
2.19
where *ξ*>0 is a scalar and (⋅)^{+} denotes the Moore–Penrose matrix inverse. As does indeed have full rank, the constrained equation of motion of the rotating rigid body can be found using the fundamental equation so that (Udwadia & Kalaba 1996)
2.20

To obtain equation (2.20) explicitly, one can show that
2.21
Then, using equation (2.9), we obtain
2.22
as (*ξ*^{−1/2}*u*^{T})^{+}=*ξ*^{1/2}*u*. Again using equation (2.9), we also obtain the relation
2.23
Substituting equations (2.22) and (2.23) into equation (2.20), we can then write
2.24
This is the explicit Lagrange equation of a rotating rigid body in terms of the unit quaternion that describes its orientation.

The positive non-zero scalar *ξ* in equation (2.24) is arbitrary. It can be suitably chosen to improve the condition number *c* of the matrix . This condition number is given by
2.25
where we define ∥⋅∥ as the matrix spectral norm. As
2.26
and
2.27
an upper bound on the condition number *c* is given by
2.28
By choosing *ξ*, we can minimize this upper bound by minimizing the second member on the right-hand side in the above equation with respect to *ξ*. The extremum of this member is found by setting
2.29
which yields for *ξ*>0 the value
2.30
This value of *ξ* can be easily shown to minimize the second member in equation (2.28), as the second derivative with respect to *ξ* is positive. Thus, a suitable value of *ξ* is found that makes numerical computations stable by yielding a bound on the condition number of the matrix . For , the bound on the condition number is then simply
2.31
as ∥*uu*^{T}∥=1.

Equation (2.24) also informs us—and this does not seem to be widely recognized—that the generalized torque *Γ*_{u} *must* appear in the form (*I*_{4}−*uu*^{T})*Γ*_{u}. Furthermore, because *I*_{4}=(*I*_{4}−*uu*^{T})+*uu*^{T}, post-multiplying this relation by *Γ*_{u}, we find that
2.32
Thus, *u*^{T}*Γ*_{u} is the component of the generalized torque 4-vector, *Γ*_{u}, in the direction of the unit vector *u*, and as it vanishes in equation (2.24), it has no effect on the rotating rigid body. On the other hand, the component (*I*_{4}−*uu*^{T})*Γ*_{u} is the orthogonal projection of *Γ*_{u} in the plane normal to *u*. Here, the matrix (*I*_{4}−*uu*^{T}) projects arbitrary vectors in to , where is the tangent space of the 3-sphere . In terms of the physically applied body torque , the generalized torque (*I*_{4}−*uu*^{T})*Γ*_{u} is expressed as (Udwadia & Schutte 2010*a*,*b*)
2.33
while the inverse relationship is given by
2.34

Finally, we point out that equation (2.24) is derived directly in terms of the generalized coordinates , and in terms of the generalized torque *Γ*_{u}. Alternatively, using equations (2.7), (2.12) and (2.33), we can express it in terms of the unit quaternion *u*, the body angular velocity *ω* and the physically applied body torque *Γ*_{B} as
2.35
where we have made use of the fact that . To get the generalized acceleration explicitly, we apply equations (2.9), (2.11) and (2.21) to obtain
2.36

Using this formulation in §3, we shall again use the fundamental equation (equation (2.20)) to develop explicit, closed-form expressions for the control torque required to rotate a rigid body from any initial rest orientation to any desired rest orientation.

## 3. Rotational motion (orientation) control using quaternions

Consider a rigid body whose orientation at any time *t* is described by the unit quaternion *u*(*t*). The body is free to pivot about its centre of mass. It is initially at rest, and its orientation is given by the quaternion, *u*_{initial}:=*u*(0). In what follows, we shall determine the control torques so that this initial orientation, *u*_{initial}, is changed to a desired orientation described by the quaternion *u*_{d}, and the body is brought to rest in this new desired orientation.

The equation for the generalized acceleration (equation (2.36)) of the unconstrained rigid body with *Γ*_{B}=0 is given by
3.1
To control the rigid body so that it acquires the orientation *u*_{d}, we need to change its acceleration from *a* so that
3.2
The rigid body achieves the desired orientation when it reaches the constraint
3.3
which describes the control objective. As *u*_{d} is any constant 4-vector in the set , and the body initially does not start on the constraint in equation (3.3), we can approach this constraint using a modified constraint equation of the form (*α*,*β*>0)
3.4
where the 4×4 diagonal matrices *α*=diag(*α*_{0}, *α*_{1}, *α*_{2}, *α*_{3}) and *β*=diag(*β*_{0}, *β*_{1}, *β*_{2}, *β*_{3}). Our intention in using this modified constraint is to take advantage of the property that equation (3.4) has the asymptotically stable fixed solution . The enforcement of this modified trajectory requirement will cause the rotational trajectories to approach the constraint in equation (3.3) in the fashion of a damped linear oscillator, where the choice of parameters in the matrices *α* and *β* dictate the actual dynamical path taken. In fact, instead of equation (3.4), we could choose other suitable second-order linear, or nonlinear, differential equations that have the same asymptotically stable fixed point, and perhaps some needed additional desirable dynamical features for rotating the rigid body to *u*_{d}.

Using equation (3.3) in equation (3.4), we obtain
3.5
Equation (3.5) describes the desired independent paths for each of the quaternion components. However, throughout the control manoeuvre the satisfaction of equation (2.4) must also be guaranteed because the quaternion *u*(*t*) *must* have a unit norm if it is to represent a physical rotation. Thus, in addition to the modified trajectory constraints given by equation (3.5), we must also impose the unit norm constraint. To achieve the control objective, we then desire that both equations (2.4) and (3.5) are simultaneously satisfied.

In §3*a*,*b*, we present two different control strategies to handle this nonlinear control objective. The first strategy deals with enforcing the unit norm constraint (equation (2.4)) along with the modified control trajectories in equation (3.5) for *u*_{i}(*t*), *i*=1,2,3 (i.e. only the vector part, **u**(t), of the quaternion). The second strategy uses the full set of modified control trajectories in equation (3.5) and casts the problem into permissible control form. This decouples the control design from the unit norm constraint so that arbitrary controllers may be applied while ensuring that *u*(*t*) is a unit quaternion. In either strategy, we arrive at an appropriately constructed constraint matrix equation
3.6
To exactly reorient the rigid body to *u*_{d}, the fundamental equation then explicitly gives the control acceleration *γ*(*t*) as
3.7
where *a* is the acceleration given by equation (3.1). The resulting control torque in the Lagrangian framework is found by
3.8
or in the body-fixed coordinate frame by (Udwadia & Schutte 2010*a*,*b*)
3.9
where *Γ*_{B}=[*Γ*_{1},*Γ*_{2},*Γ*_{3}]^{T} are the control torques about the body-fixed 1-, 2- and 3-principal directions. The descriptions of the *A* matrix and the *b* vector in equation (3.6), which are different for the two control strategies, are discussed in §3*a*,*b*.

### (a) Controller strategy 1

In this strategy, to design the control *γ*(*t*), we take the unit norm constraint (equation (2.4)) along with the last three control objectives in equation (3.5) so that the *A* matrix and *b* vector in equation (3.6) becomes
3.10
We begin by assuming that nowhere along the controlled trajectory does *u*_{0}=0, so that the *A* matrix in equation (3.10) is non-singular. The acceleration *γ*_{1}(*t*) is then explicitly found by equation (3.7) and yields
3.11
This relation follows as for non-singular matrices *A* and we have so that
3.12
The subscript ‘1’ on *γ* indicates that we are dealing with control strategy 1. The 4-vector *κ*=[*κ*_{0},*κ*^{T}]^{T} is then given by
3.13
3.14where the diagonal 3×3 matrices and , while the 3-vector, ** u**=[

*u*

_{1},

*u*

_{2},

*u*

_{3}]

^{T}. Equation (3.14) exactly represents our desired constraint given by the last three equations in equation (3.10). Thus, the fundamental equation yields the nonlinear controller in equation (3.11), which causes the coordinates

*u*

_{1},

*u*

_{2}and

*u*

_{3}to independently converge to their respective desired values given by the corresponding components of

*u*_{d}. The coordinate

*u*

_{0}is found so that the unit norm constraint (equation (2.4)) is exactly satisfied at each instant of time, as required by the first equation in the set (3.10). Furthermore, we can immediately conclude stability of the controlled system in equations (3.13) and (3.14). The three equations in equation (3.14), which are given in the form of a simple damped linear oscillator, are

*asymptotically stable*at the point

*u*_{d}provided and . We can further deduce that the entire system given by equations (3.13) and (3.14) is

*asymptotically stable*at the two fixed points 3.15 where the coordinate . We see that two fixed points exist—a consequence of the ambiguity that results when solving for the coordinate

*u*

_{0}using equation (2.4).

We now consider the case when *u*_{0}=0. The matrix *A* in equation (3.10) now becomes singular, and as a result, equation (3.6) is only consistent for those vectors *b* that lie in the range space of the matrix *A*. Consistency is required to ensure that the norm of the 4-vector *u*(*t*) is unity, and hence represents a physical rotation. In fact, equation (3.13) points out that when *u*_{0}=0, for finite accelerations , we require that
3.16
In general, the satisfaction of this condition, which arises when *u*_{0}=0, is not possible for arbitrary values of *u*_{d}, and . Thus, crossing the hyperplane *u*_{0}=0 at any time *t* would generally result in a physically unrealizable rotation as the modified trajectory requirements may not be consistent at *u*_{0}=0.

Physically speaking, the hyperplane *u*_{0}=0, which corresponds to principal rotation angles of *θ*=±*π*,±3*π*,…, appears to separate the two fixed points given in equation (3.15). The two fixed points are separated by the boundary
3.17
which is the space of rotations defined by the intersection of the hyperplane *u*_{0}=0 and the unit 3-sphere . These results show that the controller given by equation (3.11) causes rotational trajectories of the rigid body to occur on the unit 3-sphere, and the rigid body will asymptotically approach one of the fixed points in equation (3.15). To control the rigid body *on* the boundary (3.17) the condition in equation (3.16) must be satisfied. For rest-to-rest manoeuvres, the sign of the coordinate *u*_{0} at the initial time determines the specific fixed point to which the controller will rotate the rigid body. Yet, crossing the hyperplane *u*_{0}=0 to achieve any given desired orientation, *u*_{d}, is not necessary. If the quaternions *u*_{initial} and *u*_{d} have their first components (*u*_{0,initial} and *u*_{0,d}) of opposite sign, then one merely commands the controller to orient the body to the diametrically ‘opposite’ quaternion, −*u*_{d}, on which corresponds to precisely the same physical orientation as the quaternion *u*_{d}. Thus, through a proper representation of the desired target quaternion, one can ensure global stability of the control. Moreover, the orientation of the hyperplane relative to can be predetermined by varying the quaternion component combinations in the set (3.10).

### (b) Controller strategy 2

In many instances, it may be desirable to control the rigid body in the entire set , such that no restriction on its motion exists. In control strategy 1, this task is difficult because the condition in equation (3.16) must be satisfied when *u*_{0}=0 on . This effect is a direct result of constraint specification. While this problem can be obviated, as pointed out above, by choosing the target quaternion to be −*u*_{d} instead of *u*_{d}, it is however a source of inconvenience. Quite often it is required to specify constraints that represent two different categories: namely (i) constraints that model the system, and (ii) constraints that control the system. These two categories of constraints need to be distinctly conceptualized as they arise from very different sources. The constraints that model the physical system *must* always be satisfied, otherwise the dynamical model of the system would be invalid. On the other hand, the control constraints specify the desired trajectory of the physical system. These constraints are often set out, as convenient, so that a desired objective may be satisfied, and the actual trajectory of the controlled system can often be allowed to mildly deviate from the prescribed trajectory as long as the objective is nonetheless met. For example, to achieve stable control to the desired quaternion (our control objective), it is not necessary to specify exact trajectories along the curved surface of . We can design simpler trajectories such as straight line trajectories to the desired quaternion, *u*_{d}. As shown in past work (Schutte 2010), such control systems are easily handled when they are cast into the so-called permissible control form as we shall see in the subsequent development.

To develop this second control strategy, we begin by considering the modified constraints in equation (3.5) in the form of equation (3.6) so that
3.18
where and denote the control constraints. The generalized control torque that causes each component of *u* to independently approach *u*_{d} is explicitly found using the fundamental equation so that
3.19
In particular, this control force governs the prescribed control paths that we have arbitrarily chosen for each of the quaternion components. Indeed, this control force does not satisfy the unit norm constraint in equation (2.4). To satisfy equation (2.4), we cast the system into permissible control form (Schutte 2010) so that the controlled system becomes
3.20
The matrix in equation (3.20) is a projection operator that exists because of the presence of the quaternion unit-norm modelling constraint as given by equation (2.17). It ensures that the modelling constraints are satisfied at each instant of time regardless of the control inputs that are applied to the system. For *A*=*u*^{T} and , is given explicitly by
3.21
where we have used the identities in equations (2.9) and (2.21). In permissible control form (equation (3.20)), the explicit rotational equations of motion of the controlled system are then
3.22
The control acceleration *γ*_{2}(*t*) (the subscript 2, again, reminds us that we are dealing with our second control strategy) is therefore given by
3.23

Though seemingly simple, the behaviour of the controlled nonlinear dynamical system described by equation (3.22) can be quite complex. In this paper, we shall concentrate on the fixed points of this system and their stability. The fixed points are given by and any 4-vector *u**=*u* that satisfies the equation
3.24
where we recall that both quaternions *u* and *u*_{d} are unit quaternions. One obvious solution to equation (3.24) is the isolated fixed point *u**=*u*_{d}. In general, for some real scalar *ρ*, the satisfaction of equation (3.24) requires that the vector
3.25
as *u* is a unit quaternion and consequently (*I*_{4}−*uu*^{T}) is the orthogonal projection operator that projects any vector onto a plane normal to the 4-vector *u*. Re-arranging, equation (3.25) becomes
3.26
The general solution to equation (3.26) is
3.27
where *G*=(*β*−*ρI*_{4}) and *h* is an arbitrary 4-vector. Observe that the solutions in equation (3.27) depend upon the values of *ρ*, *β* and *u*_{d}. Also, note that the matrix *G* is not invertible only when *ρ*=*β*_{i}, *i*=0,1,2,3. By inspection of equation (3.26), we see that this could only occur when *u*_{d} has one or more zero components. When *G* is invertible, equation (3.27) becomes
3.28
The values *u** are found by first determining those real values of *ρ* that satisfy
3.29
and subsequently using equation (3.28). A solution of equation (3.29) is always *ρ*=0, which corresponds to *u**=*u*_{d}, a result we have already obtained by inspection of equation (3.24).

When the diagonal matrix *G* is singular, we can assume that *ρ*=*β*_{i} for some *i*∈{0,1,2,3}. For consistency of equation (3.26), this requires that *u*_{i,d}=0. Without loss of generality, let us assume that *ρ*=*β*_{3} and, initially, *β*_{i}≠*β*_{3}, *i*=0,1,2. The solution of equation (3.26) then becomes
3.30
where a real *h*_{3} is sought by equation (3.29). Depending on the values of *β*, this could yield two additional isolated fixed points. If *ρ*=*β*_{3}=*β*_{2} and *β*_{i}≠*β*_{3}, *i*=0,1, then we have the solutions
3.31
where again the values of *h*_{2} and *h*_{3}, hereto arbitrary, are determined by seeking real solutions to equation (3.29). Here, for consistency, we require that *u*_{2,d}=*u*_{3,d}=0. Depending on the values of *β* this could yield, in addition to isolated fixed points, a circle of non-isolated fixed points. Similarly, if *ρ*=*β*_{3}=*β*_{2}=*β*_{1}, which requires *u*_{1,d}=*u*_{2,d}=*u*_{3,d}=0, the solution to equation (3.26) is
3.32
In addition to the isolated fixed points and the circle of non-isolated fixed points, we could then have a sphere of non-isolated fixed points. Thus, a multiplicity of isolated and non-isolated fixed points may exist depending on our choice of the control parameters *β*_{i} and the desired quaternion *u*_{d}. For example, when the control parameters *β*_{i} are chosen to be identical so that *β*=*β*_{0}*I*_{4}, then *ρ*=2*β*_{0} satisfies equation (3.29) and yields *u**=−*u*_{d} as another fixed point of the controlled system. In fact, when *β*_{i} are all identical, the only solutions to equation (3.26) are *u**=±*u*_{d}, and so this particular controller has only two fixed points.

The stability of the controlled system in equation (3.22) is now investigated at the fixed point of interest (). We shall assume, for simplicity, that either all the *β*_{i}'s are identical, or that they are all distinct, so that we always have a set of isolated fixed points. Let
3.33
where *u*(*t*) is a perturbed trajectory of the rotating rigid body. The equation governing the perturbation then becomes
3.34
Consider now the Lyapunov function , which is positive for as *β* is positive definite. Differentiating *V* with respect to time, we get
3.35
We find that (*u*_{d}+*ζ*)^{T}(*u*_{d}+*ζ*)=1 as the perturbed trajectory *u*(*t*) describes a rotational motion, and upon differentiating with respect to time, we have . Equation (3.35) then reduces to
3.36
which is negative semi-definite. To show asymptotic stability, we consider LaSalle's theorem. In the vicinity of the fixed point *ζ*=0, let us choose a suitably small region *D*. This region is positively invariant as *V* is positive definite and . Moreover, in this region *D*, when we have by equation (3.36). By equation (3.26), the set
3.37
that contains all values of *ζ*∈*D* and satisfies the equation
3.38
has only one invariant trajectory *ζ*=0. This is because the solution, *ζ*, of equation (3.38) is, as before, of the general form
3.39
for some real scalar *ρ*, such that . The value *ζ*=0 is always an isolated solution of equation (3.39); the other values of *ρ* are found from equations (3.30)–(3.32). These fixed points are isolated as the parameters *β*_{i} are assumed distinct. We see that the largest (only) invariant set in *W* is then given by *ζ*=0, making this point, and hence *u**=*u*_{d}, asymptotically stable.

## 4. Numerical examples

In this section, numerical examples are provided to show the efficacy of the two control methodologies presented in the last section for a rigid body with principal inertias *J*_{1}=100, *J*_{2}=200 and *J*_{3}=250 ^{2}. The simulations are carried out starting from an initial orientation, *u*_{initial}, for rest-to-rest manoeuvres so that , and the final desired (rest) orientation is *u*_{d}.

### (a) Controller strategy 1

Here, we employ the first controller obtained in equation (3.11) to the system given by equation (3.2). Using this approach, the equations of motion of the controlled system were found by assuming *u*_{0}≠0 in equations (3.13) and (3.14). First, we consider the desired quaternion , , 0, . In order to visualize the controlled trajectories, we shall assume that the rigid body rotates in the set . This allows us to plot rotational trajectories on the unit 2-sphere, , given by . The control parameters are chosen as
4.1
Figure 1 shows the resulting rotational trajectories on the unit 2-sphere for various initial quaternions near the boundary given by equation (3.17). The control maintains *u*_{2}(*t*)=0 throughout the manoeuvre. In figure 1*a*, trajectories are seen to converge to the fixed points *u**_{1,2} in equation (3.15). The figure also shows the intersection of the unit 2-sphere and the hyperplane *u*_{0}=0. When the 4-vector *u*_{initial} is such that *u*_{0,initial}>0, the trajectories converge to *u*_{d} if *u*_{0,d}>0, where *u*_{d} is denoted by the small dark grey sphere. When *u*_{0,initial}<0 and *u*_{0,d}>0, the trajectories converge to the undesirable orientation denoted by the small light grey cube. As explained before, in this case it is not necessary to cross the hyperplane *u*_{0}=0 in order to reach the desired target orientation as we can represent the desired quaternion location as −*u*_{d} as shown in figure 1*b*.

We next consider a rigid body reorientation starting from a more general initial quaternion *u*_{initial}=[3/10, −1/5, 7/10, to reorient to the desired quaternion *u*_{d}=[9/10, 1/5, −3/10, −3/10]^{T} using and given in equation (4.1). Figure 2*a* shows the components of the quaternion *u*(*t*) as a function of time over a duration of *t*=30 s. Figure 2*b* gives the components of the control torques (equation (3.9)) about the body-fixed axes required to accomplish this change in orientation. The extent to which the quaternion *u*(*t*) remains a unit quaternion, as is required, during the control manoeuvre is shown in figure 2*c*. Noting the vertical scale, the unit norm constraint is satisfied to the same numerical order of accuracy as the local error tolerance used in numerically integrating equations (3.13) and (3.14).

### (b) Controller strategy 2

We now apply the second controller strategy given by equation (3.23) to the system in equation (3.2). This controller strategy is highlighted by considering the following two examples.

#### (i) Identical *β*_{i}

When the parameters of the diagonal matrix *β* are chosen so that *β*=*β*_{0}*I*, the controlled system has two fixed points, namely, the asymptotically stable fixed point and a second fixed point , as we have seen in equations (3.28) and (3.29). In this example, we shall assume that the desired quaternion is *u*_{d}=[1,0,0,0]^{T}. The fixed points of the controlled system are then *u**_{1,2}=±[1,0,0,0]^{T}. The diagonal matrices *α* and *β* are taken to be
4.2
and
4.3
As before, we visualize the rotational trajectories on the unit 2-sphere, , as shown in figure 3. Rotational trajectories starting from various initial orientations that are near the unstable fixed point *u**_{2}=[−1,0,0,0]^{T} are shown (see the appendix, table 1). The rotational trajectories *u*(*t*) corresponding to the initial quaternion *u*_{initial}=[−199/200, are shown in figure 4*a*. Also, for the same initial quaternion, the control torques about the body-fixed coordinate axes required to accomplish the manoeuvre are shown in figure 4*b*. Figure 4*c* shows the extent to which the quaternion *u*(*t*) satisfies the unit norm condition.

#### (ii) Distinct *β*_{i}

In this example, the diagonal matrix *β* is taken to be
4.4
The desired quaternion is again *u*_{d}=[1,0,0,0]^{T} while the diagonal matrix *α* is again given by equation (4.2). Given the values *u*_{d} and *β*, we can find all the (real) fixed points of the controlled system as outlined in §3. In this problem, equations (3.28) and (3.29) yield the isolated fixed points . In addition, as *u*_{d} contains zero components and the matrix *β* contains no repeated values, we have the possible values *ρ*=*β*_{i}, *i*=1,2,3. The isolated fixed points corresponding to these values of *ρ* are given by and , respectively, for *i*=1,2,3. Thus, this particular reorientation control problem yields a total of eight isolated fixed points. All of these fixed points are found to be unstable except the ones at (see the appendix, table 2). Therefore, the controlled system is stable at the two fixed points ±*u*_{d}, which, we recall, represent the same desired physical orientation. We see that the desired orientation ±*u*_{d} appears to be (generically) globally stable. Figure 5 shows rotational trajectories with various initial conditions near the unstable fixed points *u**_{3,4}, *u**_{5,6} and *u**_{7,8}, which are denoted by the light grey cubes (see the appendix). In figure 5*a*,*b*, rotational trajectories are seen to converge to the two stable fixed points denoted by the dark grey spheres. The unstable fixed points are saddle nodes (see the appendix), and in each of these figures we have shown saddle connections in which heteroclinic trajectories connect the saddle points.

## 5. Conclusions

This paper deals with the rotational dynamics and control of rigid bodies and uses quaternions to describe and control their orientation. By viewing such rotational motions in terms of the theory of constrained motion, it provides a new and unified framework for understanding both the rotational dynamics and the rotational control of rigid bodies. It permits the development of numerous control strategies, of which two have been explored in some detail here.

The main contributions of this paper are the following:

— A simple three-step approach for deriving Lagrange's equations for rotational motion of a rigid body using the fundamental equation, which explicitly provides the equation of motion for constrained mechanical systems. An explicit equation giving the generalized acceleration of a rotating body in terms of quaternions is also obtained.

— The simplicity and ease with which this same fundamental equation can yield the explicit, closed form, control torque needed to be applied to a rigid body in order to change its orientation. This places both the dynamics and the control aspects of rigid body rotational motion under one simple and overarching framework.

— The development of two control strategies to reorient a rigid body, starting from an arbitrary rest orientation and controlling it to move to another arbitrary rest orientation. The first strategy allows the stabilization to the constraint manifold to occur exactly along a pre-selected trajectory that is desired for the quaternion components

*u*_{i},*i*=1,2,3, while ensuring that*u*remains a unit quaternion. The second control strategy initially prescribes trajectories for each of the quaternion components independently (thereby specifying, in general, an inconsistent and non-physical trajectory). The dynamics are then modified by casting the controller into permissible control form, thereby correcting for, and developing the correct dynamics, and with it, the explicit control torque.— The explicit nature of the equations obtained for the controlled rigid body allows a detailed analysis of the resulting nonlinear dynamical system that describes the control action. By representing the desired target quaternion appropriately, the first control strategy appears to be globally stable so that the rigid body can be controlled to rotate from any initial (rest) orientation to any final (rest) orientation. The controlled nonlinear dynamical system resulting from the second strategy shows that depending on the parameter values

*β*_{i}, it could have a multiplicity of fixed points, whose detailed localization is presented. Their stability depend upon the parameters*β*_{i}chosen.— Numerical examples illustrating the ease of implementation of the two nonlinear controllers are presented. We note the accuracy with which the closed-form control meets the desired objective of rotating a rigid body from one given orientation to another desired orientation while maintaining the unit norm of the quaternion throughout the manoeuvres to be exactly unity.

## Appendix A. Stability of the fixed points for controller strategy 2

To investigate the stability of the isolated fixed points in our numerical examples, let us consider equation (3.20) as a system of eight first-order differential equations in phase space, of the form , where the state vector . Linearization of this eight-dimensional dynamical system about the fixed point *x**, so that *y*(*t*)=*x**+*ζ*(*t*), requires some care, because the linearized dynamics is required to be restricted to the manifold . Thus, one must use the restriction of the Jacobian operator of the aforesaid differential equation to this manifold in phase space. This leads to the 6×6 restricted Jacobian matrix, , given by
A1
The eigenvalues *λ*_{i},*i*=1,2,…,6, of yield information on the stability of the fixed points *x*=*x**.

Using *α* and *β* in equations (4.2) and (4.3), the numerically computed eigenvalues at the two fixed points for the linearized controlled system that is restricted to the manifold are given in table 1. From this table, we see that the fixed point is a stable node, while the fixed point is an unstable saddle node (figure 3).

The numerically computed eigenvalues of when the parameters *β*_{i} are given by equation (4.4) are shown in table 2. The two fixed points are stable while the remaining six fixed points are unstable.

- Received April 13, 2011.
- Accepted September 7, 2011.

- This journal is © 2011 The Royal Society