<<

University of Central Florida STARS

Honors Undergraduate Theses UCF Theses and Dissertations

2017

Atmospheric Entry

Dillon A. Martin University of Central Florida

Part of the Navigation, Guidance, Control and Dynamics Commons Find similar works at: https://stars.library.ucf.edu/honorstheses University of Central Florida Libraries http://library.ucf.edu

This Open Access is brought to you for free and open access by the UCF Theses and Dissertations at STARS. It has been accepted for inclusion in Honors Undergraduate Theses by an authorized administrator of STARS. For more information, please contact [email protected].

Recommended Citation Martin, Dillon A., "Atmospheric Entry" (2017). Honors Undergraduate Theses. 354. https://stars.library.ucf.edu/honorstheses/354 ATMOSPHERIC ENTRY

by

DILLON MARTIN

A thesis submitted in partial fulfilment of the requirements for the degree of Bachelor of Science in the Department of Mechanical and Aerospace Engineering in the College of Engineering and Computer Science at the University of Central Florida

Fall Term, 2017

Thesis Chair: Dr. Tarek Elgohary c 2017 Dillon Martin

ii ABSTRACT

The development of atmospheric entry guidance methods is crucial to achieving the requirements for future missions to ; however, many missions implement a unique controller which are specific. Here we look at the implementation of neural networks as a baseline controller that will work for a variety of different spacecraft. To accomplish this, a simulation is developed and validated with the Apollo controller. A feedforward neural network controller is then analyzed and compared to the Apollo case.

iii TABLE OF CONTENTS

LIST OF FIGURES ...... vii

LIST OF TABLES ...... viii

LIST OF SYMBOLS ...... ix

CHAPTER 1: INTRODUCTION ...... 1

CHAPTER 2: MODELING ...... 3

Dynamics ...... 3

Coordinate Systems ...... 4

Derivation ...... 5

Angular Motion ...... 5

Kinematics ...... 5

Force Equations ...... 6

Environment ...... 10

Atmosphere ...... 10

Earth ...... 10

iv Mars ...... 11

Forces ...... 13

Lift and ...... 13

Gravity ...... 13

Simulation ...... 14

Solver ...... 14

CHAPTER 3: APOLLO CONTROLLER ...... 16

Overview ...... 16

Phases ...... 17

Results ...... 18

CHAPTER 4: NEURAL NETWORK CONTROL ...... 21

Introduction ...... 21

Implementation ...... 23

CHAPTER 5: CONCLUSION ...... 27

APPENDIX : CODE ...... 28

Variables.c ...... 28

v Physics.c ...... 30

Vector.c ...... 34

Main.c ...... 35

LIST OF REFERENCES ...... 40

vi LIST OF FIGURES

Figure 2.1: Time step vs. Error ...... 15

Figure 3.1: Apollo Entry Guidance Phases ...... 17

Figure 3.2: Apollo Replication Characteristics ...... 19

Figure 3.3: Apollo Replication Control and Targeting ...... 19

Figure 3.4: Apollo Replication Flight Characteristics [1] ...... 19

Figure 3.5: Apollo Replication Control and Targeting [1] ...... 19

Figure 3.6: Apollo Monte Carlo with Normal Distribution of Density ...... 20

Figure 4.1: Neural Network Illustration ...... 22

Figure 4.2: Trained Neural Network ...... 24

Figure 4.3: Neural Network Monte Carlo ...... 25

vii LIST OF TABLES

Table 1.1: Summary of Previous Successful Mars EDL Missions [2][3] ...... 1

viii LIST OF SYMBOLS

γ - Flight path angle ψ - Heading angle φ - Latitude θ - Longitude ω - Rotation rate σ - Roll angle ν - Gravitational parameter m - Mass

CD - Coefficient of Drag

CL - Coefficient of Lift h - Altitude

ix CHAPTER 1: INTRODUCTION

To enable the next generation of Mars landers several technical challenges need to be overcome. One of which is the capability to land accurately while maintaining acceptable acceleration and heating requirements set by the vehicle and cargo.

While Earth re-entry has become routine, they often do not have the accuracy desired for Mars mission. Additionally, Mars landings present unique challenges. To date, there have been 20 missions that intended to land on Mars, of which only 7 were successful [4]. A summary of these missions is given in Table 1.1.

Table 1.1: Summary of Previous Successful Mars EDL Missions [2][3]

Viking 1/2 MPF MER-A/B Phoenix MSL Year 1976 1997 2004/2008 2008 2010 Entry From Orbit Direct Direct Direct Direct Guidance Unguided Unguided Unguided Unguided Apollo Guidance Entry Velocity (m/s) 4700 7260 5400/5500 5500 5900 Entry Flight Path Angle -17 -14.06 -11.49/11.47 -13 -15.5 (deg.) Ballistic Coefficient 64 63 94 70 115 (kg/m2) Entry Mass (kg) 992 584 827/832 600 2920 Lift to Drag Ratio 0.18 0 0 0 0.24 Diameter (m) 3.5 2.65 2.65 2.65 4.6 3-σ Landing Ellipse Major 280 200 80 100 20 Axis (km) 3-σ Landing Ellipse Minor 100 100 12 21 10 Axis (km) Total Integrated Heating 1100 3865 3687 2428 6185 (J/m2) Peak Heating Rate 26 100 44 58 155 (W/cm2)

1 Unfortunately, only one of the missions used guided entry. This was the , which carried the Curiosity rover. It had the most accurate landing, on the order of 10,000 meters. Despite this is an order of magnitude improvement over previous misstions literature has suggested that future manned missions will require a landing accuracy of 10 to 100 meters, a further two orders of magnitude improvement [2].

In literature, there are generally two approaches taken to accomplish this. One method is to gen- erate a reference trajectory with a controller implemented to make corrections and keep the space- craft on this trajectory. This reference trajectory will specify a desired profile and landing location that the spacecraft will attempt to follow throughout entry. The alternative is a predictor-corrector controller. This method continuously predicts a final landing state and then attempts to move its predicted landing using control.

To achieve this increased accuracy requirement, robust guidance methods coupled with new space- craft must be developed that to handle large amounts of uncertainty including unknown flight char- acteristics, positional uncertainty, and most notably a significant amount of atmospheric uncer- tainty. This thesis will begin by developing a model to simulate atmospheric entry. The controller used for Apollo will then be implemented with an Earth entry to validate the model. Next, the Apollo controller is adapted for Mars entry. Finally, we will look at using neural networks to control a spacecraft during entry.

2 CHAPTER 2: MODELING

Before analyzing a controller, we must find a way to test it. Since there are few publicly available programs for this, we develop our own simulation. This chapter will discuss the development of that simulation, starting with dynamics and then move into each of the models used to find the forces acting on the spacecraft.

Dynamics

We will begin with deriving the equations of motion. These equations have been derived many times before. We will choose to follow notation similar to Introduction to Aerodynamics Reentry; however, slightly different assumptions will cause variation [5]. The assumptions made are stated below.

• Point Mass • Constant mass • Non-rotating • No thrust • Drag acts in the direction opposite to velocity • Lift is perpendicular to velocity • is direction along a vector from point mass to the center of the planet

3 Coordinate Systems

Our derivation begins by defining several coordinate systems. The Planet Fixed Coordinate Frame

(OX1Y1Z1) has its origin at the center of the planet. The x1-axis points to the vernal equinox, the

z1-axis points to the North Pole, and they y1-axis is define as eˆx1 × eˆz1 =e ˆy1 .

The Vehicle Pointing System (OX2Y2Z2) has its origin at the planet’s center. After rotating the

Planet Fixed Coordinate system with latitude (φ) and longitude (θ), the x2-axis is collinear with

the vehicles position vector, the y2-axis is parallel to the equatorial plane, and the z2-axis completes the right-handed system.

        eˆx cos(−φ) 0 −sin(−φ) cos(θ) sin(θ) 0 eˆx  2       1          eˆ  =  0 1 0  −sin(θ) cos(θ) 0 eˆ  (2.1)  y2       y1          eˆz2 sin(−φ) 0 cos(−φ) 0 0 1 eˆz1

We now define two angles. The flight path angle, γ, is the angle between the local horizontal plane, or plane passing through the vehicle and orthogonal to ~r, and velocity, V~ . The heading angle, ψ, represents the direction of travel over the planet’s surface. It is properly defined as the angle between the local parallel of latitude and the projection of V~ on the local horizontal plane. It is positive in the right-hand direction around the x2-axis [5].

Using these angles, we can define a Velocity Referenced Coordinate System (OX0Y 0Z0). First, we

0 0 will rotate OX2Y2Z2 about the x2-axis by ψ. Then we will rotate about z by γ so that y is aligned with V~ .         0 eˆ cos(γ) −sin(γ) 0 1 0 0 eˆx  x      2          eˆ0  = sin(γ) cos(γ) 0 0 cos(ψ) sin(ψ) eˆ  (2.2)  y      y2   0        eˆz 0 0 1 0 −sin(ψ) cos(ψ) eˆz2

4 Derivation

Angular Motion

The derivation will start with defining the angular motion between the Planet Fixed Coordinate System and the Vehicle Pointing Coordinate System. This is accounted for by considering the rate of change in latitude and longitude. We will take this to be Ω.

˙ ˙ Ω = θeˆz1 − φeˆy2 (2.3) or ˙ ˙ ˙ Ω = θsinφeˆx2 − φeˆy2 + θcosφeˆz2 (2.4)

Kinematics

The coordinate systems defined above specify that x1 is collinear with ~r and thus

~r = reˆx2 (2.5)

Similarly, ~ 0 V = V eˆx (2.6)

0 By transforming eˆx into the Vehicle Pointing System we get the following.

~ V = (V sinγ)ˆex1 + (V cosγcosψ)ˆey1 + (V cosγsinψ)ˆez1 (2.7)

5 Now relating the derivative of ~r in OX1Y1Z1 and OX2Y2Z2 we get the following.

d~r d~r 1 = 2 + ω × r (2.8) dt dt 2/1

d~r V~ = 2 + Ω × ~r (2.9) dt

~ ˙ ˙ V =r ˙eˆx2 + (rθcosφ)ˆey2 + (rφ)ˆez2 (2.10)

Equating 2.7 and 2.10 we can get equations for r˙, θ˙, and φ˙.

r˙ = V sin(γ) (2.11)

V cos(γ)cos(ψ) θ˙ = (2.12) rcos(φ)

V cos(γ)sin(ψ) φ˙ = (2.13) r

Force Equations

We can now begin to write the equations of motion. We can first sum all of the forces, F~ , where L~ is lift force, D~ is drag force, and G~ is the force of gravity.

dv d2r F~ = L~ + D~ + G~ = m = m (2.14) dt dt2

6 Drag is defined as the force acting opposite the direction of motion.

~ 0 D = −Deˆy = −(Dsinγ)ˆex2 − (Dcosγsinψ)ˆey2 − (Dcosγsinψ)ˆez2 (2.15)

Lift is defined as being perpendicular to the direction of motion and the bank angle, σ, defines the roll of the spacecraft. When σ = 0 the lift force is in the collinear with the projection of r˙ on the plane perpendicular to V~ . We designate this the z-axis of a new coordinate system (OX00Y 00Z00),

00 0 0 0 0 eˆz , which we obtain by rotating OX Y Z by σ about y .

      eˆ00 sin(σ) 0 −cos(σ) eˆ0  x    x       eˆ00 =  0 1 0  eˆ0  (2.16)  y    y  00    0  eˆz cos(σ) 0 sin(σ) eˆz

00 00 Note that eˆy is still collinear with the velocity vector and thus we will refer to to eˆz as OXpYV ZL, where the ”p” in the x00-direction is representative of pitch. Lift can then be defined as follows.

~ 00 L = Leˆy = L(cosσcosγ)ˆex2 + L(−cosσsinγcosψ − sinσsinψ)ˆey2

+ L(−cosσsinγsinψ + sinσcosψ)ˆez2 (2.17)

Finally, gravity can be written as follows.

~ G = Geˆx2 (2.18)

7 Now, completing 2.14 we get:

dV~ m = L~ + D~ + G~ dt

= (L(cosσcosγ) − D(sinγ) − G)ˆee2

+ (L(−cosσsinγcosψ − sinσsinψ) + D(−cosγcosψ))ˆey2

+ (L(−cosσsinγsinψ + sinσcosψ) + D(−cosγsinψ))ˆez2 (2.19)

Similar to 2.8 we can now write

dV~ dV~ 1 = 2 + Ω × V~ (2.20) dt dt 2/1

~ dV1 ~ where dt is F . We can then find that

dV~ 2 = (V sinγ + V γcosγ˙ )ˆe + dt x2 ˙ (V cosγcosψ − V γsinγcosψ˙ − V ψcosγsinψ)ˆey2 +

(V cosγsinψ − V γsinγsinψ˙ + V ψcosγcosψ˙ ) (2.21)

and

8 ~ ˙ ˙ Ω × V = V (−φcosγsinψ − θcosφcosγcosψ)ˆex2 + ˙ ˙ V (θcosφsinγ − θsinφcosγsinψ)ˆey2 + ˙ ˙ V (θsinφcosγcosψ + φsinγ)ˆez2 (2.22)

Combining the previous two equations with equations with 2.12 and 2.13 we get the following.

dV~ V 2cos2γ = (V˙ sinγ + V γcosγ˙ − )ˆe + dt r x2 V 2 (V˙ cosγcosψ − V γsinγcosψ˙ − V ψcosγsinψ˙ + cosγcosψ(sinγ − tanφcosγsinψ))ˆe + r y2 V 2 (V˙ cosγsinψ − V γsinγsinψ˙ + V ψcosγcosψ˙ + cosγ(cosγcos2ψtanφ + sinγsinψ))ˆe r z2 (2.23)

Finally, the previous equation can be equated with F~ , yielding the remaining equations for V˙ , γ˙ , and ψ˙. D G V˙ = − − sin(γ) (2.24) m m

 L G V 2  γ˙ = cos(σ) − cos(γ) + cos(γ) /V (2.25) m m r

 Lsin(σ) V 2  ψ˙ = − cos(γ)cos(ψ)tan(φ) /V (2.26) mcos(γ) r

9 Environment

To calculate the values of L, D, and G in the previous equations, models are implemented for the , gravity, and aerodynamic characteristics of the vehicle.

Atmosphere

Atmospheric modeling is crucial for an accurate simulation of a planned Mars mission, and many researchers are working on this topic; however, the uncertainty in atmospheric conditions can still be as high as 25-200% [6] [7] [8]. Due to this large amount of uncertainty little is lost by using a simplified atmospheric model along with Monte Carlo simulations that will propagate error throughout entry. Additionally, since Apollo’s guidance will be implemented first on Earth, we will need different models for Earth and Mars.

Earth

The Earth’s atmosphere is represented with a standard atmospheric model supplied by NASA [9]. This model has three separate curves to represent the troposphere, lower stratosphere, and upper stratosphere.

Starting from the surface of Earth and going up to 11,000 meters, the temperature and pressure are given by 2.27 and 2.28, T = 15.04 − 0.00649h (2.27)

T + 273.155.256 P = 101.29 (2.28) 288.08

10 where T is temperature in degrees Celsius, h is altitude in meters, and P is pressure in kilo-Pascals. Continuing up in altitude the temperature and pressure for the lower stratosphere, 11,000 to 25,000 meters, is given by 2.29 and 2.30. T = −56.46 (2.29)

P = 22.65e1.73−0.000157h (2.30)

Finally, the pressure and temperature in the upper stratosphere, above 25,000 meters, is given by 2.31 and 2.32. T = −131.21 + 0.00299h (2.31)

T + 273.15−11.388 P = 2.488 (2.32) 216.6

Using these pressures and temperatures we use 2.33 to find density, ρ.

P ρ = (2.33) 0.2869(T + 273.15)

Mars

The atmospheric model for Mars is also published by NASA based on data from the Mars Global Surveyor Mission [10]. This model is broken up into two segments. A lower atmosphere from the surface to 7,000 meters and an upper atmosphere form 7,000 meters up.

11 For the lower atmosphere the temperature is given by 2.34.

T = −23.4 − 0.00222h (2.34)

Then, for the upper atmosphere 2.35 is used.

T = −31 − 0.000998h (2.35)

Regardless of altitude 2.36 and 2.37 are used to calculate the pressure and density.

P = 0.699e−0.00008h (2.36)

P ρ = (2.37) 0.1921(T + 273.1)

Finally, the speed of sound is calculated using 2.38 for both regardless of altitude

p a = γRT (2.38) where a is the speed of sound, γ is the ratio of specific heats, R is the constant, and T is again temperature. This can then be used to calculate the with 2.39.

V Ma = (2.39) a

12 Forces

We can now use this atmospheric model to calculate the lift and drag forces. After which, the gravity model will be discussed.

Lift and Drag

We will assume that our lift and drag forces are proportional to the dynamic pressure. Addition- ally, density from the atmospheric model and a precalculated value for the coefficient of lift and coefficient of drag will be used, as seen in 2.40 and 2.41.

1 F = C ρV 2A (2.40) drag 2 D

1 F = C ρV 2A (2.41) lift 2 L

The drag and lift coefficient are often a function of Mach number. For the Earth entry, parameters matching that of Apollo are assumed and implemented with a lookup table based on data in [5].

Gravity

Gravity is modeled using a Newton’s law of universal gravitation with a gravitational parameter of

m3 m3 4.282837E13 s2 for Mars and 3.986004418E14 s2 for Earth. This method assumes point masses for the planet and spacecraft. Thus the force of gravity becomes a function of only altitude.

13 Simulation

Solver

The simulation used is written in C and the post-processing of data is done in MATLAB. The solver uses a first order implementation of Euler’s Method using the equations of motion derived previously. A test case was used to help validate the system. There was no noise added to any of the variables and the following initial conditions were used with varying time steps. • Point Mass • Constant Mass of Spacecraft: 2920 kg • Constant Drag Coefficient: 1.5965 • Constant Lift Coefficient: 0.766322 • Flight Path Angle (γ): -6 degrees • Velocity: 11033.76 m/s • Latitude (φ): 0 degrees • Longitude (θ): 0 degrees • Altitude: 121920 meters • Heading Angle (ψ): 0 degrees

This case has a heading angle of 0 degrees, meaning there should be no change in latitude, thus z should be 0 and we can convert the final position to (OX1Y1). After conversion the final z-position for all time steps was less than 10−8 meters. The variation in the x and y-position are plotted in figure 2.1.

Based on this data we expect an error on order of a few meters for a time step of 10−2 seconds and we will use this for the remainder of the thesis.

14 Figure 2.1: Time step vs. Error

15 CHAPTER 3: APOLLO CONTROLLER

Overview

The Apollo reentry controller has been flight proven on all of the Apollo missions and adapted for use on the only Mars with guidance. During its original design, the high-level goals were to have a large error handling capability, use explicit techniques where possible, and adapt to the dig- ital computer which is shared with several other mission phases [1]. Notably, but understandably, landing accuracy is not one of the three main mission goals. A detailed explanation can be found in Reentry Guidance for Apollo by Morth, but an explanation of each phase will be outlined here [1].

This controller, like many of the other methods in literature, treats downrange and lateral as sepa- rate controls. The downrange distance is controlled by varying the amount of roll. This is visual- ized best by an that had an engine failure and cannot change pitch. By remaining upright the gliding distance will be near maximum, but as it begins to roll, it will begin to descend faster and faster. Once inverted it will be on the path with the shortest range. Independently, the lateral range is controlled by selecting the direction of this roll (left or right). By following an ”S” pattern, the craft can ensure it never gets too far from the target laterally. A typical flight may switch roll direction 5 or more times. The proper timing of these, particularly near the end, can minimize the lateral error at the point of deployment. It is important to note that while these roll reversals only last a few seconds, there is no range control during a roll reversal.

To carry out the above method, the Apollo controller is broken up into several functions. These functions are targeting, initial roll, huntest, up-control, ballistic phase, and final phase. A nominal trajectory is shown in the following figure, and each phase is labeled.

16 Figure 3.1: Apollo Entry Guidance Phases

Phases

Entry starts with a fixed initial roll to limit fuel consumption when there is little or no control authority. Once the spacecraft experiences more than 0.05g of acceleration, control begins. From here the controller may do a number of things depending on where it things the spacecraft is in reentry. If the velocity is low up-lift is called, and if the entry is shallow down-lift is called.

This huntest section then checks if maintaining a constant L/D will result in the desired range. If it is predicted to overshoot the desired range, then it enters a constant drag control which uses pro- portional controller based on drag and altitude. Additionally, it will predict the correct conditions

17 for the start of up-control.

The up-control phase is what makes Apollo a skip entry method. This phase uses a self-generated reference to bring the spacecraft back up to the edge of the atmosphere at which point it becomes ballistic again.

Then the final, and most relevant, phase begins. This phase is based on a stored nominal trajectory that is used as a lookup table based on velocity. Throughout the development of the controller the origin of the reference trajectory has changed, with previous designs using a simple analytic for- mula based on the equilibrium glide concept; however, Morth points out that the range calculation can be simpler for vehicles with low control authority such as Apollo [1].

Throughout the majority of the entry procedure, the lateral command is selecting the roll direction simultaneously. Once the spacecraft reaches a lateral range about half of its total lateral range capability the roll direction is revered, and it again begins to move toward the target. Additionally, a g-limiter implemented that will override the commanded roll angle to avoid exceeding the g-limit.

Results

This controller was implemented and run on Earth and the results are plotted in the following two figures. A similar case from Morth shown for comparison; however, not all of the initial conditions are precisely known. Some other notable discrepancies include the atmospheric model used as well as the spacecraft flight characteristics.

Using this same case a Monte Carlo simulation was then run for 3000 cases with a normal distri- bution applied to the density. The results are plotted in figure 3.6, where the target is plotted with a red circle. Interestingly, the downrange error is more significant than the lateral error.

18 Figure 3.2: Apollo Replication Flight Char- Figure 3.3: Apollo Replication Control and acteristics Targeting

Figure 3.4: Apollo Replication Flight Char- Figure 3.5: Apollo Replication Control and acteristics [1] Targeting [1]

19 Figure 3.6: Apollo Monte Carlo with Normal Distribution of Density

20 CHAPTER 4: NEURAL NETWORK CONTROL

Neural networks are very versatile and can be trained to handle many situations, even without prior knowledge of the system. Ping Lu described the benefit of having an entry method capable of dealing with a variety of spacecraft [11]. Here we are proposing the use of neural networks to accomplish this. This section looks at the implementation of neural networks as a method of controlling a spacecraft during atmospheric entry.

Introduction

Before beginning, a brief introduction to neural networks may be beneficial. Neural networks were inspired by biology and can be seen as a replication of neurons within the brain. They work by using a number of nodes and node connections, where each of these connections has a weight. The simplest form of neural network is a feed forward neural network, where for a given set of inputs there is an output without any loops or cycles. These neural networks are arranged in layers, where each layer contains a number of nodes. This can be visualized in figure 4.1. This figure has an input layer with two nodes (left), two hidden layers with 3 nodes each (center), and an output layer with 2 nodes (right); however, this need not be symmetrical. Each line between nodes represents a connection that has a numerical weight, W, associated with it.

Working from left to right (input to output), the inputs are multiplied by the weight of each of their connections. The next layer is then made up of the sum of these incoming connections. This sum of values is then put into a sigmoid function that normalizes the value. A typical sigmoid function

21 Figure 4.1: Neural Network Illustration

is shown in 4.3 where the range is (-1,1).

1 y = (4.1) 1 + e−x

As an example if I1, I2, and I3 were 1, 2 and 3 respectively and W1, W2, and W3 were 4, 5, and -6 then L1,1 would be 0.018 as calculated below.

1 = −0.01799 (4.2) 1 + e−(1∗4+2∗5+3∗−6)

This same calculation is repeated throughout the neural network until the outputs, O1 and O2, are found. For a neural network to be useful, these weights must be selected or trained for their specific purpose. To train the neural networks, the desired input and outputs are required. Then back propagation of error is used to update the weights. Depending on the size of your neural network this can be computationally expensive; however, if there is only offline learning (prior to flight) this will only need to be done once per spacecraft/planet.

22 In addition to the values of each weight, the number of nodes and number of hidden layers can also be selected to better accommodate the goals. It has been shown, that given enough nodes 3 layers can represent any nonlinear function [12]. For more complex functions, a greater number of nodes are needed, while the addition of nodes and layers increase the resources needed to train the neural network.

Implementation

Neural networks are used in a wide variety of applications, and thus great libraries already exist. For this work, I have chosen to use the Fast Artificial Neural Network (FANN) library due to the easy implementation [13]. As mentioned earlier, to properly train a neural network the desired outputs for a given set of inputs need to be known. First, we look at using a neural network to replicate Apollo, using this to generate the desired outputs. From there, we will look at the possibility of using a second neural network to generate these inputs and outputs.

To replicate Apollo a neural network was chosen to contain 11 input neurons, 3 hidden layers with 1000 neurons each, and a single output neuron. The 11 inputs represent acceleration, time, 3 positional values, 3 velocity values, and 3 target position values. The output neuron represents our control variable, bank angle.

As explained earlier, neural networks utilize sigmoid functions at each node to normalize the data. These bound the value at each node, preventing one large input from dominating the rest. Here, the sigmoid function chosen, is symmetric and seen in 4.3, with its derivative in 4.4.

y = tanh(s ∗ x) = 2/(1 + e−2∗s∗x) − 1 (4.3)

23 Figure 4.2: Trained Neural Network

d = s ∗ (1 − (y ∗ y)) (4.4)

Here, x is the input, y is the output, s is steepness, and d is the derivative. The steepness is kept at its default value of 0.5. This symmetric sigmoid function is preferred to another commonly used alternate, y = 1/(1 + e−x), because it allows positive and negative values to keep their sign. This is particularly helpful for positive and negative roll directions.

In figure 4.2 you can see the results of the trained neural network that closely matches Apollo. Notably, near the end of flight, there are discontinuities that are not seen in Apollo. The Monte Carlo results are then shown in figure 4.3. Similar to Apollo it shares the same distribution shape; however, the target location is far outside of the plot.

As expected, this controller is much less accurate than Apollo when disturbances are applied. This is primarily because it is trained to follow specific commands for each state instead of being trained

24 Figure 4.3: Neural Network Monte Carlo

to maximize accuracy.

The next step would be to implement a self-learning neural network that can be trained to maximize accuracy. An attempt was made to implement the approach followed by Nguyen and Widrow [14]. To accomplish this, a neural network is first trained to emulate the physics of the problem. This neural network can then work backwards from the target position and find the proper control for each state. This data can then be used to train a separate control neural network. Once trained, the control neural network can be applied to the correct physics again (as opposed to the neural network emulator).

Unfortunately, the emulator neural network could not be trained with a sufficient level of accuracy on a personal computer. Due to the highly nonlinear system, a large number of nodes are required in order to fit the system properly. If a fewer amount of data points are used, it is easy to train the neural network; however, the system is then over-fit and often artificially large forces will cause the spacecraft to escape the planet, rendering the simulation useless. While there is no doubt that this

25 technique should work for a more complex system, it will require more computing power and/or more sophisticated training algorithms.

26 CHAPTER 5: CONCLUSION

In this thesis, we developed a simulation for atmospheric entry, looked at the application of the Apollo’s entry guidance, and explored into the use of neural networks. While Apollo is a great baseline, significant improvements can be made, and neural networks appear to be a promising way to achieve this for a variety of cases.

More work is needed to determine the feasibility of neural networks for future missions; however, there are many areas that have not yet been explored. Aside from the addition of more computing power, the next steps may include implementing a recurrent neural network and online learning, as these may allow for better prediction and handling of large uncertainties.

27 APPENDIX : CODE

The following code was used as the baseline case with no control (constant bank angle) and no uncertainty. It consists of 4 files. Variables.c declares global variables that will be used. Physics.c contains functions that find atmospheric conditions and appropriate forces on the spacecraft. Vec- tor.c defines functions that allow for simple vector calculations, like dot product and cross product. All of this is then wrapped up in Main.c.

Variables.c

#define mu 3.986004418E14 //42828370000000 double F_lift; double F_drag; double F_grav; double roll; double velocity; double flightPath; double heading_angle; double r; double longitude; double latitude;

28 double target[3]; double h; double density, speed_of_sound; // kg/mˆ3 double elapsed_time; double m_sc; double Cd; double Cl; double A; double acceleration; set_variables(){ F_lift = 0; F_drag = 0; F_grav = 0;

roll = 0;

velocity = 11033.7600000000020000;

flightPath = -6 * M_PI / 180; heading_angle = 0 * M_PI / 180; r = 6492920.000000; longitude = 0.0; latitude = 0.0;

29 h = 0; density, speed_of_sound; // kg/mˆ3 elapsed_time;

m_sc = 5498.22;

Cd = 2920/( 115* M_PI * pow(4.5/2,2)); Cl = 2*0.24 * Cd; A = 12.017; }

Physics.c double Atmosphere(double h){ // temp is in Celsius // pressure is in kPa // density is in kg/mˆ3 // altitude (h) is in meters // speed_of_sound is in meters/second

double temp, pressure;

//Mars pressure/temp

/* if (h < 100000){

30 pressure = 0.699 * exp( -0.00009 * h); if( h < 7000 ){

temp = -31 - 0.000998 * h; }else{

temp = -23.4 - 0.00222 * h; }

density = pressure/(0.1921*(temp + 273.1)); }else{ density = 0; }

*/ //Earth pressurre/temp //https://www.grc.nasa.gov/www/k-12/airplane/atmosmet.html if(h > 25000){

temp = -131.21 + 0.00299*h; pressure = 2.488 * pow( (temp+273.1)/216.6, -11.388 ); }else if(h > 11000){ temp = -56.46;

pressure = 22.65 * pow(M_E, (1.73 - 0.000157*h)); }else{

temp = 15.04 - 0.00649*h; pressure = 101.29*pow((temp + 273.1)/288.08, 5.256); }

density = pressure / (0.2869 * (temp+273.1));

31 //https://www.grc.nasa.gov/www/k-12/airplane/sound.html

speed_of_sound = pow( 1.4*286*(temp+273.15), 0.5); return; } double gravity(){

F_grav = mu * m_sc / pow(r,2); return 0; } double calculate_drag(){

F_drag = 0.5 * Cd * A * density * pow(velocity, 2); return 0; } double calculate_lift(){

F_lift = 0.5 * Cl * A * density * pow(velocity,2); return 0; } double rand_norm(){ double U, V, randN; U = (double) rand() / RAND_MAX; V = (double) rand() / RAND_MAX;

32 randN = pow( -2 * log(U) ,0.5) * cos(2*M_PI*V); return randN; } double Coeff_lift_drag(){ double Mach_Cl_Cd[3][13] = { {0.4 , 0.7, 0.9, 1.1, 1.2, 1.35, 1.65 , 2, 2.4, 3, 4, 10, 29.5}, {0.24465, 0.26325, 0.32074, 0.49373, 0.47853, 0.56282, 0.55002, 0.53247, 0.5074, 0.47883, 0.44147, 0.42856, 0.38773}, {0.853, 0.98542, 1.10652, 1.1697, 1.156, 1.2788, 1.2657 , 1.2721, 1.2412, 1.2167, 1.2148, 1.2246, 1.2891} };

int i = 0; while(velocity/speed_of_sound > Mach_Cl_Cd[0][i]){ i++; }

if(i>12){ Cl = Mach_Cl_Cd[1][12];

33 Cd = Mach_Cl_Cd[2][12]; }else{ Cl = Mach_Cl_Cd[1][i]; Cd = Mach_Cl_Cd[2][i]; } return 0.0; }

Vector.c

#include

double norm3(double *vector){ double result = pow( pow(vector[0],2) + pow(vector[1],2) + pow(vector[2],2),0.5); return result; }

double dot3(double *a, double *b){ double dotproduct = a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; return dotproduct; }

double cross3(double *a, double *b, double *result){ result[0] = a[1]*b[2] - a[2]*b[1];

34 result[1] = a[2]*b[0] - a[0]*b[2]; result[2] = a[0]*b[1] - a[1]*b[0]; return 0; }

//There is almost definitely a better way to do this double unit3(double *a, double *result){ double mag = norm3(a); result[0] = a[0]/mag; result[1] = a[1]/mag; result[2] = a[2]/mag; return 0; }

Main.c

#include #include #include #include

#include "variables.c" #include "Vector.c" #include "Physics.c"

35 #define r_planet 6.371E6 // meters #define m_planet 5.972E24 // kg double dt; main(){ int i, j, k, p, step; srand(time(NULL)); //Constant initialization double time, h; // Seconds

FILE *Output_timestep;

for(p=1; p<= 15; p++){ dt = pow(10,1-p/2.0); clock_t start = clock(); set_variables();

roll = M_PI;

for(step=0; step < pow(10,10); step++){

if(longitude > M_PI){

longitude -= 2*M_PI; }else if(longitude < -M_PI){

longitude += 2*M_PI;

36 } double x = r*cos(latitude)*cos(longitude); double y = r*cos(latitude)*sin(longitude); double z = r*sin(latitude); elapsed_time = dt*step; h = r - r_planet; Atmosphere(h); Coeff_lift_drag(); gravity(); calculate_drag(); calculate_lift();

acceleration = (-F_drag-F_grav*sin(flightPath)) /m_sc;

velocity += dt*(-F_drag-F_grav*sin(flightPath)) /m_sc; flightPath += dt*( F_lift / m_sc * cos(roll) - F_grav / m_sc * cos(flightPath) + pow(velocity, 2)/r*cos(flightPath) ) / velocity; heading_angle += dt*( F_lift*sin(roll)/

37 (m_sc*cos(flightPath)) - pow(velocity, 2)*cos(flightPath)* cos(heading_angle)*tan(latitude)/r) /velocity;

r += dt * (velocity * sin(flightPath) ); longitude += dt * (velocity * cos(flightPath) * cos(heading_angle)/

( r*cos(latitude))); latitude += dt * (velocity * cos(flightPath) * sin(heading_angle) / r);

if(r < r_planet){ goto next; }

} next: Output_timestep = fopen("Output_timestep.txt", "a"); fprintf(Output_timestep, "%d\t%.16f\t%.16f\t %.16f\t%.16f\t%.16f\t%.16f\t%.16f\n", p, dt,

r*cos(latitude)*cos(longitude), r*cos(latitude)*sin(longitude),

38 r*sin(latitude), r, velocity, flightPath); fclose(Output_timestep);

time = clock() - start; time = time / CLOCKS_PER_SEC; }

return 0; }

39 LIST OF REFERENCES

[1] Raymond Morth. Reentry Guidance for Apollo, volume 1. Jan 1966.

[2] Robert D Braun and Robert M Manning. Mars exploration entry, descent, and landing chal- lenges. Journal of spacecraft and rockets, 44(2):310–323, 2007.

[3] Shuang Li and Xiuqiang Jiang. Review and prospect of guidance and control for mars atmo- spheric entry. Progress in Aerospace Sciences, 69:40–57, 2014.

[4] Zhengshi Yu, Pingyuan Cui, and John L. Crassidis. Design and optimization of naviga- tion and guidance techniques for mars pinpoint landing: Review and prospect. Progress in Aerospace Sciences, 94(Supplement C):82 – 94, 2017.

[5] Kerry D Hicks. Introduction to astrodynamic reentry. Technical report, AIR FORCE INST OF TECH WRIGHT-PATTERSON AFB OH GRADUATE SCHOOL OF ENGINEERING AND MANAGEMENT, 2009.

[6] WC Engelund, RW Powell, and RH Tolson. Atmospheric modeling challenges and mea- surement requirements for mars entry, descent and landing. LPI Contributions, 1447:9025, 2008.

[7] Hilary L Justh, Carl G Justus, and Holly S Ramey. The next generation of mars-gram and its role in the autonomous development plan. 2011.

[8] Allen Chen, Ashwin Vasavada, Alicia Cianciolo, Jeff Barnes, Dan Tyler, Scot Rafkin, David Hinson, and Stephen Lewis. Atmospheric risk assessment for the mars science laboratory entry, descent, and landing system. In Aerospace Conference, 2010 IEEE, pages 1–12. IEEE, 2010.

40 [9] Glenn Research Center. Earth atmosphere model, May 2015.

[10] Glenn Research Center. Mars atmosphere model, May 2015.

[11] Ping Lu. Entry guidance: A unified method. Journal of Guidance, Control, and Dynamics, 2014.

[12] Bunpei Irie and Sei Miyake. Capabilities of three-layered perceptrons. In IEEE International Conference on Neural Networks, volume 1, page 218, 1988.

[13] Steffen Nissen. Implementation of a fast artificial neural network library (fann). Report, Department of Computer Science University of Copenhagen (DIKU), 31:29, 2003.

[14] Derrick H Nguyen and Bernard Widrow. Neural networks for self-learning control systems. International journal of control, 54(6):1439–1451, 1991.

41