From f7d2613bb0a6ab1c63e3f6252a3a2358fdfbc691 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 29 Oct 2012 17:07:05 -0700 Subject: [PATCH] altos/micropeak: Set boost detect to 10m. Add 30s boost delay. Wait for 30 seconds before even starting look for boost. This provides an opportunity to close up the airframe, potentially causing pressure gradients seen by the baro sensor. Also, require a 10m vertical motion before triggering boost. This should limit accidental boost detect while capturing any actual flights. Signed-off-by: Keith Packard --- doc/micropeak.xsl | 22 +++++++++++++++++----- src/micropeak/ao_micropeak.c | 8 +++++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/doc/micropeak.xsl b/doc/micropeak.xsl index 2faef41c..556700c0 100644 --- a/doc/micropeak.xsl +++ b/doc/micropeak.xsl @@ -83,15 +83,27 @@ NAR #88757, TRA #12200 height is reported in decimeters, so the last digit will be tenths of a meter. For example, if MicroPeak reports 5 4 4 3, then the maximum height of the last flight was 544.3m, or - 1786 feet. After reporting the last flight, MicroPeak starts - waiting for launch. It will flash once every three seconds - in this mode. + 1786 feet. - Fly the rocket. Once the rocket passes about 4m in height - (13 feet), the micro-controller will record the ground + Finish preparing the rocket for flight. After the + previous flight data have been reported, MicroPeak waits for + 30 seconds before starting to check for launch. This gives + you time to finish assembling the rocket. As those + activities might cause pressure changes inside the airframe, + MicroPeak might accidentally detect boost. If you need to do + anything to the airframe after the 30 second window passes, + make sure to be careful not to disturb the altimeter. The + LED will remain dark during the 30 second delay, but after + that, it will start blinking once every 3 seconds. + + + + + Fly the rocket. Once the rocket passes about 10m in height + (32 feet), the micro-controller will record the ground pressure and track the pressure seen during the flight. In this mode, the LED flickers rapidly. When the rocket lands, and the pressure stabilizes, the micro-controller will record diff --git a/src/micropeak/ao_micropeak.c b/src/micropeak/ao_micropeak.c index 1d11300e..bf656979 100644 --- a/src/micropeak/ao_micropeak.c +++ b/src/micropeak/ao_micropeak.c @@ -48,7 +48,10 @@ ao_pa_get(void) #define GROUND_AVG (1 << GROUND_AVG_SHIFT) /* Pressure change (in Pa) to detect boost */ -#define BOOST_DETECT 48 /* 4m at sea level, 4.8m at 2000m */ +#define BOOST_DETECT 120 /* 10m at sea level, 12m at 2000m */ + +/* Wait after power on before doing anything to give the user time to assemble the rocket */ +#define BOOST_DELAY AO_SEC_TO_TICKS(30) /* Pressure change (in Pa) to detect landing */ #define LAND_DETECT 12 /* 1m at sea level, 1.2m at 2000m */ @@ -121,6 +124,7 @@ main(void) ao_log_micro_dump(); #endif + ao_delay(BOOST_DELAY); /* Wait for motion, averaging values to get ground pressure */ time = ao_time(); ao_pa_get(); @@ -136,8 +140,6 @@ main(void) ao_led_off(AO_LED_BLUE); pa_avg = pa_avg - (pa_avg >> FILTER_SHIFT) + pa; pa_diff = pa_ground - pa_avg; - if (pa_diff < 0) - pa_diff = -pa_diff; /* Check for a significant pressure change */ if (pa_diff > (BOOST_DETECT << FILTER_SHIFT)) -- 2.30.2