To simulate a spacecraft it is not only critical to get the orbital and attitude dynamics correct while considering a range of perturbations, but the modern spacecraft also contains a sophisticated software suite that runs a broad range of control, sensor data, estimation, fault-checking and actuation algorithms. The AVS lab is leading the development of the Basilisk Astrodynamics Simulation framework (BSK). This cross-platform software is inherently modular in its design by encapsulating dynamic behaviors, sensor models, as well as algorithm development. Modules can be created in C++, C or using Python. The C and C++ code is very clean and human readable, but provides fast numerical executions. Swig is then used to wrap these codes and make them available through the simple to use Python layer.
The modular solution allows for specific simulation components to be replaced or changed, without impacting the other code. Tasks can be grouped together and run at different frequencies. This also provides a clean separation of flight algorithms and simulation code. The challenge is to develop the ADCS, orbit maintenance and autonomy algorithms in a manner to such that they follow this modular architecture. This enables algorithms to be tested in early analysis phases, but then transitions to an actual mission environment without any changes to the actual code. A custom Message Passing Interface (MPI) allows BSK modules to share data with each other. This MPI provides a standard input and output interface that enables a particular module to be readily replace with another module that shares the same interface. Consider an attitude estimation module. With this MPI an extended Kalman filter can be replaced with an unscented Kalman filter with only a few lines of python code. To ensure that each module performs as expected they have unit and integrated tests associated with them. This allows for a suite of validation tests to be run with the Python pytest
command.
The Basilisk framework is still being developed and enhanced with new dynamic actuators, new sensor developments, as well as new space environment models. The benefit to students and researchers is that prior work can more easily be integrated into new simulations thanks to the MPI and the modular architecture.
Black Lion (BL) is a communication architecture which enables a distributed software-simulation (SW-sim) of a spacecraft system. Spacecraft software undergoes rigorous levels of integration and validation testing of the complex mission behaviors. Besides testing the nominal functionality and expected spacecraft behaviors, simulations are critical to test off-nominal behaviors where components fail, sensor signals are corrupted and how ground contact communication periods are used to analyze and address mission issues. While the BL SW-sim is being developed in order to support flat-sat testing for an ongoing interplanetary mission in which the Laboratory for Atmospheric and Space Physics (LASP) and the Autonomous Vehicle Systems (AVS) laboratory at the University of Colorado Boulder are collaborating, the BL architecture is general enough to create a range of distributed spacecraft simulations.
Multiple software processes across heterogenous computing platforms can be integrated into a single BL simulation. This allows, for example, having a dedicated computer running a complex space environment model and another computer integrating spacecraft dynamics, both of them exchanging data dynamically through BL. Further, many mission operations rely on software legacy components that were never design to integrated into a larger simulation such as the ground communication system software, or the spacecraft flight software itself.
The Black Lion communication architecture is designed to connect all the nodes of a distributed SW-sim while being as transparent as possible to the internals of these nodes, such that different mission users can plug-and-play virtual models. While the Black Lion effort is currently motivated for a specific spacecraft interplanetary mission, the system is being built under the principles of reusability and scalability, and the BL applications extend beyond the flat-sat example discussed here. Examples of further BL applications include the integration of large clusters of spacecraft, complex simulation components running on super-computers or cloud servers, as well as distributed simulation of both spacecraft sensor and actuation systems.
General-purpose computing on graphics processing units (GPGPU) is becoming common thanks to the large gaming industry. The AVS lab is researching how to exploit the GPU effectively to accelerate computationally intensive BSK tasks. Using either OpenGL, OpenCL or Vulcan software frameworks, special shaders are written to compute the net force and torque vectors onto a spacecraft due to the solar radiation pressure (SRP). Unlike earlier solutions, complex CAD solutions can be directly used. These shapes can even be time-varying as the full solution is evaluated at each time step. The research is investigating using both faceted rending techniques which work for simple SPR models and atmospheric drag models, as well as faster-than-realtime ray-tracing techniques to include complex behaviors such as light bouncing off surfaces or bouncing with a diffuse response function.
Other research is exploring how to implement a spherical harmonic solution on the GPU. The planet's gravity and magnetic fields are typically modeled through a series of spherical harmonic functions. Their evaluation can be time consuming in contrast to the other simulation components. Consider simulating a spacecraft flying through the Jupiter system containing many moons, a complex gravity field, and a very strong magnetic field. By moving the harmonic function evaluation to the GPU it enables very fast orbital simulations that can incorporate both complex gravity and magnetic field influences on the orbital motion. Near Jupiter object tend to charge to high potentials. As a result the Lorentz force will become a perturbation that must be considered in addition to the gravity forces. With the research into GPU solutions rapidly prototyping mission concepts, iterating for optimal trajectories, as well as running Monte Carlo sensitivity analysis with the full space environment becomes feasible.
The Basilisk simulation contains a large number of internal states. These can be logged to be analyzed in a post-processing step. A new Basilisk Visualization called Vizard is being developed based on the Unity gaming framework. This allows for recorded BSK states to be visualized after after a simulation, or viewed life during the simulation. The Vizard visualization provides a flexible visualization environment to see the states of the simulation. This can include which gravity bodies are included, the location and orientation of the spacecraft, the states of the spacecraft actuators, etc. Research is investigating the best means to convey this information in a heads-up mode, as well as a numerical data panel.
The Vizard program is also capable of showing the simulated states from multiple view points. An instance of this is the ability to simulate a visual camera of arbitrary definition and image size, and return the image sequence back to Basilisk as a sensor input. This enables purely software-based closed-loop simulation of a visual control or a navigation strategy. Research is exploring autonomous visual deep space navigation, but the framework can also be used for visual control for rendezvous and docking, as well as visual navigation relative to celestial objects such as the lunar surface or an asteroid.