attitude determination method in eclipse for qsat (version 2)

42
19 September 2007 1 Attitude Determination Method in Eclipse for QSAT (Version 2) Tomohiro Narumi Space Systems Dynamics Laboratory, Kyushu University 744 Motooka, Nishi-ku, Fukuoka, 819-0395, Japan [email protected]

Upload: others

Post on 03-Feb-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

1

Attitude Determination Method in Eclipse for QSAT

(Version 2)

Tomohiro Narumi

Space Systems Dynamics Laboratory, Kyushu University

744 Motooka, Nishi-ku, Fukuoka, 819-0395, Japan

[email protected]

Page 2: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

2

Contents

1. Introduction……………………………………………………………………….4

2. Coordinate Systems………………………………………………………………5

2.1 Geocentric Equatorial Coordinate System, IJK………………………………..5

2.2 Orbit Coordinate System……………………………………………………….5

2.3 Body Frame…………………………………………………………………….6

2.4 Relation of Quaternions and Tait-Bryan Angles……………………………….7

3. Attitude Determination Method ……….………………………………………..8

3.1 Concept…………………………………………………………………………8

3.2 Construction of the Kalman Filter……………………………………………..8

3.3 Sequence of the Estimation…………………………………………………...12

4. Simulation…………..……………………………………………………………13

4.1 Simulator………………………………………………………………………13

4.2 Results…………………………………………………………………………14

5. Discussion, Conclusion and Future Works…………………………………….18

5.1 Discussion……………………………………………………………………..18

5.2 Conclusion…………………………………………………………………….18

5.3 Future Works………………………………………………………………….18

Appendix A. Calculus of Quaternions…………………………………………..19

A.1 Definition…………………………………………………………………...…19

A.2 Notation………………………………………………………………………..20

A.3 Direction Cosine Matrix………………………………………………………..20

A.4 Multiplication…………………………………………………………………..20

A.5 Coordinate transformation matrix using quaternion……………………………22

Appendix B. Kinematic Equation of Quaternion………………………………22

B.1 General Equation……………………………………………………………….22

B.2 Kinematic Equation for Multiplication of Quaternion………………………….23

B.3 Kinematic Equation for Small Quaternion…………………………………..…24

Page 3: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

3

Appendix C. Observability………………………………………………………26

C.1 Linear System…………………………………………………………………..26

C.2 Nonlinear System……………………………………………………………….26

Appendix D. Discretization of the System………………………………………28

D.1 Discrete-Time Case……………………………………………………………..29

D.2 Discretization of Covariance Matrices………………………………………….30

Appendix E. Geomagnetic Field………………………………………………...33

E.1 Geomagnetic Flux………………………………………………………………33

E.2 Recursive Calculation of Legendre Function…………………………………..34

Appendix F. External Torques and Noise Generation…………………………36

F.1 Gravity Gradient Torques……………………………………………………….36

F.2 Solar Radiation Torques………………………………………………………...37

F.3 Atmospheric Drag Torques……………………………………………………..37

F.4 Magnetic Torques……………………………………………………………….37

F.5 Sensor Outputs………………………………………………………………….38

Bibliography………………………………………………….………………………41

Page 4: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

4

1. Introduction

In northern Kyushu-island in Japan, a small satellite for observing polar plasma environment and

geomagnetic field named QSAT has been being developed. To achieve the mission, the satellite has

to control the attitude, and the requirement of the error is about 5 degrees. QSAT has three types of

sensors, two 3-axis Sun sensors, 3-axis magnetometer, and 3-axis rate gyros. In sunlight, the

satellite can determine the attitude using three kinds of sensors. However the Sun sensors do not

work when the satellite is in eclipse naturally. Accordingly, attitude determination algorithms using

only magnetometer and rate gyros have to be developed. To achieve it, the Extend Kalman Filter

which can estimate the state variables including attitude is introduced. In order to circumvent

problems of singular matrix, some techniques are adopted. In this paper, construction and

performance of the EKF and the some results are described.

Page 5: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

5

2. Coordinate Systems

We mainly use three frames, inertial frame (geocentric equatorial coordinate system), orbit frame

(orbit coordinate system), and body frame. One axis of orbit frame is oriented to radial coordinate,

and another axis points in the direction of the velocity vector and is perpendicular to the radius

vector. Quaternion (Euler-parameters) and Tait-Bryan angles (Euler angles) are defined as

transformation of axes from orbit frame to body frame.

2.1 Geocentric Equatorial Coordinate System, IJK

This system has its origin at the center of Earth. The fundamental plane is the Earth’s equator, as

shown in Fig. 2.1. The I axis points towards the vernal equinox; the K axis extends through the north

pole; the J axis is defined as IKJ ˆˆˆ ×= .

2.2 Orbit Coordinate System

The R axis always points from the Earth’s center along the radius vector toward the spaced object

as it moves in its orbit. The W axis is normal to the orbital plane. The S axis is defined as the cross

product between the W axis and R axis. The S axis is usually not aligned the direction of the velocity

except for the perigee and apogee. Fig. 2.2 shows the geometry of this coordinate system.

J

I

Earth

Equatorial Plane

K

Fig. 2.1 Geocentric Equatorial Coordinate System, IJK

Page 6: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

6

2.3 Body Frame

The frame is fixed to the satellite body as shown in the Fig. 2.3.

x axis: The normal direction to the plane which the Sun sensor unit I is attached.

y axis: The normal direction to the plane which the Sun sensor unit II is attached.

z axis: The negative direction to the direction of the boom extending.

Fig. 2.2 Orbit Coordinate System, RSW

Ω i

Satellite

Vernal

Equinox

I

AN: Ascending Node

R S

W

J

K

u

ˆ x

ˆ y

ˆ z

Fig. 2.3 Definition of Body frame of QSAT

Sun sensor unit I

Sun sensor unit II

Page 7: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

7

2.4 Relation of Quaternions and Tait-Bryan Angles

The direction cosine matrix (DCM) of quaternions is [1]

2 2

1 4 1 2 3 4 1 3 2 4

2 2

1 2 3 4 2 4 2 3 1 4

2 2

1 3 2 4 2 3 1 4 3 4

2( ) 1 2( ) 2( )

2( ) 2( ) 1 2( )

2( ) 2( ) 2( ) 1

q q q q q q q q q q

q q q q q q q q q q

q q q q q q q q q q

+ − + −

− + − + + − + −

(2.1)

and DCM of 3-2-1 Tait-Bryan angles (Euler angles) [φ, θ, ψ] (yaw, roll, pitch) is

cos cos cos sin sin

sin sin cos cos sin sin sin sin cos cos sin cos

cos sin cos sin sin cos sin sin sin cos cos cos

θ ψ θ ψ θ

φ θ ψ φ ψ φ θ ψ φ ψ φ θ

φ θ ψ φ ψ φ θ ψ φ ψ φ θ

− − + + −

(2.2)

NOTE! : The Tait-Bryan angles rotation [φ, θ, ψφ, θ, ψφ, θ, ψφ, θ, ψ] is defined by successive rotations by angles

φ, θ,φ, θ,φ, θ,φ, θ, and ψ,ψ,ψ,ψ, respectively, about coordinate axes x, y, z. because 3-2-1 rotation.

Comparing the DCMs,

( )( )

2 2

2 3 1 4 3 4

1 3 2 4

2 2

1 2 3 4 1 4

arctan 2 2( ),2( ) 1

arcsin 2( )

arctan 2(2( ),2( ) 1)

q q q q q q

q q q q

q q q q q q

φ

θ

ψ

= + + −

= − −

= + + −

(2.3)

where, arctan2(y,x) is the function that calculates the arctangent of the two variables x and y in C or

FORTRAN languages. It is similar to calculating the arc tangent of y/x, except that the signs of both

arguments are used to determine the quadrant of the result.

And,

1

2

3

4

sin cos cos cos sin sin2 2 2 2 2 2

cos sin cos sin cos sin2 2 2 2 2 2

cos cos sin sin2 2 2 2

q

q

q

q

φ θ ψ φ θ ψ

φ θ ψ φ θ ψ

φ θ ψ φ

+

=

sin cos2 2

cos cos cos sin sin sin2 2 2 2 2 2

θ ψ

φ θ ψ φ θ ψ

+

(2.4)

Page 8: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

8

3. Attitude Determination Method

3.1 Construction of the State Model

QSAT has three types of sensors, two 3-axis Sun sensors, 3-axis magnetometer, and 3-axis rate

gyros. However the Sun sensors do not work when the satellite is in eclipse. Accordingly attitude

determination algorithms using only magnetometer and rate gyros have to be developed.

The quaternions which express the attitude of the satellite are defined as the coordinate

transformation from the reference orbital frame to the body frame. The innovation of the quaternion

is calculated as follows

2 2

1 4 1 2 3 4 1 3 2 4

2 2

1 2 3 4 2 4 2 3 1 4

2 2

1 3 2 4 2 3 1 4 3 4

( ) ( )

2( ) 1 2( ) 2( )

2( ) 2( ) 1 2( )

2( ) 2( ) 2( ) 1

m m o

m o

x x

m o

y y

m o

z z

m o

x x

m o

y y

m o

z z

m m

m mq q q q q q q q q q

m mq q q q q q q q q q

s sq q q q q q q q q q

s s

s s

= − = −

+ − + −

= − − + − + + − + −

y y h q y A q y

(3.1)

where ym is the measured sun vector [sx

m, sy

m, sz

m]

T and magnetic field vector [mx

m, my

m, mz

m]

T, y

o is

the reference sun vector [sxo, sy

o, sz

o]

T and magnetic field vector [mx

o, my

o, mz

o]

T, A is the direction

cosine matrix from the orbit frame to the body frame, and q is the estimated quaternion from the

reference orbit frame to the body frame. This innovation is used as the measurement with the outputs

of the rate gyros in the measurement equation.

ref

∆ = −ω g ω (3.2)

where g is the outputs from the rate gyros, ωωωωref is the angular rates of the orbit frame relative to the

inertial frame (see Appendix B).

3.2 Construction of the State Model

The state variable is preferred to choose the quaternion because of its simple expression of the

state equation and the direction cosine matrix which do not use any transcendental functions

compared to the expression of the Euler angles. The state equation of the Kalman filtering consists

of kinematic equation and dynamic equation, and the accuracy of the attitude estimation depends

on the precision of the state model. However it is very difficult because there are many

unpredictable disturbances. For example, environmental external forces, internal forces, flexible

structure, or mobile objects. Fortunately QSAT has the 3-axis rate gyros. Therefore the satellite can

obtain its motion without consideration of any disturbance. Substituting the kinematic equation

Page 9: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

9

using the outputs of the rate gyros for dynamic equation, it becomes the independent state equation

of the equation of motion. However the rate gyros have biases because of temperature and so on.

Therefore it is estimated simultaneously as the state variables.

If you use the quaternion, there is a problem that its norm is one and they are not independent.

Hence the error covariance matrix of the quaternion has singularity. Lefferts et al.[2]

suggest three

algorithms to circumvent the singularity. First method is to degenerate the error covariance matrix

from 7x7 to 6x6 when you propagate it. Second method is to delete one of quaternions. And third

method is to estimate small quaternions because one of the small quaternions is almost 1. The third

method is the most suitable for QSAT because it is earth-oriented satellite.

Therefore the state variables are small values of quaternion and biases of the rate gyros. The state

equation becomes (Appendix B)

v∆

= ∆

qx

b (3.3)

= +x Fx Gvɺ (3.4)

1k t t t+ = +x Φ x Γv (3.5)

2

10 0 0

2

10 0 0

2

10 0 0

2

0 0 0 0 0 0

0 0 0 0 0 0

0 0 0 0 0 0

z y

z x

x

ω ω

ω ω

ω ω

= −

F (3.6)

3 3

3 3

1

2

− =

I 0G

0 I

(3.7)

1exp[ ]t tt −= ∆Φ F Φ (3.8)

0exp[ ( )]

t

t t dτ τ = − ∫Γ F G (3.9)

where F is the system matrix, u is the input vector, v is the system noise in continuous system. ΦΦΦΦt, ut,

and vt are the discretized matrix or vectors. ∆qv is small quaternion vector except for q4 (defined in

Appendix B), and ∆b is the bias vector of the rate gyros.

The measurement matrix H is introduced as follows because the measurement equation is not

linear. The extended Kalman Filter (EKF) has to be adopted.

Page 10: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

10

2 2 3 1 1 4 1 4

2 4 1 2 3 2 4

3 4 3 4 1 2 3

2 2 3 1 1 4

( )

2 2 4 2 2 2 2 0 0 0

2 2 2 4 2 2 2 0 0 0

2 2 2 2 2 2 4 0 0 0

2 2 4 2 2 2

t

o o o o o o o

y x y z z y

o o o o o o o

x z x y z z x

o o o o o o o

x y y x x y z

o o o o o

y x y z z

m q m q m q m q m q m q m q

m q m q m q m q m q m q m q

m q m q m q m q m q m q m q

s q s q s q s q s q s

∂ = ∂

+ + − +

+ + + −

− + + +=

+ + −

h qH

x

1 4

2 4 1 2 3 2 4

3 4 3 4 1 2 3

2 0 0 0

2 2 2 4 2 2 2 0 0 0

2 2 2 2 2 2 4 0 0 0

o o

y

o o o o o o o

x z x y z z x

o o o o o o o

x y y x x y z

q s q

s q s q s q s q s q s q s q

s q s q s q s q s q s q s q

+ + + + −

− + + +

(3.10)

( )1

T

t t t t t t t

= +K P H H P H R (3.11)

ˆt t t t t= −P P K H P (3.12)

,

ˆ

ˆ

v t

t t

t

∆ =

qK y

b (3.13)

,

,

ˆˆ

ˆ1

v t

t t

v t

∆ =

− ∆

qq q

q (3.14)

ˆ ˆt t t

= + ∆b b b (3.15)

ˆˆt t t

= −ω g b (3.16)

where the superscript (^) means the estimate, the superscript (

-) means the a-priori value, K is the

Kalman gain, Qt , Pt and Rt are covariance matrices defined in Appendix D.

Update equations become as follows.

t t t t t+ = +P Φ PΦ Q (3.17)

t t t+ =x Φ x (3.18)

and according to Appendix D, Qt becomes

2 3

0

TT T

t t t c t t t t td t t tτ ′ ′′ ′′′= = ∆ + ∆ + ∆∫Q Φ B Q B Φ Q Q Q (3.19)

where,

Page 11: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

11

1

2

3

4

5

6

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

c

n

n

n

n

n

n

=

Q (3.20)

1

2

3

4

5

6

0 0 0 0 04

0 0 0 0 04

0 0 0 0 04

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

t

n

n

n

n

n

n

′ =

Q (3.21)

4

2 1 3 1 3 2

5

2 1 3 3 2 1

6

3 1 2 3 2 3

4

5

6

1 10 ( ) ( ) 0 0

8 8 4

1 1( ) 0 ( ) 0 0

8 8 4

1 1( ) ( ) 0 0 0

8 8 4

0 0 0 0 04

0 0 0 0 04

0 0 0 0 04

t

nn n n n

nn n n n

nn n n n

n

n

n

ω ω

ω ω

ω ω

− −

− − − −

′′ =

Q

(3.22)

2 2

4 3 2 3 2

2 2

3 5 3 1 1

2 2

2 1 6 2 1

1 1 1( ) 0 0 0

12 12 12

1 1 1( ) 0 0 0

12 12 12

1 1 1( ) 0 0 0

12 12 12

0 0 0 0 0 0

0 0 0 0 0 0

0 0 0 0 0 0

y z x y x z

x y x z y z

x z y z x y

n n n n n

n n n n n

n n n n n

ω ω ω ω ω ω

ω ω ω ω ω ω

ω ω ω ω ω ω

+ + − −

− + + −

′′′ = − − + +

Q

(3.23)

Page 12: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

12

3.3 Sequence of the Estimation

Measurement

( )m= −y y h q

( )1

T

t t t t t t t

= +K P H H P H R

ˆt t t t t= −P P K H P

ˆ

v t

t t

t

∆ =

qK y

b

,

,

ˆˆ

ˆ1

v t

t t

v t

∆ =

− ∆

qq q

q

ˆ ˆt t t= + ∆b b b

ˆˆt t t= −ω g b

Update

t t t t t+ = +P Φ PΦ Q

t t t+ =x Φ x

Page 13: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

13

4. Simulation

4.1 Simulator

The attitude simulator for QSAT is build using Microsoft Visual C++. The simulator can calculate

orbit, attitude, perturbing torques, effect of actuator, power consumption, and can also product sensor

outputs. The reason why C++ was chosen is that the computation time is short and it is easy to build

encapsulated components using object oriented programming.

Lining up the kinematic and dynamic equations, the equation of motion is as follows,

2 3 41

1 3 42

1 2 43

1 2 34

( ) / 2

( ) / 2

( ) / 2

( ) / 2

( ( ) ) /

( ( ) ) /

( ( ) ) /

z y x

z x y

y x z

x y z

x y z y z xx

y z x z x yy

z x y x y zz

q q qq

q q qq

q q qqd

q q qqdt

I I I

I I I

I I I

ω ω ω

ω ω ω

ω ω ω

ω ω ω

τ ω ωω

τ ω ωω

τ ω ωω

− + − + + − +

− − −= + −

+ − + −

(4.1)

where, ωx, ωy, and ωz are angular rate about the respective axes in body frame. Ix, Iy, and Iz are

moment of inertia. τx, τy, and τz are the sum of torques by the actuators (magnetic torquers), gravity

gradient, solar radiation pressure, atmospheric drag.

The specification of the simulator is as follows.

Table 5.1 Specification of the Simulator

Object Method

Numerical Integrator

Orbit Propagator

Sun vector

Geomagnetic Field

Atmospheric Density

Random Number Generator

Dormand-Prince, 8th

-order

SGP8

VSOP87

IGRF Model, 10th

-order

NRLMSISE-00

L’Ecuyer & Box-Muller Method

SGP: Simplified General Perturbations

VSOP: Variations Seculaires des Orbites Planetaires

IGRF: International Geomagnetic Reference Field

MSISE: Mass Spectrometer, Incoherent Scatter Radar Extended Model

Page 14: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

14

4.2 Results

I investigated above-mentioned method under following condition (Table 5.1). Kalman gain is

always calculated per sampling rate. In eclipse, the outputs of sun sensors are set to zero because

they do not work.

Table 5.1 Test Case

Orbit Ideal Circular Orbit

Attitude Perturbation Gravity Gradient Only

Initial Euler Angles (Yaw, Roll, Pitch) [deg] (3.0, 5.0, 10.0) in Orbit Frame

Initial Angular Rates (ωx, ωy, ωz) [deg/sec] (0.0, 0.0, 0.0)

Moment of Inertia (Ix, Iy, Iz) [kgm2] (0.6205, 1.178, 1.178)

Sensor Noise Nothing

Orbit Determination Error Nothing

Page 15: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

15

0 20 40 60 80 100-10

-5

0

5

10

15

Time [min]

Pitch

[deg]

Attitude Estimation (EKF)

True

Estimation

Figure 4.1 Estimated Pitch Angle

0 20 40 60 80 100-2

-1

0

1

2

3

4

5

6

Time [min]

Pitch

[deg]

Attitude Estimation (EKF)

Error

Figure 4.2 Error of Pitch Angle

Eclipse

Eclipse

Page 16: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

16

0 20 40 60 80 100

-5

0

5

10

15

20

Time [min]

Roll [deg]

Attitude Estimation (EKF)

True

Estimation

Figure 4.3 Estimated Roll Angle

0 20 40 60 80 100-5

0

5

10

15

20

Time [min]

Roll [deg]

Attitude Estimation (EKF)

Error

Figure 4.4 Error of Roll Angle

Eclipse

Eclipse

Page 17: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

17

0 20 40 60 80 100-2

-1

0

1

2

3

4

5

6

Time [min]

Yaw [deg]

Attitude Estimation (EKF)

True

Estimation

Figure 4.5 Estimated Yaw Angle

0 20 40 60 80 100-1

-0.5

0

0.5

1

1.5

2

2.5

Time [min]

Yaw [deg]

Attitude Estimation (EKF)

Error

Figure 4.6 Error of Yaw Angle

Eclipse

Eclipse

Page 18: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

18

5. Discussion, Conclusion and Future Works

5.1 Discussion

Fig. 4.1-4.6 show the result of the attitude determination method. The errors of pitch angle and

roll angle are small, but the error of yaw angle becomes about 2 degrees although the noise and

position error are 0. If filter tuning (like noise covariance) is more appropriate, the performance of

the Kalman filter will be probably better. Nevertheless, the error angles are smaller than the

requirement from the mission instruments (5 deg.).

5.2 Conclusion

The attitude determination algorithm which can be used in eclipse was constructed and

investigated, and this method which estimates the small quaternion seems to be good for

determining the attitude angles.

5.3 Future Works

Adding noises, bias and quantization error of the sensors.

Adding position error including the effect of delay time.

Speeding up the algorithms in C++ language.

Page 19: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

19

Appendix A. Calculus of Quaternion

Quaternion expresses a transformation of orthogonal coordinates using four parameters, and is

very useful to deal with kinematics of satellites. Quaternion is also called Euler parameters,

q-parameters, or Euler symmetric parameters. The definition, notation, transformation matrix, and

multiplication of quaternions are shown in this section.

A.1 Definition

Quaternion q is defined as follows.

1 1

2 2

3 3

4

sin( / 2)

sin( / 2)

sin( / 2)

cos( / 2)

q e

q e

q e

q

Φ Φ ≡ ≡ Φ

Φ

q (A.1)

where 1 2 3[ ]Te e e=e is the unit vector in the reference frame called Euler axis, Φ is the

rotation angle about Euler axis. Since the norm of Euler axis is 1, following equation is derived.

2 2 2 2

1 2 3 4 1q q q q+ + + = (A.2)

The components of Euler axis in the two frames (before and after the rotation) are same.

Accordingly vector e is the eigenvector of the coordinate transformation matrix (direction cosine

matrix) expressed by q. The inverse or conjugate of q is defined as the rotation which the angle is

–Φ and the axis is e, and is expressed by *q .

A.2 Notation

Quaternion vector is defined to express as follows.

1

2

3 4

4

v

q

q

q q

q

≡ ≡

qq (A.3)

Meanwhile, in the case of expressing the quaternion as the hyperimaginary number, it is written as

follows.

1 2 3 4q q q q≡ + + +q i j k (A.4)

where i, j, and k are units of hyperimaginary number requiring following conditions.

2 2 2 1+ + = − = − = = − = = − =i j k ij ji k jk kj i ki ik j (A.5)

Page 20: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

20

Besides, *q is also expressed as follows.

*

1 2 3 4q q q q= − − − +q i j k (A.6)

A.3 Direction Cosine Matrix

The direction cosine matrix (DCM) using e and Φ is expressed as follows.

2

1 1 2 3 1 3 2

2

1 2 3 2 2 3 1

2

1 3 2 2 3 1 3

cos (1 cos ) (1 cos ) sin (1 cos ) sin

(1 cos ) sin cos (1 cos ) (1 cos ) sin

(1 cos ) sin (1 cos ) sin cos (1 cos )

e e e e e e e

e e e e e e e

e e e e e e e

Φ + − Φ − Φ + Φ − Φ − Φ

= − Φ − Φ Φ + − Φ − Φ + Φ − Φ + Φ − Φ − Φ Φ + − Φ

T

(A.7)

Substituting Eq. (A.1), DCM expressed by q becomes

2 2 2 2

1 2 3 4 1 2 3 4 1 3 2 4

2 2 2 2

1 2 3 4 1 2 3 4 2 3 1 4

2 2 2 2

1 3 2 4 2 3 1 4 1 2 3 4

2( ) 2( )

( ) 2( ) 2( )

2( ) 2( )

q q q q q q q q q q q q

q q q q q q q q q q q q

q q q q q q q q q q q q

− − + + −

= − − + − + + + − − − + +

T q (A.8)

The relation between inverse and the conjugate are following.

1 *( ) ( )− =T q T q (A.9)

T(q) has the orthogonality as follows.

1( ) ( ) ( ) ( ) , ( ) ( )T T T−= = =T q T q T q T q I T q T q (A.10)

A.4 Multiplication

Multiplication of a quaternion as a operator is introduced here. Calculation of a quaternion and a

vector can be also defined if you use the hyperimaginary expression. The definitions can simplify

calculations, which become easier than vector expression.

Multiplication of quaternions is defined as follows.

1 2 3 4 1 2 3 4

1 4 2 3 3 2 4 1

1 3 2 4 3 1 4 2

1 2 2 1 3 4 4 3

1 1 2 2 3 3 4 4

( )( )

( )

( )

( )

( )

a b a a a a b b b b

a b a b a b a b

a b a b a b a b

a b a b a b a b

a b a b a b a b

q q q q q q q q

q q q q q q q q

q q q q q q q q

q q q q q q q q

q q q q q q q q

= + + + + + +

= + − +

+ − + + +

+ − + +

+ − − − +

q q i j k i j k

i

i

i

(A.11)

Therefore, multiplication of quaternion q and its conjugate *q becomes

* * 1= =qq q q (A.12)

This means that absolute value of the quaternion is 1.

If you use the vector expression, it becomes

Page 21: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

21

2 1 1

3 4 1 2 2

2 1 4 3 3

1 2 3 4 4

2 1 1

3 4 1 2 2

2 1 4 3 3

1 2 3 4 4

( )

( )

b b b b a

b b b b a

a b b b a

b b b b a

b b b b a

a b a a b

a a a a b

a a b

a a a a b

a a a a b

q q q q q

q q q q q

q q q q q

q q q q q

q q q q q

q q q q q

q q q q q

q q q q q

− − = = − − − −

− − = = − − − −

4 3

4 3

q q M q q

M q q

(A.13)

The above equations are also expressed by

4 3 3

4

4 3 3

4

( )( )

( )( )

v v

a T

v

v v

b T

v

q

q

q

q

×

×

+ ≡ −

− + ≡ −

γ q I qM q

q

γ q I qM q

q

(A.14)

where ( )vγ q is the matrix defined as follows

3 2

3 1

2 1

0

( ) 0 ( )

0

v v

q q

q q

q q

− ≡ − = × −

γ q q (A.15)

This means the cross-product operator of the vector. Therefore, the following relation is found for a

arbitrary vector v.

( )v v= ×γ q v v q (A.16)

The relation of the multiplied conjugate quaternions is as follows.

* * *( )a b b a=q q q q (A.17)

The hyperimaginary expression of a vector in the Euclidean space is defined as

1 2 3u u u≡ + +u i j k (A.18)

Multiplication of a quaternion and a vector is calculated as follows.

Page 22: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

22

3 2 2 3 1 4 3 1 1 3 2 4

2 1 1 2 3 4 1 1 2 2 3 3

3 2 1 1

3 1 2 2

2 1 3 3

1 2 3 4

4 3 2

3 4 1

2 1 4

1 2 3

( ) ( )

( ) ( )

0

0( )

0

0

( )

u q u q u q u q u q u q

u q u q u q u q u q u q

u u u q

u u u q

u u u q

u u u q

q q q

q q q

q q q

q q q

= − + + − + +

+ − + + − − −

− − = ≡ − − − −

− − = ≡−− − −

qu i j

k

Ω u q

Ξ q u

1

2

3

u

u

u

(A.19)

where

4 3 3

( )( )

0

( )( )

T

v

T

v

q ×

≡ −

− + ≡ −

γ u uΩ u

u

γ q IΞ q

q

(A.20)

A.5 Coordinate transformation matrix using quaternion

The coordinate transformation matrix expressed by q is given in Eq. (A.8). Another expression

using vq and 4q becomes

2

4 3 3 4( ) ( ) 2 2 ( )T T

v v v v vq q×= − + +T q q q I q q γ q (A.21)

And the following equation is derived using Eq. (13) and Eq. (21).

3 1*

1 3

( )( ) ( )

1b a

×

×

=

T q 0M q M q

0 (A.22)

Besides, transformation ( )′ =u T q u can be also expressed as follows.

3 1

1 3

( )

10 0

×

×

′ =

T q 0u u

0 (A.23)

Accordingly, ′u can be expressed by

* *( ) ( ) ( )b a b

′ = = =u M q M q u M q uq q uq (A.24)

Namely, a coordinate transformation using a quaternion is written as above simply.

Besides, according to Eq. (A.24), following equations are derived when a b=q q q .

* ( ) ( ) , ( ) ( ) ( )b a a b b a a b b a

′ = = =u q q uq q T q T q u T q q T q T q (A.25)

Page 23: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

23

Appendix B. Kinematic Equation of Quaternion

In this section, the kinematic equation expressed by quaternion is introduced. Firstly we derive the

most general equation as the result of differentiation of quaternion. Finally, we derive the kinematic

equation of variables which is divided into reference and small quaternion in order to apply to

Kalman filtering.

B.1 General Equation

Consider q(t) that expresses an attitude in a reference frame at time t, and variation of quaternion

∆q(t) from the time t to t+∆t. The reference frame of ∆q(t) is the frame of q(t). Then the attitude in

the reference frame at the time ∆t becomes,

4 3 2 1

3 4 1 2

2 1 4 3

1 2 3 4

( ) ( ) ( ) ( ( )) ( ) ( )a

q q q q

q q q qt t t t t t t

q q q q

q q q q

∆ ∆ −∆ ∆ −∆ ∆ ∆ ∆ + ∆ = ∆ = ∆ = ∆ −∆ ∆ ∆ −∆ −∆ −∆ ∆

q q q M q q q (B.1)

Then, the derivative of quaternion at time t is derived as follows using angular rate

1 2 3( ) [ ]Tt ω ω ω=ω in the satellite’s body frame.

0 0

3 2 1

3 1 2

2 1 3

1 2 3

( ( )) ( ) ( )( ) ( )( ) lim lim

0

01( )

02

0

1( ( )) ( )

2

1( ) ( )

2

a

t t

t t tt t tt

t t

t

t t

t t

ω ω ω

ω ω ω

ω ω ω

ω ω ω

∆ → ∆ →

∆ −+ ∆ −= =

∆ ∆

− − = − − − −

= Ω

=

M q q qq qq

q

ω q

q ω

ɺ

(B.2)

B.2 Kinematic Equation for Multiplication of Quaternion

The kinematic equation which expresses continuous two coordinate transformations is derived

here. This equation expressed by quaternion is nonlinear in the case of setting the angular rates as the

state variables. This is the reason why extended Kalman filter is applied to attitude calculation

generally. Here, a quaternion q is divided into a reference value refq and a small value ∆q, and the

kinematic equation is derived.

Firstly, quaternion q is expressed as follows.

Page 24: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

24

ref= ∆q q q (B.3)

where ∆q is based on the frame of refq which expresses the satellite attitude. The kinematic

equation of the reference quaternion refq becomes following from Eq. (B.2)

1

2ref ref ref

=q q ωɺ (B.4)

Therefore,

* * * *1 1

2 2ref ref ref ref ref

= = −q ω q ω qɺ (B.5)

where, refω is the angular velocity vector in the reference frame, and is expressed in

hyperimaginary number.

B.3 Kinematic Equation for Small Quaternion

∆q is derived from Eq. (B.3),

*

ref∆ =q q q (B.6)

and differentiate Eq. (B.6) and substitute Eq. (B.5),

* *

* *1 1

2 2

1 1

2 2

ref ref

ref ref ref

ref

∆ = +

= − +

= − ∆ + ∆

q q q q q

ω q q q qω

ω q qω

ɺ ɺ ɺ

(B.7)

where,

ref= + ∆ω ω ω (B.8)

and substitute Eq. (B.8) into Eq. (B.7), following equation are derived.

( )

( )

( )

4 3 3 4 3 3

1 1 1

2 2 2

( ) ( )1 1 1

2 2 2

( ) 1

0 2

( ) 1

0 2

ref ref

v v

ref refT T

v v

v

ref

ref v

ref

q × ×

∆ = − ∆ + ∆ + ∆ ∆

∆ + ∆ − ∆ + ∆ = − + + ∆ ∆ − −

− ∆ = + ∆ ∆

− ∆ = + ∆ ∆

q ω q qω q ω

γ q I γ q q Iω ω Ξ q ω

q q

γ qω Ξ q ω

γ ω qω Ξ q ω

ɺ

(B.9)

However, ω is expressed in the frame of q, and refω is in the frame of

refq actually. That is,

Page 25: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

25

*

ref= ∆ ∆ + ∆ω q ω q ω (B.10)

where ∆ωωωω is the difference vector between the angular rate vector in the frame of q and the reference

frame. Substituting Eq. (B.10) into (B.7),

*1 1 1

2 2 2

1

2

ref ref∆ = − ∆ + ∆ ∆ ∆ + ∆ ∆

= ∆ ∆

q ω q q q ω q q ω

q ω

ɺ

(B.11)

This means the kinematic equation is independent of the other frame. However actual angular rate

vector is measured in body frame. Therefore ωωωω and ωωωωref should be dealt as the variables in body

frame, and Eq. (B.9) is appropriate for satellites’ attitude determination. That is

( )

( )

( ) 1

0 2

1

0 2

ref v

ref

ref v

ref

− ∆ ∆ = + ∆ ∆

− × ∆ = + ∆ ∆

γ ω qq ω Ξ q ω

ω qω Ξ q ω

ɺ

(B.12)

if ∆q is small value,

1

2v∆ ≈ ∆q θ (B.13)

where ∆θθθθ is small Euler angle (Tait-Bryan angle) vector corresponding to the small quaternion ∆q.

Substituting this into Eq. (B.12), ∆θθθθ becomes

ref∆ = − × ∆ + ∆θ ω θ ωɺ (B.14)

Page 26: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

26

Appendix C. Observability

When you use the Kalman filter, you need to confirm the observability of the system equations. If

there is no observability, it is impossible to estimate the state variables logically, and is also

definitely impossible to apply the Kalman filter. Firstly, the most general determination method for a

linear system is introduced in this section. Secondly, the method for a nonlinear system is introduced.

You can confirm the observability of your system using these methods.

C.1 Linear System

As a linear system, following continuous system is introduced.

( ) ( ) ( )

( )

t t t

t

= +

=

x Ax Bu

y Cx (C.1)

where ( ) , ( )n mt t∈ ℜ ∈ ℜx y . The necessary and sufficient condition of observability is that the

rank of following equation is n. That is,

2

1n

rank n

=

C

CA

CA

CA

(C.2)

If this equation is n, the system is observable as long as matrices A and B are constant.

C.2 Nonlinear System

As a nonlinear system, following system is introduced.

( )

( )

( ) ( ), ( )

( ) ( )

t t t

t t

=

=

X f X u

Y h X

ɺ

(C.3)

where ( ) , ( )n mt t∈ ℜ ∈ ℜX Y . The necessary and sufficient condition of observability is that

the rank of following equation is n. That is,

Page 27: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

27

( )

( )

( )

( )

(0)

(1)

(2)

( )

h

h

h

i

h

L

L

rank nL

L

∂ ∂

∂ ∂

=∂ ∂ ∂ ∂

fX

fX

fX

fX

(C.4)

where ( )i

hL f is called Lie derivative, and is defined as follows.

( )

( )

( )

(0)

(1) (0)

(2) (1)

( ) ( 1)

( ( ))h

h h

h h

i i

h h

L t

L L

L L

L L−

=

∂=

∂=

∂=

f h X

f f fX

f f fX

f f fX

(C.5)

Page 28: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

28

Appendix D. Discretization of the System[7]

A linear time-invariant m-input p-output N-dimensional continuous-time system can be

represented by the state model

( ) ( ) ( )t t t= +x Ax Bw (D.1)

( ) ( )t t=y Cx (D.2)

where Eq. (D.1) is the state eqution and Eq. (D.2) is the output equation. A is the N x N system

matrix, B is the N x m input matrix, C is the p x N output matrix, w(t) is the m-dimensional input

vector, x(t) is the N-dimensional state vector, and y(t) is the p-dimensional output vector. If the

system has a single output so that p=1, we shall sometimes use lower case “c” for the output matrix,

in which case Eq. (A.2) becomes ( ) ( )y t cx t= .

The complete solution to the state equation Eq. (A.1) staring with initial state x(t0) at initial time t0

is

[ ] [ ]0

0 0 0( ) exp ( ) ( ) exp ( ) ( ) ,t

tt t t t t d t tτ τ τ= − + − >∫x A x A Bw (D.3)

The system is said to be asymptotically stable if the system state x(t) converges to 0 as t → ∞ for

any initial state x(t0) at any initial time t0 and with w(t)=0 for all t>t0. It follows from Eq. (D.3) that

the system is asymptotically stable if and only if all the eigenvalues of A have real parts that are

strictly less than zero (i.e., the eigenvalues of A lie in the open left half plane).

Using Eq. (A.2) and Eq. (A.3), we have that the complete output response of the system is given

by

[ ] [ ]0

0 0 0( ) exp ( ) ( ) exp ( ) ( ) ,t

tt t t t t d t tτ τ τ= − + − >∫y C A x C A Bw (D.4)

If the initial state x(t0) is zero and the initial time t0 is taken to be −∞ , Eq. (D.4) reduces to the

input/output representation

( ) ( ) ( )t

t t dτ τ τ−∞

= −∫y H w (D.5)

where H(t) is the p x m impulse response function matrix given by

0, 0

( )exp[ ], 0

tt

t t

<=

≥H

C A (D.6)

Taking the Laplace transform of both sides of Eq. (D.5) results in the tranfrer function representation

( ) ( ) ( )s s s=Y H W (D.7)

where H(s) is the transfer function matrix equal to the transform of H(t). The Laplace transform of

the matrix exponential exp[At], 0t ≥ is equal to 1( )s −−I A where I is the N x N identity matrix.

Thus, from Eq. (D.6) it is seen that the transfer function matrix H(s) is given by

1( ) ( )s s −= −H C I A B (D.8)

Page 29: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

29

D.1 Discrete-Time Case

We can generate a discrete-time state model by discretizing the continuous-time state model. To

accomplish this, let T be the sampling interval, and set t0=nT and t=nT+T in Eq. (D.3), where n is

the discrete-time index. This yields

[ ] [ ]( ) exp ( ) exp ( )nT T

nTnT T T nT nT T dτ τ τ

+

+ = + + −∫x A Bw (D.9)

Note that exp[At] can be determined by inverse transforming 1( )s −−I A and setting t=T in the

result. If w(τ) is approximately constant over each interval nT nT Tτ≤ ≤ + , then

( ) ( )nTτ ≈w w for nT nT Tτ≤ ≤ + , and Eq. (D.9) can be rewritten as

[ ] [ ]( ) exp ( ) exp ( ) ( )nT T

nTnT T T nT nT T d nTτ τ

+ + = + + − ∫x A x A B w (D.10)

Defining

[ ]exp ( )nT T

nTnT T dτ τ

+

= + −∫Γ A B (D.11)

via a change of variables it follows that ΓΓΓΓ can be expressed in the form

[ ]0

expT

dτ τ= ∫Γ A B (D.12)

Finally, defining exp[ ]T=Φ A , from Eq. (D.10) we obtain the following discrete-time output

equation:

( ) ( ) ( )nT T nT nT+ = +x Φ Γw (D.13)

and setting t=nT in both sides of Eq. (D.2), we obtain the following discrete-time output equation:

( ) ( )nT nT=y Cx (D.14)

We shall drop the notation “T” for the sampling interval in Eq. (D.13) and Eq. (D.14), in which case

the general form of the linear time-invariant finite-dimensional state model is

( 1) ( ) ( )n n n+ = +x Φx Γw (D.15)

( ) ( )n n=y Cx (D.16)

In some cases of interest, the output y(n) at time n may depend on the input w(n) at time n, in which

case Eq. (D.16) becomes

( ) ( ) ( )n n n= +y Cx Dw (D.17)

where D is a p x p matrix, called the direct-feed matrix.

The complete solution to the state equation Eq. (D.15) starting with initial state x(n0) at initial time

n0 is

0

0

11

0 0( ) ( ) ( ),n

n n n i

i n

n n n n n−

− − −

=

= + >∑x Φ x Φ Γw (D.18)

The system is said to be asymptotically stable if x(n) converges to 0 as n → ∞ for any initial state

at any initial time and with w(n)=0 for all 0n n≥ . It follows from Eq. (D.18) that the system is

Page 30: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

30

asymptotically stable if and only if all the eigenvalues of ΦΦΦΦ have magnitudes that are strictly less

than one (i.e., all eigenvalues of ΦΦΦΦ lie within the unit circle of the complex plane).

Using Eq. (D.17) and Eq. (D.18) we have that the complete output response is

0

0

11

0 0( ) ( ) ( ) ( ),n

n n n i

i n

n n n n n n−

− − −

=

= + + >∑y CΦ x CΦ Γw Dw (D.19)

If the initial state x(n0) is zero and the initial time n0 is taken to be −∞ , Eq. (D.19) reduces to the

input/output representation

( ) ( ) ( )n

i

n n i w i=−∞

= −∑y H (D.20)

where H(n) is the p x m unit-pulse response function matrix given by

0, 0

( ) , 0

1n

n

n n

n

<

= = ≥

H D

CA B

(D.21)

Taking the z-transform of both sides of Eq. (D.21) results in the transfer function representation

( ) ( ) ( )z z z=Y H W (D.22)

The z-transform of An, 1n ≥ , is equal to

1( )z −−I A . It follows from Eq. (D.21) that the transfer

function matrix H(z) is given by

1( ) ( )z z −= − +H C I A B D (D.23)

D.2 Discretization of Covariance Matrices

For the Kalman filter, the discrete-time signal/measurement model is often a discretized

representation of a continuous-time state model of the form:

( ) ( ) ( )

( ) ( ) ( )

c c c

c c c

t t t

t t t

= +

= +

x Ax Bw

y Cx v (D.24)

and initial state 0 0( )c c

t =x x , ( )c

tw and ( )c

tv are uncorrelated, white-noise, continuous-time

random signals with covariances

[ ][ ]

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

c c c c

c c c c

E t t t t

E t t t t

τ δ τ

τ δ τ

− = −

− = −

w w Q

v v R (D.25)

If ( )c

tw and ( )c

tv are stationary, as if often the case, ( )c c

t =Q Q and ( )c c

t =R R for all t.

( )c

tδ is the continuous-time impulse function:

( ) 0, 0, ( ) 1,c c

t t and dε

εδ δ τ τ

−= ≠ =∫ for any 0ε > (D.26)

Then the discretized signal/measurement model with sampling period T has the form of

Page 31: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

31

( 1) ( ) ( )

( 1) ( ) ( )

n n n

n n n

+ = +

+ = +

x Φx Γw

y Cx v (D.27)

where ( )exp T=Φ A , ( )nw and ( )nv are uncorrelated, white-noise, discrete-time random

signals with covariance matrices.

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

T

T

E i j i i j

E i j i i j

δ

δ

= −

= −

w w Q

v v R (D.28)

In the case of stationary, ( )n =Q Q and ( )n =R R for all n.

It is therefore necessary to relate the discrete-time covariance matrices Q(n) and R(n) to their

continuous-time counterparts Qc(t) and Rc(t). First consider descretization of Rc(t). It may appear

that

( ) ( ) ( ) ( )c c

n n nT nTδ δ=R R (D.29)

However, he impulses δ(n) and δc(t) are not equivalent. The discrete-time impulse δ(n) remains finite

for all n, but the continuous-time impulse δc(t) is unbounded at t=0.

To remedy this incompatibility, Lewis[15]

suggests the following method. Define the

continuous-time unit rectangle by

1 11,

( ) 2 2

0,

tb t

otehrwise

− ≤ ≤

=

(D.30)

Then δc(t) can be written as

0

1( ) lim ( / )

cT

t b t TT

δ→

= (D.31)

and the continuous-time covariance becomes

0

1( ) ( ) lim ( )

c c t nT Tt nT

tt t n T b

T Tδ

= →=

= ×

R R (D.32)

The extra factor of T ensures that the area of the rectangle remains unity. In order for the right-hand

side of this equation to equal the left-hand side, it follows that

( ) ( ) /c

n nT T=R R (D.33)

This expression gives the proper relationship between R(n) and Rc(t).

We may discretize Bwc in two ways. First, we may assume a zero-order hold, i.e., we have

w(n)=wc(nT). Note that if wc(t) is a p-vector, then so is w(n). ΓΓΓΓ is given by Eq. (D.12), and by the

same argument that produced Eq. (D.33), Q(n) is given by

( ) ( ) /c

n nT T=Q Q

(D.34)

Second, it is possible to incorporate the system dynamics from time t=nT to time n=nT+T. In this

Page 32: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

32

case, w(n) is given by

[ ]( ) exp ( ) ( )nT T

cnT

n nT T dτ τ τ+

= + −∫w A Bw (D.35)

The intervals of integration for w(n) and w(n+1) do not overlap, so w(n) is white noise. As a result

of Eq. (D.35), w(n) is a vector that is the same length as x(n). To find the covariance associated with

w(n), write

[ ]

[ ]

( ) ( ) ( )

exp ( ) ( )

( ) exp ( )

exp ( ) ( ) ( )

exp ( )

T

nT T

cnT

nT TT T T

cnT

nT T nT TT

c cnT nT

T T

n E n n

E nT T d

nT T d

nT T E

nT T d d

τ τ τ

ρ ρ ρ

τ τ ρ

ρ τ ρ

+

+

+ +

=

= + −

× + −

= + − ×

× + −

∫ ∫

Q w w

A Bw

w B A

A B w w

B A

(D.36)

Now ( ) ( ) ( ) ( )T

c c c cE τ ρ τ δ τ ρ = − w w Q , so

[ ]( ) exp ( ) ( ) exp ( )nT T

T T

cnT

n nT T nT T dτ τ τ τ+

= + − + − ∫Q A BQ B A (D.37)

By a change of variables, this equation becomes

[ ]( ) exp ( ) expT

T T

co

n dτ τ τ τ = ∫Q A BQ B A (D.38)

Because the dynamics of [ ]exp t BA are directly incorporated into w(n) and Q(n) in Eq. (D.38),

this method used

=Γ I (D.39)

where I is the N x N identity matrix.

Page 33: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

33

Appendix E. Geomagnetic Field

E.1 Formulation

International Geomagnetic Reference Field (IGRF) model is given as gradient of geomagnetic

potential.

( , , )

1

1

sin

V r

VX

r

VY

r

VZ

r

θ λ

θ

θ λ

= −∇

∂=

∂= −

∂=

B

(E.1)

where, r is the geocentric radius, θ is the colatitude, and λ is the longitude.

Fig. D.1 IGRF Coordinates

The transformation matrix from IGRF coordinates to inertial frame (IJK) is following,

3 2

cos cos sin cos sin

( ) ( ) cos sin cos sin sin

sin 0 cos

LST LST LST

LST LST LST LST

IJKR R

IGRF

θ λ λ λ θ

λ π θ θ λ λ θ λ

θ θ

− − − = − − = − − −

(E.2)

where LSTλ is local sidereal time which is calculated by use of following equations

1

1

1

2 6 3

1 1

2,451,545.0

36,525

67,310.54841 (876,600 8,640,184.812866 )

0.093104 6.2 10

UT

UT

s h s

GMST UT

UT UT

LST GMST

JDT

T

T T

λ

λ λ λ

−=

= + +

+ − ×

= +

(E.3)

Page 34: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

34

where 1UTT is the Coordinated Universal Time, and GMSTλ is the Greenwich Mean Sidereal Time.

Geomagnetic potential is given as follows

( ) ( )1

1 0

( , , ) cos sin cos

nk nm m m

n n n

n m

aV r a g m h m P

rθ φ λ λ θ

+

= =

= +

∑ ∑ (E.4)

where (cos )m

nP θ is the Schmidt seminormalized associated Legendre function, and it is defined as

1/ 2

2 2( )!1( ) (1 ) ( 1)

( )!2 !

m nm m nm

n n m n

n m dP

n mn d

εµ µ µ

µ

+

+

− = − − +

(E.5)

where m

ε is the constant value that becomes 1 when 0m = and becomes 2 when 0m ≠ .

Distributed g and h are coefficients that can calculate geomagnetic field from dipole model to 10th

order model. Hence,

( ) ( )

( ) ( )

( ) ( )

2

1 0

2

1 0

2

1 0

cos sin cos

1sin cos cos

sin

( 1) cos sin cos

nk nm m m

n n n

n m

nk nm m m

n n n

n m

nk nm m m

n n n

n m

aX g m h m P

r

aY m g m h m P

r

aZ n g h m P

r

λ λ θθ

λ λ θθ

λ λ θ

+

= =

+

= =

+

= =

∂ = +

= −

= − + +

∑ ∑

∑ ∑

∑ ∑

(E.6)

E.2 Recursive Equations

Legendre function and its derivative are calculated using recurrence equation based on Chapman

and Bartels method[16]

in order to compute the model quickly.

1/ 2

,

( )!(cos ) (cos )

( )!

m m

n n m

n mP P

n m

εθ θ

− = +

(E.7)

where , (cos )n mP θ is non-normalized associated Legendre function. And following values are

introduced, then

1/ 2

1/ 2

, ,

( )!

( )!

( )!

( )!

(cos ) (cos )

m m m

n n

m m m

n n

n m n m

n mG g

n m

n mH h

n m

dQ P

d

ε

ε

θ θθ

− ≡

+

− ≡ +

(E.8)

Therefore Eq. (E.6) becomes

Page 35: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

35

( ) ( )

( ) ( )

( ) ( )

2

,

1 0

2

,

1 0

2

,

1 0

cos sin cos

1sin cos cos

sin

( 1) cos sin cos

nk nm m

n n n m

n m

nk nm m

n n n m

n m

nk nm m

n n n m

n m

aX G m H m Q

r

aY m G m H m P

r

aZ n G H m P

r

λ λ θ

λ λ θθ

λ λ θ

+

= =

+

= =

+

= =

= +

= −

= − + +

∑ ∑

∑ ∑

∑ ∑

(E.9)

,n mP and ,n mQ can be calculated as follows based on Chapman and Bartels method.

( ),0 1,0 2,0

1(2 1) cos ( 1)n n nP n P n P

nθ − −= − − − (E.10)

( ),0 ,0 1,0cossin

n n n

nQ P Pθ

θ−= − (E.11)

( ), 1, 1 , 1

1( 1) ( 1)cos

sinn m n m n mP n m P n m Pθ

θ− − −= + − − − + (E.12)

, , ,

cos( )( 1)

sinn m n m n m

mQ n m n m P P

θ

θ= + − + − (E.13)

Page 36: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

36

Appendix F. External Torques and Noise Generation

F.1 Gravity Gradient Torques

Gravity gradient torque is calculated by following equation [17]

2 2

2 2

3

2 2

( ) ( )3

( ) ( )

( ) ( )

z y xy xz yz

E

gg x z xy xy xz

y x xy yz xy

mn I I nlI lmI n m I

nl I I lmI mnI l n IR

lm I I mnI nlI m l I

µ − + − + −

= − + − + − − + − + −

T (F.1)

where, R=R(l,m,n)T is the orbital radius vector pointing from the center of the Earth to the center of

mass of the satellite in the Body Centered Reference Frame (BCRF).

Fig. F.1 shows the stability condition in terms of inertia moment. It is required that y x zI I I> >

or x z yI I I> > to stabilize the satellite.

Fig. F.1 Stability Condition of Inertia Moments

Page 37: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

37

F.2 Solar Radiation Torques

Solar radiation pressure torque can be calculated by following

( )

(1 )

srp srp srp m

s

srp s sun

FA q

c

= × −

= +

T F c c

F r (F.2)

where csrp is the center of solar radiation pressure, cm is the center of mass, Fs is the solar constant, As

is the area, q is the reflectivity i is the incident angle, c is the velocity of light, and rsun is the unit sun

vector. The vector of the sun is calculated using the ephemeris which is developed by several

researchers. In QSAT simulator, VSOP87 (Variations Séculaires des Orbites Planétaires) method[20]

is built which guarantees for Mercury, Venus, Earth-Moon barycenter and Mars a precision of 1" for

4,000 years before and after the 2,000 epoch. The same precision is ensured for Jupiter and Saturn

over 2,000 years and for Uranus and Neptune over 6,000 years before and after J2000.

F.3 Atmospheric Drag Torques

Atmospheric drag torque is calculated by following equation

( )

1

2

a a a m

a dC AVρ

= × −

=

T F c c

F V (F.3)

where ca is the center of aerodynamic force, Cd is the drag coefficient, ρ is the atmospheric density,

and V is the velocity.

As the atmospheric density model, NRLMSIS00E-00 is used in the simulator. NRLMSISE-00 is an

empirical, global model of the Earth's atmosphere from ground to space developed by Picone, Hedin,

and Drob is based on the earlier models MSIS-86 and MSISE-90, and updated with actual satellite

drag data. It models the temperatures and densities of the atmosphere's components.

Note!: The Lever Arm of Atmospheric Drag Torque & Solar Radiation Pressure Torque

We assume csrp and ca as 5[cm] which are considered as the worst cases.

F.4 Magnetic Torques

Magnetic torques is expressed by following equation.

mag

= ×T M B (F.4)

where M is the magnetic moment vector, and B is the magnetic flux density vector. The Geomatnetic

field is calculated by IGRF model (see Appendix E).

Page 38: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

38

F.5 Sensor Outputs

For the sake of simulation of attitude determination and control, sensor outputs must be modeled.

After finishing calibration of sensors, I will build sensor model into the simulator.

[ ]( )output true= + +s A s d n (F.5)

soutput is the simulated sensor outputs, strue is the real values, A is the transformation matrix, d is the

drifts, n is the Gaussian white noise. Gaussian white noise is generated using L’Ecuyer’s method [14]

and Box-Muller method [14]

.

We should consider which sun sensor can see the sunlight. The angle between two vectors (sun

vector and perpendicular vector to the position sensing device (PSD)) has to be calculated because

the sun sensor has 55[deg] view angle.

arccos 55[deg]sun sensor

sun sensor

V V

V Vθ

⋅= ≤

(F.6)

Fig. F.2 and F.3 show the output of magnetometer. Noise (standard deviation: 500[nT]) and bias:

(200[nT] in this test) are added to the true value. Fig. F.4 and F.5 show the output of sun sensor. If

the angle between sun vector and perpendicular vector to PSD exceed 55[deg] or the satellite is in

eclipse, output becomes zero. I add noise and bias to normalized sun vector measured by PSD

because it is difficult to determine the current passing through the PSD. We are using temporary

values of drifts and noise currently. We have to get accurate values by means of calibration

tests.

Fig. F.2 Example of Magnetometer Output with Noise and Bias (a)

Page 39: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

39

Fig. F.3 Example of Magnetometer Output with Noise and Bias (b)

Fig. F.4 Example of Sun Sensor Output with Noise and Bias (a)

Page 40: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

40

Fig. F.5 Example of Sun Sensor Output with Noise and Bias (b)

Page 41: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

41

Bibliography

[1] Wertz, J. R. (Editor), Spacecraft Attitude Determination and Control, Kluwer Academic

Publishers, Netherlands, 1978.

[2] Lefferts, E. J., Markley, F. L. and Shuster, M. D., Kalman Filtering for Spacecraft Attitude

Estimation, Journal of Guidance and Control, Vol.5, No.5, Sep.-Oct., 1982, pp.417-429.

[3] Farrenkopf, R. L., Analytic Steady-State Accuracy Solutions for Two Common Spacecraft

Attitude Estimators, Journal of Guidance and Control, Vol.1, No.4, July-Aug, 1978, pp 282-284.

[4] Gelb, A., Applied Optimal Estimation, The MIT Press, Cambridge, Massachusetts, 1974.

[5] Ninomiya, K. et al., Kalman filtering Used in the Attitude Determination Systems for Astronomy

Missions of ISAS, ISAS Report, Vol.102, Feb. 1992, pp.1-88.

[6] Kaplan, M. H., Modern Spacecraft Dynamics and Control, John Wiley and Sons, New York,

1976.

[7] Kamen, E. W. and Su, J. K., Introduction to Optimal Estimation, Springer-Verlag, New York,

1999.

[8] van der Ha, J. C., Initial Attitude Determination for the Hipparcos Satellite, Acta Astronautica,

Vol.15, No.6/7, 1987, pp.421-433.

[9] Mimasu, Y., Miyata, K., Narumi, T. and van der Ha J. C., Attitude Determination and Control

System for QSAT, Proceedings of 17th

JAXA Workshop on Astrodynamics and Flight Mechanics

Symposium, Sagamihara, Japan, Jul. 2007.

[10] Psiaki, M. L., Martel, F., Pal, P. K., Three Axis Attitude Determination via Kalman Filtering of

Magnetometer Data, Journal of Guidance, Vol.13, No.3, 1989, pp.506-514.

[11] Shuster, M. D. and Oh, S. D., Three-Axis Attitude Determination from Vector Observations,

Journal of Guidance and Control, Vol.4, No.1, Jan.-Feb., 1981, pp.70-77.

[12] Kuipers, J. B., Quaternions and Rotation Sequences, Princeton University Press, US. 1999.

[13] D. A. Vallado, Fundamentals of Astrodynamics and Applications, Second Edition, Microcosm

Press and Kluwer academic, US, 2001.

[14] Press, W. H., et al., Numerical Recipes in C++, The Art of Scientific Computing, Second

Edition, Cambridge University Press, US, 2005.

[15] Lewis, F. L., Optimal Estimation with an Introduction to Stochastic Control, John Wiley & Sons,

New York, 1986.

[16] Chapman, S. and J. Bartels, Spherical Harmonic Analysis in Geophysics, Geomagnetism, vol.2,

Oxford Univ. Press, New York, 1940, pp.606-638.

[17] van der Ha, J. C., Model of Gravity Force and Gravity Gradient Torque,

FLK-SIM-TN-ZAR-004 Issue 1, April, 2006.

[18] Nakatsuka, T., Calculation of the International Geomagnetic Reference Field (4), GSJ Open File

Page 42: Attitude Determination Method in Eclipse for QSAT (Version 2)

19 September 2007

42

Report, No. 423, 2005.

[19] Hoots, F. R. and Roerich., R. L., Spacetrack Report NO. 3 - Models for Propagation of NORAD

Element Sets, December 1980.

[20] Meeus, J., Astronomical Algorithms Second Edition, Willmann-Bell, US, 2005.

[21] Philippe, L., Extensive Use of Magnetometers and Magnetotorquers for Small Satellite Attitude

Estimation and Control, 18th

Annual AAS Guidance and Control Conference, Keystone,

Colorado, AAS95-012, February, 1995.

[22] Steyn, W. H. and Hashida, Y., An Attitude Control System for a Low-Cost Earth Observation

Satellite with Orbit Maintenance Capability, 13th

AIAA/USU Conference on Small Satellites,

Logan, Utah, SSC99-XI-4, August, 1999.

[23] Sunde, B. O. and Gravdahl, J. T., Attitude Determination for the Student Satellite nCubeII:

Kalman Filter, Proceedings of the 56th International Astronautical Congress, Fukuoka, Japan,

October 17-21, 2005.

[24] Leonard, B. S., NPSAT1 Magnetic Attitude Control System, 16th

Annual AIAA/USU

Conference on Small Satellites, Logan, Utah, SSC02-V-7, August 2002.

[25] Steyn, W. H., Comparison of Low-Earth-Orbit Satellite Attitude Controllers Submitted to

Controllability Constraints, Journal of Guidance, Control, and Dynamics, Vol.17, No.4,

July-August, 1994, pp.795-804.

[26] Theil, S., Appel, P. and Schleicher, A., Low Cost, Good Accuracy – Attitude Determination

Using Magnetometer and Simple Sun Sensor, 17th

Annual AIAA/USU Conference on Small

Satellites, Logan, Utah, SSC03-XI-7, August, 2003.

[27] Samaan, M. A. and Theil, S., Accurate On-Ground Attitude Determination for the GAIA

Mission Using Kalman Smoother, 17th

AAS/AIAA Space Flight Mechanics Meeting, Sedona,

Arizona, AAS 07-100, 28th

January – 1st February, 2007.