scenarioAttitudeConstrainedManeuver#
Overview#
This script sets up a 6-DOF spacecraft which is orbiting the Earth, in the presence of the Sun. The spacecraft is modelled according to the specifics of the Bevo-2 satellite, that has a sensitive star tracker aligned with the x body axis and two sun sensors aligned with the y and z body axes. In contrast with scenarioAttitudeConstraintViolation the goal of this scenario is to illustrate how to set up a Xmera simulation using the constrainedAttitudeManeuver module to perform a slew maneuver while ensuring constraint compliance.
The script is found in the folder xmera/examples and executed by using:
python3 scenarioAttitudeConstrainedManeuver.py
This simulation is set up identically to scenarioAttitudeConstraintViolation. The reader is referred to this scenario for a detailed description of the setup. The only difference in this scenario is that the constraint-naive inertial3D module for attitude pointing is replaced with the constrainedAttitudeManeuver module.
Illustration of Simulation Results#
Each run of the script produces 6 figures. Figures 1-4 report, respectively, attitude error, RW motor torque, rate tracking error, and RW speed. These plots are only relevant to the spacecraft / RW dynamics. Figures 5 and 6 show the angle between the boresight vector of the star tracker and the Sun (fig. 5), and of the sun sensor(s) and the Sun (fig. 6). Each plot features a dashed line that represents an angular threshold for that specific instrument.
Each plot describes a slew maneuver performed from an initial inertial attitude \(\sigma_{\mathcal{B/N},i}\) to a final inertial attitude \(\sigma_{\mathcal{B/N},f}\). In scenarioAttitudeConstraintViolation, these sets of attitudes and constraints were chosen to highlight specific constraint violations. This scenario shows how, using constrainedAttitudeManeuver, the constraints are not violated.
show_plots = True, use2SunSensors = False, starTrackerFov = 20, sunSensorFov = 70, attitudeSetCase = 0
This case features the violation of the keep in constraint of the sun sensor only when inertial3D is used. Just for this case, only the sun sensor along the y body axis is considered. Now, the keep in constraint is not violated as the boresight angle never exceeds the 70 def field of view of the instrument.
show_plots = True, use2SunSensors = True, starTrackerFov = 20, sunSensorFov = 70, attitudeSetCase = 1
In this case, using inertial3D, both the sun sensor boresights exceed the respective thresholds. In this scenario, however, they do not.
show_plots = True, use2SunSensors = True, starTrackerFov = 20, sunSensorFov = 70, attitudeSetCase = 2
In this case, inertial3D violates the keep out constraint of the star tracker, alongside with the keep in constraints for both the sun sensors. The following simulation shows how all the constraints are respected.