Module: vscmgStateEffector¶
Executive Summary¶
This dynamic effector class implements a variable speed control moment gyroscope or VSCMG device.
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 |
motor torque command input message |
|
speedOutMsg |
VSCMG speed output message |
|
vscmgOutMsgs |
vector of VSCMG output messages |
-
class VSCMGStateEffector : public SysModel, public StateEffector¶
- #include <vscmgStateEffector.h>
VSCMG state effector class.
Public Functions
-
VSCMGStateEffector()¶
-
~VSCMGStateEffector()¶
-
void registerStates(DynParamManager &states)¶
-
void linkInStates(DynParamManager &states)¶
-
void updateEffectorMassProps(double integTime)¶
-
void Reset(uint64_t CurrentSimNanos)¶
Reset the module to origina configuration values.
- Returns
void
-
void AddVSCMG(VSCMGConfigMsgPayload *NewVSCMG)¶
This method allows VSCMG devices to be added to this effector
- Parameters
NewVSCMG – VSCMG device to be added
- Returns
void
-
void UpdateState(uint64_t CurrentSimNanos)¶
This method is the main cyclical call for the scheduled part of the VSCMG dynamics model. It reads the current commands array and sets the VSCMG 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
-
void ReadInputs()¶
This method is used to read the incoming command message and set the associated command structure for operating the VSCMGs.
- Returns
void
-
void ConfigureVSCMGRequests(double CurrentTime)¶
This method is used to read the new commands vector and set the VSCMG torque commands appropriately. It assumes that the ReadInputs method has already been run successfully.
- Parameters
CurrentTime – The current simulation time converted to a double
- Returns
void
-
void updateContributions(double integTime, BackSubMatrices &backSubContr, Eigen::Vector3d sigma_BN, Eigen::Vector3d omega_BN_B, Eigen::Vector3d g_N)¶
Back-sub contributions
-
void updateEnergyMomContributions(double integTime, Eigen::Vector3d &rotAngMomPntCContr_B, double &rotEnergyContr, Eigen::Vector3d omega_BN_B)¶
Energy and momentum calculations
-
void computeDerivatives(double integTime, Eigen::Vector3d rDDot_BN_N, Eigen::Vector3d omegaDot_BN_B, Eigen::Vector3d sigma_BN)¶
Method for each stateEffector to calculate derivatives
Public Members
-
std::vector<VSCMGConfigMsgPayload> VSCMGData¶
VSCMG data structure
-
Eigen::MatrixXd *g_N¶
[m/s^2] Gravitational acceleration in N frame components
-
ReadFunctor<VSCMGArrayTorqueMsgPayload> cmdsInMsg¶
motor torque command input message
-
Message<VSCMGSpeedMsgPayload> speedOutMsg¶
VSCMG speed output message
-
std::vector<Message<VSCMGConfigMsgPayload>*> vscmgOutMsgs¶
vector of VSCMG output messages
-
std::vector<VSCMGCmdMsgPayload> newVSCMGCmds¶
Incoming torque commands
-
VSCMGSpeedMsgPayload outputStates¶
(-) Output data from the VSCMGs
-
std::string nameOfVSCMGOmegasState¶
class variable
-
std::string nameOfVSCMGThetasState¶
class variable
-
std::string nameOfVSCMGGammasState¶
class variable
-
std::string nameOfVSCMGGammaDotsState¶
class variable
-
int numVSCMG¶
class variable
-
int numVSCMGJitter¶
class variable
-
BSKLogger bskLogger¶
BSK Logging
Private Members
-
VSCMGArrayTorqueMsgPayload incomingCmdBuffer¶
One-time allocation for savings
-
uint64_t prevCommandTime¶
Time for previous valid thruster firing
-
VSCMGStateEffector()¶