Attitude and Trajectory Estimation for Small Suborbital Payloads

YUNXIA YUAN

Doctoral Thesis Stockholm, 2017 TRITA-EE 2017:046 KTH School of Electrical Engineering ISSN 1653-5146 SE-100 44 Stockholm ISBN 978-91-7729-427-6 SWEDEN

Akademisk avhandling som med tillstånd av Kungl Tekniska högskolan framlägges till offentlig granskning för avläggande av teknologie doktorsexamen i flyg- och rymdteknik 14:00 fredagen den 2 Juni 2017 i Q2, Osquldas väg 10, Stockholm.

© Yunxia Yuan, June 2017

Tryck: Universitetsservice US AB iii

Abstract

Sounding and small suborbital payloads provide a means for research in situ of the and ionosphere. The trajectory and the attitude of the payload are critical for the evaluation of the scientific measurements and experiments. The trajectory refers the location of the measurement, while the attitude determines the orientation of the sensors. This thesis covers methods of trajectory and attitude reconstruction imple- mented in several experiments with small suborbital payloads carried out by the Department of Space and Plasma Physics in 2012–2016. The problem of trajectory reconstruction based on raw GPS data was studied for small suborbital payloads. It was formulated as a global least squares op- timization problem. The method was applied to flight data of two suborbital payloads of the RAIN REXUS experiment. Positions and velocities were ob- tained with high accuracy. Additionally, wind up rates were obtained, which match the measurements from onboard angular rate sensors. Based on the trajectory reconstruction technique, atmospheric densities, tem- peratures, and horizontal wind speeds below 80 km were obtained using rigid free falling spheres of the LEEWAVES experiment. An iterative method was applied using the relation between the retrieved accelerations and the veloc- ities and the densities. The dependence of the drag coefficient on the flow characteristics calls for the iterative approach. The uncertainties of the re- sults are lower at low altitudes. Comparison with independent data indicates that the results are reliable for densities below 70 km, temperatures below 50 km, and wind speeds below 45 km. Attitude reconstruction of suborbital payloads from yaw-pitch-roll Euler an- gles was studied, using measurements of magnetic fields and angular veloci- ties. The Euler angles were established by two methods: a global optimization method and an Unscented Kalman Filter (UKF) technique. The comparison of the results shows that the global optimization method provides a more accurate fit to the observations than the UKF. Improving the results of the falling sphere experiments requires understanding of the attitude motion of the sphere. An analytical consideration was devel- oped for a free falling and axisymmetric sphere under aerodynamic torques. Due to the displacement between the center of mass and the geometric cen- ter, the motion can generally be defined as a superposition of precession and nutation. These motion phenomena were modeled numerically and compared to flight data. iv

Sammanfattning

Sondraketer är en viktig teknik som används inom atmosfärs- och jonosfärs- forskningen. Nyttolastens bana och attityd är av vikt för experimenten och de vetenskapliga mätningarna, då banan beskriver var mätningarna togs vid en viss tidpunkt och attityden beskriver sensorns orientering. Denna avhandling omfattar metoder för rekonstruktion av nyttolasters banor och attityder i flera sondraketexperiment utförda av rymd- och plasmafysi- kavdelningen 2012–2016. Problemet med banrekonstruktion baserad på insamlade GPS-signaler har studerats för små friflygande sondraketnyttolaster. Det har formulerats som ett globalt minstakvadrat-optimeringsproblem. Metoden har applicerats på flygdata från två friflygande enheter i REXUS-experimentet RAIN. Positio- ner och hastigheter har erhållits med hög noggrannhet. Dessutom har en uppskattning gjorts på fasvridningen hos GPS-signalens bärvåg, som stäm- mer överens med vinkelhastighetsmätningar från en ombordsensor. Banrekonstruktionstekniken har använts för att bestämma atmosfärens tät- het, temperatur och vindhastighet från GPS data ombord på fallande sfärer inom LEEWAVES-experimentet. En iterativ metod har använts som grundar sig på relationen mellan tätheten och de rekonstruerade värdena på accelera- tion och hastighet. Det iterativa tillvägagångssättet är nödvändigt på grund av att luftmotståndet beror av flödesparametrarna på ett icke-linjärt sätt. Jämförelser med oberoende data indikerar att resultaten är pålitliga för at- mosfärstätheter under 70 km, temperaturer under 50 km och vindhastigheter under 45 km höjd. Attitydrekonstruktionen i form av gir-lutning-roll Eulervinklarna för en fri- flygande enhet har undersökts genom att använda mätningar av magnetfält och vinkelhastigheter. Två metoder användes för att rekonstruera Eulervink- larna: en global optimeringsmetod och unscented Kalmanfilterteknik (UKF). Jämförelsen av resultaten visar att den globala optimeringsmetoden ger en bättre överensstämmelse med observationerna än UKF. Förbättringar av resultaten från experimenten med fallande sfärer kräver för- ståelse av sfärens attitydrörelse. En analytisk modell har utvecklats för en fritt fallande och axisymmetrisk sfär under påverkan av aerodynamiska vridmo- ment. På grund av förskjutningen mellan masscentrum och det geometriska centrum kommer rörelsen generellt att vara en kombination av precession och nutation. Detta rörelsemönster har modellerats numeriskt och jämförts med flygdata. v

Acknowledgements

I would like to express my sincere and deep gratitude to my supervisor Dr. Nick- olay Ivchenko. Firstly, I thank him for giving me this opportunity to pursue a PhD under his supervision. During the period of study, Nickolay gave me enough freedom to conduct the research. He helped me plan my PhD study and research carefully, making it well-organised. He was always to give detailed instructions whenever I came across difficulties, he supported me to learn more about what I was interested in and provided me with opportunities to improve myself in various ways, such as by taking part in practical projects, interesting courses, conferences and symposiums, learn how to express myself in writing and developing my com- puter and network skills. He is a very intelligent and knowledgeable scientist, whom I really admire. I am very grateful to my co-supervior Dr. Gunnar Tibert as well. He provided me with a great number of instructions in the beginning of my studies at KTH to help me conduct the PhD studies. His careful and meticulous research attitude influenced me largely. He kept his concern for my study and research, and spent much time to discuss my study and research. During the whole study period, he taught me much knowledge and many skills. Many thanks to my colleagues in the Department of Space and Plasma Physics, School of Electrical Engineering, KTH Royal Institute of Technology: Lars Bylan- der, Hanna Dahlgren, Gabriel Giono, Chunqing Huo, Tobias Kuremyr, Bin Li, Per- Arne Lindqvist, Göran Marklund, Georgi Olentsenko, Lorenz Roth, Nicola Manuel Schlatter, Peter Weijnitz. I thank them for their kind help and encouragement. Thanks to my fellows in Stockholm: Huina, Lin, Yan. I thank them for their warm help and company. My thanks also go to the Chinese Scholarship Council, which financially supported my PhD study. Last but not least, I really would like to express my deep appreciation to my par- ents. I thank them very much for their endless love and support, which has helped me to get through with these studies.

Contents

Contents vii

Acronyms ix

Paper list xi List of papers ...... xi Publications not included in this thesis ...... xi

List of Figures xiii

1 Introduction 1

2 Sounding and small projects 3 2.1 RAIN ...... 3 2.2 MUSCAT ...... 5 2.3 SPIDER ...... 8

3 Principles of Global Navigation Satellite Systems 15 3.1 Signal ...... 15 3.2 Front end ...... 17 3.3 Software receiver operation ...... 17 3.4 Navigational solution ...... 19

4 Attitude kinematics and dynamics 21 4.1 Kinematics ...... 22 4.2 Attitude dynamics ...... 26 4.3 Euler’s equation ...... 28

5 State estimation 31 5.1 Least squares optimization ...... 31 5.2 Unscented transformation ...... 32 5.3 Unscented Kalman filter ...... 33

6 Results and conclusions 37

vii viii CONTENTS

6.1 Paper 1 ...... 37 6.2 Paper 2 ...... 38 6.3 Paper 3 ...... 39 6.4 Paper 4 ...... 39

Bibliography 41 Acronyms

ADC Analog-to-Digital Converter BDU Boom Deployment Unit BPSK Binary Phase Shift Keying C/A code Coarse Acquisition code CU Common Unit DC Direct Current DCM Direction Cosine Matrix DLL Delay Lock Loop EMU Electric Measurement Unit EKF Expanded Kalman Filter ESA FFU Free Flight Units GPS Global Positioning System GNSS Global Navigation Satellite System IGS International GPS Service for Geodynamics KF Kalman Filter LEEWAVES Local Excitation and Effects of Waves on Atmospheric VErtical Structure LNA Low-Noise Amplifier MUSCAT MUltiple Spheres for Characterization of Atmospheric Temperatures P code Precision code

ix x CONTENTS

PCB Printed Circuit Board PGA Programmable Gain Amplifier

PLL Phase Lock Loop QFN Quad Flat No-leads RAIN Rocket deployed Atmospheric probes conducting Independent measurements in Northern Sweden REXUS Rocket Experiments for University Students

RMU Rocket Mounted Unit SPIDER Small Payloads for Investigation of Disturbances in Electrojet by Rockets TEM Transmission Electron Microscopy

UHF Ultra High Frequency UKF Unscented Kalman Filter

UT Unscented Transformation VCO Voltage Controlled Oscillator Paper list

List of papers

1. Y. Yuan, E. Linden, N. Ivchenko, Post-flight trajectory reconstruction of subor- bital free-flyers using GPS raw data, submitted to Journal of Geodetic Science. 2. Y. Yuan, N. Ivchenko, G. Tibert, J. Gumbel, J. Hedin, M. Stanev, Atmosphere density measurements using GPS data from rigid falling spheres, submitted to At- mospheric Measurement Techniques. 3. Y. Yuan, G. Tibert, N. Ivchenko, Attitude reconstruction of suborbital small spacecrafts using a global optimization method, manuscript in preparation for Acta Astronautica. 4. Y. Yuan, G. Tibert, N. Ivchenko, Precession and nutation of a free flying and axis-symmetric sphere, submitted to Acta Astronautica.

In paper 1, Y. Yuan implemented the data processing, tuned the optimisation algo- rithm, discussed the results with co-authors, and prepared the final version of the manuscript. In paper 2, Y. Yuan derived the algorithm, implemented the data processing, dis- cussed the results with co-authors, and prepared the manuscript. In paper 3, Y. Yuan derived the algorithm, implemented the data processing, dis- cussed the results with co-authors, and wrote the manuscript. In paper 4, Y. Yuan derived the model, implemented the data processing, discussed the results with co-authors, and wrote the manuscript.

Publications not included in this thesis

1. Y. Yuan, N. Ivchenko, G. Tibert, N. M. Schlatter. Reconstruction of attitude dynamics of free falling units. Proceedings of the 22nd ESA Symposium on Eu- ropean Rocket and Balloon Programmes and Related Research, Tromso, Norway, 7-12 June 2015. 2. G. Balmer, et al. ISAAC: a REXUS student experiment to demonstrate an ejection system with predefined direction. Proceedings of the 22nd ESA Sympo- sium on European Rocket and Balloon Programmes and Related Research, Tromso,

xi xii CONTENTS

Norway, 7-12 June 2015. 3. Y. Yuan, G. Tibert, N. Ivchenko, N. M. Schlatter, David Gerhardt. Estimation of inertia properties for 3U . Small , System & Services Sympo- sium(4S), Valletta, Malta, 30 May-03 June, 2016. List of Figures

2.1 RAIN experiment setup, the FFUs are shown as grey circles at 90° and 270°...... 4 2.2 Flight phases of the MUSCAT experiment...... 6 2.3 MUSCAT RMU (a) and FFU (b)...... 7 2.4 Velocity in an inertial frame...... 7 2.5 Altitude in an inertial frame...... 8 2.6 Angular velocity vs time from ejection, in the frame of the gyroscope. . 9 2.7 SPIDER RMU and ejection test ...... 10 2.8 SPIDER units ...... 11 2.9 Magnetic field observations obtained during the SPIDER flight...... 12 2.10 Electric field observation, the unit is V/m, the color shows the temporal evolution of the electric field vector, from red to blue, from 60 s to 110 s 13

3.1 Generation of GPS signals on satellites ...... 16

4.1 Rotation in sequence of 321 Euler angles ...... 22 4.2 Rigid body rotation ...... 26

xiii

Chapter 1

Introduction

In the current era, the human civilization is highly developed. Science and technol- ogy make our lives more comfortable, convenient, and faster. This development of our civilization is the result of human beings continuously exploring the unknown world. By benefiting from the advancements of aerospace technology, humans ex- pand exploration from the Earth to beyond the Earth. Spacecraft are able to help us observe the wide environments of the Earth such as the oceans, the atmosphere, the ionosphere and magnetosphere, as well as electro-magnetic processes there to reveal the electro-magnetic space plasma environment and processes there. Space- craft also enable us to explore the outer universe, the moon, and other planets, to investigate the origin of the universe and search for other planets that may be suitable for human beings. Since sounding rockets were developed before satellites, they were applied to sci- entific exploration first, with onboard scientific payload for in situ scientific mea- surements in space just a few hundred kilometers above the Earth. This is usually called suborbital spaceflight, in which the spacecraft reaches space and then returns to the Earth, so that it does not fulfill one orbital revolution. The first man-made satellite Sputnik was launched in 1957. Today, conventional satellites, often with a mass of more than 500 kg, are very common for commu- nication, navigation, remote sensing and natural exploration as well as scientific experiments. Satellites are classified commonly on the basis of their wet mass, including fuel. A satellite is categorized as Large, Medium, Mini, Micro, Nano, Pico, or Femto, if the satellite has a corresponding mass (kg) of > 1000, 500-1000, 100-500, 10-100, 1-10, 0.1-1, or < 0.1. Mini, micro, nano, pico and femto satellites are collectively called small or miniature satellites. In recent years, the technology of small satellites has become increasingly popu- lar. The advantages of small satellites include lower launch cost due to the lower mass, and shorter development time. Due to the short development period, small satellites are often able to adopt the latest technology. In addition, small satel- lites are capable to accomplish some missions that a single large satellite could not

1 2 CHAPTER 1. INTRODUCTION complete, such as for instance, formations for measurement from multiple points. Small satellites offer an affordable solution for university-related research as well. This thesis studies the motion, modelling, and reconstruction of rigid bodies re- lated primarily to suborbital payloads. Chapter 2 presents sounding rocket and small satellite projects at KTH. Chapter 3 describes principles of Global Naviga- tion Satellites Systems, used for trajectory reconstruction in the sounding rocket projects. Chapter 4 reviews the motion theory: attitude kinematics and dynamics. Chapter 5 shows the state and parameter estimation methods which were used in this thesis to perform motion reconstruction. Chapter 6 summarizes the results of the thesis work. Chapter 2

Sounding rocket and small satellite projects

This chapter presents the student sounding rocket projects carried out at KTH. The projects, carried out within the joint Swedish-German programme Rocket Ex- periments for University Students (REXUS) have been critical in developing and demonstrating the use of small ejectable recoverable payloads (Ivchenko and Tib- ert, 2013), which enabled sounding rocket projects in the Swedish national sounding rocket programme.

2.1 RAIN

Rocket deployed Atmospheric probes conducting Independent measurements in Northern Sweden (RAIN) (Reid et al., 2013) was launched from the Swedish Space Corporations Space Center, at 11:45 UT on Nov. 16, 2012, onboard the REXUS 12 sounding rocket. The purpose of this project was to perform multi-point aerosol collection in the middle atmosphere.

Overview Characterisation of middle atmospheric aerosols and their processes is of primary importance because stratospheric particles significantly influence the chemistry and radiation budget of the atmosphere, and condensation nuclei are related to cloud formation in the stratosphere and . In situ measurements of the aerosol composition in the middle atmosphere are rare. Charged meteoric smoke parti- cles can be collected by detectors similar to those used for charged particles, (e.g. Lynch et al., 2005). Collection of neutral dust particles is challenging (Hedin et al., 2007), although some advanced experiments have been recently carried out (Rapp et al., 2010). Hence, alternative methods for in situ sampling of middle atmosphere aerosol particles and successive characterisation of their chemical composition are

3 4 CHAPTER 2. SOUNDING ROCKET AND SMALL SATELLITE PROJECTS of interest. The experiment objectives were to prove the concept of a multi-point aerosol col- lection technique in the middle atmosphere and to acquire the compositions and sizes of middle atmospheric aerosol particles. The experiment consisted of two free flight units (FFUs), which were ejected from the sounding rocket at an altitude of 57 km above ground, and followed a ballistic trajectory to an apogee height of 79 km. As the FFUs descended, they collected aerosol particles by exposing collection samples over altitude ranges. At the same time, an onboard receiver recorded raw GPS signals, which were stored onboard. The FFUs landed with a parachute and were recovered after the flight. Afterwards, the collected particles and raw sensor data were processed and analysed further.

Experiment setup

Figure 2.1: RAIN experiment setup, the FFUs are shown as grey circles at 90° and 270°.

Figure 2.1 shows a schematic of the RAIN experiment. The FFUs were cylinders with a diameter of 116 mm, a height of 108 mm, and mass of 1 kg. They were ejected sideways from a Rocket Mounted Unit (RMU). The RMU was composed of a standard REXUS module with a FFU ejection system. The FFUs were held in the RMU at launch and ejected from the rocket before it was despun, thus retaining spinning motion. The FFUs include four parts: the GPS-experiment, the localisation system, a data acqusition system and a power system. When the FFUs reached apogee, they began the dust collection phase. A turntable collection mechanism rotated inside each FFU, exposing aerosol collection samples to the surrounding environment via an exposure window at the base of the FFU. 2.2. MUSCAT 5

The collection samples consisted of 3 mm diameter copper and formvar resin coated carbon transmission electron microscopy (TEM) grids that collected the passing aerosol particles. These grids were exposed incrementally based on their angular position within the FFU. This resulted in the collection of aerosols at varying altitudes so as to capture an aerosol distribution profile. In addition to collecting aerosol particles a secondary GPS experiment was also conducted. As the FFUs flew through the atmosphere they collected raw GPS data via a GPS front end receiver. After retrieving the FFUs, these data were processed using a custom software receiver to reconstruct their trajectory.

2.2 MUSCAT

MUltiple Spheres for Characterization of Atmospheric Temperatures (MUSCAT) experiment (Bordogna et al., 2013) was launched from the Esrange Space Centre on May 9, 2013 onboard the REXUS 13 sounding rocket to measure density and temperature profiles in the mesosphere.

Overview MUSCAT was aimed to prove the concept of a rigid falling sphere to derive density and temperature profiles in the middle atmosphere. In addition, the secondary objective was to demonstrate that the sub-payloads are reliable, robust and easy to manufacture.

The experiment involved ejecting four spherical probes, or FFUs, from the RMU at an altitude of approximately 60 km. The FFUs continued to a maximum altitude of roughly 90 km. Upon ejection, the FFUs started a data gathering phase, recording raw GPS data as they travelled through the atmosphere. At an altitude of 5 km the data gathering phase was completed and the FFUs ex- perienced a similar procedure as on RAIN. They deployed parachutes and switched from raw GPS data gathering to recording and transmitting commercial GPS co- ordinates to the ground crew. The GPS data were then analysed to obtain the velocity and acceleration of the FFUs during the fall. These data can be used, along with the drag coefficient of the FFUs, to derive the atmospheric density and temperature profiles. The flight phases are shown as Fig. 2.2 (Bordogna et al., 2013).

Experiment setup The MUSCAT experiment consists of four FFUs and the RMU with an ejection system, as shown in Fig. 2.3. The RMU keeps the FFUs in place until the ejection altitude is reached. The FFU consists of a custom-made fiber composite spherical outer structure, a parachute-based recovery system and electronics assembly inside. 6 CHAPTER 2. SOUNDING ROCKET AND SMALL SATELLITE PROJECTS

Figure 2.2: Flight phases of the MUSCAT experiment.

The FFU is 124 mm in diameter and the mass is approximately 0.4 kg. The FFUs are similar to those of RAIN, consisting of four parts: the GPS-experiment, the localisation system, a data acqusition system and a power system. This is im- plemented in two different printed circuit boards (PCBs): top and bottom. The top PCB consists of the GPS-experiment and localization system, including custom- made antennas. The bottom PCB consists of the data acquisition and power sys- tems. The primary objective of the electronics is to receive and store raw GPS data. The localization system provides a position and transmits it for retrieval of the probes.

Experiment measurement A patch antenna was used to receive GPS L1 signals. The GPS raw data were recorded for the post-flight analysis. Acceleration and angular velocity data were collected onboard the FFU. The velocity and the altitude of one FFU in the Earth-North-Up frame are shown in Figs. 2.4 and 2.5. The apogee is around 81 km, at 70 s. The maximum velocity in the downleg occurs around 48 km, at 153 s, when the aerodynamic acceleration increases to the gravitational acceleration. The angular velocity in the frame of the gyroscope is shown in Fig. 2.6. Before 140 s, the angular velocity magnitude does not change obviously, due to small aerodynamic torques. After that, the angu- lar velocity magnitude apparently decreases. This matches the large aerodynamic 2.2. MUSCAT 7

(a) RMU (b) FFU

Figure 2.3: MUSCAT RMU (a) and FFU (b).

Translational velocity 50

0 : m/s x v

-50 0 50 100 150 200 250 300 200

0 : m/s y v

-200 0 50 100 150 200 250 300 1000

0 : m/s z v

-1000 0 50 100 150 200 250 300 Time: s

Figure 2.4: Velocity in an inertial frame. 8 CHAPTER 2. SOUNDING ROCKET AND SMALL SATELLITE PROJECTS

×104 Altitude 9

8 X: 70 Y: 8.118e+04 7

6 X: 150 Y: 5.053e+04 5 h: m

4

3

2

1 0 50 100 150 200 250 300 Time: s

Figure 2.5: Altitude in an inertial frame. torque.

2.3 SPIDER

SPIDER stands for Small Payloads for Investigation of Disturbances in Electrojet by Rockets. The SPIDER sounding rocket was launched from the Esrange Space Centre at 21:09 UT on Feb. 2, 2016 being part of the national sounding rocket programme, supported by the Swedish National Space Board.

Overview The aim of SPIDER is to explore the multiscale structure of electrostatic turbulence in the E region of the ionosphere (90 km - 120 km). The scientific novelty of the experiment is to investigate the physics of the auroral electrojet and pre-breakup auroral arc in situ simultaneously on multiple scales. Although multipoint observa- tion of magnetic field structures of an auroral arc has been performed (Zheng et al., 2003), SPIDER provides more multipoint observations in space plasmas of electron densities and temperatures, the magnetic field vector, and DC and low frequency 2.3. SPIDER 9

Angular velocity 10

0 : rad/s x ω -10 0 50 100 150 200 250 300 10

0 : rad/s y ω -10 0 50 100 150 200 250 300 15

10 : rad/s z ω 5 0 50 100 150 200 250 300 Time: s

Figure 2.6: Angular velocity vs time from ejection, in the frame of the gyroscope. electric field in the spin plane. Ten identical FFUs were launched on a single rocket, and ejected at 60 km alti- tude. The launch conditions included clear sky and a southward moving auroral arc. The electric field and density/ temperature probes were carried by all FFUs, and deployed after the FFU ejection from the rocket. All measurements, as well as inertial measurements and raw GPS data were saved in the onboard memory and read out after the recovery of the FFUs. The recovery system was based on the developments in the REXUS projects.

Experiment instrumentation The experiment setup consisted of five RMUs with ten FFUs in total. Each RMU held two FFUs, ejected sidewise by a spring-based system (see Fig. 2.7). Each FFU was a cylinder with a diameter of 240 mm, a height of 94 mm with a mass of 3 kg. Each FFU consists of a Common Unit (CU), a Boom Deployment Unit (BDU) and an Electric Measurement Unit (EMU).

The CU (Fig.2.8(b)) collected GPS raw data, accelerometer and gyroscope data, as 10CHAPTER 2. SOUNDING ROCKET AND SMALL SATELLITE PROJECTS

(a) RMU (b) Ejection test, the red circles are used to indicate the positions of the FFUs.

Figure 2.7: SPIDER RMU and ejection test well as implemented recovery function, which included GPS antenna and commer- cial receiver, satellite antenna and modem and radio beacon. The BDU (Fig. 2.8(c)) carried the apparatus of the probe deployment, including four electric field probes on a 2 m titanium wire, four Langmuir probes on a 1 m titanium wire, and a probe front end with pre-amplification. These probes were deployed by means of the centrifugal force from spinning motion. The EMU (Fig. 2.8(d)) contained various payload measurement electronics (see Asplund, 2016), a fluxgate magnetometer, a star tracker, power and probe control.

Experiment measurements The launch of SPIDER was called shortly after a substorm breakup, and the pay- loads crossed the westward travelling surge. An example of the vector magnetic field data is shown in Fig. 2.9. Before the launch the value is constant, showing a quick spin-up immediately after launch. The FFU ejection is seen at 57.2 s, fol- lowed by the boom deployment verified by the decrease of the spin rate. Electric field probe potentials (Fig. 2.10) show the direction of the electric field vector in the North-East-Down coordinate frame. This is based on reconstruction of the FFU attitude.

LEEWAVES As a part of an unrelated campaign targeting the upper atmosphere in a multi- instrument study, a payload of falling spheres, called Local Excitation and Effects of Waves on Atmospheric VErtical Structure (LEEWAVES), was included on the same rocket. The LEEWAVES module contained 4 falling sphere FFUs based on 2.3. SPIDER 11

(a) FFU (b) CU

(c) BDU (d) EMU

Figure 2.8: SPIDER units the MUSCAT design. The scientific aim was to determine altitude profiles of at- mospheric densities, temperatures, and horizontal wind speeds. Combined with ground-based data from , airplane observations, balloons and air- glow measurements, LEEWAVES falling sphere data were to contribute to analysis of atmospheric gravity waves generated by strong winds crossing the mountain range. While conditions were not favourable for generation of the oro- graphic waves, a large data set was obtained which will be very useful for validation of the falling sphere data. 12CHAPTER 2. SOUNDING ROCKET AND SMALL SATELLITE PROJECTS

×104 (a) 5

0 x (nT)

-5 -200 -100 0 100 200 300 400 ×104 (b) 5

0 y (nT)

-5 -200 -100 0 100 200 300 400 ×104 (c) 6

4 z (nT)

2 -200 -100 0 100 200 300 400 Time (s)

Figure 2.9: Magnetic field observations obtained during the SPIDER flight. 2.3. SPIDER 13

Figure 2.10: Electric field observation, the unit is V/m, the color shows the temporal evolution of the electric field vector, from red to blue, from 60 s to 110 s

Chapter 3

Principles of Global Navigation Satellite Systems

GNSS is a collective term referring to Global Navigation Satellite System. Exam- ples include GPS, Gallieo, Beidou, Glonass. The GPS (Global Positioning System) (e.g. Borre et al., 2007), used very widely in the world nowadays, is a global nav- igation satellite system owned and operated by the . It can provide positions and/or velocities to a GPS receiver anywhere on or near the Earth where four or more GPS satellites are visible, using the signals transmitted by the satel- lite. In general, the GPS receiver contains hardware for signal reception, i.e. an antenna/front end, and software for signal processing and navigation algorithms. The Sounding rocket projects described in Chapter 2 all used a solution with a logger of raw GPS data onboard the free flying units, combined with a post-flight software analysis for reconstruction of the trajectories of the probes. Here, a short introduction to operation principles of the GPS is given, followed by details applicable to software receiver implementation for post-flight data analysis and a formulation of the trajectory reconstruction problem.

3.1 Signal

The GPS signals are transmitted on two radio frequencies in the UHF band. They are called L1 and L2 and derived from a common frequency, f0 = 10.23 MHz, so that fL1 = 154f0 = 1575.42 MHz, fL2 = 120f0 = 1227.60 MHz. The signals are made up of three parts: carrier, spreading sequence and navigation data. On each frequency the carrier is modulated by a spreading sequence and navigation data. The spreading sequence is called Gold code or pseudorandom noise sequences. Ev- ery satellite has two unique codes. One is the coarse acquisition code (C/A), and the other one is the encrypted precision code (P). The C/A code, used in our im- plementation of the receiver, is a sequence of 1023 chips. One chip corresponds to one bit of the code. The C/A code sequence has a repetition period of 1 ms, thus

15 CHAPTER 3. PRINCIPLES OF GLOBAL NAVIGATION SATELLITE 16 SYSTEMS L2 signal BPSK X 120 modulator

BPSK L1 signal modulator X 154 ∑ BPSK 90° modulator

P code adder Limiter generator

f0=10.23 MHz C/A code adder generator

Data generator

Figure 3.1: Generation of GPS signals on satellites

its chipping rate is 1.023 MHz. By contrast, the P code is a longer sequence with about 2.35 × 104 chips, giving a chipping rate of 10.23 MHz. The C/A code is only modulated onto the L1 carrier, while the P code is modulated onto both the L1 and the L2 carriers. The Gold codes are chosen as spreading sequences for the GPS signals because they have correlation properties suitable for code division multiple access implementation, namely, all the C/A codes are nearly uncorrelated with each other, and all C/A codes are nearly uncorrelated with themselves, except for zero lag. This is the basis for the detection of the signal from individual satellites in the combined received signal in the same frequency interval, which is achieved by correlators in the receiver. Navigation data are modulated on every 20 complete C/A codes, thus having a bit rate of 50 bits per second. The navigation data contain satellite ephemeris, to be more exact, satellite clock and health data, satellite ephemeris data as well as support data. The navigation data have a bit rate of 50 bps. Its basic format is a 1500 bit long frame including 5 subframes, and each subframe has a length of 300 bits. Subframes 1, 2, and 3 are repeated in each frame, while subframes 4 and 5 have 25 versions. Since the bit rate is 50 bps, the transmission of a subframe lasts 6 s, thus one frame lasts 30 s, and one complete navigation message consists of 25 frames, taking 12.5 min. 3.2. FRONT END 17

Figure.3.1 presents the generation of GPS signals. The codes are combined with the navigation data through modulo-2 adders. The exclusive OR operation is used on binary sequences represented by 0 and 1, i.e. the codes and the navigation data. Then the combined signals are modulated onto the carrier signal using the binary phase shift keying (BPSK) method, where the phase of the carrier is instan- taneously shifted by 180◦ when a chip is changing. Note that there is a 90◦ phase shift between the two codes when they are modulated. The Doppler frequency shift results from the motion of the transmitter on a satellite relative to the GPS receiver. The Doppler frequency shift influences both the acqui- sition and tracking of the GPS signal in the receiver. The Doppler frequency shift on the L1 frequency can be large, the maximum is around ±5 kHz for a stationary GPS receiver, while approximately reach ±10 kHz for a moving GPS receiver with a high speed (Borre et al., 2007).

3.2 Front end

The front end is responsible for converting the satellite signals propagating through space as electromagnetic waves into a digital data stream to be used as an input to the software. The voltage induced in the antenna is very weak, and the frequency of the signal is too high for most conventional analog-to-digital converters (ADCs) to operate. In order to overcome this, the front end uses a set of amplifiers, mixers, filters and its own oscillator to downconvert the signal to an intermediate frequency, where it can be sampled with an appropriate automatic gain control. The front end used in the projects presented in Chapter 2 is the MAX2769 chip. It covers GPS, Glonass and Galileo navigation satellite systems on a single chip in a compact 5 mm ×5 mm, 28-pin thin quad flat no-leads (QFN) package. Incorpo- rated on the chip is the entire receiver chain, including a dual-input low noise ampli- fier (LNA) and mixer, followed by the filter, programmable gain amplifier (PGA), voltage controlled oscillator (VCO), fractional-N frequency synthesizer, crystal os- cillator, and a multibit ADC. The total cascaded noise figure of this receiver is as low as 1.4 dB. The chip offers high performance and flexibility at low cost. The same configuration was used in all the projects, with two bit sampling of the I channel (‘in phase’) at 8.192 Msamples/sec. The intermediate frequency is chosen such that L1 frequency maps to 2 MHz.

3.3 Software receiver operation

In a conventional GPS receiver, the digital signal processing starts with acquisition, followed by code and carrier tracking, then navigation data extraction, and finally position calculation. The acquisition step identifies all satellites visible to the user. If a satellite is visible, the Doppler frequency and the code phase of the satellite signal are determined during the acquisition. The carrier frequency of the satellite signal differs from its nominal value due to the relative motion of the GPS satellite CHAPTER 3. PRINCIPLES OF GLOBAL NAVIGATION SATELLITE 18 SYSTEMS and the receiver. The code phase refers to the point where the C/A code begins in the current data block. The acquisition uses the correlation properties of the GPS signal. Correlation of a local replica of a C/A code with incoming signal will only be large if a signal satellite with this code is present in the received signal, and if the code phase is correct. After the multiplication with the local code replica, the signal will contain the carrier, which can be removed by multiplying with a locally generated carrier wave. Only for the correct code phase and Doppler shift, will the correlation peak. If the peak exceeds a determined threshold, the satellite is acquired with the corresponding frequency and code phase. Once the presence of a satellite signal is established in the acquisition, tracking is used to refine the coarse values of the frequency and the code phase, as well as to keep track of these as they change over time. The tracking consists of two parts, code tracking and carrier frequency/ phase tracking. The code tracking is usually implemented as a delay lock loop (DLL) and the carrier tracking is often performed as a phase lock loop (PLL) (Borre et al., 2007). After the tracking, the C/A code and the carrier wave can be removed from the signal, with the navigation data bits left. When 30 s of data are read, the beginning of a subframe must be established to find the time when the data were transmitted from the satellite. The time of arrival is obtained through the code phase corre- sponding to the beginning of the subframe. Next pseudoranges are calculated based on the time of transmission from the satellite and the time when the signal arrives at the receiver. For realtime GPS solutions, as the time of transmission is found, the ephemeris data for the satellite can be decoded. Using the GPS for localization purposes on sub-orbital payloads presents a number of challenges. First of all, international regulations prevent conventional receivers from returning navigational solution for high altitude high speed units, and special permits are required for manufacturers of GPS units for space use. The real-time receiver approach as described above relies on receiving the sufficient ephemeris in- formation. Such ‘cold start’ can take about 2 minutes, which is too long in sounding rocket applications. Solutions to this exist, such as uploading up-to-date ephemeris prior to launch or having the receiver in operation through the launch with GPS signals reaching the antennas (which in itself can be difficult). These solutions complicate the implementation. Additional challenges are related to fast rotation and tumbling of the suborbital payloads. This results in signal drop-outs depending on the instantaneous antenna orientation with respect to the directions to the satellites. If the antenna is not collocated with the centre of mass, fast rotation results in fast varying Doppler shifts. Antenna rotation also produces phase wind-up. Storing the raw samples for post-flight analysis allows to address all these issues. Ephemeris of improved quality are available from the international GPS service for geodynamics (IGS) website (IGS, 2016), so even single code sequences can be used for navigation solution. Doppler tracking can be improved by using predicted satel- lite positions, and code tracking can be iteratively improved (which is not possible 3.4. NAVIGATIONAL SOLUTION 19 in a real time receiver).

3.4 Navigational solution

The observables from the GPS receiver, pseudoranges, are finally used to obtain navigation solution. In conventional real time receivers instantaneous solutions are filtered to improve the precision. In case when a postflight trajectory reconstruction is of interest, other methods can be applied to the complete set of the GPS raw data available from the flight. One commonly used method is the least squares optimization. It linearizes pseudorange equations, and iterates position solutions using gradients until satisfactory solutions are found. The pseudorange observation is,

i ∥ i − i∥ i ρk = xk x + cδt (3.1)

i where ρk is the pseudorange to the k:th satellite at a time instant of observation i, i equal to the multiplication of the signal transmission time and the light speed, xk is the satellite’s position at the moment of transmission, xi is the antenna’s position i at the moment of reception, δt is the receiver’s clock error. Linearization of Eq. (3.1) is based on Taylor expansion of the nonlinear item ∥ i − i∥ i i i xk x at a reference position x0. Let ∆x denotes increments of x0, then a linear least squares problem A∆xi = B has the solution ∆xi = (AT A)−1AT B. i i i Hence, the position x = x0 + ∆x . This process is iterated until the difference between two iterated results becomes very small. To improve navigation precision, Doppler frequency shifts can be used as observ- ables also, c xi − xi dδi f i = −(vi − vi) k + c t (3.2) k k ∥ i − i∥ fL1 xk x dt i i where fk is the carrier Doppler shift of the k:th satellite at observation i, vk is the satellite’s velocity and vi is the antenna’s velocity. Similarly, Eq. (3.2) can be linearized and combined with Eq. (3.1) to solve for navigational solutions.

Chapter 4

Attitude kinematics and dynamics

Apart from the trajectory reconstruction, the attitude reconstruction is also in- cluded in this thesis work. First, the attitude dynamics and kinematics shall be presented. Before the attitude motion is modelled, the attitude or orientation of a rigid body needs to be described. In order to describe the attitude, several approaches are proposed (Schaub and Junkins, 2009). The old and classical ones are direction cosine matrix, Euler angles, and quaternions. More recent ones are classical Ro- drigues parameters and modified Rodrigues parameters. There are, of course, other parameters, which are not widely used. The direction cosine matrix (DCM) takes advantage of displacements of body-fixed referenced frames, containing 9 elements. It is highly redundant, as the minimal set of attitude coordinates only requires 3 elements. However, the direction cosine matrix is very useful, which is often employed combining other description meth- ods. The Euler angles only desire 3 elements to describe the attitude, consequently, they are the minimal set. Unfortunately, any minimal set of attitude description will contain at least one singularity, where at least two coordinates are undefined or not unique. For the Euler angles, a geometric singularity can occur when an angle reaches 90◦. Yet, the Euler angles are the most commonly used sets of attitude parameters by virtue of their simplicity and visualization. The quaternions consist of 4 elements, i.e. a redundant set. In addition to elimina- tion of the singularity, their main advantage is computational efficiency, as trigono- metric functions are removed. Due to redundancy, the criterion that the magnitude of a set of quaternions equals one needs to be satisfied. At present, the quaternions are very widely adopted. Both the Rodrigues parameters are made up of 3 elements. The classical Rodrigues parameters expand the nonsingular range from 90 degrees to 180 degrees, while the modified Rodrigues parameters expand this range to 360 degrees. Nowadays, the modified Rodrigues parameters are employed by many researchers, examples

21 22 CHAPTER 4. ATTITUDE KINEMATICS AND DYNAMICS such as Karlgaard and Schaub (2009); Vittaldev et al. (2012); Zhang et al. (2013); Ventura et al. (2015); Garcia et al. (2016). The Euler angles and the quaternions are used in this thesis.

4.1 Kinematics

Euler angles and its kinematics The Euler angles describe the attitude of a body-fixed coordinate frame B with respect to another reference frame N by means of three successive rotation angles, Fig. 4.1, (Schaub and Junkins, 2009) about the sequentially displaced body-fixed axes.

1

1 1 1 3 2 2 2

2 3 3 3 (a) (d)

1

1 1

2 1 2 2 2

3 3 3 3

(b) (c)

Figure 4.1: Rotation in sequence of 321 Euler angles

If the rotation of the B frame relative to the N frame is around x axis, the rotation matrix is   1 0 0   Cx(θ) = 0 cos θ sin θ (4.1) 0 − sin θ cos θ 4.1. KINEMATICS 23

If the rotation is around y axis, the rotation matrix is   cos θ 0 − sin θ   Cy(θ) = 0 1 0 (4.2) sin θ 0 cos θ

Similarly, if the rotation is around z axis, the rotation matrix is   cos θ sin θ 0   Cz(θ) = − sin θ cos θ 0 (4.3) 0 0 1

If the rotation sequence is z, y, x axes with angles of θ1, θ2, θ3, here the subscripts mean the order. These angles are called 321 Euler angles, then the whole transfor- mation matrix (or direction cosine matrix, DCM) from the body-fixed frame to the reference frame is CBN = Cx(θ3)Cy(θ2)Cz(θ1). That is,   cθ2cθ1 cθ2sθ1 −sθ2   CBN = sθ3sθ2cθ1 − cθ3sθ1 sθ3sθ2sθ1 + cθ3cθ1 sθ3cθ2 (4.4) cθ3sθ2cθ1 + sθ3sθ1 cθ3sθ2sθ1 − sθ3cθ1 cθ3cθ2 where s, c mean sin, cos, respectively. According to the inverse transformation of the DCM C, the Euler angles can be calculated. They are the yaw angle ψ which rotates about z axis, the pitch angle θ that revolves around y axis, as well as the roll angle ϕ rotating around x axis. The formulas are below ( ) −1 C12 ψ = θ1 = tan (4.5a) C11 −1 θ = θ2 = − sin (C13) (4.5b) ( ) −1 C23 ϕ = θ3 = tan (4.5c) C33 Note that the sequence of rotation is important here. For instance, three continuous rotations in terms of 321 Euler angles do not result in the same transformation matrix or orientation as the sequence of 313 Euler angles. As to the geometrical singularity (Schaub and Junkins, 2009), for 321 Euler angles, when the pitch angle reaches ±90◦, it does not matter if ψ = 5◦ and ϕ = 10◦ or ψ = 10◦ and ϕ = 5◦. Only the sum ψ+ϕ is unique in this case. This means that the 321 Euler angles [5, 90, 10] and [10, 90, 5] denote the same attitude. This geometric singularity also exhibits the mathematical singularity of the kinetic equations of the corresponding Euler angles. As the body-fixed frame moves relative to the reference frame, an angular velocity vector ω is derived (Schaub and Junkins, 2009). This vector is written in the body frame as ′′ ′′ ′′ ω = ωxb1 + ωyb2 + ωzb3 (4.6) 24 CHAPTER 4. ATTITUDE KINEMATICS AND DYNAMICS

From Fig. 4.1, the rotation of the B frame can also be expressed in terms of the 321 Euler angles ˙ ˙ ′ ˙ ′′ ω = ψn3 + θb2 + ϕb1 (4.7) ′ The unit vector b2 is the direction of the body-fixed axis as illustrated in Fig. 4.1(c). Based on geometry, ′ ′′ − ′′ b2 = cos ϕb2 sin ϕb3 (4.8)

The transformation matrix in Eq.(4.4) can be used to express n3 in the body-fixed frame, − ′′ ′′ ′′ n3 = sin θb1 + sin ϕ cos θb2 + cos ϕ cos θb3 (4.9) Combining Eqs. (4.7)-(4.9) and then compare the resulting equation to Eq. (4.6), we can obtain       ˙ ωx − sin θ 0 1 ψ       ωy = sin ϕ cos θ cos ϕ 0 θ˙ (4.10) ωz cos ϕ cos θ − sin ϕ 0 ϕ˙ By means of inverse of Eq. (4.10), the kinetic differential equation of 321 Euler angles can be attained       ψ˙ 0 sin ϕ cos ϕ ω 1 x θ˙ =  0 cos ϕ cos θ − sin ϕ cos θ 0  ω  (4.11) cos θ y ϕ˙ cos θ sin ϕ sin θ cos ϕ sin θ ωz

From Eq. (4.11), whenever θ = ±90◦ for 321 Euler angles, in other words, cos θ = 0 as a denominator, then the kinematic equation will encounter a singularity.

Quaternions and its kinematics Quaternions are another very common set of attitude coordinates. They are well suitable to describe arbitrary and large rotations by virtue of their non-singularity and their computational efficiency. A set of quaternions q consists of 1 scalar and 1 vector of 3 components. It is defined in terms of a principal rotational vector e and a corresponding principal rotational angle Φ, which represent that a rigid body rotates an angle about a vector of a direction. That is,

q0 = cos Φ/2 (4.12a)

q1 = e1 sin Φ/2 (4.12b)

q2 = e2 sin Φ/2 (4.12c)

q3 = e3 sin Φ/2 (4.12d)

2 2 2 Since e1 + e2 + e3 = 1, the set of quaternions satisfies a constraint

2 2 2 2 q0 + q1 + q2 + q3 = 1 (4.13) 4.1. KINEMATICS 25

This constraint shows that a set of quaternions describes a four dimensional unit sphere. Given a certain attitude, the two sets (e, Φ) and (−e, −Φ) describe the same orientation, because of the non-uniqueness of the rotational direction. To make sure that the rotation is along the shortest path, namely, Φ ≤ 180◦, the component q0 must be non-negative. The transformation matrix in terms of the quaternions is given by Schaub and Junkins (2009),   2 2 − 2 − 2 − q0 + q1 q2 q3 2(q1q2 + q0q3) 2(q1q3 q0q2)  − 2 − 2 2 − 2  C = 2(q1q2 q0q3) q0 q1 + q2 q3 2(q2q3 + q0q1) (4.14) − 2 − 2 − 2 2 2(q1q3 + q0q2) 2(q2q3 q0q1) q0 q1 q2 + q3 Once this matrix is obtained from the quaternions, 321 Euler angles can be calcu- lated through Eq. (4.5) using this matrix. The quaternions can be found from the inverse transformation of the direction cosine matrix, 1√ q = ± C + C + C + 1 (4.15a) 0 2 11 22 33 C23 − C32 q1 = (4.15b) 4q0 C31 − C13 q2 = (4.15c) 4q0 C12 − C21 q3 = (4.15d) 4q0

The derivative of Eq.(4.15a), q˙0 is

C˙ 11 + C˙ 22 + C˙ 33 q˙0 = (4.16) 8q0

By using the formula C˙ = −ω × C for C˙ ii, (Schaub and Junkins, 2009), q˙0 can be written as ( ) 1 C23 − C32 C31 − C13 C12 − C21 q˙0 = − ωx − ωy − ωz (4.17) 2 4q0 4q0 4q0

By substituting Cij in Eqs. 4.15b-4.15d into Eq. 4.17, we can simplify q˙0 as 1 q˙ = (−q ω − q ω − q ω ) (4.18) 0 2 1 x 2 y 3 z

Through a similar derivation, we can obtain the expressions for q˙i, i = 1, 2, 3. As a consequence, the kinetic differential equation in terms of quaternions is       q˙0 0 −ωx −ωy −ωz q0       q˙1 1 ωx 0 ωz −ωy q1   =     (4.19) q˙2 2 ωy −ωz 0 ωx q2 q˙3 ωz ωy −ωx 0 q3 26 CHAPTER 4. ATTITUDE KINEMATICS AND DYNAMICS

4.2 Attitude dynamics

Angular momentum As a rigid body, the rotational dynamics of a small satellite about its mass center can be modelled by Euler’s equation (Schaub and Junkins, 2009),

H˙ = T (4.20) where H is the angular momentum, while T is the resultant torque.

Figure 4.2: Rigid body rotation

As shown in Fig. 4.2 (Schaub and Junkins, 2009), a rigid body with a body-fixed frame B rotates relative to a inertial reference frame N. Let Rc denote the mass center of the rigid body, and r be the position vector of an infinitesimal mass element dm to the mass center of the rigid body. From the definition of the angular momentum, the angular momentum Hc of the rigid body about its mass center is ∫

Hc = r × r˙ dm (4.21) B According to the transport theorem

Adv Bdv B = B + ω × v (4.22) dt dt B B we have N dr Bdr r˙ = = + ω × r (4.23) dt dt 4.2. ATTITUDE DYNAMICS 27 where ω is the angular velocity of the body-fixed frame B with respect to the inertial frame N. For a rigid body, Bdr/dt is 0, so that we can have

r˙ = ω × r (4.24)

Insert Eq. (4.24) into Eq. (4.21), and make use of the triple cross product

a × (b × c) = b(a · c) − c(a · b) (4.25) we derive ∫ ( ) × × Hc = r × (ω × r)dm = −r r ω (4.26) B where r× is the skew-symmetric matrix,   0 −rz ry ×   r = rz 0 −rx (4.27) −ry rx 0

Express r and ω in the B frame,

r = rxb1 + ryb2 + rzb3 (4.28)

ω = ωxb1 + ωyb2 + ωzb3 (4.29)

Hc = Hcxb1 + Hcyb2 + Hczb3 (4.30)

By substituting Eqs. (4.28)–(4.29) for corresponding items in Eq. (4.26), we can obtain       ∫ 2 2 − − Hcx ry + rz rxry rxrz ωx    − 2 2 −    Hc = Hcy = rxry rx + rz ryrz ωy dm (4.31) B − − 2 2 Hcz rxrz ryrz rx + ry ωz From Eq. (4.31), the inertia matrix including moments of and products of inertia about the mass center can be defined as   ∫ 2 2 − − ry + rz rxry rxrz B  − 2 2 −  Ic = rxry rx + rz ryrz dm (4.32) B − − 2 2 rxrz ryrz rx + ry

As the angular velocity does not change over the rigid body, it can be extracted outside the integral. In general, the dynamic different equation is built in the body-fixed frame, as a result, we can omit the superscript B. Then we can have the simple form of the angular momentum about the mass center,

Hc = Icω (4.33) 28 CHAPTER 4. ATTITUDE KINEMATICS AND DYNAMICS

4.3 Euler’s equation

Utilizing the transport theorem, the general Euler’s equation Eq. (4.20) can be written as BdH H˙ = c + ω × H = T (4.34) c dt c c By taking advantage of Eq. (4.33), the derivative of Hc seen from the B frame is BdH BdI Bdω c = ω + I (4.35) dt dt dt If I is constant in the body-fixed frame for a rigid body, as well as dω dω dω ω˙ = N = B + ω × ω = B (4.36) dt dt dt Equation (4.35) reduces to BdH c = Iω˙ (4.37) dt Insert Eqs.(4.21) and (4.37) into Eq. (4.34), which leads to the Euler’s equation of rigid body motion Iω˙ = −ω × Iω + T c (4.38) Via selecting a body-fixed frame which coincides with the principal body axes, such as to only keep the moments of inertia and remove products of inertia, the rotational equation can be expressed as

Ixxω˙ x = −(Izz − Iyy)ωyωz + Tx (4.39a)

Iyyω˙ y = −(Ixx − Izz)ωzωx + Ty (4.39b)

Izzω˙ z = −(Iyy − Ixx)ωxωy + Tz (4.39c) If the body is axi-symmetric and no external torques exist, then the rotational equations in Eqs. (4.39) become (Schaub and Junkins, 2009)

IT ω˙ x = −(Izz − IT )ωyωz (4.40a)

IT ω˙ y = −(Ixx − IT )ωzωx (4.40b)

Izzω˙ z = 0 (4.40c)

where the transverse inertia IT is given by

IT = Ixx = Iyy (4.41)

From Eq. (4.40c), we can know that ωz is constant. By differentiating Eq. (4.40a)– (4.40b), second order differential equations for ωx and ωy are obtained,

Izz − 2 2 ω¨x + ( 1) ωz ωx = 0 (4.42a) IT Izz − 2 2 ω¨y + ( 1) ωz ωy = 0 (4.42b) IT 4.3. EULER’S EQUATION 29

The solutions of ωx(t) and ωy(t) are given by

ωx(t) = A1 cos ωpt + B1 sin ωpt (4.43a)

ωy(t) = A2 cos ωpt + B2 sin ωpt (4.43b)

where ωp is defined as Izz ωp = ( − 1)ωz (4.44) IT

Let ω0 be the initial body angular velocity, then the constants A1 and A2 are,

A1 = ωx0 A2 = ωy0 (4.45)

Differentiating Eqs. (4.43a) and (4.43b) and substituting them into Eqs. (4.40a) and (4.40b), the constants B1 and B2 become,

B1 = −A2 B2 = A1 (4.46)

The solutions to the body angular velocity are given for this axi-symmetric, torque- free case through

− ωx(t) = ωx0 cos ωpt ωy0 sin ωpt (4.47a)

ωy(t) = ωy0 cos ωpt + ωx0 sin ωpt (4.47b)

ωz(t) = ωz0 (4.47c)

If the initial angular velocity coincides with the axis of symmetry, the attitude motion is pure spinning around the symmetric axis of the rigid body. This is be- cause that the initial angular momentum is aligned with the symmetric axis, and will remain the same. If the initial angular velocity does not coincide with the sym- metric axis, there are two scenarios. One is when the initial angular momentum is vertical, the attitude motion is called regular precession around the vertical angular momentum. The other one is when the initial angular momentum is tilting, the attitude motion is called nutation around the tilting angular momentum. The kinematic and dynamic equations of attitude have been established so far, they form the basis to study and estimate attitude motion.

Chapter 5

State estimation

In order to accomplish attitude reconstruction of small suborbital payloads, the least squares method and unscented Kalman filter (UKF) (Haykin, 2001) are em- ployed in this thesis.

5.1 Least squares optimization

The least squares method is widely used to estimate motion states, such as posi- tions and attitudes of objects of interest, (Li et al., 2011; Burton et al., 2014). The objective of optimization is to minimize the sum of the squares of residuals be- tween actual measurements from sensors and desired measurements from geometry and/or motion equations. Typically, there are two types of optimization applica- tions. The first type is to optimize a state vector at a single time instant using geometry based measurements. Examples of this are position solution by means of GPS pseudoranges, attitude determination through measurements of magnetome- ters and sun sensors. The second one is to optimize an initial state vector or all state vectors during whole motion using measurements propagated by the dynamic and/or kinematic system equations. In this thesis, the second type is studied. When the initial state is to be optimized, the objective function is

∑N ∥ − ∥2 min yk yˆk (5.1) x1 k=1 where x1 denotes the initial state vector. y contains the actual measurement, while yˆ is the desired measurement from the system equation. k denotes a sampling time instant, N denotes the number of samplings. For a nonlinear system, yˆ = h(x) (5.2) This objective function is subjected to the system equation x˙ = f(x, u) (5.3)

31 32 CHAPTER 5. STATE ESTIMATION where u denotes the system input, which can be an angular velocity or a torque. When all the state vectors are to be estimated, the objective function is

∑N ∥ − ∥2 min yk yˆk (5.4) x1,...xN k=1

At this moment, Eq. (5.3) is treated as a measurement equation, where u is seen as a measurement vector. To remove x˙ , the finite numeric differentiation is used,

x − x x˙ = k+1 k (5.5) k ∆t where ∆t is the sampling period. Note that the measurements from sensors can be used as not only the measurement equation, but also the system input. For example, angular velocities are used as the system input for the first type of application, while used as the measurement in the measurement equation for the second type. Considering that different measurements have different accuracies, the higher the accuracy is, the more reliable the measurement is. Hence, weights are assigned to each residual to make efficient use of reliable measurements. Namely, increase weights of reliable measurements, and decrease weights of less reliable measure- ments, such as to improve the accuracy of optimization. The weights can be set according to sensor uncertainties. During the iteration of optimization, the weights often need to be tuned according to residuals. Apart from the least squares optimization, Kalman filter (KF) and advanced filters based on the KF are common estimation approaches as well. The KF is efficient to deal with linear systems. For nonlinear systems, the UKF originating from KF has better performance than the KF. The UKF uses sample points produced by unscented transformation (UT) to represent the state vector (Haykin, 2001).

5.2 Unscented transformation

The UT is a method to convert a state vector in a nonlinear system to a set of selected sample points, called sigma points, and to calculate the statistics (mean and covariance) related to this state vector (Julier and Uhlmann, 1997). The sigma points can capture posterior mean and covariance precisely to the 2nd order (Tay- lor series expansion) for any nonlinearity, after they are propagated through the nonlinear system. Take into account a random state vector x of dimension L, mean x¯ and covariance P x, which drives a nonlinear function g = g(x). 2L + 1 sigma vectors Xi make up 5.3. UNSCENTED KALMAN FILTER 33 of a matrix X, which is used to compute the statistics of g. The sigma vectors are

X0 = x¯ (5.6a) (√ ) Xi = x¯ + (L + λ)P x i = 1, ..., L (5.6b) (√ )i Xi = x¯ − (L + λ)P x i = L + 1, ..., 2L (5.6c) i−L where λ = α2(L + κ) − L is a scaling parameter. α determines the spread of the sigma points around x¯ and is usually set as a small positive value, for example, ≤ ≤ −4 1 α 10 . κ is a( secondary√ scaling) parameter which is commonly set as 0 or 3 − L (Haykin, 2001). (L + λ)P x is the ith column of the matrix square root. i The sigma points are propagated through the nonlinear function,

Gi = g(Xi) (5.7) The mean and the covariance for g are approximated by weighted sample mean and covariance of the posterior sigma points, ∑2L ≈ m g¯ W0 Gi (5.8) i=0 ∑2L ≈ c − − T P g Wi (Gi g¯)(Gi g¯) (5.9) i=0 where Wi is the weight, m W0 = λ/(L + λ) (5.10a) c − 2 W0 = λ/(L + λ) + (1 α + β) (5.10b) m c Wi = Wi = 1/2(L + λ) i = 1, ..., 2L (5.10c) where β is used to incorporate prior knowledge of the distribution of x (for Gaussian distributions, β = 2 is optimal) (Haykin, 2001).

5.3 Unscented Kalman filter

For a nonlinear system, x˙ = F (x, u, v) (5.11) where x is the state vector, u denotes the system input, which can be an angular velocity or a torque, and v represents the process noise. The process noise can be called model uncertainties. The model uncertainties in- clude unmodelling errors, i.e. disturbance forces or torques, and parameter uncer- tainties, i.e. inaccurate inertia matrix in attitude dynamic equations. The measurement equation is, y = H(x, u, w) (5.12) 34 CHAPTER 5. STATE ESTIMATION where y denotes the measurement, w represents the measurement noise. The UKF makes use of UT on the basis of the KF. The KF algorithm includes a two-step process: time update and measurement update. In the time update step, the KF predicts the state vector according to the system equation. In the measurement step, the KF updates the state vector by using a weighted average between the state prediction and the measurement update. It is recursive, · − xˆk = (prediction of xk) + Kk [yk (prediction of yk)] (5.13) where xˆ denotes the estimate of x, k ∈ 1, ..., ∞ represents each time instant, Kk is the gain matrix. When a process noise v and a measurement noise w are not additive, the state random vector at each time instant should be redefined as the a T T T T concatenation of an original state and noises: xk = [xk , vk , wk ] . Equation (5.6) are applied to the new augmented state vector to compute the corresponding sigma a matrix Xk. Assume the noises are white noise with zero mean, the process noise has variance Q, and the measurement noise has variance R. The UKF algorithm is as follows. Initialize with:

xˆ0 = E[x0] (5.14) T P 0 = E[(x0 − xˆ0)(x0 − xˆ0) ] (5.15) xˆa = E[xa] = [xˆT 0 0]T (5.16) 0 0 0   P 0 0 0 a a − a a − a T   P 0 = E[(x0 xˆ0)(x0 xˆ0) ] = 0 Q 0 (5.17) 0 0 R where E denotes expectation of a random variable. Sigma points: [ √ √ ] a a a a a − a Xk−1 = xˆk−1 xˆk−1 + c P k−1 xˆk−1 c P k−1 (5.18) √ where c = L + λ, L is the dimension of the augmented state now. Xa = [(Xx)T (Xv)T (Xw)T ]T . Time update:

x x v Xk|k−1 = F (Xk−1, uk−1, Xk−1) (5.19) ∑2L − m x xˆk = Wi Xi,k|k−1 (5.20) i=0 2L − ∑ ˆ c x − − x − − T P k = Wi [Xi,k|k−1 xˆk ][Xi,k|k−1 xˆk ] (5.21) i=0 x w Y k|k−1 = H(Xk−1, uk−1, Xk−1) (5.22) ∑2L − m yˆk = Wi Y i,k|k−1 (5.23) i=0 5.3. UNSCENTED KALMAN FILTER 35

Measurement update:

∑2L c − − T | − − ˆ | − − ˆ P ykyk = Wi [Y i,k k 1 yk ][Y i,k k 1 yk ] (5.24) i=0 ∑2L c − − T | − − ˆ | − − ˆ P xkyk = Wi [Xi,k k 1 xk ][Y i,k k 1 yk ] (5.25) i=0 K = P P −1 (5.26) k xkyk ykyk − − − xˆk = xˆk + Kk(yk yˆk ) (5.27) − ˆ − T P k = P k KkP ykyk Kk (5.28)

If the process noise and the measurement noise are additive, i.e.

x˙ = F (x, u) + v (5.29)

y = H(x, u) + w (5.30) then we do not need to augment the state vector, thus the computation effort can be reduced. A simplified UKF algorithm is as follows, Initialize with:

xˆ0 = E[x0] (5.31) T P 0 = E[(x0 − xˆ0)(x0 − xˆ0) ] (5.32)

Sigma points: [ √ √ ] Xk−1 = xˆk−1 xˆk−1 + c P k−1 xˆk−1 − c P k−1 (5.33)

Time update:

x Xk|k−1 = F (Xk−1, uk−1) (5.34) ∑2L − m xˆk = Wi Xi,k|k−1 (5.35) i=0 2L − ∑ ˆ c − − − − T P k = Wi [Xi,k|k−1 xˆk ][Xi,k|k−1 xˆk ] + Q (5.36) i=0 x Y k|k−1 = H(Xk−1, uk−1) (5.37) ∑2L − m yˆk = Wi Y i,k|k−1 (5.38) i=0 36 CHAPTER 5. STATE ESTIMATION

Measurement update:

∑2L c − − T | − − ˆ | − − ˆ P ykyk = Wi [Y i,k k 1 yk ][Y i,k k 1 yk ] + R (5.39) i=0 ∑2L c − − T | − − ˆ | − − ˆ P xkyk = Wi [Xi,k k 1 xk ][Y i,k k 1 yk ] (5.40) i=0 K = P P −1 (5.41) k xkyk ykyk − − − xˆk = xˆk + Kk(yk yˆk ) (5.42) − ˆ − T P k = P k KkP ykyk Kk (5.43) Note that smaller Q means that the system equation is more reliable, while smaller R means that the measurement is more reliable. They are similar to the function of weights in the least squares optimization in this sense. The covariance matrixes P 0 and Q can be set according to assumptions based on the system state, for example, 1% of the initial state. The covariance R can be set according to sensor noises. They often need to be tuned until good estimates are found. Chapter 6

Results and conclusions

6.1 Paper 1

This paper presents a global optimization method where a low cost GPS front- end can be used for post-flight trajectory reconstruction for suborbital free-flyers. The method has been tested by applying it to data from a sounding rocket flight, successfully reconstructing trajectories with a high level of accuracy. Based on the GPS solutions, the accelerations and the wind up rates can be derived, which match the observables from the sensors. A comparison is given between the GPS software derived wind up rates and the x-axis spin rates measured by the onboard angular rate sensor. As the angular rate sensor saturates at around ±7 Hz, data are saturated in certain ranges. The generally good agreement, especially for FFU C, confirms that GPS can retrieve spin rates. Data from the onboard angular rate sensor could be used to constrain the wind up. As for the effect of parameters in the least squares formulation, setting the param- eters that control the weighting, the rejection threshold and the exclusion range, is a matter of ensuring that unreliable observations are rejected without losing too many reliable observations. For the code delays, this means to exclude observa- tions where the signal strength is too low to perform reliable curve fitting. For the Doppler observations, this means to exclude observations where the PLL is not tracking. Since the curve fitting is used to measure the code delays directly, instead of rely- ing on the output of the DLL, the process is essentially memoryless with respect to small errors in the DLL tracking. Thus code delay observations can be used almost immediately after a signal dropout. The Doppler observations on the other hand are taken from the PLL, which is not memoryless. After a signal dropout, the PLL needs some time to lock on to the carrier again.

37 38 CHAPTER 6. RESULTS AND CONCLUSIONS

6.2 Paper 2

This paper presents the active falling sphere technique using a low-cost GPS re- ceiver to measure atmospheric densities, temperatures, and horizontal wind speeds. Densities, temperatures, and horizontal wind speeds below 80 km were obtained, and they compare well with the independent data. As the altitude goes down, the accuracy becomes higher. Densities below 70 km, temperatures below 50 km, and wind speeds below 45 km are obtained with high accuracy. In order to make the calculated densities valid, the sphere’s velocities and accelerations should be large enough to reduce the effect of the wind speed and the acceleration uncertainty. To make the results as accurate as possible, the attitude motion and the resulting Magnus lift (Seifert, 2012; Volkov, 2009) must be included, since the sphere rotated over the flight time. The density is affected by the total acceleration from numeric differentiation of the GPS velocity, the velocity of the sphere relative to the air flow, the drag coefficient and other factors such as mass, and cross-section area. The mass and the size of the sphere are available with rather high precision, and would only introduce a systematic bias to the density. The accuracy of the acceleration is influenced by GPS measurements and process- ing, and estimation of the acceleration. In the case of a small and rigid sphere the rotational motion becomes important, which causes extra accelerations to the center of mass. With the presented technique, getting acceleration accuracy below 0.1 ms−2 is challenging. Part of this inaccuracy seems to be related to filtering the oscillation. A solution with full attitude reconstruction of the sphere would allow to compensate for some of this inaccuracy by correcting for the displacement of the antenna phase centre and the centre of mass. The density determination is also affected by the drag coefficient. While the de- pendence of the drag coefficient on the flow parameters is well behaved in the supersonic regime (in our case, corresponding to altitudes above 30 km), it exhibits fast variations in the dense subsonic flows of high Reynolds number. This is seen both as the sharp decrease from almost 1 to 0.5 over the range of just a few km and the irregular variations around 0.5 for altitudes below 25 km. This sensitivity of the drag coefficients on the parameters introduces systematic errors, which might be responsible for the positive deviation of the density ratio at 25-28 km, and lead to temperature oscillations in this area. Temperature estimates agree reasonably well with independent data below 50 km, while they exhibit larger variations above that. This is due to a less reliable density reconstruction. Also, the systematic effect of the reference altitude temperature taken from the model is the highest at the top altitudes, becoming negligible lower down in the atmosphere. The wind speed is affected by the drag acceleration, while the drag acceleration de- pends on the Magnus lift in the aerodynamic force. The Magnus lift is also related to the attitude motion, and must be accounted for to determine the wind speed at high precision. 6.3. PAPER 3 39

6.3 Paper 3

This paper presents a global optimization method to reconstruct attitudes of sub- orbital small spacecrafts based on real flight data. Yaw-pitch-roll Euler angles were employed to describe the attitude because of their straightforward physical mean- ing. A purely kinematic model was used in order to avoid modelling the complex aerodynamic torques. Here, the least squares method is a sort of global optimiza- tion, with all the attitudes over the timeline derived at one time. Though this optimization requires an appropriate initial guess, the optimized attitudes gener- ate smaller residuals than the filtered attitudes from the UKF, and contain higher accuracy. The reconstruction concludes that because of the aerodynamic torques, the attitude motion of the FFU is a complex wobbling. The covariance matrix of the state error, process noise, and measurement noise for the UKF and weights for the global optimization were initially set according to the accuracy of sensors or assumption of common sense on accuracy, then by trial-and-error. To obtain good estimation, they were tuned a few times. The regularity obtained by tuning the three covariance matrixes is that the magnetic residuals become smaller as the covariance matrix of the process noise is larger, but the standard deviations of the state errors become larger and even show a trend of divergence. It is worth pointing out that for the Z component, the optimized residuals of both the magnetic field and the angular velocity exhibit a non-zero mean. This is likely due to the drift of the rate gyro, though it is not evident over a short period of time.

6.4 Paper 4

This paper describes modelling regular precession as well as superposition of pre- cession and nutation for a free flying and axis-symmetric sphere exposed to vertical aerodynamic drag. For these two types of motion to occur, the initial angular mo- mentum and the aerodynamic torque must satisfy some certain relations. The initial configuration for the regular precession is that the initial angular mo- mentum is perpendicular to the aerodynamic torque, and the spinning angular mo- mentum that precesses around the vertical direction coincides with the symmetric axis. During the regular precession, the angular momentum is kept perpendicular to the torque. The superposition motion can be decomposed as torque-induced precession and torque-free nutation. The initial configuration for the superposition is that the initial angular momentum is perpendicular to the aerodynamic torque, yet the spinning angular momentum that precesses around the vertical direction does not coincide with the symmetric axis. As time goes, the precession motion is not regu- lar, since the nutation motion changes the torque. It is hard to obtain perfect regular precession or superposition motion due to the 40 CHAPTER 6. RESULTS AND CONCLUSIONS strict conditions. Generally speaking, if the precession speed is small enough, the attitude motion will approximate the regular precession or the superposition motion very well. This so called ‘small enough’ differs for different sets of system parame- ters and torques, namely, the moment of inertia, the lever arm and the drag. Simulations verify the analytical model. For scenarios of regular precession, the ending point of the angular velocity move along a circle. And its magnitude is constant, its vertical component is fixed. In addition, the angular velocity of pre- cession are constant. For the superposition motion, the total angular momentum is not always perpendicular to the torque. The flight data are analyzed based on the derived analytical model. In the down- leg, the motion can be seen as regular precession over the beginning 30 s, because of small drag accelerations, then quasi-regular with the drag increasing, as well as chaotic for most of flight time due to large drag accelerations. Bibliography

J. Asplund. 2016. Design and implementation of a sounding-rocket electric-field instrument. Master thesis, KTH Royal Institute of Technology, Stockholm, Swe- den. M. T. Bordogna, L. Fidjeland, M. Fjällid, M. Galrinho, A. Haponen, A. Hou, N. Ivchenko, D. Kristmundsson, Ó. L. Lárusdóttir, M. Lejon, M. Lindh, E. Lozano, P. Magnusson, A. Myleus, B. D. Oakes, and G. Tibert. 2013. Muscat experiment: Active free falling units for in situ measurements of temperature and density in the middle atmosphere. In 21st ESA Symposium European Rocket & Balloon Programmes and Related Research, pages 575–582, Thun, Swizerland. K. Borre, D. M. Akos, N. Bertelsen, P. Rinder, and S. H. Jensen. 2007. A Software- defined GPS and Galileo Receiver. Birkhäuser Boston. R. Burton et al. 2014. Dual attitude and parameter estimation of passively mag- netically stabilized nano satellites. Acta Astronautica, 94:145–158. R. V. Garcia, N. de Freitas Oliveira Matos, H. K. Kuga, and M. C. Zanardi. 2016. Unscented kalman filter for spacecraft attitude estimation using modified ro- drigues parameters and real data. Computational and Applied Mathematics, 35: 835–846. S. Haykin, editor. 2001. Kalman Filtering and Neural Networks. John Wiley & Sons, McMaster University, Hamilton, Ontario, . J. Hedin, J. Gumbel, and M. Rapp. 2007. On the efficiency of rocket-borne particle detection in the mesosphere. Atmos. Chem. Phys., 7:3701–3711. IGS. 2016. Index of /gps/products. ftp://cddis.gsfc.nasa.gov/gps/products. N. Ivchenko and G. Tibert. 2013. Sounding rocket experiments with ejectable payloads at kth. In 21st ESA Symposium on European Rocket and Balloon Pro- grammes and Related Research, pages 503–510, Thun, Switzerland, June 2013. S. J. Julier and J. K. Uhlmann. 1997. A new extension of the kalman filter to non- linear systems. In Proceedings of AeroSense: The 11th International Symposium on Aerospace/Defence Sensing, Simulation and Controls.

41 42 BIBLIOGRAPHY

C. Karlgaard and H. Schaub. 2009. Nonsigular attitude filtering using modified rodrigues. The Journal of the Astronautical Sciences, 57:777–791.

L. Li, J. Zhong, and M. Zhao. 2011. Doppler-aided GNSS position estimation with weighted least squares. IEEE Transactions on Vehicular Technology, 60: 3615–3624. K. A. Lynch, L. J. Gelinas, M. C. Kelley, Collins R. L., M. Widholm, D. Rau, E. MacDonald, Y. Liu, J. Ulwick, and P. Mace. 2005. Multiple sounding rocket observations of charged dust in the polar winter mesosphere. J. Geophys. Res., 110:A03302. M. Rapp, I. Strelnikova, B. Strelnikov, P. Hoffmann, Friedrich M., J. Gumbel, L. Megner, U.-P. Hoppe, S. Robertson, S. Knappmiller, M. Wolff, and D. R. Marsh. 2010. Rocket-borne in situ measurements of meteor smoke: Charging properties and implications for seasonal variation. J. Geophys. Res., 115:D00I16. W. Reid, P. Achtert, N. Ivchenko, P. Magnusson, T. Kuremyr, V. Shepenkov, and G. Tibert. 2013. Technical note: A novel rocket-based in situ collection technique for mesospheric and stratospheric aerosol particles. Atmospheric Measurement Techniques, 6:777–785. H. Schaub and J. L. Junkins. 2009. Analytical Mechanics of Space Systems. AIAA.

J. Seifert. 2012. A review of the Magnus effect in aeronautics. Progress in Aerospace Sciences, 55:17–45. J. Ventura, M. Romano, and U. Walter. 2015. Performance evaluation of the inverse dynamics method for optimal spacecraft reorientation. Acta Astronautica, 110: 266–278. V. Vittaldev, E. Mooij, and M. C. Naeije. 2012. Unified state modal theory and application in astrodynamics. Celestial Mechanics and Dynamical Astronomy, 112:253–282. A. N. Volkov. 2009. Aerodynamic coefficients of a spinning sphere in a rarefied-gas flow. Fluid Dyn., 44:141–157. B. Zhang, K. Liu, and J. Xiang. 2013. A stabilized optimal nonlinear feedback control for satellite attitude tracking. Aerospace Science and Technology, 27: 17–24.

Y. Zheng, K. A. Lynch, M. Boehm, R. Goldstein, H. Javadi, P. Schuck, R. L. Arnoldy, and P. M. Kintner. 2003. Multipoint measurements of field-aligned current density in the auroral zone. J. Geophys. Res., 108(A5):1217.