ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the...

38
Explicit solution of the ODEs describing the 3 DOF Control Moment Gyroscope M. van Berkel DCT 2008.104 Traineeship report Coach(es): dr. N. Sakamoto Supervisor: Prof. dr. H. Nijmeijer Technische Universiteit Eindhoven Department Mechanical Engineering Dynamics and Control Group Eindhoven, October, 2008

Transcript of ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the...

Page 1: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Explicit solution of the ODEs

describing the 3 DOF Control Moment

Gyroscope

M. van Berkel

DCT 2008.104

Traineeship report

Coach(es): dr. N. Sakamoto

Supervisor: Prof. dr. H. Nijmeijer

Technische Universiteit EindhovenDepartment Mechanical EngineeringDynamics and Control Group

Eindhoven, October, 2008

Page 2: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Contents

Contents 3

1 Introduction 4

2 Theory of Hamiltonian and Integrable systems 52.1 Lagrangian and Hamiltonian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Liouville integrability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3 Cyclic coordinates and conserved quantities . . . . . . . . . . . . . . . . . . . . . . 62.4 Poisson bracket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Control Moment Gyroscope 73.1 Description of the Control Moment Gyroscope . . . . . . . . . . . . . . . . . . . . 73.2 Lagrangian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83.3 Hamiltonian and conjugate momenta . . . . . . . . . . . . . . . . . . . . . . . . . 93.4 CMG’s first integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.5 Solution in Integral form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4 Dynamics of the CMG-system 114.1 Equilibrium points of the unperturbed system . . . . . . . . . . . . . . . . . . . . . 114.2 Libration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124.3 Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.4 Transition from libration to rotation . . . . . . . . . . . . . . . . . . . . . . . . . . 144.5 Change of motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.6 Special case of the equilibrium point . . . . . . . . . . . . . . . . . . . . . . . . . . 154.7 Summary of the different kind of motions . . . . . . . . . . . . . . . . . . . . . . . 16

5 Construction of the solution 175.1 Constant q2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175.2 Libration of q2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185.3 Total rotation of q2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195.4 Special cases of q2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205.5 Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

6 Optimal control of the CMG 246.1 Optimal Control problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246.2 Linear Optimal Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256.3 Nonlinear Sub-Optimal Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

7 Conclusions and Recommendations 28

Bibliography 30

List of symbols 31

2

Page 3: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Contents

A Analytic solution for special cases 32A.1 Solution for the case p1 = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32A.2 Solution for the case p1 = 0 and p4 = 0 . . . . . . . . . . . . . . . . . . . . . . . . 33

B Analysis of f(q2) 34B.1 Denominator > 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34B.2 Extrema of f(q2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34B.3 Maximum qMax

2 coincides with a zero if |2a| > |b| . . . . . . . . . . . . . . . . . . 35B.4 Minimum qMin

2 coincides with a zero if |2a| > |b| . . . . . . . . . . . . . . . . . . . 36B.5 Extrema qMin

2 and qMax2 coincide with a zero if |2a| < |b| . . . . . . . . . . . . . . . 36

C Numerical values used for the different parameters and simulations 37

3

Page 4: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Chapter 1

Introduction

In the control of many dynamical systems optimal control plays a important role. Many techniqueshave already been developed to solve these kind of problems. Next to this many extensions havebeen developed for instance LQR/LQG andH∞-control. Compared to linear optimal control, non-linear optimal control is still rarely applied. This is because most of the existing techniques areonly successful when using some simple nonlinearities, even then it is still difficult and often timeconsuming to apply. However for highly nonlinear systems, optimal linear controllers do not workproperly and as a consequence nonlinear optimal control needs to be applied.

Therefore in [6] a method is proposed to find an approximation for the stabilizing solution ofthe Hamilton-Jacobi equation .

The proposed method is based on the Hamiltonian perturbation theory. The idea behind thistheory is to split the system into two parts, the uncontrolled system and the remaining terms(control). The remaining parts can be treated as a perturbation on the original system. The unper-turbed system (without control) needs to be integrable to solve it. With this solution the Hamiltonequations can be substantially reduced making it possible to build an approximated nonlinear(sub-)optimal controller.

This theory has already been shown to work for some simple nonlinear problems. However toshow that the theory also works for more complicated problems a more difficult nonlinear setuphas been chosen to design a nonlinear optimal controller by using this theory. The eventual goalis not only to show it to work in simulation but also that it is possible to use feedback to stabilizea real setup. This is the Control Moment Gyroscope system (CMG). Its normal function is theattitude control of spacecrafts. However in this case the control problem will be different. TheCMG is a nonholonomic system. This will often lead to problems regarding to control. Howeverin our case some of these properties can be exploited like the existence of cyclic coordinates.

In this report the focus will lie on finding a solution of the restricted CMG without control.The solution can be used to synthesize the controller. First a small outline of this theory is given inChapter 2. After this it will be shown that the system fulfills the necessary conditions to integrateit. Then the solution will be represented in integral form. This is done in Chapter 3. With the helpof this solution, the different regimes of motion and equilibrium points are explained (Chapter 4).This is also needed to construct a solution for control purposes from the solution in integral form .After this it will be shown how to construct the solution and some of the results will be comparedto the solutions found with ODE-solvers. Finally the perturbation theory can be used to derive asub-optimal nonlinear feedback controller. How to do this is explained in Chapter 6.

4

Page 5: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Chapter 2

Theory of Hamiltonian and

Integrable systems

Before a start can be made with solving the Control Moment Gyroscope system some theory needsto be introduced. Within the theory the system has to be split up in an uncontrolled part and acontrolled part. A requirement is that the uncontrolled part is integrable. In this chapter some ofthe necessary theory about the Hamiltonian and integrability will be treated. This part is mainlybased on the theory described in [2] and [3]. However there are many other books that treat thesesubjects.

2.1 Lagrangian and Hamiltonian

The starting point in general in studying and working with dynamics is the Lagrangian L. Adifferent way to describe the dynamics of a system is the Hamiltonian representation.

The main difference is that the Lagrangian equations of motion are expressed in second or-der differential equations, where the Hamiltonian equations of motion are expressed as first orderequations. The consequence of this is that the number of equations is doubled with respect tothe Lagrangian representation. This also means that the number of independent variables is dou-bled. In general the Lagrangian is already known therefore it is most common to transform theLagrangian to the Hamiltonian. The Lagrangian depends on the independent variables qi and qi.

L = L (q1, q2, ..., qn, q1, q2, ..., qn) (2.1)

Whereas the Hamiltonian is a function of newly introduced independent coordinates pi and of qi.These pi are called conjugate momenta and are a function of qi and qi. These new coordinates pi

together with the qi are called canonical variables. This means that the Hamiltonian has followingform:

H = H (q1, q2, ..., qn, p1, p2, ..., pn, ) (2.2)

The conjugate momenta are defined as:

pi (q, q) =∂L(qi, qi)∂qj

(2.3)

The Lagrangian L (q, q) can now be transformed to the Hamiltonian H (q, p). Using somealgebraic operations on the conjugatemomenta qi can be expressed as function of q and p, (q (q, p)).The systematic transformation from the Lagrangian to the Hamiltonian representation is donewith the help of the Legendre transformation:

H (q, p) =∑

i

qi (q, p) pi − L (q, q (q, p)) (2.4)

With this knowledge of H (q, p) also Hamiltonian equations of motions can be derived (2.5).

5

Page 6: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

2.2. Liouville integrability

qi =∂H

∂pi, pi = −∂H

∂qi, i = (1, ..., n) (2.5)

Within this Hamiltonian formulation many extensions can be made in different directions.

2.2 Liouville integrability

In the last section the Lagrangian has been transformed to the Hamiltonian formulation. In thissection the notion of integrability is introduced. Within the literature [2], [3] there are many formsof definitions given for Liouville integrability. However commonly following definition is used:

A Hamiltonian system is completely integrable in the sense of Liouville if all constants ofmotion are in involution [2]. Another definition in [2] is: Two functions are in involution if theirPoisson bracket is zero. The system needs to be integrable to solve it. Therefore the involution ofthe constants of motion needs to be checked to be sure it is integrable.

A constant of motion is a quantity that is conserved throughout the motion. Another term oftenused for this is first integral. A constant of motion or first integral can be expressed as follows:

f (q1, q2, .., qn, q1, q2, .., qn) = constant (2.6)

To be able to integrate a system all the first integrals (constants of motion) need to be found likethe definition says. In reality the number of first integrals that need to be found is n, the degrees offreedom (2.5). In general the Hamiltonian is also a constant of motion because it is the conservedtotal energy of the system. Another way to find first integrals is with the help of cyclic coordinates.

2.3 Cyclic coordinates and conserved quantities

The easiest way to find first integrals is with the help of cyclic coordinates. A cyclic coordinate isdefined as a coordinate qj that does not enter the Hamiltonian function (the same holds for theLagrangian). In other words H or L are not a function of qj , however H can still be a function ofqj . The nice property of this is that its belonging conjugate momentum pj is a constant of motion.This can be easily shown as follows:

d

dt

∂L

∂qi− ∂L

∂qj=

d

dt

∂L

∂qi=

d

dtpj = 0 (2.7)

A different constant of motion is the total angular momentum. If the needed number of firstintegrals has been found, then it is necessary to check if they are in involution.

2.4 Poisson bracket

Two functions u(q, p) and v(q, p) are in involution if their Poisson bracket is zero, as was earlierstated. The Poisson bracket is defined as follows:

[u, v]q,p =∂u

∂qi

∂v

∂pi− ∂u

∂pi

∂v

∂qi(2.8)

To check if the Hamiltonian system is integrable all combinations of the first integrals witheach other and with the Hamiltonian need to vanish. The Poisson bracket of a first integral andthe Hamiltonian is always zero, otherwise it would not be a first integral. This is because:

[H, f ]q,p =∂H

∂qi

∂f

∂pi− ∂H

∂pi

∂f

∂qi= pi

∂f

∂pi+ qi

∂f

∂qi=df

dt(2.9)

If f is a first integral of H then dfdt ≡ 0.

This theory will be used to check integrability of the Control Moment Gyroscope.

6

Page 7: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Chapter 3

Control Moment Gyroscope

In the last chapter the theory about integrable systems has been introduced. In this chapter thistheory is used to try to solve the Control Moment Gyroscope system. Therefore first the systemsmodel will be introduced. After this the Lagrangian and the Hamiltonian will be derived. Thenthe constants of motion are derived and they are used to find the solution of the system in integralform.

3.1 Description of the Control Moment Gyroscope

In figure 3.1 a schematic representation of the CMG can be seen.

Figure 3.1: Schematic representation Control Moment Gyroscope [4]

The CMG system consists of four gimbals respectively A, B, C and D. Within these gimbalsthere are four axis fixed. These are ai, bi, ci and di with unity vectors i = 1, 2, 3. At the baseof the CMG a reference frame N is defined with orthogonal unit vectors Ni (i = 1, 2, 3). In thissystem there are four angles that can rotate. These are q1 in d2 direction, q2 in c1 direction, q3 inb2 direction and q4 in n3 direction. The angular velocities ωi are defined in the same directions asqi (i = 1, 2, 3, 4). These are also represented in figure 3.1. All centers of mass are situated at thecenter of disc D.

The body’s D and C can be directly actuated through T1 and T2 (see figure 3.1). Body D canbe actuated in d2 direction this corresponds to the rotation angle q1. Body C can be actuated in c1direction that corresponds to the rotation angle q2.

7

Page 8: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

3.2. Lagrangian

All angles qi (i = 1, 2, 3, 4) are observable because these angles are measured by encoders. Theelements Ix, Jx, Kx (x = A,B,C,D) are the scalar moments of inertia about the kth (k= 1,2,3)direction respectively in bodies A, B, C, and D. Only the moments of inertia are considered andnot the products of inertia. The zero positions resemble the positions as seen in figure 3.1 (qi = 0).On the real setup there is the possibility to lock b2 respectively q3. This opportunity will be used,so q3 is locked in zero position. This means no motion around this angle is possible anymore andthereby reducing the system to three degrees of freedom.

In many articles and papers like [4] and [5], also a description of the Control Moment Gyroscopecan be found.

3.2 Lagrangian

In case of the CMG the Lagrangian equals the kinetic energy because the potential energy is zero.For instance the gravity can be neglected in the system. Now the Lagrangian of the system withoutcontrol can be calculated and is given:

L =12(Jdω1

2 + (Ic + Id)ω22 +

(J2 − J1 cos2 (q2)

)ω2

4

)+ Jdω1ω4 sin (q2) (3.1)

in which

J1 = Jc + Jd −Kc − Id and J2 = Ka + Jc + Jd +Kb with J1 < Jd < J2 (3.2)

From the Lagrangian and the non-conservative forces, Lagrange’s equations can be derived.For completeness also the non-conservative quantities are added.

Jd(ω1 + ω4 sin (q2) + ω2ω4 cos (q2)) = T1 (3.3)

(Ic + Id) ω2 −12J1ω

24 sin (2q2)− Jdω1ω4 cos (q2) = T2 (3.4)

(J2 − J1 cos2 (q2)

)ω4 + J1ω2ω4 sin (2q2) + Jd (ω1 sin (q2) + ω1ω2 cos (q2)) = −ω4d4 (3.5)

Because we want to find the explicit solution of the system, we are only interested in thesystem without control (T1 = 0, T2 = 0 and d4 = 0). The state space model (with the states:q1, q2, q4, ω1, ω2, ω4) is given by:

q1 = ω1 (3.6)

q2 = ω2 (3.7)

q4 = ω4 (3.8)

ω1 =ω2 cos (q2)

(Jd sin (q2)ω1 − ω4

(J2 − J1

(2− cos2 (q2)

)))J2 − J1cos2 (q2)− Jd sin2 (q2)

(3.9)

ω2 =ω4

(Jdω1 cos (q2) + 1

2J1ω4 sin (2 q2))

Ic + Id(3.10)

ω4 =ω2

(ω4 sin (2 q2)

(12Jd − J1

)− Jdω1 cos (q2)

)J2 − J1cos2 (q2)− Jd sin2 (q2)

(3.11)

The state space model has been used to simulate the unperturbed system.

8

Page 9: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

3.3. Hamiltonian and conjugate momenta

3.3 Hamiltonian and conjugate momenta

In Section 2.1 it was explained how the Lagrangian has to be transformed to the Hamiltonian. Thistransformation is done through the conjugate momenta (2.3).

The following conjugate momenta are then found:

p1 = Jdω1 + Jdω4 sin (q2) (3.12)

p2 = (Ic + Id)ω2 (3.13)

p4 =(J2 − J1 cos2 (q2)

)ω4 + Jdω1 sin (q2) (3.14)

Now all the angular velocities are being replaced with the conjugate momenta. In essenceL (q2, ω1, ω2, ω4) has been transformed to the Hamiltonian H (q2, p1, p2, p4)

The Hamiltonian has now the following form:

H =12

(p22

(Ic + Id)+p21

Jd+

(p4 − p1 sin (q2))2

J2 − J1 cos2 (q2)− Jd sin2 (q2)

)(3.15)

3.4 CMG's �rst integrals

Two first integrals are easily found with the help of cyclic coordinates. The coordinates q1 andq4 are cyclic coordinates because they do not appear in the Hamiltonian. In (2.7) it was alreadyshown that its corresponding conjugate momenta are constant. This means that p1 and p4 arefirst integrals. The Hamiltonian H is also a first integral because it is a conserved quantity (thetotal energy of the system). It has to be checked that all constants of motion are in involution.Therefore for all combinations the Poisson brackets need to be zero. Because H(q2, p1, p2, p4) isnot a function of q1 and q4 immediately can be concluded that their Poisson brackets are zero. ThePoisson bracket of the Hamiltonian function with the Hamiltonian is always zero. The Poissonbracket can also be used to show that p2 is not a constant because it is different from zero:

[p2,H]q,p =∂p2

∂q2

∂H (q, p)∂p2

− ∂p2

∂p2

∂H (q, p)∂q2

= −∂H(q2, p1, p2, p4)∂q2

6= 0 (3.16)

The Hamiltonian depends on q2 as a consequence the partial derivative to q2 is different fromzero. Now it can be concluded that the system is integrable. The four degrees of freedom CMG,so without axis 3 locked it is also integrable. This is because the first integrals found for the 3 DOFsystem are also first integrals of the 4 DOF system. Another conserved quantity that has not beenused yet is the total angular momentum. As a consequence the number of first integrals neededis sufficient. However it has to be checked that all their Poisson brackets are zero. This could notbe found in the literature.

3.5 Solution in Integral form

In Section 3.4 it was already concluded that p1, p4 andH are constants of motion. This knowledgeis used to find an explicit solution of the corresponding set of ODEs describing the uncontrolled 3DOF CMG. The value of the constants of motion are determined by the initial conditions.

The explicit solution can only be found if the Hamiltonian (3.15) only depends on constants andone variable and its derivative. Because p2 is not constant it needs to be replaced. This is done byreplacing p2 with (Ic + Id)ω2. This was derived in (3.13).

H =12

((Ic + Id)ω2

2 +p21

Jd+

(p4 − p1 sin (q2))2

J2 − J1 cos2 (q2)− Jd sin2 (q2)

)(3.17)

Now (3.17) can be rewritten as ω2 = ω2(q2) with the constants p1, p4 and H .

9

Page 10: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

3.5. Solution in Integral form

ω2 = ±√

1Ic + Id

√2H − p2

1

Jd− (p4 − p1 sin (q2))

2

J2 − J1 cos2 (q2)− Jd sin2 (q2)(3.18)

By separation of variables (3.18) can be solved. For simplicity the initial conditions will bechosen at t = 0. The integral will also only be evaluated for the positive root of (3.18). This meansthat in a later stage the sign of ω2 should be taken into account.∫ t

0

dt =√Ic + Id

∫ q2

qi2

dq2√2H − p2

1Jd− (p4−p1 sin(q2))

2

J2−J1 cos2(q2)−Jd sin2(q2)

(3.19)

After some algebraic operations the integral can be represented in the following form.

t =∫ q2

qi2

√Jd (Ic + Id)

(J2 − J1 − (Jd − J1) sin2 (q2)

)(2JdH − p2

1)(J2 − J1 − (Jd − J1) sin2 (q2)

)− Jd (p4 − p1 sin (q2))

2 dq2 (3.20)

In a mathematical sense this system is solved. After solving the integral and rewriting it to q2the solution will have following form:

q2 = q2(t;H, p1, p4) (3.21)

In (3.21) q2 will only depend on the time t and the constantsH , p1 and p4. With this informationthe solution for the entire system can be derived.

ω1 (t;H, p1, p4) =p1

Jd− p4 sin (q2 (t))− p1 sin2 (q2 (t))J2 − J1 cos2 (q2 (t))− Jd sin2 (q2 (t))

(3.22)

ω4 (t;H, p1, p4) =p4 − p1 sin (q2 (t))

J2 − J1 cos2 (q2 (t))− Jd sin2 (q2 (t))(3.23)

The integral in (3.20) needs to be solved to be able to solve the entire system. The integrallooks like it belongs to the class of elliptic integrals, therefore it was tried to solve (3.20) withthe help of elliptic integrals. However because of the cross-term of (p4 − p1 sin (q2))

2 in (3.19)(−2p1p4 sin (q2)) it was impossible to do this. As a consequence of this it was not possible to findan analytic expression for the solution of this integral. However the solution of this integral isstill closely related to the elliptic functions. Therefore the underlying theory of elliptic integrals isused to help solve and test the methods that are used to eventually solve this system. It can also beshown that (3.19) is closely related to elliptic functions. If a simplification is applied for instancep1 = 0 (−2p1p4 sin (q2) will vanish). Then this integral reduces to a form where it is solvable withelliptic integrals. The analytic solution for p1 = 0 and p1 = p4 = 0 are shown in Appendix A.Although an analytical solution can be derived in such a way for many cases it is still difficult towork with as can be seen in Appendix A.1. Therefore this system needs to be solved in a differentway. However, before this can be done, it is necessary to determine what the essential changes arewithin the dynamics.

10

Page 11: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Chapter 4

Dynamics of the CMG-system

In Section 3.5 the solution for the CMG system was found in integral form. For future applications(Optimal control theory) it would be easiest to work with an analytical solution for the CMG, butunfortunately this is not possible. That is why another method is needed to find a useful solutionfor this system. However before this can be done the system’s dynamical properties have to bestudied. The natural starting point to do this is to determine the equilibrium points of the unper-turbed system. Then the two basic motions, oscillation and rotation are described. After this thespecial cases like the homoclinic and heteroclinic orbit are described and analyzed. At the end ofthis chapter a summary is given of the different cases.

4.1 Equilibrium points of the unperturbed system

A natural way to determine the equilibrium points is by setting the left hand side of the state spacemodel to zero (Section 3.2). This results in the following equilibrium points:

ωi = 0 (4.1)

qi ∈ R

This is not a very useful conclusion. However if ω1, ω4 and q2 are taken as constants thesystem equation (3.18) is still in equilibrium (ω2 = 0). In this case q1 and q4 are not considered ascoordinates (cyclic coordinates) and ω1 and ω4 therefore do not need to be zero. The combinationof initial conditions that correspond to this definition of equilibrium are given in table 4.1.

Table 4.1: Equilibrium pointsqi1 qi

2 qi4 ωi

1 ωi2 ωi

4

R ±π2 R R 0 R

R R R R 0 0R R R J1

Jdωi

4 sin(q2) 0 R

This corresponds to the zeros of (3.18), so it also could be directly derived from (3.18). Howeverit is more difficult to see it in this equation. This is because the initial conditions are embeddedwithin the conjugate momenta and the total energy H . To derive this directly lets first take a lookbeneath the square root in (3.18).

The numerator under the square root will be defined as f(q2). The denominator (under thesquare root) is always positive, so there are no singular points. This is explained in Appendix B.1.As a consequence of this f(q2) has to be positive or equal to zero otherwise no real solution for ω2

exists because of the square root in (3.18).To analyze f(q2) for simplicity a, b and c will be used and are defined as follows:

f(q2; qi

2, ωi1, ω

i2, ω

i4

)= a sin2 (q2) + b sin (q2) + c with (4.2)

11

Page 12: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

4.2. Libration

a = −(2Jd(Jd − J1)H + J1p21), b = 2Jdp1p4, c = (2JdH − p2

1)(J2 − J1)− Jdp24

The numerator f(q2) is just a second order equation in sin (q2), so it is easy to find the zeros of(3.18):

sin (q2) =−b±

√b2 − 4ac

2awith a ≤ 0 (4.3)

Now Z is the set containing all values for q2 that satisfy (4.3). In other words all the zeros off(q2) and ω2. This means that:

0 = f (Z(i)) = ω2 (Z(i); p1, p4,H) with i = 1, 2, ... (4.4)

However it must be considered that the zeros of f (q2) are not automatically the equilibriumpoints of the system because qi

2 is also hidden within the constants of motion. The system is inequilibrium as described in (4.1) if: qi

2 within the constants of motion is also a zero of f (q2). Thismeans if qi

2 ∈ Z the system is in equilibrium.The length of Z can differ from none to infinity depending on the constants of motion. How-

ever because of the sinus wherein q2 is contained the number of zeros only needs to be consideredwithin the 〈−π, π] interval because of the symmetric character of the sin-function. This meansthat the number of zeros within this interval will only be ranging from none to four . The zerosof f(q2) have important physical meaning even if qi

2 6∈ Z. This will be shown in the next sectionsof this chapter. During the analyzing process it was found that the CMG system has resemblesto a simple pendulum system. Although the CMG system is more complex it will be easier tounderstand when the system is compared to a pendulum.

In essence the system can be separated in two basic motions, libration and rotation just likethe pendulum.

4.2 Libration

The first basic motion corresponds to a simple oscillating behavior. Another name for this motionis libration. Although the CMG system can oscillate in many different ways, it is similar to thesimple oscillating pendulum. The main difference is that the oscillation is not around a certainpoint (where the potential energy is zero in the pendulum) but can change as a function of theconstants of motion. In a pendulum the movement is bounded by the zeros of the kinetic energy.The same holds for the CMG, if the kinetic energy is zero, the upper and lower bound of oscillationhave been reached.

The zeros of the kinetic energy are the same as the zeros of ω2 respectively f(q2), with as im-portant consequence that the upper and lower value that the angle q2 can reach will be determinedby these zeros.

This can be seen in the integral that has to be solved.

t =∫ q2

qi2

√Jd (Ic + Id)

(J2 − J1 − (Jd − J1) sin2 (q2)

)f(q2)

dq2 (4.5)

Herein f(q2) has now become the denominator. If f(q2) becomes zero the equation withinthe integral becomes singular. If this integral is solved, the solution will be of the form t =t(q2; p1, p4,H). However the solution needed should be of the form q2 = q2(t;H, p1, p4). Soby switching time t and the angle q2, t = t(q2; p1, p4,H) is inverted to q2 = q2(t;H, p1, p4). Thezeros of f(q2) that lead to singularity will now become the boundaries of q2. This means that allzeros of f(q2) (Z) need to be understood as the bounds of integration in (4.5). Only the domainwhere f(q2) is positive can be integrated. The domain that is enclosed by two zeros of f(q2). Thetwo values that enclose the domain where f(q2) is positive are from the set Z. They are calledZLBI , the lower bound of integration and ZUBI , the upper bound of integration. In other wordsthe upper value and the lower value where in between q2 can oscillate. The difference between thisupper and lower bound of integration is the same as the amplitude in the sense of normal periodicfunctions.

12

Page 13: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

4.2. Libration

In reality it is somewhat more difficult because the zeros of f(q2) change, depending on theconstants of motion. In essence there can be said that, if there are zeros, they limit the motion ofthe system. Already it has been explained what the solutions are. However for better understand-ing (4.2) is represented in figure 4.1.

−3 −2 −1 0 1 2 3−0.02

−0.01

0

0.01

0.02

0.03

0.04

0.05

q2

f(q 2)

f1: f(q

2;−π/4,−2,0.5,0.5)

f2: f(q

2;π/4,−10,1,0.1)

f3: f(q

2;π/4,−10,2.94,1)

f4: f(q

2;π/4,−10,3.5,1)

Figure 4.1: Graphical representation of the numerator f(q2; qi2, ω

i1, ω

i2, ω

i4) for the di�erent

motions related to libration (di�erent initial conditions)

In figure 4.1 four possible f(q2) are represented. Within this representation some specialconfigurations are not shown because they correspond to special cases and will be treated later.Important to remember is that ω2 is only defined in the domain where f(q2) ≥ 0. So all informa-tion below zero is not important and is as a consequence not represented. f(q2) is represented forfour different combinations of initial conditions or constants of motion. f1(q2) and f4(q2) haveonly two zeros so these represent two basic oscillations. Only the form of the oscillation will differsignificantly. f3(q2) has three zeros; there are two domains only separated by one zero where f(q2)is positive. f2(q2) has four zeros this means that there are two domains where f(q2) is positive.

The best way to understand this picture is to forget for a moment the denominator in (3.18)(then ω2 =

√f(q2)). Take for instance f1(q2), if the initial condition for qi

2 is near to the left zero.Then follow f1(q2) to the right side. This means that the angular velocity is increasing till thepoint q2 = −π

2 after this the angular velocity is decreasing till it is zero (f(q2) = 0). From hereon itcannot move further to the right because ω2 is not defined there (maximum value of q2 is reached).What will happen then is that ω2 will decrease again following f1(q2) back to the left side. Thiswill happen till the point q2 = −π

2 after this the angular velocity is increasing till it is zero again(minimum value of q2 is reached). This is because the negative solution of (3.18) also needs to beconsidered. This motion is repeating itself again and again, so this is a typical oscillating motion.In ω2 = ω2 (q2, p1, p4,H) there is still a denominator. This denominator will change the shape ofω2, but will not change the bounds.

The figure 4.1 contains all information necessary because after 2π the picture repeats itselfagain. Another important conclusion that can be drawn from the figure is that there is symmetryaround q2 = ±π

2 . This comes from the relation sin (q2) = sin (π − q2). A minimum of f(q2)is defined as qMin

2 . qMin2 is always equal to q2 = π

2 or q2 = −π2 or both in the case there are

two qMin2 . In the case that f(q2) has only one minimum (qMin

2 ) and one maximum (qMax2 ) then

qMin2 = −π

2 and qMax2 = π

2 in the case that b > 0 from (4.2). It automatically follows that if b < 0then qMin

2 = π2 and qMax

2 = −π2 . f(q2) has only one minimum and one maximum if |2a| < |b|.

This can be calculated with the help of the first and second derivative of f(q2). This is worked outand explained in Appendix B.2. This seems not to be important in this case however later on itwill be explained that there is an important physical meaning if one of these points is also a zeroof f(q2).

f2(q2) in figure 4.1 has four zeros in the domain 〈−π, π], this means there are two positivedomains (where ω2 is defined). The domain where the oscillation takes place, depends on the

13

Page 14: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

4.3. Rotation

initial condition qi2. The zeros that bound the domain wherein qi

2 is situated are the lower andupper bound of the oscillation. In the case of four zeros in the domain 〈−π, π] the amplitude ofthe oscillation cannot become bigger than π because it is limited between q2 = ±π

2 . By changingthe initial conditions in a way that f2(q2) moves upwards f3(q2) is found. In this case there arethree zeros in the interval 〈−π, π]. To the right and left of the zero located at q2 = π

2 (qMin2 ), the

domain is positive. The choice of the domain depends on the side where qi2 is situated. If qi

2 isthe point between the two positive domains, this corresponds to the equilibrium point as statedin table 4.1. In this point a change occurs where two smaller (oscillation) domains melt togetherto form one big (oscillation) domain. f1(q2) and f4(q2) only have two zeros so there is only onepositive domain and the zeros still corresponds to the lower and upper bound of the oscillation,ZLBI and ZUBI .

4.3 Rotation

This motion corresponds to the angle q2 rotating totally around in one direction. This can becompared to a pendulum wherein the kinetic energy is higher than the maximum potential energythat can be stored. As a consequence the pendulum keeps rotating. Simply said if you give itenough rotation momentum it will keep on spinning around. This motion corresponds to a casewhere there are no zeros (Z is empty) and as a consequence the domain where f (q2) > 0 hasbecome R. There is also a very basic case wherein this motion becomes more clear and can befound in Appendix A.2.

4.4 Transition from libration to rotation

The transfer between rotation and libration is the transformation from one or more zeros to nozeros. This also follows from the last two sections. This happens when all zeros are at the sametime a minimum of f(q2) (qMin

2 ). This case is illustrated in figure 4.2.

−3 −2 −1 0 1 2 3

0

0.01

0.02

0.03

0.04

0.05

0.06

0.07

q2

f(q 2)

f5: f(q

2;0,0,4.85,−7)

f6: f(q

2;−π/4,1,4.99,−2)

f7: f(q

2;− π/3,7,1.97,2)

Figure 4.2: Transfer from libration to rotation

In figure 4.2 the zeros are the bounds as described in Section 4.2 so the motion takes placebetween these bounds. However now there is no domain where f(q2) is negative. If the energy isslightly increased so that f(q2) moves upwards there will be now zeros left anymore. This meansno boundaries so total rotation. This change from libration to rotation can also be sudden, forinstance if ωi

2 is slightly increased. Then the whole curve will move upwards and there are nozeros anymore, rotation.

Now look at f6(q2) and f7(q2). They have only one qMin2 and one zero in the interval 〈−π, π]

and the motion is only bounded by one point within this interval. This means that the amplitudeof the motion is 2π.

14

Page 15: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

4.5. Change of motion

A special case will occur if also qi2 ∈ Z. As already explained this is an equilibrium point

(Section 4.1). This equilibrium point can be compared to the unstable equilibrium point of aninverted pendulum. In theory if an inverted pendulum is in equilibrium and there is a slightperturbation the pendulumwill fall down and come back to the equilibrium position taking infinitetime. This orbit is called a homoclinic orbit. The same thing happens for these equilibrium points.A slight perturbation will lead to a full rotation of q2 taking infinite time.

In the case of all zeros are also minimums of f(q2) (f5(q2)) and qi2 ∈ Z. Then if there is a

slight perturbation around this equilibrium point the angle q2 will move until it falls back into theother equilibrium point. This is called a heteroclinic orbit.

The homoclinic and heteroclinic orbits are both theoretical terms in our case. This is becauseto fall out of equilibrium a small perturbation is needed. A small perturbation means a change inenergy. As a consequence f(q2) will also change and f(q2) will have different properties. Howeverorbits that start close to these conditions will have some similar properties. A similar property isfor instance that the orbits will have long periods. These homoclinic and heteroclinic orbits aretherefore important conditions.

4.5 Change of motion

Now all cases where a sudden change can take place have been described. The cases as described inSection 4.4 and the case of f3(q2) in figure 4.1. These cases have all in common that qMin

2 coincideswith a zero. Although these cases can be identified with the described relations in the precedingsections. It is still quite time consuming and not straightforward to find out when a transitionwill occur. A nicer expression can be derived where these cases are expressed in the conjugatemomenta equal to twice the total energy. Two relations can be derived one for the q2 = −π

2position and one for the q2 = π

2 position. This is because qMin2 is always situated in q2 = ±π

2 .

2H =(p1 + p4)

2

J2 − Jd+p1

2

Jdbelonging to qMin

2 = −π2

(4.6)

2H =(p1 − p4)

2

J2 − Jd+p1

2

Jdbelonging to qMin

2 =π

2(4.7)

The derivation is made in Appendix B.4 with the help of first and second derivatives of f(q2).Now by filling in the constants of motion it is immediately possible to calculate wether the motionis on the brink of change. There is only one remark about this. That is in the case there are onlyone qMin

2 and one qMax2 (Figure 4.2: f6, b < 2a). Then one of (4.6) or (4.7) corresponds to a

maximum of f(q2) coinciding with a zero (depending on the sign of b, see Appendix B.5).

4.6 Special case of the equilibrium point

In the previous sections already an extensive analysis has been made of what happens if qMin2 ∈ Z.

Now a logical proceeding is what happens if qMax2 ∈ Z. The answer is nothing, q2 is constant in

this case . This is because ω2 is only defined in qi2 (and sometimes defined in π − qi

2 because ofsymmetry). It is much easier understood by just showing it. There are two possibilities one zeroor two zeros in the interval 〈−π, π] this can be seen in figure 4.3.

In figure 4.3 f(q2) is plotted again. The figure clearly shows that f8(q2) and f9(q2) are alwaysnegative except where they are zero. This means only here f(q2) is defined. If f(q2) is slightlychanged. It moves in that case upwards and there will be a small motion but no big changes.Similarly as in Section 4.5 an expression can be derived here and is explained in Appendix B.3.

2H =p1

2

Jd(4.8)

This can also be proven with the help of (4.3). As explained the zeros are the boundaries ofoscillation, so the boundaries are in this case in the same point. There is no oscillation anymorewhich means:

15

Page 16: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

4.7. Summary of the di�erent kind of motions

−3 −2 −1 0 1 2 3−4

−3.5

−3

−2.5

−2

−1.5

−1

−0.5

0

x 10−3

q2

f(q 2)

f8: f(q

2;−π/2,−0.5,0,0.1)

f9: f(q

2;π/4,−0.43,0,1)

Figure 4.3: Constant q2, maxima that coincides with an equilibrium point

sin (q2) =−b2a

with√b2 − 4ac = 2H − p1

2

Jd= 0 (4.9)

So exactly the same relation has been found. Also in this case a physical interpretation canbe given. This case corresponds to a pendulum (without damping) in stable equilibrium. Bygiving a very small push (increasing energy slightly) the pendulum just begins to oscillate a little.However because the energy is conserved in the system, it will remain oscillating with a very smallamplitude, just like the angle q2 of the CMG.

4.7 Summary of the di�erent kind of motions

In this chapter the different motions and special cases have been explained. Because they arespread over the chapter they are summarized. In the table underneath the basic motions aresummarized:

Table 4.2: Summary of the basic motionsBasic motions Condition Explanation

Equilibrium qi2 ∈ Z q2 is in rest

Libration ∃Z ∧ qi2 6∈ Z q2 is oscillating between ZLBI and ZUBI

Rotation Z = ∅ q2 is rotating without any boundaries

The special cases are summarized in table 4.3. Although also (4.6) or (4.7) could also be usedas conditions to separate the special cases it has here been explained with Z.

Table 4.3: Summary of the special casesSpecial cases Condition Explanation

Stable equilibrium (4.8) Comparable to stable equilibrium point of pendulumLibration to rotation f(q2) ≥ 0 ∧ qMin

2 ∈ Z If f(q2) ↑ Transfer from libration to rotation- Homoclinic orbit f(q2) ≥ 0∧ Small perturbation will lead to homoclinic orbit,

Z ∩ 〈−π, π] = qi2 comparable to unstable equilibrium point of pendulum

- Heteroclinic orbit f(q2) ≥ 0 ∧ qi2 ∈ Z∧ Small perturbation will lead

n (Z ∩ 〈−π, π]) = 2 to heteroclinic orbitAmplitude doubling n (Z ∩ 〈−π, π]) = 3 If f(q2) ↑ The amplitude of the oscillation will double

n(A) is number of elements in A

16

Page 17: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Chapter 5

Construction of the solution

In the last chapter all different motions have been separated and explained. In this chapter thefocus will be to really construct the solution. In general one can easily solve this system withnumerical ODE-solvers. However for control purposes the system needs to be defined for manyinitial conditions in a certain interval. This is because it is needed in the canonical transformation.That has to be applied to build the feedback controller. It is virtually impossible to generate allthese solutions with ODE-solvers and also have a high accuracy. The construction of the solutionis done, similar to the separation of the motion that is used in the last chapter. First the solution ofq2(t; p1, p4,H) for the three basic motions are constructed. It is shown how to construct q2 whenit is constant or is as good as constant. Then it is shown how to construct the solution for q2 if it isoscillating. After this it is shown how to construct the solution in the case that q2 is rotating. Thenthe solutions for the special cases are represented. This means that q2(t; p1, p4,H) is shown in thecases of an amplitude doubling, a homoclinic orbit and a heteroclinic orbit.

5.1 Constant q2

The solution for a constant q2 is easily found. If the initial conditions correspond to those in table4.1 than q2 is in equilibrium and constant. Then q2(t; p1, p2,H) = qi

2 is taken as the solution.In a numerical sense if there is a very small oscillation it can also be approximated by a constant

q2. However when one of the parameters slightly is increased it begins to oscillate with a very smallamplitude. This is shown in the next figure.

0 2 4 6 8 100.7854

0.7854

0.7854

0.7854

0.7854

0.7854

0.7854

0.7854

Time t [s]

Ang

le q

2 [rad

]

(a)

q2 = f(t)

q2Ode45

ZLBI and ZUBI

−3 −2 −1 0 1 2 3

−0.05

−0.045

−0.04

−0.035

−0.03

−0.025

−0.02

−0.015

−0.01

−0.005

0

Angle q2 [rad]

f(q 2)

(b)

Numerator f(q2)

ZLBI

ZUBI

q2i

Figure 5.1: Representation of a nearly constant q2 with 2H − p21

Jd= 6.6 · 10−4

In figure 5.1a the solution for q2 as function of time for a certain set of initial conditions is repre-sented. The dash-dotted line represents the approximated solution, the dashed line the calculatedamplitudes. The solid-line is the solution found when solving the state space model numerically.

17

Page 18: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

5.2. Libration of q2

Also in figure 5.1b f(q2) is represented. Important to notice is that ZLBI the lower bound of inte-gration and ZUBI , the upper bound of integration are both very close to qi

2. In the first case q2 isnearly constant because the amplitude is very small. This is because (5.1) (Section 4.6).

0 ≈ 2H − p12

Jd(5.1)

Looking at the amplitudes it becomes clear that they are almost the same. Although solvingthe state space model looks the best, it is time consuming and in longer time frames it resultsin larger errors. The method described in this section gives immediately a good approximationwithout solving any differential equation or integral.

5.2 Libration of q2

This is by far the most difficult case to solve. We first solve the integral on the right hand side of(3.20) by numerical integration. The function that needs to be integrated will be abbreviated withg(q2, p1, p4,H) for simplicity.

g(q2, p1, p4,H) =

√Jd (Ic + Id)

(J2 − J1 − (Jd − J1) sin2 (q2)

)(2JdH − p2

1)(J2 − J1 − (Jd − J1) sin2 (q2)

)− Jd (p4 − p1 sin (q2))

2 dq2

(5.2)(3.20) and (3.19) can be written in a shorter form.

t =∫ q2

qi2

g(q2; p1, p4,H) =∫ q2

qi2

√Jd (Ic + Id)

(J2 − J1 − (Jd − J1) sin2 (q2)

)f(q2)

dq2 (5.3)

The integration is done over the domain that is bounded by the two zeros of f(q2) (ZLBI

and ZUBI ) that encloses qi2. The bounds within the programming will be determined from (5.4)

instead of (4.3).

q2 = arcsin−b±

√b2 − 4ac

2awith a ≤ 0 (5.4)

There are maximally two zeros of f(q2) calculated with (5.4). This is because the arcsin is onlydefined between q2 = ±π

2 . So if necessary the other two zeros of f(q2) will be constructed withthe help of symmetry around q2 = ±π

2 . So that in the end g(q2; p1, p4,H)) is integrated over thecorrect interval. The zeros of f(q2), ZLBI and ZUBI enclose the interval wherein qi

2 is situated.Also the sign of ωi

2 has now to be taken care of, because in the form of (5.3) only the positive roothas been considered.

−0.4 −0.2 0 0.2 0.4 0.6 0.8

−0.6

−0.5

−0.4

−0.3

−0.2

−0.1

0

0.1

0.2

Tim

e t [

s]

Angle q2 [rad]

t = t(q2;p

1,p

4,H)

ZLBI and ZUBI

−3 −2 −1 0 1 2 3

−0.07

−0.06

−0.05

−0.04

−0.03

−0.02

−0.01

0

0.01

0.02

Angle q2 [rad]

f(q 2)

Numerator f(q2)

ZLBI

ZUBI

q2i

Figure 5.2: Result of numerically integrating the function between ZLBI and ZUBI

18

Page 19: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

5.3. Total rotation of q2

In figure 5.2a this integration is visually represented for a certain set of initial conditions (Ap-pendix C). The dashed lines are the calculated bounds (ZLBI and ZUBI ) and the solid line repre-sents the numerically integrated function t = t(q2; p1, p4,H) within this interval. It can be seenthat, this line only represents the inverse of q2 and only for a half period. Within the half periodthat is calculated all information is already contained. On the time axis the half period T

2 can bedirectly determined. This can also be expressed as follows:

T

2=∫ ZUBI

qi2

g(q2, p1, p4,H)dq2 −∫ ZLBI

qi2

g(q2, p1, p4,H)dq2 =∫ ZUBI

ZLBI

g(q2, p1, p4,H)dq2 (5.5)

Only a half period is found because in the form of (5.3) only the positive root has been consid-ered. This has as consequence that only half the period has been calculated. If now the negativeroot of (5.3) is considered then:

−∫ ZUBI

ZLBI

g(q2; p1, p4,H)dq2 =∫ ZLBI

ZUBI

g(q2; p1, p4,H)dq2 (5.6)

This is indeed the missing part of the oscillation. However it is not necessary to also calculate thispart because it can be constructed from (5.3).

This knowledge can now be used to correctly extend t = t(q2; p1, p4,H). This is done bymirroring around the horizontal line passing through ZLBI or ZUBI where q2 has reached itsminimal value, respectively maximum value. Then copy this inverse function to form one periodT . Now the function can be totally reconstructed by copying and shifting this one period T . Thiscan be seen in figure 5.3.

−0.4 −0.2 0 0.2 0.4 0.6 0.8−2.5

−2

−1.5

−1

−0.5

0

0.5

1

Tim

e t [

s]

Angle q2 [rad]

t = t(q2;p

1,p

4,H)

MirroringExtending

ZLBI and ZUBI

Mirror axis

Figure 5.3: Mirroring and extension of the function q2

In this case the half period T has beenmirrored upward to form the entire period T . This wholeperiod can be copied and shifted downward and upward to form the entire t = t(q2; p1, p4,H) (hereonly one downward shift is represented). Now only the time t and q2 need to be switched to findq2 = q2(t;H, p1, p4). The solution is shown in figure 5.4.

The solution constructed is represented by dots. These dots match the solid line that is foundby numerically solving the state space model with ODE45.

5.3 Total rotation of q2

One can find q2(t; p1, p4,H) by just numerically integrating q2 from 〈−∞,+∞〉. This is possiblebecause there are no zeros of f(q2) that bound the integration. After integration again the form

19

Page 20: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

5.4. Special cases of q2

0 2 4 6 8 10−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

Time t [s]A

ngle

q2 [r

ad]

q

2 = q

2(t;p

1,p

4,H)

q2Ode45

ZLBI and ZUBI

Figure 5.4: Periodic movement of q2

t = t(q2; p1, p4,H) is found. The points also need to be switched again, so that q2 = q2(t; p1, p4,H)is found.

However on account of reducing the number of calculations q2 is only numerically integratedover the domain 〈−π,+π]. Then it is extended over time. This is possible because after onerotation the motion repeats itself. So by just copying the data over this interval and shifting thesolution 2π upwards or downwards this interval accordingly, the total solution can be found. Theresult for a certain set of initial conditions is shown in figure 5.5.

0 2 4 6 8 10−18

−16

−14

−12

−10

−8

−6

−4

−2

0

2

Time t [s]

Ang

le q

2 [rad

]

(a)

−3 −2 −1 0 1 2 3

2

4

6

8

10

12

14

16

18

x 10−3

Angle q2 [rad]

f(q 2)

(b)

f(q2)

q2i

q2 = q

2(t;p

1,p

4,H)

q2Ode45

Figure 5.5: Total rotation of q2

In figure 5.5 a constant rotation of q2 is found. The solid line shows the solution found bysolving the state space model numerically and the dots represent the solution found by calculatingit by numerical integration as described in this section. Clearly can be seen that they exactly match.

5.4 Special cases of q2

There are three different special cases the amplitude doubling, the homoclinic orbit and the het-eroclinic orbit (they were described in Sections 4.4 and 4.5) For these cases the solution does nothave to be constructed differently. The libration and rotation construction as described will suf-fice. However these special cases need to be tested. Also can be shown that these cases have beenanalyzed correctly in Chapter 4. Therefore also the solutions have been calculated with the ODE-solver to show that they are indeed correct. In figure 4.1 the amplitude doubling is represented.This happens when there are three zeros and f(q2) is moving upwards a little so that the "middleone" disappears. This can be seen in figure 5.6:

20

Page 21: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

5.4. Special cases of q2

0 2 4 6 8 10−1

−0.5

0

0.5

1

1.5

2

2.5

3

3.5

4

Time t [s]

Ang

le q

2 [rad

]

q2(t) with ω

2i = 2.9355

q2(t) with ω

2i = 2.9358

q2Ode45

ZLBI and ZUBI

Z (middle)

Figure 5.6: Amplitude doubling

The same initial conditions are used in the case of f3 in figure 4.1 (see Appendix C). f3 rep-resents a f(q2) with three zeros where one zero was also a minimum of f(q2). Only the initialcondition of ωi

2 has been slightly changed as is shown in the legend. This minimal change willresult in a totally different oscillation. The amplitude has doubled (dots in comparison to the stars)and also the period has changed. The zero at q2 = π

2 (cross-line) that bounded q2 has disappearedby just changing ωi

2 slightly so that the minimum in q2 = π2 no longer is a zero. In the following

figure the direct transfer from libration to rotation will be considered. This means that qi2 6∈ Z.

0 5 10 15 20 25 30−8

−6

−4

−2

0

2

4

6

8

10

Time t [s]

Ang

le q

2 [rad

]

q2(t) with ω

2i = 4.85367267

q2(t) with ω

2i = 4.85367269

q2Ode45(RelTol,AbsTol = 10−5)

q2Ode45(RelTol,AbsTol = 10−10)

ZLBI and ZUBI

Figure 5.7: Transition from libration to rotation

The same initial conditions are used in the case of f5 in figure 4.2). f3 represents a f(q2) withtwo zeros where both zeros are also a minima of f(q2). Only ωi

2 is minimally changed . First thebounds are ZLBI = −π

2 and ZUBI = π2 , the system is oscillating (dots). Then the function f(q2)

is lifted up a little by changing ωi2 so that there are no zeros of f(q2). This will lead to rotation

(stars).About the accuracy and calculation time has not really been spoken yet. The accuracy depends

on the number of integration points and integration schemes to calculate the half period in (5.6).

21

Page 22: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

5.5. Result

However because of the copying of this half period the error made in the half period will be copiedwith it, so if the half period is calculated accurate than it will also be accurate over longer timespans. This is not the case if it is solved with ODE-solvers; then it has to be accurate over the entiretime domain leading to errors over long time spans. This can be seen in figure 5.7 at the end ofthe periodic solution. The solid line begins to differ from the dots even if there already is a veryhigh accuracy applied.

It is possible that ODE-solvers calculate a totally incorrect solution. Numerical errors can leadto this incorrect solution. Normally the motion is bounded between q2 = ±π

2 . However becauseof a numerical error the calculated solution can go over the bounds (dashed lines). As a result theperiod is totally wrong and the new bounds are incorrect. This cannot happen with solutions thatare constructed in this report. The bounds of oscillation are calculated analytically.

Finally look at the solution of nearly homoclinic and heteroclinic orbits that already have beenexplained.

0 5 10 15 20 25 30 35 40−8

−7

−6

−5

−4

−3

−2

−1

Time t [s]

Ang

le q

2 [rad

]

(a)

q2(t) with q

2i = −π/2−10−5

q2(t) with q

2i = −π/2−10−5

q2Ode45

ZLBI and ZUBI

−3 −2 −1 0 1 2 3

−2

0

2

4

6

8

10x 10

−3

q2

f(q 2)

(b)

Almost Homoclinic orbitAlmost Heteroclinic orbit with f(π/2) = 2.6142e−012Z

Figure 5.8: Nearly homoclinic and heteroclinic orbits

The f(q2) can be seen again in figure 5.8b where the initial conditions are ωi2 = 0 and qi

2 ≈ π2

so it is very close to an equilibrium point (table 4.1). This means that both solutions almost gothrough a homoclinic orbit (dots) and heteroclinic orbit (stars). The period T will become very big(qi

2 → π2 , T → ∞). The near homoclinic orbit (dots) will go from close to the equilibrium point

(qi2) back to the same equilibrium point (q2 = −π

2 −2π) taking a long time. In the beginning of theorbit the angular velocity is small. Then just like in an inverted pendulum the angular velocity willincrease when it falls "down". Then it will slow down again and approach the equilibrium againvery slowly. The same can be observed in figure 5.8a.

The near heteroclinic orbit (stars) will go from q2 = −π2 to q2 = − 3π

2 (q2 = π2 ). However

instead of the oscillation going up again as you would expect, it will move down after some time.This is because of the perturbation of qi

2, as a consequence the bound ZLBI = π2 is not present

anymore (see legend figure 5.8b). It means that it will also go towards q2 = −π2 − 2π. There only

has to be made one last comment about the solution that has been constructed. When integratingover a domain that is almost flat (nearly homoclinic and heteroclinic orbits) the result will showsome overshoot (error) as can be seen in figure 5.8a. However this will have disappeared at the endof T

2 because q2 will be correct there. This is why it has been decided that this is acceptable.

5.5 Result

In this chapter it has been explained how to construct the solution for q2 = q2(t;H, p1, p4). Alsothe solutions for q2 have been shown compared to the solutions found with ODE45, to show thatthe solutions are indeed correct. All this has been combined into an algorithm wherein only thetime and the initial conditions need to be given to find q2 (q2 = q2(t; qi

2, ωi1, ω

i2, ω

i4)). Remem-

ber that the constants of motion are expressed in the initial conditions. Now by substitutingq2 = q2(t; qi

2, ωi1, ω

i2, ω

i4) into (3.22), (3.18) and (3.23) also solutions for ω1, ω2 and ω4 are found

22

Page 23: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

5.5. Result

as function of the time and initial conditions. This will be denoted as:

Φ(t, qi1, q

i2, q

i4, ω

i1, ω

i2, ω

i4) =

q2(t, qi

1, qi2, q

i4, ω

i1, ω

i2, ω

i4)

ω1(t, qi1, q

i2, q

i4, ω

i1, ω

i2, ω

i4)

ω2(t, qi1, q

i2, q

i4, ω

i1, ω

i2, ω

i4)

ω4(t, qi1, q

i2, q

i4, ω

i1, ω

i2, ω

i4)

(5.7)

These solutions Φ can now be used to lift the Hamiltonian system and the new canonicalcoordinates will also be expressed in these new functions. With these new canonical variables anoptimal controller can be synthesized. This will be explained in the next chapter.

23

Page 24: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Chapter 6

Optimal control of the CMG

In this chapter the optimal control problem in general form will be introduced. Then linear controlis also shortly introduced to show what the problems are with the CMG concerning control. Finallywill be shown how to derive the nonlinear feedback law using the solutions that were found in thelast chapter.

6.1 Optimal Control problem

The general optimal control problem is formulated as:

x = f (x) + g (x)u (6.1)

with a cost function:

J =∫ ∞

0

L(x(t), u(t))dt (6.2)

A proper choice needs to be made for the cost function. The cost function needs to be mini-mized and the choice depends on the desired control of the system. One of the most basic choicesthat can be taken is for instance:

J =12

∫ ∞0

(xTRx+ uTQu

)dt (6.3)

In our case x = [x1, x2, x3, x4, x5, x6]T = [q1, q2, q4, ω1, ω2, ω4]T , u = [T1, T2]T and x = f(x)is:

x1 = x4 (6.4)

x2 = x5 (6.5)

x3 = x6 (6.6)

x4 =x5 cos (x2)

(Jd sin (x2)x4 − x6

(J2 − J1

(2− cos2 (x2)

)))+ x6d4 sin (x2)

J2 − J1cos2 (x2)− Jd sin2 (x2)(6.7)

x5 =x6

(Jdx4 cos (x2) + 1

2J1x6 sin (2x2))

Ic + Id(6.8)

x6 =x5

(x6 sin (2x2)

(12Jd − J1

)− Jdx4 cos (x2)

)− x6d4

J2 − J1cos2 (x2)− Jd sin2 (x2)(6.9)

24

Page 25: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

6.2. Linear Optimal Control

and with g(x):

g (x) = g =

0 00 00 0

J2−J1 cos2(x2)Jd(J2−J1cos2(x2)−Jd sin2(x2))

00 1

Ic+Id

− sin(x2)J2−J1cos2(x2)−Jd sin2(x2)

0

(6.10)

Hereby the entire system is defined. Actuator T1 can directly control x1 (q1) and x4 (ω1). T2

can directly control x2 (q2) and x5 (ω2). However there is no actuator on gimbal axis 4, x3 (q4) andx6 (ω4). Therefore x6 can only indirectly be actuated by T1 and T2 because the angular velocities ofgimbal axis 1 (x4) and gimbal axis 4 (x6) are coupled. It is not possible to asymptotically stabilizethe CMG without damping d4 this is because x6 can not be forced to go to zero without it. Addingdamping on gimbal axis 4 (N3) (see figure 3.1) makes it possible to asymptotically stabilize thesystem instead of just stabilizing the system. This is also necessary because with no dampingthe cost function can not be bounded. Although the damping is small, it is present in the CMG.The nonholonomic properties of the system become more clear by analyzing the linear controlproblem.

6.2 Linear Optimal Control

Derivation of linear optimal feedback controllers, often gives a good inside into the system. Thesystem is linearized around an equilibrium point xe

i (x1 = xe1, x2 = xe

2, x3 = xe3, x4 = 0, x5 = 0

and x6 = 0). The linearized system is observable and has the form x = Ax+Bu:

A =

0 0 0 1 0 00 0 0 0 1 00 0 0 0 0 10 0 0 0 0 d4 sin(xe

2)

J2−J1cos2(xe2)−Jd sin2(xe

2)0 0 0 0 0 00 0 0 0 0 − d4

J2−J1cos2(xe2)−Jd sin2(xe

2)

(6.11)

B =

0 00 00 0

J2−J1 cos2(xe2)

Jd(J2−J1cos2(xe2)−Jd sin2(xe

2))0

0 1Ic+Id

− sin(xe2)

J2−J1cos2(xe2)−Jd sin2(xe

2)0

First let’s assume that d4 = 0 and the 6 dimensional system is considered (6.11). Then the

controllability matrix C =[B,AB,A2B, ..., AnB

]will have rank 4. So in this case two states will

not be controllable in linear sense. Now introducing damping into the model the rank of C will be5. This is because it is now possible for x5 (ω2) to reach zero (independently from x4), although itis still impossible to control x3 (q4) in the linear sense. However the system is nonholonomic andas a consequence the system does not depend on the states x1 and x3. Therefore it is possible todelete these states. The states that will remain are x = [x2, x4, x5, x6] then the system is as follows:

25

Page 26: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

6.3. Nonlinear Sub-Optimal Control

A =

0 0 1 00 0 0 d4 sin(xe

2)

J2−J1cos2(xe2)−Jd sin2(xe

2)0 0 0 00 0 0 − d4

J2−J1cos2(xe2)−Jd sin2(xe

2)

(6.12)

B =

0 0

J2−J1 cos2(x22)

Jd(J2−J1cos2(xe2)−Jd sin2(xe

2))0

0 1Ic+Id

− sin(xe2)

J2−J1cos2(xe2)−Jd sin2(xe

2)0

The controllability matrix C for this system will have full rank so the entire system is control-

lable in linear sense. The consequence of deleting these states will be that one no longer forcesthe states x4 and x6 to zero. They now can also remain constant because x1 = x3 = 0. It is notnecessary to discard the state x1. Even with the state x1 the system is fully controllable. Howeversince x1(t) was not yet calculated, this state is also discarded.

The state matrix A contains almost no dynamics except for some damping. The reason for thisis that when linearizing around x4 = x6 = 0 (ω1 = ω2 = 0) a lot of terms in A will vanish. Besidesthe controllability problems as described earlier, this is also a good indication that linear control ofthe CMG is far from ideal. In the linear optimal control problem the Riccati-equation is used tofind the linear optimal state-feedback:

PA+ATP − PRP +Q = 0 (6.13)

The matrices Q and R originate from the cost function and A is the state matrix as definedin (6.12). Now P needs to be calculated so that it is a stabilizing solution of the Riccati equation(6.13), P = PT > 0. If a certain P is the stabilizing solution of (6.13) (A−R(0)P is stable) then itis called Γ. The state-feedback will then be u = −gT (Γx)T .

6.3 Nonlinear Sub-Optimal Control

In the previous chapters we explained Hamiltonian theory and a solution was found for f(x)(without damping d4). This can be used when the original Hamiltonian is lifted this means thatx = f(x) can be represented as a Hamiltonian by doubling the system dimensions. The newHamiltonian H0 = pT f(x) is called the lifted Hamiltonian. The corresponding Hamiltonianequations of H0 have then following form:

x = ∂H0∂p = f(x)

p = −∂H0∂x = −∂f

∂x (x)Tp

(6.14)

We already found that H was integrable which means H0 is also integrable. In nonlinearoptimal control the Hamilton-Jacobi equation (H-J) is used to find the nonlinear optimal state-feedback. If this equation is linearized around the origin one would find the Riccati equation.

HH−J (x, p) = pT f (x)− 12pTR (x) p+ q(x) = 0 (6.15)

Now the terms R (x) and q (x) are originating from the cost function and are the nonlinearcounterparts of the matrices Q and R. Where q(x) is used to determine the cost on the states andR(x) to determine the cost on the inputs. Now because H0 = pT f(x), HH−J can be rewritten to:

H1 = HH−J −H0 = −12pTR (x) p+ q(x) (6.16)

The part that remains from (6.15) whenH0 is subtracted is the perturbed partH1. H1 containsall parts of (6.15) that cannot be integrated, so in this case terms related to the control inputs (costfunction) and the damping. This is represented in (6.16).

26

Page 27: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

6.3. Nonlinear Sub-Optimal Control

Now our original system with the canonical coordinates (x, p) can be transformed to a new setof canonical variables (X,P ). This is done with the solutions found in the previous chapter, (5.7)denoted as Φ (t;x0) with x0 the initial conditions. Φ(t, x0) has the following form:

Φ(t, x0) =

x2 (t, x0)x4 (t, x0)x5 (t, x0)x6 (t, x0)

(6.17)

The solutions found in the last chapter can now be used to transform (6.15) where the trans-formation has following form (the transformation originates from (6.14)):

x(t,X) = Φ (t,X) , p(t,X, P ) =∂Φ∂x

(−t, x)P, (6.18)

whereX is the same as the vector x0. Also the derivatives to the initial conditions ofΦ (t,X) arerequired. They have also been determined but are not represented in this report. When H0(x, p)is transformed to H0(X,P ) it has the following property:

X =∂H0

∂P= 0, P = −∂H0

∂X= 0 (6.19)

If now the entire H-J equation is transformed to these new canonical variables (X,P ), the onlyparts that remain are the perturbed Hamiltonian equations of H1 because of (6.19).

Now the nonlinear optimal state-feedback can be found by solving the Hamiltonian equationsH1(X,P ). However, it is still very difficult to solveH1. That is why the solution of the Hamiltonianequations are approximated by linearization:

X =∂H1

∂P, P = −∂H1

∂X(6.20)

The solution of (6.20) that is convergent to the origin is substituted in (6.18) and the functionalrelation of x and p in (6.18) is obtained, which is an approximation of the stabilizing solution. Thiscan be found in [6] and is called the perturbation theory. The nonlinear feedback law has a similarform as the linear feedback law (u = −gT (Γx)T ):

u = −g (x)Tp(x)T (6.21)

One way of obtaining the functional relation between x and p is elimination of initial condi-tions for (6.20), resulting in a family, with parameter t, of approximations of the derivative of thestabilizing solution. p (x; t) from (6.15) is calculated with:

p (x; t) =∂Φ∂x

(−t, x)TeAT tΓeAtΦ (−t, x) , (6.22)

Now only the optimal time t needs to be chosen such that p (x) can be determined. To deter-mine t, a reasonable choice is such that

∫|H (x, p (x; t)) |dx is minimized. The state matrix A is

the same matrix that is stated in (6.12) and Γ is the linear state-feedback, which can be calculatedwith (6.13).

It is now possible to calculate the suboptimal nonlinear feedback, which is given by:

u = −g (x)Tp (x; t)T = −g (x)T (

∂Φ∂x

(−t, x)TeAT tΓeAtΦ (−t, x))T (6.23)

Important to notice is that if the feedback is linearized again one finds back the linear optimalstate-feedback (p (x) = Γx), which can also be calculated with the Riccati equation. For this reasonthe feedback calculated with the perturbation theory will always have a performance equal or betterthen the linear optimal state-feedback.

27

Page 28: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Chapter 7

Conclusions and Recommendations

In this report an explicit solution of the corresponding set of ODEs describing the CMG was con-structed for the uncontrolled three degree of freedom Control Moment Gyroscope. A number ofsteps have been taken to get to this solution. First the Lagrangian has been derived for the CMGsystem. Next the Lagrangian has been converted to the Hamiltonian representation. The Hamil-tonian has been further simplified. This could be done because enough first integrals were found,making the Hamiltonian integrable. The entire system has then been reduced to one differentialequation describing the relevant dynamics of the uncontrolled system. The equation only dependson the initial conditions, the angular position and the velocity of the second gimbal axis. This"system" equation is a powerful tool to analyze the system.

This differential equation is usually solved by separation of variables. Unfortunately the inte-gral that was found as a result of this operation was not solvable. If it had been solvable than thecontroller could have been synthesized after making proper choices for the cost functions. How-ever because no analytic expression existed it had to be constructed from this integral. This is amajor setback whereby it becomes a time consuming proces to calculate the explicite solutions.

From the "system" equation the equilibrium points have been derived. With the same equationare also the boundaries of the angular position of the second gimbal axis determined. Immediatelyidentifying the two basic motions oscillation and rotation from this equation. Also the change ofdynamics have been identified. For instance when the amplitude will double. The homoclinicand heteroclinic orbits have also been identified. It was even possible to derive equations onlydepending on the constants of motion to immediately identify homoclinic orbit, heteroclinic or-bit and amplitude doubling. This has all been expressed in analytic expressions without solvingdifferential equations.

After this three different construction schemes belonging to the different dynamics have beendeveloped and combined in one program. Because during the construction, symmetry and period-icity of the solution have been considered, only a small section (a half period) of the solution needsto be calculated by numerical integration. This means that if this small section is accurate thewhole solution will be accurate. The rest of the solution is constructed by copying and mirroringthis small section. Therefore the construction of the solution for longer time intervals will be veryfast. When solving with ODE-solvers numerical errors can lead to wrong motion regimes. Alsoover longer time intervals the error will be bigger. This will not happen in the program becausethe different types of motions have been separated by analytical functions.

This all has been combined into a program whereby just filling in time and initial conditionsthe belonging solution for the angle of gimbal axis two is found. The angular velocities have beenreduced to a form only depending on the initial conditions and the angle of the second gimbal axisthe solution of the entire system has been found.

This solution can then be used to synthesize the sub-optimal state-feedback. To calculate thisstate-feedback the Hamilton-Jacobi equation is used. Because the system can now be expressed inthe new canonical variables only the perturbation remains, containing damping, control inputs andthe functions found in this report. Also because of the form of the Hamilton-Jacobi the derivativesto the initial conditions of q2 are needed. They also have been programmed but are not representedin this report. What still is missing in the Hamilton-Jacobi equation is a proper choice for the cost

28

Page 29: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

function. Now with the H-J an optimal time t can be calculated. Whereafter the state-feedback canbe calculated for this t. This construction scheme is more explicitly described in [6].

Another important remark that has to be made is that the four degrees of freedom (gimbalaxis three unlocked) is also integrable. This is because the existing first integrals will remain firstintegrals (Hamiltonian will be conserved and the conjugate momenta of gimbal axis one and fourremain cyclic) in the four DOF system. Then only onemore first integral will be needed namely thetotal angular momentum which also is a conserved quantity. This means that a similar approachcan be used to solve the four DOF system.

29

Page 30: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Bibliography

[1] M. Abramowitz and I. A. Stegun. Handbook of mathematical functions: With formulas,graphs,and mathemathical tables. New York: Dover, 1965.

[2] V. I. Arnold. Mathematical methods of classical mechanics. Springer Verlag, 2nd edition, 1989.

[3] H. Goldstein. Classical mechanics. Addison-Wesley, 3rd edition, 2001.

[4] T. R. Parks. Manual for model 750 control moment gyroscope. Educational Control ProductsBell Canyon, CA, 1999.

[5] Mahmut Reyhanoglu and Jasper van de Loo. State feedback tracking of a nonholonomic controlmoment gyroscope. Proceedings of the 45th IEEE Conference on Decision & Control, San Diego,CA, USA, 2006.

[6] Noboru Sakamoto and Arjan J. van der Schaft. Analytical approximation methods for thestabilizing solution of the hamilton-jacobi equation. "to be published in IEEE Trans. AutomaticControl", 2008.

30

Page 31: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

List of symbols

Symbols from Chapter 1 "Theory of the Hamiltonian and Integrable systems"

L Lagrangian [J]H Hamiltonian [J]qi ith independent coordinate [rad]qi ith independent velocity [rad/s]pi ith conjugate momenta [kgm2rad/s]f First integralu Function depending on q and pv Function depending on q and p

Symbols from Chapter 2 "Control Moment Gyroscope"

ai Unity vectors of body Abi Unity vectors of body Bci Unity vectors of body Cdi Unity vectors of body DNi Unity vectors of the reference frameIx Scalar moments of inertia of body x in direction 1 [kgm2]Jx Scalar moments of inertia of body x in direction 2 [kgm2]Kx Scalar moments of inertia of body x in direction 3 [kgm2]ωi = Angular velocity of the ith body [rad/s]d4 Damping on body D [Nsm]J1 Combined scalar moment of inertia [kgm2]J2 Combined scalar moment of inertia [kgm2]t Time [s]g The function to be integrated (inverse of ω2)

Symbols from Chapter 3 "Dynamics of the CMG-system"

qi2 Initial condition of the angle q2ωi

1 Initial condition of the angular velocity ω1 [rad/s]ωi

2 Initial condition of the angular velocity ω2 [rad/s]ωi

4 Initial condition of the angular velocity ω4 [rad/s]f(q2) The numerator beneath the square root of ω2

Z All zeros of f(q2) respectively ω2 [rad]a,b,c Constants of f(q2)qMin2 Coordinate of the minimums of f(q2) [rad]qMax2 Coordinate of the maximums of f(q2) [rad]

Symbols from Chapter 4 "Construction of the solution"

ZLBI The minimum value that q2 can reach [rad]ZUBI The maximum value that q2 can reach [rad]T Period [s]

31

Page 32: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Appendix A

Analytic solution for special cases

A.1 Solution for the case p1 = 0

For a number of simplifications of the original integral (equation 3.20) there can be a solutionfound in known analytic functions. To show that it is still difficult to work with such a solution oneexample is given. The solution will be worked out in the case that p1 = 0. Therefore first (3.20) issimplified to (A.1).

t =∫ q2

qi2

√(Ic + Id)

(J2 − J1 − (Jd − J1) sin2 q2

)2H(J2 − J1 − (Jd − J1) sin2 q2

)− p2

4

dq2 (A.1)

To be able to solve this integral a substitution is done. The substitution is u = sin (q2). Thenthe integral has following form:

t = C

∫ q2

qi2

√A− u2

(1− u2) (A− u2 −Bp42)dq2 (A.2)

with A =J2 − J1

Jd − J1, B =

12H(Jd − J1)

and C =

√Ic + Id

2H

Before it can be solved it needs to fit in a form that is suggested in [1]. Therefore anothersubstitution of z = A− u2. The integral will then reduces to following form:

t = −C2

√z

(z −Bp42) (z +A− 1) (z −A)

(A.3)

This form can now be integrated and has following solution:

t = ψ (z)φ (z) (F (φ (z) , E)−Π (φ (z) , D,E)|z=A−sin2(q2)

z=A−sin2(qi2)

(A.4)

with

ψ (z) =

((z +A)2 + 2 (z +A) + 1

)CBp4

2

(A− 1 +Bp42) z

√(A− 1)2 z

A (z +A− 1)3Bp42

(A.5)

and φ (z) =

√(A− 1 +Bp4

2) zBp4

2 (z +A− 1)(A.6)

with the constants

D =Bp4

2

A− 1 +Bp42and E =

√(2A− 1)Bp4

2

A (A− 1 +Bp42)

(A.7)

In (A.4) is F the incomplete integral of the first kind and Π the incomplete elliptic integral ofthe third kind. It is clear although an analytic expression exist for the solution of (A.1) it is stilldifficult to work with.

32

Page 33: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

A.2. Solution for the case p1 = 0 and p4 = 0

A.2 Solution for the case p1 = 0 and p4 = 0

If the two conjugate momenta p1 and p4 are zero the hamiltonian (3.15) then reduces to followingform and is easily solved.

2H = (Ic + Id)ω22 → q2 = ωi

2t+ qi2 (A.8)

To show that this motion has no equilibrium points equation 4.2 is simplified

(2JdH)(J2 − J1 − (Jd − J1) sin2 q2

)6= 0 with ωi

2 6= 0 (A.9)

33

Page 34: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Appendix B

Analysis of f (q2)

B.1 Denominator > 0

In Chapter 4 there was already stated why it is important that the denominator of (3.18) is alwayspositive. The denominator of this function is:

0 = J2 − J1 − (Jd − J1) sin2 (q2) (B.1)

(B.2)

Now by simply using some algebraic relations following relation can be derived:

sin2 (q2) =J2 − J1

Jd − J1(B.3)

(B.4)

Already known is that J1 < Jd < J2 so that as a consequence:

sin2 (q2) > 1 (B.5)

This means that the denominator does not have zeros and is always positive. As consequenceit is only necessary that f(q2) is analyzed.

B.2 Extrema of f(q2)

In Section 4.2 was already explained how to find the maxima and minima of the numerator of(3.18), f(q2). This is worked out below in (B.6).

0 =d

dq2

(a sin2 (q2) + b sin (q2) + c

)0 = −

((2 Jd (Jd − J1)H + J1p1

2)sin (q2)− Jdp1p4

)cos (q2) (B.6)

The maxima and minima are given by following two relations:

cos (q2) = 0 and sin (q2) =Jdp1p4

2 Jd (Jd − J1)H + J1p12

= − b

2a(B.7)

Important to notice is that if:|2a| < |b| (B.8)

Then there is only one minimum (qMin2 ) and one maximum (qMax

2 ). This also means thatthere are maximal two zeros in the domain 〈−π, π].

34

Page 35: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

B.3. Maximum qMax2 coincides with a zero if |2a| > |b|

Now separating the case of two extrema and four extrema then can be shown which extremacorrespond to qMin

2 and qMax2 . This can be calculated by taking the second derivative of the nu-

merator.

d2

dq22f(q2) = 2a

(cos2 (q2)− sin2 (q2)

)− b sin (q2) (B.9)

Now filling in the equation found for the second extrema equation sin (q2) = − b2a the following

relation is found:

d2

dq22f

(arcsin

(−b2a

))= 2a− b2

2a= 2a

(1− b2

(2a)2

)(B.10)

This extreem exist if |2a| > |b| this means that also (2a)2 > b2. This is now worked out:

2a

(1− b2

(2a)2

)︸ ︷︷ ︸

>0

⇒ −(2 Jd (Jd − J1)H + J1p1

2)< 0 (B.11)

The result is that this relation always correspond to qMax2 if |2a| > |b|. This should automati-

cally mean that the two extrema corresponding to cos (q2) = 0 in this case are qMin2 . This can now

be proven:d2

dq22f(±π

2

)= −2a∓ b > 0 with |2a| > |b| (B.12)

In the case that |2a| < |b|:d2

dq22f(π

2

)= −2a− b < 0 if b > 0 maximum, if b < 0 minimum (B.13)

d2

dq22f(−π

2

)= −2a+ b > 0 if b > 0 minimum, if b < 0 maximum (B.14)

This corresponds to the case that there is only one qMin2 and one qMax

2 .

B.3 Maximum qMax2 coincides with a zero if |2a| > |b|

First lets find the point where qMax2 coincides with a zero of f(q2).

sin (q2) =Jdp1p4

2 Jd (Jd − J1)H + J1p12

(B.15)

This relation has to be filled into f(q2).

0 = a

(Jdp1p4

2 Jd (Jd − J1)H + J1p12

)2

+ b

(Jdp1p4

2 Jd (Jd − J1)H + J1p12

)+ c

This now is worked out to find a useful relation.

0 =(2 JdH − p1

2)(

2 Jd (Jd − J1)H + J1p12 − (Jd − J1) Jdp4

2

J2 − J1

)(B.16)

If one of two following relations are fulfilled there is a maximum qMax2 that coincides with a

zero if |2a| > |b|.

2H =p1

2

Jd(4.8)

2H =(Jd − J1) Jdp4

2 − J1p12 (J2 − J1)

Jd (Jd − J1) (J2 − J1)(B.17)

However no physical meaning could be found to the abbreviated second equation of (B.17).

35

Page 36: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

B.4. Minimum qMin2 coincides with a zero if |2a| > |b|

B.4 Minimum qMin2 coincides with a zero if |2a| > |b|

In Appendix B.2 was shown that if |2a| > |b| that cos (q2) = 0 corresponds to qMin2 . To find the

points where qMin2 coincides with a zero, sin (q2) = ±1 is filled in f(q2).

0 = a± b+ c (B.18)

This is worked out below.

0 = −2 Jd (Jd − J1)H − J1p12 ± 2 Jdp1p4 +

(2 JdH − p1

2)(J2 − J1)− Jdp4

2 (B.19)

qMin2 coincides with a zero if one of two following relations is fulfilled and |2a| > |b|.

2H =(p1 + p4)

2

J2 − Jd+p1

2

Jdbelonging to qMin

2 = −π2

(4.6)

and

2H =(p1 − p4)

2

J2 − Jd+p1

2

Jdbelonging to qMin

2 =π

2(4.7)

B.5 Extrema qMin2 and qMax

2 coincide with a zero if

|2a| < |b|If b > 0 the maximum coincides with a zero if:

2H =(p1 − p4)

2

J2 − Jd+p1

2

Jd(4.6)

A minimum coincides with a zero if:

2H =(p1 + p4)

2

J2 − Jd+p1

2

Jd(4.6)

If b < 0 the relations are switched.

36

Page 37: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

Appendix C

Numerical values used for the

di�erent parameters and

simulations

Throughout the report simulations have been shown. These were calculated with the followingvalues for the inertia elements. These values are based on the real set-up.

Values for the inertia elements [kgm2]Ib = 0.0190 Ic = 0.0092 Id = 0.0148Jb = 0.0178 Jc = 0.0230 Jd = 0.0273Ka = 0.0670 Kb = 0.0297 Kc = 0.0188

In the simulations the initial conditions needed to calculate the different lines/functions in thefigures are given beneath.

Figure Line qi2 [rad] ωi

1 [rad/s] ωi2 [rad/s] ωi

4 [rad/s]Figure 4.1 f1 −π

4 −2 0.5 0.5f2

π4 −10 1 0.1

f3π4 −10 2.94 1

f4π4 −10 3.5 1

Figure 4.2 f5 0 0 4.85 −7f6 −π

4 1 4.99 −2f7 −π

3 7 1.97 2

Figure 4.3 f8 −π2 −0.5 0 0.1

f9π4 −0.43 0 1

Figure 5.1 π4 5 10−5 0

Figure 5.2 π4 −10 1 1

Figure 5.5 π4 −2 −1.5 2

Figure 5.6 π4 −10 ≈ 2.94 1

Figure 5.7 0 0 ≈ 4.85 −7

Figure 5.8 Full ≈ −π2 2 0 1

Striped ≈ −π2 −2 0 −2

37

Page 38: ExplicitsolutionoftheODEs describingthe3DOFControlMoment ... · Control Moment Gyroscope In the last chapter the theory about integrable systems has been introduced. In this chapter

38