Module: mtbMomentumManagement
Executive Summary
This module computes the appropriate wheel torques and magnetic torque bar dipoles to bias the wheels to their desired speeds. Note that there is no gurantee that the wheel speeds will converge to their bias when less than 3 orthornormal torque rods are in use. In this case it is recommended that a nullspace controller be used to drive the wheels toward their bias. Documentation for the math used in this module can be found in a paper by Eric Hogan.
Message Connection Descriptions
The following table lists all the module input and output messages. The module msg connection 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 |
---|---|---|
rwParamsInMsg |
input message for RW parameters |
|
mtbParamsInMsg |
input message for MTB layout |
|
tamSensorBodyInMsg |
input message for magnetic field sensor data |
|
rwSpeedsInMsg |
input message for RW speeds |
|
rwMotorTorqueInMsg |
input message for RW motor torques |
|
mtbCmdOutMsg |
output message for MTB dipole commands |
|
rwMotorTorqueOutMsg |
output message for RW motor torques |
User Guide
See the example script scenarioMtbMomentumManagement for an illustration on how to use this module.
The user must set the momentum dumping gain value cGain
to a postive value. The required input messages are described above.
The optional module list wheelSpeedBiases
can be set to desired RW spin rates in terms of rad/sec. If this is not set,
the default values are zero rates.
Note that the MTB input configuration message variable GtMatrix_B
must be provided in a row major format.
Functions
-
void SelfInit_mtbMomentumManagement(mtbMomentumManagementConfig *configData, int64_t moduleID)
This method initializes the configData for this module. It checks to ensure that the inputs are sane and then creates the output message of type MTBCmdMsgPayload and ArrayMotorTorqueMsgPayload.
- Parameters:
configData – The configuration data associated with this module
moduleID – The module identifier
- Returns:
void
-
void Update_mtbMomentumManagement(mtbMomentumManagementConfig *configData, uint64_t callTime, int64_t moduleID)
Computes the appropriate wheel torques and magnetic torque bar dipoles to bias the wheels to their desired speeds.
- Parameters:
configData – The configuration data associated with the module
callTime – The clock time at which the function was called (nanoseconds)
moduleID – The module identifier
- Returns:
void
-
void Reset_mtbMomentumManagement(mtbMomentumManagementConfig *configData, uint64_t callTime, int64_t moduleID)
This method performs a complete reset of the module. Local module variables that retain time varying states between function calls are reset to their default values. The local copy of the message output buffer should be cleared.
- Parameters:
configData – The configuration data associated with the module
callTime – [ns] time the method is called
moduleID – The module identifier
- Returns:
void
-
void v3TildeM(double v[3], void *result)
-
struct mtbMomentumManagementConfig
- #include <mtbMomentumManagement.h>
Top level structure for the sub-module routines.
Public Members
-
double wheelSpeedBiases[MAX_EFF_CNT]
[rad/s] reaction wheel speed biases
-
double cGain
[1/s] reaction wheel momentum feedback gain
-
RWArrayConfigMsg_C rwParamsInMsg
input message for RW parameters
-
MTBArrayConfigMsg_C mtbParamsInMsg
input message for MTB layout
-
TAMSensorBodyMsg_C tamSensorBodyInMsg
input message for magnetic field sensor data in the Body frame
-
RWSpeedMsg_C rwSpeedsInMsg
input message for RW speeds
-
ArrayMotorTorqueMsg_C rwMotorTorqueInMsg
input message for RW motor torques
-
MTBCmdMsg_C mtbCmdOutMsg
output message for MTB dipole commands
-
ArrayMotorTorqueMsg_C rwMotorTorqueOutMsg
output message for RW motor torques
-
BSKLogger *bskLogger
BSK Logging.
-
double tauDesiredMTB_B[3]
[N-m] desired torque produced by the magnetic torque bars in the Body frame
-
double tauDesiredRW_B[3]
[N-m] desired torque produced by the reaction wheels in the Body frame
-
double hDeltaWheels_W[MAX_EFF_CNT]
[N-m-s] momentum of each wheel
-
double hDeltaWheels_B[3]
[N-m-s] momentum of reaction wheels in the Body frame
-
double tauDesiredRW_W[MAX_EFF_CNT]
[N-m] Desired individual wheel torques
-
double tauIdealRW_W[MAX_EFF_CNT]
[N-m-s] Ideal individual wheel torques
-
double tauIdealRW_B[MAX_EFF_CNT]
[N-m-s] Ideal wheel torque in the body frame
-
double wheelSpeedError_W[MAX_EFF_CNT]
[N-m-s] difference between current wheel speeds and desired wheel speeds
-
RWArrayConfigMsgPayload rwConfigParams
configuration for RW’s
-
MTBArrayConfigMsgPayload mtbConfigParams
configuration for MTB layout
-
double wheelSpeedBiases[MAX_EFF_CNT]