Fuzzy of a Magnetically Actuated CubeSat

Alex R. Walker B.S. University of Cincinnati

A Thesis submitted to the University of Cincinnati School of Aerospace Systems in partial fulfillment of the requirements for the degree of

Master of Science in Aerospace Engineering

October 2013 Committee Chair: Kelly Cohen, Ph.D. Abstract

The problem of magnetic attitude control of a CubeSat is analyzed. Three controller types are examined: a Constant-Gain Simple PD controller, a Linear Constant-Gain Optimal PD controller

(i.e. an LQR), and a Fuzzy Gain-Scheduled PD controller. Each subsequent controller type utilizes a more-complex design algorithm. The Simple PD controller is tuned by hand iteration, the LQR is tuned using rule-of-thumb algorithms, and the Fuzzy Gain-Scheduled PD controller is designed using a Genetic Algorithm operating on two Fuzzy Inference Systems. Though the basic structures of these three controllers are identical, the differing design processes lead to different controller performance. The use of a Genetic-Fuzzy System is of particular interest, because this demonstrates the use of an intelligent algorithm to automate the controller design process. The techniques presented herein are directly applicable to any magnetically actuated that can be modeled as a rigid body, although the mass distribution, geometry, and orbit of the satellite will determine controller-specific constants.

ii

iii

Contents

Abstract ...... ii

Contents ...... iv

List of Tables...... ix

List of Figures ...... x

Nomenclature ...... xvi

Introduction ...... 1

1.1 Impetus ...... 1

1.2 Literature Review ...... 3

1.2.1 CubeSat Attitude Control ...... 3

1.2.2 Controllability and Control Algorithms for Magnetically Actuated ..... 5

1.2.3 Observability and Satellite Attitude Estimation ...... 8

1.3 Design Approach and Assumptions ...... 10

1.4 Thesis Outline ...... 13

Satellite Model ...... 15

2.1 Reference Frames ...... 15

2.1.1 Earth Centered Inertial ...... 15

2.1.2 Spacecraft-Centered Inertial ...... 17

2.1.3 Spacecraft-Centered Body-Fixed ...... 18

2.1.4 Earth-Centered Earth-Fixed ...... 19 iv

2.2 Attitude Parameterization and Kinematics ...... 20

2.2.1 Parameterization Evaluation ...... 20

2.2.2 Euler-Rodrigues Symmetric Parameters (Quaternion) ...... 22

2.3 Attitude Dynamics ...... 25

2.3.1 Momentum Equations ...... 25

2.3.2 Magnetic Control Torque ...... 27

2.3.3 Aerodynamic Drag Torque...... 28

2.3.4 Solar Pressure Torque ...... 30

2.3.5 Gravity Gradient Torque ...... 30

2.4 Linearized Attitude Model ...... 31

2.4.1 Aerodynamic Drag Torque...... 31

2.4.2 Gravity Gradient Torque ...... 33

2.4.3 Complete Linearized System Dynamics ...... 35

2.5 Modeling ...... 36

2.5.1 Earth’s Magnetic Field ...... 36

2.5.2 Orbit Propagation ...... 37

PD Controller and the LQR ...... 41

3.1 General Controller Structures ...... 41

3.2 PD Design Process...... 46

3.3 LQR Design Process ...... 46

v

3.3.1 Optimal Solution of Linear Constant-Gain Feedback Control...... 46

3.3.2 Defining the Optimal Control Problem ...... 48

3.4 Summary ...... 50

Genetic Algorithm-Tuned Fuzzy Logic System ...... 51

4.1 Fuzzy Logic Overview ...... 51

4.1.1 Fuzzy Sets and Membership Functions ...... 52

4.1.2 Fuzzy Inference System ...... 54

4.1.3 Fuzzification ...... 55

4.1.4 Inference Method ...... 55

4.1.5 Defuzzification ...... 57

4.2 Genetic Algorithm Overview ...... 57

4.2.1 Strings – Problem Parameterization ...... 58

4.2.2 Population Size ...... 59

4.2.3 Selection – Roulette Wheel ...... 59

4.2.4 Crossover ...... 60

4.2.5 Mutation ...... 61

4.2.6 Elitist Selection ...... 61

4.3 Genetic-Fuzzy System Implementation ...... 62

4.3.1 Fuzzy Inference Systems ...... 62

4.3.2 Genetic Algorithm ...... 67

vi

4.4 Summary ...... 75

Design Results ...... 76

5.1 Simple PD Design Results ...... 80

5.1.1 First Simple PD Design Snapshot ...... 80

5.1.2 Second Simple PD Design Snapshot ...... 83

5.1.3 Third Simple PD Design Snapshot ...... 84

5.1.4 Fourth Simple PD Design Snapshot ...... 86

5.1.5 Fifth Simple PD Design Snapshot ...... 88

5.1.6 Simple PD Controller Final Design ...... 90

5.2 LQR Design Results ...... 97

5.2.1 First LQR Design Snapshot ...... 98

5.2.2 Second LQR Design Snapshot ...... 99

5.2.3 Third LQR Design Snapshot ...... 101

5.2.4 Fourth LQR Design Snapshot ...... 103

5.2.5 Fifth LQR Design Snapshot ...... 104

5.2.6 LQR Final Design ...... 106

5.3 Genetic-Fuzzy Design Results...... 111

5.3.1 First Fuzzy Gain Scheduler Design Snapshot ...... 112

5.3.2 Second Fuzzy Gain Scheduler Design Snapshot ...... 114

5.3.3 Third Fuzzy Gain Scheduler Design Snapshot ...... 116

vii

5.3.4 Fourth Fuzzy Gain Scheduler Design Snapshot ...... 118

5.3.5 Fifth Fuzzy Gain Scheduler Design Snapshot ...... 120

5.3.6 Fuzzy Gain Scheduler Final Design ...... 122

5.4 Summary ...... 131

Conclusion ...... 133

6.1 Contribution of Work Completed ...... 134

6.2 Future Plans ...... 134

6.3 Recommendations for Further Work ...... 135

International Geomagnetic Reference Field Model ...... 139

Optimized Fuzzy Inference Systems ...... 142

References ...... 146

viii

List of Tables

Table 1.1. Principal moments of inertia of ArduSat estimated based on those of CP2, taken from Reference 25...... 13

Table 4.1. Inference method steps using min-max method...... 55

Table 4.2. Genetic algorithm cost function constants...... 69

Table 4.3. String partition used for genetic algorithm...... 73

Table 5.1. Initial conditions for design simulation...... 76

Table 5.2. Quantitative comparison of all controllers with just gravity gradient disturbance torque...... 127

Table 5.3. Quantitative comparison of all controllers with aerodynamic and gravity gradient disturbance torques...... 131

Table B.1. Final Fuzzy Controller proportional FIS input and output gains...... 142

Table B.2. Final Fuzzy Controller proportional FIS rule base...... 142

Table B.3. Final Fuzzy Controller derivative FIS input and output gains...... 144

Table B.4. Final Fuzzy Controller derivative FIS rule base...... 144

ix

List of Figures

Figure 1.1. TLE used for simulation of orbit propagation for ACS design...... 11

Figure 1.2. Simulated spacecraft ground track found from orbit propagation of Raiko TLE.. 12

Figure 2.1. Earth-Centered Inertial Reference Frame with respect to Earth-Centered Earth-

Fixed Reference Frame...... 17

Figure 2.2. Spacecraft-Centered Inertial Reference Frame with respect to Earth-Centered

Inertial Reference Frame...... 18

Figure 2.3. Spacecraft-Centered Body-Fixed Reference Frame with respect to Spacecraft-

Centered Inertial Reference Frame...... 19

Figure 2.4. Earth-Centered Earth-Fixed Reference Frame with respect to Longitudinal and

Latitudinal Coordinates...... 20

Figure 2.5. Comparison of radial and absolute differences in position for Keplerian, Parameter

Variation, and SGP4 orbit propagation algorithms...... 39

Figure 2.6. Comparison of magnetic field magnitude among the three orbit propagators investigated...... 39

Figure 2.7. Comparison of magnetic field direction among the three orbit propagators investigated...... 40

Figure 4.1. Triangular, Trapezoidal, Gaussian, and Sigmoidal membership functions...... 54

Figure 4.2. Fuzzy Inference Process showing: (1) Input, (2) Fuzzification, (3) Inference, and

(4) Defuzzification...... 56

Figure 4.3. Free input membership function vertex x-values (circled in red)...... 66

Figure 4.4. Free output membership function x-values (circled). Circles on membership function endpoints are equidistant from center diamond of same color...... 67

x

Figure 5.1. Uncontrolled error quaternion response...... 77

Figure 5.2. Uncontrolled body-fixed angular rate response...... 78

Figure 5.3. Uncontrolled body-fixed reference frame over all simulation time...... 78

Figure 5.4. Uncontrolled aerodynamic torque in body-fixed frame...... 79

Figure 5.5. Uncontrolled gravity gradient torque in body-fixed frame...... 79

Figure 5.6. Magnetic field strength in uncontrolled body-fixed frame...... 79

Figure 5.7. First Simple PD Controller error quaternion response...... 81

Figure 5.8. First Simple PD Controller angular rate error response...... 82

Figure 5.9. First Simple PD Controller magnetic moment response...... 82

Figure 5.10. Second Simple PD Controller error quaternion response...... 83

Figure 5.11. Second Simple PD Controller angular rate error response...... 83

Figure 5.12. Second Simple PD Controller magnetic moment response...... 84

Figure 5.13. Third Simple PD Controller error quaternion response...... 85

Figure 5.14. Third Simple PD Controller angular rate error response...... 85

Figure 5.15. Third Simple PD Controller magnetic moment response...... 86

Figure 5.16. Fourth Simple PD Controller error quaternion response...... 87

Figure 5.17. Fourth Simple PD Controller angular rate error response...... 87

Figure 5.18. Fourth Simple PD Controller magnetic moment response...... 88

Figure 5.19. Fifth Simple PD Controller error quaternion response...... 89

Figure 5.20. Fifth Simple PD Controller angular rate error response...... 89

Figure 5.21. Fifth Simple PD Controller magnetic moment response...... 90

Figure 5.22. Final Simple PD Controller error quaternion response...... 91

Figure 5.23. Final Simple PD Controller angular rate error response...... 91

xi

Figure 5.24. Final Simple PD Controller magnetic moment response...... 92

Figure 5.25. Final Simple PD Controller magnetic torque response...... 93

Figure 5.26. Final Simple PD Controller gravity gradient torque disturbance input...... 93

Figure 5.27. Final Simple PD Controller magnetic field strength time history...... 93

Figure 5.28. Final Simple PD Controller error quaternion response with both aerodynamic and gravity gradient disturbances...... 94

Figure 5.29. Final Simple PD Controller angular rate error response with both aerodynamic and gravity gradient disturbances...... 95

Figure 5.30. Final Simple PD Controller magnetic moment response with both aerodynamic and gravity gradient disturbances...... 95

Figure 5.31. Final Simple PD Controller magnetic torque response and aerodynamic and gravity gradient torque disturbance inputs...... 96

Figure 5.32. First LQR error quaternion response...... 98

Figure 5.33. First LQR angular rate error response...... 99

Figure 5.34. First LQR magnetic moment response...... 99

Figure 5.35. Second LQR error quaternion response...... 100

Figure 5.36. Second LQR angular rate error response...... 100

Figure 5.37. Second LQR magnetic moment response...... 101

Figure 5.38. Third LQR error quaternion response...... 101

Figure 5.39. Third LQR angular rate error response...... 102

Figure 5.40. Third LQR magnetic moment response...... 102

Figure 5.41. Fourth LQR error quaternion response...... 103

Figure 5.42. Fourth LQR angular rate error response...... 103

xii

Figure 5.43. Fourth LQR magnetic moment response...... 104

Figure 5.44. Fifth LQR error quaternion response...... 105

Figure 5.45. Fifth LQR angular rate error response...... 105

Figure 5.46. Fifth LQR magnetic moment response...... 106

Figure 5.47. Final LQR error quaternion response...... 107

Figure 5.48. Final LQR angular rate error response...... 107

Figure 5.49. Final LQR magnetic moment response...... 108

Figure 5.50. Final LQR error quaternion response with both aerodynamic and gravity gradient disturbances...... 108

Figure 5.51. Final LQR angular rate error response with both aerodynamic and gravity gradient disturbances...... 109

Figure 5.52. Final LQR magnetic moment response with both aerodynamic and gravity gradient disturbances...... 109

Figure 5.53. Final LQR magnetic torque response and aerodynamic and gravity gradient torque disturbance inputs...... 110

Figure 5.54. First Fuzzy error quaternion response...... 112

Figure 5.55. First Fuzzy angular rate error response...... 112

Figure 5.56. First Fuzzy magnetic moment response...... 113

Figure 5.57. Second Fuzzy error quaternion response...... 114

Figure 5.58. Second Fuzzy angular rate error response...... 115

Figure 5.59. Second Fuzzy magnetic moment response...... 115

Figure 5.60. Third Fuzzy error quaternion response...... 116

Figure 5.61. Third Fuzzy angular rate error response...... 116

xiii

Figure 5.62. Third Fuzzy magnetic moment response...... 117

Figure 5.63. Fourth Fuzzy error quaternion response...... 118

Figure 5.64. Fourth Fuzzy angular rate error response...... 118

Figure 5.65. Fourth Fuzzy magnetic moment response...... 119

Figure 5.66. Fifth Fuzzy error quaternion response...... 120

Figure 5.67. Fifth Fuzzy angular rate error response...... 120

Figure 5.68. Fifth Fuzzy magnetic moment response...... 121

Figure 5.69. Final Fuzzy error quaternion response...... 122

Figure 5.70. Final Fuzzy angular rate error response...... 122

Figure 5.71. Final Fuzzy magnetic moment response...... 123

Figure 5.72. Final Fuzzy proportional gain response...... 123

Figure 5.73. Final Fuzzy derivative gain response...... 124

Figure 5.74. Final Fuzzy error quaternion response with both aerodynamic and gravity gradient disturbances...... 128

Figure 5.75. Final Fuzzy angular rate error response with both aerodynamic and gravity gradient disturbances...... 128

Figure 5.76. Final Fuzzy magnetic moment response with both aerodynamic and gravity gradient disturbances...... 129

Figure 5.77. Final Fuzzy proportional gain response with both aerodynamic and gravity gradient disturbances...... 129

Figure 5.78. Final Fuzzy derivative gain response with both aerodynamic and gravity gradient disturbances...... 130

xiv

Figure 5.79. Final Fuzzy magnetic torque response and aerodynamic and gravity gradient torque disturbance inputs...... 131

Figure B.1. Final Fuzzy Controller proportional FIS quaternion error input membership functions...... 143

Figure B.2. Final Fuzzy Controller proportional FIS angular rate error input membership functions...... 143

Figure B.3. Final Fuzzy Controller proportional FIS output membership functions...... 143

Figure B.4. Final Fuzzy Controller derivative FIS quaternion error input membership functions...... 144

Figure B.5. Final Fuzzy Controller derivative FIS angular rate error input membership functions...... 145

Figure B.6. Final Fuzzy Controller derivative FIS output membership functions...... 145

xv

Nomenclature*

Scalar and Vector Quantities

푎 Exponential constant of linear first-order differential equation solution

퐴 Matrices used to derive PD feedback law – with subscripts

퐴 State equation matrix multiplying state vector – without subscripts

푏 Magnetic field scalar – with subscripts

퐵 Magnetic field vector

퐵 State equation matrix multiplying control input

푐 Speed of light

푐퐷 Output-multiplying gain of derivative feedback FIS

푐퐷,푞 Input-multiplying gain for quaternion error of derivative feedback FIS

푐퐷,휔 Input-multiplying gain for angular rate error of derivative feedback FIS

푐푃 Output-multiplying gain of proportional feedback FIS

푐푃,푞 Input-multiplying gain for quaternion error of proportional feedback FIS

푐푃,휔 Input-multiplying gain for angular rate error of proportional feedback FIS

퐶 Constant of linear first-order differential equation solution

퐶퐷 Drag force coefficient

퐷 Derivative feedback scalar or matrix

푓 General function of proportional-derivative state feedback control law

퐹 Force vector

* Nomenclature for Appendix A is self-contained, as it uses many alternative definitions of the variables defined in the rest of the thesis. Terms there are defined as used. xvi

퐹푒 Solar flux constant

ℎ Angular momentum vector

퐼 Identity matrix – used with subscripted n×n

퐼 Mass moment of inertia matrix – with axis and frame subscript(s)

퐽 Cost function value

푘 Cost function constants – with subscripts

퐾 Feedback gain matrix produced by constant-gain LQR algorithm

퐾퐷 Derivative FIS output before output gain

퐾푃 Proportional FIS output before output gain

푚 Magnetic moment scalars – with axis subscripts

푚퐷 Linearized drag matrix element – with additional number subscripts

푚퐺 Linearized gravity gradient matrix element – with additional number subscripts

푀 Magnetic moment vector

푀퐷 Matrix for linearized drag dynamics

푀퐺퐺 Matrix for linearized gravity gradient dynamics

푃 Proportional feedback scalar or matrix

푃 Matrix solution to infinite-horizon Ricatti equation

푞 Quaternion vector

푄 Positive-definite state history weighting matrix for LQR algorithm

푟 Scalar component of three-dimensional vector

푟̅ Three-dimensional vector used for transformation demonstration

푅퐸/푆퐶 Vector from spacecraft center of gravity to Earth’s center of gravity

푅 Positive-definite control history weighting matrix for LQR algorithm

xvii

푆 Planform area used in drag force/torque calculation – with or without subscripts

푆 Positive-semi-definite final state weighting matrix for LQR algorithm

푡 Time

푇 Coordinate transformation matrix

푢 Eigen Axis – with or without subscripts

푢 Control input vector in matrix state equations

푣 Complex vector portion of quaternion

푉 Velocity vector

푤 First quaternion parameter, real portion of quaternion

푥 Second quaternion parameter, first complex parameter of quaternion

푥 State vector in matrix state equations

푦 Third quaternion parameter, second complex parameter of quaternion

푧 Fourth quaternion parameter, third complex parameter of quaternion

훼 Angular acceleration

훿 Displacement of center of pressure from center of gravity

∆ Denotes change, usually small

휃 Angle about which a coordinate system must rotate about an Eigen Axis to become

coincident with another coordinate system

휇퐸 Specific gravitational constant (or geopotential) of Earth

휌 Atmospheric density

휏 Torque vector or scalar – with a subscript, a scalar

휑 Angle used to derive quaternion rate equations

휔 Angular rate vector or scalar – with a subscript, a scalar

xviii

휔̇ Angular rate time rate of change vector or scalar – with a subscript, a scalar

¢ Constant of linear first-order differential equation solution (¢ = 푒퐶)

Subscripts

∞ Indicates freestream conditions

1 First of a series or indicates row/column number of a matrix

2 Second of a series or indicates row/column number of a matrix

3 Third of a series or indicates row/column number of a matrix

푎푣푒 Average of a quantity

퐵 Used to indicate body reference frame

퐶 Used to indicate control torque

퐷 Indicates terms dealing with aerodynamic drag

푒푟푟 Error terms

푓 Denotes final condition

퐺퐺 Used to indicate gravity gradient torque

퐼 Used to indicate inertial reference frame

푚푎푥 Maximum allowable value

푛표푚 Nominal conditions, about which linearization takes place

푆푃 Used to indicate solar pressure force/torque

푥 Used to denote x-component of a vector quantity

푦 Used to denote y-component of a vector quantity

푧 Used to denote z-component of a vector quantity

훼 Used to indicate control for desired angular acceleration

xix

Chapter 1

Introduction

The aim of this thesis is to design several three-axis attitude controllers for a magnetically- actuated CubeSat and analyze the solutions with respect to one another and with respect to the anticipated level of control achievable with solely magnetic actuation. In this chapter, the impetus for the current work is presented. A literature review gives a brief introduction on the history of CubeSat attitude control then outlines previous work on controllability of and algorithms utilized for solely magnetically actuated satellites. Algorithms for attitude estimation are also briefly discussed. Then, the approach of the present work is discussed. Finally, an outline for the rest of the thesis is given.

1.1 Impetus

The work completed in this thesis is motivated by the design of the Attitude Control System

(ACS) of the first CryoCube™, a CubeSat designed and built by NASA Kennedy Space Center

(KSC) and Sierra Lobo, Inc. (SLI). The purpose of the first CryoCube™, known as CryoCube-1, is to study the phenomena associated with condensation and the transient and steady-state behaviors of cryogens in a microgravity environment by imaging the liquid-vapor interface of liquid oxygen (LOX) to be generated on-orbit. The space and mass required for the experiment

1 tank, imaging hardware, experiment peripheral electronics, onboard computer, and onboard radio as well as the stringent thermal requirements, which have necessitated a low power consumption/dissipation system with the ability to attain various attitude configurations with moderate pointing accuracy, have driven the ACS design toward solely three-axis magnetic actuation. The reason magnetic actuation is most desirable for CryoCube-1’s ACS is that magnetorquers, which utilize current flowing through looped wires to produce a magnetic moment in the local magnetic field thereby producing a torque on the spacecraft, are a relatively low-power, lightweight, and compact means by which to provide three-axis control. In comparison, control moment gyros and reaction wheels, which utilize electric motors to angularly accelerate masses to produce a torque on the spacecraft, consume more power and are more-massive. Additionally, gas thrusters are undesirable because they require: fuel or pressurized gas, which is a non-renewable resource on a spacecraft; a tank to contain the propellant; tubing; and nozzles. This added size and complexity is not a feasible ACS design for

CryoCube-1.

In addition to driving hardware selection requirements, the thermal and power management requirements of CryoCube-1 have driven the initial attitude control performance requirements used for the work in this thesis. In accordance with these requirements, the desired attitude of the spacecraft is such that the X-Axis is sun-pointing and the Z-Axis is approximately parallel to the

Celestial North Pole, a nearly-inertial orientation over the course of a day. It is desired to attain this attitude from about sixty degrees initial angular error, corresponding to an initially nadir- pointing attitude in the expected orbit. This initial large-angle maneuver should be accomplished in as short a time as possible, such that the spacecraft settles to a “steady state” with an attitude error less than ten degrees and an attitude rate error less than 10-3 rad/sec.

2

Although CryoCube-1’s ACS design is the main motivation for this thesis, this work develops control algorithms for a 1U CubeSat (a 10 cm cube) while CryoCube-1 is a 3U CubeSat (a 10 cm

× 10 cm × 30 cm rectangular prism). The reason for this seeming mismatch from design to implementation is that the fuzzy algorithm is to be tested aboard another CubeSat for model and design algorithm validation purposes. NanoSatisfi, Inc., a company started via a Kickstarter campaign to launch a publicly available CubeSat, will allow an attitude control algorithm to be tested aboard their ArduSat satellite, a 1U CubeSat whose primary payload is a bank of 16

Arduino Uno microcontrollers which will be used to run programs developed by NanoSatisfi’s paying customers. Data obtained from the ArduSat attitude control test will be used to analyze controller performance with respect to both the simulated and actual system. Following algorithm validation, the design and analysis will be performed for CryoCube-1’s ACS, applying appropriate lessons learned from test results analysis.

1.2 Literature Review

The general literature on satellite attitude determination and control is extensive, including topics such as: attitude representations and parameterizations; attitude determination sensors, algorithms, and observability; and attitude control algorithms, ACS hardware configurations, and controllability. This section reviews attitude determination and control literature relevant only to solely magnetically actuated .

1.2.1 CubeSat Attitude Control

A comprehensive list of all attitude control configurations ever utilized on a CubeSat currently does not exist and may not ever exist due to the proprietary nature of some CubeSats.

However, Reference 1 lists all CubeSat missions launched prior to 2009 and includes information on each CubeSat’s Attitude Determination and Control System (ADCS). According

3 to this list, the majority of the CubeSats built before 2009 were designed with solely magnetic actuation. In general, CubeSats whose missions included Earth observation, general purpose cameras, attitude determination and/or control experiments, and communication tests tended to utilize magnetic actuation. Permanent and hysteresis rods also tended to be chosen for

Earth observation and communication CubeSats. Those satellites that were used to measure radiation tended not to specify control type. Two of the CubeSats launched prior to 2009 did not use any type of control – one was designed as a short-lived Earth observation satellite, and the other was used for radiation measurement and Earth observation. Finally, the four CubeSats that are known to have used momentum wheels and/or gas thrusters were either attempting to demonstrate the use of these technologies on CubeSats or attempting to utilize these technologies to achieve high pointing accuracy for Earth or gamma ray observation. Two of these CubeSats never made it to orbit, one with momentum wheels never recovered from an unintended fast spin mode, and only one was apparently highly successful.

In all, only about 55% of the CubeSats in operation prior to 2009 appear to have exhibited some degree of success. The high failure rate is partially due to the failure of a launch vehicle which was carrying fourteen CubeSats. Nearly two thirds of the CubeSats designed with magnetic actuators failed. However, only about five of the sixteen CubeSats that used magnetic actuators were aboard the failed launch vehicle. The other five magnetically actuated CubeSats that failed prior to 2009 were unable to transmit to ground, either due to unfavorable pointing or a failed radio. Presumably, the success rate of CubeSats has increased in the four years since the list in Reference 1 was last updated, but without a comprehensive reputable source to verify the claims made on such websites as Wikipedia, the claims remain presumed.

4

1.2.2 Controllability and Control Algorithms for Magnetically Actuated Satellites

Arguably, the most important question to answer before moving ahead with the development of an attitude control law utilizing only magnetic actuation is: What level of control does solely magnetic actuation provide? The answer is not easy to find and has not been found for the most general case. However, Bhat has analyzed the controllability problem in the most detail in

Reference 2, in which he found sets of conditions allowing strong accessibility and controllability. Strong accessibility was found to be guaranteed if the magnetic field and its time derivative are linearly independent at every instant. Controllability was found to be guaranteed if, in addition to the magnetic field and its time derivative being linearly independent at every instant, the magnetic field is periodic in time2. The controllability conditions were found to hold in any Keplerian orbit in a dipole magnetic field, except for those orbits about the magnetic equator2. Incidentally, a satellite in Low Earth Orbit (LEO) can be roughly modelled as being in a Keplerian orbit in a dipole magnetic field. According to Reference 2, there is some evidence that the nearly-periodic nature of the true magnetic field experienced in an actual LEO may be enough to guarantee controllability; however, this remains an open topic for research.

With reasonable certainty that the solely magnetically-actuated CubeSat system is controllable, the next important question to answer is: How well can a stabilizing control algorithm be expected to perform? Answering this question necessitates surveying the types of control algorithms that have been developed for, applied to, and analyzed with solely magnetically-actuated satellites. The vast majority of control algorithms that have been proposed for solely magnetically actuated attitude control of a satellite are proportional-derivative (PD) feedback controllers3-29. However, some have solved the time-optimal problem, which leads to an open-loop control strategy28, 29.

5

Magnetically-induced torques were initially used as a means to dump excess momentum from momentum wheels. Martel, Pal, and Psiaki were the very first to suggest magnetic actuators as the sole means of active satellite attitude control for improving the stability of a passively gravity gradient stabilized spacecraft3. They used an Euler angle and angular rate feedback, took a classical transfer function root analysis of the linearized system in order to show stability, and simulated a spacecraft utilizing the designed control law along with a previously presented

Kalman filter to demonstrate expected performance3.

Almost a decade later, Wiśniewski published his Ph. D. thesis, which outlined the techniques he had applied to solely magnetic actuation for attitude control of the Ørsted satellite4. The thesis demonstrated design of an infinite horizon LQR, a finite horizon LQR, and a constant-gain LQR, but the main results were the nonlinear, PD feedback sliding mode and energy-based Lyapunov- stable controllers designed for mission-specific maneuvers. Wiśniewski also suggests possibly using fuzzy logic with the energy-based Lyapunov-stable controllers to design a fuzzy PD magnetic attitude controller4. Wiśniewski and co-authors presented work on periodic LQRs in

References 5 and 6, presented work on energy-based Lyapunov-stable PD controllers in

Reference 7, presented work on sliding mode PD controllers in Reference 8, and presented new work on periodic H2 control in Reference 9.

Over the last fifteen years, many have followed Wiśniewski’s lead, developing periodic

10, 11, 12, 13, 14, 15 16, 17, 18, 19, 20, 21 22 LQRs , Lyapunov-stable PD controllers , and H∞/H2 controllers while some have investigated more-classical PD design10, 23, 24, 25, 26, model predictive13, 27, time- optimal28, 29, and fuzzy logic30 methods31. The majority of the more-classical PD design focuses on pole placement23 or iteratively hand-tuning design parameters to achieve desired performance10, 25. Likewise, much of the work done with LQRs is very similar, although

6

References 12 and 13 have examined discrete-time models, and Reference 14 examined performance of an LQR with an Extended Kalman Filter. Lovera and Astolfi have presented many different Lyapunov-stable PD controllers for the magnetically actuated satellite attitude control problem. Most notably, they presented general scaling conditions for local exponential stability with quaternion and angular rate feedback and conditions for local exponential stability with saturated PD feedback in Reference 17, and they presented a locally exponentially stable proportional feedback controller in Reference 18. H∞/H2, model predictive, and fuzzy logic controllers, while less-investigated for magnetically actuated satellite attitude control, have shown results consistent with those of the other feedback control methods, although H∞/H2 and model predictive controllers can be used to achieve greater robustness31.

The time-optimal controllers investigated for the magnetic actuation problem are unique in that it has been shown that an attitude error on the order of forty to sixty degrees can be reduced to zero in several minutes28, 29, whereas all feedback controllers discussed thus far have settling times on the order of one to several hours3-29. The slow settling time may be traceable to the proof that controllability can only be guaranteed if the magnetic field is periodic and the fact that the magnetic field varies approximately with the orbital period of the satellite, or about ninety minutes for a typical LEO. One major drawback of the time-optimal controller compared with the feedback controllers is the time-optimal solution’s computational demand. The problem in

Reference 28 took five minutes to solve on a desktop computer with an Intel Pentium 4

Processor and 3.0 GB of RAM. However, Reference 29 demonstrates that it may be possible to approximate a time-optimal solution using intelligent system design methods, thereby reducing computational burden.

7

1.2.3 Observability and Satellite Attitude Estimation

Attitude is typically estimated through measurement of at least two linearly independent reference vectors32. Using only one reference vector would only provide estimate of two linearly independent directions of the full three-dimensional spacecraft orientation. The second linearly independent reference vector provides the estimate of the third direction. However, it also provides a redundant estimation which is linearly dependent on a portion of the first reference vector. Therefore, the problem is overconstrained and requires an algorithmic approach to resolve. Noisy measurements of the reference vectors complicate resolution of the overconstrained problem because both measured reference vectors generally cannot coincide with both the expected directions of the reference vectors no matter what coordinate transformation is applied to the measured reference vectors. Wahba proposed formulating the problem as a minimization of a loss function, and optimal treatment of Wahba’s loss function problem has been accomplished in Reference 32.

Body-fixed angular rates could be derived from the time-varying attitude estimation; however, many commercially available angular rate sensors, generally referred to as gyroscopes†, are relatively inexpensive, fairly accurate, largely easy to implement, and can provide measurements of very high angular rates. Modern handheld electronic devices, such as cellphones, utilize micro-electromechanical system (MEMS) “gyroscopes” because they are small, lightweight, and provide attitude rate information that apps can utilize. Other types of

“gyroscopes,” including gyrostats, fiber optic gyroscopes, and Coriolis Vibratory Gyroscopes

(CVGs), may weigh and/or cost more than the MEMS “gyroscopes,” but depending on the device, they may also be able to offer more accuracy than MEMS “gyroscopes.” However, the

† Most modern “gyroscopes” are not true gyroscopes because they contain no rotating parts. 8 qualities that make MEMS “gyroscopes” suitable for use in cellphones also make them appropriate for use in a CubeSat ADCS.

In practice, measurements of reference vectors and the angular rates are utilized in a filter to recursively estimate the full state vector, thereby reducing state estimation error and providing a means to estimate attitude if or when one of the reference vectors cannot be measured (e.g. when the spacecraft passes into eclipse and the sun vector becomes unmeasurable). One filter most commonly used for attitude estimation is the Multiplicative Extended Kalman Filter (MEKF)33.

Although widely used, the MEKF is inherently a linear algorithm working to estimate the state of a nonlinear system and has been known to perform poorly or even diverge in some instances33.

Other types of filters, such as nonlinear observers, Unscented Kalman Filters (UKFs), and particle filters have been developed and used in applications where the MEKF fails due to extreme nonlinearities or assumptions of Gaussian noise distributions33.

Typical attitude sensors include sun sensors, horizon sensors, magnetometers, and star sensors34. Sun sensors and magnetometers are the most straightforward attitude sensors to implement on a magnetically actuated CubeSat because star sensors and horizon sensors are generally larger, more complicated, and require more power to operate35. Photosensitive devices, such as solar panels, which are already used to power CubeSats, can act as coarse sun sensors whose short-circuit output current varies approximately proportionally to the cosine of the angle between the sun sensor normal and the sun vector36. These angles can be resolved to determine the direction of the sun (i.e. the sun vector) in the body-fixed reference frame, although Earth albedo may introduce significant error into the measurement, and the sun vector is indeterminate when the spacecraft is in eclipse36. Similarly, for magnetically actuated spacecraft, three-axis magnetometers are already used to determine the appropriate magnetic moment to apply. Three-

9 axis measurement of the local magnetic field can be used to determine the direction of the local magnetic field in the body-fixed reference frame. Ephemeris models of the sun vector and the magnetic field direction in conjunction with the measured body-fixed reference vectors can be used in an algorithm, such as Markley’s optimal algorithm, to resolve the spacecraft attitude32.

One issue in using the sun vector as a reference is that, in most orbits, the spacecraft will eventually be in eclipse, and the sun vector will be indeterminate. For circular LEO with relatively low inclination, this will occur over approximately half the orbit. The MEKF can be used with magnetic field vector and angular rate measurements to iteratively determine the attitude while the spacecraft is in eclipse, but without a second measured reference vector, the attitude estimate will be more susceptible to drift resulting from the integration of the body-fixed rates.

1.3 Design Approach and Assumptions

The primary focus of this thesis is the design of a fuzzy gain-scheduled PD controller for magnetic attitude control of a CubeSat. Therefore, analysis of the fuzzy controller performance is a central priority of this work. The fuzzy controller performance is compared against that of a

Simple PD controller and an LQR under both the idealization of design assumptions and under the influence of disturbance inputs for which the design process did not account. In order to perform this analysis, a basic PD controller and an LQR must also be investigated and designed for the given mission.

In order to conduct a detailed design of the attitude controller, the defining parameters of the mission are required. For analyzing the magnetic attitude control of a satellite, the important

10 parameters are: the orbit, including time of orbit; the mass properties of the spacecraft, including principal moments of inertia; and the desired attitude of the spacecraft.

Figure 1.1 shows the TLE used to simulate the orbit of ArduSat, which is scheduled to be deployed from the International Space Station (ISS) on November 25, 2013. The TLE is actually that of the Raiko CubeSat as of February 19, 2013 at 21:13:37.147872; Raiko was deployed from the ISS in late 2012. Figure 1.2 shows the ground track resulting from orbit propagation of the

Raiko TLE over the course of ten hours, starting at the epoch given in the TLE.

Figure 1.1. TLE used for simulation of orbit propagation for ACS design.

11

Figure 1.2. Simulated spacecraft ground track found from orbit propagation of Raiko TLE.

Table 1.1 gives the estimated principal moments of inertia of ArduSat. At the time this work was completed, publicly-available 3D models of ArduSat did not differentiate among the densities of the constituent materials; therefore, they did not allow accurate estimation of the principal moments of inertia. Instead, the mass properties of CP2, a 1U CubeSat similar to

ArduSat, were found in Reference 25 and used as the estimated mass properties for design in this thesis.

12

Table 1.1. Principal moments of inertia of ArduSat estimated based on those of CP2, taken from Reference 25.

Principal Moment Spacecraft Axis (kg-m2) X 8.817×10-4 Y 9.804×10-4 Z 1.035×10-3

Although in reality the attitude of the spacecraft will be estimated from sensor measurements, the controller designs and analyses assume perfect state knowledge. It is expected that actual state estimation with a Kalman filter and/or the two-vector attitude determination algorithm will have errors on the order of a couple degrees for the attitude estimate32, 51 and errors on the order of 10-5 rad/sec for the attitude rate estimate50. For the purpose of design and evaluation of the magnetic attitude control algorithm, these errors are assumed to be negligible.

1.4 Thesis Outline

Chapter 2: Satellite Model – Chapter 2 presents the detailed nonlinear satellite model, including the orbital, magnetic field, and attitude kinematics/dynamics models. Linearization of the nonlinear model is performed in preparation for design of the LQR. Some preliminary analysis of the models is performed to give more insight into the nature of the problem.

Chapter 3: PD and LQR Controllers – Chapter 3 presents the general procedure used to design a simple PD attitude controller in Section 3.2 and the algorithms used to design and implement a constant-gain LQR for attitude control in Section 3.3. Results of these designs are presented in Chapter 5.

Chapter 4: Genetic-Fuzzy System – Chapter 4 introduces the heuristic and mathematical foundations of fuzzy logic inference systems and genetic algorithms, then presents the

13 application of a genetic-fuzzy system to design a fuzzy gain-scheduling PD controller for magnetic attitude control of a satellite. No optimization of the genetic algorithm is presented, but general justification for its setup is given. Results of this design are presented in Chapter 5.

Chapter 5: Design Results – Chapter 5 presents design results of the controllers introduced in Chapters 3 and 4. Performance of the controllers is compared both under the idealization of design assumptions and under the influence of unaccounted-for disturbance inputs.

Chapter 6: Conclusion – Chapter 6 summarizes the work presented in this thesis and makes recommendations for future work to be performed.

14

Chapter 2

Satellite Model

Developing an ACS for any spacecraft requires a good model of the system dynamics. Their small size, relatively stiff structures, and general lack of moving parts mean that CubeSats behave primarily as rigid bodies. Equations describing the behavior of rigid bodies subjected to external forces are straightforward. However, modeling the external forces, such as aerodynamic, solar pressure, gravity gradient, and magnetic forces produced by flight in space is less straightforward and requires the development of several different models. Additionally, because the model represents a vehicle in a physical three-dimensional space, reference frames and representations of orientations are important aspects of the model which must first be defined to solve the problem. The following section reviews the available models relevant to magnetic attitude control of a CubeSat and evaluates the models for use in simulation and/or control system implementation.

2.1 Reference Frames

2.1.1 Earth Centered Inertial

The Earth-Centered Inertial (ECI) frame is the primary reference frame in which the

Newtonian physics of the simulation is based; Newtonian physics assumes that motion can be

15 described in a non-accelerating or inertial frame. Although the Earth is accelerating around the sun, and likewise the solar system is accelerating, it is assumed that, over the short periods of simulation time, this motion is sufficiently small to constitute an inertial frame. In order to transfer from this reference frame to other Earth-based reference frames, the inertial frame must be defined with respect to the rotating Earth, or an Earth-Centered Earth-Fixed (ECEF) reference frame.

The Earth-Centered Inertial reference frame, shown in Figure 2.1, is defined using the Vernal

Equinox, denoted , the Celestial North Pole (i.e. the axis about which Earth rotates), and the

Celestial Equator (i.e. Earth’s equator). The X-Axis points in the direction of the Vernal

Equinox, defined by the direction from Earth’s center to the sun’s center at the time the sun appears to pass through the Earth’s equatorial plane moving from south to north. The Y-Axis is defined 90 degrees to the east of the X-Axis through the Earth’s equatorial plane. The Z-Axis completes the right-handed frame, passing through the Celestial North Pole.

The major issue with this definition is that the Earth precesses with a period of about 26,000 years and nutates with a period of about 19 years34. This means the direction of the Vernal

Equinox is time-dependent. Therefore, the epoch of the Vernal Equinox must be defined. One way to deal with the changing equinox direction is to utilize what is known as the True Equator and Mean Equinox (TEME). This definition, used by NORAD’s Two-Line-Element Sets (TLEs), neglects Earth’s short period nutation, hence Mean Equinox, and uses Earth’s true equatorial plane at epoch. The TEME is used as the Earth-Centered Inertial frame for the ACS because

NORAD’s TLEs are used to determine orbital position. The only information required to transform coordinates from the ECI frame to the Earth-Fixed frame is the Greenwich Mean

16

Sidereal Time (GMST), which essentially measures the angle between the Vernal Equinox and the Greenwich Meridian.

Figure 2.1. Earth-Centered Inertial Reference Frame with respect to Earth-Centered Earth-Fixed Reference Frame.

2.1.2 Spacecraft-Centered Inertial

The spacecraft-centered inertial frame, shown in Figure 2.2, is essentially a translation of the

Earth-centered inertial frame from the center of mass of the Earth to the center of mass of the spacecraft. This reference frame gives no new representation of the attitude of the spacecraft.

Instead, this frame is used for locating the spacecraft with respect to the origin of the Earth- centered inertial frame (RS/C).

17

Figure 2.2. Spacecraft-Centered Inertial Reference Frame with respect to Earth-Centered Inertial Reference Frame.

2.1.3 Spacecraft-Centered Body-Fixed

The Spacecraft-Centered Body-Fixed coordinate frame, shown in Figure 2.3, is used in determining and propagating the spacecraft attitude and angular rates. This frame is assumed to be centered at the center of mass of the spacecraft and to align with the principal moment of inertia axes of the spacecraft. Furthermore, it is assumed that the orientation of this frame also coincides with the principal geometric axes of the CubeSat because the CubeSat is symmetric about all principal geometric axes and is assumed to have a symmetric mass distribution about these axes. However, the geometric center of the spacecraft is assumed close to but non- collocated with the center of mass of the spacecraft; the CubeSat Standard allows up to a 2 cm discrepancy between geometric and mass centers37.

The X-Axis of the CubeSat is defined from the center of mass of the satellite through and perpendicular to one of the 10 cm×10 cm faces; ideally for the given mission, the X-Axis is sun- pointing. For the purposes of the preliminary attitude control system design, the Y-Axis and Z-

18

Axis are arbitrarily defined such that both axes originate at the center of mass of the spacecraft, each axis remains perpendicular to one of the 10 cm×10 cm sides of the spacecraft, and all three axes constitute a right-handed coordinate system.

Figure 2.3. Spacecraft-Centered Body-Fixed Reference Frame with respect to Spacecraft-Centered Inertial Reference Frame.

2.1.4 Earth-Centered Earth-Fixed

The Earth-Centered Earth-Fixed reference frame, shown in Figure 2.4, is used to determine the position of the spacecraft with respect to a “fixed” ground position. The X-Axis of this frame is defined from the Earth’s center of mass through the intersection of the equator and the

Greenwich meridian. The Y-Axis is defined from the Earth’s center of mass through the point on the equator at 90 degrees east longitude. The Z-Axis is defined from the Earth’s center of mass through the Celestial North Pole. For simplicity and because it is not required to know the exact ground track for this investigation, it is assumed that the Earth is a sphere of uniform density.

19

Figure 2.4. Earth-Centered Earth-Fixed Reference Frame with respect to Longitudinal and Latitudinal Coordinates.

2.2 Attitude Parameterization and Kinematics

2.2.1 Parameterization Evaluation

An ideal parameterization of all possible three-dimensional attitudes would utilize three parameters to minimize computational storage requirements, would not exhibit singularities or discontinuities, and would yield a linear kinematic equation for further computational efficiency.

However, to the best knowledge of the author, no such parameterization of three-dimensional rotations or coordinate transformations is yet known; those that do exist exhibit at least one undesirable characteristic. Several of the most common attitude parameterizations used to represent the attitude of non-spinning aircraft or spacecraft include: Euler Angles, Euler-

Rodrigues Symmetric Parameters (hence forth referred to as the quaternion), Cayley-Klein

Parameters, and Modified Rodrigues Parameters.

Euler Angle representation is one of the most well-known parameterizations of attitude as it is usually the primary attitude representation presented to undergraduates studying flight mechanics. One of the advantages of Euler Angles is that they utilize a minimum number, three,

20 parameters to describe attitude. Another advantage, and likely the reason they are taught to undergraduates studying flight mechanics, is that the parameters have a relatively easy-to- understand physical interpretation; the angles are usually interpreted as roll, pitch, and yaw of a vehicle. Although they have their advantages, Euler Angles are plagued by several disadvantages that make them unattractive to use for most practical attitude control systems. One drawback to the Euler Angle representation is the existence of a phenomenon known as gimbal lock, which occurs at attitudes from which an infinitesimal rotation in at least one direction is impossible38.

This can be corrected by using another set of Euler Angles with discontinuities at different attitudes, but this approach requires more computational power38. Another drawback of Euler

Angles is their use of trigonometric functions. Similarly, the Euler Angles’ kinematic equations, which allow computation of a time-varying attitude, are nonlinear, further increasing computational complexity38.

Quaternion representation is another well-known parameterization of attitude. In fact, quaternions are the “preferred parameterization for spacecraft attitude control systems”38. They are so popular because the quaternion representation yields linear kinematic relations, provides a continuous representation of three-dimensional space, exhibits no singularities such as gimbal lock, and does not utilize trigonometric functions. However, quaternions do have one drawback.

A quaternion is a four-element parameterization and thus does not utilize a minimum number of parameters to describe attitude. In fact, each attitude corresponds to two sets of parameters38.

The remaining two parameterizations, Cayley-Klein Parameters and Modified Rodrigues

Parameters, are less-frequently used in attitude control systems, but both offer distinct advantages over quaternion representation. The Cayley-Klein Parameters have been useful in explaining properties of quaternions, but they have no computational advantage over

21 quaternions38. The Modified Rodrigues Parameters offer a representation with a minimum number of parameters, but contain one singularity in representing the unit sphere, yield nonlinear kinematic equations, and utilize mathematical operations more-complex than quaternions38.

The quaternion parameterization was chosen to represent the attitude dynamics for this model, because the use of quaternion parameterization in spacecraft attitude control systems is fairly well-documented, Euler Angle Parameterization is relatively computationally intensive, and

Cayley-Klein and Modified Rodrigues Parameters offer no clear advantages over quaternion parameterization.

2.2.2 Euler-Rodrigues Symmetric Parameters (Quaternion)

A unit quaternion is a 4-parameter vector that can be used to represent how one coordinate system appears from the perspective of another coordinate system. Hence, quaternions can be used to develop rotation or transformation matrices. Additionally, given body-fixed angular rates, quaternions can be used on their own to propagate the attitude of a reference frame that rotates in time with respect to an inertial reference frame.

A unit quaternion consists of a real scalar part and a complex 3-vector part, as shown in

Equation 2.1. The real scalar part is equal to the cosine of half the angle through which one coordinate system must rotate about the Eigen Axis between the two coordinate systems in order to align with the second coordinate system. The complex 3-vector part is proportional to the sine of half this angle and the Eigen Axis between two coordinate frames. The Eigen Axis, denoted as a vector 푢 in Equation 2.1, can be thought of as a vector that is expressed exactly the same in both coordinate frames (i.e. it is a non-complex eigenvector of the coordinate transformation or rotation between the two coordinate systems).

22

휃 푤 cos( ⁄2) 푤 푥 푞 ≡ ( ) ≡ ( ) ≡ (푦) (2.1) 푢 sin(휃⁄ ) 푣 2 푧

One convenient aspect of unit quaternion representation of coordinate transformations is that multiple transformations take a simple form, resulting from the definition of quaternion multiplication. A transformation resulting from two subsequent transformations is defined as follows:

푤1 −푥1 −푦1 −푧1 푤2 푤1푤2 − 푣1 ∙ 푣2 푥1 푤1 −푧1 푦1 푥2 푞3 = 푞1 × 푞2 = [ ] = [ ] [ ] (2.2) 푤1푣2 + 푤2푣1 + 푣1 × 푣2 푦1 푧1 푤1 −푥1 푦2 푧1 −푦1 푥1 푤1 푧2

From this definition, it can be shown that the complex conjugate of a unit quaternion representation of a coordinate transformation is the inverse of this transformation. That is, the identity quaternion results from the multiplication of a unit quaternion with its complex conjugate.

푤 ∗ −푥 푞 = (−푦) (2.3) −푧

1 푞 × 푞∗ = 푞∗ × 푞 = [0] (2.4) 0 0

A coordinate transformation matrix, 푇, is constructed from the unit quaternion representation of the transformation of a vector, 푟̅, via the following relations:

푟푥 푟̅ = (푟푦) (2.5) 푟푧

0 1 0 0 푞∗ × [ ] × 푞 = [ 1×3] [ ] (2.6) 푟̅ 03×1 푇 푟̅

23

1 − 2(푦2 + 푧2) 2(푥푦 + 푤푧) 2(푥푧 − 푤푦) 푇 = [ 2(푥푦 − 푤푧) 1 − 2(푥2 + 푧2) 2(푦푧 + 푤푥) ] (2.7) 2(푥푧 + 푤푦) 2(푦푧 − 푤푥) 1 − 2(푥2 + 푦2)

For a quaternion changing as a result of a body-fixed angular velocity, 휔, the first-order differential equation for the change in the quaternion with respect to time is derived by constructing the quaternion resulting from a small transformation angle in a short time from a nominal quaternion attitude representation, using the small-angle forms of the trigonometric functions, and taking the limit of the difference of the quaternion from its nominal value divided by a small change in time as the small change in time approaches zero, as is done in Equations

2.8 through 2.14.

cos(휃/2)

푢 sin(휃/2) 푞(푡) = 푥 (2.8) 푢푦 sin(휃/2) [푢푧 sin(휃/2)]

0 −푢푥 −푢푦 −푢푧 ∆휑 ∆휑 푢푥 0 푢푧 −푢푦 푞(푡 + ∆푡) = (cos ( ) 퐼4×4 + sin ( ) [ ]) 푞(푡) (2.9) 2 2 푢푦 −푢푧 0 푢푥 푢푧 푢푦 −푢푥 0

∆휑 cos ( ) ≈ 1 (2.10) 2

∆휑 ∆휑 1 sin ( ) ≈ ≈ 휔∆푡 (2.11) 2 2 2

0 −휔푥 −휔푦 −휔푧 1 휔푥 0 휔푧 −휔푦 푞(푡 + ∆푡) = (퐼4×4 + [ ] ∆푡) 푞(푡) (2.12) 2 휔푦 −휔푧 0 휔푥 휔푧 휔푦 −휔푥 0

푑푞 푞(푡+∆푡)−푞(푡) 푞̇ = = lim (2.13) 푑푡 ∆푡→0 ∆푡

0 −휔푥 −휔푦 −휔푧 푑푞 1 휔 0 휔푧 −휔푦 = ( 푥 ) 푞 (2.14) 푑푡 2 휔푦 −휔푧 0 휔푥 휔푧 휔푦 −휔푥 0

24

It is interesting to note that a system described by Equation 2.14 has two complex conjugate poles each with multiplicity two located on the imaginary axis at half the magnitude of the angular velocity from the origin. Ordinarily, this would mean any rotating body is unstable, but because the attitude quaternion is a unit vector, the system is marginally stable and the attitude will tend to change in a sinusoidal fashion with time.

Unfortunately, with round-off error, propagated unit quaternions may drift from unity, especially when using ordinary differential equation solvers. This could eventually lead to significantly non-unit quaternions, non-orthonormal transformation matrices, and a diverging simulated system. Therefore, computer algorithms must be implemented to normalize the quaternion at each time step to prevent drift from non-unit quaternions.

2.3 Attitude Dynamics

2.3.1 Momentum Equations

The CubeSat is modelled as a rigid body. As long as the structural modes of the spacecraft are stable and have very high natural frequencies compared to the highest frequency modes of the rigid-body attitude equations, the rigid body assumption is valid. With such small expected angular rates, less than or equal to the order of 10-3 rad/sec, essentially any structural mode is a very high frequency mode. Additionally, it is not expected that the spacecraft will have very flexible structures or anything driving structural vibrations to instability, so all expected structural modes will naturally be high-frequency and stable. Although CryoCube™ will have a fluid onboard, it is expected that the fluid will be viscous enough to resist the small changes in motion caused by attitude correction; therefore, no sloshing modes need to be taken into consideration.

25

Attitude kinematics of a rigid body can be described by the very well documented Euler moment equation, shown in Equation 2.15 below35.

̇ ̇ 휏 = ℎ퐼 = ℎ퐵 + 휔퐵 × ℎ퐵 = 퐼퐵휔̇ 퐵 + 휔퐵 × (퐼퐵휔퐵) (2.15) where 퐼퐵 is the moment of inertia tensor in the Spacecraft-Centered Body-Fixed frame. As discussed previously, this frame coincides with the axes of principle moments of inertia.

Therefore, 퐼퐵 is a diagonal matrix with principle moments of inertia on the diagonal. The Euler moment vector equation is essentially a statement that external torques, 휏, cause a change in angular momentum, ℎ퐼, of the system in an inertial frame. The equation is expressed in terms of body-fixed angular rates, 휔퐵, by using the Transport Theorem.

Rearranging to express Euler’s moment equation in a state-space form:

퐼퐵휔̇ 퐵 = (퐼퐵휔퐵) × 휔퐵 + 휏 (2.16)

퐼 −퐼 푦 푧 휏푥 휔푦휔푧 ( ) 퐼푥 퐼 휔̇ 푥 푥 퐼 −퐼 휏푦 휔̇ 푧 푥 [ 푦] = 휔푥휔푧 ( ) + 퐼 (2.17) 퐼푦 푦 휔̇ 휏 푧 퐼푥−퐼푦 푧 휔푥휔푦 ( ) [ 퐼푧 ] [ 퐼푧 ] where 퐼푥, 퐼푦, and 퐼푧 are the principle moments of inertia of the body-fixed X-, Y-, and Z-Axes, respectively. Similarly, the body-fixed angular rates and the external moments have been expressed with x, y, and z subscripts to represent angular rates and external moments about the body-fixed X-, Y-, and Z-Axes, respectively.

The external torques in Euler’s moment equation encompass all torques the spacecraft will experience. This includes not only disturbance torques, but control torques as well. In the next section, the control magnetic torque model is developed and evaluated to determine approximate expected control authority. Similarly, aerodynamic, solar pressure, and gravity gradient torque

26 models are developed and evaluated to determine which disturbance torques are significant and if the CubeSat has enough control authority to overcome the disturbances.

2.3.2 Magnetic Control Torque

Magnetic actuation utilizes the Earth’s magnetic field and a current passing through coiled or looped wire in order to generate a torque. The current passing through the coils can be expressed as a magnetic moment vector which, when crossed with Earth’s magnetic field vector, yields the magnetic control torque. Mathematically, this is:

휏퐶 = 푀 × 퐵 (2.18) where 푀 is the magnetic moment vector produced by the spacecraft and 퐵 is the magnetic field vector generated by the Earth. Earth’s magnetic field model is discussed in Section 2.5 and in

Appendix A. For now, it is assumed that the Earth’s magnetic field behaves in accordance with the first-order IGRF model on January 1, 201048. Under this assumption, the minimum strength of the magnetic field the simulated CubeSat will experience is 2.49×10-5 tesla. From ArduSat’s magnetorquer data sheet49, the worst-case maximum magnetic moment is 0.04 A-m2. Therefore, the worst-case maximum available torque is 1.0×10-6 N-m. In order for this approximated control authority to be “good enough” to control the spacecraft, the disturbance torques should be much smaller than this worst-case magnetic control torque. It is assumed that the disturbance torques are much smaller than the control torque if the disturbance torques are more than two orders of magnitude smaller than the control torque. Disturbance torques more than three orders of magnitude smaller than the control torque are assumed negligible.

For the purpose of explicitly writing the complete mathematical model, the magnetic control torque equation is rewritten:

27

휏퐶,푥 푚푦푏푧 − 푚푧푏푦 0 푏푧 −푏푦 푚푥 [휏퐶,푦] = [푚푧푏푥 − 푚푥푏푧 ] = [−푏푧 0 푏푥 ] [푚푦] (2.19) 휏 퐶,푧 푚푥푏푦 − 푚푦푏푥 푏푦 −푏푥 0 푚푧 where, again, the x, y, and z subscripts indicate the body-fixed axes on which the vectors are projected. Notice the rank of the magnetic field matrix is two, and therefore the system is instantaneously uncontrollable.

Lastly, it should be noted that the magnetorquers used by ArduSat are not identical to those used by CryoCube™. CryoCube-1’s magnetorquers have a higher maximum magnetic moment,

0.24 A-m2, than ArduSat’s magnetorquers53. Furthermore, although it is assumed that most magnetorquers produce a magnetic moment linearly proportional to the current supplied to them, the real responses are generally nonlinear and therefore could differ between ArduSat’s magnetorquers and CryoCube-1’s magnetorquers. However, as long as the response of the magnetorquers to varying current levels can be characterized, this is of little consequence. All that must be known is the desired magnetic moment and a least-squares curve fit to a transformation from desired magnetic moment to required driving current, which is the value set by the computerized controller.

2.3.3 Aerodynamic Drag Torque

Aerodynamic drag is a force resulting from the resistance of the atmosphere to the spacecraft’s motion. A simple one-dimensional drag model is assumed to act independently in all three body axes. In each axis, the aerodynamic drag force is given by:

1 2 퐹퐷 = ⁄2 휌푉∞ 푆퐶퐷 (2.20) where 휌 is the atmospheric density at altitude, 푉∞ is the freestream velocity of the upper atmosphere projected onto the body axis of interest, 푆 is the surface area of the spacecraft as seen

28 normal to the axis of interest, and 퐶퐷 is the drag coefficient, assumed to be 2.0 for all directions, a worst-case value suggested by Reference 34. The aerodynamic drag torque results from this force acting through the spacecraft’s center of pressure, which is assumed to be offset from the center of gravity; forces acting through the center of gravity produce no moment.

It can be seen from the model that the worst-case aerodynamic drag occurs when the largest surface (0.01 m2) is normal to the freestream velocity and when the force works at the worst-case maximum moment arm (0.02 m). Additionally, the density at the anticipated altitude is about

5.2×10-13 kg/m3. Therefore, the worst-case aerodynamic drag torque is calculated to be 6.13×10-9

N-m, which is more than two orders of magnitude smaller than the control torque; therefore, the control authority is considered “good enough” to reject disturbances caused by the aerodynamic torque.

For the purpose of explicitly writing the complete mathematical model, the aerodynamic drag torque equation is rewritten:

푖̂ 푗̂ 푘̂ 휏퐷,푥 훿 훿 훿 [휏퐷,푦] = | 푥 푦 푧 | = 푉 푉 푉 휏퐷,푧 1 2 푥 1 2 푦 1 2 푧 − ⁄ 휌푉푥 푆푥퐶퐷 − ⁄ 휌푉푦 푆푦퐶퐷 − ⁄ 휌푉푧 푆푧퐶퐷 2 |푉∞| 2 |푉∞| 2 |푉∞|

3 3 푉푦 푉푧 푆푦훿푧 − 푆푧훿푦 |푉∞| |푉∞| 3 3 1 푉푧 푉푥 휌퐶퐷 푆푧훿푥 − 푆푥훿푧 (2.21) 2 |푉∞| |푉∞| 3 3 푉푥 푉푦 푆푥훿푦 − 푆푦훿푥 [ |푉∞| |푉∞|] where the δ’s express moment arm distances, the subscripts reference the body-fixed axes, and velocities without subscript infinity represent velocity of the spacecraft (i.e. in the opposite direction as velocities with subscript infinity).

29

2.3.4 Solar Pressure Torque

Solar pressure is a force due to the collision of photons with the spacecraft. A simplified model for the solar pressure force, assuming all particles are specularly reflected after having collided exactly normal to the surface, is given by:

퐹 퐹 = 2 푒 푆 (2.22) 푆푃 푐

2 8 where 퐹푒 is the solar flux constant (1385 W/m mean at 1 AU), 푐 is the speed of light (2.998×10 m/s), and 푆 is the surface area exposed to the radiation. Accordingly, the worst-case solar pressure torque, acting at the maximum moment arm (0.02 m) is 1.82×10-9 N-m, which is about three orders of magnitude smaller than the control torque, therefore considered negligible.

Because this torque is considered negligible and accurate modelling of the solar pressure torque, which requires knowledge of the spacecraft’s surface reflectivities, is beyond the scope of this work, no detailed model is developed.

2.3.5 Gravity Gradient Torque

The gravity gradient torque results from the slight differences in gravitational attraction between different portions of the spacecraft and Earth. This torque tends to align the axis of smallest moment of inertia with the local Earth-pointing vector39. The mathematical model used to calculate gravity gradient torque is as follows:

푅퐸/푆퐶푅퐸/푆퐶(퐼 − 퐼 ) 휏퐺퐺,푥 푦 푧 푧 푦 µ퐸 퐸/푆퐶 퐸/푆퐶 [휏퐺퐺,푦] = 3 5 푅 푅 (퐼 − 퐼 ) (2.23) |푅퐸/푆퐶| 푥 푧 푥 푧 휏퐺퐺,푧 퐸/푆퐶 퐸/푆퐶 [푅푥 푅푦 (퐼푦 − 퐼푥)] where 푅퐸/푆퐶 denotes the distance from the spacecraft to Earth in the spacecraft body-fixed frame, µ퐸 denotes Earth’s specific gravitational constant, the 퐼’s are the principal moments of inertia, and the subscripts reference the body-fixed axes.

30

A conservative overestimate of the maximum gravity gradient torque can easily be calculated assuming that the magnitudes of all differences in principle moments are equal and the magnitudes of all projections of 푅퐸/푆퐶 on the body-fixed axes are equal. This yields a maximum torque of magnitude:

µ퐸 3 3 ∆퐼푚푎푥 (2.24) 푅퐸/푆퐶

Inserting the simulated CubeSat’s data into this equation yields an overestimated worst-case gravity gradient torque of 5.91×10-10 N-m, which is more than three orders of magnitude smaller than the control torque; therefore, the control authority is assumed “good enough” to reject disturbances caused by the negligible gravity gradient torque.

2.4 Linearized Attitude Model

A linearized model of the spacecraft kinematics, dynamics, and external torques about the desired attitude state is required to develop an LQR for attitude regulation. By inspection of the nonlinear equations of motion in Equation 2.14 and Equation 2.17, it is clear that the kinematic and dynamic derivatives of the model approach constant values of zero near the desired state.

Therefore, the model linearized about the desired state only really consists of disturbance torque terms. Linearized versions of the aerodynamic drag and gravity gradient torque models are presented in the following subsections.

2.4.1 Aerodynamic Drag Torque

The aerodynamic torque is dependent on the freestream velocity, and freestream velocity along a given axis of the spacecraft is dependent on the spacecraft attitude. Examination of

Equation 2.21 reveals that this dependence on attitude is more than first order, so in order to

31 develop a full linear model of the system, the aerodynamic drag torque must be linearized with respect to spacecraft attitude.

First, the spacecraft velocity vector in the body-fixed frame is expressed as a time history of the spacecraft velocity vector in the desired sun-pointing frame multiplied by a transformation of this vector from this ideal frame to the actual body-fixed frame, assuming the transformation is small:

푉푥 1 2푧̃ −2푦̃ 푉(푡) = [푉푦] = [−2푧̃ 1 2푥̃ ] 푉푛표푚(푡) = 푉푧 2푦̃ −2푥̃ 1

푉푥,푛표푚(푡) + 2푧̃푉푦,푛표푚(푡) − 2푦̃푉푧,푛표푚(푡) [−2푧̃푉푥,푛표푚(푡) + 푉푦,푛표푚(푡) + 2푥̃푉푧,푛표푚(푡)] (2.25) 2푦̃푉푥,푛표푚(푡) − 2푥̃푉푦,푛표푚(푡) + 푉푧,푛표푚(푡) where the tilde terms are the linearized state variables, corresponding to a small-angle transformation from the nominal attitude.

Next, these equations are substituted into Eq. 2.21 to yield a set of equations that are third order with respect to the attitude displacement terms. Using only the first order terms of this equation, because the nominal attitude displacement terms are all zero, the linearized aerodynamic drag torque is given by Equations 2.26, 2.27, and 2.28 below.

32

2 2 푚퐷,11 = −(푆푦훿푧푉푦,푛표푚 푉푧,푛표푚 + 푆푧훿푦푉푧,푛표푚 푉푦,푛표푚)

2 푚퐷,12 = 푆푧훿푦푉푧,푛표푚 푉푥,푛표푚

2 푚퐷,13 = 푆푦훿푧푉푦,푛표푚 푉푥,푛표푚

2 푚퐷,21 = 푆푧훿푥푉푧,푛표푚 푉푦,푛표푚

2 2 푚퐷,22 = −(푆푥훿푧푉푥,푛표푚 푉푧,푛표푚 + 푆푧훿푥푉푧,푛표푚 푉푥,푛표푚)

2 푚퐷,23 = 푆푥훿푧푉푥,푛표푚 푉푦,푛표푚

2 푚퐷,31 = 푆푦훿푥푉푦,푛표푚 푉푧,푛표푚

2 푚퐷,32 = 푆푥훿푦푉푥,푛표푚 푉푧,푛표푚

푚 = −푆 훿 푉 2푉 − 푆 훿 푉 2푉 퐷,33 푥 푦 푥,푛표푚 푦,푛표푚 푦 푥 푦,푛표푚 푥,푛표푚 (2.26)

푚퐷,11 푚 퐷,12 푚퐷,13 푀퐷 = [푚퐷,21 푚퐷,22 푚퐷,23] (2.27) 푚퐷,31 푚퐷,32 푚퐷,33

푆 훿 푉 3 − 푆 훿 푉 3 휏퐷,푥 푥̃ 푧 푦 푧,푛표푚 푦 푧 푦,푛표푚 휌퐶퐷 1 3 3 [휏퐷,푦] = (3푀퐷 [푦̃] + [푆푥훿푧푉푥,푛표푚 − 푆푧훿푥푉푧,푛표푚 ]) (2.28) |푉∞| 2 휏퐷,푧 푧̃ 3 3 푆푦훿푥푉푦,푛표푚 − 푆푥훿푦푉푥,푛표푚

2.4.2 Gravity Gradient Torque

The gravity gradient torque is partly dependent on the direction of the Earth in the spacecraft body-fixed frame. Therefore, the gravity gradient torque is dependent on the spacecraft attitude.

Examination of Equation 2.23 reveals that this dependence on attitude is second order, so in

33 order to develop a full linear model of the system, the gravity gradient torque must be linearized with respect to spacecraft attitude.

The approach to linearization is similar to that taken in the linearization of the aerodynamic drag torque. First, the vector from the spacecraft body-fixed frame to the center of the Earth is expressed as a time history of said vector if the spacecraft were aligned with the desired frame multiplied by a transformation of this vector from the ideal frame to the actual body-fixed frame, assuming the transformation is small:

퐸/푆퐶 푅푥 1 2푧̃ −2푦̃ 퐸/푆퐶 퐸/푆퐶 퐸/푆퐶 푅 (푡) = [푅푦 ] = [−2푧̃ 1 2푥̃ ] 푅푛표푚 (푡) = 퐸/푆퐶 2푦̃ −2푥̃ 1 푅푧

퐸/푆퐶 퐸/푆퐶 퐸/푆퐶 푅푥,푛표푚(푡) + 2푧̃푅푦,푛표푚(푡) − 2푦̃푅푧,푛표푚(푡) 퐸/푆퐶 퐸/푆퐶 퐸/푆퐶 −2푧̃푅푥,푛표푚(푡) + 푅푦,푛표푚(푡) + 2푥̃푅푧,푛표푚(푡) (2.29) 퐸/푆퐶 퐸/푆퐶 퐸/푆퐶 [ 2푦̃푅푥,푛표푚(푡) − 2푥̃푅푦,푛표푚(푡) + 푅푧,푛표푚(푡) ] where, again, the tilde terms are the linearized state variables, corresponding to a small-angle transformation from the nominal attitude.

Next, these relations are substituted into Equation 2.23 to yield a set of equations that are second-order with respect to the attitude displacement terms. Using only the first order terms of this equation, because the nominal attitude displacement terms are all zero, the linearized gravity gradient torque is given by Equations 2.30, 2.31, and 2.32 below:

34

퐸/푆퐶 2 퐸/푆퐶 2 푚퐺,11 = (−2푅푦,푛표푚 + 2푅푧,푛표푚 ) (퐼푧 − 퐼푦)

퐸/푆퐶 퐸/푆퐶 푚퐺,12 = 2푅푥,푛표푚푅푦,푛표푚(퐼푧 − 퐼푦)

퐸/푆퐶 퐸/푆퐶 푚퐺,13 = −2푅푥,푛표푚푅푧,푛표푚(퐼푧 − 퐼푦)

퐸/푆퐶 퐸/푆퐶 푚퐺,21 = −2푅푥,푛표푚푅푦,푛표푚(퐼푥 − 퐼푧)

퐸/푆퐶 2 퐸/푆퐶 2 푚퐺,22 = (2푅푥,푛표푚 − 2푅푧,푛표푚 ) (퐼푥 − 퐼푧)

퐸/푆퐶 퐸/푆퐶 푚퐺,23 = 2푅푦,푛표푚푅푧,푛표푚(퐼푥 − 퐼푧)

퐸/푆퐶 퐸/푆퐶 푚퐺,31 = 2푅푥,푛표푚푅푧,푛표푚(퐼푦 − 퐼푥)

퐸/푆퐶 퐸/푆퐶 푚퐺,32 = −2푅푦,푛표푚푅푧,푛표푚(퐼푦 − 퐼푥)

퐸/푆퐶 2 퐸/푆퐶 2 푚퐺,33 = (−2푅푥,푛표푚 + 2푅푦,푛표푚 ) (퐼푦 − 퐼푥)

(2.30)

푚퐺,11 푚퐺,12 푚퐺,13 푀퐺퐺 = [푚퐺,21 푚퐺,22 푚퐺,23] (2.31) 푚퐺,31 푚퐺,32 푚퐺,33

(퐼 − 퐼 )푅퐸/푆퐶 푅퐸/푆퐶 휏퐺퐺,푥 푥̃ 푧 푦 푦,푛표푚 푧,푛표푚 휏 µ퐸 퐸/푆퐶 퐸/푆퐶 [ 퐺퐺,푦] = 5 3푀퐺퐺 [푦̃] + (퐼푥 − 퐼푧)푅푥,푛표푚푅푧,푛표푚 (2.32) |푅퐸/푆퐶(푡)| 휏퐺퐺,푧 푧̃ 퐸/푆퐶 퐸/푆퐶 ( [(퐼푦 − 퐼푥)푅푥,푛표푚푅푦,푛표푚])

2.4.3 Complete Linearized System Dynamics

From Equation 2.14, it is obvious that the time rate of change of the error quaternion with the nominal state represented by a unit error quaternion and zero angular velocity is given by

35

Equation 2.33, where the real part of the quaternion error rate of change is omitted because it is assumed constant.

푥̃̇ 휔̃푥 1 [푦̃̇] = 퐼 [휔̃푦] (2.33) 2 3×3 푧̃̇ 휔̃푧

Now, combining all the linearized parts of the model together gives Equation 2.34, in which torques not dependent on the attitude are lumped into a vector of disturbance torques.

휔̃̇ 푥 휔̃푥

휔̃̇ 휔̃ 0 푏푧 −푏푦 푦 휌퐶퐷 3µ퐸푀퐺퐺 푦 푚 03×3 3 푀퐷 + 5 푥 휔̃̇ |푉∞| |푅퐸/푆퐶(푡)| 휔̃ −푏푧 0 푏푥 휏 푧 = [ ] 푧 + [푚푦] + [ ] (2.34) 1 푥̃ 푏푦 −푏푥 0 03×1 푥̃̇ 퐼 0 푚푧 2 3×3 3×3 푦̃̇ 푦̃ [ 03×3 ] [ 푧̃ ] [ 푧̃̇ ]

2.5 Magnetic Field Modeling

In order to accurately model the magnetically actuated CubeSat’s attitude control system, the magnetic field used to produce the control torque must be modeled. Because the magnetic field is dependent on the position of the spacecraft with respect to Earth-Centered Earth-Fixed coordinates, the orbital dynamics of the satellite must be modeled in conjunction with an Earth magnetic field model. The magnetic field and orbital models are presented in the following subsections.

2.5.1 Earth’s Magnetic Field

For all design and evaluation simulations in this thesis, the 13th order IGRF2010 model48 is used with the included secular variation model, allowing forward extrapolation to the expected dates of ArduSat’s operation. The equations for this model can be found in Appendix A. The

36 highest-order model was chosen because it reduces the estimated error of the field to a minimum, thereby allowing the most accurate simulation, although the higher-order model is slightly more computationally demanding. The 13th order model more-accurately represents the shorter wavelength magnetic waves produced by Earth’s core, reducing RMS errors to an estimated 10 nT from an estimated 35 nT with the 10th order model40. The IGRF models are estimated to have a curve fitting error of about 10 nT RMS, and secular (long-term, non-periodic) variations are estimated to increase this error by 20 nT/year40. Additionally, magnetic fields generated independently from Earth’s magnetic field, such as spacecraft residual magnetic fields and solar- induced magnetic storms, are not modeled by the IGRF; therefore, they constitute errors from the true local magnetic field, estimated on the order of 20 nT in magnetically quiet conditions, but upwards of 1000 nT during magnetic storms40.

2.5.2 Orbit Propagation

A few classes of methods exist for determining the velocity and position of a spacecraft with respect to the Earth. The simplest method utilizes only the algebraic equations of the basic two- body problem. Slightly more complex methods, known as methods of general perturbations, introduce additional algebraic perturbation terms and equations into the set of equations that describe the two-body problem34. Such perturbation terms take into account Earth’s varying gravitational field, tidal forces of the moon and sun, and atmospheric drag. Analytically simpler methods known as special perturbation techniques, utilize the differential form of the equations of motion in order to propagate position and velocity time histories41. Special perturbation methods are highly accurate but are computationally expensive and are sensitive to initial conditions and round-off errors41. In order to achieve the best qualities of both general and special perturbation methods, hybrid methods known as semi-analytic perturbation techniques

37 were developed. These methods are more accurate than the general perturbation techniques and not as computationally demanding as the special perturbation techniques41.

The basic two-body propagator, a special perturbation propagator (parameter variation from

Reference 42), and a general perturbation propagator (SGP4) were compared using the TLE from

Raiko to determine how the estimated orbital positions and local magnetic fields differed. Figure

2.5 shows the two-body propagator and the special perturbation methods produce similar radial position data, but differ significantly in absolute position because some of the orbital parameters of the special perturbation method change and all the two-body orbital parameters remain constant. The difference between the special perturbation method and SGP4 is likely due to a combination of the presence of more perturbation terms in SGP4 and the sensitivity of special perturbation methods to initial conditions (it was assumed integration started at the spacecraft

TLE epoch). Figure 2.6 and Figure 2.7 show the position discrepancy leads to a significant magnetic field magnitude and direction measurement discrepancy. The special perturbation method and SGP4 are most similar to one another, exhibiting less than 1% error (from average) in magnetic field magnitude measurement and less than 1° error in magnetic field direction. The magnetic field error resulting from the discrepancy in estimated position of the two-body propagator with the other two propagators is about one order of magnitude higher. The reason such large position errors result in fairly small magnetic field estimation errors is that minimum electromagnetic wavelengths simulated by the IGRF are on the order of thousands of kilometers, so a position error of a few kilometers is essentially negligible.

38

Figure 2.5. Comparison of radial and absolute differences in position for Keplerian, Parameter Variation, and SGP4 orbit propagation algorithms.

Figure 2.6. Comparison of magnetic field magnitude among the three orbit propagators investigated.

39

Figure 2.7. Comparison of magnetic field direction among the three orbit propagators investigated.

SGP4, the general perturbation method used to derive NORAD’s TLEs, was chosen as the orbit propagation algorithm for simulation because it is fairly computationally simple, does not require numerical integration, and is generally accurate on the order of kilometers43. Very accurate position estimation provided by thorough special perturbation and semi-analytic perturbation techniques is not required to achieve a good estimate of the local magnetic field, as was shown in the comparison of the various propagation methods. Therefore, for the purpose of attitude controller design, speed of the propagation algorithms is more important than position accuracy, because faster algorithms allow faster simulation, thereby allowing a more-expedient design process.

40

Chapter 3

PD Controller and the LQR

The general Proportional Derivative (PD) controller for attitude control utilizes feedback of the angular rate and quaternion errors to generate a control response. By this definition, a constant-gain LQR that uses angular rate and quaternion errors to generate a control response is a

PD controller. However, this type of constant-gain LQR is a special type of PD controller that implements a constant feedback gain matrix obtained in solving a linear-system, quadratic-cost optimal control problem. The general PD controller, on the other hand, can utilize any nonlinear function to calculate a control action from the state error. In general, it may be possible to find a nonlinear PD controller with better performance qualities than an LQR, but this enhanced performance may come at a price of higher computational complexity. In this chapter, a linear constant-gain PD control structure is developed by hand without the constant-gain LQR design algorithm. It is shown that this controller is essentially identical to an LQR.

3.1 General Controller Structures

The general PD feedback structure for providing control torques for solely magnetically actuated attitude regulation is given by Equation 3.1. This equation simply states that a PD

41 feedback law calculates control action using a function of the attitude error and the angular rate error, in addition to information about the magnetic field.

휏 = 푓(푞푒푟푟, 휔푒푟푟, 퐵) (3.1)

Arguably one of the simplest incarnations of this structure can be found by momentarily ignoring the fact that the control can only be applied in a given plane at any one instant and just looking at the nonlinear dynamic equations of motion in Equation 2.17. From this equation, it is obvious that the control torque vector will impart an angular acceleration proportional to the torque vector pre-multiplied by the inverse of the principal moment tensor. This equation also shows that angular acceleration is proportional to some second-order off-axis coupling among the three axes. However, the off-axis coupling terms are fairly small for small angular velocities and small differences among the three principal moments of inertia. A control torque can be thought of as being composed of two parts: one part to negate these coupling terms, and the other part to impart the actual desired angular acceleration, as shown in Equation 3.2. Considering the system with the coupling terms pre-negated, such that the control torque that imparts the desired angular acceleration is the only torque of interest, the dynamic equations of motion become completely decoupled linear first order differential equations, as shown in Equation 3.3. If the angular acceleration is then made proportional to the negative of the angular velocity, as is done in Equation 3.4, simple linear differential equation analysis shows that the solution is exponentially stable to the zero angular velocity state. Furthermore, if the angular acceleration is made proportional to the negative of the angular velocity error, as is done in Equation 3.5, the system is exponentially stable to the desired angular velocity state.

퐼퐵휔̇ 퐵 = (퐼퐵휔퐵) × 휔퐵 + 휏푐표푢푝푙푖푛푔 + 휏훼 (3.2)

42

휏푥 퐼 휔̇ 푥 푥 훼푥 휏푦 −1 휔̇ 훼 휔̇ 퐵 = 퐼퐵 휏훼 = [ 푦] = 퐼 = [ 푦] (3.3) 푦 훼 휔̇ 푧 휏푧 푧 [퐼푧 ]

휔̇ = −푎휔

푑휔 = −푎휔 푑푡

−푎푡 휔 = ¢푒 (3.4)

휔̇ = −푎휔푒푟푟 = −푎(휔 − 휔푑푒푠)

푑휔⁄푑푡 = −푎 휔 − 휔푑푒푠

ln|휔 − 휔푑푒푠| = −푎푡 + 퐶

휔 = 휔 + ¢푒−푎푡 푑푒푠 (3.5)

However for inertial attitude regulation, it is not enough that just the angular velocity converges to zero. The error quaternion, found by pre-multiplying the current attitude quaternion with the inverse (complex conjugate) of the desired quaternion, must be the identity quaternion

(i.e. the current attitude quaternion must equal the desired quaternion). Therefore, the current coordinate axes must perform some rotation maneuver to “reach” the desired coordinate axes.

One conceptually easy means by which these axes could accomplish this is by rotating about the error quaternion Eigen Axis in the negative sense. That is, the desired angular velocity is proportional to the negative of the Eigen Axis direction. Moreover, because infinite control authority is not physically realizable, it is desirable to decrease the constant of proportionality

43

(i.e. the magnitude of the desired angular velocity) to zero as a function of the deviation of the current attitude from the desired attitude, such that the desired rotation rate decreases, thus is capable of being changed with a reasonably finite torque, as the attitude reaches its desired state.

The sine of the half angle, which multiplies the Eigen Axis in the quaternion parameterization, provides exactly this quality to the Eigen Axis. Therefore, the imaginary vector portion of the quaternion attitude parameterization provides a vector that is proportional to a desired angular velocity vector suitable for use in simultaneously driving the error quaternion to the unit quaternion and the angular velocity to zero. The resulting control law in Equation 3.6, when used with diagonal 푃 and 퐷 matrices, is termed the Simple PD controller.

퐼퐵휔̇ = 휏훼 = −퐴0퐼퐵휔푒푟푟 = 퐴0퐼퐵(−휔 + 휔푑푒푠)

= 퐴0퐼퐵(−휔 − 퐴1푣푒푟푟)

= −퐴0퐼퐵휔 − 퐴1퐴0퐼퐵푣푒푟푟

= −(푃퐼 푣 + 퐷퐼 휔) 퐵 푒푟푟 퐵 (3.6)

Now, remembering that the coupling terms and thus the torque negating them was ignored for the time being, the true desired torque is given by Equation 3.7.

휏 = −(푃퐼퐵푣푒푟푟 + 퐷퐼퐵휔) + 휏푐표푢푝푙푖푛푔 (3.7)

These coupling terms are essentially dependent only on the angular velocities, such that if the equations were linearized, feedback terms dependent on the off-axis angular velocities would appear in matrix 퐷 of Equation 3.7. Furthermore, external torques due to gravity gradient and atmospheric drag have been ignored up to this point. These terms are dependent on the attitude

44 terms, such that when they are accounted for, feedback terms dependent on all three imaginary parts of the quaternion vector appear in matrix 푃 of Equation 3.7.

휔 휏 = −(푃퐼퐵푣푒푟푟 + 퐷퐼퐵휔) = −[퐷퐼퐵 푃퐼퐵] [ ] = −퐾푥 (3.8) 푣푒푟푟

The rearrangement done in Equation 3.8 shows that the feedback appears as an LQR feedback would. Therefore, the LQR feedback matrix is similar to the Simple PD feedback matrix, except that the Simple PD feedback matrix assumes the cross-coupled terms are all zero; the means by which both matrices are found is also substantially different. The assumption that cross-coupling terms are zero is justified due to the very small angular rates expected during the satellite lifetime, the small differences among the principal moments of inertia, and the small worst-case magnitudes of the disturbance torques (approximated in Chapter 2). So, it is expected that the simple PD controller should behave very similarly to the LQR.

The other inconvenient truth that was ignored in this conceptual analysis of the problem is the fact that this desired torque cannot actually be applied using solely magnetic actuation. Instead

Wiśniewski has suggested using a relation similar to Equation 3.9 to find the component of the desired torque projected on the actuation plane and the magnetic moment that must be supplied by the magnetorquers to produce this torque.

휏푑푒푠 = −(푃퐼퐵푣푒푟푟 + 퐷퐼퐵휔)

퐵 × 휏 푀 = 푑푒푠 |퐵|2

휏 = 푀 × 퐵 (3.9)

45

It is less obvious that the torque producible by the magnetorquers will make the system converge to the desired state, but Chapter 1 discusses some results on stability analysis of a magnetically actuated spacecraft using this type of feedback control. To review, Astolfi and

Lovera17 found a magnetically actuated spacecraft utilizing a simple PD control law similar to the one developed in this chapter, without the coupling torque term, is locally exponentially stable and all trajectories converge to the desired state as long as the proportional and derivative terms are scaled properly with respect to one another17.

3.2 PD Design Process

An iterative process of simulation, solution evaluation, and gain attenuation is undertaken.

Simulation is performed using the equations of motion and models developed in Chapter 2 and

Chapter 3; the simple PD controller from Section 3.1 is used to generate the control response.

Coupled with this task, and following the work of Guerrant, the actuation and measurement times are adjusted such that the simulated solutions exhibited the desired settling characteristics25. For consistency, all simulations utilize the same set of initial conditions, given in Table 5.1. This design condition represents a realistically achievable attitude rate using a B- dot algorithm for initial CubeSat detumble and a relatively large-angle slew (or rotation) from the desired attitude.

3.3 LQR Design Process

3.3.1 Optimal Solution of Linear Constant-Gain Feedback Control

The constant gain linear quadratic regulator for attitude control is the linear PD feedback matrix that minimizes a cost function, thus solving an optimal control problem. The general cost

46 function, Equation 3.10, is the integral over time of an “everywhere positive” quadratic function of the states and control action in addition to a terminal cost penalty for a final state error.

1 푇 1 푡푓 푇 푇 퐽 = 푥 (푡푓)푆푥(푡푓) + ∫ (푥 (푡)푄푥(푡) + 푢 (푡)푅푢(푡))푑푡 (3.10) 2 2 푡0

In Equation 3.10, Q and R are both positive-definite matrices, meaning any appropriately- sized nonzero vector quadratically multiplying these matrices, as x and u do, will result in a positive value. The matrix S is positive semi-definite, meaning some final state vectors will result in zero cost. The optimal control problem is solved by finding the minimum of the cost function subject to the linearized dynamics of the system, given by Equation 3.11, which is a general version of Equation 2.34, and the assumed feedback control, given by Equation 3.12.

푥̇ = 퐴푥 + 퐵푢 (3.11)

푢 = −퐾푥 (3.12)

In addition, because the periodicity is a sufficient condition for magnetic attitude controllability (assuming linear independence of the magnetic field and its time derivative), the periodic behavior of the linearized system is taken into account. A time-periodic LQR solution, in which the feedback matrix varies periodically with time, could be solved by providing the periodic approximation of the linearized attitude equations of motion and solving a periodic optimal control problem. However, a constant-gain, or infinite horizon solution is sought for its ability to be easily implemented, so the simple average of Equation 2.34, the linearized equations of motion with respect to time, is taken to represent the system dynamics using time-invariant equations of motion.

47

The solution to the time-invariant optimal control problem given in Equations 3.13 and 3.14, with an infinite final time and zero final cost, is given by the Algebraic Riccati Equation (ARE), given in Equation 3.13, and the corresponding equation for the feedback gain matrix, given in

Equation 3.14.

0 = 푃퐵푅−1퐵푇푃 − 푄 − 푃퐴 − 퐴푇푃 (3.13)

푢 = −퐾푥 = −푅−1퐵푇푃푥 (3.14)

The ARE can be solved for the constant matrix, 푃, which in turn can be used to solve for the constant feedback gain matrix.

3.3.2 Defining the Optimal Control Problem

Though the ARE and the corresponding equation for the feedback gain matrix provide a nice solution to the constant-gain feedback optimal control problem, these equations do not provide a truly unique optimal solution given just the mass, size, and orbital properties of the spacecraft.

One must also define the weighting matrices, Q and R, in order to solve the optimal control problem. This raises the question: How should the Q and R matrices be constructed to produce the “best” system response? This question may lead to other questions, but all are essentially asking the same question: For the given system and its requirements, what defines the optimal response?

These are arguably design questions, so therefore some design iteration is needed to find an

LQR, much the same that a design approach was required to develop a simple PD controller.

Some general rules of thumb have been established to aid in the design of an LQR. Additionally, search algorithms can be implemented to find the Q and R matrices which minimize the time it takes the attitude to converge to a certain error, for example10. However, whether automated or

48 performed more by hand, the design process largely consists of guessing Q and R matrices, solving for the feedback gain matrix, simulating the system response with the controller, analyzing the response with respect to desired qualities, and repeating the process by re-guessing the Q and R matrices until the compensated system exhibits the desired qualities or is as close as possible to exhibiting the desired qualities.

The design approach taken to develop the LQR for solely magnetic attitude control of the

CubeSat is started by implementing Bryson’s rule. Bryson’s rule is a basic method for forcing all states and control to affect the cost function equally. Q and R are restricted to be diagonal matrices, with positive constants equal to the inverse of the square of the maximum expected or desired value of the corresponding state or control, as shown in Equations 5.1 and 5.2. This effectively normalizes the effects of each state and control, such that the expected maximum value of the contribution of each state and control is one. However, it should be noted that this does not actually limit the maximum values of these quantities; Bryson’s rule is only a first-cut attempt at adequately defining the optimal control problem.

With a first guess of Q and R matrices, the resulting feedback-gain-matrix-compensated system is simulated. Another general rule of thumb is used to adjust the Q and R matrices appropriately. If the controller appears to be overcompensating, the R matrix is multiplied by a factor greater than one. If the state dynamics appear to be dominating the system response with very little effect from the controller, the R matrix is multiplied by a factor less than one and greater than zero. This rule of thumb increases the magnitude of the control response if the controller appears to be undercompensating the dynamics, and it decreases the magnitude of the control response if the controller appears to be overcompensating the dynamics.

49

3.4 Summary

A walkthrough of the reasoning behind using a proportional derivative feedback controller for attitude control was given. The difficulties in applying this control to the magnetic actuation problem were discussed, and literature was cited showing that magnetically-actuated PD feedback is at least globally stable and locally exponentially stable. The design process for the

Simple PD controller and the theory behind and design process for the LQR were presented, as well.

50

Chapter 4

Genetic Algorithm-Tuned Fuzzy Logic System

In this chapter, a unique approach is explored for developing a nonlinear PD feedback controller for solely magnetic attitude control by using a genetic algorithm to tune a fuzzy logic gain-scheduled PD controller. The genetic algorithm coupled with the fuzzy logic system is generally referred to as a genetic-fuzzy system. For the attitude control problem, the fuzzy inference systems developed in this chapter approximate nonlinear PD feedback by using the following two inputs: an effective magnitude of error in the attitude (effective because the error quaternion magnitude is always one) and the magnitude of angular velocity error. These function inputs are more-specific versions of the function inputs proposed for the generalized magnetic attitude PD feedback controller given by Equation 3.1. This simplified approach is taken to reduce the computational demand of the resulting fuzzy inference systems.

4.1 Fuzzy Logic Overview

Fuzzy logic is a multivalued logic construct that allows digital computers a means by which to emulate subjective decision-making. Moreover, fuzzy logic can be used to infer a set of outputs based on a set of inputs and a set of logic-based rules that map inputs to outputs in what is termed a fuzzy inference system (FIS). Various methods, including the Mamdani and Sugeno

51 methods exist for performing the mapping, but all methods have been shown to allow fuzzy inference systems to act as universal approximators44. The work done in this thesis follows

Mamdani’s method, as it is the most common fuzzy inference system method44. The property of universal approximation means that fuzzy inference systems can be used to approximate any function to any arbitrary degree of accuracy. However, with increasing accuracy in function approximation, the fuzzy system becomes more complex, and thus computational complexity increases.

4.1.1 Fuzzy Sets and Membership Functions

Fuzzy sets are multivalued sets, meaning that an item can belong partially to a fuzzy set. In a bivalent set, which is the type of set with which most people are familiar, an item either belongs to a set or does not belong to a set; there is no partial set membership. For example, the set of all rectangles over the space of all two-dimensional geometric objects is a bivalent set. A 2D geometric shape is either a rectangle or it is not; the shape either belongs 100% to the set or 0% to the set. In contrast, the set of all round 2D geometric objects is arguably fuzzy. Some examples of 2D objects that are somewhat round and somewhat not, belonging to the set to a degree between 0% and 100%, include: half circles, crescent shapes, and even regular polygons with a large enough number of sides. It should be noted that the adjective “round” is decidedly a more subjective criterion than “being a rectangle.”

In FISs, the input and output “linguistic” variables are broken down into fuzzy sets called membership functions, which act as adjectives to the linguistic variables. For instance, if angular velocity were an input, “angular velocity” would be the linguistic variable, and words that describe the angular velocity, such as “fast” or “slow,” could be appropriate membership functions of “angular velocity”45. Again, these adjectives are subjective, depending on the

52 context in which angular velocity is used. A person measuring the angular velocity of a motor shaft might have a different definition of “fast” compared to a person measuring the angular velocity of a rotating spacecraft.

Membership functions, as their name suggests, do act as functions of the value of the linguistic variable. The membership function outputs the degree to which the value of the linguistic variable belongs to the set (also referred to as a membership function). Most often membership functions are shown plotted, where the abscissa is the value of the linguistic variable, and the ordinate, on the range [0 1], is the degree of membership of the value of the linguistic variable to the given membership function. Common membership functions are triangular, trapezoidal, Gaussian, and sigmoidal, shown in Figure 4.1. All these membership functions assume that at least one value of the linguistic variable belongs 100% to the membership function set. Triangular membership functions are the simplest because only the three linguistic variable values at the vertices of the triangle are needed to define the triangle, and points between the vertices can be found by linear interpolation. Similarly, trapezoidal membership functions are fairly computationally simple, with four such values needed. On the other hand, Gaussian and sigmoidal membership functions, though only requiring two defining values, require computation of the Gaussian and sigmoid functions, which is more taxing than the linear interpolation of the triangular and trapezoidal membership functions.

53

Figure 4.1. Triangular, Trapezoidal, Gaussian, and Sigmoidal membership functions.

4.1.2 Fuzzy Inference System

A fuzzy inference system is essentially a function that maps inputs to outputs. The process by which this transformation occurs may, at first, appear convoluted. However, the algorithms that have been proposed to accomplish this mapping all attempt to imitate the human decision- making process by combining the results of a series of logical, if-then statements to produce an answer, using fuzzy sets to first map the problem to a linguistic domain, then again to map the problem from the linguistic domain to a numerical domain. The pre-mapping to a linguistic domain is known as fuzzification. Application and combination of the if-then rules is known as the inference method. Finally, defuzzification is the process that maps the result of the inference

54 method, generally not a single number and usually a hybrid membership-function-like set, to a single value for each output.

4.1.3 Fuzzification

Fuzzification is the evaluation of all the linguistic variables’ membership functions at the inputs. So, for example, the value of angular velocity with membership functions “slow” and

“fast” could yield 0% slow and 100% fast or possibly 40% slow and 30% fast (the values do not have to be complements). All other linguistic input variables and all their respective membership functions are evaluated in the same manner.

4.1.4 Inference Method

The inference method is dependent on the type of FIS. In this work, Mamdani-type FISs that use min-max composition are utilized for the attitude control fuzzy gain scheduler. Generally, the inference method takes the fuzzified values, substitutes them for the antecedents in the if- then statements, logically evaluates the effective antecedent of the if-then statements, and evaluates the if-then statements to produce a result. This process is outlined in Table 4.1.

Table 4.1. Inference method steps using min-max method. Step Explanation Original If-Then Statement If (in1 is mfn1) AND (in2 is mfn2) AND … Then (out1 is mfm1) AND (out2 is mfm2) AND … Substitute Numeric Fuzzified Values for g1 AND g2 AND … Then (out1 is mfm1) AND Antecedents (out2 is mfm2) AND … Logically Evaluate Effective Antecedent min{g1,g2, …} Then (out1 is mfm1) AND (out2 is mfm2) AND … Evaluate If-Then Statement → Result out1 = h1; out2 = h2; …

The inference process for Mamdani-type FISs uses the fuzzified values in the antecedents of the if-then rules to limit the membership functions of the consequents of the if-then rules to a

55 maximum value. Then, the consequents of the if-then rules are combined over the output range to produce what is effectively an output membership function. This effective output membership function may not remotely resemble one of the four membership functions in Figure 4.1, and it may not even have a value at which set membership is 100%, but it does provide a means by which to extract a single output value, a topic discussed in the next section on defuzzification.

This process, from fuzzification through defuzzification, is outlined in Figure 4.2.

Figure 4.2. Fuzzy Inference Process showing: (1) Input, (2) Fuzzification, (3) Inference, and (4) Defuzzification.

The min-max composition that the fuzzy gain scheduler uses dictates exactly how the antecedents and consequents of the if-then rules are combined. Using min-max composition, the minimum of the antecedents is taken to be the effective antecedent. That is, if the conditional portion of the if-then statement has more than one condition to be satisfied, the conditions must be combined using logical ANDs (i.e. minima or intersections). For each rule and for a given output linguistic variable, this minimum value is used to limit the corresponding output

56 membership function, as described previously. When all the consequents of one output linguistic variable are combined, the maximum value of all the consequents is taken to be the resultant value of the effective output membership function at every point over the output range.

4.1.5 Defuzzification

Like the inference method, defuzzification is dependent on the type of FIS. In addition, for a

Mamdani-type FIS, there are several ways in which defuzzification could be accomplished.

Again, all yield FISs that act as universal approximators44, so from this perspective, the choice is not terribly important. For the attitude control fuzzy gain scheduler, centroid defuzzification is used. Centroid defuzification essentially determines the centroid of the area(s) of the effective output membership function found through the inference step and returns this value as the defuzzified output for the given output linguistic variable.

4.2 Genetic Algorithm Overview

A genetic-fuzzy approach was used because genetic optimization is relatively easy to implement for fuzzy control system design. In comparison, other heuristic optimization techniques, such as neural-fuzzy and ant colony optimization, require a priori knowledge of function input-output relations and/or fairly extensive problem reformulation. For example, neural network methods for tuning fuzzy membership functions require a set of training data in which input-output sets are known44, 45. Therefore, using a neural-fuzzy approach to tuning the fuzzy system would not be as straightforward as simulating the satellite system with an applied feedback controller and modifying controller parameters based on system stability properties; the problem would need reformulation. Similarly, ant colony optimization requires the problem to be reformulated into a path length minimization problem54. In contrast, the only problem

57 reformulation a genetic algorithm requires is expression of the problem as an optimization (i.e. definition of a fitness function) and parameterization of values to be changed in optimization.

Genetic algorithms are a heuristic approach to solving parameter optimization problems46.

The parameters to be optimized are coded in strings of numbers, usually using binary digits but possibly using other bases47. A set of possible solutions is generated using the coding scheme, and the problem is evaluated using the strings of the possible solutions. Solutions are selected based on their fitness to recombine with one another or possibly mutate into new solutions to produce the next generation of possible solutions. The best solutions may even be deliberately copied into the new generation, a process known as elitist selection, in order to increase likelihood of solution convergence or offset the effects of high mutation rate, which tends to lead to a longer time to find the solution47. The process is repeated from the solution evaluation step until the algorithm has converged on a solution.

4.2.1 Strings – Problem Parameterization

Converting the parameters of the optimization problem into strings of numbers allows the recombination, or crossover, and mutation routines of the genetic algorithm to function. One important aspect of the string is the selection of the base into which the parameters are converted. Most often, parameters are expressed as binary numbers, and each parameter is listed in the string one after the other with no spaces46. This can lead to a very long binary string representation of the parameters and is relatively undesirable if large numbers of these strings are to be stored. Alternatively, base ten could be used to represent the optimization parameters, thus reducing string size. However, base ten representation requires special mutation operations because, unlike binary, a number in base ten does not have a definite “opposite” value46.

58

Furthermore, other bases could be used in special circumstances. For example, the rules for one linguistic output of a FIS could be represented in a base equal to the number of possible linguistic output membership functions. In this case, each number corresponds to a known set of input membership functions and a known linguistic output, and the value of the number corresponds to the membership function of the linguistic output. A value could even be included to represent the possibility that no output membership function is triggered by the rule, thus increasing the base of the number required to represent the FIS rules by one. This is the case for the attitude control fuzzy gain scheduler; three output membership functions are used, so base four is used to represent the FIS rule string.

4.2.2 Population Size

Population size plays an important role in solution convergence. A large population allows a large number of possible solutions to be evaluated and more likely allows good solutions to combine at an earlier generation47. Additionally, with a large number of possible solutions evaluated, it is less likely the solution will converge to a local minimum cost. However, the drawback to large populations is that every member must be evaluated (unless it is identical to another member), so generational solution time increases, possibly increasing overall solution time. The population size for the genetic algorithm used to tune the attitude control fuzzy gain scheduler is initially fifty members, increasing to and remaining at fifty two members for each subsequent generation, due to elitist selection of the best two population members.

4.2.3 Selection – Roulette Wheel

Selection is the method by which members of the population are picked to undergo crossover or mutation operations46. Several different selection methods exist, but the one used for tuning the attitude control fuzzy gain scheduler is Roulette Wheel Selection. In Roulette Wheel

59

Selection, the fitness of all population members is normalized, such that the sum of all members’ fitness values is one46. Each member is then given a percentage of the range between zero and one corresponding to the member’s normalized fitness value46. A random number is generated on this range, and the member whose part of the range on which the random number falls is selected for further manipulation46. This procedure tends to select the fitter members of the population more frequently and allows all members the opportunity for selection, unlike stochastic universal sampling, which tends to select all members of the population with equal likelihood or tournament selection which tends to select the fittest members more frequently, but never selects the weakest member of the population46.

4.2.4 Crossover

Crossover is the method by which two members of a population recombine to form one or two new members of the next generation. In single point crossover, a single point between any two digits in the string is selected, and the information after this point in one member is swapped with information after this point in another member, thus creating two new population members with the correct number of digits in each string46. This method is good for generating large changes in the population members, but once the solution nears convergence, only small changes are generally needed to reach the optimum, and single point crossover likely will not yield these small changes47.

In two point crossover, two points in the string are chosen, and two members of the population swap digits between these points46. This effectively solves the problem single point crossover has in tending to generate too large of a change; two point crossover can exchange as little as one digit. However, if too little information is swapped, two point crossover can have a difficult time weeding out bad solutions within the first few generations of the algorithm.

60

4.2.5 Mutation

Mutation is the method by which a single member of the population is altered to form one new member of the next generation. Mutation in a binary string is accomplished by selecting one or a number of distributed or contiguous digits and inverting them, such that the ones become zeros and the zeros become ones46. Mutation of a string of another base is slightly more complex.

For instance, it could be accomplished by adding or subtracting one to the digit unless the digit is the maximum or minimum value, respectively, in which case the minimum or maximum digit, respectively, replaces the digit being mutated. Another possible method to perform mutation in non-binary strings is to replace the digits selected for mutation with random allowable values; however, this method does not guarantee the digits being mutated will actually change.

Mutation generally allows new genetic information to enter the population, whereas crossover takes genetic information already in the population and recombines it46. Mutation is beneficial for perturbing populations from a local optimum solution, thus helping to find a global optimum solution47. However, this perturbation away from optima slows solution convergence. Therefore, the rate of mutation tends to be selected to be very small. If it is uncertain whether the solution will converge to the global optimum, as desired, or whether it will converge to local optima, a high mutation rate is selected, and other methods, such as elitist selection, are used to ensure the solution does not diverge from an optimum47.

4.2.6 Elitist Selection

Elitist selection is the process of selecting a number of the fittest members of the population in the current generation to pass unaltered to the next generation unchanged by mutation or crossover46. This allows population members with very good fitness to “survive” and pass into

61 the next generation, negating the effects of a high mutation rate, which alters a large portion of the population and tends to shift the population from the optima.

4.3 Genetic-Fuzzy System Implementation

A genetic algorithm is used to tune the fuzzy inference systems used for the attitude control fuzzy gain scheduler. The attitude control fuzzy gain scheduler is composed of two FISs, one of which outputs the proportional feedback gain, and the other outputs the derivative feedback gain.

The fuzzy feedback gains are utilized in a Simple PD controller.

4.3.1 Fuzzy Inference Systems

The two fuzzy inference systems for the attitude control fuzzy gain scheduler output the appropriate feedback gains. These FISs can be viewed as nonlinear functions that accept two input values and output one value. However, one nuance of the FISs is that they can only accept inputs and produce outputs on given ranges, which are generally the product of design.

Therefore, the input and output ranges are normalized because it is assumed that appropriate gains can be found to scale the true inputs to the normalized ranges and similarly appropriate gains can be found to scale the normalized output values to a more-appropriate range. This linear mapping before and after the fuzzy inference system allows the FIS to take on a simpler form with fewer degrees of freedom to be tuned, or designed by the genetic algorithm. In addition to being normalized, the input values are saturated such that inputs above and below the normalized input range are limited to the maximum or minimum range values, respectively. This simply assists the FIS to find a solution, instead of allowing it to accept values about which it has no information.

62

If the normalization differences are not considered, the two inputs to each FIS are identical.

The first input is effectively the angle through which the body-fixed coordinate system must rotate about the Eigen Axis in order to coincide with the desired coordinate system. This angle is expressed such that the maximum value it can assume is one, corresponding to a 180° error, and the minimum value it can assume is zero, corresponding to no error. The second input is the normalized angular velocity magnitude, which is essentially the magnitude of angular velocity error, because the desired angular velocity is zero. Unlike the normalized angular error, there is no natural maximum value the magnitude of angular velocity error can assume. However, the minimum value the magnitude of angular velocity can assume is zero, corresponding to a spacecraft with the desired angular velocity.

Now, considering the effects of pre-scaling constants, the scaled inputs must be limited to their maximum allowable value, one. Even though the angular error is basically already normalized, a scaling value is utilized with this input to provide some additional design degrees of freedom, in case a regime that needs a large change in gain exists in a relatively localized region of the input space. More specifically, the thought here is that the system is locally exponentially stable with the correct scaling of gains, but there might be another set of gains that would improve performance outside this local region of exponential stability. Therefore, the normalized and scaled angular error input must be limited to a maximum value of one as is the scaled angular velocity error magnitude input. However, because both values have a natural minimum of zero and the scaling does nothing to change this, there is no need to check that the values are greater than or equal to zero. With that, the fuzzy scheduled proportional and derivative gains can be expressed as scaled functions of the scaled magnitudes of angular error

63 and angular velocity error limited to a maximum value of one, as is shown in Equations 4.1 and

4.2.

2 푃 = 푐 ∙ 퐾 (min {푐 [1 − |1 − cos−1(푤 )|] , 1} ; min{푐 |휔|, 1}) (4.1) 푃 푃 푃,푞 휋 푒푟푟 푃,휔

2 퐷 = 푐 ∙ 퐾 (min {푐 [1 − |1 − cos−1(푤 )|] , 1} ; min{푐 |휔|, 1}) (4.2) 퐷 퐷 퐷,푞 휋 푒푟푟 퐷,휔

Most importantly, these gains are used in the very Simple PD feedback law of Equation 3.6, where P and D are scalars. Additionally, as with the other magnetic attitude control laws,

Equation 3.9 is used to limit the desired torque to the applicable torque and thus the effective magnetic moment, a projection of the desired moment on the plane perpendicular to the magnetic field vector.

In addition to the design degrees of freedom provided by input and output scaling factors, more degrees of freedom are available in design of the nonlinear FIS mapping. The nonlinear mapping is determined by the input/output membership function parameters and the rules that link input membership functions to output membership functions. However, if some of the design variables are not fixed a priori, the task of the genetic algorithm to optimize the controller opens up, effectively gaining infinite degrees of freedom due to the fact that some design variables, namely the number of input membership functions, drive the total number of design degrees of freedom. Not only does the number of input membership functions drive the total number of possible rules, the total number of rule combinations increases as the power of the number of inputs, so the number of rules increases exponentially with the number of inputs. It is this growth in complexity that makes it convenient to fix the number of inputs to the two magnitudes of error and to fix the number of input membership functions to three for each input.

64

Similarly, the number of output membership functions is restricted to three. These restrictions provide nine combinations of input membership functions, therefore nine possible rules for each

FIS, and three possible consequents for each rule. The choices of which, if any, output membership function to assign to each input membership function combination are left as design variables to be tuned by the genetic algorithm.

Even more degrees of freedom can be removed from the problem by fixing membership parameters. This can be done without too much loss in generality, because the input and output ranges have been normalized. Triangular membership functions are chosen for all inputs and outputs because they are one of the least computationally demanding membership functions to use. One straightforward parameter to fix is the center point of the leftmost triangular membership function because it can be reasonably assumed that a special set of gains may exist for very small errors, corresponding to a state or part of the state near the equilibrium point.

Similarly, another straightforward parameter to fix is the center point of the rightmost triangular membership function because it can be reasonably assumed that a special set of gains may exist for very large errors, corresponding to a state or part of the state very far from the equilibrium point. Fixing these two extreme points also eliminates two other parameters, namely the leftmost vertex of the leftmost membership function and the rightmost vertex of the rightmost membership function, because these vertices fall outside of the input range and do not contribute any meaningful information to the FIS. All the other input membership function vertices are free to be moved during design. Therefore, the rightmost vertex of the leftmost membership function; all the vertices of the center membership function; and the leftmost vertex of the rightmost membership function of the input linguistic variables are free variables left to the genetic algorithm to define. This is highlighted in Figure 4.3

65

Figure 4.3. Free input membership function vertex x-values (circled in red).

Following the same type of reasoning why the leftmost and rightmost input membership function center vertices are fixed at zero and one, respectively, the leftmost and rightmost output membership function center vertices are chosen to be fixed at zero and one, respectively.

However, in this case it is assumed that the gains output by the FISs could possibly take on some very small value close to zero or could possibly take on some maximum value, relatively far from zero. A free membership function in the center allows greater weighting toward one side or the other, or not. Additionally, in order to allow the output to fall on the closed interval between zero and one, the output range used for defuzzification must extend beyond the limits of [0 1], because the centroid defuzzification process returns the center of area of the effective output membership function. Therefore, a set of membership functions with nonzero area can never return the minimum or maximum value of the range over which defuzzification is carried out.

For this reason, the closed interval [-0.5 1.5] is chosen as the output interval over which the defuzzification routine calculates the center of area, and the triangular membership functions are chosen to be isosceles with half-widths no greater than one half. These restrictions, detailed in 66

Figure 4.4, ensure the maximum and minimum values capable of being output by the FISs are one and zero, respectively, yet they do not significantly limit the ability of the FISs to generate a nonlinear mapping of the inputs to outputs.

Figure 4.4. Free output membership function x-values (circled). Circles on membership function endpoints are equidistant from center diamond of same color.

4.3.2 Genetic Algorithm

The genetic algorithm, as stated previously, is used to tune all the variable parameters of the proportional and derivative FISs discussed in section 4.3.1. In addition to these variables, the genetic algorithm is also able to modify two timing parameters of the controller. This tuning is accomplished by first selecting bases and limits for all the free variables and concatenating these representations so that a string of digits of a specific form and length expresses each candidate solution. Then, the genetic operations discussed in Section 4.2 are carried out over a number of generations until the solution converges to an optimum. This optimum is found by evaluating the cost function in Equation 4.3, whose parameters for the magnetic attitude control problem are

67 found in Table 4.2; these parameters were found by estimating the values they multiply and ensuring the products were roughly the same, similar to Bryson’s rule for the LQR.

At first glance, this may appear to be an identical problem to that of the LQR, wherein parameters of the cost function need to be updated via a design process to achieve the desired result. However, the cost function of the LQR is required to be of a certain form, a positive- definite quadratic function of the state and control time histories, whereas the cost function used by the genetic algorithm can be as nonlinear as need be to accurately assess the candidate solution. For instance, the cost function could evaluate, via a Monte Carlo analysis, the probabilistic stability characteristics of each solution based on its probability of providing a stable solution within certain error bounds and/or its probability of achieving a certain bounded error within a given amount of time. Unfortunately, evaluation of this cost function for each population member would take a very long time, as each member would need to be evaluated many times to accurately calculate probabilistic quantities, so it may not be a practical means by which to find the best solution using a genetic algorithm. Luckily, other very good choices of cost functions do exist.

One good choice of a cost function for the present magnetic attitude control problem is that given by Equation 4.3 and used by the present genetic algorithm. Notice that this cost function does not penalize control effort at all, a parameter on which the LQR solution heavily relies.

Instead, the cost function penalizes averages of the states, weighted by approximate order-of- magnitude factors, and the final time at which the attitude angular error is above the ten degree error bound, a decidedly nonlinear function with which an LQR-solving algorithm would have a fairly difficult time dealing without resorting to more-general optimal control techniques.

However, the obvious advantage of the LQR is that an analytical solution exists for the constant-

68 gain LQR problem, whereas no analytical solution exists for any possible more-general optimal control problem posed to the genetic algorithm.

On further examination of Equation 4.3, the final settling time appears to be penalized twice; once in average errors and again in the final settling time term. The large errors in the initial attitude correction tend to dominate the average error terms. A better approach might be to use the averages of the errors after settling time instead of the averages of the errors over all of simulation time. However, considering a random initial population, none of the population members are guaranteed to define a controller that allows settling to the desired attitude. All solutions that do not settle to the desired attitude will have the same cost because their settling times (final solution time) will be identical, and all their average errors after settling time will be identically zero. This means that convergence would essentially start out as a random search, relying heavily on mutation, which potentially may never find a solution that is able to settle the system to the desired attitude. Furthermore, different solutions that are able to settle the system could potentially be separated by these maximal cost solutions, meaning that the algorithm would be very susceptible to converging to local optima.

퐽 = 푘1휔푎푣푒 + 푘2휃(푑푒푔)푎푣푒 + 푘3푡푓 (4.3)

휃(푡) ≤ 휃푚푎푥 ∀푡 ≥ 푡푓 (4.4)

Table 4.2. Genetic algorithm cost function constants. Cost Function Constants k1 1 -5 k2 5×10 -8 k3 5×10 휃푚푎푥 10°

69

In a real-world implementation, the controller will actuate the magnetorquers at a constant current for a determined amount of time, then turn off the magnetorquers for a period of time so that Earth’s magnetic field, not the magnetic field produced by the spacecraft attitude control system, can be measured. The amount of time the magnetorquers are actuated and the amount of time the magnetorquers are turned off are the two timing parameters tuned by the genetic algorithm. These parameters, expressed in six-digit binary, are allowed to take on values between ten and sixty-three and are the first values in the parameterized string, as described in Table 4.3.

The next variables in the parameterized string are those that describe the membership function vertices. Six-digit binary values are used to specify where on the closed interval, [0 1], these vertices lie, in effect discretizing this range into sixty-four locations where binary value zero corresponds to zero and binary value sixty-three corresponds to one. For those membership functions whose widths are defined in lieu of defining exactly where on the interval the leftmost and rightmost vertices lie, five-digit binary values are used to specify the number of discrete points these vertices are offset from the center vertex.

Intermixed with the membership function vertex parameters are parameters that specify the input and output gains, expressed in scientific notation. The first set of parameters represent the powers of ten. These terms are three-digit binary values, representing a range from negative three to positive four, that add to a nominal exponent value determined by hand-tuning the Simple PD controller. If no nominal exponent had been known, the gain exponent could have been expressed as a larger binary string to search more possible values. However, since nominal values were already known, there was no sense in increasing solution complexity.

70

In addition to these scientific notation exponent values, the string also contains two-digit decimal numbers corresponding to each input and each output gain. Each complete gain is constructed by multiplying the two-digit decimal number, expressed in tenths, by ten raised to the resultant corresponding exponential term, essentially expressing the gain in scientific notation with two significant digits.

Lastly, nine-digit quaternary parts of the string specify the output membership function corresponding to each of the nine combinations of three input membership functions for each of two input linguistic variables.

Some of the aforementioned parameters to be optimized require discretization of the solution space. To determine appropriate levels of discretization, maximum discretization levels were identified and utilized for the optimization problem. In general, a finer level of discretization is desirable to find as close to a true optimal solution as possible, because an ideal optimization would utilize the continuous space. However, the more discrete the solution space, the larger the space and the longer the solution may take to converge to an optimum; convergence is expected to be approximately exponential with smaller improvements as the solution approaches an optimum. Time parameters were chosen to be represented in six digit binary because it was expected that the actuator on/off times could be up to one minute long and up to one second resolution may be necessary for good optimization results. The gain exponent addition terms were chosen such that each input/output gain could be perturbed by at least two orders of magnitude, effectively allowing the tuning process to make an input or output much less or much more significant to the gain scheduler system. The number of discrete points on the input-output membership function ranges was chosen based on the number of discrete points MATLAB’s

Fuzzy Toolbox nominally uses to determine the center of area for defuzzification, because

71

MATLAB’s Fuzzy Toolbox was utilized for fuzzy controller design. MATLAB’s Fuzzy Toolbox uses 181 points over the output range, by default, to determine the center of area of the effective output membership function. Using a greater resolution to define the membership functions would make the error associated with membership function vertex placement less than the error associated with defuzzification calculations, so it is desirable to use a resolution similar to

MATLAB’s default resolution. The binary representation that comes closest to without exceeding the resolution used for defuzzification is seven-digit binary. However, because the output range is [-0.5 1.5] while membership function vertices are defined on the range [0 1] and membership function widths are defined on the range [0 0.5], representing the output range to seven-digit binary accuracy only requires representing output membership function vertex locations as six-digit binary and widths as five-digit binary. This six-digit binary convention was also used to define input membership function vertices in order to keep errors resulting from discretization of the input space on the same order as errors resulting from discretization of the output space.

72

Table 4.3. String partition used for genetic algorithm.

Parameter Name Location in String (Start-End) Base Time to apply constant control 1-6 Binary (min. 10) Time to measure state (control off) 7-12 Binary (min. 10) P FIS Input 1 MF 1 Parameter (Right) 13-18 Binary P FIS Input 1 MF 2 Parameter (Left/Right/Center) 19-24 Binary P FIS Input 1 MF 2 Parameter (Left/Right/Center) 25-30 Binary P FIS Input 1 MF 2 Parameter (Left/Right/Center) 31-36 Binary P FIS Input 1 MF 3 Parameter (Left) 37-42 Binary P FIS Input 2 MF 1 Parameter (Right) 43-48 Binary P FIS Input 2 MF 2 Parameter (Left/Right/Center) 49-54 Binary P FIS Input 2 MF 2 Parameter (Left/Right/Center) 55-60 Binary P FIS Input 2 MF 2 Parameter (Left/Right/Center) 61-66 Binary P FIS Input 2 MF 3 Parameter (Left) 67-72 Binary P FIS Output MF 2 Parameter (Center) 73-78 Binary P FIS Output MF 1 Half Width 79-83 Binary P FIS Output MF 2 Half Width 84-88 Binary D FIs Output MF 3 Half Width 89-93 Binary D FIS Input 1 MF 1 Parameter (Right) 94-99 Binary D FIS Input 1 MF 2 Parameter (Left/Right/Center) 100-105 Binary D FIS Input 1 MF 2 Parameter (Left/Right/Center) 106-111 Binary DFIS Input 1 MF 2 Parameter (Left/Right/Center) 112-117 Binary D FIS Input 1 MF 3 Parameter (Left) 118-123 Binary D FIS Input 2 MF 1 Parameter (Right) 124-129 Binary D FIS Input 2 MF 2 Parameter (Left/Right/Center) 130-135 Binary D FIS Input 2 MF 2 Parameter (Left/Right/Center) 136-141 Binary D FIS Input 2 MF 2 Parameter (Left/Right/Center) 142-147 Binary D FIS Input 2 MF 3 Parameter (Left) 148-153 Binary D FIS Output MF 2 Parameter (Center) 154-159 Binary D FIS Output MF 1 Half Width 160-164 Binary D FIS Output MF 2 Half Width 165-169 Binary D FIs Output MF 3 Half Width 170-174 Binary P FIS Input 1 Gain Exponent 175-177 Binary P FIS Input 2 Gain Exponent 178-180 Binary P FIS Output Gain Exponent 181-183 Binary D FIS Input 1 Gain Exponent 184-186 Binary D FIS Input 2 Gain Exponent 187-189 Binary D FIS Output Gain Exponent 190-192 Binary P FIS Input 1 Multiple (expressed in tenths) 193-194 Decimal P FIS Input 2 Multiple (expressed in tenths) 195-196 Decimal P FIS Output Multiple (expressed in tenths) 197-198 Decimal D FIS Input 1 Multiple (expressed in tenths) 199-200 Decimal D FIS Input 2 Multiple (expressed in tenths) 201-202 Decimal D FIS Output Multiple (expressed in tenths) 203-204 Decimal P FIS Rule Base 205-213 Quaternary D FIS Rule Base 214-222 Quaternary

73

In all, each string representing a candidate solution, or a population member, ends up being

222 digits. Table 4.3 provides an overview of the order, base, and parameter represented by each piece of the string structure. Accounting for the different digit bases, there are over 4×1080 possible strings. Even if one string could be evaluated every second, it would take longer than the age of the universe to evaluate all possible strings. In fact, billions of clones of the world’s fastest supercomputer, currently claimed to execute 33.86 petaflops52, running in parallel could not evaluate every possible string in less time than the current age of the universe. Even if each of the membership function parameters were expressed by four fewer binary digits, there would be over 8×1046 possible strings, and solution with billions of clones of the world’s fastest supercomputer running in parallel would still take longer than the current age of the universe. It is a staggering design space which cannot be completely searched for “the” optimal solution by enumerating all possible combinations. This means that the genetic algorithm may not find the global optimum with respect to the desired cost function, but at the very least, it will tend to converge on a local optimal solution.

Insightful setup of the genetic algorithm helps this convergence. Because it is unknown whether any member of any given generation will be anywhere close to the ideal global optimal solution, the mutation rate is set relatively high; thirty percent of each subsequent generation is generated by mutation of random members of its preceding generation. As discussed in sections

4.2.5 and 4.2.6, the high mutation rate tends to displace good solutions from the population in order to keep a variety of genetic material or find solutions closer to a global optimum if solutions from a local optimum are dominating the population. To offset this displacement, and the resulting solution divergence, elitist selection is used to maintain the best two members of the previous generation in the next generation, thus guaranteeing some convergence to the best

74 discovered solution. (The two elite members are not considered part of the population when percentages of subsequent generations are discussed.) The remaining seventy percent of the subsequent generation is generated via two-point crossover of two members of the previous generation chosen by Roulette Wheel Selection.

4.4 Summary

The genetic-fuzzy system implementation was discussed. The processes behind fuzzy inference systems and genetic algorithms were presented, and the specific setup for the genetic- fuzzy system used to find the fuzzy gain scheduled PD controller for attitude control of the magnetically actuated CubeSat was introduced. Justification for this setup was also presented.

75

Chapter 5

Design Results

In this chapter, the design methods discussed in the previous two chapters are implemented.

The estimated mass properties of ArduSat are used with the models developed in Chapter 2 to simulate the attitude response of the spacecraft to the controllers. Gravity gradient and aerodynamic drag torques are taken into consideration in final evaluation of the controllers. All controllers are designed with the same set of initial conditions, given in Table 5.1.

Table 5.1. Initial conditions for design simulation.

Initial Condition Value Desired Quaternion (with [0.9679 0.0000 0.1000 −0.2306]푇 respect to ECI frame) Error Quaternion (with respect [0.8660 0.2811 −0.2008 0.3614]푇 to Desired Quaternion) Angular Error (degrees) 60.00 Angular Rate (rad/sec) [0.001 0.005 0.002]푇 Epoch (Simulation Start Time) February 19, 2013 at 9:13:37.147872 p.m.

With no control, this set of initial conditions propagated over ten hours, with dynamics subject to aerodynamic and gravity gradient torques, results in a nearly periodic response in attitude and angular rate, as can be seen in Figure 5.1 and Figure 5.2, respectively. Indeed, looking at how the body axes appear with respect to the inertial frame over all of time in Figure

76

5.3 builds the picture that the spacecraft is spinning. However, the gravity gradient and aerodynamic torques, shown respectively in Figure 5.5 and Figure 5.4, appear less-obviously periodic. Similarly, the magnetic field in spacecraft body-fixed frame, shown in Figure 5.6, does not appear to be periodic, though the ground track shown in Figure 1.2 reveals that the magnetic field in the inertial frame does not complete one period within the simulation time; one period would be complete if the start of the ground track were coincident with the end of the ground track.

Figure 5.1. Uncontrolled error quaternion response.

77

Figure 5.2. Uncontrolled body-fixed angular rate response.

Figure 5.3. Uncontrolled body-fixed reference frame over all simulation time.

78

Figure 5.4. Uncontrolled aerodynamic torque in body-fixed Figure 5.5. Uncontrolled gravity gradient torque in body- frame. fixed frame.

Figure 5.6. Magnetic field strength in uncontrolled body-fixed frame.

All subsequent controllers are designed taking the gravity gradient torque into consideration and not taking the aerodynamic torque into consideration. The responses with only the gravity gradient torque are presented for the design snapshots as well as for the final design. A small aerodynamic torque is introduced to the simulation, assuming the spacecraft’s center of pressure

79 is displaced slightly from the spacecraft’s center of gravity, and the final controller is examined for its ability to reject both the aerodynamic torque and gravity gradient torque disturbances.

Because the aerodynamic torque and gravity gradient torque are on the same order of magnitude, much less than the torque the magnetorquers can impart, it is assumed that designing for rejection of one of the disturbance torques will allow the controller to reject both disturbance torques simultaneously.

5.1 Simple PD Design Results

A Simple PD controller is designed using the structure and method discussed in Section 3.2.

A rough order of magnitude guess for gains just strong enough to cancel the effects of the aerodynamic and gravity gradient torques is used as the starting point for design. Good measurement and actuation time delays are initially guessed based on the assumption that it is desirable to actuate for a longer time than it is desirable to measure the state and calculate controller response. The solution is evaluated to determine if control is undercompensating or overcompensating, and the gains are adjusted in iterative fashion. The time delays are updated when no further improvement can be realized by gain manipulation alone. In the following subsections, five snapshots of the design process are presented, each a slight improvement over the previous and all leading up to the final, sixth design, presented in Section 5.1.6.

5.1.1 First Simple PD Design Snapshot

The first Simple PD controller used the following gains: P=1×10-8 and D=1×10-6. These gains were found assuming angular velocities of 10-3 rad/sec, Euler-Axis quaternion parameters on the order of 10-1, magnetic field strength on the order of 10-5 tesla, and mass moments of inertia on the order of 10-3 kg-m2. It was also assumed that the desired torque was one order of magnitude higher than the disturbance torques; therefore, the desired torque was on the order of 10-9 kg-m2.

80

Further assuming that the mapping of the desired torque to the plane perpendicular to the local magnetic field vector does nothing to the order of magnitude of the actual torque produced, it is clear to see how the initial gain guesses were calculated.

The first Simple PD controller also uses time delays of 30 seconds for actuators on and 10 seconds for actuators off. These are essentially guesses, because no known rule of thumb exists for actually determining these values, other than roughly analyzing how much angular momentum the actuation would impart to or take away from the system.

Figure 5.7. First Simple PD Controller error quaternion response.

81

Figure 5.8. First Simple PD Controller angular rate error response.

Figure 5.9. First Simple PD Controller magnetic moment response.

Figure 5.7 and Figure 5.8 are nearly indistinguishable from Figure 5.1 and Figure 5.2, respectively, hinting that the controller may not be doing much. Figure 5.9 confirms that the control effort is indeed very small, about three to four orders of magnitude smaller than the maximum possible.

82

5.1.2 Second Simple PD Design Snapshot

The second simple PD controller used the following gains: P=10-4 and D=10-2. These gains were found by increasing the previous controller’s gains by four orders of magnitude in order to achieve closer to a maximum of control effort. Time delays were kept the same.

Figure 5.10. Second Simple PD Controller error quaternion response.

Figure 5.11. Second Simple PD Controller angular rate error response.

83

Figure 5.12. Second Simple PD Controller magnetic moment response.

Figure 5.10 and Figure 5.11 show that the second Simple PD controller allows neither the angular error nor the angular rate to settle to their desired values. Figure 5.12, on the other hand, shows that the control effort is still below its maximum allowable value. Further exploration of large feedback gains lends credibility to the notion that the maximum dipole moment is too large to lead to a stable Simple PD feedback controller. Therefore, smaller gains are explored in subsequent Simple PD controller designs.

5.1.3 Third Simple PD Design Snapshot

The third Simple PD controller uses the following gains: P=5×10-5 and D=10-2. It is assumed that the smaller proportional gain will allow angular velocity to settle out, because in comparing

Figure 5.10 and Figure 5.11, it appears as though the body-fixed angles initially converge very well to the desired state, but they do so at the expense of high angular rate error. Therefore, decreasing the proportional gain while maintaining the derivative gain is expected to yield better results. The time delay parameters are still kept the same.

84

Figure 5.13. Third Simple PD Controller error quaternion response.

Figure 5.14. Third Simple PD Controller angular rate error response.

85

Figure 5.15. Third Simple PD Controller magnetic moment response.

Figure 5.13 and Figure 5.14 show some improvement of the third Simple PD controller over the second Simple PD controller. The attitude appears to settle for longer periods of time, and the angular rate error appears to approach the desired zero state. Figure 5.15 shows that the control effort is still below the maximum allowable by more than an order of magnitude.

5.1.4 Fourth Simple PD Design Snapshot

The fourth Simple PD controller uses the following gains: P=5×10-5 and D=10-2. These gains are identical to those used in the third Simple PD controller. However, the fourth Simple PD controller explores the effects of the timing parameters by increasing actuator on time to 40 seconds and keeping actuator off time at 10 seconds. It was assumed that a longer time to actuate would be better, but it is unknown how long is too long. An infinite actuator on time would result in a spacecraft with generally increasing angular momentum, so this suggests that too large of an actuator on time would result in an unstable system.

86

Figure 5.16. Fourth Simple PD Controller error quaternion response.

Figure 5.17. Fourth Simple PD Controller angular rate error response.

87

Figure 5.18. Fourth Simple PD Controller magnetic moment response.

Figure 5.16 and Figure 5.17 suggest that the increase in actuator on time did more to improve system stability than to degrade it. Figure 5.18 also reflects this improved stability, showing that less power is needed to keep the system stable when it is near its equilibrium point.

5.1.5 Fifth Simple PD Design Snapshot

The fifth Simple PD controller uses the following gains: P=10-5 and D=8×10-3. These gains were decreased from those of the fourth Simple PD controller in an attempt to achieve better stability. The timing parameters were kept the same as those in the fourth Simple PD controller.

88

Figure 5.19. Fifth Simple PD Controller error quaternion response.

Figure 5.20. Fifth Simple PD Controller angular rate error response.

89

Figure 5.21. Fifth Simple PD Controller magnetic moment response.

Figure 5.19 and Figure 5.20 show that stability has been improved over that of the fourth

Simple PD controller. Additionally, Figure 5.21 shows that this stability only requires about three orders of magnitude less power than the maximum power the actuators can deliver.

However, it is desired to settle within about ten degrees of the nominal attitude in as short a time as possible, a task on which the controller could improve.

5.1.6 Simple PD Controller Final Design

The Final Simple PD controller uses the following gains: P=10-5 and D=8×10-3. It also uses an actuator on time of 50 seconds and an actuator off time of 20 seconds, which were tuned to improve the final settling characteristics, achieving a more-consistent smaller-than-ten-degree settling attitude error.

90

Figure 5.22. Final Simple PD Controller error quaternion response.

Figure 5.23. Final Simple PD Controller angular rate error response.

91

Figure 5.24. Final Simple PD Controller magnetic moment response.

Figure 5.22 shows that the Final Design of the Simple PD controller has the smallest average steady-state error of any of the Simple PD design snapshots. This indicates that the pointing accuracy requirement tends to drive the design more so than the settling time, because this steady-state error still falls outside of the ten degree pointing accuracy requirement, and this performance appears to be pushing the limits of the simple PD feedback capabilities; no better solution could be found by the simple hand-tuning method. Figure 5.23 and Figure 5.24 show that the angular velocity and controller power responses of the Simple PD controller Final

Design differ only slightly from the previous design snapshot.

Figure 5.25 shows the magnetic torque acting on the spacecraft. Much like the control moment dipole, which produces the magnetic torque, the magnetic torque starts with a large magnitude, reaching a relatively steady-state in about an hour and a half, or one orbit period.

92

Figure 5.25. Final Simple PD Controller magnetic torque response.

Figure 5.26. Final Simple PD Controller gravity gradient torque disturbance input.

Figure 5.27. Final Simple PD Controller magnetic field strength time history.

93

Similarly, Figure 5.26 shows the gravity gradient torque reaches a steady periodic response, while Figure 5.27 shows that the magnetic field experienced by the spacecraft does not appear to be very periodic. The nearly periodic gravity gradient torque is expected as the spacecraft tends to orient itself with respect to Earth, the source of the gravity gradient torque, periodically with respect to orbital position. Additionally, the apparently aperiodic magnetic field is not much of a surprise, given that the simulation time is less than that over which the magnetic field is expected to appear periodic. That is, the magnetic field should appear to have a period of about a day, but simulation time was only ten hours.

Figure 5.25, Figure 5.26, and Figure 5.27 appear nearly identical for all subsequent final designs, so they are not shown for other final designs. However, all torques on the spacecraft are presented in figures like Figure 5.31, below, for each final design.

The Simple PD controller’s ability to simultaneously reject both the aerodynamic drag and gravity gradient torques is now explored in the following four figures.

Figure 5.28. Final Simple PD Controller error quaternion response with both aerodynamic and gravity gradient disturbances.

94

Figure 5.29. Final Simple PD Controller angular rate error response with both aerodynamic and gravity gradient disturbances.

Figure 5.30. Final Simple PD Controller magnetic moment response with both aerodynamic and gravity gradient disturbances.

Figure 5.28 and Figure 5.29 show that the additional disturbance torque makes it harder for the controller to achieve low steady-state error, leading to a steady-state with peaks outside the desired ten degree range. Figure 5.30 strengthens this notion, showing that more control effort,

95 therefore more power, is required in the steady-state portion of the response. Figure 5.28 also suggests that the settling time improves, though this is likely closely related to a desirable aerodynamic torque assisting the spacecraft in making this rotation.

Figure 5.31. Final Simple PD Controller magnetic torque response and aerodynamic and gravity gradient torque disturbance inputs.

Figure 5.31 shows that, although the magnetic controller can keep up with the gravity gradient and disturbance torques, the loss of one axis of actuation makes the task difficult. The magnetic torque appears to be much more “spiked,” corresponding with the large amount of time the aerodynamic torque tends to be exerted in one particular direction. If part of this direction

96 coincides with the unactuated direction over an extended period, the controller simply is not able to reject the disturbance, and its influence grows, unaffected.

5.2 LQR Design Results

An LQR is designed for the magnetic attitude control problem using the method and general design procedure discussed in Section 3.3. Bryson’s rule is used to develop the Q and R matrices used in the initial design. Subsequent designs increase the order of magnitude of the R matrix diagonal entries to penalize excessive control effort, until the resulting controller is able to stabilize the spacecraft about the desired attitude.

Using Bryson’s rule, the maximum desired quaternion error is the sine of half the maximum desired displacement from the desired attitude, ten degrees. The maximum desired angular velocity error is 10-4 rad/sec, approximately the resolution of the angular rate sensors. Lastly, the maximum desired actuation is 0.02 A-m2, half of the maximum the magnetorquers can exert; it has already been seen in design of the Simple PD controller that this is a very large control effort, so it is expected that the diagonal entries of the R matrix will need to be increased by at least a couple orders of magnitude. The resulting first guess Q and R matrices are shown in

Equation 5.1 and Equation 5.2, respectively, and the resulting first guess Kalman gain matrix is shown in equation 5.3. All designs utilize 50 seconds actuators on and 20 seconds actuators off.

132 0 0 0 132 0 0 3×3 0 0 132 푄 = (5.1) 108 0 0 8 03×3 0 10 0 [ 0 0 108]

2,500 0 0 푅 = [ 0 2,500 0 ] (5.2) 0 0 2,500 97

0.2295 0.0001394 −0.001192 200.0 0.1215 −1.039 퐾 = [−0.0001387 0.2295 0.0001350 −0.1209 200.0 0.1177] (5.3) 0.001192 −0.0001343 0.2295 1.039 −0.1171 200.0

5.2.1 First LQR Design Snapshot

The first guess Kalman gain matrix is used for the first LQR Design Snapshot. Figure 5.32 and Figure 5.33 show that this feedback gain makes the system very unstable, and Figure 5.34 offers some explanation as to the reason why. The feedback gains are large enough to cause actuator saturation. As was seen in the Simple PD design study, any actuation that comes close to saturation levels is far too large to stabilize the system. Therefore, the feedback gains are too large.

Figure 5.32. First LQR error quaternion response.

98

Figure 5.33. First LQR angular rate error response.

Figure 5.34. First LQR magnetic moment response.

5.2.2 Second LQR Design Snapshot

The feedback gains are reduced by an order of magnitude from those of the first LQR Design

Snapshot by multiplying the R matrix by a factor of one hundred. This is effectively the same as multiplying the entire Kalman gain matrix by a factor of one tenth. Figure 5.35 and Figure 5.36

99 show that this design still makes the system unstable. However, Figure 5.37 reveals the design is getting closer to a more-stable controller, because the actuators are saturated less frequently than in Figure 5.34.

Figure 5.35. Second LQR error quaternion response.

Figure 5.36. Second LQR angular rate error response.

100

Figure 5.37. Second LQR magnetic moment response.

5.2.3 Third LQR Design Snapshot

Again, the feedback gains are reduced by another order of magnitude from those of the previous LQR Design Snapshot by multiplying the R matrix by another factor of one hundred, and again, the Kalman gain matrix is effectively multiplied by a factor of one tenth.

Figure 5.38. Third LQR error quaternion response.

101

Figure 5.39. Third LQR angular rate error response.

Figure 5.40. Third LQR magnetic moment response.

Figure 5.40 shows that this gain no longer allows the actuators to become saturated. However,

Figure 5.38 and Figure 5.39 show that this design still allows the system to become unstable.

102

5.2.4 Fourth LQR Design Snapshot

Again, the Kalman gain matrix is effectively multiplied by a factor of one tenth by multiplying the R matrix by a factor of one hundred.

Figure 5.41. Fourth LQR error quaternion response.

Figure 5.42. Fourth LQR angular rate error response.

103

Figure 5.43. Fourth LQR magnetic moment response.

Figure 5.41 and Figure 5.42 show that this feedback gain matrix is capable of stabilizing the system. However, the performance of this controller is not quite as good as that observed in the final Simple PD design. Settling takes slightly longer, the initial increase in angular error is relatively large, and the steady-state errors are fairly large, on average. Figure 5.43 also shows that this design uses more control effort, therefore more power than the final Simple PD design.

5.2.5 Fifth LQR Design Snapshot

The fifth LQR Design Snapshot again effectively multiplies the Kalman gain matrix by a factor of one tenth by multiplying the R matrix by a factor of one hundred to explore what a further reduction in feedback gain does to system stability. Figure 5.44 and Figure 5.45 make it fairly obvious that this feedback gain does not produce a system that is stable, at least over the period of ten hours. On a longer time scale it appears as though the angular rates and angular errors might approach the desired state, though. Figure 5.46 shows why this settling is so slow: the control effort is very small; therefore, corrections are slow to take effect.

104

Figure 5.44. Fifth LQR error quaternion response.

Figure 5.45. Fifth LQR angular rate error response.

105

Figure 5.46. Fifth LQR magnetic moment response.

5.2.6 LQR Final Design

The final LQR Design was found by multiplying the Kalman gain matrix from the fourth

LQR Design Snapshot by factors between one tenth and ten to find the controller exhibiting the best performance, with minimum settling time and minimum average steady-state error. This controller was determined to be that with a Kalman feedback gain matrix of 1.5×10-3퐾, where 퐾 is the matrix given by Equation 5.3.

Figure 5.47 shows that the final LQR has a much smaller initial angular error overshoot than that of the fourth LQR design. Additionally, the average steady-state error of the final LQR is smaller than that of the fourth LQR design. Figure 5.48 shows the final LQR design also has a smaller initial angular velocity overshoot with smaller average steady-state error compared with the fourth LQR design. Furthermore, Figure 5.49 shows the power consumption of the final LQR is less than that of the fourth LQR Design Snapshot. In comparing the final LQR with the final

106

PD Controller, the Simple PD controller settles faster and uses less control effort, but the LQR has a smaller average steady-state error.

Figure 5.47. Final LQR error quaternion response.

Figure 5.48. Final LQR angular rate error response.

107

Figure 5.49. Final LQR magnetic moment response.

The LQR’s ability to simultaneously reject both aerodynamic and gravity gradient torques is now explored in the following four figures.

Figure 5.50. Final LQR error quaternion response with both aerodynamic and gravity gradient disturbances.

108

Figure 5.51. Final LQR angular rate error response with both aerodynamic and gravity gradient disturbances.

Figure 5.52. Final LQR magnetic moment response with both aerodynamic and gravity gradient disturbances.

Again, adding additional disturbance torques to the simulation decreases the performance of the controller. Figure 5.50 shows the average steady-state angular error has peaks outside the desired ten degree region but is, for the most part, below the ten degree error limit. Figure 5.51 shows the average steady-state angular rate error increases with the addition of the aerodynamic

109 torque. Similarly, Figure 5.52 shows that the power required to stabilize the satellite is greater with the additional disturbance torque.

Figure 5.53. Final LQR magnetic torque response and aerodynamic and gravity gradient torque disturbance inputs.

Figure 5.53 shows all the torques experienced by the spacecraft. Comparing the torques of the

LQR design to those of the Simple PD design in Figure 5.31 shows that the aerodynamic and gravity gradient torques are nearly identical, but the magnetic torque produced by the LQR is slightly larger than that produced by the Simple PD controller, likely because the LQR has a slightly larger total feedback gain. Again, the magnetic torque appears to “spike” most in

110 response to long periods of large aerodynamic torque. In all, however, the Simple PD controller and the LQR appear to have extremely similar performance likely due in large part to the great similarity in the two controllers’ structures.

5.3 Genetic-Fuzzy Design Results

A genetic-fuzzy system, developed in section 4.3, is used to develop the fuzzy gain scheduled

PD controller. The genetic algorithm, detailed in section 4.3.2, tunes the fuzzy inference systems, detailed in section 4.3.1. After completing the genetic algorithm setup, including specification of the constants in Table 4.2, the genetic algorithm automatically searches for a solution that minimizes the cost function using the heuristic methodology described in sections 4.2 and 4.3.2.

Because the genetic algorithm solution is automatic after the initial setup and the strings contain a fairly large amount of information to decode and analyze, the strings are given without further analysis in case the reader is interested in exactly what path the genetic algorithm took to reach its final design. The same plots generated for the other design snapshots and final design are also presented for the genetic-fuzzy design.

111

5.3.1 First Fuzzy Gain Scheduler Design Snapshot

Figure 5.54. First Fuzzy error quaternion response.

Figure 5.55. First Fuzzy angular rate error response.

112

Figure 5.56. First Fuzzy magnetic moment response.

The first fuzzy gain scheduler design comes from the randomly generated initial population used to start the genetic algorithm; it is the best design of the initial population with respect to the cost function. Figure 5.55 shows the reason this design has a low cost; the average angular velocity is very low. However, Figure 5.54 shows that this solution is far from ideal, because the spacecraft is nowhere near its desired orientation, with an average angular error greater than seventy degrees. Figure 5.56 is interesting in that it shows the average power required by this controller is relatively small with large peaks during periods when angular velocity error appears to sharply increase.

The fittest member of the first generation is:

001010001010011000111011010111010111000110100011100001001011101110101101010111

001100110111000101001110001111110011000001001000001011111101000001011100010001

110100101100001010100000100100001011025412761744210021301203232010

113

5.3.2 Second Fuzzy Gain Scheduler Design Snapshot

The second fuzzy gain scheduler design comes from the fittest member of the eighteenth generation. Figure 5.57 shows that the angular error has been decreased but still does not appear to reach a steady-state error bound. Figure 5.58 shows that the angular velocity error increased slightly to allow the angular error to decrease. Lastly, Figure 5.59 shows that the power required to achieve better attitude accuracy appears to increase while large spikes in power demand appear to disappear altogether with the disappearance of abrupt changes in angular velocity.

The fittest member of the eighteenth generation is:

001010111000111110000100010000011101100111001010001101101001111011011001000101

110011111111111110100100001000100100111010010100101001110100011110001000000111

010101010110011100100000010101111010272238233378000001032102221123

Figure 5.57. Second Fuzzy error quaternion response.

114

Figure 5.58. Second Fuzzy angular rate error response.

Figure 5.59. Second Fuzzy magnetic moment response.

115

5.3.3 Third Fuzzy Gain Scheduler Design Snapshot

Figure 5.60. Third Fuzzy error quaternion response.

Figure 5.61. Third Fuzzy angular rate error response.

116

Figure 5.62. Third Fuzzy magnetic moment response.

The third fuzzy gain scheduler design snapshot comes from the fittest member of the thirty- sixth generation. Figure 5.60 shows that the average angular error is improving greatly, almost achieving less than ten degree steady-state pointing accuracies. Figure 5.61 shows that average angular velocity error is also decreasing as angular error is decreasing. Lastly, Figure 5.62 shows that the power required by the controller is also decreasing.

The fittest member of the thirty-sixth generation is:

011010100001010001100101010100011101111101000101010011011110001010000101000101

110111001011100111001001000010110000001010111001000011101111101110001000000000

110101110111101001000110011001111100863292091049000022213121002213

117

5.3.4 Fourth Fuzzy Gain Scheduler Design Snapshot

Figure 5.63. Fourth Fuzzy error quaternion response.

Figure 5.64. Fourth Fuzzy angular rate error response.

118

Figure 5.65. Fourth Fuzzy magnetic moment response.

The fourth fuzzy gain scheduler design snapshot comes from the fittest member of the fifty- fourth generation. Figure 5.63 shows that the average angular error is continuing its improvement, achieving less than ten degree steady-state pointing accuracies. Figure 5.64 shows that average angular velocity error is also continuing to decrease as angular error is decreasing.

Lastly, Figure 5.65 appears to show that the power required by the controller is also decreasing.

The fittest member of the fifty-fourth generation is:

011001100001110001100101010100011101111101110001010001011110001010000101000101

110111001011100111001001000010110000001010101100111111101111101110001000000000

110101110111101001000110011000111100863979690839001022213121002212

119

5.3.5 Fifth Fuzzy Gain Scheduler Design Snapshot

Figure 5.66. Fifth Fuzzy error quaternion response.

Figure 5.67. Fifth Fuzzy angular rate error response.

120

Figure 5.68. Fifth Fuzzy magnetic moment response.

The fifth fuzzy gain scheduler design snapshot comes from the fittest member of the seventy- second generation. Figure 5.66, Figure 5.67, Figure 5.68 show very little differences when compared to the corresponding figures of the fourth design.

The fittest member of the seventy-second generation is:

011010100001110001100001100111011101111101000101010001011110001011000101000101

110111001011100111001001100010110000001010101101000011101111101110001000000000

110111110100111010000100011001111100007398004735200122212131002212

121

5.3.6 Fuzzy Gain Scheduler Final Design

Figure 5.69. Final Fuzzy error quaternion response.

Figure 5.70. Final Fuzzy angular rate error response.

122

Figure 5.71. Final Fuzzy magnetic moment response.

Figure 5.72. Final Fuzzy proportional gain response.

123

Figure 5.73. Final Fuzzy derivative gain response.

The final fuzzy gain scheduler design corresponds to the fittest member of the ninetieth generation. Figure 5.69 shows that average angular error is still decreasing. Figure 5.70 appears to show that average angular velocity error is still decreasing. Additionally, Figure 5.71 shows that improved performance may have been achieved by increasing feedback gains, especially for regimes very close to the maximum angular error boundary, as the applied control power seems to have locally “spiked” responses under some of these conditions. Figure 5.72 and Figure 5.73, which show the scheduled gains, reveal that the proportional gain predominantly changes in response to the various operational regimes, whereas the derivative gain remains constant. The initial slew maneuver appears to be governed by a particular set of constant gains. Once close to the desired state, the proportional gain predominantly appears to shift between its initial constant gain value and zero, likely because preventing the angular velocity from increasing becomes a more important task to maintain stability near the desired state. However, a few instances where the proportional gain becomes very large indicate that brief periods to substantially override a relatively strong angular velocity feedback may be required to improve stability. 124

Appendix B shows the FISs associated with this solution. On close inspection, these data provide some further insight into why the controller behaves the way it does. Both FISs are unaffected by the quaternion error, as is obvious by looking at the input gains, thus only respond as if quaternion error always belongs 100% to the small set. Furthermore, the reason the derivative feedback gain was seen as constant is because the input angular velocity gain was so high; the D FIS nearly always acts as if angular velocity error is 100% large and quaternion error is 100% small, nearly always outputting the centroid of the med membership function. Middle- of-the-road gains, output rules that vary with the input membership functions, and slightly dissimilar output membership functions help the P FIS output non-constant values.

The resultant membership functions and rules that produce very little or no change in the P and D gains could indicate that the solution converged to a local minimum cost. If the solution is in fact the global optimum or very close to the global optimum, relatively static controller gain behavior could be an indication that the inputs provided to the fuzzy systems are not significantly responsible for prescribing appropriate feedback gain scheduling. This could also be an indication that a more-general feedback structure should be used to calculate and apply actuation.

It is interesting to note that the P gain appears as almost a bang-bang type of controller. This bang-bang behavior is reminiscent of the time-optimal solution of Ref. 28, which also exhibits a bang-bang type of actuation.

The behavior of the fuzzy inference systems can be further explained by examining the resulting solution in light of the cost function the genetic algorithm was asked to minimize. Most notably, changing the k values of the cost function may yield a different controller solution, because these values essentially define the characteristics of a good solution. If, for instance, it is determined that the weight on average angular velocity is too large, then this weight could be

125 decreased, and the optimization performed again. The average angular velocity weight may be determined to be too large if the angular velocity requirement is met with considerable margin while the angular error requirement is not met or met with a very small margin. Similarly, if it is desired to find a much faster settling time, the gain on final time could be increased, although this cost function may not necessarily be able to find a solution that settles faster than the one already found. Faster settling may require a more relaxed steady state error requirement, and therefore larger average angular error and most likely larger average angular rate error. Lastly, if lower average angular error is desired, the gain on average angular error could be increased, which would most likely increase settling time and average angular rate error. Modifying the cost function gains to achieve desired performance characteristics requires consideration of the tradeoffs of changing these gains.

The fittest member of the ninetieth generation is:

011010101101010001100000010111011101111011000001010001011110001011000101000101

110111001011100111001001100010110000001010101101000011101111101110001000000000

110111110100111010000100011001111100005398004735200122212131002212

Upon comparing all the controllers via the genetic algorithm cost function in Table 5.2, it is clear that the fuzzy controller provides the lowest average angular error and relatively low angular rate error over all simulation time at the cost of about three minutes slower settling time.

The LQR has the fastest settling time and relative low average angular error, and the Simple PD controller has the lowest average angular rate error but fairly large average angular error.

126

Table 5.2. Quantitative comparison of all controllers with just gravity gradient disturbance torque.

Controller θave (deg) ωave (rad/sec) tf (sec) J Fuzzy 11.45 2.365×10-4 13838.8 0.001501 LQR 11.95 2.644×10-4 13688.9 0.001546 Simple PD 14.98 2.282×10-4 13739 0.001664

Adding the aerodynamic torque decreases the ability of the controller to achieve the desired attitude and rate errors, as was seen in the LQR and Simple PD designs. However, Figure 5.74 shows that the initial average angular error and settling times appear largely unaffected by the addition of this disturbance torque. Comparing this response to the final LQR and Simple PD responses reveals that the fuzzy gain scheduled response is more consistent and better stays within the ten degree error bounds. Figure 5.75 and Figure 5.76 show that in the final design the angular velocity error grows and so does the power the controller needs to exert to stabilize the spacecraft to the desired attitude. Figure 5.78 shows that the derivative gain still stays constant.

However, Figure 5.77 shows that the increased disturbances require a higher proportional gain to successfully stabilize the spacecraft about its desired state, likely because the disturbances tend to induce larger angular velocity errors, which in turn yield larger angular velocity error feedback terms, reducing the effectiveness of the lower-gain proportional error feedback terms.

127

Figure 5.74. Final Fuzzy error quaternion response with both aerodynamic and gravity gradient disturbances.

Figure 5.75. Final Fuzzy angular rate error response with both aerodynamic and gravity gradient disturbances.

128

Figure 5.76. Final Fuzzy magnetic moment response with both aerodynamic and gravity gradient disturbances.

Figure 5.77. Final Fuzzy proportional gain response with both aerodynamic and gravity gradient disturbances.

129

Figure 5.78. Final Fuzzy derivative gain response with both aerodynamic and gravity gradient disturbances.

Figure 5.79 shows that once again, the controller response is driven mostly by the disturbance torques that occur about the unactuated axis and are thus uncompensated for longer periods of time. In comparing the magnetic torques exerted by the final designs of all three controllers, it appears the Simple PD exerts the largest average torque and has the greatest average steady-state angular error, the LQR exerts slightly smaller average torque and has better average steady-state angular error, and the fuzzy gain scheduled controller exerts the smallest average torque and has the best average steady-state angular error. Furthermore, Table 5.3 shows that the fuzzy controller is the most robust solution with respect to keeping a low average angular error, although the Simple PD controller does a good job keeping a low angular rate error. None of the controllers are able to keep the angular error consistently within ten degrees, as the final time column of Table 5.3 shows.

130

Table 5.3. Quantitative comparison of all controllers with aerodynamic and gravity gradient disturbance torques.

Controller θave (deg) ωave (rad/sec) tf (sec) J Fuzzy 12.69 2.765×10-4 35839.6 0.002703 LQR 14.32 3.175×10-4 35591.3 0.002813 Simple PD 16.25 2.610×10-4 30236 0.002585

Figure 5.79. Final Fuzzy magnetic torque response and aerodynamic and gravity gradient torque disturbance inputs.

5.4 Summary

The Simple PD controller, LQR, and fuzzy gain scheduled PD controller were designed to achieve the desired performance as best as possible. Snapshots of the design processes were

131 presented to highlight the differences in design procedure and convergence on a final solution.

The final controllers were evaluated for their abilities to reject disturbances and their responses were compared. The fuzzy gain scheduler response was found to exhibit the smallest average angular error and it was found to be the most robust with respect to keeping this angular error low in the presence of unaccounted-for disturbance torques.

132

Chapter 6

Conclusion

The problem of attitude control of a magnetically actuated CubeSat was investigated, and three separate Proportional-Derivative feedback controllers were developed to satisfy design requirements under relatively idealized conditions. The designs were qualitatively evaluated for their ability to reject unaccounted-for disturbance torque inputs. As the main focus of the thesis was the development and evaluation of a fuzzy logic attitude controller for a magnetically actuated CubeSat by utilizing a genetic algorithm to assist in designing the FISs for the controller, an emphasis was placed on the design process and comparison of the three controllers explored herein. The Simple PD controller required the most effort from the designer to determine a good solution. The Constant-Gain LQR required some effort from the designer, but much of the design was rooted in interpretation of the meaning and function of the cost function matrices, Q and R; once these matrices were defined, the feedback gain matrix was easily calculated. Similarly, the cost function of the genetic algorithm used to assist in the design of the

Fuzzy PD controller played an important role in the design product, but unlike the LQR, the genetic algorithm cost function was able to take any form, not just a positive-definite quadratic form. The more-open cost function led to a more intuitive cost definition, and it was proposed

133 that a complex enough cost function could theoretically replace the designer in evaluating the solution for desired stability characteristics, thereby reducing the problem to the genetic algorithm and model setup, although solution time would likely increase significantly. As it were, solution of the genetic algorithm using the relatively simple cost function took approximately three days to iterate through ninety generations, mainly due to simulation time required for each candidate solution. This is the tradeoff of the more “hands-off” approach.

6.1 Contribution of Work Completed

The work in this thesis provided a unique method to design a controller for a magnetically- actuated satellite. A genetic algorithm was used to tune two fuzzy inference systems that were used to schedule gains in a proportional-derivative feedback attitude control algorithm. The genetic algorithm provided a relatively automatic heuristic search for a solution to optimize the controller and the ability to generalize the associated cost function to achieve the desired settling times and average steady-state error characteristics. Furthermore, the genetic algorithm solution for the fuzzy gain-scheduled PD controller was shown to be an improvement over the solutions found for the Simple PD controller and LQR, because the fuzzy controller exhibited lower average angular error without compromising much on a fast settling time, and it exhibited robustness to the initially unaccounted-for disturbance torques.

6.2 Future Plans

The Fuzzy Gain Scheduled PD Controller will be implemented on the ArduSat satellite, to be deployed from the ISS on November 25, 2013. The fuzzy controller is not the primary control algorithm used for the flight; it is an experiment to be run on one of the Arduino Uno payload microcontrollers, not the primary flight computer. Therefore, in order to reduce the risks associated with the mission, NanoSatisfi has opted to defer testing of this algorithm until near the

134 end of the mission, in three to six months’ time. In the meantime, attitude measurement and nominal control data will be collected from ArduSat and analyzed, helping to increase the system model accuracy, which in turn will be used to better-design the fuzzy controller.

Testing has already confirmed that the Arduino Uno contains sufficient memory and processor speed to meet the calculation demands imposed by the two Mamdani FISs that constitute the Fuzzy Gain Scheduled PD Controller while also meeting timing and precision requirements. As the Arduino is programmed using a C-like language and the analysis of this thesis was conducted primarily in MATLAB, the FISs and corresponding routines had to be translated into a form that is executable on the Arduino platform.

6.3 Recommendations for Further Work

The work completed for this thesis could be vastly expanded through more-detailed design and analysis of the controllers. Firstly, the work undertaken made several simplifying assumptions. The most significant simplifying assumption, aside from the modelling assumptions addressed in Section 6.2, is that the sensors and actuators allow for perfect state estimation and actuation. In reality, sensors tend to yield noisy measurements due to unaccounted for physical phenomena. In addition, these noisy measurements are used on digital systems, so rather than being able to provide continuous measurement, the values used for a control system are discrete. These noisy, discrete measurements are used in attitude estimation algorithms, such as the Extended Kalman Filter, mentioned in Section 1.2.3, to produce noisy state estimates. These noisy state estimates are used by the control law to calculate and apply the actuator response. The actuators, similar to the sensors, can only be actuated at discrete levels and are subject to noise due to unaccounted for physical phenomena. Ideally, a control law would be able to reject this noise and allow the spacecraft to settle to the desired attitude.

135

In order to investigate a controller’s ability to perform in the presence of sensor and actuator noise, models of the sensors and actuators need to be developed. Using these models, state estimators can be developed. For the most-realistic simulations, the responses of real hardware should be characterized to various inputs. For instance, the current produced by sun sensors could be measured and expressed as a function of varying orientations of a solar simulator with respect to sensor normal. Using, for example, a least squares fit of the data to a function allows characterization of the sensor noise, which is necessary to develop a Kalman Filter. With sensors characterized, the sensor response to ephemeris models of the quantities being measured (e.g.

Earth’s magnetic field and the solar vector) can be simulated and used to develop state estimation algorithms. Similarly, the noise characteristics of the magnetorquers could be quantified and used to generate realistic simulation of the actuator response to electrical input.

The ephemeris models, noisy measurement models, and state estimation algorithms can then be integrated into the controlled system model to generate a detailed attitude determination and control system model, which can be used for controller design.

Further detailed analysis of the resulting solutions could be undertaken via a stochastic robustness analysis. A stochastic robustness analysis of a satellite attitude control system would most likely use random simulation start dates and times (epochs) and random initial error quaternions and angular velocities to completely randomize system states. In randomizing simulation epochs, properties of the two-line element set, used to propagate satellite orbit, would not need to be randomized, because it can be reasonably assumed that for a known or desired orbit, the uncertainty of the position of the satellite with respect to the ECEF frame is much larger than the uncertainty of the satellite’s orbital parameters. That is, the orbit will appear relatively constant in an inertial frame, but will vary significantly with time as viewed from

136

Earth’s rotating surface (and rotating magnetic field). Many sets of random initial conditions can be used to simulate system response with the same satellite attitude determination and control setup. Simulation responses can then be used to analyze system settling time and steady-state errors, finding the probabilistic attributes of these controller performance parameters. This more- exhaustive approach to quantify the performance characteristics of the various controllers is preferable to analyzing just one single case, because one controller could perform very well for one set of system initial conditions but perform very poorly for all others. Robustness, or the ability to perform well for a wide variety of initial conditions and randomized simulation parameters, is highly desirable for a controller because the real world is filled with uncertainty.

In addition to improving simulation fidelity and exhaustively, stochastically analyzing robustness of final controller performance, different algorithmic approaches could be investigated to optimize a fuzzy controller. For instance, heuristic methods like neural networks and ant colony optimization could be used to tune the fuzzy inference systems, but these alternate methods would most likely require problem reformulation as mentioned in Section 4.2 and therefore could prove difficult to use. With such a huge number of degrees of freedom in the fuzzy system coupled with the nonlinear system dynamics, any optimization of the fuzzy system will likely be difficult.

Though a great deal of work has been done in the area of solely magnetic actuation of a satellite, there are still many more potential advances. One of the most notable areas of potential advancement is in finding a general or even a heuristic solution to the time-optimal slew maneuver for a satellite using only magnetorquers. Very little work on this time-optimal problem has been done, and significant potential for advancement still exists. Another potential area of interest may be in exploring different feedback structures. For instance, mapping the magnetic

137 moment to the plane that is perpendicular to the local magnetic field at the instant the control is calculated may not necessarily be ideal, because any real system will have to implement a zero order hold, and during the time the control torque is held at its constant value, the magnetic field will change; this is especially true in the body-fixed frame of a rotating spacecraft. In fact, a general nonlinear feedback control law that allows a magnetically actuated satellite to perform large angle slew maneuvers in near-minimum time and settle with very small attitude error may exist but has yet to be found due to computational restrictions and the assumption of solution forms. Intelligent systems, using fuzzy logic, genetic algorithms, neural networks, etc. may be able to help find a general solution, but practical implementation of one of these systems on a magnetically actuated satellite may be difficult or impossible for the foreseeable future. A quick calculation of the complexity of a general Mamdani FIS shows why. Using the three angular rate feedback terms, three non-redundant quaternion error terms (plus possibly the sign of the fourth), three terms for the magnetic field vector, and the hypothesized three terms for the magnetic field time derivative vector, the general fuzzy system would have twelve to thirteen unique linguistic variable inputs. If each of these inputs has just three membership functions, the rule base alone has up to 312 to 313 = 531,441 to 1,594,323 possible rule combinations; on-orbit evaluation of a

FIS with a rule base of this size would take a significant amount of time. Furthermore from a design perspective, if a genetic algorithm were used to find the optimal FIS, the strings representing these solutions could be up to this length and likely would be longer if more than just the rule base were designed by the genetic algorithm; most definitely a more-dynamic type of genetic algorithm than that presented in this thesis (i.e. using a variable-length string) would need to be used, or some clever simplification of the vector nature of the problem would have to be implemented.

138

Appendix A

International Geomagnetic Reference Field Model

The best-documented Earth magnetic field model is the International Geomagnetic Reference

Field (IGRF) model. The IGRF is composed of a number of spherical harmonic functions which have been fit to measurements taken and agreed-upon by the International Association of

Geomagnetism and Aeronomy (IAGA)40. New IGRF models, composed of model constants in the form of Gaussian coefficients, are produced every five years and include first time-derivative

(secular variation) terms of model constants to model the field for the next five years40. Old model constants are retained in the new model and are designated Definite Geomagnetic

Reference Field (DGRF) models, because records of the actual magnetic field can be used to more-definitively, not necessarily exactly, model the historical geomagnetic field40.

m m Each model gives the Gaussian coefficients gn and hn where n is the order of the harmonic.

The reference field is then specified as a potential function of distance from Earth center, r,

Earth-fixed latitude, θ, and Earth-fixed longitude, φ, for a spherical harmonic representation of order k:

푅 푛+1 푉(푟, 휃, 휑) = 푅 ∑푘 ( 퐸) ∑푛 [푔푚 cos(푚휑) + ℎ푚 sin(푚휑)]푃푚(휃) (A.1) 퐸 푛=1 푟 푚=0 푛 푛 푛

139

So, in spherical components, the magnetic field vector can be calculated as:

휕푉 푅 푛+2 퐵 = − = ∑푘 ( 퐸) (푛 + 1) ∑푛 [푔푛,푚 cos(푚휑) + ℎ푛,푚 sin(푚휑)]푃푛,푚(휃) (A.2) 푟 휕푟 푛=1 푟 푚=0

1 휕푉 푅 푛+2 휕푃푛,푚(휃) 퐵 = − = − ∑푘 ( 퐸) ∑푛 [푔푛,푚 cos(푚휑) + ℎ푛,푚 sin(푚휑)] (A.3) 휃 푟 휕휃 푛=1 푟 푚=0 휕휃

1 휕푉 1 푅 푛+2 퐵 = − = − ∑푘 ( 퐸) ∑푛 푚[−푔푛,푚 sin(푚휑) + 휑 푟 sin(휃) 휕휑 sin(휃) 푛=1 푟 푚=0

ℎ푛,푚 cos(푚휑)]푃푛,푚(휃) (A.4)

In Equations A.2 through A.4, Earth is assumed spherical, Br is assumed positive radially outward, Bθ is assumed positive southward, and Bφ is assumed positive eastward.

Equations A.5 through A.20 define quantities in the spherical component equations. Most are given in terms of recurrence relations because this facilitates calculation, decreasing computational time.

푛,푚 푚 푔 = 푆푛,푚푔푛 (A.5)

푛,푚 푚 ℎ = 푆푛,푚ℎ푛 (A.6)

The S terms are given by Equations A.7 through A.10.

푆0,0 = 1 (A.7)

2푛−1 푆 = 푆 [ ] , 푛 > 1 (A.8) 푛,0 푛−1,0 푛

(푛−푚+1)(훿1 +1) 푆 = 푆 √ 푚 , 푚 > 1 (A.9) 푛,푚 푛,푚−1 푛+푚

140

1 , 푖 = 푗 훿푗 = { (A.10) 푖 0 , 푖 ≠ 푗

The Pn,m terms are found by Equations A.11 through A.15.

(푛−1)2−푚2 퐾푛,푚 ≡ , 푛 > 1 (A.11) (2푛−1)(2푛−3)

퐾푛,푚 ≡ 0 , 푛 = 1 (A.12)

푃0,0 = 1 (A.13)

푃푛,푛 = sin(휃) 푃푛−1,푛−1 (A.14)

푃푛,푚 = cos(휃) 푃푛−1,푚 − 퐾푛,푚푃푛−2,푚 (A.15)

The P derivatives used in Equations A.2 through A.4 are found using Equations A.16 through

A.18.

휕푃0,0 = 0 (A.16) 휕휃

휕푃푛,푛 휕푃푛−1,푛−1 = sin(휃) + cos(휃) 푃푛−1,푛−1 , 푛 > 1 (A.17) 휕휃 휕휃

휕푃푛,푚 휕푃푛−1,푚 휕푃푛−2,푚 = cos(휃) − sin(휃) 푃푛−1,푚 − 퐾푛,푚 (A.18) 휕휃 휕휃 휕휃

For computational efficiency, the recurrence relations in Equations A.19 and A.20 are used in place of evaluating trigonometric functions hundreds of times.

cos(푚휑) = cos((푚 − 1)휑 + 휑) = cos((푚 − 1)휑) cos(휑) − sin((푚 − 1)휑) sin(휑) (A.19)

sin(푚휑) = sin((푚 − 1)휑 + 휑) = sin((푚 − 1)휑) cos(휑) + cos((푚 − 1)휑) sin(휑) (A.20)

141

Appendix B

Optimized Fuzzy Inference Systems

The input and output membership functions and the rule bases of the two fuzzy inference systems as well as the input and output gains designed by the genetic algorithm are presented in this appendix.

Table B.1. Final Fuzzy Controller proportional FIS input and output gains.

푐푃,푞 0 3 푐푃,휔 5.3×10 -5 푐푃 9.8×10

Table B.2. Final Fuzzy Controller proportional FIS rule base.

verr P FIS small med large small med

err med small med med

ω large med small med

142

Figure B.1. Final Fuzzy Controller proportional FIS quaternion error input membership functions.

Figure B.2. Final Fuzzy Controller proportional FIS angular rate error input membership functions.

Figure B.3. Final Fuzzy Controller proportional FIS output membership functions.

143

Table B.3. Final Fuzzy Controller derivative FIS input and output gains.

푐퐷,푞 0 6 푐퐷,휔 4.7×10 -2 푐퐷 3.5×10

Table B.4. Final Fuzzy Controller derivative FIS rule base.

verr D FIS small med large

small small large small

err med med

ω large med small med

Figure B.4. Final Fuzzy Controller derivative FIS quaternion error input membership functions.

144

Figure B.5. Final Fuzzy Controller derivative FIS angular rate error input membership functions.

Figure B.6. Final Fuzzy Controller derivative FIS output membership functions.

145

References

[1] “Michael’s List of CubeSat Satellite Missions,” August 7, 2009.

[http://mtech.dk/thomsen/space/cubesat.php Accessed August 25, 2013]

[2] Bhat, S. P., “Controllability of Nonlinear Time-Varying Systems: Applications to Spacecraft

Attitude Control Using Magnetic Actuation,” IEEE Transactions on Automatic Control, Vol.

50, No. 11, November 2005.

[3] Martel, F., Pal, P., and Psiaki, M., "Active Magnetic Control System for Gravity Gradient

Stabilized Spacecraft," Proceedings of the 2nd Annual AIAA/USU Conference on Small

Satellites, Logan, Utah, 1988.

[4] Wiśniewski, R., “Satellite Attitude Control Using Only Electromagnetic Actuation,” Ph. D.

Dissertation, Department of Control Engineering, Aalborg University, Aalborg Ø, Denmark,

1996.

[5] Wiśniewski, R., "Linear Time Varying Approach to Satellite Attitude Control Using Only

Electromagnetic Actuation," Journal of Guidance, Control, and Dynamics, Vol. 23, No. 4,

2000, pp. 640-647.

[6] Wiśniewski, R. and Markley, F. L., "Optimal Magnetic Attitude Control," Aalborg

University, 1999.

[7] Wiśniewski, R. and Blanke, M., "Fully Magnetic Attitude Control for Spacecraft Subject to

Gravity Gradient," Automatica, Vol. 35, 1999, pp. 1201-1214.

146

[8] Wiśniewski, R., "Sliding Mode Attitude Control for Magnetic Actuated Satellite," Aalborg

University, 1998.

[9] Wiśniewski, R., Stoustrup, J., "Periodic H_2 Synthesis for Spacecraft Attitude Control with

Magnetorquers," Journal of Guidance, Control, and Dynamics, Vol. 27, No. 5, 2004, pp. 874-

881.

[10] Makovec, K. L., “A Nonlinear Magnetic Controller for Three-Axis Stability of

Nanosatellites,” Master’s Thesis, Virginia Polytechnic Institute and State University,

Blacksburg, VA, 2001.

[11] Psiaki, M. L., “Magnetic Torquer Attitude Control Via Asymptotic Periodic Linear

Quadratic Regulation,” AIAA Paper 2000-4043, 2000.

[12] Pulecchi, T., Lovera, M., and Verga, A., “Optimal Discrete-Time Design of Three-Axis

Magnetic Attitude Control Laws,” IEEE Transactions on Control Systems Technology, Vol.

18, No. 3, 2010, pp. 714-722.

[13] Lovera, M. and Varga, A., "Optimal Discrete-Time Magnetic Attitude Control of Satellites,"

Proceedings of the 16th International Federation of Automatic Control World Congress, Vol.

16, No. 1, 2005.

[14] Lovera, M., De Marchi, E., and Bittanti, S., "Periodic Attitude Control Techniques for Small

Satellites with Magnetic Actuators," IEEE Transactions on Control Systems Technology, Vol.

10, No. 1, 2002, pp. 90-95.

147

[15] Reyhanoglu, M. and Hervas, J. R., "Three-Axis Magnetic Attitude Control Algorithms for

Small Satellites," Proceedings of 5th International Conference on Recent Advances in Space

Technologies, 2011, pp. 897-902.

[16] Lovera, M. and Astolfi, A., "Global Attitude Regulation Using Magnetic Control,"

Proceedings of the 40th IEEE Conference on Decision and Control, Orlando, Florida, 2001,

pp. 4604-4609.

[17] Lovera, M. and Astolfi, A., “Global Magnetic Attitude Control of Inertially Pointing

Spacecraft,” Journal of Guidance, Control, and Dynamics, Vol. 28, No. 5, 2005, pp. 1065-

1067.

[18] Lovera, M. and Astolfi, A., "Global Magnetic Attitude Control of Spacecraft," Proceedings

of the 43rd IEEE Conference on Decision and Control, Atlantis, Paradise Island, Bahamas,

2004, pp. 267-272.

[19] Gravdahl, J. T., "Magnetic Attitude Control for Satellites," Proceedings of the 43rd IEEE

Conference on Decision and Control, Atlantis, Paradise Island, Bahamas, 2004, pp. 261-266.

[20] Wang, P., Shtessel, Y. B., and Wang, Y., "Satellite Attitude Control Using Only

Magnetorquers," Proceedings of 30th Southeastern Symposium on System Theory, 1998, pp.

500-504.

[21] Lovera, M. and Astolfi, A., “Spacecraft Attitude Control Using Magnetic Actuators,”

Automatica, Vol. 40, 2004, pp. 1405-1414.

148

[22] Kulkarni, J. and Campbell, M., "An Approach to Magnetic Torque Attitude Control of

Satellites via 'H_infinity' Control for LTV Systems," Proceedings of the 43rd IEEE

Conference on Decision and Control, Atlantis, Paradise Island, Bahamas, 2004.

[23] Wood, M. and Chen, W., "Attitude Control of Magnetically Actuated Satellites with an

Uneven Inertia Distribution," Elsevier, Aerospace Science and Technology, Vol. 25, No. 1,

2013, pp. 29-39.

[24] Corti, A. and Lovera, M., "Attitude Regulation for Spacecraft with Magnetic Actuators: An

LPV Approach," Control of Linear Parameter Varying Systems with Applications, Springer,

2012, pp. 339-355.

[25] Guerrant, D. V., “Design and Analysis of Fully Magnetic Control for Picosatellite

Stabilization,” Master’s Thesis, California Polytechnic State University, San Luis Obispo, CA

2005.

[26] Mohammed, A., Boudjemai, A., Chouraqui, S., and Benyettou, M., "Magnetorquer Control

for Orbital Manoeuvre of Low Earth Orbit Microsatellite," Proceedings of the 5th WSEAS

International Conference on Applied Computer Science, Hangzhou, China, 2006, pp. 1024-

1027.

[27] Wood, M., Chen, W., and Fertin, D., “Model Predictive Control of Low Earth Orbiting

Spacecraft with Magneto-Torquers,” International Conference on Control Applications,

Proceedings of the 2006 IEEE, Munich, Germany, October, 2006, pp. 2908-2913.

149

[28] Liang, J., Fullmer, R., and Chen, Y., “Time-Oiptimal Magnetic Attitude Control for Small

Spacecraft,” 43rd IEEE Conference on Decision and Control, Atlantis, Paradise Island,

Bahamas, 2004, pp. 255-260.

[29] Heydari, A., “Time-Optimal Closed-Loop Attitude Control of Magnetica Actuated Satellites

Using Neural Networks,” Master’s Thesis, Aerospace Engineering Department, Sharif

University of Technology, Tehrān Iran, Iran, 2008.

[30] Heydari, A., Pourtakdoust, S. H., and Heydari, H., "Magnetic Attitude Control Using Fuzzy

Logic," Proceedings of the IEEE International Symposium on Intelligent Control, Saint

Petersburg, Russia, 2009, pp. 456-460.

[31] Silani, E. and Lovera, M., "Magnetic Spacecraft Attitude Control: A Survey and Some New

Results," Elsevier, Control Engineering Practice, Vol. 13, 2005, pp. 357-371.

[32] Markley, F. L., "Fast Quaternion Attitude Estimation from Two Vector Measurements,"

Journal of Guidance, Vol. 25, No. 2, 2001, pp.411-414.

[33] Crassidis, J. L., Markley, F. L., and Cheng, Y., "Survey of Nonlinear Attitude Estimation

Methods," Journal of Guidance, Control, and Dynamics, Vol. 30, No. 1, 2007, pp. 12-28.

[34] Wertz, J. R., Spacecraft Attitude Determination and Control, Reidel, Dordrecht, Holland,

1978.

[35] Sidi, M. J., Spacecraft Dynamics & Control: A Practical Engineering Approach,

Cambridge, Neq York, NY, 1997.

150

[36] Cannata, M. N., "Development of a Sun Vector Determination Algorithm for CubeSat-Class

Spacecraft," Master's Thesis, Graduate Department of Earth and Space Sciences, York

University, Toronto, Ontario, 2010.

[37] Munakata et. al., "CubeSat Design Specification," Rev. 12, The CubeSat Program,

California Polytechnic State Universiy, San Luis Obispo, California, 2009.

[38] Shuster, M. D., "A Survey of Attitude Representations," The Journal of the Astronautical

Sciences, Vol. 41, No. 4, 1993, pp. 439-517.

[39] Wie, B., Space Vehicle Dynamics and Control, 2nd ed, AIAA, Reston, VA, 2008.

[40] Lowes, F. J., “The International Geomagnetic Reference Field: A “Health” Warning,”

IAGA Division V-MOD, Geomagnetic Field Modeling, January 2010.

[http://www.ngdc.noaa.gov/IAGA/vmod/igrfhw.html. Accessed 2/10/13.]

[41] Hoots, F. R., Roehrich, R. L., and Kelso, TS, “Spacetrack Report No. 3: Models for

Propagation of NORAD Element Sets,” Department of Defense, Alexandria, VA, 1988.

[42] Wertz, J. R., and Larson, J. W., Space Mission Analysis and Design, Third Edition,

Springer, New York, NY, 1999.

[43] Vallado, David A., Paul Crawford, Richard Hujsak, and T.S. Kelso, "Revisiting Spacetrack

Report #3," presented at the AIAA/AAS Astrodynamics Specialist Conference, Keystone,

CO, 2006 August 21–24.

[44] Ross, T. J., Fuzzy Logic with Engineering Applications, 3rd Ed., John Wiley and Sons, Inc.,

West Sussex, UK, 2010.

[45] Tsoukalas, L. H., Uhrig, R. E., and Zadeh, L. A., Fuzzy and Neural Approaches in

Engineering, John Wiley and Sons, Inc., New York, NY, 1997.

151

[46] Vick, A., and Cohen, K., "Genetic Fuzzy Controller for a Gas Turbine Fuel System," in

Book, Intelligent and Autonomous Aerospace Systems, edited by John Valasek, AIAA's

Progress in Aeronautics & Astronautics Series, October 2012.

[47] Ernest, N. D., "UAV Swarm Cooperative Control Based on a Genetic-Fuzzy Approach,"

Master's Thesis, Department of Aerospace Engineering, College of Engineering, University of

Cincinnati, Cincinnati, Ohio, 2012.

[48] Finlay, C. and Nair, M., "International Geomagnetic Reference Field IGRF-11," IAGA V-

MOD Geomagnetic Field Mdeling, January 2010.

[http://www.ngdc.noaa.gov/IAGA/vmod/igrf.html. Accessed 2/10/13.]

[49] "NanoPower P110 Series Solar Panels Datasheet," Electronic Datasheet, GOMSpace, April

2013. [http://gomspace.com/documents/GS-DS-P110-1.0.pdf. Accessed 10/19/13]

[50] "BMG160 Digital, Triaxial Gyroscope Sensor," Electronic Datasheet, BST-BMG160-

DS000-07, Bosch Sensortec, Rev. 1, May 2013. [http://ae-

bst.resource.bosch.com/media/products/dokumente/bmg160/BST-BMG160-DS000-

07_published.pdf. Accessed 10/19/13]

[51] Searcy, J. D., "Magnetometer-Only Attitude Determination with Application to the M-SAT

Mission," Master's Thesis, Graduate School of the Missouri University of Science and

Technology, Rolla, MO, 2011.

[52] Knapp, A., "Chinese Supercomputer Is Now The World's Fastest - By A Lot," Forbes, June

17, 2013. [http://www.forbes.com/sites/alexknapp/2013/06/17/chinese-supercomputer-is-

now-the-worlds-fastest-by-a-lot/. Accessed 10/19/13]

152

[53] "ISIS MagneTorquer Board iMTQ," Electronic Datasheet, ISIS, CubeSatShop, V.12.11.

[http://www.isispace.nl/brochures/ISIS%20iMTQ%20Brochure%20v12.11.pdf. Accessed

10/19/13]

[54] Dorigo, M., Birattari, M., and Stutzle, T., "Ant Colony Optimization: Artificial Ants as a

Computational Intelligence Technique," IEEE Computational Intelligence Magazine,

November, 2006, pp. 28-39.

153