Module: rwMotorTorque

Executive Summary

This module maps a desired torque to control the spacecraft, and maps it to the available wheels using a minimum norm inverse fit.

The optional wheel availability message is used to include or exclude particular reaction wheels from the torque solution. The desired control torque can be mapped onto particular orthogonal control axes to implement a partial solution for the overall attitude control torque. More information can be found in the PDF Description.

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

rwMotorTorqueOutMsg

ArrayMotorTorqueMsgPayload

RW motor torque output message

vehControlInMsg

CmdTorqueBodyMsgPayload

commanded vehicle control torque input message

rwParamsInMsg

RWArrayConfigMsgPayload

RW array configuration input message

rwAvailInMsg

RWAvailabilityMsgPayload

(optional) RW device availability message


Functions

void SelfInit_rwMotorTorque(rwMotorTorqueConfig *configData, int64_t moduleID)

This method creates the module output message.

Parameters
  • configData – The configuration data associated with this module

  • moduleID – The ID associated with the configData

Returns

void

void Update_rwMotorTorque(rwMotorTorqueConfig *configData, uint64_t callTime, int64_t moduleID)

Add a description of what this main Update() routine does for this module

Parameters
  • configData – The configuration data associated with the module

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

  • moduleID – The ID associated with the configData

Returns

void

void Reset_rwMotorTorque(rwMotorTorqueConfig *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.

Parameters
  • configData – The configuration data associated with the module

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

  • moduleID – The ID associated with the configData

Returns

void

struct rwMotorTorqueConfig
#include <rwMotorTorque.h>

Top level structure for the sub-module routines.

Public Members

double controlAxes_B[3 * 3]

[-] array of the control unit axes

uint32_t numControlAxes

[-] counter indicating how many orthogonal axes are controlled

int numAvailRW

[-] number of reaction wheels available

RWArrayConfigMsgPayload rwConfigParams

[-] struct to store message containing RW config parameters in body B frame

double GsMatrix_B[3 * MAX_EFF_CNT]

[-] The RW spin axis matrix in body frame components

double CGs[3][MAX_EFF_CNT]

[-] Projection matrix that defines the controlled body axes

ArrayMotorTorqueMsg_C rwMotorTorqueOutMsg

RW motor torque output message.

CmdTorqueBodyMsg_C vehControlInMsg

vehicle control (Lr) Input message

RWArrayConfigMsg_C rwParamsInMsg

RW Array input message.

RWAvailabilityMsg_C rwAvailInMsg

optional RWs availability input message

BSKLogger *bskLogger

BSK Logging.