I added Mach immunity using the MPU's accelerometer. The vertical velocity is calculated using the y-axis acceleration data. In order for the drogue parachute to deploy, this velocity must be less than than SUBSONIC_SPEED (which has been defined under setup_params.h).
The loopTimer variable measures the main loop's time interval.
loopTimer is reset on every loop cycle
The TimeData struct stores the value of this time interval in the dt member.
avg_y_accel stores the average y-axis acceleration based on the 3 most recent Samples.
mpuVelY is the vertical velocity based on the integration of avg_y_accel
Added the conditional statement mpuVelY < SUBSONIC_SPEED to avoid deployment of the drogue parachute if the vertical velocity is too high ( and possibly in the transonic range)
Mention [stepsize] in a comment if you'd like to report some technical debt. See examples here.
I added Mach immunity using the MPU's accelerometer. The vertical velocity is calculated using the y-axis acceleration data. In order for the drogue parachute to deploy, this velocity must be less than than SUBSONIC_SPEED (which has been defined under setup_params.h).