.. _scenarioAttitudeGG: scenarioAttitudeGG ================== Overview -------- Illustrates how to add a :ref:`GravityGradientEffector` to a 6U cube-sat spacecraft while a Hill-frame pointing control solution is active. This script expands on :ref:`scenarioAttitudeGuidance` sets up a 6-DOF spacecraft which is orbiting the Earth. More illustrations on using the gravity gradient torque effector can be found in the modules :ref:`UnitTestGravityGradientEffector` folder. The script is found in the folder ``xmera/examples`` and executed by using:: python3 scenarioAttitudeGG.py The simulation layout is shown in the following illustration. The :ref:`GravityGradientEffector` is added to the spacecraft to create a position depended external torque. This .. image:: /_images/static/test_scenarioAttitudeGG.svg :align: center Illustration of Simulation Results ---------------------------------- In this simulation the reference frame is not aligned with the Hill frame, but rather it has a fixed angular offset along the 2nd body axis. As the Body frame inertia tensor is diagonal, this reference orientation represents a non-equilibrium gravity gradient torque orientation. Thie simulation results are shown in the following figures: .. image:: /_images/Scenarios/scenarioAttitudeGG1.svg :align: center .. image:: /_images/Scenarios/scenarioAttitudeGG2.svg :align: center .. image:: /_images/Scenarios/scenarioAttitudeGG3.svg :align: center Where in :ref:`scenarioAttitudeGuidance` the attitude error asymptotically converged to zero, with the gravity gradient torque the closed loop dynamics is now only Lagrange stable or bounded.