Skip to content

Commit

Permalink
Merge pull request #140 from NCSU-High-Powered-Rocketry-Club/legacy-c…
Browse files Browse the repository at this point in the history
…onfig

Switch to Legacy Launch 1 configuration
  • Loading branch information
harshil21 authored Jan 25, 2025
2 parents f6bc36f + 2537d5b commit a3b681b
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
python-version-file: "pyproject.toml"

- name: Install the project
run: uv sync
run: uv sync --verbose --group dev

- name: Run integration tests
timeout-minutes: 3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
python-version-file: "pyproject.toml"

- name: Install the project
run: uv sync
run: uv sync --verbose --group dev

- name: Run tests with coverage
run: |
Expand Down
4 changes: 2 additions & 2 deletions airbrakes/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ServoExtension(Enum):
MIN_EXTENSION = -0.75
MAX_EXTENSION = 0.055
MIN_NO_BUZZ = -0.72
MAX_NO_BUZZ = 0.05
MAX_NO_BUZZ = 0.01


# -------------------------------------------------------
Expand Down Expand Up @@ -166,7 +166,7 @@ class DisplayEndingType(StrEnum):
motor has stopped burning if the current velocity is less than a percentage of the max velocity."""

# ----------------- Coasting to Freefall -----------------
TARGET_ALTITUDE_METERS = 1000
TARGET_ALTITUDE_METERS = 1
"""The target altitude in meters that we want the rocket to reach. This is used with our bang-bang
controller to determine when to extend and retract the airbrakes."""

Expand Down
2 changes: 1 addition & 1 deletion airbrakes/simulation/sim_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
motor="AeroTech_J500G",
airbrake_retracted_cd=np.array([[0.05, 0.2, 0.3], [0.5, 0.445, 0.43]]),
airbrake_extended_cd=np.array([[0.05, 0.2, 0.3], [0.65, 0.595, 0.58]]),
rocket_mass=np.float64(5.103),
rocket_mass=np.float64(5.76),
reference_area=np.float64(0.008107),
airbrakes_reference_area=np.float64(0.00487741),
air_temperature=np.float64(10),
Expand Down
5 changes: 5 additions & 0 deletions launch_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ This folder contains the launch data of actual previous flights. These are used
3. `genesis_launch_1.csv`: This was our first attempt of a control launch with the Genesis subscale rocket. We tried to have it extend its airbrakes for most of coast and then retract them, but later analysis proved that airbrakes didn't deploy during coast. Additionally, the LandedState was incorrectly detected, so for convenience ~100 mb of useless data has been cropped out of this file.
The timestamps of the LandedState packets were synced with the timestamps of the last packet in the file. See #91 for more details.
4. `genesis_launch_2.csv`: This was our second attempt of a control launch with Genesis. For this one we told the airbrakes to deploy once at around the start of CoastState and did not tell them to retract at all. When we recovered the rocket, the fins were extended, by analysis of launch data shows that the airbrakes didn't deploy in CoastState, and most likely deployed sometime either in FreeFall or once the rocket hit the ground. LandedState was mostly correctly detected. See #91 for more details.
5. `legacy_launch_1.csv`: This was the first time airbrakes physically deployed! The airbrakes were pre-programmed to stay deployed after apogee convergence.
6. `legacy_launch_2.csv`: This was the second time airbrakes physically deployed! This was a control launch where the we planned to hit a target apogee.

## Videos

There is a video of the launch from the rocket's perspective in the `videos` folder.

## Metadata

Expand Down
56 changes: 56 additions & 0 deletions launch_data/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,61 @@
"apogee_meters": 463.62
},
"flight_description": "Second flight of apogee prediction code. This was very similar to first flight and airbrakes most likely failed to deploy at the intended time. See https://github.com/NCSU-High-Powered-Rocketry-Club/AirbrakesV2/issues/91 for more details."
},
"legacy_launch_1.csv": {
"date": "2025-01-25 12:11:35.000",
"launch_site": {
"air_temperature_celsius": 4.11,
"air_pressure_mb": null,
"wind_speed_kmh": null,
"wind_speed_direction": null,
"launch_coordinates": {
"latitiude": 35.1758000,
"longitude": -76.8283400
},
"landed_coordinates:": {
"latitude": null,
"longitude": null
},
"launch_rod_angle": 5.0
},
"imu_details": {
"imu_model": "Parker-LORD 3DM-CX5-15",
"raw_packet_frequency": 1000.0,
"est_packet_frequency": 500.0
},
"flight_data": {
"log_buffer_index": 5000,
"apogee_meters": null
},
"flight_description": ""
},
"legacy_launch_2.csv": {
"date": "2025-01-25 15:11:35.000",
"launch_site": {
"air_temperature_celsius": 3.11,
"air_pressure_mb": null,
"wind_speed_kmh": null,
"wind_speed_direction": null,
"launch_coordinates": {
"latitiude": 35.1758000,
"longitude": -76.8283400
},
"landed_coordinates:": {
"latitude": null,
"longitude": null
},
"launch_rod_angle": 5.0
},
"imu_details": {
"imu_model": "Parker-LORD 3DM-CX5-15",
"raw_packet_frequency": 1000.0,
"est_packet_frequency": 500.0
},
"flight_data": {
"log_buffer_index": 5000,
"apogee_meters": null
},
"flight_description": ""
}
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "AirbrakesV2"
description = "Logic for airbrakes as a part of the NASA Student Launch Competition"
requires-python = ">=3.13"
version = "0.1.0"
version = "1.1.0"
readme = "README.md"
dependencies = [
"gpiozero",
Expand Down
4 changes: 4 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
LAUNCH_DATA = list(Path("launch_data").glob("*.csv"))
# Remove the genesis_launch_1.csv file since it's almost the same as genesis_launch_2.csv:
LAUNCH_DATA.remove(Path("launch_data/genesis_launch_1.csv"))
# Remove the legacy_launch_2.csv file since it's almost the same as legacy_launch_1.csv:
# LAUNCH_DATA.remove(Path("launch_data/legacy_launch_2.csv"))
# Use the filenames as the ids for the fixtures:
LAUNCH_DATA_IDS = [log.stem for log in LAUNCH_DATA]

Expand Down Expand Up @@ -132,6 +134,8 @@ def target_altitude(request):
return 1800.0 # actual apogee was about 1854m
if launch_name == "genesis_launch_2":
return 413.0 # actual apogee was about 462m
# if launch_name == "legacy_launch_1":
# return 600.0 # actual apogee was about 650m
return 1000.0 # Default altitude


Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a3b681b

Please sign in to comment.