Module: dipoleMapping

Executive Summary

This module computes individual torque rod dipole commands taking into account saturation limits.

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

mtbParamsInMsg

MTBArrayConfigMsgPayload

input message for MTB layout

dipoleRequestBodyInMsg

DipoleRequestBodyMsgPayload

input message containing the requested body frame dipole

dipoleRequestMtbOutMsg

MTBCmdMsgPayload

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

Detailed Module Description

The following presents the mathematics for mapping a Body frame dipole request into individual torque rod dipole commands.

The individual rod dipoles are given by

\[{\pmb \mu}_{\text{cmd}} = [G_t]^{\dagger} \ {}^{\cal B} {\pmb\mu}_{\text{desired}}\]

where the \(\dagger\) symbol denotes the pseudo inverse. The dipole commands may need to be saturated at this point. The saturated commands are referred to as \({\pmb\mu}_{\text{saturated}}\) from here on out in this document.

User Guide

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

Note that user must set the torque rod alignment matrix GtMatrix_B and the steeringMatrix in row major format. Also note that steeringMatrix is simply the psuedoinverse of the torque rod alignment matrix


Functions

void SelfInit_dipoleMapping(dipoleMappingConfig *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_dipoleMapping(dipoleMappingConfig *configData, uint64_t callTime, int64_t moduleID)

This method computes takes a requested Body frame dipole into individual torque rod dipole commands using a psuedoinverse taking into account saturation limits of 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_dipoleMapping(dipoleMappingConfig *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 dipoleMappingConfig
#include <dipoleMapping.h>

Top level structure for the sub-module routines.

Public Members

double steeringMatrix[MAX_EFF_CNT * 3]

matrix for mapping body frame dipole request to individual torque bar dipoles

MTBArrayConfigMsg_C mtbArrayConfigParamsInMsg

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

DipoleRequestBodyMsg_C dipoleRequestBodyInMsg

[A-m2] input message containing the requested body frame dipole

MTBCmdMsg_C dipoleRequestMtbOutMsg

[A-m2] output message containing the individual dipole requests for each torque bar on the vehicle

MTBArrayConfigMsgPayload mtbArrayConfigParams

configuration parameters for all the torque bars used on the vehicle

BSKLogger *bskLogger

BSK Logging.