Module: thrusterDynamicEffector¶
Executive Summary¶
Thruster dynamics class used to provide thruster effects on body. This class is used to hold and operate a set of thrusters that are located on the spacecraft. It contains all of the configuration data for the thruster set, reads an array of on-time requests (double precision in seconds). It is intended to be attached to the dynamics plant in the system using the DynEffector interface and as such, does not directly write the current force or torque into the messaging system. The nominal interface to dynamics are the dynEffectorForce and dynEffectorTorque arrays that are provided by the DynEffector base class. There is technically double inheritance here, but both the DynEffector and SysModel classes are abstract base classes so there is no risk of diamond.
The module
PDF Description
contains further information on this module’s function,
how to run it, as well as testing.
Message Connection Descriptions¶
The following table lists all the module input and output messages. The module msg variable name is set by the user from python. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.
Msg Variable Name |
Msg Type |
Description |
---|---|---|
cmdsInMsg |
(optional) input message with thruster commands. If not connected the thruster commands are set to zero. |
|
thrusterOutMsgs |
output message vector for thruster data |
-
class ThrusterDynamicEffector : public SysModel, public DynamicEffector¶
- #include <thrusterDynamicEffector.h>
thruster dynamic effector class
Public Functions
-
ThrusterDynamicEffector()¶
The Constructor.
-
~ThrusterDynamicEffector()¶
The destructor.
-
void linkInStates(DynParamManager &states)¶
This method is used to link the states to the thrusters
- Parameters
states – The states to link
- Returns
void
-
void computeForceTorque(double integTime)¶
This method computes the Forces on Torque on the Spacecraft Body.
- Parameters
integTime – Integration time
- Returns
void
-
void computeStateContribution(double integTime)¶
-
void Reset(uint64_t CurrentSimNanos)¶
This method is used to reset the module.
- Returns
void
-
void addThruster(THRSimConfigMsgPayload *newThruster)¶
Add a new thruster to the thruster set.
-
void UpdateState(uint64_t CurrentSimNanos)¶
This method is the main cyclical call for the scheduled part of the thruster dynamics model. It reads the current commands array and sets the thruster configuration data based on that incoming command set. Note that the main dynamical method (ComputeDynamics()) is not called here and is intended to be called from the dynamics plant in the system
- Parameters
CurrentSimNanos – The current simulation time in nanoseconds
- Returns
void
-
void writeOutputMessages(uint64_t CurrentClock)¶
This method is here to write the output message structure into the specified message.
- Parameters
CurrentClock – The current time used for time-stamping the message
- Returns
void
-
bool ReadInputs()¶
This method is used to read the incoming command message and set the associated command structure for operating the thrusters.
- Returns
void
-
void ConfigureThrustRequests(double currentTime)¶
This method is used to read the new commands vector and set the thruster firings appropriately. It assumes that the ReadInputs method has already been run successfully. It honors all previous thruster firings if they are still active. Note that for unit testing purposes you can insert firings directly into NewThrustCmds.
- Parameters
currentTime – The current simulation time converted to a double
- Returns
void
-
void ComputeThrusterFire(THRSimConfigMsgPayload *CurrentThruster, double currentTime)¶
This method is used to get the current force for a thruster firing. It uses the configuration data associated with a given thruster and the current clock time to determine what state and force the thruster should be in.
- Parameters
CurrentThruster – Pointer to the configuration data for a given thruster
currentTime – The current simulation clock time converted to a double
- Returns
void
-
void ComputeThrusterShut(THRSimConfigMsgPayload *CurrentThruster, double currentTime)¶
This method is used to go through the process of shutting down a thruster once it has been commanded off. It uses the configuration data associated with a given thruster and the current clock time to turn off the thruster according to the ramp profile.
- Parameters
CurrentThruster – Pointer to the configuration data for a given thruster
currentTime – The current simulation clock time converted to a double
- Returns
void
-
double thrFactorToTime(THRSimConfigMsgPayload *thrData, std::vector<THRTimePairMsgPayload> *thrRamp)¶
This method finds the location in the time in the specified ramp that corresponds to the current thruster thrust factor. It is designed to initialize the ramp-up and ramp-down effects to the appropriate point in their respective ramps based on the initial force
- Parameters
thrData – The data for the thruster that we are currently firing
thrRamp – This just allows us to avoid switching to figure out which ramp
- Returns
double The time in the ramp associated with the thrust factor
Public Members
-
ReadFunctor<THRArrayOnTimeCmdMsgPayload> cmdsInMsg¶
input message with thruster commands
-
std::vector<Message<THROutputMsgPayload>*> thrusterOutMsgs¶
output message vector for thruster data
-
int stepsInRamp¶
class variable
-
std::vector<THRSimConfigMsgPayload> thrusterData¶
Thruster information
-
std::vector<double> NewThrustCmds¶
Incoming thrust commands
-
double mDotTotal¶
kg/s Current mass flow rate of thrusters
-
double prevFireTime¶
s Previous thruster firing time
-
BSKLogger bskLogger¶
BSK Logging
Private Members
-
std::vector<THROutputMsgPayload> thrusterOutBuffer¶
Message buffer for thruster data
-
THRArrayOnTimeCmdMsgPayload incomingCmdBuffer¶
One-time allocation for savings
-
uint64_t prevCommandTime¶
Time for previous valid thruster firing
-
ThrusterDynamicEffector()¶