Module: torque2Dipole

Executive Summary

This module computes a Body frame reequested dipole given a requested body torque and magnetic field vector.

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

tamSensorBodyInMsg

TAMSensorBodyMsgPayload

input message for magnetic field sensor data

tauRequestInMsg

CmdTorqueBodyMsgPayload

input message containing control torque in the Body frame

dipoleRequestOutMsg

DipoleRequestBodyMsgPayload

output message containing dipole request in the Body frame

Detailed Module Description

The following presents the mathematics for converting a requested Body torque into a requested Body dipole to be produced the torque rods given the local magnetic field vector. The desired Body frame dipole is given by

\[{}^{\cal B} {\pmb\mu}_{\text{desired}} = \frac{1}{|\bf b|^2} {}^{\cal B}{\bf b} \times \ {}^{\cal B} {\pmb\tau}_{\text{desired}} = [G_t] {\pmb\mu}_{\text{cmd}}\]

where \(\bf b\) is the local magnetic field vector and \([G_t]\) is a 3 \(\times N_{\text{MTB}}\) matrix that transforms the individual rod dipoles to the Body frame.

User Guide

See the example script scenarioMtbMomentumManagementSimple for an illustration on how to use this module.


Functions

void SelfInit_torque2Dipole(torque2DipoleConfig *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_torque2Dipole(torque2DipoleConfig *configData, uint64_t callTime, int64_t moduleID)

This method transforms the requested torque from the torque rods into a Body frame requested dipole from the torque rods.

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_torque2Dipole(torque2DipoleConfig *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 torque2DipoleConfig
#include <torque2Dipole.h>

Top level structure for the sub-module routines.

Public Members

TAMSensorBodyMsg_C tamSensorBodyInMsg

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

CmdTorqueBodyMsg_C tauRequestInMsg

[N-m] input message containing control torque in the Body frame

DipoleRequestBodyMsg_C dipoleRequestOutMsg

[A-m2] output message containing dipole request in the Body frame

BSKLogger *bskLogger

BSK Logging.