Development of an Attitude Dynamics Simulation Applet









A Thesis


Presented to the Faculty of


California Polytechnic State University







In Partial Fulfillment


of the Requirements for the Degree


Master of Science in Aerospace Engineering





by


Noriko Takada


August 2003








































2003


Noriko Takada


ALL RIGHTS RESERVED

APPROVAL PAGE



Title: Development of an Attitude Dynamics Simulation Applet


Author: Noriko Takada


Date Submitted: August 2003






ABSTRACT

Development of an Attitude Dynamics Simulation Applet

By Noriko Takada

This paper presents the development of a web-based application written in Java, or an applet, for simulating attitude dynamics of a spacecraft. The project was a continuation of a previous work done by Daniel L. Quock in 2000. Previously available scenarios included constant torque, gravity gradient, and reaction-wheel control simulation of a rigid spacecraft. The challenges left by the previous work included adding more scenarios, such as adding damping components, incorporating flexibility, and deploying the applet on the world wide web for public use, which the project presented in this paper has achieved. In addition, the applet was integrated into the Java Astrodynamics Toolkit (JAT) project, which is a comprehensive collection of classes for an astrodynamics researcher. The spacecraft attitude dynamics applet developed in this project was constructed by the classes available from JAT, while at the same time this thesis project has contributed to the JAT project.

ACKNOWLEDGEMENTS


I would like to express my gratitude to my thesis advisor, Dr. Jordi Puig-Suari for his support and guidance. Especially the derivation of the flexible-spacecraft equations of motion could not have been done without his insight. I would like to thank him also for helping me finishing up the project during the last several weeks and for checking and correcting my thesis draft and making suggestions for the format.

My thanks also go to Daniel L. Quock, who preceded this project and developed the first attitude simulation applet, for his help and encouragement. He was kind enough to let me study and modify his code and use it for the applet developed in this project.

This project would not have been the same if I did not participate in the Java Astrodynamics Toolkit (JAT) project. The applet developed in this project uses numerical integration routine and plotting interface available from JAT, which has enhanced the overall feature of the applet. I would like to thank the project administrators David Gaylor and Tobias Berthold for letting me join the project and giving me suggestions for my work.

Last, but not least, I would like to thank my parents for supporting me for a full six years of my education and making this whole thing possible in the first place, and many thanks to my friends and classmates whose encouragement I really appreciate.


TABLE OF CONTENTS

LIST OF FIGURES ix

LIST OF TABLES xv

NOMENCLATURE xvi

1 INTRODUCTION 1

1.1 Objective of the Project 1

1.2 Project History 1

1.3 Overview of Rigid Body Dynamics 3

1.3.1 Spacecraft Dynamics 4

1.3.2 Angular Momentum & Rotational Kinetic Energy 4

1.3.3 Attitude Kinematics 5

1.3.4 Attitude Dynamics 6

1.3.5 Attitude Control 6

2 Programming in Java 8

2.1 What is Java? 8

2.2 The Advantages of Java 9

2.3 Java Astrodyamics Toolkit (JAT) 10

2.3.1 Project Overview 10

2.3.2 Open-source software development 10

2.3.3 Concurrent Versions System (CVS) and Sourceforge.net 11

2.3.4 Tools used to develop JAT 11

2.3.5 Architecture of JAT 14

2.4 Development of jat.attitude package 15

2.5 Development of Attitude Simulation Applet 16

3 Developed Scenarios for a Rigid Spacecraft 24

3.1 Constant, Body-Fixed Torques 24

3.2 Gravity Gradient in a Circular Orbit 28

3.3 Gravity Gradient in an Eccentric Orbit 34

3.4 Damping with Spherical Wheel Damper 37

3.5 Reorientation Maneuver with Four Reaction Wheels 42

3.6 Reorientation Maneuver with Three Control Moment Gyros 52

3.7 One-Axis Bang-Bang Control Demonstration 61

4 Developed Scenarios for a Flexible Spacecraft 65

4.1 Flexible Spacecraft in Two Dimensions 65

4.1.1 Derivation of Equations of Motion 65

4.1.2 Linear Analysis 73

4.1.3 Confirmation of the Accuracy of the Model 80

4.1.4 Simulation Implementation 91

4.2 Flexible Spacecraft in Three Dimensions 95

4.2.1 Derivation of Equations of Motion 95

4.2.2 Linear Analysis 101

4.2.3 Confirmation of the Accuracy of the Model 106

4.2.4 Simulation Implementation 112

5 Implementation on a Website 119

6 Conclusions and Future Work 121

REFERENCES 122

Appendix 1 2D Flexible Spacecraft Equations of Motion 126

Appendix 2 Linearization of Equations of Motion (3D) 128

LIST OF FIGURES


Figure 1.1: Applet Interface from Previous Work 2

Figure 2.1: Interface of Eclipse Platform 12

Figure 2.2: Interface of WinCVS 13

Figure 2.3: Interfaces of 2D Plots in JAT 17

Figure 2.4: 3D Animation produced by AnimationWindow class 18

Figure 2.5: Scene graph diagram for AnimationWindow 19

Figure 2.6: 3D Visualization of a Spacecraft with Flexible Appendages 20

Figure 2.7: Scene Graph Diagram of AnimtionWIndow2.class 21

Figure 2.8: Interface of the Attitude Simulation Applet 22

Figure 3.1: Applet Interface for Scenario 1 25

Figure 3.2: Scenario 1 Simulation with 26

Figure 3.3: Scenario 1 Simulation with 27

Figure 3.4: Scenario 1 Simulation with 28

Figure 3.5: Applet Interface for Scenario 2 33

Figure 3.6: Applet Interface for Scenario 3 36

Figure 3.7: A rigid spacecraft with a spherical damper inside 37

Figure 3.8: Interface of Scenario 4 41

Figure 3.9: Four Reaction Wheels in a Pyramid Configuration 42

Figure 3.10: A reaction wheel in an arbitrary orientation 43

Figure 3.11: Applet Interface for Scenario 5 50

Figure 3.12: Example of reorientation maneuver 51

Figure 3.13: Angular momentum during a reorientation maneuver with no initial angular velocities 51

Figure 3.14: Possible configuration of CMG Assembly using three CMGs 53

Figure 3.15: A CMG of Arbitrary Orientation inside a spacecraft 54

Figure 3.16: Applet Interface for Scenario 6 60

Figure 3.17: Block diagram used for the simulation 61

Figure 3.18: Reduced Block diagram 62

Figure 3.19: Final Transfer function 62

Figure 3.20: Algorithm of Bang-Bang Control 63

Figure 3.21: Interface for Scenario 7 64

Figure 4.1: A Flexible Spacecraft in a Circular Orbit 65

Figure 4.2: Flexible element modeling 69

Figure 4.3: Position plot for anti-symmetric initial condition 79

79

Figure 4.4: Position plot for symmetric initial condition 79

Figure 4.5: Total energy of the system with no energy-dissipating elements 82

Figure 4.6: Total energy of the system with no energy-dissipating elements 82

Figure 4.7: Model of a flexible spacecraft system 83

Figure 4.8: Total angular momentum for a symmetric initial condition 88

Figure 4.9: Total angular momentum for an anti-symmetric initial condition 89

Figure 4.10: Angular momentum plot for non-symmetric initial condition 90

Figure 4.11: Applet Interface of Flexible Spacecraft in 2D Simulation 91

Figure 4.12: Position Plot for a symmetric initial condition 92

Figure 4.13: Angular Momentum Plot for a symmetric initial condition 92

Figure 4.14: Position Plot for an anti-symmetric initial condition 93

Figure 4.15: Angular Momentum Plot for an anti-symmetric condition 93

Figure 4.16: Position Plot for a non-symmetric initial condition 94

Figure 4.17: Angular Momentum Plot for a non-symmetric initial condition 94

Figure 4.18: Flexible spacecraft model 95

Figure 4.19: Numerical Simulation for a symmetric initial condition 105

Figure 4.20: Numerical Simulation for an anti-symmetric condition 105

Figure 4.21: System Total Energy for anti-symmetric initial condition 107

Figure 4.22: System Energy for symmetric initial condition 107

Figure 4.23: Angular momentum of the system for anti-symmetric initial condition 112

Figure 4.24: Angular momentum of the system for symmetric initial condition 112

Figure 4.26: Tip-mass Position and Velocity Plot for a symmetric initial condition 114

114

Figure 4.27: Spacecraft Euler Angle Plot for a symmetric initial condition 114

114

Figure 4.28: Angular Momentum Plot for a symmetric initial condition 115

115

Figure 4.29: Tip-mass Position and Velocity Plot for an anti-symmetric initial condition 115

115

Figure 4.30: Spacecraft Euler Angle Plot for an anti-symmetric condition 116

116

Figure 4.31: Angular Momentum Plot for an anti-symmetric condition 116

116

Figure 4.32: Tip-mass Position and Velocity Plot for a non-symmetric condition 117

Figure 4.33: Spacecraft Euler Angle Plot for a non-symmetric condition 117

117

Figure 4.34: Angular Momentum Plot for a non-symmetric condition 118

118

Figure 5.1: The Applet on the World Wide Web 119

Figure 5.2: Server file structure 120



LIST OF TABLES

Table 2.1: Packages in JAT 14

Table 2.2: jat.attitude package architecture 15


NOMENCLATURE

H angular momentum ()

I moment of inertia ()

T kinetic energy (joule)

Tc control torque ()

Kp proportional gain

Kd derivative gain

Ki integral gain

M torque ()

V potential energy (joule)

a semi-major axis (km)

e eccentricity

n orbital rate, (rad/sec)

elemnt of direction matrix, i =1,2,3

c11 gravity gradient variable

c21 gravity gradient variable

c31 gravity gradient variable

angular velocity of a spacecraft in a circular otbit (rad/sec)

gravitational parameter (km3/s2)

J reaction wheel moment of inertia (kg-m2 )

G gravitational constant (Nm2/kg2)

a semi-major axis (km)

angle (radian)

p semilatus rectum, p = a(1-e2) (km)

c viscous damping coefficient

m mass (kg)

r distance from Earth to spacecraft’s center of mass (km)

t time (second)

q1 first quaternion

q2 second quaternion

q3 third quaternion

q4 fourth quaternion

qe error quarternion

qt target quarternion

qs current quarternion of a spacecraft

EI flexural rigdity

angular velocity (rad / sec)

angular acceleration (rad / sec2 )

number of orbits


Subscripts

a reaction wheel aligned along x-axis

b reaction wheel aligned along y-axis

c reaction wheel aligned along z-axis

x x-axis

y y-axis

z z-axis

xx principal axes, x-direction

yy principal axes, y-direction

zz principal axes, z-direction

GG gravity gradient


Superscripts

* non-dimensionalized

T matrix transpose


Overhead Notations

vector

time derivative,

basis vector

1 INTRODUCTION

1.1 Objective of the Project

The main objective of this project was to develop software for simulating spacecraft attitude dynamics and control in Java and to provide access to it via the Internet for the purpose of:

These needs come from the experience encountered in spacecraft-dynamics courses offered at California Polytechnic State University, San Luis Obispo (Cal Poly). When students take a spacecraft dynamics course for the very first time in their undergraduate education, understanding the subject is relatively difficult because the subject mainly deals with the three-degree of freedom rotational motion in space while the focus of their previous education was usually on translational motion. The web-based application will provide students with one form of reference that they can consult with in studying attitude dynamics.


1.2 Project History

The idea of making an applet for simulating spacecraft attitude dynamics was generated by Daniel L. Quock [Ref 22], who undertook such a project as his Master’s thesis project. Quock developed an applet that was capable of simulating a rigid body dynamics with constant torques, maneuvering capability with three reaction wheels, and gravity-gradient torques. An example of its interface is shown below.

Figure 1.1: Applet Interface from Previous Work


When Quock completed his project, (the applet was completed in terms of its functionality but was never actually deployed on a website), he determined the following future tasks: 1) Expanding the program—Add more scenarios (Ex. Damping, Gyros, Four Reaction Wheels), 2) Using it in the classroom, 3) Making it available publicly. At the onset of this project, it was determined that the first task was to deploy the available applet from previous work on a Web Site for public use. This was done successfully, and the applet was used by students who were taking spacecraft-dynamics class at the time to check the accuracy of their simulation. Meanwhile, Quock made the applet file, which was originally one big file, modular, decomposing it into four separate files: 1) AttDynamics.java, 2) AnimationWindow.java, 3) HelpWindow.java,

4) PlotWindow.java. AttDynamics is the applet file, and other three are utility classes that are instanciated by AttDynamics. In order to make adding scenarios an easy process, Quock enhanced the comments in AttDynamics so as to indicate where new lines of code for new scenarios were to be added. However, because of the involvement in Java Astrodynamics Toolkit (JAT) project, which will be described later in this paper, the decision was made to write a completely new file for the new applet, the reason for which was that in JAT subroutines needed for simulation such as plotting routine and numerical integration routine were available, and using routines from previous work was no longer necessary. From the previous work, only AnimationWindow was used in the new applet for three-dimensional visualization of the behavior of spacecraft attitude. Finally it was decided that the new applet was going to be developed as a part of JAT.


1.3 Overview of Rigid Body Dynamics

Satellite technology is young but is already indispensable to our lives today; some of the fields in which satellites are used include telecommunications, scientific research, meteorology, and others [Ref 3]. Therefore the need for engineers to have a solid educational background on spacecraft dynamics is critical for the improvement and safety of our daily lives.



1.3.1 Spacecraft Dynamics

Spacecraft dynamics is a combination of orbit dynamics and attitude dynamics, both of which is needed to describe the motion of a spacecraft in space but each deals with distinct area of dynamics. Orbit dynamics is a particle dynamics in which a spacecraft is considered to be a particle (a point mass with no dimension), and its translational motion is the focus of the subject. Attitude dynamics, on the other hand, is a rigid-body dynamics in which a spacecraft is considered to be a body with finite dimension, and its rotational motion about its center of mass is the main focus. As no physical bodies are completely rigid, a flexible body is also concerned in spacecraft attitude dynamics. The challenges in learning spacecraft attitude dynamics include its non-intuitiveness compared to the relative intuitiveness in translational dynamics, the difficulty in visualizing what is really happening to the spacecraft orientation, and the heavy emphasis on computer simulation because of the involved complexity and non-linearity in the equations of motion of attitude dynamics.


1.3.2 Angular Momentum & Rotational Kinetic Energy

The two quantities important in attitude dynamics is the angular momentum and rotational kinetic energy, which together completely define the rotational dynamic state of a rigid body [Ref 3]. The equations of angular momentum and rotational kinetic energy in matrix form are given in [Ref 3] and are shown in the respective order.

(Eq. 1.1)

(Eq. 1.2)

These two quantities are subject to the law of conservation and can be used to check for the accuracy of the mathematical model of a spacecraft system. This way of checking the accuracy of a model can be applied to a flexible system as well


1.3.3 Attitude Kinematics

The attitude kinematics deals with the description of the orientation of a body in space, which is always described with respect to some reference coordinate system, which may or may not be inertial. An example of an inertial reference frame is the non-rotating coordinate system fixed at the center of the Earth, and an example of a non-inertial reference frame is the orbit frame that moves with a spacecraft in an orbit. It is noted that the word ‘inertial’ should be interpreted to mean ‘inertial enough’ as no reference frame is never perfectly non-accelerating; In the case of the non-rotating frame fixed at the center of the Earth, it is actually accelerating if considered in a bigger perspective since the solar system is accelerating through universe, but this fact is not relevant if a spacecraft is in the solar system.

The relationship between two frames (in the case of describing the orientation of a spacecraft, between the body frame and the reference frame) is defined by a transformation matrix by using Euler angles, direction cosines, or quaternion vectors. The relationship of any two coordinate systems is obtained by successive transformation between intermediate frames. The kinematics of a spacecraft in space is completely described by the kinematical differential equation that defines the time-dependent relationships of two coordinate systems and any necessary transformation in order to express the quantity in the desired frame.

1.3.4 Attitude Dynamics

The attitude dynamics of a spacecraft is described by the angular momentum equation, which states that the time rate of change of the angular momentum of a system is equal to the external torques acting on the center of mass of the system.

The derivation leads to three, coupled nonlinear ordinary differential equations, which together with the kinematical equations, completely describe the attitude motion of a spacecraft in space.


1.3.5 Attitude Control

The expression ‘attitude control’ has the meaning of controlling the attitude of a satellite so it can achieve a desired orientation [Ref 3]. In order to control the attitude of a spacecraft, control torque is necessary, which can be produced actively with control hardware instruments (this kind of control is called active control), or by natural effects such as gravity gradient torques (this kind of control is called passive control) [Ref 3]. In the case of active control, the control torque to be activated is a function of the attitude errors or the difference between the current orientation and the desired orientation [Ref 3]. The equation for the control torques is written as [Ref 3]:

(i =1, 2, 3) (Eq. 1.3)

The above equation applies to each of the three body axes. Control gains Kp, Kd, and Ki are proportional, derivative, and integral gains, respectively, and can be determined in order to obtain desired natural frequency and damping characteristic of the system through the linearization of spacecraft dynamic equations.

Attitude control can be of two types: attitude stabilization and attitude reorientation maneuver. For the attitude stabilization, passive control is popular although active control can also be used. For attitude reorientation maneuver, the attitude control must necessarily be active with the control torques calculated by a control command law. An example of satellites that need such attitude reorientation maneuver is one whose task is to scan the sky for scientific observations [Ref 3]. Command laws are expressed in different attitude error terminologies, and the most common include Euler-angle error for small-angle maneuver, and for large-attitude maneuvers, direction cosine error or quaternion error expressions [Ref 3]. The attitude control of a spacecraft using the control command law assumes the existence of control hardware that can generate the commanded torques. The topic of control hardware is discussed next.

For the attitude control of a spacecraft, Sidi [Ref 3] lists four distinct means:

1. Earth’s magnetic field

2. Reaction forces produced by expulsion of gas or ion particles

3. Solar radiation pressure on spacecraft surfaces

4. Momentum exchange devices (rotating bodies inside the s/c)

Of the four options, the first three change the overall inertial angular momentum of a spacecraft, while the fourth option do not because it is based on rotating masses inside the spacecraft, and angular momentum is transferred within the system without changing the overall inertial angular momentum vector of the system [Ref 3]. The momentum exchange devices include reaction wheels, momentum wheels, and control moment gyros, and they are popular for accurate and fast maneuvers for their capability of providing continuous and smooth control with lowest possible disturbing torques [Ref 3].

2 Programming in Java

2.1 What is Java?

Java consists of three components: the Java programming language, the Java virtual machine, and the Java platform [Ref 11]. The Java programming language is the language Java programs are written in. It is similar to C++, which makes it easy for people who have used C++ to learn. It is design to be simpler than C++ so that it is easier to write bug-free code than C++ [Ref 11]. The Java virtual machine is a CPU architecture that can be implemented on hardware directly or in the form of a software program [Ref 11]. When Java codes are compiled, they are first converted to intermediate code called byte codes, which are the machine instruction for the Java virtual machine. The Java virtual machine then interprets and executes the byte codes. Therefore, as long as the Java virtual machine is implemented, any computer can run Java programs. The Java platform is the programming environment, which is also referred to as JRE (Java Runtime Environment) or the core Java APIs (Application Programming Interfaces). The platform is made up of a collection of classes available for use by all Java programs [Ref 11]. Java programs can be of two types: an application or applet. A Java application is said to run ‘stand-alone,’ and executes independently on a computer whereas an applet is, by definition, run inside a Web browser as a part of the page, which is downloaded via the Internet and runs on a user’s machine.





2.2 The Advantages of Java

The following list summarizes the characteristics of Java that makes it more suitable for using in this project than other programming languages:

1. Simple

2. Object Oriented

3. Platform Independent

4. Easy to generate documentation

5. Easy to build Graphical User Interface

6. Available for free

First of all, as was mentioned in the previous section, the syntax in Java is simpler than other languages, which makes it relatively easy to write bug-free code. Second, the object-oriented design of Java makes it easy to re-use or add functionality to the existing code, which saves programmers time and effort. Third, programs written in Java can be run on any platforms with the implementation of Java virtual machine. Fourth, the implementation of Java comes with the tool called javadoc, which generates documentation in HTML format if the documentation convention is followed in the source code. Fifth, since the standard APIs include classes for building graphical user interface, it is easy to build GUI and to make an application that looks good. Lastly, everything needed to write Java programs, from the software development kit (SDK) to the language editor, is available free via the Internet.




2.3 Java Astrodyamics Toolkit (JAT)

2.3.1 Project Overview

The Java Astrodynamics Toolkit (JAT) project is an Open Source project hosted by the Web site: SourceFourge.net. It was started by a small group of aerospace engineering graduate students at the University of Texas at Austin, who decided to use Java for their homework assignments in Celestial Mechanics. They started sharing a numerical integrator and discussing homework problems, but they became frustrated by the lack of numerical and engineering routine in Java and decided to create Java Astrodynamics Toolkit. The ultimate goal of the project is for JAT to become a space mission analysis and design software that can compete with existing commercial-off-the-shelf (COTS) software in terms of features, accuracy and ease of use but with more flexibility that the Java language and the nature of open-source code can provide. The current Web address of the project is: http://jat.sourceforge.net/


2.3.2 Open-source software development

The Java Astrodynaics Toolkit project is an Open Source software development project for the purpose of providing users with flexibility to modify and redistribute the source code and of facilitating a rapid progress of the project. The definition of the term Open Source is maintained by an organization called Open Source Initiative (OSI), which certifies the license terms that comply with the Open Source Definition [Ref 15]. Simply stated, the Open Source license ensures the availability of the source code and uses’ freedom to re-distribute the source code in the original or modified form.


2.3.3 Concurrent Versions System (CVS) and Sourceforge.net

The Java Astrodynamics Toolkit project utilizes the Concurrent Versions System (CVS) with much of its functionality provided by SourceFourge.net. CVS is a tool used by software development teams to store the source code in a centralized location, and the functions it provides include [Ref 16]:

Sourceforge.net is an Open Source software development website, providing free hosting services for Open-Source developers. It provides many of the CVS services along with the repository of Open Source code and applications available on the Internet [Ref 17].




2.3.4 Tools used to develop JAT

The following tools were used to develop the packages in JAT and the attitude simulation applet in this project.

1. Java 2 SDK, Standard Edition, Version 1.4

2. Java 3D API

3. Eclipse Platform

4. WinCVS 1.3

The Java 2 SDK, Standard Edition, Version 1.4 (SDK stands for Software Development Kit) contains the tools needed to develop Java programs including the compiler and is the minimum requirement that programmers must have in order to write code in Java. The Java 3D API provides a set of interfaces that enables developers to build 3D animation and incorporate into an application or applet [Ref 18]. As an editor, the Eclipse Java Development Tools (JDT) in the Eclipse Platform available from eclipse.org was used [Ref 19]. Figure 2.1 shows the interface of Eclipse Platform in the Java-browsing mode.


F
igure 2.1: Interface of Eclipse Platform

WinCVS is an Open Source software called a CVS client that is needed for developers to make changes to the code in the CVS repository. WinCVS provides graphical user interface so that beginners can quickly learn the CVS operations[Ref 20]. The interface of WinCVS is shown in Figure 2.2.

F
igure 2.2: Interface of WinCVS








2.3.5 Architecture of JAT

JAT is still growing in terms of its features and functionality, but the current architecture or the available packages as of July 2003 is summarized in the table below.

Table 2.1: Packages in JAT

JAT Packages

Features

jat.alg

Package alg contains generic algorithms such as numerical integrators, non-linear equation solvers, etc.

jat.attitude

Package attitude contains equations of motion for basic rigid and flexible spacecraft dynamics and provides means to present the output to users

jat.audio

Package audio provides a utility for playing sound files

jat.cm

Package cm contains celestial mechanics routines

jat.demo

Package demo provides demonstration of how to use jat routines

jat.env

Package env provides the mechanism for setting environment variables (such as a path to the local JAT directory)

jat.eph

Package eph contains the methods necessary to parse the JPL DE 405 ephemeris files (text versions), and compute the position and velocity of the planets, Moon, and Sun

jat.forces

Package forces contains force models for generating space trajectories. These forces include gravity, atmospheric drag and solar radiation pressure.

jat.gps

Package gps contains models used to simulate the GPS constellation and navigation using GPS

jat.math

Package math contains mathematical functions that should have been included in java.math.

jat.matvec

Package matvec provodes Matrix and vector functions derived from JAMA and JMAT

jat.plot

Package plot provides plotting capability based on Ptolemy and Gr.

jat.sensors

Package sensors contains models of various spacecraft sensors such as gyros, accelerometers, etc.

jat.timeRef

Package timeRef contains classes for converting time formats and types and Earth reference frames.

jat.traj

Package traj provides a means to create trajectory file

jat.util

Package util provides utility functions

jat.vr

Package vr provides Virtual Reality functions for Java3D visualization



2.4 Development of jat.attitude package

The development of jat.attitude package started because the need of developing Java files for the attitude simulation applet and the need of JAT developers to create rigid-body dynamics package matched. The way the attitude package works resembles the spacecraft dynamics simulation that can be done in MATLAB, which is a reasonable way to start because that makes it possible to check the output from JAT function against that from MATLAB, thereby confirming the accuracy and competence of JAT. Table 2.2 shows the current architecture of jat.attitude package.

Table 2.2: jat.attitude package architecture

Name

Features

jat.attitude

Package attitude contains generic utility classes

jat.attitude.eom

Package eom contains equations of motions of a rigid and flexible spacecraft

jat.attitude.thesis

Package thesis contains the applet for this project

jat.attitude.util

Package thesis contains utility classes for GUI and 3D animation


At this point, the package jat.attitude is designed so as to assist the development of the attitude simulation applet; however, there is a lot of room for improvement for this package architecture, and the thesis applet should eventually be moved to the demo package in order to be consistent with what Java Astrodynamics Toolkit is supposed to be: the class libraries for Astrodynamics researchers.






2.5 Development of Attitude Simulation Applet

The main subroutines needed for the development of the attitude simulation applet were 1) numerical integration routine, 2) GUI building routine, 4) event handling routine, 3) equations of motion defining routine, 4) 2D visualization routine, 5) 3D visualization routine. The numerical integration routine was provided by jat.alg integrator package, and the method employed was a fixed-step-size Runge-Kutta 8th order method with the integration parameter values taken from Fehlberg, Erwin, NASA TR R-287 [Ref 21]. Graphical User Interface (GUI) was mainly built in the init( ) method in the applet with the help of an outside routine that built input fields and accompanying labels. In this project all the GUI components used was Swing components because of their flexibility and ease in giving a sophisticate look to GUI and well-anticipated enhancement of features in the future. Event handling was mostly done in the actionPerformed( ) method in the applet that provided the responses to the users’ pushing buttons. Equations of motion for every scenario were defined in jat.attitude.eom package that implemented interfaces needed for the numerical integration. 2D visualization, that is, plotting the output was done through classes contained in jat.plot package. An example of a 2D plot is shown in the following figure. Please see the Appendix for the Java code used in this project.






F
igure 2.3: Interfaces of 2D Plots in JAT

The plot in JAT has the capability of printing the plot, resetting x and y ranges to their original values, setting the plot format, and resetting the plot to fit the data.

The visualization of attitude dynamics in three-dimensional space was done through Java 3D API provided by Sun, and AnimationWindow class created by Quock [Ref 22]. AnimationWindow is capable of reproducing the attitude time history with the input of quaternions during the simulation period. An example of animation is shown in Figure 2.4.

F
igure 2.4: 3D Animation produced by AnimationWindow class

Java 3D uses a data structure called ‘scene graph’ or ‘virtual universe’ as it is called in Java 3D terminology [Ref 8]. A scene graph diagram is a pictorial description of how the scene is to be rendered on the screen; in a way this seems analogous to the pseudo-code in generic programming.

In AnimationWindow, The satellite is represented using com.sun.j3d.utils.geometry.Box, which is available from the Java3D standard API.

Once an attitude simulation is run, and you have the quaternion values that describe the time history of satellite orientation stored in an array, it is quite easy to visualize the attitude motion using AnimationWindow.class. To construct AnimationWindow object, the following parameters have to be set:

title: (String) = title that goes in window title bar

ixxt: (float) = temp principal moment of inertia,

iyyt: (float) = temp principal moment of inertia

izzt: (float) = temp principal moment of inertia

pts: (int) = number of principal moment of inertia

tvars: (floar arrat) = array of values

symType; (String) = temp type of simulation

(e.g. “Gravity Gradient”)

Animation is controlled using Swing Timer (animControl) , which will fire ActionEvent at every time value specified as the ‘delayValue,’ and this updates the Canvas to produce animation. The scene graph diagram for AnimationWindow is shown below.

F
igure 2.5: Scene graph diagram for AnimationWindow

I
n this project, a new 3D animation routine was developed in order to visualize the flexible appendages on a spacecraft, which is shown in Figure 2.6.


Figure 2.6: 3D Visualization of a Spacecraft with Flexible Appendages


The 3D animation shown in Figure 2.6 was created by the class named AnimationWindow2.class, which is a modified version of AnimationWindow.class. The scene graph diagram of AnimationWindow2.class is shown in Figure 2.7.


F
igure 2.7: Scene Graph Diagram of AnimtionWIndow2.class


In Java 3D, the connection (or ‘joint’) between two object is represented by TransformGroup (TG). TransformGroup has its own representation of transformation with respect to the TransformGroup at the next higher level, to which it is connected. The transformation can be in the state of identity in which case there is no transformation between two TransformGroups. In Figure 2.7, the TransformGroup named ‘satlTrans’ has the transformation of the spacecraft with respect to a reference frame, and the TransformGroup named ‘Beam1TG’ and ‘Beam2TG’ have the transformation of the tip masses with respect to the coordinate frame fixed at the spacecraft.


Figure 2.8 shows the interface of the applet developed in this project.

F
igure 2.8: Interface of the Attitude Simulation Applet


The attitude simulation applet developed in this project has nine scenarios to choose from, and users are asked to pick one scenario from the list at the top. The item below the scenario list is the help file for the specific scenario. It describes the configuration of the spacecraft system simulated and explains what kind of input is required for the simulation. The next item is the scenario-specific input panel in which users are asked to enter moments of inertia of the spacecraft, constants needed for the scenario, and initial condition. The text fields below are for the simulation control; the first field controls the time-step for the numerical integration routine and the next field control the simulation time. It should be noted that, in the case of gravity-gradient scenario, time is in terms of number of orbits instead of seconds. For the output option, users can get 2D plots only, 3D animation only, or both by checking off the corresponding boxes. Simulation can be started by pushing the button that says “Start button” at the very bottom of the applet

The applet has an Euler angle converter that converts 3-2-1 Euler angle to corresponding quaternion values as an additional feature.

3 Developed Scenarios for a Rigid Spacecraft

3.1 Constant, Body-Fixed Torques

This scenario uses Euler’s rotational equations of motion to simulate the attitude dynamics of a rigid spacecraft with optional body-fixed, constant torques. Euler’s rotational equations of motion is found in most of the textbooks on spacecraft dynamics (See Ref 1,2,3,and 5), and is easily derived from the angular momentum equation:

(Eq. 3.1)

The resulting Euler’s rotational equations are:

(Eq. 3.2)

(Eq. 3.3)

(Eq. 3.4)

where the ’s are inertial angular velocities in body frame, the I’s are the principal moments of inertia, and the M’s are the body-fixed, constant torques. The overhead dot in the above equations denotes the time derivative of the variable. Eq. (3.2), (3.3), and (3.4) are three coupled, nonlinear ordinary differential equations and completely describe the dynamics of a rigid body. The other half of the equations that will completely furnish the description of the attitude motion of a spacecraft is the kinematical differential equations that describe the time-dependent relationship between two frames [Ref 1], which are given as:

(Eq. 3.5)

(Eq. 3.6)

(Eq. 3.7)

(Eq. 3.8)

where ’s are quaternions that define the transformation from inertial frame to body frame, which are preferred over Euler angles because of the lack of singularity in the set of kinematical differential equations Eq (3.5)-(3.8). In the simulation, Eq (3.2)-(3.8) are numerically integrated to get the time history of each variable.

T
he simulation interface is shown in Figure 3.1 below.

Figure 3.1: Applet Interface for Scenario 1

T
his scenario can be used to demonstrate the torque-free motion of a spinning axisymmetric rigid body, torque-free motion of asymmetric rigid body that is spinning about one of its principal axes, or a spinning axisymmetric body with constant body-fixed torques. With no presence of external torques and internal energy dissipation, an asymmetric rigid body has the characteristics that if the spin axis is either the major axis or minor axis, then the rotational motion is said to be stable [Ref 1]. If the spin axis is the intermediate axis, then the rotational motion is said to be unstable [Ref 1]. The next figure shows that a rigid asymmetric body spinning about its major axis is stable if a small impulsive disturbance torque is applied to the body.

Figure 3.2: Scenario 1 Simulation with




The next figure shows that a rigid, asymmetric body spinning about its minor axis is also stable if a small impulsive disturbance torque is applied to the body.

F
igure 3.3: Scenario 1 Simulation with


The next figure shows that a rigid, asymmetric body spinning about its intermediate axis is unstable if a small impulsive disturbance torque is applied to the body.






Figure 3.4: Scenario 1 Simulation with




3.2 Gravity Gradient in a Circular Orbit

Because of a finite dimension of a spacecraft, the body experiences a gradient of gravitational force; the stronger force is felt on the side of the spacecraft that is closer to the Earth, and the weakest force is felt on the side that is furthest from the Earth. Depending on the orientation of a spacecraft with respect to the Earth, the Gravity Gradient force may cause a spacecraft to go unstable over a period of time. This scenario intends to demonstrate the behavior of a Gravity-Gradient spacecraft.

The approximate gravity gradient torque acting on a spacecraft in an orbit is expressed as [Ref 1]:

(Eq. 3.9)

=

=

=

=

where n is the orbital rate defined as .

To construct the dynamic equations of motion about body-fixed principal axes with gravity gradient, the external moment terms in the Euler’s rotational equations of motion are substituted with the gravity gradient torque defined above.

The Gravity Gradient affects the spacecraft’s stability as it moves in an orbit, but the size of the gravity gradient torques is small and long simulations may be required to observe its effects. This makes simulating in terms of time in seconds undesirable because of the expensive computation time. In addition, simulation in terms of seconds is not convenient for eccentric orbits which will be discussed later. To avoid such a problem, the time has been taken out from the differential equations used in this scenario. To nondimensionalize the equation, the following parameter was used:

(Eq. 3.10)

is the angular velocity of a spacecraft going around in a circular orbit with the radius of r, and is the gravitational parameter defined as [Ref 2].

G is the gravitational constant, and in the case of artificial satellites, is nearly equal to Gm1 [Ref 2]. is constant for a spacecraft in a circular orbit with the radius being constant throughout the revolution, and it therefore can be used as the nondimensinalizing parameter. The following definition was used:

(i = 1,2, 3) (Eq. 3.11)

where has been nondimensionalized by .

Identities and definitions used in the nondimensionalizing process are:

(Eq. 3.12)

where is the angular velocity in the units of radians per second, and t is the time in seconds. It is noted that the unit of the left-hand side and the right-hand side of Eq (3.12) is radian.

(Eq. 3.13)

(Eq. 3.14)

(Eq. 3.15)

Rearranging the definition of time derivative as

(Eq. 3.16)

Putting Eq (3.15) into Eq (3.16),

(Eq. 3.17)

Eq (3.17) converts the derivative with respect to time into the derivative with respect to which is the number of orbits.

The dynamic equations Eq.(3.2-3.4) and the gravity-torque can be nondimentionalized using the relationships Eq (3.11)-(3.17):

(Eq. 3.18)

(Eq. 3.19)

(Eq. 3.20)

c11, c21, and c31 in the above equations can be written in terms of quaternions:

(Eq. 3.21)

(Eq. 3.22)

(Eq. 3.23)

The kinematical equations Eq. (3.5)-(3.8) are nondimensionalized as:

(Eq. 3.24)

(Eq. 3.25)

(Eq. 3.26)

(Eq. 3.27)

where q’s define the transformation from orbit frame (Local-Vertical-Local-Horizontal: LVLH) to body frame.

To simulate the attitude dynamics of a rigid spacecraft in a circular orbit, Eq. (3.18)-(3.20) and Eq. (3.24)-(3.27) were numerically integrated to get the time history of each variable. The applet interface for this scenario is shown in Figure 3.5.


F
igure 3.5: Applet Interface for Scenario 2


For this scenario, the reference frame is the orbit frame, not an inertial frame, which moves with the spacecraft in an orbit. It should be noted, the time is in terms of orbits instead of seconds for this scenario.





3.3 Gravity Gradient in an Eccentric Orbit

Incorporating eccentricity in the Gravity-Gradient dynamic and kinematical equations is done through redefining the nondimensionalizing scheme. In the case with a circular orbit, the nondimensionalizing parameter was , but cannot be used for the eccentric case because it is no longer a constant as a spacecraft revolves around an orbit with eccentricity. The parameter that was used in nondimensionalizing differential equations for the eccentric case is the orbital mean motion n [Ref 2]:

(Eq. 3.28)

where is the semi-major axis.

In order to nondimensionalize the equations, the following identities are used:

(Eq. 3.29)

(Eq 3.30)

where

(Eq. 3.31)

(Eq. 3.32)

The dynamic equations for this scenario that have been nondimensionalized are:

(Eq. 3.33)

(Eq. 3.34)

(Eq. 3.35)

The nondimensionalized kinematical equations are:

(Eq. 3.36)

(Eq. 3.37)

(Eq. 3.38)

(Eq. 3.39)

Eq. (3.33)-(3.39) were numerically integrated to get the time history of variables. The applet interface for this scenario is shown in Figure 3.6.



F
igure 3.6: Applet Interface for Scenario 3


Again, the time is in terms of number of orbits for this scenario.







3.4 Damping with Spherical Wheel Damper

Damping was added to a rigid spacecraft in the form of a spherical wheel damper with the viscous damping coefficient of c. The configuration of the system, which is a simplified model of a rigid body with internal energy dissipation [Ref 1], is shown in Figure 3.7.

F
igure 3.7: A rigid spacecraft with a spherical damper inside


The total angular momentum of the system is:

(Eq. 3.40)

where the moments of inertia used in calculating include both the inertia of spacecraft and that of the damper. is the angular momentum of the damper relative to the spacecraft.

The absolute angular momentum of the spherical damper is

(Eq. 3.41)

where ’s are the angular velocities of the spacecraft about the principal axes, and ’s are the relative velocities between the rigid body and the damper about the principal axes.

The relative angular momentum of the spherical damper is

(Eq. 3.42)

The total angular momentum of the system in the body frame is expressed as:

(Eq. 3.43)

where I’s are the spacecraft’s moments of inertia including the moments of inertia of the spherical damper.

Then the dynamic equations of the spacecraft system is

(Eq. 3.44)

where

(Eq. 3.45)

(Eq. 3.46)

= (Eq. 3.47)

(Eq. 3.48)

where M’s are external torques acting on the spacecraft.

Then Eq. (3.44) becomes

(Eq. 3.49)

Rearranging, Eq. (3.49) becomes

(Eq. 3.50)

The dynamic equations of the spherical damper is given as follows:

(Eq. 3.51)

where

(Eq. 3.52)

(Eq. 3.53)

(Eq. 3.54)

=

(Eq. 3.55)

where c is the viscous damping coefficient of the spherical damper.

Eq. (3.55) represents the reaction torque acting on the damper by the spacecraft.

Then Eq. (3.51) becomes:

(Eq. 3.56)

Rearranging Eq. (3.56),

(Eq. 3.57)

From Eq. (3.57), the dynamic equations for the spherical damper are written as:

(Eq. 3.58)

(Eq. 3. 59)

(Eq. 3.60)

By substituting Eq. (3.58-3.60) into Eq. (3.50), the dynamic equations for the spacecraft system becomes:

(Eq. 3.61)

(Eq. 3.62)

(Eq. 3.63)

I
n the simulation Eq. (3.58)-(3.60), Eq. (3.61)-(3.63) are numerically integrated together with the kinematical differential equations. The next figure shows the interface of the applet for this scenario.

Figure 3.8: Interface of Scenario 4



3.5 Reorientation Maneuver with Four Reaction Wheels

An attitude maneuver via momentum transfer based on the conservation of angular momentum was simulated. In this project, four reaction wheels in a pyramid configuration was used; this configuration provides redundancy such that if one wheel becomes unable to operate for some reason, the other three reaction wheels can provide control torque in all three directions. The pyramid configuration is illustrated in Figure 3.9.











Figure 3.9: Four Reaction Wheels in a Pyramid Configuration


The rotational axes of four wheels are inclined to 1-2 plane by an arbitrary angle, by which each reaction wheel contributes its control torque about the third axis. For an arbitrarily oriented reaction wheel, its momentum vector can be expressed in terms of body-reference basis vectors as illustrated in the following figure.







Figure 3.10: A reaction wheel in an arbitrary orientation

The simple illustration in Figure 3.10 reveals that the vector pointing in the direction of angular momentum of the reaction wheel can be expressed as:

(Eq. 3.64)

From Figure 3.9, the following relationships are found:

(Eq. 3.65)

(Eq. 3.66)

(Eq. 3.67)

(Eq. 3.68)

The control law used in this project was given by [Ref 3]

(Eq. 3.69)

(Eq. 3.70)

(Eq. 3.71)

(Note: From the way the control laws are written, the gains have to have negative signs)

In Eq. (6)-(8), K’s are the proportional gain and Kd’s are derivative gain calculated in the program so that the natural frequency and damping coefficient will be 1. qe’s are error quaternions defined as [Ref 3]

(Eq. 3.72)

In Eq. (9), qt’s are target quaternions that describe the commanded orientation and qs’s are the current quaternions that describe the current orientation of a spacecraft. Similar information is found on page 403 of Ref 1.

The total angular momentum of a rigid spacecraft and four reaction wheels inside is expressed as:

(Eq. 3.73)

where is the angular momentum of the spacecraft and reaction wheels, and the moments of inertia used to calculate include both the inertia of the spacecraft and that of the reaction wheels. is the angular momentum of the reaction wheel assembly relative to the spacecraft. Both quantities can be expressed as follows:

(Eq. 3.74)

where I’s are the principal moments of inertia of the spacecraft including the inertia of reaction wheels.

(Eq. 3.75)

where J’s are the moment of inertia of the reaction wheels, ’s are the angular speed of reaction wheels, and (, , , ) are the direction cosines, as indicated in Eq. (3.64), between the wheel spin axis and body axes. In this project, it was assumed that all wheels had the same inertia J, so Eq. (3.75) can be reduced to:

(Eq. 3.76)

For convenience later on in the calculation, following definitions will be used:

(Eq. 3.77)

(Eq. 3.78)

(Eq. 3.79)

The dynamic equations of motion for the system of a rigid spacecraft and four reaction wheels in a pyramid configuration as shown in Figure 3.9 are expressed in a vector form as:

(Eq. 3.80)

where

= (Eq. 3.81)

(Eq. 3.82)

(Eq. 3.83)

=

=


(Eq. 3.84)

Then Eq. (3.80) becomes:

(Eq. 3.85)



Rearranging Eq. (3.85),

(Eq. 3.86)

Solving Eq. (3.86) for ’s:

(Eq. 3.87)

(Eq. 3.88)

(Eq. 3.89)

The term shaded in gray in Eq. (3.87, 3.88, 3.89) can be considered as control torques generated by reaction wheels; that is,

(Eq. 3.90)

(Eq. 3.91)

(Eq. 3.92)

Eq. (3.90-3.92) can be solved for the commanded reaction wheel speed ’s in order to generate necessary control torques ’s that are calculated by the particular control law being employed. Eq. (3.90-3.92) can be put into matrix form so as to solve for ’s:

(Eq. 3.93)

Then

(Eq. 3.94)

where

and is the pseudo-inverse of defined as

(Eq. 3.95)

In this scenario, dynamic equations for a spacecraft Eq. (3.87 – 3.89), dynamic equations for a reaction wheel assembly Eq. (3.94), and kinematical equations Eq. (3.5- 3.8) were numerically integrated. The applet interface for this scenario is shown below.


F
igure 3.11: Applet Interface for Scenario 5

As indicated in Figure 3.11, users have the choice of selecting between four-reaction-wheel configuration or three-reaction-wheel configuration. The three reaction-wheel configuration is the four-wheels-in-a-pyramid configuration with one wheel being disabled.

The following figures shows the result for commanded 3-2-1 Euler angles of = 10 degrees, = 20 degrees, and = 60 degrees reorientation maneuver with no initial angular velocities.



Figure 3.12: Example of reorientation maneuver

Since during a reorientation maneuver, angular momentum is internally exchanged between a spacecraft and its reaction wheel assembly, angular momentum of the total system is conserved, and this is shown in the next figure.



Figure 3.13: Angular momentum during a reorientation maneuver with no initial angular velocities



3.6 Reorientation Maneuver with Three Control Moment Gyros

Control moment gyros (CMGs) are used when a spacecraft mission requires high control torque that reaction wheels are not able to generate. CMGs can provide 100-5000 Nm maximum torque while reaction wheels can only provide 1-2 Nm maximum torque [Ref 13]. The main difference between reaction wheels and CMGs is how they generate reaction torque. A reaction wheel generates torque about the rotor spin axis by spinning up and down, and its nominal spin rate is zero. Reaction wheels are often used to control three-axis stabilized spacecraft and small spacecrafts [Ref 1]. On the other hand, a CMG generates reaction torque by changing the direction of the constant angular momentum vector of a spinning rotor, which is done by changing the gimbal angle or applying torque on the gimbal axis. Because of its nominal large constant angular momentum, a CMG is capable of providing a large reaction torque with a small gimbal torque input. CMGs are often used for control of agile spacecraft and momentum management of large spacecraft [Ref 1]. The fundamental principle of how a CMG generates a reaction torque is well described on page 143 of Ref 2.

The two basic types of control moment gyros used for spacecraft control are: 1) single-gimbal control moment gyros (SGCMGs) and 2) double-gimbal control moment gyros (DGCMGs). Some of the CMG arrangements that have been developed in the past are: four SGCMGs of pyramid configuration, six parallel mounted SGCMGs, three orthogonally mounted DGCMGs, and four parallel mounted DGCMGs [Ref 1]. In this project, to simulate a reorientation maneuver of a rigid spacecraft using CMGs, a configuration of 3 single-gimbal control moment gyros aligned with the principal axis was used. Figure 3.14 shows one example of how three CMGs can be set up in a spacecraft with respect to the body frame.















Figure 3.14: Possible configuration of CMG Assembly using three CMGs

In Figure 3.14, ’s are gimbal angle of each CMG and ’s are angular momentum vector of CMGs. indicates that the axis is fixed while its angle can be changed by an electric motor.






W
hile a reaction wheel directly effects the spacecraft around the flywheel rotation axis, a CMG is rotated about the second axis (the flywheel rotation axis being the first axis), and produce a spacecraft rate about the third axis [Ref 2]. Figure 3.15 shows a CMG oriented in an arbitrary direction in a rigid spacecraft.

Figure 3.15: A CMG of Arbitrary Orientation inside a spacecraft

In Figure 3.15, is the spin axis of the CMG shown, and is its gimbal axis. is the constant spin rate that provides the CMG with a nominal angular momentum, and the spin rate is usually high. is the gimbal angle, and is the gimbal rate used to provide the spacecraft with the control torque from the CMG. For the configuration shown in Figure 3.13, the total angular momentum of the system is:

(Eq. 3.96)

=

In Eq. (3.96), I’s are the moments of inertia of the spacecraft including the inertia of the CMG. The moment of inertia is assumed to be:

(Eq. 3.97)

In Eq. (3.96), it should be noted that (gimbal axis) is fixed while (spin axis) changes as the gimbal rate is commanded to produce control torque.

In this project, three single-gimbal CMGs aligned with the principal axis were used as the actuators.

The first CMG has the gimbal axis aligned with the body-1 axis and has the following relative angular momentum:

(Eq. 3.98)

where is the gimbal rate of the first CMG, andis its constant spin rate.

In Eq (3.98), the gimbal axis and spin axis are expressed as:

Substituting the above definition into Eq. (3.98), the equation becomes:

(Eq. 3.99)

The angular momentum for the second and third CMG can be obtained following the similar processes.

(Eq. 3.100)

(Eq. 3.101)


Then the total angular momentum of the CMG assembly relative to the spacecraft is expressed in a matrix form as follows:

(Eq. 3.102)

For convenience later on in the calculation, the following definitions will be used:

(Eq. 3.103)

(Eq. 3.104)

(Eq. 3.105)

The dynamic equations of the spacecraft including the CMG assembly can be derived from the following governing equation:

(Eq. 3.106)

where

(Eq. 3.107)

(I’s are the moments of inertia of the spacecraft plus the inertia of CMG assembly.)

(Eq. 3.108)

(Eq. 3.109)


=

=

(Eq. 3.110)


Then Eq. (3.106) becomes:

(Eq. 3.111)

Rearranging Eq. (3.111),

(Eq. 3.112)

Eq. (3.112) can be solved for ’s as follows:

(Eq. 3.113)

(Eq. 3.114)

(Eq. 3.115)

The term shaded in gray in Eq. (3.113, 3.114, 3.115) can be considered as control torques generated by CMGs; that is,

(Eq. 3.116)

(Eq. 3.117)

(Eq. 3.118)

Eq. (3.116-3.118) can be solved for the commanded CMG gimbal rates ’s in order to generate necessary control torques ’s that are calculated by the particular control law being employed. Eq. (3.116-3.118) can be put into a matrix form so as to solve for’s:



=

(Eq. 3.119)

Then

(Eq. 3.120)

where

(Eq. 3.121)

(Eq. 3.122)

In Eq. (3.122), ’s were neglected because they were small and determined to be insignifiant.

In the simulation, the dynamic equations of motion of the spacecraft Eq. (3.113-3.115), the dynamic equations of motion of the CMG assembly Eq. (3.120), and the kinematical differential equations Eq. (3.5-3.8) were numerically integrated.

The following figure shows the interface of this scenario.

F
igure 3.16: Applet Interface for Scenario 6






3.7 One-Axis Bang-Bang Control Demonstration

A basic bang-bang control about single axis, which is good to simulate thruster control (having only on-off fixed-level thrust) was implemented in this scenario. First, the model of a linearized spacecraft dynamics with a proportional and derivative control was considered, which is shown in Figure 3.17.








Figure 3.17: Block diagram used for the simulation

The block diagram in Figure 2.7-1 can be further reduced to the diagram shown below.







Figure 3.18: Reduced Block diagram


Figure 3.18 can be reduced to the form of block diagram that describes the behavior of the spacecraft.




Figure 3.19: Final Transfer function

The denominator in the transfer function represents a second-order system, and the proportional and derivative gain can be chosen to get the desired natural frequency and damping coefficient. The simulation is for a demonstration purpose only, so the gains were selected such that the natural frequency and the damping coefficient were 1. In the simulation two kinds of control actuators were tested; the first one was a continuous actuator with no physical constraint, and the second actuator was a bang-bang actuator with a limited, fixed amount of torque. The differential equations used in the simulation are:

(Eq. 3.123)

(Eq. 3.124)

The control torque was calculated by the following control law:

(Eq. 3.125)

Kx and Kxd were calculated so as to get the natural frequency and the damping coefficient of 1 with no physical constraint.

For the bang-bang control scheme, the control algorithm used at each integration step is shown in the following figure.



Figure 3.20: Algorithm of Bang-Bang Control

In figure 3.20, dz denotes a dead zone below which no torque should be generated.

I
n figure 3.20, sign is the signum function that returns 1 if the element is grater than zero, 0 if it is equals zero, and –1 if it is less than zero. The interface for this scenario is shown in Figure 3.21.

Figure 3.21: Interface for Scenario 7

4 Developed Scenarios for a Flexible Spacecraft

4.1 Flexible Spacecraft in Two Dimensions

4.1.1 Derivation of Equations of Motion

A two-dimensional flexible spacecraft was modeled as a rigid central body with flexible appendages attached as illustrated below. Two concentrated masses are attached at the tip of the massless beams, one on each side of the rigid central spacecraft. The model used is illustrated in Figure 4.1 below.

F
igure 4.1: A Flexible Spacecraft in a Circular Orbit

In Figure 4.1, r is the radius of the spacecraft’s orbit, is the true anomaly of the spacecraft, is the angle between the spacecraft body frame and the orbit frame in the 1-2 plane (The spacecraft is constrained to move only in the 1-2 plane in this model.), u1 and u2 are the deflections of the tip masses measured from the b1 axis, L is the length of each beam that is attached to the central rigid body, a is the distance from the center of mass of the rigid body to the attachment point of the beam, EI is the flexural rigidity of each beam, and me, ms/c, m1, m2 are the mass of Earth, spacecraft, tip-mass on the right side of spacecraft, tip-mass on the left side of spacecraft, respectively.

Equations of motion for this system were derived by the Lagrange’s equation.

First of all, kinetic energy of the whole system illustrated above is

(Eq 4.1)


where Ts/c = Kinetic energy of the spacecraft

Tm = Kinetic energy of the masses


(Eq. 4.2)

(Eq. 4.3)


and can be calculated as follows.

First of all,

(Eq. 4.4)

So by chain rule,

(Eq. 4.5)

Derivatives of unit basis vectors are calculated as

(Eq. 4.6)

(Eq. 4.7)

Then becomes

(Eq. 4.8)

=

=

So ,which is a scalar value, becomes (Eq. 4.9)

is calculated following similar steps.

(Eq. 4.10)

(Eq. 4.11)

=

=

=

(Eq. 4.12)

The term is calculated with the fact that

(Eq. 4.13)

(Eq. 4.14)

(Eq. 4.15)

(Eq. 4.16)

So,

(Eq. 4.17)

With the preceding preliminary calculations, the kinetic energy of the whole system is

(Eq. 4.18)

Using the Lagrange’s method, equations of motion about each generalized coordinate is obtained with this total kinetic energy and respective generalized force about each coordinate. Generalized coordinates in this case are:

{ r, , , u1, u2}

Generalized forces about each coordinate in the order of the above listing is

(Eq. 4.19)

where G is the gravitational constant

(Eq. 4.20)

where is the environmental torque and is the control torque.

(Eq. 4.21)

(Eq. 4.22)

(Eq. 4.23)

The generalized forces and come from the deflection of the tip of the cantilever attached to the rigid central body as illustrated in the following figure. (Note: the cantilever itself is considered massless; the mass is concentrated only at the tip.)








Figure 4.2: Flexible element modeling

The deflection of a point in the cantilever is given by the following formula [Ref 23].

(Eq. 4.24)

where y = vertical deflection

P = applied load at the tip of the cantilever

x = horizontal distance measured from the beam attachment location

EI = constant flexural rigidity of each beam

At the tip of the beam, x=L, so the deflection becomes

(Eq. 4.25)

To formulate Lagrange’s equations, force in terms of coordinates (deflection) is desired, so solving the previous equation for the applied load P in terms of the tip deflection y,

(Eq. 4.26)

From this, it follows that

(Eq. 4.27)

and

(Eq. 4.28)

If Eq. (4.28) is correct, it must be the derivative of potential energy, .

The potential energy of the cantilever beam due to the deflection caused by the applied load in the previous illustration is given by

(Eq. 4.29)

With the derived value of applied load in terms of tip deflection,

(Eq. 4.30)

=

Force is the derivative of potential energy, so the following relationship must hold.

(Eq. 4.31)

which is in fact the case.


Then the equations of motion about each generalized coordinate can be obtained by setting up the following equations.

(Eq. 4.32)

(Eq. 4.33)

(Eq. 4.34)

(Eq. 4.35)

(Eq. 4.36)

In the model considered in which the spacecraft’s orbit is circular, r and are constant, so only 6 state variables were considered instead of 10 state variables. These 6 state variables are

Carrying out the operations in Eq (4.33), (4.35), and(4.36), the following equations results:

+

(Eq. 4.37)

(Eq. 4.38)


(Eq. 4.39)

In order to perform the numerical integration, Eq.(4.37),(4.38), and(4.39) have been simultaneously solved for the second derivative of , u1 and u2. Please see the appendix for the exact equations used in the simulation.


4.1.2 Linear Analysis

There are several ways to proceed with a linear analysis for a non-linear system. One way is to employ the small perturbation method in which small perturbation about an equilibrium point is assumed and higher order terms are discarded in the state equations, resulting in the linearized state equations about the equilibrium point. This method may work for a relatively simple system, but when the system becomes complicated and the equations become complex, even solving for a set of first-order differential equations may be a daunting task, in which case other methods might be employed. One could also directly linearize the second-order differential equations derived from the Lanrange’s method by ignoring the nonlinear terms and proceeding with the Laplace transform to get the characteristic equation for the system. This method is attractive because a set of second-order differential equations may be more manageable than the corresponding set of first-order differential equations. Another way is to use energy as a means to get the characteristic equation, and this is also an attractive method for a complex system. In this project, all aforementioned methods were employed and an identical system matrix and characteristic equation were obtained. In this paper, only the linearization of second –order differential equation and subsequent Laplace transformation will be described.

Transfer functions relating the input torque (control torque) to desired output were obtained directly from the second-order nonlinear equations of motion derived by the Lagrange’s method by ignoring the nonlinear terms [Ref 6].

In the previous section, equation was derived as:

+

(Eq. 4.37 Repeated)

By ignoring nonlinear terms, the equation reduces to:

(Eq 4.40)

u1 equation has been derived as:

(Eq. 4.38 Repeated)

By ignoring nonlinear terms,

(Eq 4.41)

u2 equation has been derived as:

(Eq. 4.39 Repeated)

By ignoring nonlinear terms,

(Eq. 4.42)

Equation (4.40), (4.41), and (4.42) can be put into a matrix form as follows:

(Eq 4.43)

The above form can be recognized as the form:

[Ref 6] (Eq. 4.44)

where M = mass matrix (inertia matrix)

C = damping matrix

K = stiffness matrix

= n-dimensional configuration vector, whose elements are the generalized coordinates

= generalized force vector associated with

It can be seen that in Eq(4.43), damping matrix C is absent.

The differential matrix equation is linear, and its Laplace transform can be taken [Ref 3]

(Eq. 4.45)

(Eq. 4.46)

This can be solved for the vector by employing Cramer’s rule or a computer algebra system such as Maple.

The system matrix as seen in Eq. (4.46) is:

(Eq. 4.47)

The characteristic equation is the determinant of this matrix.

(Eq. 4.48)

In an attempt to use reasonable parameters for the numerical simulation, following values were used, which were taken from [Ref 14]

J = 13.35 (kgm2)

a= 0.40 (m)

L = 1.80 (m)

EI = 15.52 (Nm2)

The tip mass was chosen to be 1kg.

With these parameters, the characteristic equation becomes

(Eq. 4.49)

The roots of this equation are

From this, the frequencies that can be seen in the numerical simulation are

2.826 rad/sec

3.711 rad/sec

The natural frequencies of the system above are interpreted to mean that there are two vibration modes in the system. The first mode has the frequency of 2.826 radians/second and the period of 2.223 seconds indicating the oscillation in this mode completes one cycle in 2.223 seconds. The second mode has the frequency of 3.711 radians/second and the period of 1.693 second. These frequencies were confirmed by numerical simulation.

Figure 4.3: Position plot for anti-symmetric initial condition

Figure 4.4: Position plot for symmetric initial condition

From the above figures, it was determined that the frequency of 3.771 radians/second was for the anti-symmetric mode, and the frequency of 2.826 seconds was for the symmetric mode.


4.1.3 Confirmation of the Accuracy of the Model

The reliable method to confirm the accuracy of the mathematical model of a system is to check its consistency with the law of conservation of energy and angular momentum. That is, the total energy of a closed system must remain constant and the total angular momentum of the system with no external torque applied must also remain constant. To carry out this process of confirming the accuracy of the model, the total energy and angular momentum were calculated first.

The total energy of any system is

(Eq. 4.50)

where E = total energy

T = kinetic energy

V = potential energy

For the two-dimensional flexible spacecraft considered in this project,

(Eq. 4.51)

=

+

(Eq. 4.52)

So,

E = + + (Eq. 4.53)

That the energy E was constant during the numerical simulation was confirmed with the fallowing parameters and initial condition.

J = 13.35 ()

a= 0.40 (m)

L = 1.80 (m)

EI = 15.52 ()

m= 1 (kg)

The simulation result for the above parameters and initial condition is shown below.

Figure 4.5: Total energy of the system with no energy-dissipating elements

The above figure implies that the mathematical model was accurate in terms of the energy point of view.


Simulation with the same parameters and different initial condition was also performed.

J = 13.35 ()

a= 0.40 (m)

L = 1.80 (m)

EI = 15.52 ()

m= 1 (kg)

Figure 4.6: Total energy of the system with no energy-dissipating elements

Figure 4.6 also confirms that the mathematical model is consistent with the law of conservation of energy.


The total angular momentum of the system was also checked. The angular momentum of the system was calculated referring to the model illustrated below.



Figure 4.7: Model of a flexible spacecraft system

The total angular momentum is the sum of the angular momentum of each massive element in the system: the central rigid spacecraft and the two masses at the beam tips.

(Eq. 4.54)

(Eq. 4.55)

By definition [Ref 1],

(Eq. 4.56)

=

where because the reference frame and the body frame are coincided at the origin

Also, the position vector of the mass is, as seen in the previous illustration, the following form, which is subsequently expressed in the reference frame.

(Eq. 4.57)

=

=

The time derivative of with respect to the reference frame was taken in terms of the body frame frame, which was then expressed in the reference frame as follows.

For an arbitrary vector [Ref 1],

(Eq. 4.58)

So for ,

(Eq. 4.59)

=

(Note: ==0)

=

=

= =

+

Then,

(Eq. 4.60)

Similarly for ,

(Eq. 4.61)

=

where

(Eq. 4.62)

=

=

The time derivative of is

(Eq. 4.63)

=

=

=

=

=

+

Then,

(Eq. 4.64)



Therefore the total angular momentum of the system is

(Eq. 4.65)

=

+

+

With no external torque applied on the system, the total angular momentum should be constant, which is indicated in the following equation [Ref 1].

(Eq. 4.66)

The system angular momentum was checked for symmetric, anti-symmetric, and non-symmetric cases.

Symmetric case:

Figure 4.8: Total angular momentum for a symmetric initial condition

The above figure shows that the total angular momentum is constant (plot in the fourth row). Since the initial condition is symmetric, the figure also shows that the angular momentum of the rigid central body stays zero .









Anti-symmetric case:

Figure 4.9: Total angular momentum for an anti-symmetric initial condition

The above figure shows that the angular momentum of the system is zero and is constant. Also the figure shows that the angular momentum of the spacecraft fluctuates since the initial condition is anti-symmetric.









Non-symmetric case:

Figure 4.10: Angular momentum plot for non-symmetric initial condition


The above figure shows that the system angular momentum for a non-symmetric initial condition also stays at zero throughout the simulation period.









4.1.4 Simulation Implementation

The equations of motion for a flexible spacecraft in two dimensions were implemented in the Attitude Simulation applet. Its interface is shown in Figure 4.11.


Figure 4.11: Applet Interface of Flexible Spacecraft in 2D Simulation


Outputs from MATLAB and the applet for the position and angular momentum are shown side-by-side in figures that follow. The outputs were obtained for symmetric, anti-symmetric, and non-symmetric initial conditions.



Figure 4.12: Position Plot for a symmetric initial condition



Figure 4.13: Angular Momentum Plot for a symmetric initial condition



Figure 4.14: Position Plot for an anti-symmetric initial condition



Figure 4.15: Angular Momentum Plot for an anti-symmetric condition



Figure 4.16: Position Plot for a non-symmetric initial condition



Figure 4.17: Angular Momentum Plot for a non-symmetric initial condition


4.2 Flexible Spacecraft in Three Dimensions

4.2.1 Derivation of Equations of Motion

To model a three-dimensional flexible spacecraft, the same model as for the two-dimensional model was used.













Figure 4.18: Flexible spacecraft model

The concentrated masses were constrained to only move in the 1-2 plane, but the body frame was allowed to orient freely with the reference frame. Therefore, in the two dimensional case, the angular velocity vector was , but in a three dimensional case, the angular velocity vector is.

Compared to the previously considered two-dimensional model, the derivation process was quite similar except that the three dimensional case had two more degrees of freedom. Again Lagrange’s method was used to obtain the equations of motion.

The system potential energy comes from the deflection of beam cantilevered at the rigid spacecraft due to the displacements of the masses attached at the tips.

(Eq. 4.67)

Kinetic energy is

(Eq. 4.68)

where

=

and

=

=

With these preliminary calculations, the system kinetic energy becomes

(Eq. 4.69)

The Lagrangian is then

(Eq. 4.70)

=

+

+

With this Lagrangian, the standard form of Lagrange’s equation was used to derive the equations of motion of the system. The standard form of Lagrange’s equation is defined as [Ref 7] :

(i = 1,2,…, n) (Eq. 4.71)

where = those generalized forces not derivable from a potential function

Examples of typical such forces are frictional forces, time-variant forcing functions, and nonhohlonomic constraint forces.

In the case considered in this project, the generalized forces, not derivable from a potential function, are not present, so the right-hand side of the equation is zero.

Generalized coordinates qi are:

, , and are Euler angles, which define a sequenced simple rotation to locate the orientation of a rigid body with respect to a reference frame. The sequence of Euler angle rotation used in this project was 3-2-1 (or ). For reference, transformation matrix in terms of 3-2-1 Euler angles and kinematical differential equations in terms of 3-2-1 Euler angles are summarized below.

To be consistent with notations commonly used in published materials on spacecraft dynamics, Euler angles were defined as follows:

The transformation matrix for 3-2-1 Euler angle rotation can be obtained by multiplying transformation matrix of each successive simple rotation [Ref 3].

(Eq. 4.72)

where

(Eq. 4.73)

(Eq. 4.74)

(Eq. 4.75)

[Ref 3] (Eq. 4.76)

The reference to 321 Euler angle rotation can be found in [Ref 1,2,and 3].

Also for 3-2-1 Euler angle rotation,

(Eq. 4.77)

[Ref 3] (Eq. 4.78)





In a matrix form [Ref 1],

(Eq. 4.79)

(Eq. 4.80)

The Lagrange’s equations of motion are:

(Eq. 4.81)

(Eq. 4.82)

(Eq. 4.83)

(Eq. 4.84)

(Eq. 4.85)




4.2.2 Linear Analysis

The second order differential equations of motion were linearized by ignoring nonlinear terms [Ref 5], and replacing trigonometric functions with their small-angle assumptions. In order to get the small-angle assumption of sine and cosine, truncated Taylor series was utilized.

For a function f(x), truncated Taylor series about a point is

(Eq. 4.86)

Ignoring the second-order or higher-order terms,

(Eq. 4.87)

=

Using the above formula, the truncated Taylor series of about is

(Eq. 4.88)

where

(Eq. 4.89)

Similar process was carried out to determine the small-angle assumption of sine function.

(Eq. 4.90)

where

(Eq. 4.91)

The set of second-order equations was linearized using Eq (4.89) and Eq (4.91), and was put in a matrix form as follows. See the appendix for the detailed process of linearization.

+ = (Eq. 4.92)

The values of T1, T2, T3, T4, and T5 are arbitrary here.

In order to get the characteristic equation of the system, the Laplace transform of the left-hand-side was taken.

(Eq, 4.93)

(Eq. 4.94)

The determinant of the above matrix gives the characteristic equation of the system and determines the natural frequencies of the system.

(Eq. 4.95)


If the same parameters were put in the equation as in the two dimensional case, the same frequency values should be obtained. This should be true since the state variables and are decoupled as seen in the system matrix.

The set of parameters for that condition is:

EI = 15.52 (Nm2)

a = 0.4 (m)

L = 1.8 (m)

Ixx = 45.42 (kgm)

Iyy = 35.42 (kgm)

Izz = 13.35 (kgm)

m = 1 (kg)

The characteristic roots are:

These are the same as the roots for the two dimensional model:

This result increased the confidence that the three-dimensional model derived as descried in this paper was accurate.

The characteristic roots indicate that there are two modes that have the following frequencies and periods:

Mode1: 2.826 rad/sec (frequency), 2.223 sec (period)

Mode2: 3.711 rad/sec (frequency), 1.693 sec (period)










Simulation with the following initial condition was performed:

Figure 4.19: Numerical Simulation for a symmetric initial condition

To confirm the other mode, simulation was performed with the following initial condition:

Figure 4.20: Numerical Simulation for an anti-symmetric condition

In the above figure, the period of 1.693 seconds is confirmed.



4.2.3 Confirmation of the Accuracy of the Model

For a torque-free motion of a rigid body with no internal energy dissipation and no external torques, the system energy and angular momentum should be constant. The energy of the three-dimensional flexible spacecraft being modeled is calculated as follows.

The system potential energy comes from the tip mass deflections.

(Eq. 4.96)

Kinetic energy is

(Eq. 4.97)

So the total energy that is conserved during the numerical simulation is

(Eq. 4.98)








To confirm the conservation of system energy, numerical simulations were performed with the two different initial conditions. which are shown in Figure 4.21 and 4.22. Both figure show that the output is consistent with the law of conservation of energy.

Figure 4.21: System Total Energy for anti-symmetric initial condition


Figure 4.22: System Energy for symmetric initial condition


In order to calculate the angular momentum, the following notation will be used.

For an arbitrary vector, ,

expressed in basis vectors

expressed in basis vectors

time derivative of with respect to [a] frame expressed in [b] frame


time derivative of with respect to [a] frame expressed in [b]

frame

The system total angular momentum is given by

(Eq. 4. 99)

where ()

=

(Noteis the transpose of the transformation matrix, which would perform the t ransformation from body frame to reference frame.)

(Eq. 4.100)

where

For convenience, the following definition was used:

,

,

Then the angular momentum calculation in a matrix format becomes

(Eq. 4.101)

Similarly for the second mass,

(Eq. 4.102)

where

For convenience, define:

,

,

(Eq. 4.103)


The total angular momentum of the system expressed in a reference frame is

(Eq. 4.104)

= +

+

The following calculations describes the detail of Eq(4.104).

For an arbitrary vector [Ref 1],

So for ,

=

(Note: ==0)

=

=

The time derivative of () is

=

=

=

In other words,

Above equations can be expressed in the reference frame by using the transformation matrix. Since there is no external torque acting on the system, the total angular momentum of the system should be constant.

Figure 4.3 shows that the angular momentum is constant for the following initial condition.

Figure 4.23: Angular momentum of the system for anti-symmetric initial condition


Figure 4.24 shows the result of numerical simulation with the following initial condition, which shows that the angular momentum remained constant.

Figure 4.24: Angular momentum of the system for symmetric initial condition


4.2.4 Simulation Implementation

The equations of motion derived in this section were implemented in the applet, and its interface is shown below.

. F
igure 4.25: Interface of Flexible Spacecraft in 3D Simulation


Outputs from MATLAB and the applet for the position and angular momentum are shown side-by-side in figures that follow. The outputs were obtained for symmetric, anti-symmetric, and non-symmetric initial conditions.



Figure 4.26: Tip-mass Position and Velocity Plot for a symmetric initial condition



Figure 4.27: Spacecraft Euler Angle Plot for a symmetric initial condition



Figure 4.28: Angular Momentum Plot for a symmetric initial condition



Figure 4.29: Tip-mass Position and Velocity Plot for an anti-symmetric initial condition



Figure 4.30: Spacecraft Euler Angle Plot for an anti-symmetric condition



Figure 4.31: Angular Momentum Plot for an anti-symmetric condition




Figure 4.32: Tip-mass Position and Velocity Plot for a non-symmetric condition



Figure 4.33: Spacecraft Euler Angle Plot for a non-symmetric condition



Figure 4.34: Angular Momentum Plot for a non-symmetric condition












5 Implementation on a Website

The attitude simulation applet developed in this project has been deployed on a website managed by the Cal Poly Advanced Technology Lab (ATL), which is shown in Figure 5.1.

F
igure 5.1: The Applet on the World Wide Web







The file structure in the server for the deployment of the applet is shown below.

Figure 5.2: Server file structure


In the third tier, external_jar file contains the external packages to be loaded with the applet in a jar compressed format, jat file contains the AttitudeSimulator.class with the jat package structure preserved, and jat_jar file contains the jat packages in a jar compressed format to be loaded with the applet itself.


6 Conclusions and Future Work

The first objective of adding more scenarios to the attitude simulation applet and deploying it on a Website was achieved, and a new task of developing the attitude package in JAT was initiated in this project. In the future, more options may be added to the applet such as changing the number of reaction wheels/CMGs, selecting different reaction wheels/CMGs configuration, providing different control scheme, and selecting different external torque environment. All these are reasonably feasible because the Java programming language is object-oriented in nature, and adding new features to the existing code should be relatively easy. Once the applet is fully operational on a Web site, an instructor may use it in the classroom to demonstrate the principle of spacecraft attitude dynamics to students.



REFERENCES

1. Wie, Bong, Spacecraft Vehicle Dynamics and Control, AIAA Education Series, VA, 1998

2. Wiesel, William E., Spaceflight Dynamics, Irwin McGraw-Hill, 1997

3. Sidi, Marcel J., Spacecraft Dynamics & Control—A Practical Enginering Approach, Cambridge University Press, 1997

4. Kane, Thomas R., Likins, Peter W., and Levinson, David A., Spacecraft Dynamics, McGraw-Hill, Inc. 1983

5. Meirovitch, Leonard, Methods of Analytical Dynamics, McGraw-Hill Book Company, 1970

6. Meirovitch, Leonard, Computational Methods in Structural Dynamics, Sijthoff & Noordhoff, 1980

7. Greenwood, T. Donald, Principles of Dynamics—second edition, Prentice-Hall, Inc., 1988

8. Walsh E., Aaran, and Gehringer, Doug, JAVA 3D API Jump-Start, Prentice-Hall Inc., 2002

9. Java 3D Tutorial Ch.0-Ch.7

10. Cadenhead, Rogers., Sams Teach Yourself Java 2 in 24 Hours, Second Edition, Sams Publishing, 2001

11. Flanagan, David., Java in a Nutshell, fourth Edition, O’Reilly & Associates Inc., 2002

12. Bishop., Judith M., and Bishop ., Nigel T., Java Gently for Engineers and Scientists, Pearson Education Limited 2000.


13. Wie, Bong., and Bailey, David, Rapid “Multitarget Acquisition and Pointing Control of Agile Spacecraft”, Journal of Guidance, Control, and Dynamics, Vol. 25, No.1, January-February 2002

14. Ge. T. H. Lee and F. Hong, Variable Structure Maneuvering Control of a Flexible Spacecraft, Proceeding of the American Control Conference Arlington, VA June 25-27, 2001

15. The Open Source Definition, http://www.samurajdata.se/opensource/mirror/docs/definition.html, Open Source Initiative (OSI), Aug 9, 2003

16. Basic Introduction to CVS and SourceForge.net (SF.net) Project CVS Services, http://sourceforge.net/docman/display_doc.php?docid=14033&group_id=1, Open Source Development Network, 2003

17 What is SourceForge.net?, http://sourceforge.net/docman/display_doc.php?docid=6025&group_id=1, Open Source Development Network, 2003

18 Java 3D API Home Page, http://java.sun.com/products/java-media/3D/, Sun Microsystems, Inc., 2003

19 eclipse.org, http://www.eclipse.org/, 2003

20 Cvs Gui, http://www.wincvs.org/, 2003

21 Java Astrodynamics Toolkit (JAT), http://jat.sourceforge.net/, The JAT Project, 2003

22. Quock, Daniel L., Web-Based Tools for Spacecraft Attitude Dynamics and Control Simulation, A Thesis Presented to the Faculyty of California Polytechnic State University, August 2001

23 Beer,Ferdinand and Johnston, Russell, Mechanics of Materials—2nd edition, McGraw-Hill, Inc.



Appendices

1. Equations of Motion for the Flexible Spacecraft (2D case)

2. Linearization of Equations of Motion (3D case)

3. Java code

3.1 jat.attitude

3.1.1 DegToQuat.java

3.1.2 QuatToDeg.java

3.2 jat.attitude.eom

3.2.1 RConstantTorque.java

3.2.2 RGGCircularOrbit.java

3.2.3 RsphericalDamper.java

3.2.4 FourRWManeuver.java

3.2.5 CMGManeuver.java

3.2.6 BangBangTwoD.java

3.2.7 FlexibleTwoD.java

3.2.8 FlexibleThreeD.java

3.2.9 EomTest.java

3.3 jat.attitude.util

3.3.1 AnimationWindow.java

3.3.2 AnimationWindow2.java

3.3.3 JTextFieldPanel.java

3.3.4 TextFieldPanel.java

3.4 jat.attitde.thesis

3.4.1 AttitudeSimulatorA.java


Appendix 1 2D Flexible Spacecraft Equations of Motion

Appendix 2 Linearization of Equations of Motion (3D)

Previously the 2nd order equations of motion were derived directly from Lagrangian function as:

(Eq. 4.92)

(Eq. 4.93)

(Eq. 3.2.2-9)


(Eq. 3.2.2-10)

(Eq. 3.2.2-11)


By substituting in these equations the following values:

(Eq. 3.2.2-12)

(Eq. 3.2.2-13)


(Eq. 3.2.2-14)


(Eq. 3.2.2-15)

(Eq. 3.2.2-16)


To further simplify the hand calculation, equations were further simplified with the following substitution and side relations.

,





The simplified equations are

(Eq. 3.2.2-17)


(Eq. 3.2.2-18)

(Eq. 3.2.2-19)


(Eq. 3.2.2-20)


(Eq. 3.2.3-21)