Explicit solution of the ODEs describing the 3 DOF Control Moment

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 Contents

Contents 3

1 Introduction 4

2 Theory of Hamiltonian and Integrable systems 5 2.1 Lagrangian and Hamiltonian ...... 5 2.2 Liouville integrability ...... 6 2.3 Cyclic coordinates and conserved quantities ...... 6 2.4 Poisson bracket ...... 6

3 Control Moment Gyroscope 7 3.1 Description of the Control Moment Gyroscope ...... 7 3.2 Lagrangian ...... 8 3.3 Hamiltonian and conjugate momenta ...... 9 3.4 CMG’s first integrals ...... 9 3.5 Solution in Integral form ...... 9

4 Dynamics of the CMG-system 11 4.1 Equilibrium points of the unperturbed system ...... 11 4.2 Libration ...... 12 4.3 Rotation ...... 14 4.4 Transition from libration to rotation ...... 14 4.5 Change of motion ...... 15 4.6 Special case of the equilibrium point ...... 15 4.7 Summary of the different kind of motions ...... 16

5 Construction of the solution 17 5.1 Constant q2 ...... 17 5.2 Libration of q2 ...... 18 5.3 Total rotation of q2 ...... 19 5.4 Special cases of q2 ...... 20 5.5 Result ...... 22

6 Optimal control of the CMG 24 6.1 Optimal Control problem ...... 24 6.2 Linear Optimal Control ...... 25 6.3 Nonlinear Sub-Optimal Control ...... 26

7 Conclusions and Recommendations 28

Bibliography 30

List of symbols 31

2 Contents

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

B Analysis of f(q2) 34 B.1 Denominator > 0 ...... 34 B.2 Extrema of f(q2) ...... 34 Max 35 B.3 Maximum q2 coincides with a zero if |2a| > |b| ...... Min 36 B.4 Minimum q2 coincides with a zero if |2a| > |b| ...... Min Max 36 B.5 Extrema q2 and q2 coincide with a zero if |2a| < |b| ......

C Numerical values used for the different parameters and simulations 37

3 Chapter 1

Introduction

In the control of many dynamical systems optimal control plays a important role. Many techniques have already been developed to solve these kind of problems. Next to this many extensions have been developed for instance LQR/LQG and H∞-control. Compared to linear optimal control, non- linear optimal control is still rarely applied. This is because most of the existing techniques are only successful when using some simple nonlinearities, even then it is still difficult and often time consuming to apply. However for highly nonlinear systems, optimal linear controllers do not work properly 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 of the Hamilton-Jacobi equation . The proposed method is based on the Hamiltonian perturbation theory. The idea behind this theory 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 Hamilton equations 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 to show that the theory also works for more complicated problems a more difficult nonlinear setup has been chosen to design a nonlinear optimal controller by using this theory. The eventual goal is not only to show it to work in simulation but also that it is possible to use feedback to stabilize a real setup. This is the Control Moment Gyroscope system (CMG). Its normal function is the of spacecrafts. However in this case the control problem will be different. The CMG is a nonholonomic system. This will often lead to problems regarding to control. However in 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 in Chapter 2. After this it will be shown that the system fulfills the necessary conditions to integrate it. Then the solution will be represented in integral form. This is done in Chapter 3. With the help of 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 compared to the solutions found with ODE-solvers. Finally the perturbation theory can be used to derive a sub-optimal nonlinear feedback controller. How to do this is explained in Chapter 6.

4 Chapter 2

Theory of Hamiltonian and Integrable systems

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

2.1 Lagrangian and Hamiltonian

The starting point in general in studying and working with dynamics is the Lagrangian L.A different 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 order equations. The consequence of this is that the number of equations is doubled with respect to the 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 the Lagrangian to the Hamiltonian. The Lagrangian depends on the independent variables qi and q˙i.

L = L (q1, q2, ..., qn, q˙1, q˙2, ..., q˙n) (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 q˙i. These new coordinates pi together with the qi are called canonical variables. This means that the Hamiltonian has following form: H = H (q1, q2, ..., qn, p1, p2, ..., pn, ) (2.2) The conjugate momenta are defined as:

∂L(qi, q˙i) pi (q, q˙) = (2.3) ∂q˙j The Lagrangian L (q, q˙) can now be transformed to the Hamiltonian H (q, p). Using some algebraic operations on the conjugate momenta q˙i can be expressed as function of q and p,(q˙ (q, p)). The systematic transformation from the Lagrangian to the Hamiltonian representation is done with the help of the Legendre transformation: X H (q, p) = q˙i (q, p) pi − L (q, q˙ (q, p)) (2.4) i With this knowledge of H (q, p) also Hamiltonian equations of motions can be derived (2.5).

5 2.2. Liouville integrability

∂H ∂H q˙i = , p˙i = − , i = (1, ..., n) (2.5) ∂pi ∂qi 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 this section the notion of integrability is introduced. Within the literature [2], [3] there are many forms of 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 of motion are in involution [2]. Another definition in [2] is: Two functions are in involution if their Poisson bracket is zero. The system needs to be integrable to solve it. Therefore the involution of the 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 often used for this is first integral. A constant of motion or first integral can be expressed as follows:

f (q1, q2, .., qn, q˙1, q˙2, .., q˙n) = constant (2.6) To be able to integrate a system all the first integrals (constants of motion) need to be found like the definition says. In reality the number of first integrals that need to be found is n, the degrees of freedom (2.5). In general the Hamiltonian is also a constant of motion because it is the conserved total 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 is defined as a coordinate qj that does not enter the Hamiltonian function (the same holds for the Lagrangian). In other words H or L are not a function of qj, however H can still be a function of q˙j. 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 ∂L ∂L d ∂L d − = = pj = 0 (2.7) dt ∂q˙i ∂qj dt ∂q˙i dt A different constant of motion is the total . If the needed number of first integrals 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 earlier stated. The Poisson bracket is defined as follows:

∂u ∂v ∂u ∂v (2.8) [u, v]q,p = − ∂qi ∂pi ∂pi ∂qi To check if the Hamiltonian system is integrable all combinations of the first integrals with each other and with the Hamiltonian need to vanish. The Poisson bracket of a first integral and the Hamiltonian is always zero, otherwise it would not be a first integral. This is because:

∂H ∂f ∂H ∂f ∂f ∂f df (2.9) [H, f]q,p = − =p ˙i +q ˙i = ∂qi ∂pi ∂pi ∂qi ∂pi ∂qi dt df If f is a first integral of H then dt ≡ 0. This theory will be used to check integrability of the Control Moment Gyroscope.

6 Chapter 3

Control Moment Gyroscope

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

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 gimbals there are four axis fixed. These are ai, bi, ci and di with unity vectors i = 1, 2, 3. At the base of the CMG a reference frame N is defined with orthogonal unit vectors Ni (i = 1, 2, 3). In this system there are four angles that can rotate. These are q1 in d2 direction, q2 in c1 direction, q3 in b2 direction and q4 in n3 direction. The angular velocities ωi are defined in the same directions as qi (i = 1, 2, 3, 4). These are also represented in figure 3.1. All centers of mass are situated at the center of disc D. The body’s D and C can be directly actuated through T1 and T2 (see figure 3.1). Body D can be actuated in d2 direction this corresponds to the rotation angle q1. Body C can be actuated in c1 direction that corresponds to the rotation angle q2.

7 3.2. Lagrangian

All angles qi (i = 1, 2, 3, 4) are observable because these angles are measured by encoders. The th elements Ix, Jx, Kx (x = A, B, C, D) are the scalar moments of inertia about the k (k= 1,2,3) direction respectively in bodies A, B, C, and D. Only the moments of inertia are considered and not 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 and thereby reducing the system to three degrees of freedom. In many articles and papers like [4] and [5], also a description of the Control Moment Gyroscope can be found.

3.2 Lagrangian

In case of the CMG the Lagrangian equals the because the potential energy is zero. For instance the gravity can be neglected in the system. Now the Lagrangian of the system without control can be calculated and is given: 1 L = J ω 2 + (I + I ) ω 2 + J − J cos2 (q ) ω2 + J ω ω sin (q ) (3.1) 2 d 1 c d 2 2 1 2 4 d 1 4 2 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)

1 (I + I )ω ˙ − J ω2 sin (2q ) − J ω ω cos (q ) = T (3.4) c d 2 2 1 4 2 d 1 4 2 2

2  J2 − J1 cos (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 the system 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:

q˙1 = ω1 (3.6)

q˙2 = ω2 (3.7)

q˙4 = ω4 (3.8) ω cos (q ) J sin (q ) ω − ω J − J 2 − cos2 (q ) ω˙ = 2 2 d 2 1 4 2 1 2 (3.9) 1 2 2 J2 − J1cos (q2) − Jd sin (q2) 1  ω4 Jdω1 cos (q2) + 2 J1ω4 sin (2 q2) ω˙ 2 = (3.10) Ic + Id ω ω sin (2 q ) 1 J − J  − J ω cos (q ) ω˙ = 2 4 2 2 d 1 d 1 2 (3.11) 4 2 2 J2 − J1cos (q2) − Jd sin (q2) The state space model has been used to simulate the unperturbed system.

8 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. This transformation 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)

2  p4 = J2 − J1 cos (q2) ω4 + Jdω1 sin (q2) (3.14) Now all the angular velocities are being replaced with the conjugate momenta. In essence L (q2, ω1, ω2, ω4) has been transformed to the Hamiltonian H (q2, p1, p2, p4) The Hamiltonian has now the following form: ! 1 p2 p2 (p − p sin (q ))2 H = 2 + 1 + 4 1 2 (3.15) 2 2 2 (Ic + Id) Jd J2 − J1 cos (q2) − Jd sin (q2)

3.4 CMG's rst integrals

Two first integrals are easily found with the help of cyclic coordinates. The coordinates q1 and q4 are cyclic coordinates because they do not appear in the Hamiltonian. In (2.7) it was already shown that its corresponding conjugate momenta are constant. This means that p1 and p4 are first integrals. The Hamiltonian H is also a first integral because it is a conserved quantity (the total 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) is not a function of q1 and q4 immediately can be concluded that their Poisson brackets are zero. The Poisson bracket of the Hamiltonian function with the Hamiltonian is always zero. The Poisson bracket can also be used to show that p2 is not a constant because it is different from zero:

∂p2 ∂H (q, p) ∂p2 ∂H (q, p) ∂H(q2, p1, p2, p4) (3.16) [p2,H]q,p = − = − 6= 0 ∂q2 ∂p2 ∂p2 ∂q2 ∂q2

The Hamiltonian depends on q2 as a consequence the partial derivative to q2 is different from zero. 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 DOF system are also first integrals of the 4 DOF system. Another conserved quantity that has not been used yet is the total angular momentum. As a consequence the number of first integrals needed is sufficient. However it has to be checked that all their Poisson brackets are zero. This could not be found in the literature.

3.5 Solution in Integral form

In Section 3.4 it was already concluded that p1, p4 and H are constants of motion. This knowledge is used to find an explicit solution of the corresponding set of ODEs describing the uncontrolled 3 DOF 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 and one variable and its derivative. Because p2 is not constant it needs to be replaced. This is done by replacing p2 with (Ic + Id) ω2. This was derived in (3.13). ! 1 p2 (p − p sin (q ))2 H = (I + I ) ω2 + 1 + 4 1 2 (3.17) c d 2 2 2 2 Jd J2 − J1 cos (q2) − Jd sin (q2)

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

9 3.5. Solution in Integral form

s r 1 p2 (p − p sin (q ))2 ω = ± 2H − 1 − 4 1 2 (3.18) 2 2 2 Ic + Id Jd J2 − J1 cos (q2) − Jd sin (q2) By separation of variables (3.18) can be solved. For simplicity the initial conditions will be chosen at t = 0. The integral will also only be evaluated for the positive root of (3.18). This means that in a later stage the sign of ω2 should be taken into account.

Z t Z q2 p dq2 dt = I + I (3.19) c d q 2 2 0 qi p1 (p4−p1 sin(q2)) 2 2H − − 2 2 Jd J2−J1 cos (q2)−Jd sin (q2) After some algebraic operations the integral can be represented in the following form.

s Z q2 J (I + I ) J − J − (J − J ) sin2 (q ) d c d 2 1 d 1 2 (3.20) t = 2 dq2 i 2 2  q2 (2JdH − p1) J2 − J1 − (Jd − J1) sin (q2) − Jd (p4 − p1 sin (q2))

In a mathematical sense this system is solved. After solving the integral and rewriting it to q2 the 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 constants H, p1 and p4. With this information the solution for the entire system can be derived.

p p sin (q (t)) − p sin2 (q (t)) ω (t; H, p , p ) = 1 − 4 2 1 2 (3.22) 1 1 4 2 2 Jd J2 − J1 cos (q2 (t)) − Jd sin (q2 (t)) p − p sin (q (t)) ω (t; H, p , p ) = 4 1 2 (3.23) 4 1 4 2 2 J2 − J1 cos (q2 (t)) − Jd sin (q2 (t)) The integral in (3.20) needs to be solved to be able to solve the entire system. The integral looks like it belongs to the class of elliptic integrals, therefore it was tried to solve (3.20) with 2 the help of elliptic integrals. However because of the cross-term of (p4 − p1 sin (q2)) in (3.19) (−2p1p4 sin (q2)) it was impossible to do this. As a consequence of this it was not possible to find an analytic expression for the solution of this integral. However the solution of this integral is still closely related to the elliptic functions. Therefore the underlying theory of elliptic integrals is used to help solve and test the methods that are used to eventually solve this system. It can also be shown that (3.19) is closely related to elliptic functions. If a simplification is applied for instance p1 = 0 (−2p1p4 sin (q2) will vanish). Then this integral reduces to a form where it is solvable with elliptic 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 to work with as can be seen in Appendix A.1. Therefore this system needs to be solved in a different way. However, before this can be done, it is necessary to determine what the essential changes are within the dynamics.

10 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, but unfortunately this is not possible. That is why another method is needed to find a useful solution for this system. However before this can be done the system’s dynamical properties have to be studied. 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 the special cases like the homoclinic and heteroclinic orbit are described and analyzed. At the end of this 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 space model 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 the system equation (3.18) is still in equilibrium (ω2 = 0). In this case q1 and q4 are not considered as coordinates (cyclic coordinates) and ω1 and ω4 therefore do not need to be zero. The combination of initial conditions that correspond to this definition of equilibrium are given in table 4.1.

Table 4.1: Equilibrium points i i i i i i q1 q2 q4 ω1 ω2 ω4 π R ± 2 R R 0 R R R R R 0 0 J1 i ω sin(q2) 0 R R R Jd 4 R

This corresponds to the zeros of (3.18), so it also could be directly derived from (3.18). However it is more difficult to see it in this equation. This is because the initial conditions are embedded within the conjugate momenta and the total energy H. To derive this directly lets first take a look beneath the square root in (3.18). The numerator under the square root will be defined as f(q2). The denominator (under the square 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:

i i i i  2 (4.2) f q2; q2, ω1, ω2, ω4 = a sin (q2) + b sin (q2) + c with

11 4.2. Libration

2 2 2 a = −(2Jd(Jd − J1)H + J1p1), b = 2Jdp1p4, c = (2JdH − p1)(J2 − J1) − Jdp4

The numerator f(q2) is just a second order equation in sin (q2), so it is easy to find the zeros of (3.18): √ −b ± b2 − 4ac sin (q ) = with a ≤ 0 (4.3) 2 2a

Now Z is the set containing all values for q2 that satisfy (4.3). In other words all the zeros of f(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 equilibrium i points of the system because q2 is also hidden within the constants of motion. The system is in i equilibrium as described in (4.1) if: q2 within the constants of motion is also a zero of f (q2). This i means if q2 ∈ 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 considered within the h−π, π] interval because of the symmetric character of the sin-function. This means that the number of zeros within this interval will only be ranging from none to four . The zeros i of f(q2) have important physical meaning even if q2 6∈ Z. This will be shown in the next sections of this chapter. During the analyzing process it was found that the CMG system has resembles to a simple pendulum system. Although the CMG system is more complex it will be easier to understand when the system is compared to a pendulum. In essence the system can be separated in two basic motions, libration and rotation just like the pendulum.

4.2 Libration

The first basic motion corresponds to a simple oscillating behavior. Another name for this motion is libration. Although the CMG system can oscillate in many different ways, it is similar to the simple oscillating pendulum. The main difference is that the oscillation is not around a certain point (where the potential energy is zero in the pendulum) but can change as a function of the constants 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 oscillation have 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 determined by these zeros. This can be seen in the integral that has to be solved. s q2 2  Z Jd (Ic + Id) J2 − J1 − (Jd − J1) sin (q2) t = dq2 (4.5) i f(q2) q2

Herein f(q2) has now become the denominator. If f(q2) becomes zero the equation within the 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). So by switching time t and the angle q2, t = t(q2; p1, p4,H) is inverted to q2 = q2(t; H, p1, p4). The zeros of f(q2) that lead to singularity will now become the boundaries of q2. This means that all zeros of f(q2) (Z) need to be understood as the bounds of integration in (4.5). Only the domain where f(q2) is positive can be integrated. The domain that is enclosed by two zeros of f(q2). The two values that enclose the domain where f(q2) is positive are from the set Z. They are called ZLBI , the lower bound of integration and ZUBI , the upper bound of integration. In other words the upper value and the lower value where in between q2 can oscillate. The difference between this upper and lower bound of integration is the same as the amplitude in the sense of normal periodic functions.

12 4.2. Libration

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

f : f(q ;−π/4,−2,0.5,0.5) 0.05 1 2 f : f(q ;π/4,−10,1,0.1) 2 2 f : f(q ;π/4,−10,2.94,1) 0.04 3 2 f : f(q ;π/4,−10,3.5,1) 4 2 0.03

) 0.02 2 f(q

0.01

0

−0.01

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

Figure 4.1: Graphical representation of the numerator i i i i for the dierent f(q2; q2, ω1, ω2, ω4) motions related to libration (dierent initial conditions)

In figure 4.1 four possible f(q2) are represented. Within this representation some special configurations 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 for four different combinations of initial conditions or constants of motion. f1(q2) and f4(q2) have only two zeros so these represent two basic oscillations. Only the form of the oscillation will differ significantly. 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) p i (then ω2 = f(q2)). Take for instance f1(q2), if the initial condition for q2 is near to the left zero. Then follow f1(q2) to the right side. This means that the angular velocity is increasing till the π point q2 = − 2 after this the angular velocity is decreasing till it is zero (f(q2) = 0). From hereon it cannot 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. This π will 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 be considered. 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 itself again. Another important conclusion that can be drawn from the figure is that there is symmetry π around q2 = ± 2 . This comes from the relation sin (q2) = sin (π − q2). A minimum of f(q2) Min Min π π is defined as q2 . q2 is always equal to q2 = 2 or q2 = − 2 or both in the case there are Min Min Max two q2 . In the case that f(q2) has only one minimum (q2 ) and one maximum (q2 ) then Min π Max π q2 = − 2 and q2 = 2 in the case that b > 0 from (4.2). It automatically follows that if b < 0 Min π Max π then q2 = 2 and q2 = − 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 out and explained in Appendix B.2. This seems not to be important in this case however later on it will be explained that there is an important physical meaning if one of these points is also a zero of f(q2). f2(q2) in figure 4.1 has four zeros in the domain h−π, π], this means there are two positive domains (where ω2 is defined). The domain where the oscillation takes place, depends on the

13 4.3. Rotation

i i initial condition q2. The zeros that bound the domain wherein q2 is situated are the lower and upper bound of the oscillation. In the case of four zeros in the domain h−π, π] the amplitude of π the oscillation cannot become bigger than π because it is limited between q2 = ± 2 . By changing the initial conditions in a way that f2(q2) moves upwards f3(q2) is found. In this case there are π Min three zeros in the interval h−π, π]. To the right and left of the zero located at q2 = 2 (q2 ), the i i domain is positive. The choice of the domain depends on the side where q2 is situated. If q2 is the point between the two positive domains, this corresponds to the equilibrium point as stated in table 4.1. In this point a change occurs where two smaller (oscillation) domains melt together to form one big (oscillation) domain. f1(q2) and f4(q2) only have two zeros so there is only one positive 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 be compared to a pendulum wherein the kinetic energy is higher than the maximum potential energy that can be stored. As a consequence the pendulum keeps rotating. Simply said if you give it enough rotation momentum it will keep on spinning around. This motion corresponds to a case where there are no zeros (Z is empty) and as a consequence the domain where f (q2) > 0 has become R. There is also a very basic case wherein this motion becomes more clear and can be found 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 no zeros. This also follows from the last two sections. This happens when all zeros are at the same Min time a minimum of f(q2) (q2 ). This case is illustrated in figure 4.2.

f : f(q ;0,0,4.85,−7) 5 2 0.07 f : f(q ;−π/4,1,4.99,−2) 6 2 f : f(q ;− π/3,7,1.97,2) 7 2 0.06

0.05 )

2 0.04 f(q

0.03

0.02

0.01

0

−3 −2 −1 0 1 2 3 q 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 place between these bounds. However now there is no domain where f(q2) is negative. If the energy is slightly increased so that f(q2) moves upwards there will be now zeros left anymore. This means no boundaries so total rotation. This change from libration to rotation can also be sudden, for i instance if ω2 is slightly increased. Then the whole curve will move upwards and there are no zeros anymore, rotation. Min Now look at f6(q2) and f7(q2). They have only one q2 and one zero in the interval h−π, π] and the motion is only bounded by one point within this interval. This means that the amplitude of the motion is 2π.

14 4.5. Change of motion

i A special case will occur if also q2 ∈ Z. As already explained this is an equilibrium point (Section 4.1). This equilibrium point can be compared to the unstable equilibrium point of an inverted pendulum. In theory if an inverted pendulum is in equilibrium and there is a slight perturbation the pendulum will fall down and come back to the equilibrium position taking infinite time. 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. i In the case of all zeros are also minimums of f(q2) (f5(q2)) and q2 ∈ Z. Then if there is a slight perturbation around this equilibrium point the angle q2 will move until it falls back into the other equilibrium point. This is called a heteroclinic orbit. The homoclinic and heteroclinic orbits are both theoretical terms in our case. This is because to fall out of equilibrium a small perturbation is needed. A small perturbation means a change in energy. As a consequence f(q2) will also change and f(q2) will have different properties. However orbits that start close to these conditions will have some similar properties. A similar property is for instance that the orbits will have long periods. These homoclinic and heteroclinic orbits are therefore important conditions.

4.5 Change of motion

Now all cases where a sudden change can take place have been described. The cases as described in Min Section 4.4 and the case of f3(q2) in figure 4.1. These cases have all in common that q2 coincides with a zero. Although these cases can be identified with the described relations in the preceding sections. It is still quite time consuming and not straightforward to find out when a transition will occur. A nicer expression can be derived where these cases are expressed in the conjugate π momenta equal to twice the total energy. Two relations can be derived one for the q2 = − 2 π Min π position and one for the q2 = 2 position. This is because q2 is always situated in q2 = ± 2 .

2 2 (p1 + p4) p1 Min π (4.6) 2 H = + belonging to q2 = − J2 − Jd Jd 2 2 2 (p1 − p4) p1 Min π (4.7) 2 H = + belonging to q2 = J2 − Jd Jd 2

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 motion is on the brink of change. There is only one remark about this. That is in the case there are only Min Max one q2 and one q2 (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

Min In the previous sections already an extensive analysis has been made of what happens if q2 ∈ Z. Max Now a logical proceeding is what happens if q2 ∈ Z. The answer is nothing, q2 is constant in i i this case . This is because ω2 is only defined in q2 (and sometimes defined in π − q2 because of symmetry). It is much easier understood by just showing it. There are two possibilities one zero or two zeros in the interval h−π, π] 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 always negative except where they are zero. This means only here f(q2) is defined. If f(q2) is slightly changed. 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.

p 2 2 H = 1 (4.8) Jd This can also be proven with the help of (4.3). As explained the zeros are the boundaries of oscillation, so the boundaries are in this case in the same point. There is no oscillation anymore which means:

15 4.7. Summary of the dierent kind of motions

−3 x 10

0

−0.5

−1

−1.5 ) 2 −2 f(q

−2.5

−3

−3.5 f : f(q ;−π/2,−0.5,0,0.1) 8 2 f : f(q ;π/4,−0.43,0,1) 9 2 −4

−3 −2 −1 0 1 2 3 q 2

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

2 −b p 2 p1 sin (q2) = with b − 4ac = 2 H − = 0 (4.9) 2a Jd So exactly the same relation has been found. Also in this case a physical interpretation can be given. This case corresponds to a pendulum (without damping) in stable equilibrium. By giving 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 small amplitude, just like the angle q2 of the CMG.

4.7 Summary of the dierent kind of motions

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

Table 4.2: Summary of the basic motions Basic motions Condition Explanation Equilibrium i is in rest q2 ∈ Z q2 Libration i is oscillating between LBI and UBI ∃Z ∧ q2 6∈ Z q2 Z Z 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 used as conditions to separate the special cases it has here been explained with Z.

Table 4.3: Summary of the special cases Special cases Condition Explanation Stable equilibrium (4.8) Comparable to stable equilibrium point of pendulum Libration to rotation Min If Transfer from libration to rotation f(q2) ≥ 0 ∧ q2 ∈ Z f(q2) ↑ - Homoclinic orbit f(q2) ≥ 0∧ Small perturbation will lead to homoclinic orbit, i comparable to unstable equilibrium point of pendulum Z ∩ h−π, π] = q2 - Heteroclinic orbit i Small perturbation will lead f(q2) ≥ 0 ∧ q2 ∈ Z∧ n (Z ∩ h−π, π]) = 2 to heteroclinic orbit Amplitude doubling n (Z ∩ h−π, π]) = 3 If f(q2) ↑ The amplitude of the oscillation will double n(A) is number of elements in A

16 Chapter 5

Construction of the solution

In the last chapter all different motions have been separated and explained. In this chapter the focus will be to really construct the solution. In general one can easily solve this system with numerical ODE-solvers. However for control purposes the system needs to be defined for many initial 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 all these solutions with ODE-solvers and also have a high accuracy. The construction of the solution is done, similar to the separation of the motion that is used in the last chapter. First the solution of q2(t; p1, p4,H) for the three basic motions are constructed. It is shown how to construct q2 when it is constant or is as good as constant. Then it is shown how to construct the solution for q2 if it is oscillating. After this it is shown how to construct the solution in the case that q2 is rotating. Then the solutions for the special cases are represented. This means that q2(t; p1, p4,H) is shown in the cases 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 table i 4.1 than q2 is in equilibrium and constant. Then q2(t; p1, p2,H) = q2 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 small amplitude. This is shown in the next figure.

(a) (b) 0.7854 0

−0.005 0.7854 −0.01

0.7854 −0.015

−0.02 0.7854 ) [rad]

2 −0.025 2 f(q −0.03 0.7854 Angle q −0.035 0.7854 Numerator f(q ) −0.04 2 q = f(t) ZLBI 2 −0.045 UBI 0.7854 qOde45 Z 2 −0.05 qi ZLBI and ZUBI 2 0.7854 0 2 4 6 8 10 −3 −2 −1 0 1 2 3 Angle q [rad] Time t [s] 2

2 p1 −4 Figure 5.1: Representation of a nearly constant q2 with 2H − = 6.6 · 10 Jd

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 calculated amplitudes. The solid-line is the solution found when solving the state space model numerically.

17 5.2. Libration of q2

LBI Also in figure 5.1b f(q2) is represented. Important to notice is that Z the lower bound of inte- UBI i gration and Z , the upper bound of integration are both very close to q2. In the first case q2 is nearly constant because the amplitude is very small. This is because (5.1) (Section 4.6).

p 2 0 ≈ 2 H − 1 (5.1) Jd Looking at the amplitudes it becomes clear that they are almost the same. Although solving the state space model looks the best, it is time consuming and in longer time frames it results in larger errors. The method described in this section gives immediately a good approximation without 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 with g(q2, p1, p4,H) for simplicity.

s J (I + I ) J − J − (J − J ) sin2 (q ) g(q , p , p ,H) = d c d 2 1 d 1 2 dq 2 1 4 2 2  2 2 (2JdH − p1) J2 − J1 − (Jd − J1) sin (q2) − Jd (p4 − p1 sin (q2)) (5.2) (3.20) and (3.19) can be written in a shorter form.

s q2 q2 2  Z Z Jd (Ic + Id) J2 − J1 − (Jd − J1) sin (q2) t = g(q2; p1, p4,H) = dq2 (5.3) i i f(q2) q2 q2

LBI The integration is done over the domain that is bounded by the two zeros of f(q2) (Z UBI i and Z ) that encloses q2. The bounds within the programming will be determined from (5.4) instead of (4.3). √ −b ± b2 − 4ac q = arcsin with a ≤ 0 (5.4) 2 2a

There are maximally two zeros of f(q2) calculated with (5.4). This is because the arcsin is only π defined between q2 = ± 2 . So if necessary the other two zeros of f(q2) will be constructed with π the help of symmetry around q2 = ± 2 . So that in the end g(q2; p1, p4,H)) is integrated over the LBI UBI i correct interval. The zeros of f(q2), Z and Z enclose the interval wherein q2 is situated. i Also the sign of ω2 has now to be taken care of, because in the form of (5.3) only the positive root has been considered.

0.2 0.02

0.1 0.01

0 0

−0.01 −0.1

−0.02 −0.2 ) 2 −0.03 f(q

Time t [s] −0.3 −0.04 −0.4 −0.05 Numerator f(q ) −0.5 2 −0.06 ZLBI t = t(q ;p ,p ,H) ZUBI −0.6 2 1 4 −0.07 i LBI UBI q Z and Z 2

−0.4 −0.2 0 0.2 0.4 0.6 0.8 −3 −2 −1 0 1 2 3 Angle q [rad] Angle q [rad] 2 2

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

18 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 seen that, this line only represents the inverse of q2 and only for a half period. Within the half period T that is calculated all information is already contained. On the time axis the half period 2 can be directly determined. This can also be expressed as follows:

UBI LBI UBI T Z Z Z Z Z Z = g(q2, p1, p4,H)dq2 − g(q2, p1, p4,H)dq2 = g(q2, p1, p4,H)dq2 (5.5) 2 i i LBI q2 q2 Z 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 negative root of (5.3) is considered then:

Z ZUBI Z ZLBI − g(q2; p1, p4,H)dq2 = g(q2; p1, p4,H)dq2 (5.6) ZLBI ZUBI This is indeed the missing part of the oscillation. However it is not necessary to also calculate this part 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 by LBI UBI mirroring around the horizontal line passing through Z or Z where q2 has reached its minimal value, respectively maximum value. Then copy this inverse function to form one period T . Now the function can be totally reconstructed by copying and shifting this one period T . This can be seen in figure 5.3.

1

0.5

0

−0.5

Time t [s] −1

−1.5 t = t(q ;p ,p ,H) 2 1 4 Mirroring −2 Extending ZLBI and ZUBI Mirror axis −2.5 −0.4 −0.2 0 0.2 0.4 0.6 0.8 Angle q [rad] 2

Figure 5.3: Mirroring and extension of the function q2

In this case the half period T has been mirrored upward to form the entire period T . This whole period can be copied and shifted downward and upward to form the entire t = t(q2; p1, p4,H) (here only one downward shift is represented). Now only the time t and q2 need to be switched to find q2 = 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 found by 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 h−∞, +∞i. This is possible because there are no zeros of f(q2) that bound the integration. After integration again the form

19 5.4. Special cases of q2

1 q = q (t;p ,p ,H) 2 2 1 4 qOde45 0.8 2 ZLBI and ZUBI

0.6

0.4 [rad] 2

0.2 Angle q

0

−0.2

−0.4 0 2 4 6 8 10 Time t [s]

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 integrated over the domain h−π, +π]. Then it is extended over time. This is possible because after one rotation the motion repeats itself. So by just copying the data over this interval and shifting the solution 2π upwards or downwards this interval accordingly, the total solution can be found. The result for a certain set of initial conditions is shown in figure 5.5.

−3 (a) x 10 (b) 2 q = q (t;p ,p ,H) 18 2 2 1 4 0 qOde45 2 16 −2 14 −4 12 −6 [rad] ) 2 2 10 −8 f(q 8

Angle q −10

−12 6

−14 4 f(q ) 2 −16 2 qi 2 −18 0 2 4 6 8 10 −3 −2 −1 0 1 2 3 Angle q [rad] Time t [s] 2

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 by solving the state space model numerically and the dots represent the solution found by calculating it 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 not have 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 been analyzed 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 "middle one" disappears. This can be seen in figure 5.6:

20 5.4. Special cases of q2

4 q (t) with ωi = 2.9355 3.5 2 2 q (t) with ωi = 2.9358 2 2 3 qOde45 2 LBI UBI 2.5 Z and Z Z (middle) 2 [rad] 2 1.5

Angle q 1

0.5

0

−0.5

−1 0 2 4 6 8 10 Time t [s]

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 initial i condition of ω2 has been slightly changed as is shown in the legend. This minimal change will result 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 disappeared i π by just changing ω2 slightly so that the minimum in q2 = 2 no longer is a zero. In the following i figure the direct transfer from libration to rotation will be considered. This means that q2 6∈ Z.

10 q (t) with ωi = 4.85367267 2 2 8 q (t) with ωi = 4.85367269 2 2 qOde45(RelTol,AbsTol = 10−5) 6 2 qOde45(RelTol,AbsTol = 10−10) 4 2 ZLBI and ZUBI 2 [rad] 2

0 Angle q −2

−4

−6

−8 0 5 10 15 20 25 30 Time t [s]

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) with i two zeros where both zeros are also a minima of f(q2). Only ω2 is minimally changed . First the LBI π UBI π bounds are Z = − 2 and Z = 2 , the system is oscillating (dots). Then the function f(q2) i is lifted up a little by changing ω2 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 5.5. Result

However because of the copying of this half period the error made in the half period will be copied with it, so if the half period is calculated accurate than it will also be accurate over longer time spans. This is not the case if it is solved with ODE-solvers; then it has to be accurate over the entire time domain leading to errors over long time spans. This can be seen in figure 5.7 at the end of the periodic solution. The solid line begins to differ from the dots even if there already is a very high accuracy applied. It is possible that ODE-solvers calculate a totally incorrect solution. Numerical errors can lead π to this incorrect solution. Normally the motion is bounded between q2 = ± 2 . However because of a numerical error the calculated solution can go over the bounds (dashed lines). As a result the period is totally wrong and the new bounds are incorrect. This cannot happen with solutions that are 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 been explained.

−3 (a) x 10 (b) −1 10 q (t) with qi = −π/2−10−5 2 2 −2 q (t) with qi = −π/2−10−5 2 2 8 qOde45 2 −3 ZLBI and ZUBI 6

−4 [rad] ) 2

2 4 f(q −5

Angle q 2

−6 0

−7 Almost Homoclinic orbit π −2 Almost Heteroclinic orbit with f( /2) = 2.6142e−012 Z −8 0 5 10 15 20 25 30 35 40 −3 −2 −1 0 1 2 3 Time t [s] q 2

Figure 5.8: Nearly homoclinic and heteroclinic orbits

i i π The f(q2) can be seen again in figure 5.8b where the initial conditions are ω2 = 0 and q2 ≈ 2 so it is very close to an equilibrium point (table 4.1). This means that both solutions almost go through a homoclinic orbit (dots) and heteroclinic orbit (stars). The period T will become very big i π (q2 → 2 ,T → ∞). The near homoclinic orbit (dots) will go from close to the equilibrium point i π (q2) back to the same equilibrium point (q2 = − 2 −2π) taking a long time. In the beginning of the orbit the angular velocity is small. Then just like in an inverted pendulum the angular velocity will increase when it falls "down". Then it will slow down again and approach the equilibrium again very slowly. The same can be observed in figure 5.8a. π 3π π The near heteroclinic orbit (stars) will go from q2 = − 2 to q2 = − 2 (q2 = 2 ). However instead of the oscillation going up again as you would expect, it will move down after some time. i LBI π This is because of the perturbation of q2, as a consequence the bound Z = 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 integrating over a domain that is almost flat (nearly homoclinic and heteroclinic orbits) the result will show some overshoot (error) as can be seen in figure 5.8a. However this will have disappeared at the end T of 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). Also the solutions for q2 have been shown compared to the solutions found with ODE45, to show that the solutions are indeed correct. All this has been combined into an algorithm wherein only the i i i i time and the initial conditions need to be given to find q2 (q2 = q2(t; q2, ω1, ω2, ω4)). Remem- ber that the constants of motion are expressed in the initial conditions. Now by substituting i i i i q2 = q2(t; q2, ω1, ω2, ω4) into (3.22), (3.18) and (3.23) also solutions for ω1, ω2 and ω4 are found

22 5.5. Result

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

 i i i i i i  q2(t, q1, q2, q4, ω1, ω2, ω4) i i i i i i i i i i i i  ω1(t, q1, q2, q4, ω1, ω2, ω4)  (5.7) Φ(t, q1, q2, q4, ω1, ω2, ω4) =  i i i i i i   ω2(t, q1, q2, q4, ω1, ω2, ω4)  i i i i i i ω4(t, q1, q2, q4, ω1, ω2, ω4) These solutions Φ can now be used to lift the Hamiltonian system and the new canonical coordinates will also be expressed in these new functions. With these new canonical variables an optimal controller can be synthesized. This will be explained in the next chapter.

23 Chapter 6

Optimal control of the CMG

In this chapter the optimal control problem in general form will be introduced. Then linear control is also shortly introduced to show what the problems are with the CMG concerning control. Finally will be shown how to derive the nonlinear feedback law using the solutions that were found in the last 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: Z ∞ J = L(x(t), u(t))dt (6.2) 0 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 choices that can be taken is for instance: 1 Z ∞ J = xT Rx + uT Qu dt (6.3) 2 0 T T T In our case x = [x1, x2, x3, x4, x5, x6] = [q1, q2, q4, ω1, ω2, ω4] , u = [T1,T2] and x˙ = f(x) is: x˙ 1 = x4 (6.4)

x˙ 2 = x5 (6.5)

x˙ 3 = x6 (6.6)

x cos (x ) J sin (x ) x − x J − J 2 − cos2 (x ) + x d sin (x ) x˙ = 5 2 d 2 4 6 2 1 2 6 4 2 (6.7) 4 2 2 J2 − J1cos (x2) − Jd sin (x2)

1  x6 Jdx4 cos (x2) + 2 J1x6 sin (2 x2) x˙ 5 = (6.8) Ic + Id x x sin (2x ) 1 J − J  − J x cos (x ) − x d x˙ = 5 6 2 2 d 1 d 4 2 6 4 (6.9) 6 2 2 J2 − J1cos (x2) − Jd sin (x2)

24 6.2. Linear Optimal Control

and with g(x):

 0 0   0 0     0 0  2 g (x) = g =  J2−J1 cos (x2)  (6.10)  2 2 0   Jd(J2−J1cos (x2)−Jd sin (x2))   0 1   Ic+Id  sin(x2) − 2 2 0 J2−J1cos (x2)−Jd sin (x2)

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) and x6 (ω4). Therefore x6 can only indirectly be actuated by T1 and T2 because the angular velocities of gimbal axis 1 (x4) and gimbal axis 4 (x6) are coupled. It is not possible to asymptotically stabilize the CMG without damping d4 this is because x6 can not be forced to go to zero without it. Adding damping on gimbal axis 4 (N3) (see figure 3.1) makes it possible to asymptotically stabilize the system instead of just stabilizing the system. This is also necessary because with no damping the 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 control problem.

6.2 Linear Optimal Control

Derivation of linear optimal feedback controllers, often gives a good inside into the system. The e e e e system is linearized around an equilibrium point xi (x1 = x1, x2 = x2, x3 = x3, x4 = 0, x5 = 0 and x6 = 0). The linearized system is observable and has the form x˙ = Ax + Bu:

 0 0 0 1 0 0   0 0 0 0 1 0     0 0 0 0 0 1   d sin(xe)  A = 4 2 (6.11)  0 0 0 0 0 2 e 2 e   J2−J1cos (x )−Jd sin (x )   2 2   0 0 0 0 0 0   d4  0 0 0 0 0 − 2 e 2 e J2−J1cos (x2)−Jd sin (x2)  0 0   0 0     0 0   J −J cos2(xe)  B = 2 1 2  2 e 2 e 0   Jd(J2−J1cos (x2)−Jd sin (x2))   1   0 I +I   e c d  sin(x2) − 2 e 2 e 0 J2−J1cos (x2)−Jd sin (x2)

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 be 5. This is because it is now possible for x5 (ω2) to reach zero (independently from x4), although it is still impossible to control x3 (q4) in the linear sense. However the system is nonholonomic and as a consequence the system does not depend on the states x1 and x3. Therefore it is possible to delete these states. The states that will remain are x = [x2, x4, x5, x6] then the system is as follows:

25 6.3. Nonlinear Sub-Optimal Control

 0 0 1 0  e d4 sin(x2)  0 0 0 2 e 2 e   J2−J1cos (x )−Jd sin (x )  A =  2 2  (6.12)  0 0 0 0   d4  0 0 0 − 2 e 2 e J2−J1cos (x2)−Jd sin (x2)  0 0  2 2 J2−J1 cos (x )  2  2 e 2 e 0  Jd(J2−J1cos (x2)−Jd sin (x2))  B =  1   0 I +I   e c d  sin(x2) − 2 e 2 e 0 J2−J1cos (x2)−Jd sin (x2) 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 forces the states x4 and x6 to zero. They now can also remain constant because x˙ 1 =x ˙ 3 = 0. It is not necessary to discard the state x1. Even with the state x1 the system is fully controllable. However since 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 this is that when linearizing around x4 = x6 = 0 (ω1 = ω2 = 0) a lot of terms in A will vanish. Besides the controllability problems as described earlier, this is also a good indication that linear control of the CMG is far from ideal. In the linear optimal control problem the Riccati-equation is used to find the linear optimal state-feedback:

PA + AT P − PRP + Q = 0 (6.13) The matrices Q and R originate from the cost function and A is the state matrix as defined in (6.12). Now P needs to be calculated so that it is a stabilizing solution of the Riccati equation (6.13), P = P T > 0. If a certain P is the stabilizing solution of (6.13)(A − R(0)P is stable) then it is 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 that x˙ = f(x) can be represented as a Hamiltonian by doubling the system dimensions. The new T Hamiltonian H0 = p f(x) is called the lifted Hamiltonian. The corresponding Hamiltonian equations of H0 have then following form:

x˙ = ∂H0 = f(x) ∂p (6.14) ∂H0 ∂f T p˙ = − ∂x = − ∂x (x) p

We already found that H was integrable which means H0 is also integrable. In nonlinear optimal 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. 1 H (x, p) = pT f (x) − pT R (x) p + q(x) = 0 (6.15) H−J 2 Now the terms R (x) and q (x) are originating from the cost function and are the nonlinear counterparts of the matrices Q and R. Where q(x) is used to determine the cost on the states and T R(x) to determine the cost on the inputs. Now because H0 = p f(x), HH−J can be rewritten to: 1 H = H − H = − pT R (x) p + q(x) (6.16) 1 H−J 0 2

The part that remains from (6.15) when H0 is subtracted is the perturbed part H1. H1 contains all parts of (6.15) that cannot be integrated, so in this case terms related to the control inputs (cost function) and the damping. This is represented in (6.16).

26 6.3. Nonlinear Sub-Optimal Control

Now our original system with the canonical coordinates (x, p) can be transformed to a new set of 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:   x2 (t, x0)  x4 (t, x0)  Φ(t, x0) =   (6.17)  x5 (t, x0)  x6 (t, x0) 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 ) = (−t, x) P, (6.18) ∂x

where X is the same as the vector x0. Also the derivatives to the initial conditions of Φ(t, X) are required. 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: ∂H ∂H X˙ = 0 = 0, P˙ = − 0 = 0 (6.19) ∂P ∂X If now the entire H-J equation is transformed to these new canonical variables (X,P ), the only parts 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 equations H1(X,P ). However, it is still very difficult to solve H1. That is why the solution of the Hamiltonian equations are approximated by linearization:

∂H¯ ∂H¯ X˙ = 1 , P˙ = − 1 (6.20) ∂P ∂X The solution of (6.20) that is convergent to the origin is substituted in (6.18) and the functional relation of x and p in (6.18) is obtained, which is an approximation of the stabilizing solution. This can be found in [6] and is called the perturbation theory. The nonlinear feedback law has a similar form as the linear feedback law (u = −gT (Γx)T ):

u = −g (x)T p(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 the stabilizing solution. p (x; t) from (6.15) is calculated with:

∂Φ T p (x; t) = (−t, x)T eA tΓeAtΦ(−t, x) , (6.22) ∂x 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 R |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 calculated with (6.13). It is now possible to calculate the suboptimal nonlinear feedback, which is given by:

∂Φ T u = −g (x)T p (x; t)T = −g (x)T ( (−t, x)T eA tΓeAtΦ(−t, x))T (6.23) ∂x Important to notice is that if the feedback is linearized again one finds back the linear optimal state-feedback (p (x) = Γx), which can also be calculated with the Riccati equation. For this reason the feedback calculated with the perturbation theory will always have a performance equal or better then the linear optimal state-feedback.

27 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 of steps have been taken to get to this solution. First the Lagrangian has been derived for the CMG system. 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 differential equation describing the relevant dynamics of the uncontrolled system. The equation only depends on 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 the controller 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 a major 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 equation are also the boundaries of the angular position of the second gimbal axis determined. Immediately identifying the two basic motions oscillation and rotation from this equation. Also the change of dynamics have been identified. For instance when the amplitude will double. The homoclinic and heteroclinic orbits have also been identified. It was even possible to derive equations only depending 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 solving differential equations. After this three different construction schemes belonging to the different dynamics have been developed 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 needs to be calculated by numerical integration. This means that if this small section is accurate the whole solution will be accurate. The rest of the solution is constructed by copying and mirroring this small section. Therefore the construction of the solution for longer time intervals will be very fast. When solving with ODE-solvers numerical errors can lead to wrong motion regimes. Also over longer time intervals the error will be bigger. This will not happen in the program because the 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 conditions the belonging solution for the angle of gimbal axis two is found. The angular velocities have been reduced to a form only depending on the initial conditions and the angle of the second gimbal axis the solution of the entire system has been found. This solution can then be used to synthesize the sub-optimal state-feedback. To calculate this state-feedback the Hamilton-Jacobi equation is used. Because the system can now be expressed in the new canonical variables only the perturbation remains, containing damping, control inputs and the functions found in this report. Also because of the form of the Hamilton-Jacobi the derivatives to the initial conditions of q2 are needed. They also have been programmed but are not represented in this report. What still is missing in the Hamilton-Jacobi equation is a proper choice for the cost

28 function. Now with the H-J an optimal time t can be calculated. Whereafter the state-feedback can be 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 (gimbal axis three unlocked) is also integrable. This is because the existing first integrals will remain first integrals (Hamiltonian will be conserved and the conjugate momenta of gimbal axis one and four remain cyclic) in the four DOF system. Then only one more first integral will be needed namely the total angular momentum which also is a conserved quantity. This means that a similar approach can be used to solve the four DOF system.

29 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 Products Bell Canyon, CA, 1999. [5] Mahmut Reyhanoglu and Jasper van de Loo. State feedback tracking of a nonholonomic control moment 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 the stabilizing solution of the hamilton-jacobi equation. "to be published in IEEE Trans. Automatic Control", 2008.

30 List of symbols

Symbols from Chapter 1 "Theory of the Hamiltonian and Integrable systems" L Lagrangian [J] H Hamiltonian [J] th qi i independent coordinate [rad] th q˙i i independent velocity [rad/s] th 2 pi i conjugate momenta [kgm rad/s] f First integral u Function depending on q and p v Function depending on q and p

Symbols from Chapter 2 "Control Moment Gyroscope" ai Unity vectors of body A bi Unity vectors of body B ci Unity vectors of body C di Unity vectors of body D Ni Unity vectors of the reference frame 2 Ix Scalar moments of inertia of body x in direction 1 [kgm ] 2 Jx Scalar moments of inertia of body x in direction 2 [kgm ] 2 Kx Scalar moments of inertia of body x in direction 3 [kgm ] th ωi = Angular velocity of the i body [rad/s] d4 Damping on body D [Nsm] 2 J1 Combined scalar moment of inertia [kgm ] 2 J2 Combined scalar moment of inertia [kgm ] t Time [s] g The function to be integrated (inverse of ω2)

Symbols from Chapter 3 "Dynamics of the CMG-system" i q2 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) Min q2 Coordinate of the minimums of f(q2)[rad] Max q2 Coordinate of the maximums of f(q2)[rad]

Symbols from Chapter 4 "Construction of the solution" LBI Z The minimum value that q2 can reach [rad] UBI Z The maximum value that q2 can reach [rad] T Period [s]

31 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 solution found in known analytic functions. To show that it is still difficult to work with such a solution one example is given. The solution will be worked out in the case that p1 = 0. Therefore first (3.20) is simplified to (A.1). s Z q2 (I + I ) J − J − (J − J ) sin2 q  t = c d 2 1 d 1 2 dq (A.1) 2  2 2 i 2H J − J − (J − J ) sin q − p q2 2 1 d 1 2 4 To be able to solve this integral a substitution is done. The substitution is u = sin (q2). Then the integral has following form:

s Z q2 2 A − u (A.2) t = C 2 2 2 dq2 i (1 − u )(A − u − Bp4 ) q2 r J − J 1 I + I with A = 2 1 , B = and C = c d Jd − J1 2H(Jd − J1) 2H Before it can be solved it needs to fit in a form that is suggested in [1]. Therefore another substitution of z = A − u2. The integral will then reduces to following form: r C z (A.3) t = − 2 2 (z − Bp4 )(z + A − 1) (z − A) This form can now be integrated and has following solution:

2 z=A−sin (q2) (A.4) t = ψ (z) φ (z)(F (φ (z) ,E) − Π(φ (z) ,D,E)| 2 i z=A−sin (q2) with  2  2 s (z + A) + 2 (z + A) + 1 CBp4 (A − 1)2 z ψ (z) = (A.5) 2 3 2 (A − 1 + Bp4 ) z A (z + A − 1) Bp4 s 2 (A − 1 + Bp4 ) z (A.6) and φ (z) = 2 Bp4 (z + A − 1) with the constants s 2 2 Bp4 (2 A − 1) Bp4 (A.7) D = 2 and E = 2 A − 1 + Bp4 A (A − 1 + Bp4 ) In (A.4) is F the incomplete integral of the first kind and Π the incomplete elliptic integral of the third kind. It is clear although an analytic expression exist for the solution of (A.1) it is still difficult to work with.

32 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 following form and is easily solved.

2 i i (A.8) 2H = (Ic + Id) ω2 → q2 = ω2t + q2 To show that this motion has no equilibrium points equation 4.2 is simplified

2  i (A.9) (2JdH) J2 − J1 − (Jd − J1) sin q2 6= 0 with ω2 6= 0

33 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 always positive. The denominator of this function is:

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

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

2 J2 − J1 sin (q2) = (B.3) Jd − J1 (B.4)

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

2 sin (q2) > 1 (B.5)

This means that the denominator does not have zeros and is always positive. As consequence it 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).

d 2  0 = a sin (q2) + b sin (q2) + c dq2 2  0 = − 2 Jd (Jd − J1) H + J1p1 sin (q2) − Jdp1p4 cos (q2) (B.6)

The maxima and minima are given by following two relations:

Jdp1p4 b (B.7) cos (q2) = 0 and sin (q2) = 2 = − 2 Jd (Jd − J1) H + J1p1 2a

Important to notice is that if: |2a| < |b| (B.8) Min Max Then there is only one minimum (q2 ) and one maximum (q2 ). This also means that there are maximal two zeros in the domain h−π, π].

34 B.3. Maximum Max coincides with a zero if q2 |2a| > |b|

Now separating the case of two extrema and four extrema then can be shown which extrema Min Max correspond to q2 and q2 . This can be calculated by taking the second derivative of the nu- merator.

2 d 2 2  (B.9) 2 f(q2) = 2a cos (q2) − sin (q2) − b sin (q2) dq2 b Now filling in the equation found for the second extrema equation sin (q2) = − 2a the following relation is found:

2    2 2 ! d −b b b (B.10) 2 f arcsin = 2a − = 2a 1 − 2 dq2 2a 2a (2a) This extreem exist if |2a| > |b| this means that also (2a)2 > b2. This is now worked out:

2 ! b 2 2a 1 − ⇒ − 2 Jd (Jd − J1) H + J1p1 < 0 (B.11) (2a)2 | {z } >0 Max The result is that this relation always correspond to q2 if |2a| > |b|. This should automati- Min cally mean that the two extrema corresponding to cos (q2) = 0 in this case are q2 . This can now be proven: 2   d π (B.12) 2 f ± = −2a ∓ b > 0 with |2a| > |b| dq2 2 In the case that |2a| < |b|: 2   d π (B.13) 2 f = −2a − b < 0 if b > 0 maximum, if b < 0 minimum dq2 2 2   d π (B.14) 2 f − = −2a + b > 0 if b > 0 minimum, if b < 0 maximum dq2 2 Min Max This corresponds to the case that there is only one q2 and one q2 .

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

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

Jdp1p4 (B.15) sin (q2) = 2 2 Jd (Jd − J1) H + J1p1

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

 2   Jdp1p4 Jdp1p4 0 = a 2 + b 2 + c 2 Jd (Jd − J1) H + J1p1 2 Jd (Jd − J1) H + J1p1 This now is worked out to find a useful relation.

 2  2 2 (Jd − J1) Jdp4 0 = 2 JdH − p1 2 Jd (Jd − J1) H + J1p1 − (B.16) J2 − J1 Max If one of two following relations are fulfilled there is a maximum q2 that coincides with a zero if |2a| > |b|.

p 2 2 H = 1 (4.8) Jd (J − J ) J p 2 − J p 2 (J − J ) 2 H = d 1 d 4 1 1 2 1 (B.17) Jd (Jd − J1)(J2 − J1) However no physical meaning could be found to the abbreviated second equation of (B.17).

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

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

Min In Appendix B.2 was shown that if |2a| > |b| that cos (q2) = 0 corresponds to q2 . To find the Min points where q2 coincides with a zero, sin (q2) = ±1 is filled in f(q2).

0 = a ± b + c (B.18) This is worked out below.

2 2 2 0 = −2 Jd (Jd − J1) H − J1p1 ± 2 Jdp1p4 + 2 JdH − p1 (J2 − J1) − Jdp4 (B.19)

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

2 2 (p1 + p4) p1 Min π (4.6) 2 H = + belonging to q2 = − J2 − Jd Jd 2 and 2 2 (p1 − p4) p1 Min π (4.7) 2 H = + belonging to q2 = J2 − Jd Jd 2

B.5 Extrema Min and Max coincide with a zero if q2 q2 |2a| < |b|

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

(p − p )2 p 2 2 H = 1 4 + 1 (4.6) J2 − Jd Jd A minimum coincides with a zero if:

(p + p )2 p 2 2 H = 1 4 + 1 (4.6) J2 − Jd Jd If b < 0 the relations are switched.

36 Appendix C

Numerical values used for the dierent parameters and simulations

Throughout the report simulations have been shown. These were calculated with the following values 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.0148 Jb = 0.0178 Jc = 0.0230 Jd = 0.0273 Ka = 0.0670 Kb = 0.0297 Kc = 0.0188

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

i i i i Figure Line q2 [rad] ω1 [rad/s] ω2 [rad/s] ω4 [rad/s] π Figure 4.1 f1 − 4 −2 0.5 0.5 π f2 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 −7 π f6 − 4 1 4.99 −2 π f7 − 3 7 1.97 2

π Figure 4.3 f8 − 2 −0.5 0 0.1 π f9 4 −0.43 0 1

π −5 Figure 5.1 4 5 10 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 38