scenario_FeedbackRW¶
Overview¶
This script sets up a 6-DOF spacecraft orbiting Earth. The goal of the scenario is to
add reaction wheels to BSK_Dynamics, and
establish a inertial pointing FSW mode in BSK_Fsw.
The script is found in the folder src/examples/BskSim/scenarios
and executed by using:
python3 scenario_FeedbackRW.py
The simulation mimics the basic simulation simulation in the earlier tutorial in scenarioAttitudeFeedbackRW. The simulation layout is shown in the following illustration.
Two simulation processes are created: one which contains dynamics modules, and one that contains the FSW modules. The initial setup for the simulation closely models that of scenario_BasicOrbit.
Custom Dynamics Configurations Instructions¶
In addition to the modules used in scenario_BasicOrbit, the user must configure the RW module
in BSK_Dynamics
to stabilize the tumbling. This is accomplished by first creating the RW state effector.
The RW object is then configured through InitAllDynObjects(SimBase)
which
includes the SetReactionWheelDynEffector()
function which configures the RW pyramid’s properties and messages.
Custom FSW Configurations Instructions¶
To configure the desired Module: inertial3D FSW mode the user must declare the following modules
within the __init__()
function in BSK_Fsw.
These provide the initial setup for an attitude guidance system that makes use of an inertial pointing model, a module
that tracks the error of the spacecraft’s MRP parameters against the pointing model, and a module that takes that
information to provide a torque to correct for the error.
Following the initial declaration of these configuration modules, BSK_Fsw
calls a InitAllFSWObjects()
command,
which, like BSK_Dynamics’s InitAllDynObjects()
, calls additional setter functions that configure each
of the FSW modules with the appropriate information and message names.
In addition to the modules used for attitude guidance, there are also two setter functions that send vehicle and RW
configuration messages that are linked into the attitude guidance modules called SetVehicleConfiguration()
and
SetRWConfigMsg()
.
After each configuration module has been properly initialized with various message names, FSW tasks are generated.
The two tasks required for the Module: inertial3D mode are inertial3DPointTask
and mrpFeedbackRWsTask
.
Note how the tasks are divided between the pointing model and control loop. These modular tasks allow
for simple FSW reconfigurations should the user want to use a different pointing model, but to use the same feedback
control loop. This will be seen and discussed in later scenarios.
Finally, the Module: inertial3D mode call in scenario_FeedbackRW needs to be triggered by:
SimBase.createNewEvent("initiateInertial3D", self.processTasksTimeStep, True,
["self.modeRequest == 'inertial3D'"],
["self.fswProc.disableAllTasks()",
"self.enableTask('inertial3DPointTask')",
"self.enableTask('mrpFeedbackRWsTask')"])
which disables any existing tasks and enables the inertial pointing task and RW feedback task. This concludes how to construct a preconfigured FSW mode that will be available for any future scenario that uses the BSK_Sim architecture.
Illustration of Simulation Results¶
showPlots = True
-
scenario_FeedbackRW.
run
(showPlots)[source]¶ The scenarios can be run with the followings setups parameters:
- Parameters
showPlots (bool) – Determines if the script should display plots
-
class
scenario_FeedbackRW.
scenario_AttitudeFeedbackRW
[source]¶ Bases:
BSK_masters.BSKSim
,BSK_masters.BSKScenario