Skip to content

Commit

Permalink
drag hack scale
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-gu committed Aug 18, 2024
1 parent b637766 commit 38f3f2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion STM32Cube/Calculations/trajectory_lib.c
Original file line number Diff line number Diff line change
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

0 comments on commit 38f3f2f

Please sign in to comment.