Module: hingedRigidBodyStateEffector

This class is an instantiation of the stateEffector class and is a hinged rigid body effector. This effector is a rigid body attached to the hub through a torsional spring and damper that approximates a flexible appendage. See Allard, Schaub, and Piggott paper: General Hinged Solar Panel Dynamics Approximating First-Order Spacecraft Flexing for a detailed description of this model. A hinged rigid body has 2 states: theta and thetaDot

The module PDF Description contains further information on this module’s function, how to run it, as well as testing.


class HingedRigidBodyStateEffector : public StateEffector, public SysModel

Public Functions

HingedRigidBodyStateEffector()

Contructor

This is the constructor, setting variables to default values

~HingedRigidBodyStateEffector()

Destructor

This is the destructor, nothing to report here

void SelfInit()

This method initializes the object. It creates the module’s output messages.

Return

void

void CrossInit()

This method subscribes to messages the HRB needs.

Return

void

void writeOutputStateMessages(uint64_t CurrentClock)

This method takes the computed theta states and outputs them to the m messaging system.

Return

void

Parameters
  • CurrentClock: The current simulation time (used for time stamping)

void UpdateState(uint64_t CurrentSimNanos)

This method is used so that the simulation will ask HRB to update messages.

Return

void

Parameters
  • CurrentSimNanos: The current simulation time in nanoseconds

void registerStates(DynParamManager &statesIn)

Method for registering the HRB states

This method allows the HRB state effector to register its states: theta and thetaDot with the dyn param manager

void linkInStates(DynParamManager &states)

Method for getting access to other states

This method allows the HRB state effector to have access to the hub states and gravity

void updateContributions(double integTime, BackSubMatrices &backSubContr, Eigen::Vector3d sigma_BN, Eigen::Vector3d omega_BN_B, Eigen::Vector3d g_N)

Method for back-sub contributions

This method allows the HRB state effector to give its contributions to the matrices needed for the back-sub method

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

Method for HRB to compute its derivatives

This method is used to find the derivatives for the HRB stateEffector: thetaDDot and the kinematic derivative

void updateEffectorMassProps(double integTime)

Method for giving the s/c the HRB mass props and prop rates

This method allows the HRB state effector to provide its contributions to the mass props and mass prop rates of the spacecraft

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

Computing energy and momentum for HRBs

This method is for calculating the contributions of the HRB state effector to the energy and momentum of the s/c

void calcForceTorqueOnBody(double integTime, Eigen::Vector3d omega_BN_B)

Force and torque on s/c due to HRBs

void prependSpacecraftNameToStates()

Public Members

double mass

[kg] mass of hinged rigid body

double d

[m] distance from hinge point to hinged rigid body center of mass

double k

[N-m/rad] torsional spring constant of hinge

double c

[N-m-s/rad] rotational damping coefficient of hinge

double thetaInit

[rad] Initial hinged rigid body angle

double thetaDotInit

[rad/s] Initial hinged rigid body angle rate

std::string nameOfThetaState

Identifier for the theta state data container

std::string nameOfThetaDotState

Identifier for the thetaDot state data container

Eigen::MatrixXd *c_B

[m] Vector from point B to CoM of s/c in B frame components

Eigen::MatrixXd *cPrime_B

[m/s] Body time derivative of vector c_B in B frame components

Eigen::Matrix3d IPntS_S

[kg-m^2] Inertia of hinged rigid body about point S in S frame components

Eigen::Vector3d r_HB_B

[m] vector pointing from body frame origin to Hinge location

Eigen::Matrix3d dcm_HB

DCM from body frame to hinge frame

std::string HingedRigidBodyOutMsgName

state output message name

HingedRigidBodySimMsg HRBoutputStates

instance of messaging system message struct

BSKLogger bskLogger

BSK Logging

Private Members

double theta

[rad] hinged rigid body angle

double thetaDot

[rad/s] hinged rigid body angle rate

double cTheta

term needed for back substitution

Eigen::Vector3d r_HP_P

[m] vector pointing from body frame origin to Hinge location

Eigen::Matrix3d dcm_HP

DCM from body frame to hinge frame

Eigen::Vector3d aTheta

term needed for back substitution

Eigen::Vector3d bTheta

term needed for back substitution

Eigen::Matrix3d rTilde_HP_P

Tilde matrix of rHB_B

Eigen::Matrix3d dcm_SH

DCM from hinge to hinged rigid body frame, S

Eigen::Matrix3d dcm_SP

DCM from body to S frame

Eigen::Vector3d omega_PN_S

[rad/s] omega_BN in S frame components

Eigen::Vector3d sHat1_P

unit direction vector for the first axis of the S frame

Eigen::Vector3d sHat2_P

unit direction vector for the second axis of the S frame

Eigen::Vector3d sHat3_P

unit direction vector for the third axis of the S frame

Eigen::Vector3d r_SP_P

Vector pointing from B to CoM of hinged rigid body in B frame components

Eigen::Matrix3d rTilde_SP_P

Tilde matrix of rSB_B

Eigen::Vector3d rPrime_SP_P

[m/s] Body time derivative of rSB_B

Eigen::Matrix3d rPrimeTilde_SP_P

Tilde matrix of rPrime_SB_B

Eigen::Matrix3d ISPrimePntS_P

[kg-m^2/s] time body derivative IPntS in body frame components

Eigen::Vector3d omegaLoc_PN_P

[rad/s] local copy of omegaBN

Eigen::Matrix3d omegaTildeLoc_PN_P

tilde matrix of omegaBN

StateData *thetaState

state manager of theta for hinged rigid body

StateData *thetaDotState

state manager of thetaDot for hinged rigid body

int64_t HingedRigidBodyOutMsgId

state output message ID