Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final values for comp #96

Merged
merged 6 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions STM32Cube/Calculations/trajectory_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define EARTH_MEAN_RADIUS 6371009 // m
#define TOL 0.00001
#define TIME_STEP 0.05 // s
#define ROCKET_BURNOUT_MASS_KG 39.609
#define ROCKET_BURNOUT_MASS_KG 42.5288206112 // 93.76 lbs
#define LAUNCH_PAD_ELEVATION_M 295.0

/**
Expand Down Expand Up @@ -77,6 +77,8 @@ static const Cubic2VariablePolynomial DRAG_POLYNOMIAL_COEFFS[11] = {
-0.1879f, -31.8071f, 15.4422f, -1.1456f} // 100% ext
};

#define DRAG_HACK_SCALE 1.25

/**
* Evaluates a cubic 2 variable polynomial at the given coordinates.
*/
Expand Down Expand Up @@ -123,7 +125,7 @@ float dragAccel_m_s2(float extension, float speed_m_s, float altitude_m) {
#undef INTERPOLATE_FIELD
}
// Divide drag force by mass to get acceleration
#define SCALE_FIELD(field) poly.field /= ROCKET_BURNOUT_MASS_KG;
#define SCALE_FIELD(field) poly.field *= DRAG_HACK_SCALE / ROCKET_BURNOUT_MASS_KG;
APPLY_TO_FIELDS(SCALE_FIELD)
#undef SCALE_FIELD
#undef APPLY_TO_FIELDS
Expand Down
2 changes: 1 addition & 1 deletion STM32Cube/Calculations/trajectory_lib.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TRAJECTORY_LIB_H_
#define TRAJECTORY_LIB_H_

#define EXTENSION_REFERENCE 0.58f
#define EXTENSION_REFERENCE 0.53f

/**
* Returns the acceleration due to drag acting on the rocket.
Expand Down
Loading