Dexter Carpenter
Winter & Spring, 2024
This repository hosts MATLAB scripts and data to run a simulation for Oregon State University's Experimental Sounding Rocket Association Team. The simulation is used to gain understanding of how the Blade Extending Apogee Variance System (Air Brakes) will affect the rocket's flight path. The simulation takes OpenRocket data export in conjunction with OpenMotor custom motors as a basis.
Read more about it on my Website
Objectives
- Understand the total braking power of BEAVS given varying rocket designs
- Separation failure risk analysis
- PID control simulation
- Output data to BEAVS hardware to simulate flight (did not achieve)
Preliminary simulation and proof of concept.
Simulation 2 aims to provide a better representation for the Coefficient of Drag. Future iterations of the simulation will aim to control the BEAVS extension.
Incorporates a basic feedback script into the simulation. A function is used to calculate a predicted apogee and alter the blade extension based on the difference between the predicted apogee and target apogee. This version also attempts to use Runge-Kutta (4,5) to solve the ODE.
Adds PID option to start finding Kp, Ki, and Kd values. This PID evaluated the error between the current altitude and a target altitude of 10,000ft.
Instead of having the PID evaluate the error between the altitude, it now uses a lookup table to determine the error between a velocity. The lookup table is based on a previous test flight.
This version has aimed to make the simulation more interactive and user-friendly. There are more prompts for user input instead of hard-coding inputs into the main script. The code is better commented and functions are explained. Version 6 is likely a 'final release' for the BEAVS 4 Simulation.
To use this simulation to test your own OpenRocket rockets, you must use the following file export format:
OpenRocket Data Export config:
- Must go Edit > Preferences > Units > Default Metric > Ok
- Select All Variables
- Format > Field Seperator String > Comma
- Decimal Places > 3
- Use Exponential Notation
- Section Comments > Don't Include Simulation Description
- Section Comments > Don't Include Flight Events
- Comment Character > #
- Keep Field Descriptions
OpenRocket Event Export config:
- Variables to Export > None
- Format Settings > csv
- Include Flight Events
- Comment Character > #
However, this script was not written for general use. The primary function is to provide the OSU ESRA team insights. Modification of the data display requires edits to the script, and is not made easy to use for an outside user. Use outside of the OSU ESRA team is certainly encouraged.
See also Colin Hale-Brown's repository for BEAVS 4.0
This uses MATLAB R2020b or MATLAB R2023a for Version 6
Requires Statistics and Machine Learning Toolbox
This very helpful Trajectory Calculation PDF by MIT.