summaryrefslogtreecommitdiff
path: root/src/micropeak
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-10-29 17:07:05 -0700
committerKeith Packard <keithp@keithp.com>2012-10-29 17:13:23 -0700
commitf7d2613bb0a6ab1c63e3f6252a3a2358fdfbc691 (patch)
treed65409298ee14ef88d2cc65404224bd805bb6533 /src/micropeak
parent0d0ece403028e8a4453cc380575ed95c5e00ddb7 (diff)
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 <keithp@keithp.com>
Diffstat (limited to 'src/micropeak')
-rw-r--r--src/micropeak/ao_micropeak.c8
1 files changed, 5 insertions, 3 deletions
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))