FSW Base
Basic FSW model for BSK-RL.
- action(func: Callable[[...], None]) Callable[[Callable[[...], None]], Callable[[...], None]] [source]
Decorator to reset the satellite software before executing an action.
Each time an action is called, the FSW tasks and dynamics models call their
reset_for_action
methods to ensure that the satellite is in a consistent state before the action is executed.Action functions are typically called by Actions to task the satellite.
- Parameters:
func (Callable[[...], None])
- Return type:
Callable[[Callable[[…], None]], Callable[[…], None]]
- class FSWModel(satellite: Satellite, fsw_rate: float, priority: int = 100, **kwargs)[source]
Bases:
ABC
The abstract base flight software model.
One FSWModel is instantiated for each satellite in the environment each time the environment is reset and new simulator is created.
- Parameters:
satellite (Satellite) – Satellite modelled by this model
fsw_rate (float) – [s] Rate of FSW simulation.
priority (int) – Model priority.
kwargs – Passed to task creation functions
- property world: WorldModel
Reference to the episode world model.
- property dynamics: DynamicsModel
Reference to the satellite dynamics model for the episode.
- class Task(fsw: FSWModel, priority: int)[source]
Bases:
ABC
Template class for defining FSW processes.
Each FSW process has a task associated with it, which handle certain housekeeping functions.
- Parameters:
fsw (FSWModel) – FSW model task contributes to
priority (int) – Task priority
- name: str
- class BasicFSWModel(satellite: Satellite, fsw_rate: float, priority: int = 100, **kwargs)[source]
Bases:
FSWModel
The abstract base flight software model.
One FSWModel is instantiated for each satellite in the environment each time the environment is reset and new simulator is created.
- Parameters:
satellite (Satellite) – Satellite modelled by this model
fsw_rate (float) – [s] Rate of FSW simulation.
priority (int) – Model priority.
kwargs – Passed to task creation functions
- action_drift() None [source]
Decorated with
action
Disable all tasks and do nothing.
- Return type:
None
- class SunPointTask(fsw, priority=99)[source]
Bases:
Task
Task to generate a sun-pointing reference.
- Parameters:
fsw (FSWModel)
- name: str = 'sunPointTask'
- action_charge() None [source]
Decorated with
action
Charge battery by pointing the solar panels at the sun.
- Return type:
None
- class NadirPointTask(fsw, priority=98)[source]
Bases:
Task
Task to generate nadir-pointing reference.
- Parameters:
fsw (FSWModel)
- name: str = 'nadirPointTask'
- class RWDesatTask(fsw, priority=97)[source]
Bases:
Task
Task to desaturate reaction wheels using thrusters.
- Parameters:
fsw (FSWModel)
- name: str = 'rwDesatTask'
- setup_thruster_mapping(controlAxes_B: Iterable[float], thrForceSign: int, **kwargs) None [source]
Configure the thruster mapping.
- Parameters:
controlAxes_B (Iterable[float]) – Control unit axes.
thrForceSign (int) – Flag indicating if pos (+1) or negative (-1) thruster solutions are found.
kwargs – Passed to other setup functions.
- Return type:
None
- setup_momentum_dumping(hs_min: float, maxCounterValue: int, thrMinFireTime: float, desatAttitude: str | None, **kwargs) None [source]
Configure the momentum dumping algorithm.
- Parameters:
hs_min (float) – [N*m*s] Minimum RW cluster momentum for dumping.
maxCounterValue (int) – Control periods between firing thrusters.
thrMinFireTime (float) – [s] Minimum thruster firing time.
desatAttitude (str | None) –
Direction to point while desaturating:
"sun"
points panels at sun"nadir"
points instrument nadirNone
disables attitude control.
kwargs – Passed to other setup functions.
- Return type:
None
- action_desat() None [source]
Decorated with
action
Charge while desaturating reaction wheels.
This action maneuvers the satellite into
desatAttitude
, turns on the thruster power sink, and enables the desaturation tasks. This action typically needs to be called multiple times to fully desaturate the wheels.- Return type:
None
- class TrackingErrorTask(fsw, priority=90)[source]
Bases:
Task
Task to convert an attitude reference to guidance.
- Parameters:
fsw (FSWModel)
- name: str = 'trackingErrTask'
- class MRPControlTask(fsw, priority=80)[source]
Bases:
Task
Task to control the satellite with reaction wheels.
- Parameters:
fsw (FSWModel)
- name: str = 'mrpControlTask'
- setup_mrp_feedback_rwa(K: float, Ki: float, P: float, **kwargs) None [source]
Set the MRP feedback control properties.
- Parameters:
K (float) – Proportional gain.
Ki (float) – Integral gain.
P (float) – Derivative gain.
kwargs – Passed to other setup functions.
- Return type:
None
- class SteeringFSWModel(*args, **kwargs)[source]
Bases:
BasicFSWModel
FSW extending attitude control to use MRP steering instead of MRP feedback.
This class replaces the simple attitude feedback control law with a more sophisticated MRP steering control law.
- class MRPControlTask(fsw, priority=80)[source]
Bases:
Task
Task to control the satellite with reaction wheels.
- Parameters:
fsw (FSWModel)
- name: str = 'mrpControlTask'
- setup_mrp_steering_rwa(K1: float, K3: float, omega_max: float, servo_Ki: float, servo_P: float, **kwargs) None [source]
Define the control properties.
- Parameters:
K1 (float) – MRP steering gain.
K3 (float) – MRP steering gain.
omega_max (float) – [rad/s] Maximum targetable spacecraft body rate.
servo_Ki (float) – Servo gain.
servo_P (float) – Servo gain.
kwargs – Passed to other setup functions.
- Return type:
None