diff options
author | Keith Packard <keithp@keithp.com> | 2009-05-16 20:04:31 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-05-16 20:04:31 -0700 |
commit | fec4212a59a7b3321536b25707dcabc43c797c33 (patch) | |
tree | 864ea545b087c0b84f20e3072e49caa0c8bd0595 | |
parent | 09771c644de54ae354e8f98af7ba74289b3c0fcc (diff) |
Abandon use of accelerometer for apogee detect.
Integrating the accelerometer data to compute velocity worked for one rocket
flight, but additional testing shows that it doesn't work in other
airframes. Until we figure out how this should work, we'll rely on the
altimeter to detect apogee.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | ao_flight.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ao_flight.c b/ao_flight.c index 0b47bfa5..48f71202 100644 --- a/ao_flight.c +++ b/ao_flight.c @@ -156,6 +156,10 @@ ao_flight(void) ao_raw_pres = ao_adc_ring[ao_flight_adc].pres; ao_flight_tick = ao_adc_ring[ao_flight_adc].tick; + ao_flight_accel -= ao_flight_accel >> 4; + ao_flight_accel += ao_raw_accel >> 4; + ao_flight_pres -= ao_flight_pres >> 4; + ao_flight_pres += ao_raw_pres >> 4; /* Update velocity * * The accelerometer is mounted so that @@ -175,10 +179,6 @@ ao_flight(void) ao_flight_adc = ao_adc_ring_next(ao_flight_adc); } - ao_flight_accel -= ao_flight_accel >> 4; - ao_flight_accel += ao_raw_accel >> 4; - ao_flight_pres -= ao_flight_pres >> 4; - ao_flight_pres += ao_raw_pres >> 4; if (ao_flight_pres < ao_min_pres) ao_min_pres = ao_flight_pres; @@ -334,7 +334,7 @@ ao_flight(void) * over in that case and the integrated velocity * measurement should suffice to find apogee */ - if (abs(ao_flight_vel) > ao_min_vel + ACCEL_VEL_APOGEE || + if (/* abs(ao_flight_vel) > ao_min_vel + ACCEL_VEL_APOGEE || */ ao_flight_pres > ao_min_pres + BARO_APOGEE) { /* ignite the drogue charge */ |