# NASA SBIR Phase III: Low Energy Mission Planning

Hello PSS fans! This is Charles Swanson, recently minted doctor of plasma physics and PSS’s newest employee. It’s my distinct pleasure to discuss our most recent NASA contract: A Phase III SBIR to integrate our Low Energy Mission Planning Toolbox (LEMPT) into NASA’s open source Orbit Determination Toolbox (ODTBX).

Have you read about the kinds of maneuvers conducted by Hiten and AsiaSat 3 that allowed them to reach orbits that would seemingly be outside their Delta-V budgets? Have you always wondered how one goes about planning such maneuvers?

What about the Lunar Gateway from which NASA plans to stage missions to the surface of the Moon in the coming decades? What kinds of clever orbital tricks can we use to get to, from, and about the Moon with the minimum possible fuel?

That’s what LEMPT is for. LEMPT is a suite of tools written in MATLAB for the planning of low energy missions, the kinds of missions that loop way outside the target orbit of the Moon and deep into chaotic regions of the gravitational landscape. Here’s an example:

This LEO to Lunar Orbit mission takes just one impulsive burn of 2.8 km/s. It loops way outside the Moon and back in for a ballistic capture.

To go from LEO to a low lunar orbit usually takes almost 4 km/s of Delta-V. The maneuver depicted takes only 2.8 km/s. This is the kind of planning capability that NASA would like for their ODTBX. From now until December, we’ll be integrating the LEMPT into ODTBX, where it will help NASA mission planners evaluate all of their options along the trade-off of mission time and Delta-V.

The orbit above doesn’t look anything like the Keplerian ellipse that we know and love. That’s because this is a four-body system, with the Sun, Earth, Moon, and spacecraft all interacting gravitationally. Even the three-body system is famously chaotic: here are two examples of the kind of distinctly weird-looking orbits you can get:

This is a periodic orbit in the Sun-Earth-Spacecraft system. Periodic orbits are rare in such systems.

This orbit starts with only 0.01% more velocity than the periodic orbit but escapes the Earth entirely. This is an example of chaos.

It’s this chaos that the LEMPT leverages to plan exotic and efficient maneuvers.

# Comparing disturbance models

A customer recently asked us for help comparing the disturbance analysis available in the CubeSat Toolbox with the full model in SCT Professional, for a 3U CubeSat. That is, to compare CubeSatDisturbanceAnalysis to Disturbances. The CubeSat Toolbox uses a simplified model of the spacecraft geometry as a single set of fixed areas, nominally for a rectangular prism. The full model in SCT Pro allows for articulated and rotating bodies built of individual components. The CubeSat Toolbox has a subset of the environment and disturbance functions in Pro but includes drag and optical disturbances in Earth orbit. Given enough options for the two models it should be possible to get the exact same results. We will sketch out our process and discoveries in this post.

Creating a model of a 3U CubeSat in Pro was the easy part, as it is just a single box component, and verifying that the areas match those from CubeSatFaces is accomplished by a trivial command-line printout. Comparing the results of the optical and drag analysis is much more complex as there are so many variables:

• Atmosphere model: exponential, scale height, J70
• Solar flux model
• Earth albedo model
• Earth radiation model
• Satellite optical properties (specular, diffuse, absorptive)
• Attitude pointing (LVLH vs. ECI)

In order to compare the results, we had to call both disturbance models in a script and generate plots overlaying the resulting forces and torques. Here is the code defining the model for SCT Pro.

``` m = CreateComponent( 'make', 'box', 'x', 0.1, 'y', 0.1, 'z', 0.3,... 'name', 'Core', 'body', 1, 'mass', mass, ... 'faceColor', 'gold foil', 'emissivity', thermal.emissivity,... 'absorptivity', thermal.absorptivity, 'sigmaT', optical.sigmaT,... 'sigmaA', optical.sigmaA, 'sigmaD', optical.sigmaD, 'sigmaS', optical.sigmaS,... 'inside', 0); BuildCADModel( 'add component', m ); ```

You can see the thermal and optical properties that must be specified as well as the mass and dimensions. The spacecraft is inertially fixed and put into an equatorial orbit, so we would expect zero drag along the z axis and the x/y forces to oscillate at orbit rate. Then to call the disturbance model we generate a low Earth orbit, get the Earth environment and run the analysis, like so:

``` [r,v] = RVOrbGen(el,t); e = EarthEnvironment( r, v, jD, d ); hD = Disturbances( 'init', g, e ); [fD,tD] = Disturbances( 'run', g, e, hD ); ```

The EarthEnvironment function is where the guts of the space environment modeling occurs. This includes specifying albedo and radiation constants, calculating the atmospheric density over the orbit, computing the sun vector and solar flux magnitude, checking for eclipses, computing the Earth magnetic field, and correcting the inertial velocity for the rotation of the atmosphere for drag calculations. In the CubeSat toolbox, this data is computed inside the dynamical model, RHSCubeSat. The same steps of creating the model and calling the disturbance function are shown below.

``` c = RHSCubeSat; c.mass = 3; c.inertia = InertiaCubeSat( '3U', c.mass ); [a,n,rho] = CubeSatFaces('3U',1); c.surfData.nFace = n; c.surfData.area = a; c.surfData.rFace = rho; for k = 1:6 % Radiation coefficients [absorbed; specular; diffuse] c.surfData.sigma(:,k) = [optical.sigmaA;optical.sigmaS;optical.sigmaD]; end c.atm = []; q = QZero*ones(1,size(r,2)); [tC, fC, h, hECI, fr, tq] = CubeSatDisturbanceAnalysis( c, q, r, v, jD ); ```

Let’s look at drag first, as it proved to be the easiest to verify. The primary difference between the CubeSat model and full disturbance model for drag initially was the atmosphere model itself: CubeSat uses the Jacchia 1970 model by default, while EarthEnvironment specifies a scale height atmosphere. The Jacchia 1970 model accounts for changes in density with the time of day, resulting in an orbit rate periodicity; however it is computationally more intensive and not needed in preliminary analysis. The scale heights model depends only on altitude and is very quick. The CubeSat dynamic model already had an option to switch to the scale height atmosphere if desired, so we added that same option to the CubeSat disturbance analysis function. This promptly resulted in a close result between the models for the drag force.

Comparison of the drag force between the CubeSat Toolbox and SCT Pro disturbance models for a 3U CubeSat

A slight variation remains due to a difference in the transformation between the inertial frame and Earth-fixed frame between the two models. This transformation is used to account for the rotation of Earth’s atmosphere, as drag depends on the relative velocity between the surface and the air. CubeSat uses a fast almanac function, ECIToEF, to compute this matrix for a given Julian date. This model accounts for nutation but not as accurately as TruEarth does in Pro. The EarthEnvironment function in Pro, however, uses a simpler transformation using Earth’s rotational rate about the inertial z-axis, ignoring nutation. This accounts for the nonzero Z force in the CubeSat output, which can be seen to be four orders of magnitude less than the X/Y forces. Both approaches are valid for a preliminary analysis so we accept this small remaining difference.

Producing an equally close comparison for the optical forces unearthed a few bugs in the CubeSat version as well as differences in fidelity that are intentional. First, recall that there are three main contributions to optical forces in Earth orbit: solar flux; Earth albedo – that is, reflected flux; and Earth infrared radiation. The fluxes can be modeled simply as constants, or at higher fidelity by accounting for distance from the radiating body. The full disturbance model accounts for the change in solar flux over the year as the Earth moves in its orbit, which amounts to about 100 W/m2 or 7% of the average flux. The CubeSat environment model was not doing this, but since it was already calling the sun vector function which calculates the needed data, we decided to add it. The sun vector itself can be modeled a number of ways, with CubeSat providing a low fidelity almanac version and Pro a higher fidelity almanac option as well as an option for JPL ephemerides.

Making a temporary change in CubeSat to use the higher fidelity sun almanac provided closer results, but there were still differences in the optical forces. A check on the optical coefficients revealed that Disturbances assumed 100% diffuse reflection for planetary infrared radiation while the CubeSat version assumed 100% absorption. This was result of a misunderstanding of the model when the CubeSat version was created. The intention of the model is to assume 100% absorption, but the radiation has to be reemitted or the temperature of the body would increase to infinity. Hence the diffuse coefficient in the Pro model. So, the CubeSat version’s coefficients were corrected to match. This improved the agreement between the models but still not completely.

Further investigation uncovered a bug in the calculation of the planetary radiation flux and Earth albedo flux. We call this a copy/paste bug, as the distance scaling factor was in the code, but applied to the wrong variable when the CubeSat version was created from the Pro version – so the scaling was unitized out. Correctly applying the scale factor to the flux input (and not its unit vector) to the base solar force function, SolarF, resulted in exact agreement between the two models. The figure below shows the final differences with the CubeSat sun almanac function restored to its default value.

Comparison of the optical force between the simplified and full disturbance models for a 3U CubeSat

To summarize, we identified the following subtleties in making a direct comparison between these two disturbance models:

• Selecting the same atmosphere model, AtmDens2, for both cases
• Understanding the sun vector model in each case (SunV1 vs. SunV2)
• Adding the solar flux scaling with the Earth’s distance from the sun to the CubeSat model (1 line)
• Updating the optical coefficients for planetary radiation in the CubeSat model (to be diffuse)
• Correcting a bug in the scaling of the Earth albedo and radiation fluxes with altitude in CubeSat
• Accounting for Earth’s nutation in transforming velocity to the Earth-fixed frame

This provides a great illustration of how careful one needs to be in performing any disturbance analysis, as there are so many subleties in even simple models that must be recorded if results are to be replicated. Every constant, every scale factor, every coefficient, every source of ephemeris needs to be understood.

We were happy to provide the results of our analysis to our customer so that he could decide which models he wants to use in his analysis. This is an example of the technical support we can provide to all our SCT customers; if you have a question, just ask!

# Reaction Wheel Friction Models

Reaction wheels are used in many spacecraft for attitude control. A reaction wheel is a momentum exchange device because it controls the spacecraft by exchanging momentum with the rest of the spacecraft. Momentum is exchanged via a motor that is fixed to the spacecraft. As with all rotating parts it is subject to friction. Friction needs to be modeled as part of the design process.

The standard way to model friction is with three terms. One is damping which is proportional to wheel speed. The faster the wheel spins the more friction torque is produced. Ultimately, this limits the net control torque. At some speed the motor is just balancing the friction torque. The second component is Coulomb friction that is constant but flips signs when the wheel speed changes sign. the third is static friction. It is like Coulomb friction but only exists at zero speed.

An alternative friction model is known as the bristle friction model. This models friction as bristles that bend. It also has the same friction components described above but they are applied though the bristle state.

Both models can be made to produce similar results as shown in the following figure.

The static friction is clearly seen. The wheel speeds are nearly the same. The middle plot is of the bristle state. The problem with these models is when the torque is low and the wheel speed passes through zero. We then get limit cycling as shown below.

This is due to numerical error.

We can eliminate the limit cycling by using a very small integration time step with the bristle friction model. An alternative approach is to use the first model and multiply the sum of the static and Coulomb friction with a sigmoid, or s function.

The coefficient of the sigmoid function is beta. Very small betas remove the static friction, and all Coulomb friction, near zero speed. The large betas retain the form of the friction and eliminate the limit cycling!

These models can be found in the Spacecraft Control Toolbox 2015.1 . This particular script will be available in 2015.2 which will be released in July.

# Why Use Princeton Satellite Systems’ MATLAB Toolboxes?

Almost all aerospace organizations have extensive libraries of software for simulation, design and analysis. Why then should they use our MATLAB toolboxes?

I’ve been working in the aerospace business since 1979. My experience includes:

1. The Space Shuttle Orbiter Dynamics Analysis
2. The GPS IIR control system design
3. The Inmarsat 3 control system design
4. The GGS Polar Platform control system design
5. The Mars Observer delta-V control system
6. The Indostar-1 control system
7. The ATDRS momentum management system
8. The PRISMA formation flying safe mode guidance

# Simulating Magnetic Hysteresis Damping

CubeSats have caused a renewed interest in magnetic control of satellites, and passive hysteresis damping in particular. Modeling actual hysteresis rods on a satellite is not trivial, and generally requires empirical data on the properties of the rods selected. Our newest CubeSat simulation demonstrates damping using rods in LEO. A permanent magnet is modeled using a constant dipole moment, and we expect the satellite to align with the magnetic field and damp. We evaluate the results by plotting the angle between the dipole and the Earth’s magnetic field and the body rates.

First, let’s verify the magnetic hysteresis model in the toolbox using the bulk material properties in orbit. We use a dipole model of the Earth’s magnetic field. The nice hysteresis curves below confirms that we are computing the derivatives of the magnetic field correctly in the body frame, which requires careful accounting of rotating coordinates. Also we stay within the saturation limits which means our magnetic flux derivatives are correct too.

Hysteresis curves from simulating magnetic hysteresis in orbit

We will assume the rods are 1 mm radius and 95 mm length, with rods placed perpendicular to each other and the permanent magnet. Three rods are used per axis. The apparent rod parameters are taken from the literature. The actual rods will not reach saturation while in orbit, so we will see a minor loop.

Minor loops from damping rods using apparent properties

The rods produce only a small amount of damping per orbit, so we have to run for many orbits or days to see significant damping – in some passive satellites, the total time allotted for stabilization is two months! In this case we test the rods’ ability to damp the torque induced by turning on a torque rod with a dipole of 1 AM2 and allowing the CubeSat to align itself with the magnetic field, starting from LVLH pointing.

Damping in LEO using hysteresis rods

Simulating the rods is time-intensive, with a timestep of about 4 seconds required – which makes a simulation of several days on orbit take several minutes of computation. Once performance of the rods has been verified, a simple damping factor can be substituted.

This new simulation along with the functions for hysteresis rod dynamics will be in the new version of our CubeSat Toolbox, due for release in June!

References:

1. F. Santoni and M. Zelli, “Passive magnetic attitude stabilization of the UNISAT-4 micro satellite”, Acta Astronautica,65 (2009) pp. 792-803
2. J. Tellinen, “A Simple Scalar Model for Magnetic Hysteresis”, IEEE Transactions on Magnetics, Vol. 34, No. 4, July 1998
3. T. Flatley and D. Henretty, “A Magnetic Hysteresis Model”, N95-27801 (NASA Technical Repoets Server), 1995

# PSS MATLAB Toolbox Tutorial Videos

Over the summer we worked on developing some videos to help customers get started using our MATLAB products. Our MIT intern, James Slonaker, did a fabulous job! Come check out our Toolbox Tutorial Videos on our YouTube Channel!

# Asteroid Prospector Orbiting Apophis

Asteroid Prospector is a 6U CubeSat designed to survey asteroids. It uses a Busek Ion engine to spiral out of earth orbit and rendezvous with an asteroid. It then uses its reaction control thruster system, which employ ECAPS green propellant thrusters, to perform near-asteroid operations. Here is a picture of the spacecraft in circular orbit mode.

The simulation is running in our Simulation Framework. The graphical display uses our VisualCommander client on the Mac.

The flight software is implemented in our ControlDeck C++ class library. Both the simulation and control software are available as part of our Aero/Astro vehicle control products.

You can see a movie of the spacecraft on our YouTube channel: http://www.youtube.com/watch?v=ZvPqwFKGRKw

We presented our Asteroid Prospector mission concept on Tuesday Aug 13th, 2013  the Small Satellites Conference in Logan, Utah in Session VI: Strength in Numbers. A copy of our paper is available here.

# New PSS MATLAB Product – Core Control Toolbox

We have just released our new MATLAB product – the Core Control Toolbox (CCT). We created the Core Control Toolbox as a base product for those customers who may have interests outside of aircraft and spacecraft modeling and simulation. It features many of the general purpose functions found in our Spacecraft Control Toolbox. Like all our Toolbox products, CCT comes with complete source code. Users can view and modify any function in the toolbox to suit their particular needs. We’ve included a number of our filtering, graphics, mathematics, quaternion, robotics, and other general purpose functions.

Below one of our robotics functions is featured! The Selective Compliance Articulated Robot Arm (SCARA) is used in many industrial applications requiring assembly in a plane, like manufacturing a PC board.

The SCARA movie shows a SCARA robot following a straight line trajectory. The trajectory is computed by a dedicated SCARA inverse kinematics routine.

Check out what CCT and our other MATLAB toolboxes have to offer!
Core Control Toolbox
Aircraft Control Toolbox
CubeSat Toolbox
Spacecraft Control Toolbox