C++ Module: nHingedRigidBodyStateEffector
Executive Summary
This class is an instantiation of the stateEffector class and is a N-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.
Important
The equations of motion are derived for a chain of identical panels. Every panel must carry the
same positive mass and the same hinge to center of mass distance d, and each hinge sits
2d from the one before it. The panel inertia IPntS_S may differ from panel to panel.
Initialization rejects a chain that violates the mass or distance requirement. An uneven chain
is modeled with C++ Module: dualHingedRigidBodyStateEffector for two panels, or with
C++ Module: spinningBodyNDOFStateEffector for an arbitrary number.
Message Connection Descriptions
The following table lists all the module output messages. Each is a vector carrying one message per panel, ordered outward from the hub.
Msg Variable Name |
Msg Type |
Description |
|---|---|---|
nHingedRigidBodyOutMsgs |
Output vector of messages containing the panel angle and angle rate. |
|
nHingedRigidBodyConfigLogOutMsgs |
Output vector of messages containing the panel inertial states. The position and velocity are those of the panel center of mass, and the attitude and angular velocity are those of the panel frame S. |
-
struct HingedPanel
- #include <nHingedRigidBodyStateEffector.h>
Struct containing all the panel variables. All members are public by default so they can be changed by methods of the N_hingedRigidBodyStateEffector class.
Public Functions
-
template<typename Type>
inline void assignStateParamNames(Type effector) Assign this panel’s state-engine property names to an attached effector.
- Template Parameters:
Type – Pointer type for an effector that accepts inertial property names.
- Parameters:
effector – Effector that receives the panel’s inertial property names.
Public Members
-
double mass = 1.0
[kg] mass of hinged panel
-
double d = 1.0
[m] distance from hinge point to hinged rigid body center of mass
-
double k = 1.0
[N-m/rad] torsional spring constant of hinge
-
double c = 0.0
[N-m-s/rad] rotational damping coefficient of hinge
-
double thetaInit = 0.0
[rad] Initial hinged rigid body angle
-
double thetaDotInit = 0.0
[rad/s] Initial hinged rigid body angle rate
-
double theta = 0.0
[rad] hinged rigid body angle
-
double theta_0 = 0.0
[rad] hinged rigid body rest angle
-
double thetaDot = 0.0
[rad/s] hinged rigid body angle rate
-
Eigen::Vector3d r_SB_B
— Vector pointing from B to CoM of hinged rigid body in B frame components
-
std::string nameOfInertialPositionProperty
— identifier for the inertial position property
-
std::string nameOfInertialVelocityProperty
— identifier for the inertial velocity property
-
std::string nameOfInertialAttitudeProperty
— identifier for the inertial attitude property
-
std::string nameOfInertialAngVelocityProperty
— identifier for the inertial angular velocity property
-
Eigen::MatrixXd *r_HN_N = nullptr
[m] position vector of the panel hinge H relative to the inertial frame
-
Eigen::MatrixXd *v_HN_N = nullptr
[m/s] inertial velocity vector of H relative to the inertial frame
-
Eigen::MatrixXd *sigma_SN = nullptr
— MRP attitude of panel frame S relative to the inertial frame
-
std::vector<DynamicEffector*> dynEffectors
— Vector of dynamic effectors attached to this panel
-
template<typename Type>
-
class NHingedRigidBodyStateEffector : public StateEffector, public SysModel
- #include <nHingedRigidBodyStateEffector.h>
NHingedRigidBodyStateEffector class.
Public Functions
-
void addHingedPanel(HingedPanel NewPanel)
class method
This method appends a panel to the chain along with its output messages
- Parameters:
NewPanel – the panel to append to the chain
-
NHingedRigidBodyStateEffector()
— Contructor
This is the constructor, setting variables to default values
-
~NHingedRigidBodyStateEffector()
— Destructor
This is the destructor, releasing the per panel output messages
-
double HeaviFunc(double cond)
— Heaviside function used for matrix contributions
Method for defining the Heaviside function for the EOMs */
-
void writeOutputStateMessages(uint64_t CurrentClock) override
This method takes the computed theta states and outputs them to the messaging system.
- Parameters:
CurrentClock – The current simulation time (used for time stamping)
-
void UpdateState(uint64_t CurrentSimNanos) override
This method is used so that the simulation will ask HRB to update messages.
- Parameters:
CurrentSimNanos – The current simulation time in nanoseconds
-
void registerStates(DynParamManager &statesIn) override
— 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 registerProperties(DynParamManager &states) override
— Method for registering the panel properties
This method registers the panel inertial properties with the dynamic parameter manager and links them into dependent dynamic effectors
-
void addDynamicEffector(DynamicEffector *newDynamicEffector, int segment) override
— Attach an effector
This method attaches a dynamicEffector to one of the panels
- Parameters:
newDynamicEffector – the dynamic effector to be attached
segment – the panel to attach to, counting outward from the hub starting at 1
-
void linkInStates(DynParamManager &states) override
— Method for getting access to other states
This method allows the HRB state effector to have access to the hub states and gravity
-
void updateEffectorMassProps(double integTime) override
— Method for stateEffector to give mass contributions
This method allows the HRB state effector to provide its contributions to the mass props and mass prop rates of the spacecraft
-
void updateContributions(double integTime, BackSubMatrices &backSubContr, Eigen::MRPd sigma_BN, Eigen::Vector3d omega_BN_B, Eigen::Vector3d g_N) override
— Back-sub contributions
This method allows the HRB state effector to give its contributions to the matrices needed for the back-sub method
-
void updateEnergyMomContributions(double integTime, Eigen::Vector3d &rotAngMomPntCContr_B, double &rotEnergyContr, Eigen::Vector3d omega_BN_B) override
— Energy and momentum calculations
This method is for calculating the contributions of the HRB state effector to the energy and momentum of the s/c
Public Members
-
std::string nameOfThetaState
— Identifier for the theta state data container
-
std::string nameOfThetaDotState
— Identifier for the thetaDot state data container
-
BSKLogger bskLogger
— BSK Logging
-
std::vector<Message<HingedRigidBodyMsgPayload>*> nHingedRigidBodyOutMsgs
— panel state output messages
-
std::vector<Message<SCStatesMsgPayload>*> nHingedRigidBodyConfigLogOutMsgs
— panel config log messages
Private Functions
-
void checkPanelUniformity()
— Method for rejecting a panel chain the EOMs cannot represent
This method checks that the panel chain is one the equations of motion can represent
-
void computePanelInertialStates()
— Method for computing the panel states relative to the inertial frame
This method computes the panel states relative to the inertial frame
Private Members
-
double totalMass
[kg] Total mass of effector
-
std::vector<HingedPanel> PanelVec
— vector containing all the info on the different panels
-
Eigen::MatrixXd *inertialPositionProperty = nullptr
[m] r_N position relative to system spice zeroBase
-
Eigen::MatrixXd *inertialVelocityProperty = nullptr
[m/s] v_N velocity relative to system spice zeroBase
-
std::string propertyNameIndex
— effector identifier used to name the per panel properties
-
bool hasAttachedEffectors = false
— true once any panel carries a dynamic effector
Private Static Attributes
-
static uint64_t effectorID = 1
[] ID number of this panel
-
void addHingedPanel(HingedPanel NewPanel)