NOS3 42 Orbit and Attitude Dynamics - nasa/nos3 GitHub Wiki

42, A Visualization and Simulation Tool for Spacecraft Orbit and Attitude Dynamics

42 Overview

Some of the simulated hardware components require dynamic environmental data. 42 is an open source visualization and simulation tool for spacecraft attitude and orbital dynamics and environmental data developed by NASA’s Goddard Space Flight Center (GSFC). The role of 42 within NOS3 is to provide dynamic environmental data required by the simulated hardware components.

The presentation material on 42 describes it as a general-purpose, multi-body, multi-spacecraft simulation. The presentation materials describe the following features of 42 which are of interest to NOS3 (other features are described as well):

  1. Multiple spacecraft, anywhere in the solar system
    1. Two-body, three-body orbit dynamics (with seamless transition between)
    2. One sun, nine planets, 45 major moons

The presentation materials also list the following environmental models which are of interest to NOS3 (other models are described as well):

  1. Planetary Ephemerides
    1. From Meeus, “Astronomical Algorithms”
    2. Good enough for GNC validation, not intended for mission planning
  2. Gravity Models have coefficients up to 18th order and degree
    1. Earth: EGM96
  3. Planetary Magnetic Field Models
    1. IGRF up to 10th order (Earth only)
  4. Earth Atmospheric Density Models
    1. MSIS-86 (thanks to John Downing)
    2. Jacchia-Roberts Atmospheric Density Model (NASA SP-8021)

42 uses a collection of input files to control its execution. For NOS3, the main configuration files of interest are the following:

  1. Inp_Sim.txt – The main configuration file which defines items such as the environment (epoch, gravity models, celestial bodies, etc.), spacecraft reference orbits and configuration files, spacecraft and configuration files, and ground station locations.
  2. Orb_LEO.txt – Spacecraft reference orbit file referred to by Inp_Sim.txt. This file specifies the orbit center (Earth) and refers to the two line element set file which defines the spacecraft orbit.
  3. SC_NOS3.txt – Spacecraft definition file referred to by Inp_Sim.txt. This file defines labels, orbit parameters, initial attitude, body parameters, and other parameters specific to the spacecraft.
  4. Inp_IPC.txt – File defining the TCP/IP or file parameters for communicating input and output to and from 42.
  5. Inp_Graphics.txt – File defining the GUI configuration for 42, including what windows to display, parameters for the point of view, various display elements such as grids and labels, and other graphic elements properties.
  6. There are several other input files which are not used much for NOS3, including Inp_Cmd.txt (defining a command script for 42), Inp_FOV.txt (defining fields of view), Inp_Region.txt (defining regions for 42), and Inp_TDRS.txt (defining TDRS satellites for 42).

Providing Data to a Simulator from 42

When 42 is run, it writes environmental data to a set of files that have the extension ".42". The data written in the "MAG.42" file can be used by the MagnetometerSimDataFileProvider data provider while the data written in the "FOTON.42" file can be used by the GPSSimDataFileProvider. In addition to using files of 42 data, 42 can output data to a TCP/IP socket. This output is controlled by the input file Inp_IPC.txt. To output data to a TCP/IP socket and act as a server (the mode used by NOS3 hardware simulator data providers such as MagnetometerSimData42SocketProvider and GPSSimData42SocketProvider), the "IPC Mode" should be set to "TX", the "Socket Role" should be set to "SERVER" and the "Server Host Name, Port" should be set to the host name or IP address to use and the TCP socket port number to use.

Coordinating 42 Time

When data is output to a TCP/IP socket and in order to maintain a consistent real time reference within the system, 42 has been modified so that it can have its time driven by NOS Engine (which also drives hardware simulator and flight software time as well). To configure 42 to use NOS Engine driven time, the Inp_Sim.txt and Inp_NOS3.txt files are modified as follows. In Inp_Sim.txt change the "Time Mode" line to have the value "NOS3". In Inp_NOS3.txt set the "NOS3 Time Connection String" line to have the connection string for contacting the NOS Engine Standalone Server and set the "Sim Time Bus" line to the NOS Engine bus name to use to retrieve time from.

Data Available from 42

The following data is currently written by 42 to the TCP/IP socket and can be used as environmental data for data providers:

  • date/time
  • spacecraft in eclipse/sunlight
  • spacecraft position in the inertial world frame
  • direction cosine matrix for conversion from inertial world frame to rotating world frame
  • spacecraft position in the rotating world frame
  • spacecraft velocity in the inertial world frame
  • direction cosine matrix for conversion from spacecraft inertial frame to spacecraft body frame
  • spacecraft angular velocity
  • quaternion for conversion from spacecraft inertial frame to spacecraft body frame
  • vector from spacecraft to sun in the inertial world frame
  • magnetic field vector at the spacecraft in the inertial world frame
  • spacecraft angular momentum

In addition, data from various sensors in 42 can be written by 42 to the TCP/IP socket for use as environmental data for data providers.