mtbMomentumManagementSimple#

Executive Summary#

This module computes the desired Body frame torque to dump the momentum in the reaction wheels.

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.

Module I/O Messages#

Msg Variable Name

Msg Type

Description

rwParamsInMsg

RWArrayConfigMsgPayload

input message for RW parameters

rwSpeedsInMsg

RWSpeedMsgPayload

input message for RW speeds

tauMtbRequestOutMsg

CmdTorqueBodyMsgPayload

output message containing control torque in the Body frame

Detailed Module Description#

The following presents the mathematics for computing the torque to be requested by the magnetic torque rods to drive the net momentum of the reaction wheels to zero.

Assume the spacecraft contains \(N_{\text{RW}}\) RWs. The net RW angular momentum is given by

\[{}^{\cal B} {\bf h}_{\text{wheels}} = \sum_{i=1}^{N_{\text{RW}}} \hat{\bf g}_{s_i} J_{s_i} \Omega_i\]

where \(\hat{\bf g}_{s_i}\) is the RW spin axis in the Body frame \(\cal B\), \(J_{s_i}\) is the spin axis RW inertia and \(\Omega_i\) is the RW speed rate about this axis. The desired torque to be produced by the torque rods to drive the wheel momentum to zero is then given by the proportional control law

\[{}^{\cal B} {\pmb\tau}_{\text{desired}} = - K_p \ {}^{\cal B} {\bf h}_{\text{wheels}}\]

where \(K_p\) is the proportional feedback gain with units of 1/s.

User Guide#

See the example script scenarioMtbMomentumManagementSimple for an illustration on how to use this module. Note that the user must set the momentum dumping gain value Kp to a postive value and GsMatrix_B must be specified in column major format.

Class MtbMomentumManagementSimple#

class MtbMomentumManagementSimple : public SysModel#

Top level structure for the sub-module routines.

Public Functions

void reset(uint64_t callTime) override#

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. Check if required input messages are connected.

Parameters:

callTime – [ns] time the method is called

Returns:

void

void updateState(uint64_t callTime) override#

This routine calculate the current desired torque in the Body frame to meet the momentum target.

Parameters:

callTime – The clock time at which the function was called (nanoseconds)

Returns:

void

Public Members

double Kp#

[1/s] momentum feedback gain

ReadFunctor<RWArrayConfigMsgPayload> rwParamsInMsg#

input message containing RW parameters

ReadFunctor<RWSpeedMsgPayload> rwSpeedsInMsg#

input message containingRW speeds

Message<CmdTorqueBodyMsgPayload> tauMtbRequestOutMsg#

output message containing control torque in the Body frame

RWArrayConfigMsgPayload rwConfigParams#

configuration for RW’s

double Gs[3 * MAX_EFF_CNT]#

transformation from the wheelspace to the Body frame

BSKLogger bskLogger = {}#

BSK Logging.