diff --git a/STM32Cube/Calculations/trajectory_lib.c b/STM32Cube/Calculations/trajectory_lib.c index 5566db7..da4d670 100644 --- a/STM32Cube/Calculations/trajectory_lib.c +++ b/STM32Cube/Calculations/trajectory_lib.c @@ -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 /** @@ -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. */ @@ -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 diff --git a/STM32Cube/Calculations/trajectory_lib.h b/STM32Cube/Calculations/trajectory_lib.h index 7d26fd6..e9d82db 100644 --- a/STM32Cube/Calculations/trajectory_lib.h +++ b/STM32Cube/Calculations/trajectory_lib.h @@ -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.