Module: mtbFeedforward

Executive Summary

This module computes the torque produced by the magnetic torque bars and applies it to the current commanded body torque as a feedforward term.

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

vehControlInMsg

CmdTorqueBodyMsgPayload

input message containing the current control torque in the Body frame

dipoleRequestMtbInMsg

MTBCmdMsgPayload

input message containing the individual dipole requests for each torque bar on the vehicle

tamSensorBodyInMsg

TAMSensorBodyMsgPayload

input message for magnetic field sensor data

mtbParamsInMsg

MTBArrayConfigMsgPayload

input message for MTB layout

vehControlOutMsg

CmdTorqueBodyMsgPayload

output message containing the current control torque in the Body frame

Detailed Module Description

The following presents the mathematics for computing the expected torque produced by the torque rods given their alignment matrix, Gt, the individual rod dipole commands, and the local magnetic field vector in the Body frame. This value is then fed forward to reaction wheels by adding it to the current command Body frame torque to drive the net momentum of the reaction wheel system to zero.

The expected torque produced by the torque rods is given by

\[{}^{\cal B} {\pmb \tau}_{\text{rods}} = [G_t] {\pmb\mu}_{\text{cmds}} \times \ {}^{\cal B}{\bf b}\]

and the feed forward command used to dump the momentum of the reaction wheels is simply the negation of the expected torque produced by the rods.

\[{}^{\cal B} {\pmb\tau}_{\text{ff}} = - {}^{\cal B}{\pmb\tau}_{\text{rods}}\]

User Guide

See the example script scenarioMtbMomentumManagementSimple for an illustration on how to use this module. Note that the user must specify the torque rod alignment matrix GtMatrix_B in row major form.


Functions

void SelfInit_mtbFeedforward(mtbFeedforwardConfig *configData, int64_t moduleID)

This method initializes the output messages for this module.

Parameters
  • configData – The configuration data associated with this module

  • moduleID – The module identifier

Returns

void

void Update_mtbFeedforward(mtbFeedforwardConfig *configData, uint64_t callTime, int64_t moduleID)

Computes the feedforward torque rod torque.

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

Parameters
  • configData – The configuration data associated with the module

  • callTime – [ns] time the method is called

  • moduleID – The module identifier

Returns

void

struct mtbFeedforwardConfig
#include <mtbFeedforward.h>

Top level structure for the sub-module routines.

Public Members

CmdTorqueBodyMsg_C vehControlInMsg

input message containing the current control torque in the Body frame

MTBCmdMsg_C dipoleRequestMtbInMsg

input message containing the individual dipole requests for each torque bar on the vehicle

TAMSensorBodyMsg_C tamSensorBodyInMsg

[Tesla] input message for magnetic field sensor data in the Body frame

MTBArrayConfigMsg_C mtbArrayConfigParamsInMsg

input message containing configuration parameters for all the torque bars on the vehicle

CmdTorqueBodyMsg_C vehControlOutMsg

output message containing the current control torque in the Body frame

MTBArrayConfigMsgPayload mtbArrayConfigParams

configuration for MTB layout

BSKLogger *bskLogger

BSK Logging.