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.

Module I/O Messages

Msg Variable Name

Msg Type

Description

cmdsInMsg

VSCMGArrayTorqueMsgPayload

motor torque command input message

speedOutMsg

VSCMGSpeedMsgPayload

VSCMG speed output message

vscmgOutMsgs

VSCMGConfigMsgPayload

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)

&#8212; Back-sub contributions

void updateEnergyMomContributions(double integTime, Eigen::Vector3d &rotAngMomPntCContr_B, double &rotEnergyContr, Eigen::Vector3d omega_BN_B)

&#8212; Energy and momentum calculations

void computeDerivatives(double integTime, Eigen::Vector3d rDDot_BN_N, Eigen::Vector3d omegaDot_BN_B, Eigen::Vector3d sigma_BN)

&#8212; Method for each stateEffector to calculate derivatives

Public Members

std::vector<VSCMGConfigMsgPayload> VSCMGData

&#8212; VSCMG data structure

Eigen::MatrixXd *g_N

[m/s^2] Gravitational acceleration in N frame components

ReadFunctor<VSCMGArrayTorqueMsgPayload> cmdsInMsg

&#8212; motor torque command input message

Message<VSCMGSpeedMsgPayload> speedOutMsg

&#8212; VSCMG speed output message

std::vector<Message<VSCMGConfigMsgPayload>*> vscmgOutMsgs

&#8212; vector of VSCMG output messages

std::vector<VSCMGCmdMsgPayload> newVSCMGCmds

&#8212; 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

&#8212; BSK Logging

Private Members

VSCMGArrayTorqueMsgPayload incomingCmdBuffer

&#8212; One-time allocation for savings

uint64_t prevCommandTime

&#8212; Time for previous valid thruster firing

StateData *hubSigma

class variable

StateData *hubOmega

class variable

StateData *hubVelocity

class variable

StateData *OmegasState

class variable

StateData *thetasState

class variable

StateData *gammasState

class variable

StateData *gammaDotsState

class variable