Module: vscmgVelocitySteering

Executive Summary

The vscmgVelocitySteering module maps the required spacecraft control torque vector (\(\boldsymbol{L}_r\)) to a corresponding reference wheel acceleration and gimbal rate for each VSCMG.

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

vscmgParamsInMsg

VSCMGArrayConfigMsgPayload

VSCMG array configuration input message

vehControlInMsg

CmdTorqueBodyMsgPayload

vehicle control (Lr) input message

attNavInMsg

NavAttMsgPayload

attitude navigation input message

attGuideInMsg

AttGuidMsgPayload

attitude guidance input message

speedsInMsg

VSCMGSpeedMsgPayload

VSCMG speeds input message

vscmgRefStatesOutMsg

VSCMGRefStatesMsgPayload

reference VSCMG states output message

Detailed Module Description

General Function

the vscmgVelocitySteering module creates the VSCMG reference state vector \(\dot{\boldsymbol{\eta}}\) developed in chapter 8 of Analytical Mechanics of Space Systems.

Algorithm

This module employs the Velocity-Based VSCMG Steering Law of Section (8.8.2) of Analytical Mechanics of Space Systems. Use of the \(2N\times1\) state vector \({\boldsymbol{\eta}}\)

(1)\[\begin{split}\boldsymbol{\eta} = \begin{bmatrix} \boldsymbol{\Omega} \\ \boldsymbol{\gamma} \end{bmatrix}\end{split}\]

and \(3\times2N\) matrix \([Q]\)

(2)\[[Q] = \begin{bmatrix} D_0 & D \end{bmatrix}\]

allow for the compact expression

(3)\[[Q]\dot{\boldsymbol{\eta}} = -\boldsymbol{L}_r\]

where \(\boldsymbol{L}_r\) is the required spacecraft control torque vector, \(N\) is the number of VSCMGs, \(\boldsymbol{\Omega}\) is the vector of RW spin rates, and \(\boldsymbol{\gamma}\) is the vector of gimbal angles. The matrices \([D_0]\) and \([D]\) are defined with all components in the spacecraft body frame \(\mathcal{B}\) as

(4)\[[D_0] = \begin{bmatrix} \cdots \hat{\boldsymbol{g}}_{s_{i}}I_{W_{s_{i}}} \cdots \end{bmatrix}\]
(5)\[[D_1] = \begin{bmatrix} \cdots \left(I_{W_{s_{i}}}\Omega_{i} + \frac{J_{s_{i}}}{2}\omega_{s_{i}} \right)\hat{\boldsymbol{g}}_{t_{i}} + \frac{J_{s_{i}}}{2}\omega_{t_{i}}\hat{\boldsymbol{g}}_{s_{i}} \cdots \end{bmatrix}\]
(6)\[[D_2] = \begin{bmatrix} \cdots \frac{1}{2}J_{t_{i}}(\omega_{t_{i}}\hat{\boldsymbol{g}}_{s_{i}}+\omega_{s_{i}}\hat{\boldsymbol{g}}_{t_{i}}) \cdots \end{bmatrix}\]
(7)\[[D_3] = \begin{bmatrix} \cdots J_{g_{i}}(\omega_{t_{i}}\hat{\boldsymbol{g}}_{s_{i}}-\omega_{s_{i}}\hat{\boldsymbol{g}}_{t_{i}}) \cdots \end{bmatrix}\]
(8)\[[D_4] = \begin{bmatrix} \cdots \frac{1}{2}(J_{s_{i}}-J_{t_{i}})(\hat{\boldsymbol{g}}_{s_{i}}\hat{\boldsymbol{g}}_{t_{i}}^{T}\boldsymbol{\omega}_{r} + \hat{\boldsymbol{g}}_{t_{i}}\hat{\boldsymbol{g}}_{s_{i}}^{T}\boldsymbol{\omega}_{r}) \cdots \end{bmatrix}\]
(9)\[[D] = ([D_1] - [D_2] + [D_3] + [D_4])\]

where

(10)\[{\boldsymbol{ \omega}} = \omega_{s_{i}}\hat{\boldsymbol{ g}}_{s_{i}} + \omega_{t_{i}}\hat{\boldsymbol{ g}}_{t_{i}} + \omega_{g_{i}}\hat{\boldsymbol{ g}}_{g_{i}}\]

and \(\hat{\boldsymbol{g}}_{s_{i}}\), \(\hat{\boldsymbol{g}}_{t_{i}}\), and \(\hat{\boldsymbol{g}}_{g_{i}}\) are the unit vectors in the direction of the first, second and third axis of the ith gimbal wheel system respectively, \(J_{s_{i}}\), \(J_{t_{i}}\), \(J_{g_{i}}\) are the inertias for the ith gimbal wheel system for the first, second and third axis, \(I_{w_{s_{i}}}\) is the ith RW spin axis inertia, and \(\boldsymbol{\omega}_{r}\) is the reference angular velocity for the spacecraft.

Defining the \(2N\times2N\) diagonal weighting matrix \([W]\)

(11)\[[W] = \text{diag}\{W_{s_{1}},\cdots,W_{s_{N}},W_{g_{1}},\cdots,W_{g_{N}}\}\]

where \(W_{s_{i}}\) and \(W_{g_{i}}\) are the weights associated with the ith VSCMG RW and CMG respectively. The desired \(\dot{\boldsymbol{\eta}}\) can be found through

(12)\[\dot{\boldsymbol{\eta}} = [W][Q]^{T}([Q][W][Q]^{T})^{-1}(-\boldsymbol{L}_{r})\]

The weights are defined to be dependant on proximity to a CMG singularity through the use of the non-dimensional scalar

(13)\[\delta = \text{det}\frac{1}{\overline{h}^{2}}([D_{1}][D_{1}]^{T})\]

where \(\overline{h}\) is the nominal RW angular momentum found through

(14)\[\overline{h} = \frac{1}{N}\sum_{i=1}^{N}I_{w_{s_{i}}}\Omega_{i_{0}}\]

where \(\Omega_{i_{0}}\) is the nominal spin rate of the ith RW. As the CMG approaches a singularity \(\delta\) goes to zero. The weights \(W_{s_{i}}\) can be defined as

(15)\[W_{s_{i}} = W_{s_{i}}^{0}e^{(-\mu\delta)}\]

with \(W_{s_{i}}^{0}\) and \(\mu\) being positive scalars. The weights \(W_{g_{i}}\) are held constant. This allows for the weights on the RW mode to be small when far from the CMG singularity but still allow the control to produce \(\boldsymbol{L}_{r}\) if a singularity is reached.

User Guide

This section is to outline the steps needed to setup the VSCMG velocity steering module in Python using Basilisk.

  1. Import the vscmgVelocitySteering class:

    from Basilisk.fswAlgorithms import vscmgVelocitySteering
    
  2. Create an instance of the vscmgVelocitySteering class:

    vscmgSteering = vscmgVelocitySteering.VscmgVelocitySteering()
    
  3. Set the module parameters:

    mu = 1e-9
    vscmgSteering.setMu(mu)
    W0_s = [200.0] * numVSCMGs
    W_g = [1.0] * numVSCMGs
    vscmgSteering.setW0_s(W0_s)
    vscmgSteering.setW_g(W_g)
    
  4. The VSCMG reference states output message is vscmgRefStatesOutMsg.

  5. Add the module to the task list:

    unitTestSim.AddModelToTask(unitTaskName, vscmgSteering)
    

class VscmgVelocitySteering : public SysModel
#include <vscmgVelocitySteering.h>

Mapping desired control torque vector to gimbal rates and RW wheel accelerations.

Public Functions

VscmgVelocitySteering()

This is the constructor for the module class. It sets default variable values and initializes the various parts of the model

~VscmgVelocitySteering() = default
void SelfInit()

Initialize C-wrapped output messages

void Reset(uint64_t CurrentSimNanos)

This method is used to reset the module, checks that required input messages are connected, and initializes internal states.

void UpdateState(uint64_t CurrentSimNanos)

This is the main method that gets called every time the module is updated. Provide an appropriate description.

void setMu(double)

setter for mu property

inline double getMu() const

getter for mu property

void setW0_s(std::vector<double>)

setter for W0_s property

inline std::vector<double> getW0_s() const

getter for W0_s property

void setW_g(std::vector<double>)

setter for W_g property

inline std::vector<double> getW_g() const

getter for W_g property

Public Members

ReadFunctor<VSCMGArrayConfigMsgPayload> vscmgParamsInMsg

[-] VSCMG array configuration input message

ReadFunctor<CmdTorqueBodyMsgPayload> vehControlInMsg

[-] vehicle control (Lr) input message

ReadFunctor<NavAttMsgPayload> attNavInMsg

[-] attitude navigation input message

ReadFunctor<AttGuidMsgPayload> attGuideInMsg

[-] attitude guidance input message

ReadFunctor<VSCMGSpeedMsgPayload> speedsInMsg

[-] VSCMG speeds input message

Message<VSCMGRefStatesMsgPayload> vscmgRefStatesOutMsg

[-] reference VSCMG states C++ output message

VSCMGRefStatesMsg_C vscmgRefStatesOutMsgC = {}

[-] reference VSCMG states C output message

BSKLogger bskLogger

BSK Logging.

Private Members

double mu

[-] control parameter for wheel weights

double h_bar_squared

[kg^2-m^4/s^4] square of nominal RW angular momentums

std::vector<double> W0_s

[-] vector of static wheel weights

std::vector<double> W_g

[-] vector of gimbal wheel weights

std::vector<double> h_bar

[kg-m^2/s] vector of nominal RW angular momentums

VSCMGRefStatesMsgPayload outputRefStates

[-] output reference states for the VSCMGs

VSCMGArrayConfigMsgPayload vscmgConfigParams

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