Basilisk: a Flexible, Scalable and Modular Astrodynamics Simulation Framework
Total Page:16
File Type:pdf, Size:1020Kb
BASILISK: A FLEXIBLE, SCALABLE AND MODULAR ASTRODYNAMICS SIMULATION FRAMEWORK Patrick W. Kenneally∗, Scott Piggotty and Hanspeter Schaub z University of Colorado, Boulder ABSTRACT Basilisk is an astrodynamics framework that simulates complex spacecraft systems in the space environment. While The Basilisk astrodynamics framework is a spacecraft simu- many simulation tools possess overlapping features with lation tool developed with an aim of strict modular separation Basilisk, none others possess the unique characteristics of and decoupling of modeling concerns in regards to coupled Basilisk. These characteristics are that Basilisk is a highly spacecraft dynamics, environment interactions and flight soft- modular, Python user-friendly, open-source simulation frame- ware algorithms. Modules, Tasks, and Task Groups are the work that provides sufficiently accurate (fidelity is config- three core components which enable Basilisk’s modular ar- urable) coupled vehicle position and attitude dynamics, along chitecture. These core components are described and their with optional structural flexing, imbalanced momentum ex- functionality demonstrated. The Basilisk message passing change device, and fuel slosh dynamics, with at least a 365 system is a critical communications layer which facilitates the times speedup (one mission year in one compute time day). routing of input and output data between Modules. This paper Furthermore, Basilisk is equally well employed during early outlines Basilisk’s data logging and Monte Carlo simulation mission design phases as it is later on during detailed de- functionality. The implementation of the Basilisk, a Python sign phases and further in post-launch telemetry analysis and wrapped C++/C technology stack is described. Finally, ex- spacecraft command sequence validation. ample simulation configurations and results are provided to This paper describes the Basilisk framework in three pri- demonstrate the modularity and flexibility of the framework. mary sections. In Sec. 2 a brief survey of the current state- Index Terms— simulation, modular, python, dynamics, of-the-art commercial-off-the-shelf (COTS) and government- off-the-shelf (GOTS) spacecraft simulation software is given. Each of these COTS/GOTS systems posses unique feature 1. INTRODUCTION sets. These unique feature sets predispose each tool excel when applied to different classes of spacecraft system anal- Spacecraft simulation software tools are an indispensable part ysis. of modern spacecraft design processes. The continual in- crease in complexity of spacecraft mission and maneuver de- The remaining section of the paper are dedicated to an sign, dynamical and kinematic design verification, and post- overview of the Basilisk framework. Beginning with Sec- launch telemetry analysis all heavily rely on software simu- tion 3, the Basilisk framework’s software stack is introduced. lation tools. These simulation tools provide engineers with Section 4 gives a detailed account of the aforementioned the ability to increase the quality of design and testing by re- novel Basilisk system architecture, which allows for the ducing cost and duration of development. For example, pro- rapid development of a simulation for of a wide variety of posed changes to a mission’s configuration, parameter tuning complex spacecraft systems. The key architectural compo- or in-flight anomalies may be explored via Monte Carlo simu- nents discussed are the Basilisk fundamental building blocks lation. Additionally, hardware in the loop testing (HWIL) al- which govern simulation execution, the Basilisk message lows for verification and validation of the spacecraft hardware system which facilitates data passing between models, and and software systems in a controlled laboratory environment. the Basilisk spacecraft dynamics implementation. Section 5 Such HWIL testing can expose technical faults and system in- outlines the simulation execution flow of control and how tegration problems saving considerable project financial and the fundamental components of Modules, Tasks, and Task personnel resources before launching the system to space. Groups work together to provide the user with flexible con- trol over their simulation design, integration rates and mes- ∗Graduate Research Assistant, Smead Aerospace Engineering Sciences sage passing. Sections 6 and 7 and provide an overview of the Department Basilisk multi-processing Monte Carlo tools and the ability to y ADCS Integrated Simulation Software Lead,Laboratory for Atmo- log, process, and analyze large (multi-gigabyte) data sets. In spheric and Space Physics zProfessor, Glenn L. Murphy Endowed Chair, Smead Aerospace Engi- the final section of this paper a simple example Basilisk sim- neering Sciences Department ulation configuration will be presented from the perspective of the end user engineer to illustrate the basic functionality of [11, 8]. The DARTS tool uses spatial operator algebra for the Basilisk’s modular design. development of multibody dynamics to generate a spacecraft system mass matrix in a form that is efficiently solved recur- 2. ASTRODYNAMICS SIMULATION TOOLS sively [12]. Similarly, the simulation package “42” allows for spacecraft composed of multiple rigid or flexible bodies Astrodynamics simulation tools can be broadly categorized using a tree topology to formulate the dynamics. Both of into three groups; Commercial off the shelf (COTS), Gov- these formulations allow developers to add arbitrary models ernment off the shelf (GOTS) and general open source. A to the simulation without significant change to the code base. number of tools had their naissance in the GOTS category It seem an unreasonable goal to expect a tool, which simu- and subsequently moved to the open source category. A list lates the high complexity of a spacecraft system, to accommo- of popular tools to which are referred is given below. date all possible missions configurations and spacecraft sub- tleties as out-of-the-box modeling functionality . On this ba- • MATLAB/Simulink [1] sis, it is reasoned that extensibility of a simulation tool via means of scripting and custom code development is needed • Analytic Graphics Inc (AGI) Systems Tool Kit (STK) to allow engineers to adapt the tool to the particular specifica- [2] tion and requirements of their mission. All of the tools listed • a.i. FreeFlyer [3] include some basic level of scriptability while others enable significantly more customization. For example AGI’s STK • NASA General Mission Analysis Tool (GMAT) [4] offers their Connect and Object Model APIs which facilitate the addition of custom simulation models except for coupled • NASA Trick [5] spacecraft dynamics. In contrast JPL’s DARTS tool allows a • OreKit [6] user to compile and add a completely custom model to any part of the simulation framework. This may include a model • Jet Propulsion Laboratory (JPL), Dynamics Algorithms of the flexible dynamics of a large solar panel boom or the for Real-Time Simulation (DARTS)/Dshell [7] addition of a simulated ground station. While it is not surprising that none of the COTS tools use a • NASA 42 [8] version of an open source license, it is interesting to note that Each tool is developed with a specific subset of astrody- COTS tools are typically not cross platform in so far as they namics simulation purposes in mind. For example the OreKit, typically support installation on only one or two of the three GMAT and STK tools were initially developed with a focus big OS variants of macOS, Windows and Linux (MATLAB on high fidelity orbit dynamics, orbit estimation, orbit prop- excepted). agation and trajectory design. As a result these tools include Finally, a large feature which is not available by default in a range of different propagators, complex multi body, gravity most tools is Hardware-in-the-loop and Software-in-the-loop models, drag, solar radiation pressure and orbit determination functionality. Of the tools listed MATLAB/Simulink and the tools. For example the Orekit tool includes six optional meth- DARTS/Dshell tools support HWIL and SWIL functionality ods to model atmospheric density and therefore drag effects, without significant modification. Providing this functionality from simple exponential models to empirical predictive mod- allows engineers to use of the same set of tools and flight algo- els such as the Marshall Solar Activity Future Estimation [9]. rithms through multiple phases of the mission and in multiple When assessing software packages in the context of their engineering teams across an organization. ability to simulate full spacecraft dynamics it is important to identify how the dynamics are computed and how this im- 3. SOFTWARE STACK AND BUILD pacts the modularity of the implementation. For example, tools such as OreKit and STK have increased their ability to The core Basilisk architectural components and most modules accommodate spacecraft attitude. STK can be paired with the are written in C++ to allow for object-oriented development SOLIS plugin, a commercial plugin to the STK which models and fast execution speed. However, Basilisk Modules can also spacecraft translational and attitude dynamics. And while the be developed using Python, for easy and rapid prototyping, C SOLIS plugin enhances STK’s spacecraft dynamics, it does (to allow flight software modules to be easily ported directly not model disturbances which may alter the spacecraft’s cen- to flight targets) and Fortran (to accommodate legacy space ter of mass[10]. Similarly, OreKit models the spacecraft as a environment