scenario_AttGuidMultiSat

Overview

This script sets up three 6-DOF spacecraft orbiting the Earth. The goal of this scenario is to

  1. introduce the flight software class,

  2. show how one can change the active flight mode on the run, and

  3. discuss how this script takes advantage of the new BSK Sim structure.

The script is found in the folder basilisk/examples/MultiSatBskSim/scenariosMultiSat and is executed by using:

python3 scenario_AttGuidMultiSat.py

This simulation is based on the scenario_BasicOrbitMultiSat with the addition of flight software modules. It also takes some cues from scenario_AttGuidance, but with several spacecraft and more possible flight modes.

For simplicity, the script plots only the information related to one of the spacecraft, despite logging the necessary information for all spacecraft in the simulation.

Custom Dynamics Configurations Instructions

The dynamics modules required for this scenario are identical to those used in scenario_BasicOrbitMultiSat.

Custom FSW Configurations Instructions

In this example, all spacecraft inherit the same flight software class defined in BSK_MultiSatFsw. Four flight modes are implemented through the use of events and are described below:

  1. standby: the spacecraft has no attitude requirements.

  2. inertialPointing: the spacecraft points at some inertially fixed location.

  3. sunPointing: the spacecraft points at the Sun.

  4. locationPointing: the spacecraft aims at a ground location on Earth.

The attitude is controlled using a set of four reaction wheels that are set up in BSK_MultiSatDynamics. The mrpFeedback is used for the control law and rwMotorTorque interfaces with the reaction wheels. The attTrackingError module is used with all modes to convert from a reference message to a guidance one.

The events can be set using the modeRequest flag inside the FSW class. It is crucial that all events call the setAllButCurrentEventActivity method. This function is called in a way such that all events’ activity is made active except for the current one. Without this command, every event could only be made active once. The method also makes sure it only affects the events specific to each spacecraft. For more information, see SimulationBaseClass.

No formation flying control is done in this scenario. To see a more complete example which includes formation geometry control, see scenario_StationKeepingMultiSat.

In this scenario, it is shown how the flight software events are set up, and how to change them on-the-fly.

Illustration of Simulation Results

Since three spacecraft are simulated, and to prevent excessively busy plots, only the information pertaining to one spacecraft is plotted per simulation.

show_plots = True, numberSpacecraft=3
../../../_images/scenario_AttGuidMultiSat_attitude.svg../../../_images/scenario_AttGuidMultiSat_rate.svg../../../_images/scenario_AttGuidMultiSat_attitude_tracking_error.svg../../../_images/scenario_AttGuidMultiSat_tracking_error_rate.svg../../../_images/scenario_AttGuidMultiSat_rw_motor_torque.svg../../../_images/scenario_AttGuidMultiSat_rw_speeds.svg
scenario_AttGuidMultiSat.run(show_plots, numberSpacecraft)[source]

The scenarios can be run with the followings setups parameters:

Parameters
  • show_plots (bool) – Determines if the script should display plots

  • numberSpacecraft (int) – Number of spacecraft in the simulation

class scenario_AttGuidMultiSat.scenario_AttGuidFormationFlying(numberSpacecraft)[source]

Bases: BSK_MultiSatMasters.BSKSim, BSK_MultiSatMasters.BSKScenario

configure_initial_conditions()[source]

Developer must override this method in their BSK_Scenario derived subclass.

log_outputs()[source]

Developer must override this method in their BSK_Scenario derived subclass.

pull_outputs(show_plots, spacecraftIndex)[source]

Developer must override this method in their BSK_Scenario derived subclass.