|
| 1 | +Rocket Class Axes Definitions |
| 2 | +============================= |
| 3 | + |
| 4 | +The Rocket class has two different coordinate systems: |
| 5 | + |
| 6 | +1. **User Defined Coordinate System**: Used for geometrical inputs of the \ |
| 7 | + aerodynamic surfaces and motor. |
| 8 | +2. **Body Axes Coordinate System**: Used during the flight simulation to assess \ |
| 9 | + the governing equations of motion. |
| 10 | + |
| 11 | +All inputs are automatically converted from the user's coordinate system to the |
| 12 | +rocket body axes coordinate system for use during the simulation. |
| 13 | + |
| 14 | +Let's dive into the definitions of these coordinate systems: |
| 15 | + |
| 16 | + |
| 17 | +1. User Defined Coordinate System |
| 18 | +--------------------------------- |
| 19 | + |
| 20 | +Two things are set by the user in the user input coordinate system: |
| 21 | + |
| 22 | +1. **Coordinate System Origin**: The origin of the coordinate system is set at \ |
| 23 | + any point along the rocket's center line. This point can be arbitrarily chosen \ |
| 24 | + and is not explicitly defined. All inputs must be given relative to this \ |
| 25 | + point. |
| 26 | +2. **Direction of Center Axis**: Specified by the ``coordinate_system_orientation`` \ |
| 27 | + argument when initializing the Rocket (:class:`rocketpy.Rocket.__init__`). This \ |
| 28 | + argument defines the direction of the axis that follows the rocket's center \ |
| 29 | + line. It can be either ``"nose_to_tail"`` or ``"tail_to_nose"``. |
| 30 | + |
| 31 | +.. tip:: |
| 32 | + |
| 33 | + If you are using some CAD software to design your rocket, you can imagine the \ |
| 34 | + coordinate system as the one used in the CAD software. The origin of the \ |
| 35 | + coordinate system is the origin of the rocket in the CAD software, and the \ |
| 36 | + direction of the center axis is the direction of the rocket's centerline. \ |
| 37 | + You don't need to worry about the exact position of the origin, as long as \ |
| 38 | + all inputs are given relative to this point. |
| 39 | + |
| 40 | +.. seealso:: |
| 41 | + |
| 42 | + See `Positions and Coordinate Systems <positions.rst>`_ for more \ |
| 43 | + information on the definitions of the rocket's aerodynamic surfaces and motor. |
| 44 | + |
| 45 | +The ``x`` and ``y`` axes are defined at the plane perpendicular to the center axis, |
| 46 | +while the ``z`` axis is defined along the center axis. Depending on the choice of |
| 47 | +``coordinate_system_orientation``, the ``x`` axis and ``y`` axis can be inverted. |
| 48 | + |
| 49 | +The following figure shows the two possibilities for the user input coordinate system: |
| 50 | + |
| 51 | +.. figure:: ../../static/rocket/3dcsys.png |
| 52 | + :align: center |
| 53 | + :alt: Rocket axes |
| 54 | + |
| 55 | +.. note:: |
| 56 | + |
| 57 | + When ``coordinate_system_orientation`` is set to ``"tail_to_nose"``, the direction \ |
| 58 | + of the ``x``, ``y``, and ``z`` axes of the **User Defined Coordinate System** is \ |
| 59 | + the same as the **Body Axes Coordinate System**. The origin of the coordinate \ |
| 60 | + system may still be different. |
| 61 | + |
| 62 | +Angular Position Inputs |
| 63 | +~~~~~~~~~~~~~~~~~~~~~~~ |
| 64 | + |
| 65 | +Angular position inputs (``angular_position``) refer to the roll angle position |
| 66 | +of that surface along the rocket's tube. The roll angle is defined as the angle |
| 67 | +from the ``y`` axis to the surface. |
| 68 | +Currently, only the :class:`rocketpy.RailButtons` class uses this kind of input. |
| 69 | + |
| 70 | +The following figure shows the roll angle |
| 71 | +definition for both ``coordinate_system_orientation`` options: |
| 72 | + |
| 73 | +.. figure:: ../../static/rocket/angularpos.png |
| 74 | + :align: center |
| 75 | + :alt: Angular position |
| 76 | + |
| 77 | + |
| 78 | +.. note:: |
| 79 | + |
| 80 | + The positive direction of the roll angle is defined as the direction that \ |
| 81 | + rotates the surface in the positive direction of the ``z`` axis. |
| 82 | + |
| 83 | +.. _rocket_axes_body_axes: |
| 84 | + |
| 85 | +2. Body Axes Coordinate System |
| 86 | +------------------------------ |
| 87 | + |
| 88 | +The body axes coordinate system is used inside the simulation to assess the |
| 89 | +governing equations of motion. The body axes coordinate system is defined as follows: |
| 90 | + |
| 91 | +- The origin is at the rocket's center of dry mass (``center_of_dry_mass_position``). |
| 92 | +- The ``z`` axis is defined along the rocket's centerline, pointing from the center of dry mass towards the nose. |
| 93 | +- The ``x`` and ``y`` axes are perpendicular. |
| 94 | + |
| 95 | +3. Relation to Flight Coordinates |
| 96 | +--------------------------------- |
| 97 | + |
| 98 | +The ``Flight`` class uses a coordinate system defined as follows: |
| 99 | + |
| 100 | +- The origin is at the launch rail. |
| 101 | +- The ``Z`` axis is positive upwards. |
| 102 | +- The ``X`` axis is position eastwards. |
| 103 | +- The ``Y`` axis is positive northwards. |
| 104 | + |
| 105 | +The following figure shows the rotational relationship between the |
| 106 | +**Body Axes Coordinate System** and the **Flight Coordinate System**: |
| 107 | + |
| 108 | +.. figure:: ../../static/rocket/flightcsys.png |
| 109 | + :align: center |
| 110 | + :alt: Flight coordinate system |
| 111 | + |
| 112 | +In the figure above, :math:`\bf{i}` is the ``inclination`` and :math:`\bf{h}` |
| 113 | +is the ``heading`` of the launch rail. |
| 114 | + |
| 115 | +The heading and inclination can be described in terms of Euler angles. |
| 116 | +The relation is given by: |
| 117 | + |
| 118 | +.. math:: |
| 119 | + \begin{aligned} |
| 120 | + &\text{Precession:} \quad &\psi &= -\bf{h} \\ |
| 121 | + &\text{Nutation:} \quad &\theta &= \bf{i} - 90° \\ |
| 122 | + \end{aligned} |
| 123 | +
|
| 124 | +A last rotation is defined by the ``angular_position`` of the rocket's rail buttons. |
| 125 | +This is a rotation around the rocket's centerline, and describes the last |
| 126 | +Euler angle: |
| 127 | + |
| 128 | +.. math:: |
| 129 | + \begin{aligned} |
| 130 | + &\text{Spin:} \quad &φ & \\ |
| 131 | + \end{aligned} |
| 132 | +
|
| 133 | +If no rail buttons pair ir present, the spin angle is set to **0°**. |
| 134 | + |
| 135 | +.. note:: |
| 136 | + |
| 137 | + With spin angle set to **0°**, if the launch rail ``heading`` is set to \ |
| 138 | + **0°** and rail ``inclination`` to **90°**, the **Body Axes Coordinate \ |
| 139 | + System** is aligned with the **Flight Coordinate System**. |
| 140 | + |
| 141 | +Rocket's initial orientation |
| 142 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 143 | + |
| 144 | +The initial orientation of the rocket is expressed in Euler parameters (quaternions). |
| 145 | +The Euler parameters are defined using the 3-1-3 rotation sequence: |
| 146 | + |
| 147 | +.. math:: |
| 148 | +
|
| 149 | + \begin{aligned} |
| 150 | + e_{0} &= \cos\left(\frac{φ}{2}\right) \cos\left(\frac{θ}{2}\right) \cos\left(\frac{ψ}{2}\right) - \sin\left(\frac{φ}{2}\right) \cos\left(\frac{θ}{2}\right) \sin\left(\frac{ψ}{2}\right) \\ |
| 151 | + e_{1} &= \cos\left(\frac{φ}{2}\right) \cos\left(\frac{ψ}{2}\right) \sin\left(\frac{θ}{2}\right) + \sin\left(\frac{φ}{2}\right) \sin\left(\frac{θ}{2}\right) \sin\left(\frac{ψ}{2}\right) \\ |
| 152 | + e_{2} &= \cos\left(\frac{φ}{2}\right) \sin\left(\frac{θ}{2}\right) \sin\left(\frac{ψ}{2}\right) - \sin\left(\frac{φ}{2}\right) \cos\left(\frac{ψ}{2}\right) \sin\left(\frac{θ}{2}\right) \\ |
| 153 | + e_{3} &= \cos\left(\frac{φ}{2}\right) \cos\left(\frac{θ}{2}\right) \sin\left(\frac{ψ}{2}\right) + \cos\left(\frac{θ}{2}\right) \cos\left(\frac{ψ}{2}\right) \sin\left(\frac{φ}{2}\right) \\ |
| 154 | + \end{aligned} |
| 155 | +
|
| 156 | +
|
0 commit comments