Module: thrustRWDesat

This algorithm is used to control both the RCS and DV thrusters when executing a trajectory adjustment.


Functions

void SelfInit_thrustRWDesat(thrustRWDesatConfig *configData, int64_t moduleID)

This method initializes the configData for the thruster-based RW desat module. It checks to ensure that the inputs are sane and then creates the output message

Return

void

Parameters
  • configData: The configuration data associated with the thruster desat

  • moduleID: The module ID associated with configData

void CrossInit_thrustRWDesat(thrustRWDesatConfig *configData, int64_t moduleID)

This method performs the second stage of initialization for the thruster RW desat interface. It’s primary function is to link the input messages that were created elsewhere.

Return

void

Parameters
  • configData: The configuration data associated with the RW desat logic

  • moduleID: The module ID associated with configData

void Update_thrustRWDesat(thrustRWDesatConfig *configData, uint64_t callTime, int64_t moduleID)

This method takes in the current oberved reaction wheel angular velocities.

Return

void

Parameters
  • configData: The configuration data associated with the RW desat logic

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

void Reset_thrustRWDesat(thrustRWDesatConfig *configData, uint64_t callTime, int64_t moduleID)

This method resets the configData for the thruster-based RW desat module.

Return

void

Parameters
  • configData: The configuration data associated with the thruster desat

  • moduleID: The module ID associated with configData

struct thrustRWDesatConfig
#include <thrustRWDesat.h>

module configuration message

Public Members

char inputSpeedName[MAX_STAT_MSG_LENGTH]

(-) The name of the input RW speeds message

char inputRWConfigData[MAX_STAT_MSG_LENGTH]

[-] The name of the RWA configuration message

char inputThrConfigName[MAX_STAT_MSG_LENGTH]

[-] The name of the thruster configuration message

char inputMassPropsName[MAX_STAT_MSG_LENGTH]

[-] Tha name of the input mass properties message

char outputThrName[MAX_STAT_MSG_LENGTH]

(-) The name of the output thrust command block

double rwAlignMap[3 * MAX_EFF_CNT]

(-) Alignment of the reaction wheel spin axes

double thrAlignMap[3 * MAX_EFF_CNT]

(-) Alignment of the vehicle thrusters

double thrTorqueMap[3 * MAX_EFF_CNT]

(-) Alignment of the vehicle thruster torques

double maxFiring

(s) Maximum time to fire a jet for

double thrFiringPeriod

(s) The amount of time to rest between thruster firings

int numRWAs

(-) Number of reaction wheels being desaturated

int numThrusters

(-) Number of thrusters available in the align map

double accumulatedImp[3]

(s) The accumulated firing in the body frame

double currDMDir[3]

(-) The current direction of momentum reduction

double totalAccumFiring

(s) The total thruster duration we’ve commanded

double DMThresh

(r/s) The point at which to stop decrementing momentum

uint64_t previousFiring

(ns) Time that the last firing command was given

int32_t inputRWConfID

[-] ID for the incoming RWA configuration data

int32_t inputSpeedID

(-) ID for the incoming RW speeds

int32_t inputThrConID

[-] ID for the thruster configuration data

int32_t inputMassPropID

[-] ID for the incoming mass property information

int32_t outputThrID

(-) ID for the outgoing thruster commands

BSKLogger *bskLogger

BSK Logging.