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.
Msg Variable Name |
Msg Type |
Description |
---|---|---|
vscmgParamsInMsg |
VSCMG array configuration input message |
|
vehControlInMsg |
vehicle control (Lr) input message |
|
attNavInMsg |
attitude navigation input message |
|
attGuideInMsg |
attitude guidance input message |
|
speedsInMsg |
VSCMG speeds input message |
|
vscmgRefStatesOutMsg |
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}}\)
and \(3\times2N\) matrix \([Q]\)
allow for the compact expression
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
where
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]\)
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
The weights are defined to be dependant on proximity to a CMG singularity through the use of the non-dimensional scalar
where \(\overline{h}\) is the nominal RW angular momentum found through
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
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.
Import the vscmgVelocitySteering class:
from Basilisk.fswAlgorithms import vscmgVelocitySteering
Create an instance of the vscmgVelocitySteering class:
vscmgSteering = vscmgVelocitySteering.VscmgVelocitySteering()
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)
The VSCMG reference states output message is
vscmgRefStatesOutMsg
.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
[-] 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
-
VscmgVelocitySteering()