.. _scenarioAttitudeFeedbackRWPower: scenarioAttitudeFeedbackRWPower =============================== Overview -------- Illustrates how to add a :ref:`ReactionWheelPower` to the simulation to track the RW power usages. Further, a the RW power modules are connected to a battery to illustrate the energy usage during this maneuver. This script expands on :ref:`scenarioAttitudeFeedbackRW`. The script is found in the folder ``xmera/examples`` and executed by using:: python3 scenarioAttitudeFeedbackRWPower.py The simulation layout is shown in the following illustration. A single simulation process is created which contains both the spacecraft simulation modules, as well as the Flight Software (FSW) algorithm modules. The 3 separate :ref:`ReactionWheelPower` instances are created to model the RW power requirements. For more examples on using the RW power module see :ref:`test_unitReactionWheelPower`. Next, a battery module is created using :ref:`simpleBattery`. All the RW power draw messages are connected to the battery to model the total energy usage. .. image:: /_images/static/test_scenarioAttitudeFeedbackRWPower.svg :align: center Illustration of Simulation Results ---------------------------------- The first simulation scenario is run with ``useRwPowerGeneration = False`` to model RW devices which require electrical power to accelerate and decelerate the fly wheels. The attitude history should be the same as in :ref:`scenarioAttitudeFeedbackRW`. Shown below are the resulting RW power requirements, as well as the time history of the battery state. :: show_plots = True, useRwPowerGeneration = False .. image:: /_images/Scenarios/scenarioAttitudeFeedbackRWPower3False.svg :align: center .. image:: /_images/Scenarios/scenarioAttitudeFeedbackRWPower4False.svg :align: center The next simulation allows 50% of the breaking power to be returned to the power system. You can see how this will reduce the overall maneuver energy requirements. :: show_plots = True, useRwPowerGeneration = True .. image:: /_images/Scenarios/scenarioAttitudeFeedbackRWPower3True.svg :align: center .. image:: /_images/Scenarios/scenarioAttitudeFeedbackRWPower4True.svg :align: center