Hohmann Transfer Simulation with the Spacecraft Control Toolbox

Hohmann transfers are a well-known maneuver used to change the semi-major axis of an orbit. The Spacecraft Control Toolbox allows you to compute the required velocity changes, and integrate them into a full simulation.

In this demonstration, we create a 6U CubeSat that has 3 orthogonal reaction wheels and a single hydrazine thruster. The thruster is aligned with the body x-axis and must be aligned with the velocity vector to do the maneuver. An ideal Hohmann maneuver is done with impulsive burns at two points in the orbit. In reality, with a thruster, we have to do a finite burn.

The Hohmann transfer is computed with the following Spacecraft Control Toolbox code:

rI = [-7000;0;0];
vI = [0;-sqrt(mu/Mag(rI));0];
OrbMnvrHohmann(Mag(rI),rF);
[dV,tOF] = OrbMnvrHohmann(Mag(rI),rF);

The first time OrbMnvrHohmann is called, it generates the plot below of the planned Hohmann transfer. The function computes the delta-V and also the time of flight, which will be used to determine the start time of the second thruster burn.

We create a short script with numerical integration to implement the maneuver using a thruster. The burn durations are computed based on the thrust and the mass of the spacecraft. In this case, they are about three minutes long. The maneuver is quite small, so the mass change is not important. The attitude control system uses the PID3Axis function which is a general-purpose attitude control algorithm. The simulation is a for loop, shown below. The ECI vector for the burn is passed to the attitude control system, which updates every step of the simulation.

% Simulation loop
for k = 1:n

  % Update the controller
  dC.eci_vector = uBurn(:,kMnvr);
  [tRWA, dC]    = PID3Axis( x(7:10), dC );

  % Start the first burn
  inMnvr = false;
  if( t(k) > tStart(1) && t(k) < tEnd(1) )
    inMnvr = true;
  end

  % Switch orientation
  if( t(k) > tEnd(1) )
    kMnvr = 2;
  end

  % Start the second burn
  if( t(k) > tStart(2) && t(k) < tEnd(2) )
    inMnvr = true;
  end
  
  if( inMnvr )
    dRHS.force = thrustE*QTForm(x(7:10),dC.body_vector)*nToKN; % kN
  else
    dRHS.force = [0;0;0];
  end
  el = RV2El(x(1:3),x(4:6));
  xP(:,k) = [x;tRWA;Mag(dRHS.force)/nToKN;el(1);el(5)];

  % Right hand side
  dRHS.torqueRWA = -tRWA;
  x = RK4(@RHSRWAOrbit,x,dT,0,dRHS);
end

The maneuver logic just waits a quarter orbit then performs the first burn, by applying the thrust along the body vector. It then waits for the time of flight and then starts the next burn. The start and stop times are pre-computed. RK4 is Fourth Order Runge-Kutta, a popular numerical algorithm included with the toolbox.

At the final orbit radius an attitude maneuver is needed to reorient for the final burn.

The spacecraft body rates, in the body frame, during the maneuver are shown below.

The reaction wheel rates are shown below. The simulation does not model any particular wheel. Friction is not included in the simulation, although the right-hand-side function can include friction.

The wheel torques and rocket thrust are shown below. The thruster is a 0.2 lbf hydrazine thruster that is based on the Aerojet-Rocketdyne MR-103. The PID controller does not demand much torque.

The semi-major axis and eccentricity are shown below. The middle portion is during the transfer orbit.

The eccentricity is zero at the start and finish. Note the slope in both eccentricity and semi-major axis due to the finite acceleration. At the end of the simulation, we print the achieved orbital elements:

Final SMA        7099.72 km
  SMA error         0.28 km
Final e          1.3e-05

The result is very close to the ideal solution!

This post shows how you can easily integrate attitude and orbit control. Email us for more information! We’d be happy to share the script. We can also offer a 30 day demo to let you explore the software.

PSS Toolboxes 2021.1 Now Available!

Version 2021.1 of Princeton Satellite Systems toolboxes for MATLAB is now available! Over 50 new functions and scripts are included. Many other existing functions have been improved.

One new function is AtmNRLMSISE.m, an atmosphere function based on the NRL MSISE model. It is uses extensive flight data and includes sun effects. It computes the overall density and the number density of all atmospheric constituents. Our function has an easy to use interface that automatically incorporates the sun information and lets you input your spacecrafts ECI coordinates. You can also choose to use the original interface. Here is a comparison with the existing scale height model.

We provide a complete set of functions for planning lunar missions in the Missions module. The software includes landing control systems and trajectory optimizaton tools. You can use our Optical Navigation system for your cis-lunar missions and explore our cutting-edge neural network terminal descent software.

Here are two images from an optical navigation simulation for a solar sail.

Solar Sail and Earth paths in the heliocentric frame.
Navigation camera view.

The Spacecraft Control Toolbox provides you with a lot of ways to do things, so you can use your own creativity to perform analyses or design a mission.

Contact us to purchase or for a demo!

Lunar Orbit Insertion Maneuver

New functions in the Lunar Cube module in 2016.1 allow you to easily plan lunar insertion and orbit change maneuvers. In the following pictures you can see a lunar orbit insertion from a hyperbolic orbit. In all figures the lunar terrain is exaggerated by a factor of 10.

The same maneuver looking down on the orbit plane. The green arrows are the force vectors.

The following figure shows a two maneuver sequence. The first puts the spacecraft into an elliptical orbit. The second circularizes the orbit.

Lunar Cube Module for 2016.1

We are adding the Lunar Cube Module in 2016.1 to our CubeSat Toolbox for MATLAB! It allows users to analyze and simulateCubeSats in lunar transfer and lunar orbit. It includes a new dynamical model for CubeSats that includes:

  • Earth, Moon and Sun gravity based on the JPL ephemerides
  • Spherical harmonic lunar gravity model
  • Reaction wheels
  • Thrusters
  • Power generation from solar panels
  • Battery energy storage
  • Variable mass due to fuel consumption
  • Solar pressure disturbances
  • Lunar topographic model
  • New graphics functions for lunar orbit operations
  • Lunar targeting function
  • Lunar mission control function for attitude control and orbit control

The module includes a script with a simulation of a 6U Cubesat leaving Earth orbit and reaching the moon. The following figure shows the Earth to Moon trajectory.

LunarTrajectory

This figure shows the transfer orbit near the moon. The lunar topography is exaggerated by a factor of 10 to make it visible. It is based on Clementine measurements.

LunarEncounter

Here are results from the new LunarTargeting function. It finds optimal transfers to lunar orbits. The first shows the transfer path to the Moon’s sphere of influence.

Test21

The next shows the lunar hyperbolic orbit. In this case the transfer is into a high inclination lunar orbit.

Test22

Contact us for more information!

SolidWorks Interface in SCT 2015.1

Version 2015.1 will have a new DXF file format exporter to export CAD models built in the Spacecraft Control Toolbox into SolidWorks. The following figure shows the Lunar Lander model in the Spacecraft Control Toolbox CAD window.

LunarLander

Exporting requires just two lines of code:

g = BuildCADModel( 'get model' );
ExportDXF(g,'LunarLander');

Rodger Stephens of Prism Engineering provided SolidWorks models from the DXF file. The file opened in SolidWorks with 7 parts creating an assembly called LunarLander-1.

SolidWorks1

Each part contains planes, sketches, and surfaces.

SolidWorks2

The Spacecraft Control Toolbox has always had DXF import capability but now it can export in a format that is supported by most CAD packages. This will speed the process of going from conceptual designs in the Spacecraft Control Toolbox to detailed designs in SolidWorks and other CAD packages.

Spacecraft CAD Design in the Spacecraft Control Toolbox

AutoDesk Inventor and SolidWorks are powerful software packages for the computer-aided design of spacecraft. Ultimately you need to use one of those packages for the mechanical design of your satellite, but what about the preliminary design phase when you are still determining what components you even need? The CAD software in the Spacecraft Control Toolbox can provide you with a valuable tool to do your conceptual layouts and early trade studies, and the same model can be used as the basis for disturbance analysis in later design phases.

A CAD model in SCT is built in a script which allows you to build your models algorithmically. You can call design functions, use for loops and revision-control your source code. For example, within the script you can do an eclipse analysis and compute the battery capacity. This number can generate the volume of your batteries which you can then use to size your spacecraft.

The function BuildCADModel provides the model-building interface. The CreateComponent function is used to generate the individual components using parameter pairs as arguments. Components are grouped into bodies to allow for rotation and articulation. A GUI displays your finished model and allows you to visualize it in 3D. You then store your finished models as mat-files. Our disturbance model uses every triangle in your model for disturbance analysis.

The example figure shows a solar sail design, with the spacecraft bus in the middle. BuildCADModel allows you to group components into subsystems as on the left-hand side, which can then be highlighted using transparency.

The figure below shows the BuildCADModel GUI which allows you to verify the body and component properties.

There are many examples of spacecraft models in the SCT to help you get started, and a lengthy chapter in the User’s Guide discussing the finer points of component location, orientation, and physical properties such as drag and optical coefficients. Your CAD model essentially functions as a database for your entire spacecraft model!

Brand New Free SCT Textbook Companion App for MATLAB

We are happy to announce the release of our free Textbook Companion App for MATLAB (2012b or later).  Based on four Chapter 2 walk through tutorials, the goal is to design a geostationary spacecraft, maintaining an exact orbital position, delivering a -126 dB in the Ku band, and 7 year lifetime.

app_cover

The GUI allows us to look at the results of various gravity models, summing various types of disturbances caused by the sun-angle, a basic geo-synchronous orbit simulation, and then a full simulation that incorporates the orbit, disturbances, and Control and Link parameters. app_results

The app is available on the textbook support page: http://support.psatellite.com/sct/theory_textbook.php.

 

IR Imaging with the Spacecraft Control Toolbox

Many spacecraft are incorporating cameras, both visible and IR, to image other nearby objects. These may be other satellites or space debris. This blog entry shows how you can simulate imaging with the Spacecraft Control Toolbox.

In this simulation a target 1U CubeSat is illuminated by several sources of radiant flux and imaged by a camera located on a chase vehicle. The CubeSat panels have different optical and thermal properties. An exploded view is shown below. The surface properties are for radiators (black), solar panels (blue) and gold foil (yellow).

SatelliteBlog

The target is located in a circular orbit and the chase vehicle is in a similar but slightly eccentric orbit. A camera is mounted on the chase vehicle. The chase vehicle keeps its camera pointed at the target. Solar radiation, earth radiation, and earth albedo illuminate the target. The motion of the two vehicles is simulated for one revolution. The target spacecraft remains between approximately 75 m and 150 m from the chase vehicle.

RelativePos

As the target and chase vehicle move in their respective orbits, the change in temperature of the target CubeSat is simulated. Each of the 6 panels are composed of two triangles. The temperatures of the panels vary based on the thermal properties of each face and the orientation of the spacecraft. The orientation affects the incoming flux for each particular face.

Temp

Solar radiation is the dominant source over the course of the simulation but earth radiation and earth albedo also effect the total flux. The solar radiation, plotted in dark blue, clearly shows the times when the earth is blocking the line of sight from the spacecraft to the sun.

Flux

A photon detector model is assumed for the IR imaging device. The following flow chart describes the imager model.

FlowCharts

The initial output observed by the imager is shown below. It should be noted that for the particular orbit and orientation initial conditions specified, the z component of the relative position is always equal to zero. This means that only the x and y panels of the cube will be visible throughout the simulation. It is possible to specify different initial conditions that would result in a z relative position, and in this case, up to three faces of the cube can be detected.

DetectIm1

We have created a video that displays the imager results as a sequence.

IRImaging

SCT Seminar – Sheffield UK

Yosef and Amanda are giving a seminar on our Spacecraft Control Toolbox in Sheffield, England on October 1, 2013. This event has been arranged through our UK distributors, MeadoTech Ltd. A big thank you goes out to Dr. Mohamed Mahmoud and Ruth Jenkinson!

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

New Attitude Profiling Functions and Visualization in SCT v11

Creating attitude profiles just got easier! Satellites typically have multiple antennas and sensors that must be pointed in different directions at various times. We often want to point a sensor payload or a directional antenna at a certain location on Earth, while keeping the solar panels aligned with the sun and aiming the star camera away from bright areas of the sky. The group of new attitude profile functions in SCT v11 allow high-level directives to be defined, and facilitate the automatic computation of an attitude profile that meets the target alignment objectives while satisfying all pointing constraints. Detailed time-history plots and 3D visualization with playback enable you to explore and understand the attitude profile in depth.

The 2D plot below shows a time history of the rotation angle around the primary body axis. The primary body axis is aligned with the primary target. We can then rotate about this axis to align a secondary body axis as closely as possible with a secondary target. At the same, we have one or more pointing constraints which impose time-varying bounds on the rotation angle. The dark gray regions illustrate how these bounds change over time.

AttitudeProfilePlots002

The 3D view below shows the orbital path (cyan) of the satellite about the Earth, with a CAD model at the current orbit location in the center of the figure. The sun vector is shown (yellow) and the Earth lighting is based on the sun location. The primary alignment vector (green) is directed towards a coordinate on the Earth, and the secondary alignment is pointed in the orbit-normal direction. Constraint directions are shown in red with angular sweeps to show their size. The sensor cone is a star camera that has to keep the sun, Earth and moon out of its field of view.

AttitudeProfile3DVis001