Class ThrusterControlSoftware
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
[Nominal] Defines the thruster controller software. This module takes a desired torque to control the spacecraft, and maps it to an array of thrusters.
public class ThrusterControlSoftware : Software
- Inheritance
-
ThrusterControlSoftware
Constructors
ThrusterControlSoftware()
Default constructor
protected ThrusterControlSoftware()
Fields
AngleErrorThreshold
[rad] Angular error at which thruster forces are scaled to not be super-saturated
[Unit(UnitType.RADIAN)]
public double AngleErrorThreshold
Field Value
ControlAxes_B
Array of the control unit axes
[Unit(UnitType.NONE)]
public Matrix3 ControlAxes_B
Field Value
In_BodyMassMsg
Vehicle configuration input message. Gets component's parent if null.
public MassMessage? In_BodyMassMsg
Field Value
In_CommandTorqueMsg
Commanded spacecraft external control torque message
public CommandTorqueMessage? In_CommandTorqueMsg
Field Value
In_ThrusterArrayConfigMsg
Configuration of thrusters attached to the spacecraft
public ThrusterArrayConfigMessage? In_ThrusterArrayConfigMsg
Field Value
Out_ThrustForceArrayMsg
Output thruster force commands for thruster array
public ThrustForceArrayMessage? Out_ThrustForceArrayMsg
Field Value
SmallValue
[-] Specifies what is considered a small number
[Unit(UnitType.NONE)]
public double SmallValue
Field Value
ThrusterForceSign
Flag indicating if pos (+1) or negative (-1) thruster solutions are found
[Unit(UnitType.NONE)]
public int ThrusterForceSign
Field Value
TorqueAngleError
[rad] Angular error of the effector torque
[Unit(UnitType.RADIAN)]
public double TorqueAngleError
Field Value
UseSecondLoop
Flag indicating if the 2nd least squares fitting loop should be used
public bool UseSecondLoop
Field Value
Methods
ComputeTorqueAngleError(Matrix, Vector3, int, Vector, double[])
Determine the angle between the desired torque vector and the actual torque vector.
protected double ComputeTorqueAngleError(Matrix torque, Vector3 bLr_B, int numForces, Vector force, double[] forceMag)
Parameters
Returns
FindMinimumNormForce(Matrix, Vector3, int)
Use a least square inverse to determine the smallest set of thruster forces that yield the desired torque vector.
Note that this routine does not constrain yet the forces to be either positive or negative
protected Vector FindMinimumNormForce(Matrix D, Vector3 Lr_B_Bar, int NumForces)
Parameters
Returns
Initialise()
This method is called whenever some key parameters are changed and any new local variables are required to be recalculated. This can be called by the software chains if a configuration of some values are updated.
public override void Initialise()
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 object is created from the controller and has been attached to the parent object. By this point, it has been registered to the simulation and will run after the constructor.
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
SubtractMin(Vector, int)
Take a stack of force values find the smallest value, and subtract if from all force values. Here the smallest values
will become zero, while other forces increase.
Assumption: Thrusters are aligned such that if all thrusters are firing, then no torque or force is applied.
This ensures only positive force values are computed.
protected Vector SubtractMin(Vector F, int size)