Module: thrMomentumDumping

Executive Summary

This module reads in the desired impulse that each thruster must produce to create inertial momentum change to despin the RWs.

The output of the module is a setup of thruster firing times. Each thruster can only fire for a maximum time that matches a single control period. After this the thrusters are off for an integer number of control periods to let the RW re-stabilize the attitude about an inertial pointing scenario. The module PDF Description contains further information on this module’s function, how to run it, as well as testing.

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.

../../../../_images/moduleImgThrMomentumDumping.svg

Figure 1: thrMomentumDumping() Module I/O Illustration

Module I/O Messages

Msg Variable Name

Msg Type

Description

thrusterOnTimeOutMsg

THRArrayOnTimeCmdMsgPayload

thruster on time output message

thrusterImpulseInMsg

THRArrayCmdForceMsgPayload

commanded thruster impulse input message

thrusterConfInMsg

THRArrayConfigMsgPayload

Thruster array configuration input message

deltaHInMsg

CmdTorqueBodyMsgPayload

requested momentum change input message


Functions

void SelfInit_thrMomentumDumping(thrMomentumDumpingConfig *configData, int64_t moduleID)

This method initializes the configData for this module. It creates a single output message of type THRArrayOnTimeCmdMsgPayload.

Parameters:
  • configData – The configuration data associated with this module

  • moduleID – The ID associated with the configData

Returns:

void

void Update_thrMomentumDumping(thrMomentumDumpingConfig *configData, uint64_t callTime, int64_t moduleID)

This method reads in the requested thruster impulse message. If it is a new message then a fresh thruster firing cycle is setup to achieve the desired RW momentum dumping. The the same message is read in, then the thrust continue to periodically fire to achieve the net thruster impuleses requested.

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_thrMomentumDumping(thrMomentumDumpingConfig *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 thrMomentumDumpingConfig
#include <thrMomentumDumping.h>

thruster force momentum dumping module configuration message

Public Members

int32_t thrDumpingCounter

counter to specify after how many contro period a thruster firing should occur.

double Delta_p[MAX_EFF_CNT]

vector of desired total thruster impulses

uint64_t lastDeltaHInMsgTime

time tag of the last momentum change input message

double thrOnTimeRemaining[MAX_EFF_CNT]

vector of remaining thruster on times

uint64_t priorTime

[ns] Last time the attitude control is called

int numThrusters

number of thrusters installed

double thrMaxForce[MAX_EFF_CNT]

[N] vector of maximum thruster forces

int maxCounterValue

this variable must be set to a non-zero value, indicating how many control periods to wait until the thrusters fire again to dump RW momentum

double thrMinFireTime

[s] smallest thruster firing time

THRArrayOnTimeCmdMsg_C thrusterOnTimeOutMsg

thruster on time output message name

THRArrayCmdForceMsg_C thrusterImpulseInMsg

desired thruster impulse input message name

THRArrayConfigMsg_C thrusterConfInMsg

The name of the thruster configuration Input message.

CmdTorqueBodyMsg_C deltaHInMsg

The name of the requested momentum change input message.

BSKLogger *bskLogger

BSK Logging.