Module: dualHingedRigidBodyStateEffector¶
Executive Summary¶
Class to represent a solar array of two panels. The first panel is hinged on a single axis to the spacecraft body. The second panel is hinged to the first panel by a parallel axis on the opposite end of the first panel from the spacecraft body.)
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.
Figure 1: DualHingedRigidBodyStateEffector()
Module I/O Illustration¶
Msg Variable Name |
Msg Type |
Description |
---|---|---|
motorTorqueInMsgName |
(Optional) Input message of the two hinge motor torque values |
|
dualHingedRigidBodyOutMsgName + |
Output message containing the panel 1 hinge state angle and angle rate |
|
dualHingedRigidBodyOutMsgName + |
Output message containing the panel 2 hinge state angle and angle rate |
|
dualHingedRigidBodyConfigLogOutMsgName + |
Output message containing the panel 1 inertial position and attitude states |
|
dualHingedRigidBodyConfigLogOutMsgName + |
Output message containing the panel 2 inertial position and attitude states |
Detailed Module Description¶
The module PDF Module Description
contains further information on this module’s function, as well as testing.
User Guide¶
This section is to outline the steps needed to setup a Hinged Rigid Body State Effector in python using Basilisk.
Import the dualHingedRigidBodyStateEffector class:
from Basilisk.simulation import dualHingedRigidBodyStateEffector
Create an instantiation of a Dual Hinged Rigid body:
panel1 = dualHingedRigidBodyStateEffector.DualHingedRigidBodyStateEffector()
Define all physical parameters for a Dual Hinged Rigid Body. For example:
IPntS1_S1 = [[100.0, 0.0, 0.0], [0.0, 50.0, 0.0], [0.0, 0.0, 50.0]]
Do this for all of the parameters for a Dual Hinged Rigid Body seen in the public variables in the .h file.
Define the initial conditions of the states:
panel1.theta1Init = 5*numpy.pi/180.0 panel1.theta1DotInit = 0.0 panel1.theta2Init = 5*numpy.pi/180.0 panel1.theta2DotInit = 0.0
Define a unique name for each state:
panel1.nameOfTheta1State = "dualHingedRigidBodyTheta1" panel1.nameOfTheta1DotState = "dualHingedRigidBodyThetaDot1" panel1.nameOfTheta2State = "dualHingedRigidBodyTheta2" panel1.nameOfTheta2DotState = "dualHingedRigidBodyThetaDot2"
Define an optional motor torque input message:
panel1.motorTorqueInMsgName = "motorTorque"
The module creates two output messages with the panel angular states. The message name is composed of the string
dualHingedRigidBodyOutMsgName
and appended with either_OutputStates0
or_OutputStates1
. If this base string is not set, then the moduleModuleTag
string is used as the base string. An example of setting the base msg string is:panel1.dualHingedRigidBodyOutMsgName = "panel1Angles"
The module creates two output messages with each panel inertial position and attitude states. The message name is composed of the string
dualHingedRigidBodyConfigLogOutMsgName
and appended with either_InertialStates0
or_InertialStates1
. If this base string is not set, then the moduleModuleTag
string is used as the base string. An example of setting the base msg string is:panel1.dualHingedRigidBodyConfigLogOutMsgName = "panel1Log"
Add the panel to your spacecraftPlus:
scObject.addStateEffector(panel1)
Add the module to the task list:
unitTestSim.AddModelToTask(unitTaskName, panel1)
-
class
DualHingedRigidBodyStateEffector
: public StateEffector, public SysModel¶ - #include <dualHingedRigidBodyStateEffector.h>
dual hinged rigid body state effector
Public Functions
-
DualHingedRigidBodyStateEffector
()¶
-
~DualHingedRigidBodyStateEffector
()¶
-
void
registerStates
(DynParamManager &statesIn)¶ class method
-
void
linkInStates
(DynParamManager &states)¶ class method
-
void
updateEffectorMassProps
(double integTime)¶ class method
-
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
This method is for calculating the contributions of the DHRB state effector to the energy and momentum of the s/c
-
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
-
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
UpdateState
(uint64_t CurrentSimNanos)¶ This method is used so that the simulation will ask DHRB to update messages.
- Return
void
- Parameters
CurrentSimNanos
: The current simulation time in nanoseconds
-
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)
Public Members
-
double
mass1
¶ [kg] mass of 1st hinged rigid body
-
double
mass2
¶ [kg] mass of 2nd hinged rigid body
-
double
d1
¶ [m] distance from hinge point H1 to hinged rigid body center of mass S1
-
double
d2
¶ [m] distance from hinge point H2 to hinged rigid body center of mass S2
-
double
l1
¶ [m] distance from hinge point H1 to hinged point H2
-
double
k1
¶ [N-m/rad] torsional spring constant of hinge
-
double
k2
¶ [N-m/rad] torsional spring constant of hinge
-
double
c1
¶ [N-m-s/rad] rotational damping coefficient of hinge
-
double
c2
¶ [N-m-s/rad] rotational damping coefficient of hinge
-
double
theta1Init
¶ [rad] Initial hinged rigid body angle for first panel
-
double
theta1DotInit
¶ [rad/s] Initial hinged rigid body angle rate for first panel
-
double
theta2Init
¶ [rad] Initial hinged rigid body angle for second panel
-
double
theta2DotInit
¶ [rad/s] Initial hinged rigid body angle rate for second panel
-
Eigen::Matrix3d
IPntS1_S1
¶ [kg-m^2] Inertia of hinged rigid body about point S in S frame components
-
Eigen::Matrix3d
IPntS2_S2
¶ [kg-m^2] Inertia of hinged rigid body about point S in S frame components
-
Eigen::Vector3d
r_H1B_B
¶ [m] vector pointing from body frame origin to Hinge location
-
Eigen::Matrix3d
dcm_H1B
¶ [-] DCM from body frame to hinge frame
-
double
thetaH2S1
¶ [-] theta offset of H2 frame with respect to S1 frame
-
std::string
nameOfTheta1State
¶ [-] Identifier for the theta state data container
-
std::string
nameOfTheta1DotState
¶ [-] Identifier for the thetaDot state data container
-
std::string
nameOfTheta2State
¶ [-] Identifier for the theta state data container
-
std::string
nameOfTheta2DotState
¶ [-] Identifier for the thetaDot state data container
-
Eigen::MatrixXd *
g_N
¶ [m/s^2] Gravitational acceleration in N frame components
-
BSKLogger
bskLogger
¶ BSK Logging
-
std::string
motorTorqueInMsgName
¶ (optional) motor torque input message name
-
std::string
dualHingedRigidBodyOutMsgName
¶ state output message base name for all panels
-
std::string
dualHingedRigidBodyConfigLogOutMsgName
¶ panel state config log message base name for all panels
Private Functions
-
void
computePanelInertialStates
()¶ This method computes the panel states relative to the inertial frame
- Return
void
-
void
prependSpacecraftNameToStates
()¶ class method
Private Members
-
Eigen::Vector3d
r_H1P_P
¶ [m] vector pointing from primary body frame P origin to Hinge 1 location. If a single spacecraft body is modeled than P is the same as B
-
Eigen::Matrix3d
dcm_H1P
¶ DCM from primary body frame to hinge 1 frame
-
double
u1
¶ [N-m] motor torques on panel 1
-
double
u2
¶ [N-m] motor torques on panel 2
-
Eigen::Matrix3d
rTildeH1B_B
¶ [-] Tilde matrix of rHB_B
-
Eigen::Matrix3d
dcm_S1P
¶ [-] DCM from primary body to S1 frame
-
Eigen::Matrix3d
dcm_S2P
¶ [-] DCM from primary body to S2 frame
-
Eigen::Vector3d
omega_PN_S1
¶ [rad/s] omega_PN in S1 frame components
-
Eigen::Vector3d
omega_PN_S2
¶ [rad/s] omega_PN in S2 frame components
-
Eigen::Vector3d
sHat11_P
¶ [-] unit direction vector for the first axis of the S frame
-
Eigen::Vector3d
sHat12_P
¶ [-] unit direction vector for the second axis of the S frame
-
Eigen::Vector3d
sHat13_P
¶ [-] unit direction vector for the third axis of the S frame
-
Eigen::Vector3d
sHat21_P
¶ [-] unit direction vector for the first axis of the S frame
-
Eigen::Vector3d
sHat22_P
¶ [-] unit direction vector for the second axis of the S frame
-
Eigen::Vector3d
sHat23_P
¶ [-] unit direction vector for the third axis of the S frame
-
Eigen::Vector3d
r_S1P_P
¶ [-] Vector pointing from body origin to CoM of hinged rigid body in P frame comp
-
Eigen::Vector3d
r_S2P_P
¶ [-] Vector pointing from body origin to CoM of hinged rigid body in P frame comp
-
Eigen::Matrix3d
rTildeS1P_P
¶ [-] Tilde matrix of rSP_P
-
Eigen::Matrix3d
rTildeS2P_P
¶ [-] Tilde matrix of rSP_P
-
Eigen::Vector3d
rPrimeS1P_P
¶ [m/s] Body time derivative of rSP_P
-
Eigen::Vector3d
rPrimeS2P_P
¶ [m/s] Body time derivative of rSBP_P
-
Eigen::Matrix3d
rPrimeTildeS1P_P
¶ [-] Tilde matrix of rPrime_SP_P
-
Eigen::Matrix3d
rPrimeTildeS2P_P
¶ [-] Tilde matrix of rPrime_SP_P
-
Eigen::Matrix3d
IS1PrimePntS1_P
¶ [kg-m^2/s] time body derivative IPntS in primary body frame components
-
Eigen::Matrix3d
IS2PrimePntS2_P
¶ [kg-m^2/s] time body derivative IPntS in primary body frame components
-
Eigen::Vector3d
omega_PNLoc_P
¶ [rad/s] local copy of omegaPN
-
Eigen::Matrix3d
omegaTildePNLoc_P
¶ [-] tilde matrix of omegaPN
-
double
theta1
¶ [rad] hinged rigid body angle
-
double
theta1Dot
¶ [rad/s] hinged rigid body angle rate
-
double
theta2
¶ [rad] hinged rigid body angle
-
double
theta2Dot
¶ [rad/s] hinged rigid body angle rate
-
Eigen::Matrix2d
matrixADHRB
¶ [-] term needed for back substitution
-
Eigen::Matrix2d
matrixEDHRB
¶ [-] term needed for back substitution
-
Eigen::MatrixXd
matrixFDHRB
¶
-
Eigen::MatrixXd
matrixGDHRB
¶
-
Eigen::Vector2d
vectorVDHRB
¶
-
int64_t
motorTorqueInMsgId
¶ motor torque message ID
-
int64_t
dualHingedRigidBodyOutMsgId
[2]¶ state output message ID of all panels
-
int64_t
dualHingedRigidBodyConfigLogOutMsgId
[2]¶ panel state config log msg ID of all panels
-
Eigen::Vector3d
r_SN_N
[2]¶ [m] position vector of hinge CM S relative to inertial frame
-
Eigen::Vector3d
v_SN_N
[2]¶ [m/s] inertial velocity vector of S relative to inertial frame
-
Eigen::Vector3d
sigma_SN
[2]¶ MRP attitude of panel frame S relative to inertial frame
-
Eigen::Vector3d
omega_SN_S
[2]¶ [rad/s] inertial panel frame angular velocity vector
-