Module: spacecraftReconfig

Executive Summary

The primary purpose of this module is to schedule burn timing and attitude for spacecraft formation reconfiguration. Basic idea is described in section 14.8.3 of Analytical Mechanics of Space Systems. Based on keplerian dynamics, formation reconfiguration from one initial orbital element difference to target orbital element difference is scheduled so that reconfiguration is completed in one orbit period.

In addition to formation control algorithm described in the textbook, some extensions and improvements are included in this module. First, this module assumes that deputy spacecraft has one-axis thrusters. Therefore, attitude control is also necessary along with burn at certain period. When burn timing is approaching, target attitude is output as attRefOutMsg. Otherwise, and if attRefInMsg (which is optional) is set, the reference message is output as attRefOutMsg. Second, if \(\delta a\) is not zero, drift of \(\delta M\) occurs. This module can take this drift into consideration . Therefore, this module can achieve formation reconfiguration in orbital period. Third, in general three-time burn is necessary for reconfiguration. Two of them occur at perigee and apogee each. The other burn timing varies depending on necessary change of orbital element difference. In some cases, this burn timing can be close to perigee or apogee. In these cases, two burns are integrated into one burn. Parameter attControlTime is used to check whether this integration is necessary or not.

Message Connection Descriptions

The following table lists all the module input and output messages. The module msg variable name 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

chiefTransInMsg

NavTransMsgPayload

chief’s position and velocity input message

deputyTransInMsg

NavTransMsgPayload

deputy’s position and velocity input message

thrustConfigInMsg

THRArrayConfigMsgPayload

deputy’s thruster configuration input message

attRefInMsg

AttRefMsgPayload

(optional) deputy’s reference attitude input message. If set, then the deputy will point along this reference attitude unless it must point the thrusters in a control direction.

vehicleConfigInMsg

VehicleConfigMsgPayload

deputy’s vehicle configuration input message

attRefOutMsg

AttRefMsgPayload

deputy’s target attitude output message

onTimeOutMsg

THRArrayOnTimeCmdMsgPayload

The deputy’s thruster’s on time output message

burnArrayInfoOutMsg

ReconfigBurnArrayInfoMsgPayload

deputy’s scheduled burns info output message

Module Assumptions and Limitations

  • This module uses classic orbital element, so this module cannot be applied to near-circular or near-equatorial orbits.

  • Too long or too short attControlTime may result in control error.

  • Impulsive maneuvers are approximated by steady thrust of a certain period.

User Guide

This module requires the following variables to be set as parameters:

  • attControlTime time [s] necessary to control one attitude to another attitude

  • mu gravitational constant for a central body in m^3/s^2

  • targetClassicOED desired orbital element difference.

For targetClassicOED, normalized semi major axis must be used.


Functions

void SelfInit_spacecraftReconfig(spacecraftReconfigConfig *configData, int64_t moduleID)

This method initializes the configData for this module. It checks to ensure that the inputs are sane and then creates the output message

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

  • moduleID – The Basilisk module identifier

Returns:

void

void Update_spacecraftReconfig(spacecraftReconfigConfig *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 Basilisk module identifier

Returns:

void

void Reset_spacecraftReconfig(spacecraftReconfigConfig *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. The local copy of the message output buffer should be cleared.

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

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

  • moduleID – The Basilisk module identifier

Returns:

void

void UpdateManeuver(spacecraftReconfigConfig *configData, NavTransMsgPayload chiefTransMsgBuffer, NavTransMsgPayload deputyTransMsgBuffer, AttRefMsgPayload attRefInMsgBuffer, THRArrayConfigMsgPayload thrustConfigMsgBuffer, VehicleConfigMsgPayload vehicleConfigMsgBuffer, AttRefMsgPayload *attRefOutMsgBuffer, THRArrayOnTimeCmdMsgPayload *thrustOnMsgBuffer, uint64_t callTime, int64_t moduleID)

based on burn schedule, this function creates a message of reference attitude and thruster on time

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

  • chiefTransMsgBuffer – chief’s position and velocity

  • deputyTransMsgBuffer – deputy’s position and velocity

  • attRefInMsgBuffer – target attitude

  • thrustConfigMsgBuffer – thruster’s config information

  • vehicleConfigMsgBuffer – deputy’s vehicle config information

  • attRefOutMsgBuffer – target attitude

  • thrustOnMsgBuffer – thruster on time

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

  • moduleID – The Basilisk module identifier

Returns:

void

double AdjustRange(double lower, double upper, double angle)

This function is used to adjust a certain value in a certain range between lower threshold and upper threshold. This function is particularily used to adjsut angles used in orbital motions such as True Anomaly, Mean Anomaly, and so on.

Parameters:
  • lower – lower threshold

  • upper – upper threshold

  • angle – an angle which you want to be between lower and upper

Returns:

double

int CompareTime(const void *n1, const void *n2)

This function is used to sort an array of spacecraftReconfigConfigBurnInfo in ascending order.

Parameters:
  • n1

  • n2

Returns:

void

void ScheduleDV(spacecraftReconfigConfig *configData, classicElements oe_c, classicElements oe_d, THRArrayConfigMsgPayload thrustConfigMsgBuffer, VehicleConfigMsgPayload vehicleConfigMsgBuffer)

This function is used to sort an array of spacecraftReconfigConfigBurnInfo in ascending order.

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

  • oe_c – chief’s orbital element

  • oe_d – deputy’s orbital element

  • thrustConfigMsgBuffer

  • vehicleConfigMsgBuffer – deputy’s vehicle config information

Returns:

void

struct spacecraftReconfigConfig
#include <spacecraftReconfig.h>

Data structure for the MRP feedback attitude control routine.

Public Members

NavTransMsg_C chiefTransInMsg

chief orbit input msg

NavTransMsg_C deputyTransInMsg

deputy orbit input msg

THRArrayConfigMsg_C thrustConfigInMsg

THR configuration input msg.

AttRefMsg_C attRefInMsg

nominal attitude reference input msg

VehicleConfigMsg_C vehicleConfigInMsg

deputy vehicle config msg

AttRefMsg_C attRefOutMsg

attitude reference output msg

THRArrayOnTimeCmdMsg_C onTimeOutMsg

THR on-time output msg.

ReconfigBurnArrayInfoMsg_C burnArrayInfoOutMsg

array of burn info output msg

double mu

[m^3/s^2] gravity constant of planet being orbited

double attControlTime

[s] attitude control margin time (time necessary to change sc’s attitude)

double targetClassicOED[6]

target classic orital element difference, SMA should be normalized

double resetPeriod

[s] burn scheduling reset period

double tCurrent

[s] timer

uint64_t prevCallTime

[ns]

uint8_t thrustOnFlag

thrust control

int attRefInIsLinked

flag if the attitude reference input message is linked

ReconfigBurnArrayInfoMsgPayload burnArrayInfoOutMsgBuffer

msg buffer for burn array info

BSKLogger *bskLogger

BSK Logging.