Class VSCMG
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
This components models a variable speed control moment gyroscope (VSCMG) connected to a rigid body. VSCMG may be constructed from three different model: balanced wheels, simple jitter, and fully-coupled imbalanced wheel.
public class VSCMG : StateEffector
- Inheritance
-
VSCMG
Constructors
VSCMG()
Default constructor
protected VSCMG()
Fields
In_ArrayMotorTorqueMsg
The input array of motor torques applied to the moment gyroscope
public VSCMGArrayMotorTorqueMessage? In_ArrayMotorTorqueMsg
Field Value
Out_ArrayMotorTorqueMsg
Output message for VSCMG torques
public List<VSCMGTorqueMessage> Out_ArrayMotorTorqueMsg
Field Value
Out_VSCMGArrayConfigMsg
Output Message for array of reaction wheel configs
public VSCMGArrayConfigMessage? Out_VSCMGArrayConfigMsg
Field Value
Out_VSCMGSpeedMsg
Output message for VSCMG speeds
public VSCMGSpeedMessage? Out_VSCMGSpeedMsg
Field Value
VSCMGData
List of reaction wheel messages
public List<VSCMGConfigMessage> VSCMGData
Field Value
Methods
AddVSCMG(VSCMGConfigMessage)
Adds in another reaction wheel to the reaction wheel system payload
public void AddVSCMG(VSCMGConfigMessage message)
Parameters
message
VSCMGConfigMessageA new message reference to add
ComputeDerivatives(double, Vector3, Vector3, Vector3)
Computers the Derivatives of the Body along with the Kinematic Derivatives
public override void ComputeDerivatives(double time, Vector3 rDDot_BN_N, Vector3 omegaDot_BN_B, Vector3 sigma_BN)
Parameters
time
doubleThe current computation time
rDDot_BN_N
Vector3The acceleration in the body frame
omegaDot_BN_B
Vector3The derivative of the attitude rate in the body frame
sigma_BN
Vector3The current attitude in the body frame
CreateVSCMG(double, double, Vector3, Vector3, Vector3, Vector3, Vector3, VSCMGModelType, double, double, double, double, bool, double, double, double, bool, bool, double, double, double, double, double, double, double, double, double, double, double, double, double, double)
Creates a new reaction wheel to add to the payload
public void CreateVSCMG(double wheelMass, double gimbalMass, Vector3 rGB_B, Vector3 wheelSpinAxis0_B, Vector3 gimbalSpinAxis_B, Vector3 IG, Vector3 rGcG_G, VSCMGModelType wheelModelType = VSCMGModelType.Balanced, double omega = 0, double omegaMax = 6000, double gammaDot = 0, double gammaDotMax = 6000, bool useFriction = false, double frictionCoulombWheel = 0, double wheelLinearFrictionRatio = 0, double gimbalLinearFrictionRatio = 0, bool useMinTorque = false, bool useMaxTorque = false, double maxTorqueWheel = 0, double maxTorqueGimbal = 0, double currentTorqueWheel = 0, double currentTorqueGimbal = 0, double minTorqueWheel = 1E-05, double minTorqueGimbal = 1E-05, double maxMomentumWheel = 100, double frictionCoulombGimbal = 0, double staticImbalance = 0, double dynamicImbalance = 0, double l = 0.01, double L = 0.1, double theta = 0, double gamma = 0)
Parameters
wheelMass
double[kg] Gyroscope wheel mass
gimbalMass
double[kg] Gyroscope gimbal mass
rGB_B
Vector3[m] Position of the gimbal relative to the body origin, in body-frame coordinates
wheelSpinAxis0_B
Vector3[-] Spin axis unit vector gsHat in body-frame coordinates, measured with gimbal angle gamma = 0
gimbalSpinAxis_B
Vector3[-] Spin axis unit vector ggHat in body-frame coordinates
IG
Vector3[kg*m^2] Vector of principal moments of inertia of the gimbal
rGcG_G
Vector3[m] Position of the gimbal centre of mass relative to the gimbal origin, in gimbal-frame coordinates
wheelModelType
VSCMGModelType[-] Gyroscope model type such as BalancedWheels, JitterSimple and JitterFullyCoupled
omega
double[RPM] Initial wheel speed
omegaMax
double[RPM] Maximum wheel speed
gammaDot
double[RPM] Initial gimbal speed
gammaDotMax
double[RPM] Maximum gimbal speed
useFriction
bool[-] Set to TRUE to turn on internal wheel friction
frictionCoulombWheel
double[N*m] Maximum wheel friction. Friction is linear with speed up to this value
wheelLinearFrictionRatio
double[-] Fraction of the maximum wheel speed at which the friction saturates
gimbalLinearFrictionRatio
double[-] Fraction of the maximum gimbal speed at which the friction saturates
useMinTorque
bool[-] Set to TRUE to clip any torque below a minimum torque value to 0
useMaxTorque
bool[-] Set to TRUE to clip any torque value above a maximum torque value to that maximum
maxTorqueWheel
double[N*m] Maximum wheel motor torque
maxTorqueGimbal
double[N*m] Maximum gimbal motor torque
currentTorqueWheel
double[N*m] Initial wheel torque
currentTorqueGimbal
double[N*m] Initial gimbal torque
minTorqueWheel
double[N*m] Minmum wheel motor torque
minTorqueGimbal
double[N*m] Minimum gimbal motor torque
maxMomentumWheel
double[Nms] Maximum wheel angular momentum. Used to calculate moment of inertia
frictionCoulombGimbal
double[N*m] Maximum gimbal friction. Friction is linear with speed up to this value
staticImbalance
double[kg*m]*10^-6 static wheel imbalance parameter
dynamicImbalance
double[kg*m^2]*10^-6 dynamic wheel imbalance parameter
l
double[m] Distance of the wheel centre of mass from the gimbal spin axis along the wheel spin axis
L
double[m] Height of the wheel spin axis above the gimbal origin
theta
double[deg] Initial wheel angle
gamma
double[deg] Initial gimbal angle
LinkStateProperties(StateModel?)
Links and registers any of the states from the state model that is associated with the root object.
public override void LinkStateProperties(StateModel? properties)
Parameters
properties
StateModelThe model that contains the list of states to fetch
OnBegin(double)
Called when the object is beginning ticking for the first time. This is when the simulation calls the very first tick and will run before the update call.
protected override void OnBegin(double time)
Parameters
time
double[s] Current time of the simulation before the tick
OnCreate()
Called when the 'Component' is created from the controller.
protected override void OnCreate()
OnLoad(double)
Called after all of the data has been loaded from a save state on this object. This enables any post-load operations to be performed and extra data to be loaded from the metadata.
protected override void OnLoad(double time)
Parameters
time
double[s] The current clock time of the simulation
OnUpdate(double, double)
Called when the object should update from the simulation tick. This will take in a time and a step, where the time is the time of the clock before updating the object.
protected override void OnUpdate(double time, double step)
Parameters
time
double[s] Current time of the simulation before the update
step
double[s] The time-step to update during this tick
ReadInputs()
Reads the input messages and adds information to the instance
protected void ReadInputs()
UpdateBackContributions(double, ref BackSubstitutionMatrices, Vector3, Vector3, Vector3)
Substitutes in the Back Substitution Matrices and performs some calculations.
public override void UpdateBackContributions(double time, ref BackSubstitutionMatrices backSubContribution, Vector3 sigma_BN, Vector3 omega_BN_B, Vector3 g_N)
Parameters
time
doubleThe current time [s]
backSubContribution
BackSubstitutionMatricessigma_BN
Vector3The current Attitude
omega_BN_B
Vector3The current Attitude rate
g_N
Vector3The spacecraft local gravity vector
UpdateEnergyContributions(double, ref Vector3, ref double, Vector3)
Computes the Energy and Momentum Contributions from the Body
public override void UpdateEnergyContributions(double time, ref Vector3 rotAngMomPntCContr_B, ref double rotEnergyContr, Vector3 omega_BN_B)
Parameters
time
doubleThe current time [s]
rotAngMomPntCContr_B
Vector3rotEnergyContr
doubleomega_BN_B
Vector3The current Attitude Rate of the body
UpdateMassProperties(double, double)
Updates the mass properties of the current physical object at a particular time.
public override void UpdateMassProperties(double time, double step)
Parameters
time
double[s] The current time of the simulation
step
double[s] The delta time between the updates
WriteOutputMessages(double)
Updates the payload messages with some new states
protected void WriteOutputMessages(double time)
Parameters
time
doubleThe current time [s]
WriteOutputStateMessages(double)
Writes state messages after integration
public override void WriteOutputStateMessages(double time)
Parameters
time
doubleThe current time [s]