Code Monkey home page Code Monkey logo

rocket-env's Introduction

Rocket SIM 6DOF

This is a Python Gym environment to simulate a 6 degrees of freedom rocket.

rocket-trajectory

Features

  • full 6DOF rocket landing environment
  • realistic dynamics equation modeled on a rigid body assumption
  • interactive 3D visualization through PyVista
  • actuators available:
    1. thruster
    2. fins
  • Wandb logging wrapper

Continuous action space

The environment employes a continuous action space, with the engine allowed to throttle between maxThrust and minThrust. The thrust was normalized to lie in the range [-1, +1] as best practice for convergence of the algorithms suggest. The engine is gimbaled by two angles $\delta_y$ and $\delta_z$ around two hinge points, respectively moving the engine around the z and y axis.

Aerodynamic fins control

Research question:

  • Is there a reduction in fuel consumption when the thruster is aided by fins? Quantify it.

Actuator description

  • Pitch plane ( x - z ) corresponding to i={1,2}:

    • Diagram of the angles

    • Position vector of the fin i in body coordinates:

      $$ \vec{x}^{B,i} = \begin{bmatrix} x_{fin}^i \ \pm r_{base} \ 0 \end{bmatrix} $$

  • Yaw plane ( x - y ) corresponding to i={3,4}:

    • Diagram of the angles

    • Position vector of the fin i in body coordinates: $$\vec{x}^{B,i} = \begin{bmatrix}x_{fin}^i \ 0 \ \pm r_{base}\end{bmatrix}$$

Actuator control definition (x-y)

To compute the force generated by the fin i in body axis we have to:

  1. Neglecting wind, we can compute the air velocity of the center of mass of the vehicle as:

    $$ \vec{v}^B_{air} = R_{I \rightarrow B}\vec{v}^I$$

  2. Compute the velocity vector at each fin location i (denoted by its position vector in body coordinates $\vec{x}^{B,i}$), taking into account the rotation of the rocket:

    $$ \vec{v}^{B,i}{air} = \vec{v}^B{air} + \vec{\omega}^B \times \left[ \vec{x}^{B,i} - \vec{x}^{B,CG}\right] $$

  3. Compute the aerodynamic angles at the location of each fin i:

    • x-z plane aerodynamic angle:

      $$\alpha^i = \arctan 2 \left[ \frac{v_z^{B,i}}{v_x^{B,i}} \right]$$

    • x-y plane aerodynamic angle:

      $$ \beta^i = \arcsin \left[ \frac{v_y^{B,i}}{||\vec{v}^{B,i}||} \right] $$

  4. Input the angle of deflection from the longitudinal axis of the fin $\beta_{fin,i}$ (i.e. the control input).

  5. Compute the angle of attack $AoA$ of each fin i:

    • Yaw plane ( x - y ): $$AoA_i = -\beta_{fin,i} - \beta^i$$

    • Pitch plane ( x - z ): $$AoA_i = \beta_{fin,i} - \alpha^i$$

  6. Compute the aerodynamic pressure $$q=\frac{1}{2}\rho(x)||\vec{\vec{v}^{B,i}_{air}}||$$

  7. Compute the normal force coefficient $C_f$:

    $$ C_f(AoA_i)=\bar{C_f} \sin{AoA_i} $$

  8. Compute the aerodynamic force at each fin i:

    • Yaw plane ( x - y ):

      $$ \vec{F}^B_{fin,i} = qS_{fin}C_f\left(AoA_i\right) \begin{bmatrix} \sin{\beta_{fin,i}} & \cos{\beta_{fin,i}} & 0 \end{bmatrix}^T$$

    • Pitch plane ( x - z ):

      $$ \vec{F}^B_{fin,i} = qS_{fin}C_f\left(AoA_i\right) \begin{bmatrix} -\sin{\beta_{fin,i}} & 0 & \cos{\beta_{fin,i}} \end{bmatrix}^T$$

  9. Compute the aerodynamic torque for each fin i:

    $$ M^i = \left[ \vec{x}^{B,i} - \vec{x}^{B,CG}\right] \times \vec{F}^B_{fin,i} $$

rocket-env's People

Contributors

tuxliri avatar

Watchers

 avatar

rocket-env's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.