AA 279C Report
AA 279C Report
1
REVISION HISTORY
2
TABLE OF CONTENTS
1 PROBLEM SET 1 4
1.1 PROBLEM 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 PROBLEM 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 PROBLEM 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 PROBLEM 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 PROBLEM 5 AND 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.6 PROBLEM 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.7 PROBLEM 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2 PROBLEM SET 2 14
2.1 PROBLEMS 1-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2 PROBLEM 3-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3 PROBLEM 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.4 PROBLEM 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5 PROBLEMS 10-11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3 PROBLEM SET 3 21
3.1 Problems 1 and 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 Problem 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3 Problem 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4 Problems 5 and 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.5 Problem 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4 PROBLEM SET 4 33
4.1 Problem 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.1.1 Part a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.1.2 Part b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.1.3 Part c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.1.4 Part d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.1.5 Part e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.2 Problem 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.2.1 Parts a-c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.2.2 Part D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2.3 Part E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.3 Problem 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.3.1 Part C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5 PROBLEM SET 5 46
5.1 Problems 1 and 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.2 Problems 3 and 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3
1 PROBLEM SET 1
1.1 PROBLEM 1
Select the characteristics of your mission.
For this project, we have decided to work on a satellite in a highly elliptical orbit. Its main
target attitude will be Earth pointing, with a secondary target attitude of sun pointing (for solar
panels). The state representation will be quaternions and angular velocity in the body frame. It
will use star trackers as sensors and reaction wheels for the actuators.
1.2 PROBLEM 2
Conduct survey of satellites
Several potential satellite missions with some of the characteristics given above were surveyed.
Some of the missions found include the ICESat-2 mission, which would point a laser at the
surface of the Earth to determine its exact height. This mission would be in low Earth orbit, but
would have an Earth pointing target. The James Webb Space Telescope was also considered,
it is in a Lagrange halo orbit and would use star trackers as sensors. Several JPL missions,
including CubeRRT, RACE, and TEMPEST-D were also considered. These are all CubeSat
sciense missions in LEO orbits with Earth pointing targets. Finally, we also considered the
ORCAS mission, which is in a highly elliptical orbit and has an Earth pointing target.
1.3 PROBLEM 3
Select a satellite
We selected the Orbiting Configurable Artificial Star (ORCAS) for this course project. This
project meets all the desired specifications listed in problem 1.
1.4 PROBLEM 4
Project information
ORCAS is a proposed project at NASA with a potential launch date of 2026. The following
information about requirements and spacecraft specifications come from NASA Goddard re-
ports [1][2][3]. The main goal of the mission is to provide a laser signal to ground telescopes
when they are imaging stars to improve their image quality. Based on this stated goal, there are
several key mission requirements. During observation of a given target star, the satellite must
be within 7.3 arcseconds of the target star for at least ten minutes and ideally closer to three
hours. This requirement is based on the field of view of the ground telescopes. Additionally,
the satellite must always be more than 1000km from the surface of the Earth for safety reasons.
During observation, the laser on the spacecraft must be pointed towards the Earth. At all other
times, the pointing vector on the spacecraft’s solar panels must be within 89 degrees of the
pointing vector to the sun.
The dry mass of the spacecraft is 35kg, and the wet mass is 80kg. A breakdown of the mechan-
ical elements and their respective masses is given in Table 2.
The spacecraft will use star trackers for attitude determination. A micro-reaction wheel system,
Blue Canyon Technology’s Flexcore, will be used for attitude control, with thrusters used as
backup. There will be four 24mN thrusters on the spacecraft.
4
Spacecraft Component Mass (kg)
Electric Propulsion System 2.5
Laser 5
EP Power Unit 3
Reaction Wheel 6
Star Trackers 2
Backup Battery 2.7
Xenon Fuel 45
Xenon Tank and Subsystems 5
Solar Array 8
Table 2: Spacecraft components and masses.
The spacecraft will consist of a CubeSat with solar panels on the top. It is a standard ESPA
class spacecraft with dimensions 0.9m x 0.7m x 0.6m. The solar panels will unfold from each
side as shown in figure 1. Therefore, two of the solar panels will be dimension 0.9m x 0.7m
and two will be dimension 0.9m x 0.6m. These will be uniform thickness with a total mass of
8kg. The laser on the spacecraft will be on the side opposite the solar panels. A diagram of the
spacecraft from NASA Goddard can be seen in Figure 1.
5
Figure 2: A plot from the Matlab model showing the body frame geometry.
1.6 PROBLEM 6
Discretize spacecraft and develop Matlab function to handle barycenter
The following is an excerpt from our code where the satellite center of mass and inertia tensor
are calculated, each in SI units.
−0.0156
m = 0.0126 (1)
0.0000
8.593 −0.483 0
I = −0.483 12.243 0 (2)
0 0 11.183
These properties derive from our SatelliteBody object, which holds a collection of surfaces.
Table 3 provides a summary of the surface properties, followed by the matlab object code.
6
Name Pos. Body Frame (x,y,z) [m] Mass [kg] Length [m] Width [m]
Laser Surface ( 0.460, 0.210, 0.000) 5.000 0.100 0.100
Antennae Surface ( 0.460,-0.210, 0.000) 0.000 0.100 0.100
Side 1 Surface ( 0.450, 0.000, 0.000) 11.700 0.600 0.700
Side 2 Surface ( 0.000, 0.300, 0.000) 11.700 0.900 0.700
Side 3 Surface ( 0.000, 0.000, 0.350) 11.700 0.900 0.600
Side 4 Surface (-0.450, 0.000, 0.000) 11.700 0.600 0.700
Side 5 Surface ( 0.000,-0.300, 0.000) 11.700 0.900 0.700
Side 6 Surface ( 0.000, 0.000,-0.350) 11.700 0.900 0.600
Solar Panel 1 (-0.450, 0.000, 0.700) 2.000 0.600 0.900
Solar Panel 2 (-0.450, 0.600, 0.000) 2.000 0.900 0.700
Solar Panel 3 (-0.450, 0.000,-0.700) 2.000 0.600 0.900
Solar Panel 4 (-0.450,-0.600, 0.000) 2.000 0.900 0.700
Table 3: A table summarizing the surfaces for the satellite body of Figure 2. The body is axially
asymmetric due to the inclusion of the laser and antennae.
4 methods
5
6 function obj = ORCASSatelliteBody()
7 % ORCASSATELLITEBODY Construct an instance of this class
8
9 total body mass = 70.2;
10
11 laser surface = Surface([0.46; 0.21; 0], [0; 1; 0], [1; ...
0; 0], 0.1, 0.1, 5, [1, 0, 0]);
12 antenna surface = Surface([0.46; -0.21; 0], [0; 1; 0], ...
[1; 0; 0], 0.1, 0.1, 0, [0, 0, 1]);
13 s1 = Surface([0.9 / 2; 0; 0], [0; 1; 0], [1; 0; 0], 0.6, ...
0.7, total body mass / 6);
14 s2 = Surface([0; 0.6 / 2; 0], [1; 0; 0], [0; 1; 0], 0.9, ...
0.7, total body mass / 6);
15 s3 = Surface([0; 0; 0.7 / 2], [1; 0; 0], [0; 0; 1], 0.9, ...
0.6, total body mass / 6);
16 s4 = Surface([-0.9 / 2; 0; 0], [0; 1; 0], [-1; 0; 0], ...
0.6, 0.7, total body mass / 6);
17 s5 = Surface([0; -0.6 / 2; 0], [1; 0; 0], [0; -1; 0], ...
0.9, 0.7, total body mass / 6);
18 s6 = Surface([0; 0; -0.7 / 2], [1; 0; 0], [0; 0; -1], ...
0.9, 0.6, total body mass / 6);
19 sp1 = Surface([-0.9 / 2; 0; 0.7], [0; 1; 0], [1; 0; 0], ...
0.6, 0.9, 2, [0, 1, 1]);
20 sp2 = Surface([-0.9 / 2; 0.6; 0], [0; 1; 0], [1; 0; 0], ...
0.9, 0.7, 2, [0, 1, 1]);
21 sp3 = Surface([-0.9 / 2; 0; -0.7], [0; 1; 0], [1; 0; 0], ...
0.6, 0.9, 2, [0, 1, 1]);
22 sp4 = Surface([-0.9 / 2; -0.6; 0], [0; 1; 0], [1; 0; 0], ...
0.9, 0.7, 2, [0, 1, 1]);
23
7
24 obj = obj@SatelliteBody([laser surface, antenna surface, ...
s1, s2, s3, s4, s5, s6, sp1, sp2, sp3, sp4]);
25 end
26
27 end
28 end
8
46 switch nargin
47 case 1
48 no vects = 0;
49 end
50
51 corner vectors = obj.position body + ...
52 [ ...
53 obj.first vector body * obj.length / 2 + ...
obj.second vector body * obj.width / 2, ...
54 -obj.first vector body * obj.length / 2 + ...
obj.second vector body * obj.width / 2, ...
55 -obj.first vector body * obj.length / 2 - ...
obj.second vector body * obj.width / 2, ...
56 obj.first vector body * obj.length / 2 - ...
obj.second vector body * obj.width / 2];
57 patch(corner vectors(1, :), corner vectors(2, :), ...
corner vectors(3, :), obj.color);
58
59 if no vects == 0
60 % plot normal vector
61 quiver3(obj.position body(1), obj.position body(2), ...
obj.position body(3), ...
62 obj.normal vector body(1), ...
obj.normal vector body(2), ...
obj.normal vector body(3));
63 end
64 end
65
66 end
67 end
This code defines a Satellite Body, which includes a collection of surfaces and the code to
compute the body center of mass and inertia tensors.
9
22 end
23 center of mass = center of mass / total mass;
24 end
25
26 function inertia tensor = inertia tensor(obj)
27
28 % diagonal terms
29 Ixx = 0;
30 Iyy = 0;
31 Izz = 0;
32 for i = 1:length(obj.surfaces)
33 m = obj.surfaces(i).mass;
34 x2 = obj.surfaces(i).position body(1)ˆ2;
35 y2 = obj.surfaces(i).position body(2)ˆ2;
36 z2 = obj.surfaces(i).position body(3)ˆ2;
37
38 Ixx = Ixx + m * (y2 + z2);
39 Iyy = Iyy + m * (x2 + z2);
40 Izz = Izz + m * (y2 + x2);
41 end
42
43 % off-diagonal terms
44 Ixy = 0;
45 Ixz = 0;
46 Iyz = 0;
47 for i = 1:length(obj.surfaces)
48 m = obj.surfaces(i).mass;
49 x = obj.surfaces(i).position body(1);
50 y = obj.surfaces(i).position body(2);
51 z = obj.surfaces(i).position body(3);
52
53 Ixy = Ixy - m * x * y;
54 Ixz = Ixz - m * x * z;
55 Iyz = Iyz - m * y * z;
56 end
57
58 inertia tensor = [Ixx, Ixy, Ixz; Ixy, Iyy, Iyz; Ixz, ...
Iyz, Izz];
59 end
60
61 function plot(obj, no vects)
62 % plot all the surfaces
63 switch nargin
64 case 1
65 no vects = 0;
66 end
67
68 if no vects == 0
69 for i = 1:length(obj.surfaces)
70 obj.surfaces(i).plot();
71 end
72 end
73 if no vects == 1
74 for i = 1:length(obj.surfaces)
75 obj.surfaces(i).plot(no vects);
76 end
77 end
78 end
10
79
80 function plot body frame(obj)
81 quiver3(0, 0, 0, 1, 0, 0, 'k');
82 quiver3(0, 0, 0, 0, 1, 0, 'k');
83 quiver3(0, 0, 0, 0, 0, 1, 'k');
84 end
85
86 function plot principal frame(obj)
87 [inertia tensor principal, rot mat body2principal] = ...
obj.principal axes();
88 x = [1, 0, 0];
89 y = [0, 1, 0];
90 z = [0, 0, 1];
91 x pr = x * rot mat body2principal;
92 y pr = y * rot mat body2principal;
93 z pr = z * rot mat body2principal;
94 quiver3(0, 0, 0, x(1), x(2), x(3), 'r');
95 quiver3(0, 0, 0, y(1), y(2), y(3), 'r');
96 quiver3(0, 0, 0, z(1), z(2), z(3), 'r');
97 end
98
99 function [inertia tensor principal, rot mat body2principal] ...
= principal axes(obj)
100 inertia tensor = obj.inertia tensor();
101 [rot mat body2principal, inertia tensor principal] = ...
eig(inertia tensor);
102 end
103
104 end
105 end
1.7 PROBLEM 8
Orbit propagation
Initial conditions were defined based on the main requirement that the spacecraft must be on
the line of sight from the observatory to the target star at observation for as long as possible.
Based on this requirement, the position and velocity are nearly fully defined. Based on the
direction that NASA Goddard is headed with the design of this mission, a distance along the
line of sight of 200,000km and an orbit period of five days were selected. This fully defined
the six degrees of freedom for the initial conditions of the orbit.
The orbit was then propagated using a numerical integrator. For now, no perturbations have
been added. The Matlab code used can be seen below, and the Simulink model is shown
in Figure 3. Note that the Matlab code and Simulink model were developed previously for
11
research in SLAB, but have been simplified for the purpose of this report. No previous work
on the attitude determination and control for this mission has been done.
1 clear all;
2 close all;
3 clc;
4
17 %Model Constants
18 muEarth = 398600; %kmˆ3/sˆ2
19 rEarth = 6378.137; %km
20
21 initDays = [3,20,2024,0,0,0]; %month day year hour min sec
22 [gmst,JD] = calToGMST(initDays);
23 gmst = 0;%Assume orbit starts aligned with target star
24
25 %Orbit parameters
26 perturbs = [0,0,0,0]; %[j2,moon,sun,srp], 1 for included 0 for not
27 dLOS = 200000; %km
28 v dir = 1; %1 or -1
29 n = 5; %days
30
31 %Determine orbit
32 T sid = 23*3600 + 56*60 + 4.1; %period of a sidereal day in seconds
33 a = (muEarth*nˆ2* T sidˆ2/(4*piˆ2))ˆ(1/3);
34 wE = [0;0;(2*pi)/(T sid)];
35
36 r hat = [cos(dec)*cos(RA); cos(dec)*sin(RA); sin(dec)];
37
38 r ob ecef = rEarth*[cos(obLat)*cos(obLong); cos(obLat)*sin(obLong); ...
sin(obLat)];
39 r ob eci = rotz(gmst)* r ob ecef;
40 v ob eci = cross(wE,r ob ecef);
41
42 r sc eci = r ob eci + dLOS* r hat;
43 v norm = sqrt(2*muEarth*(1/norm(r sc eci)-1/(2*a)));
44 v perp = v ob eci-dot(v ob eci,r hat)* r hat;
45 v par = sqrt(v normˆ2-norm(v perp)ˆ2);
46 v sc eci = v perp+v dir *(v par)* r hat;
47
48 [a,e,i,Om,w,E] = eciToOE(r sc eci,v sc eci,muEarth);
49
50 T = 2*pi*sqrt(aˆ3/muEarth);
51 ti = 0;
52 tf = nOrbits*T;
53
12
54 simout = sim('ORCAS model 1');
55 r orbit = simout.get('r orbit').data;
56 v orbit = simout.get('v orbit').data;
57 sc RA = rad2deg(simout.get('sc RA').data);
58 sc dec = rad2deg(simout.get('sc dec').data);
59 r perp = simout.get('r perp').data;
60 r par = simout.get('r par').data;
61 distObSC = simout.get('dist obToSC').data;
62 losZenith = simout.get('losZenith').data;
63 sunZenith = simout.get('sunZenith').data;
64 zenith eci = simout.get('zenith eci').data;
65 v perp = simout.get('v perp').data;
66 v par = simout.get('v par').data;
67 illumAngle = simout.get('illumAngle').data;
68
69 figure
70 plot3(r orbit(:,1),r orbit(:,2),r orbit(:,3))
71 hold on
72 plotAroundEarth(rEarth)
73 hold on
74 plot3(r orbit(1,1),r orbit(1,2),r orbit(1,3),'*')
75 xlabel('x (km)')
76 ylabel('y (km)')
77 zlabel('z (km)')
78 title('ECI Position of Spacecraft')
The orbit propagation can be seen below in Figure 4. As shown, the ORCAS orbit is highly
elliptical. Observations can be made at the point indicated by the red star, which is also where
the initial conditions occur.
13
Figure 4: ECI Propagation of the ORCAS highly elliptical orbit.
2 PROBLEM SET 2
2.1 PROBLEMS 1-2
The principal axes can be identified by taking the eigenvectors and eigenvalues of the inertia
tensor in the body axis frame. The ORCAS model principal axes are very similar to its body
axes. The rotation matrix from body axes to principal axes is the following:
−0.9916 0 −0.1290
REN U →ECEF = −0.1290 0 0.9916 (3)
0 1 0
Figure 5 shows a 3D model of ORCAS with both the body and principal axes included. As
shown, the two axes are very similar which was expected.
14
Figure 5: 3D Model of ORCAS spacecraft with showing body and principal axes in black and
red, respectively. Note that the two axis frames are similar enough that they do not show up
separately.
1 Ix = moment of inertia(1);
2 Iy = moment of inertia(2);
3 Iz = moment of inertia(3);
4
5 wx = w(1);
6 wy = w(2);
7 wz = w(3);
8
9 w dot = [-wy*wz*(Iz-Iy)/Ix;
15
10 -wz*wx*(Ix-Iz)/Iy;
11 -wx*wy*(Iy-Ix)/Iz];
Initial conditions
ω = 2 5 9 rad/s (4)
were used to initialize the model. The model was plotted for 3600 seconds, allowing it to
complete more than three complete revolutions in every direction.
A plot of the rotational kinetic energy and momentum ellipsoids can be seen in Figure 7.
Figure 7: The rotational kinetic energy and momentum ellipsoids along with the polhode for
initial conditions of ω = [2, 5, 9] rad/s.
Theoretically, for the given initial conditions for rotational velocity, the semi-major axis of the
energy ellipsoid can be calculated by:
r
2T
= 12.3946 (5)
Ix
and as seen in the figure that value is accurate. Similarly, the semi-mjaor axis for the momentum
ellipsoid can be calculated by:
s
L2
= 14.6813 (6)
Ix2
16
Figure 8 shows the polhode plotted in the three 2D planes identified by the body axis. As
expected, the polhode is an ellipse in the xy plane, which can also be seen in the 3D plot of the
polhode. This makes sense as this is the major axis. In the other two planes, the polhode is an
arc, which makes sense as these are the two minor axes for the spacecraft.
2.3 PROBLEM 8
The initial conditions were changed so that all rotation is in the major principal axes. The new
initial conditions are:
ω = 5 0 0 rad/s (7)
Figure 9: The rotational kinetic energy and momentum ellipsoids along with the polhode for
initial conditions of ω = [5, 0, 0] rad/s.
As expected, the momentum and energy ellipsoids now meet at a single point, at their tips. This
17
is due to the fact that the angular velocity no longer varies with time. The plot of the polhode
in 2D frames is not included as it is a single point for all three planes.
Similarly, initial conditions
ω = 0 5 0 rad/s (8)
were also examined. The results for this can be seen in Figure 10.
Figure 10: The rotational kinetic energy and momentum ellipsoids along with the polhode for
initial conditions of ω = [0, 5, 0] rad/s.
As shown, in this case the momentum and energy ellipsoids intersect for large swaths, as this
is the unstable mode where the satellite is rotating around the principal axis which is neither
major nor minor. Again, the angular velocity does not change with time (so the plot of angular
velocity is again not included).
2.4 PROBLEM 9
Problem 4 was repeated using a new satellite with the requirement that it is axial-symmetric.
The new satellite has simpler characteristics to meet the requirement. It is prolate cube. While
each of the surfaces are the same size, the x and y faces have four times the mass as the z faces.
The new inertia tensor is the following, and Figure 11 depicts the model.
0.6250 0 0
I= 0 0.6250 0 (9)
0 0 1.0000
18
Figure 11: A Prolate Satellite Model.
The updated momentum and energy ellipsoids are plotted using the same initial conditions as
for problem 4:
ω = 2 5 9 rad/s (10)
The ellipsoids and polhode for these initial conditions for the axially symmetric spacecraft can
be seen in Figure 12.
19
Figure 12: The rotational kinetic energy and momentum ellipsoids along with the polhode for
initial conditions of ω = [2, 5, 9] rad/s for an axial-symmetric satellite.
The polhode plots in each of the principal planes can be seen in Figure 13.
Figure 13: The polhode plotted in the xy, yz, and xz principal frames for initial conditions of ω
= [2, 5, 9] rad/s for an axial-symmetric satellite.
As shown, the polhode is still a circle in the xy planes as expected, and now it is a line in
the other two planes. This is because as an axially symmetric body, the polhode is an ellipse
perpendicular to the x plane.
20
Figure 14: The error between the analytical and numerical models.
As shown, after 50 seconds the error is at about 0.1 seconds. The numerical integrator was
tuned to have a smaller time step for greater accuracy.
Since the error over time is very small, even with a 0.001 time step, the angular velocity vector
and the angular momentum vector are changing according to theory in the principal axes.
3 PROBLEM SET 3
3.1 Problems 1 and 2
Two attitude parameterizations, quaternions and Euler angles, were used in this homework
to determine the attitude of the spacecraft. The first parameterization, quaternions, have the
following kinematic equations:
1~
~q˙ = Ω~q (11)
2
where
0 ωz −ωy ωx
−ωz 0 ωx ωy
~ =
Ω (12)
ωy −ωx 0 ωz
−ωx −ωy −ωz 0
The secondary attitude parameterization used were Euler angles. The kinematic equations for
these are:
21
ωx sin ψ + ωy cos ψ
φ̇ = (13)
sin θ
θ̇ = ωx cos ψ − ωy sin ψ (14)
ψ̇ = ωz − (ωx sin ψ + ωy cos ψ) cot θ (15)
Both attitude parameterizations were numerically integrated over multiple revolutions using
Simulink. In the same functions, the angular velocity was also propagated using the Euler
equations based on the code in problem set 2.
The simulink model for the quaternions can be seen below in Figure 15, and the simulink model
for the Euler angles can be seen in Figure 16. To build upon the code from the previous problem
sets, we converted our objects from the previous problem sets into matlab System objects. This
allows our object code to be used in Simulink. These Simulink model use matlab System
objects blocks to call our object code. The blocks in Figure 15 and 16 share a lot of code via
inheritance. The code shared related to the computation of the inertial tensor from the previous
problem sets. They differ with in their functions called derivative, which we provide below.
The derivative function of the quaternion model pertains to quaternion kinematics; whereas,
the Euler model pertains to the Euler kinematics.
22
Figure 16: Simulink model for Euler angle kinematic equations.
The Euler Angle Kinematics Derivative Function is provided below. Notice that the input and
output names of this function match the System Block of the Simulink diagram of Figure 16.
22 phidot = (wx*sin(psi)+wy*cos(psi))/sin(theta);
23 thetadot = wx*cos(psi)-wy*sin(psi);
24 psidot = wz-(wx*sin(psi)+wy*cos(psi))*cot(theta);
25 state dot(1:3) = [phidot;thetadot;psidot];
26
27 Ix = I principal(1, 1);
28 Iy = I principal(2, 2);
29 Iz = I principal(3, 3);
30 wx = omega principal(1);
31 wy = omega principal(2);
32 wz = omega principal(3);
33
23
38 state dot(4:6) = w dot;
39 end
The Quaternion Kinematics Derivative Function is provided below. Notice that the input and
output names of this function match the System Block of the Simulink diagram of Figure 15.
18
19 Ix = I principal(1, 1);
20 Iy = I principal(2, 2);
21 Iz = I principal(3, 3);
22 wx = obj.omega principal(1);
23 wy = obj.omega principal(2);
24 wz = obj.omega principal(3);
25
26 w dot = [wy * wz * (Iy - Iz) / Ix
27 wz * wx * (Iz - Ix) / Iy
28 wx * wy * (Ix - Iy) / Iz];
29
3.2 Problem 3
Numerically integrating the attitude state with the quaternion parameterization yields Figure
17. Numerically integrating the attitude state with the Euler parameterization yields Figure 18.
24
Figure 17: State evolution of quaternion via numerical integration.
25
Figure 18: State evolution of quaternion via numerical integration.
3.3 Problem 4
From an arbitrary initial angular velocity of the ORCAS satellite body, we observe constant
angular momentum in the inertial frame with Figure 19 and the Herpolhode contained within
the plane perpendicular to angular momentum with Figure 20.
26
Figure 19: Observation of constant angular momentum in inertial frame. The changes observed
are very small and result from small integration errors.
27
Figure 20: Observation that the Herpolhode is contained within the plan perpendicular to the
angular momentum.
Figure 21 shows several coordinate systems of the ORCAS satellite at the beginning and end
of the simulation in the ECI frame.
28
Figure 21: The axis triads of several coordinate systems of the ORCAS satellite at the beginning
and end of the simulation.
was used. Since a 313 rotation was used for the Euler angles, an initial condition of
φ 0
θ = π (17)
2
π
ψ 2
was used. The simulation was then run for 3 revolutions, or 1080 seconds, with a time step
of 0.1 seconds. Figure 22 shows the change in Euler angles and angular velocity over those
revolutions.
29
Figure 22: The change in angular velocity and angles for an equilibrium condition.
As shown, the values of angular velocity do not change over time as expected, since this is
an equilibrium case. Also, the only rotation seen is a linearly increasing vale of ψ, which as
expected increases to a value of about 1080 radians in 1080 seconds, since the angular velocity
is 1 rad/s. As expected the values of φ and θ do not change with time.
For the next section, a new simulink model was used which includes propagation in the RTN
frame of the body. The simulink model can be seen in Figure 23.
An initial angular velocity of 1 rad/s in the N direction of the RTN frame was propagated. The
313 Euler angle propagation was used. Results for each angle can be seen in Figure 24.
30
Figure 24: A 313 Euler angle propagation with an initial condition of rotation about the N axis
of the RTN frame.
As shown, the φ and θ angles change very slightly due to numerical error. The third angle, ψ,
increases continuously as expected. Note that the results are wrapped which accounts for the
large drop after the first rotation. These results are as expected and verify that the model is
working correctly.
3.5 Problem 6
In this section, the stability of the satellite was tested. Three cases with rotation about each of
the three principal moments of inertia are tested, with a slightly perturbed initial condition.
The initial conditions for the three cases are
ω= 1 0.01 0.01 rad/s (18)
ω = 0.01 1 0.01 rad/s (19)
ω = 0.01 0.01 1 rad/s (20)
31
For all cases, the simulation is allowed to run for three rotations (1080 seconds) with a time
step of 0.1 seconds. The results for each of the cases can be seen in Figures 25-26.
Figure 25: The change in angular velocity and angles for a slightly perturbed rotation about the
x-axis.
Figure 26: The change in angular velocity and angles for a slightly perturbed rotation about the
y-axis.
32
Figure 27: The change in angular velocity and angles for a slightly perturbed rotation about the
z-axis.
As shown, the rotation is stable about the x and z axes. For both cases, the rotation is period-
ically stable for both the angular velocity and the Euler angles. There is some slight rotation
about all the values but the values stay stable throughout time (except the angle which is ex-
pected to change and increase linearly throughout, which happens for both).
On the other hand, the rotation about the y axis is unstable. The change in all three angles
continues to increase throughout. The values for the angular velocity are periodically stable but
change much more than for the other two. This makes sense as this is the least stable axis in
general.
4 PROBLEM SET 4
4.1 Problem 1
4.1.1 Part a
To add a new feature with rotors along the principal axes, we created new subclasses off of
previous work. This new subclasses includes the new physics involving the wheels, but calls
the parent class code for the physics without the rotors. In this way, we ensure that there are no
dangerous repetitions in our code. Below is the subclasses that includes rotor methods.
33
6 omega r x, ...
omega r y, ...
omega r z)
7 % SATELLITEATTITUDE Construct an instance of this class
8
9 obj.satellite body = ORCASSatelliteBody();
10 [I, R] = obj.satellite body.principal axes();
11 obj.inertia tensor principal = I;
12 obj.R body to principal = R;
13
14 if nargin == 0
15 omega I x = 0;
16 omega I y = 0;
17 omega I z = 0;
18 omega r x = 0;
19 omega r y = 0;
20 omega r z = 0;
21 end
22
23 obj.omega principal = ...
24 EulerEquationModelPrincipalRotors( ...
25 omega I x, ...
omega I y, ...
omega I z, ...
26 I(1, 1), I(2, 2), ...
I(3, 3), ...
27 1, ...
28 omega r x, ...
omega r y, ...
omega r z);
29 end
30
52 end
53 end
34
1 classdef EulerEquationModelPrincipalRotors < EulerEquationModel
2
3 properties
4 omega r x principal = 0
5 omega r y principal = 0
6 omega r z principal = 0
7 I r = 1
8 end
9
10 methods
11
30 end
31
32 function state = state(obj)
33 state = [ ...
34 obj.state@EulerEquationModel(); ...
35 obj.omega r x principal; ...
36 obj.omega r y principal; ...
37 obj.omega r z principal ...
38 ];
39 end
40
35
50 end
51
4.1.2 Part b
To verify the correctness of this code, we produce simulations that results in a video that is
summarized by Figure 28. This simulation is a perturbed rotation about the 2nd principal
axis. In the simulation, the inertia angular momentum is constant; the inertial angular velocity
rotates about the inertia angular momentum; the principal frames flip periodically where the
second principal axis spins about the inertial angular momentum; and, the body axis is flipping
according the Tennis Racket Theorem.
Figure 28: The angular momentum, angular velocity, principal axes, and first body vector, each
in the ECI frame, at two different time instances while spinning in second mode. The angular
momentum constant, but the satellite is flipping because the 2nd rotational mode is unstable.
Figure 21 shows the vector coordinates over time.
36
4.1.3 Part c
Figure ?? shows the z angular velocity component for each of the principal axes over time in
the ECI frame with a perturbed rotation. For the perturbed rotation about the 3rd mode, the
rotation is stable; whereas, for the 2nd mode, the rotation is unstable.
Figure 29: The relevant coordinate of the 3 principal-axis vectors. With the second rotational
mode, one of the principal body vectors flips periodically because that rotational mode is uns-
able. This is not observed with the third rotational mode.This data is from simulation that also
generated Figure 28.
4.1.4 Part d
After adding a spinning wheel to the 2nd axis, the 2nd rotational mode becomes stable, as seen
in Figure 30.
Figure 30: Applying a rotating wheel along the 2nd principal axis removes the instability about
the 2nd principal axis. Notice that the y-component no longer flips compared with Figure 29
.
4.1.5 Part e
Since the laser is on the first body axis, which is aligned with the first principal axis, we add a
spinning wheel to the first principal axis to induce a more stable spin along that axis. Figure 31
shows the how adding that rotor helps reduce the resulting spin from a perturbed rotation.
37
Figure 31: Showing a perturbed spin about body axis 1, before and after adding a spinning
rotor to principal axis 1.
4.2 Problem 2
4.2.1 Parts a-c
For this section, the rotor was turned off and the gravity gradient was examined. The following
equations represent the Euler equations with torque added in the principal frame.
3µ
(I
R3 z
− Iy )cy cz − (Iz − Iy )ωy ωz
ω̇x = (22)
Ix
3µ
(I
R3 x
− Iz )cz cx − (Ix − Iz )ωx ωz
ω̇y = (23)
Ix
3µ
(I
R3 y
− Ix )cx cy − (Iy − Ix )ωx ωy
ω̇x = (24)
Ix
Here, ~c is a unit vector in the direction of the ECI position of the spacecraft expressed in the
principal frame, and R is the magnitude of the ECI position of the spacecraft. For the following
tests, an orbit with the following orbital elements was used to ensure the gravity gradient would
be significant.
a 25000km
e 0.7
i 0.01
= (25)
Ω π
π
ω
2
3π
E 2
All angles are in radians. The maximum gravity gradient magnitude should be on the order of
1 Nm based on the gravitational parameter of the Earth and the semi-major axis of the orbit.
The magnitude of the gravitational torque can be seen in Figure 32. As expected, the maximum
magnitude is on the correct order of magnitude but is lower since it is multiplied by the values
of c, all of which are less than one.
38
Figure 32: Magnitude of gravitational torque over 2 orbits.
4.2.2 Part D
The Euler and Kinematic equations were integrated with the gravity gradient included. The
initial conditions have the body and the RTN frame aligned. A rotation of 1 rad/s around the N
axis was introduced. To check the model, the eccentricity of the orbit was changed to zero.
The torque can be seen in Figure 33. As shown, the gravitational torque varies slightly over the
orbit but remains close to zero. The small torque seen is likely due to numerical errors. The
model was allowed to run for two orbit periods.
Figure 33: The x, y, and z components of the gravitational torque on a circular orbit.
The next two figures (34 and 35) show the change in Euler angles and angular velocity over
time, respectively.
39
Figure 34: The Euler angles over two orbit periods for a circular orbit.
Figure 35: The angular velocity over two orbit periods for a circular orbit.
The results are as expected, with no significant changes from earlier propagations.
4.2.3 Part E
Finally, the Euler and Kinematic equations were integrated for the initial orbit conditions given
for part c. The orbit is eccentric, so the gravity gradient will no longer be zero. The torque
results can be seen in Figure 36. These match the results found in Part C, but are broken down
into their individual components.
40
Figure 36: The gravitational torques for two orbit periods for an elliptical orbit.
The Euler angles can be seen below in Figure 37. As shown, these are very similar to the results
from Part E.
Figure 37: The Euler angles for two orbit periods for an elliptical orbit.
On the other hand, the angular velocity can be seen in Figure 38. As shown, the z component
of the angular velocity changes due to the gravitational torque, as expected.
41
Figure 38: The angular velocity for two orbit periods for an elliptical orbit.
4.3 Problem 3
The coefficients KT and KR for the spacecraft were calculated using the following equations:
Iz − Iy
KR = (26)
Ix
Iz − Ix
KT = (27)
Iy
The regions of stable and unstable motion were computed and can be seen in Figure 39.
As shown, the spacecraft is in a stable region of the plot. Therefore, the spacecraft should be
very stable about equilibrium. The initial angles and angular velocity were all multiplied by
1.01 as a slight perturbation. Figures 40 and 41 show the Euler angles and angular velocity in
this case. As shown, the motion is stable and returns to the initial results.
42
Figure 40: The Euler angles for perturbed motion with gravity gradient over two orbits.
Figure 41: The angular velocity for perturbed motion with gravity gradient over two orbits.
To produce unstable motion, a the y and x components of the moment of inertia were flipped
to ensure the satellite falls on the line of unstable pitch. The same initial conditions were used.
The results can be seen in Figures 42 and 43.
43
Figure 42: The Euler angles for perturbed motion with gravity gradient over two orbits.
Figure 43: The angular velocity for perturbed motion with gravity gradient over two orbits.
As shown, the results are now slightly less stable. At this point, it is on the border between
stable and unstable.
4.3.1 Part C
As noted in part B, the satellite chosen for this project is already stable with the gravity gradient
torque. Therefore, no change to mas distribution or nominal attitude is needed. However, in
order to maintain stability, the moment of inertia in the x principal frame should always be
smallest, and the moment of inertia in the z principal frame should always be largest. This does
make sense for the project because if the satellite points in the desired direction (towards Earth)
this requirement is met.
44
The stable configuration the satellite currently has is shown in the Ki frame in Figure 39, and
the resulting attitude motion is shown in Figures 40 and 41.
When the x and y moments of inertia are flipped, that mode is shown in the Ki frame in Figure
44.
45
5 PROBLEM SET 5
5.1 Problems 1 and 2
In addition to the gravity gradient, three torques were added to the model. These included
the magnetic field torque, the solar radiation pressure torque, and the drag torque. These were
numerically integrated over several revolutions of the spacecraft with an initial angular velocity
of 1rad/s in the normal direction of the RTN frame. The results from this simulation can be
seen in Figures 45 and 46.
Figure 45: The torques of the magnetic field, gravity gradient, solar radiation pressure, and
drag in the principal frame over multiple revolutions of the spacecraft.
46
Figure 46: The total value for the torques of the magnetic field, gravity gradient, solar radiation
pressure, and drag over multiple revolutions of the spacecraft.
As seen in these figures, all four torques vary as the spacecraft rotates as expected. The values
for the torque components are also as expected. Based on Lecture 10 slide 10, the values shown
in Table 4 were computed for the maximum expected torque for each type. As shown in the
table, all the values are larger than the maximum values in the torque plots above.
47
Figure 47: Quaternion drift from starting orientation over 1 hour of simulated orbit.
References
[1] Peretz, Eliad (2020). Orbiting Configurable Artificial Star (ORCAS) for visible adaptive
optics from the ground. Astro 2020 White Paper. Unpublished.
[2] Peretz, Eliad (2020). ORCAS-Orbiting Configurable Artificial Star. Submitted in response
to NASA ROSES. Unpublished.
[3] Yu, W. Michaels, A. & Pritchett, R. (2020). Orbiting ReConfiguration Artificial Star.
FY2020 Analysis Report. Unpublished.
48