Class ReactionWheelArray
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
[Nominal] This component models a reaction wheel array connected to a rigid body. Reaction wheel arrays may be constructed from three different model: balanced wheels, simple jitter, and fully-coupled imbalanced wheels.
public class ReactionWheelArray : StateEffector
- Inheritance
-
ReactionWheelArray
Constructors
ReactionWheelArray()
Default constructor
protected ReactionWheelArray()
Fields
In_MotorTorqueArrayMsg
Message ID for incoming motor torque data
public MotorTorqueArrayMessage? In_MotorTorqueArrayMsg
Field Value
Out_RWArrayConfigMsg
Output Message for array of reaction wheel configs
public RWArrayConfigMessage? Out_RWArrayConfigMsg
Field Value
Out_RWArraySpeedMsg
Output message for the reaction wheels
public RWArraySpeedMessage? Out_RWArraySpeedMsg
Field Value
Properties
CenterOfMassL_L
[m] The center of mass of the component within its own local
coordinates. This does not include any of the sub-components.
Overridden to always return Vector3(0,0,0)
public override Vector3 CenterOfMassL_L { get; set; }
Property Value
Mass
The mass of the reaction wheel array, excluding child objects. Overridden to always return 0.
public override double Mass { get; set; }
Property Value
MaxTorques
The maximum RW motor torque. This is the 'UMax' parameter.
[Unit(UnitType.NEWTON_METRE)]
[ReadOnly]
[Metadata(ContainedIn = "Out_RWArrayConfigMsg")]
public double[] MaxTorques { get; set; }
Property Value
- double[]
MomentOfInertia_LB
[kg m^2] The moment of inertia of the component within its own
local coordinates. This does not include any of the sub-components.
Overridden to always return a Matrix of 0.
public override Matrix3 MomentOfInertia_LB { get; set; }
Property Value
NumRW
The number of reaction wheels linked to the RWArray config message.
[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(ContainedIn = "Out_RWArrayConfigMsg")]
public int NumRW { get; set; }
Property Value
SpinAxis_B
The RW spin axis matrix in body frame coordinates. This is the 'GsMatrix_B' parameter.
[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(ContainedIn = "Out_RWArrayConfigMsg")]
public Vector3[] SpinAxis_B { get; set; }
Property Value
- Vector3[]
SpinInertias
The spin axis inertia for RWs as a list of wheel values. This is the 'JsList' parameter.
[Unit(UnitType.KILOGRAM_SQUARE_METRE)]
[ReadOnly]
[Metadata(ContainedIn = "Out_RWArrayConfigMsg")]
public double[] SpinInertias { get; set; }
Property Value
- double[]
Methods
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
CreateReactionWheel(double, Vector3, Vector3, RWModelType, double, double, bool, bool, bool, double, double, double, double, double, double, double, double, double)
Creates a new reaction wheel and adds the wheel to the current array. This will also initialise the reaction wheel with some default properties.
public ReactionWheel CreateReactionWheel(double wheelMass, Vector3 wheelPosition_B, Vector3 wheelSpinAxis_B, RWModelType wheelModelType = RWModelType.Balanced, double omega = 0, double omegaMax = 6000, bool useFriction = false, bool useMinTorque = false, bool useMaxTorque = false, double maxTorque = 0, double minTorque = 1E-05, double maxMomentum = 100, double frictionCoulomb = 0, double frictionStatic = 0, double betaStatic = -1, double frictionViscous = 0, double staticImbalance = 0, double dynamicImbalance = 0)
Parameters
wheelMass
double[kg] RW mass
wheelPosition_B
Vector3[m] Position vector of the RW relative to the spacecraft body frame
wheelSpinAxis_B
Vector3[-] Spin axis unit vector gsHat in B-frame components
wheelModelType
RWModelType[-] RW model type such as BalancedWheels, JitterSimple and JitterFullyCoupled
omega
double[RPM] Initial RW speed
omegaMax
double[RPM] Maximum RW speed
useFriction
bool[-] Set to TRUE to turn on RW internal wheel friction
useMinTorque
bool[-] Set to TRUE to clip any torque below a minimum torque value
useMaxTorque
bool[-] Set to TRUE to clip any torque value above a maximum torque value
maxTorque
double[Nm] Maximum RW motor torque
minTorque
double[Nm] Minimum RW motor torque
maxMomentum
double[Nms] Maximum RW wheel momentum in Nms
frictionCoulomb
double[Nm] Coulomb friction torque model
frictionStatic
double[Nm] Static friction torque magnitude
betaStatic
double[-] Stribeck friction coefficient, positive turns Stribeck friction on, negative turns this friction off
frictionViscous
double[-] Viscous friction coefficient
staticImbalance
double[kg*m]*10^-6 static RW imbalance
dynamicImbalance
double[kg*m^2]*10^-6 dynamic RW imbalance
Returns
GetReactionWheel(int)
Returns a particular reaction wheel from the reaction wheel array, if it exists.
public ReactionWheel? GetReactionWheel(int index)
Parameters
index
intThe reaction wheel index
Returns
- ReactionWheel
The reaction wheel reference if it exists
GetReactionWheelMessage(int)
Return a reference to the message of the reaction wheel at the specified index.
public RWConfigMessage? GetReactionWheelMessage(int index)
Parameters
index
intThe index of the reaction wheel within the array.
Returns
- RWConfigMessage
The reaction wheel configuration message for this wheel
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
OnChildAttached(UniverseObject)
This event is called when a child has been attached to this object. This will pass in the reference to the child object that was added.
protected override void OnChildAttached(UniverseObject child)
Parameters
child
UniverseObjectThe child object that was added
OnChildDetached(UniverseObject)
This event is called when a child has been detached from this object. This will pass in the child object that was removed.
protected override void OnChildDetached(UniverseObject child)
Parameters
child
UniverseObjectThe child object that was detached
OnCreate()
Called when the 'Component' is created from the controller.
protected override void OnCreate()
OnFinish(double)
Called when the object is deleted from the simulation and can handle any cleanup of variables.
protected override void OnFinish(double time)
Parameters
time
double[s] The current clock time when deleted
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
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 angMomentum_B, ref double energy, Vector3 omega_BN_B)
Parameters
time
doubleThe current time [s]
angMomentum_B
Vector3A reference to the Angular Momentum Vector
energy
doubleA reference to the Energy Contribution value
omega_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]