From: Keith Packard Date: Wed, 23 Mar 2011 01:33:38 +0000 (+0900) Subject: altos: Ignore alt error for fast->coast. Allow larger error for baro apogee. X-Git-Tag: 0.9.3~109 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=32364c9e0d346e0e5d517e18d4e90b8ff2fa944f altos: Ignore alt error for fast->coast. Allow larger error for baro apogee. With the fixed kalman filter, transitions across mach don't cause bumps in the merged filter. And, with working kalman bits, the signal for broken baro detection is stronger and so we can allow for baro apogee detection in cases where noise occurs close to apogee. Bump the kalman filter to trust the baro less so that the model tracks across mach. Signed-off-by: Keith Packard --- diff --git a/src/ao_flight.c b/src/ao_flight.c index 39325a69..88f0544f 100644 --- a/src/ao_flight.c +++ b/src/ao_flight.c @@ -626,8 +626,7 @@ ao_flight(void) * but the barometer is being ignored as * it may be unreliable. */ - if (ao_speed < AO_MS_TO_SPEED(AO_MAX_BARO_SPEED) && - (ao_raw_alt >= AO_MAX_BARO_HEIGHT || ao_error_h_sq_avg < 30)) + if (ao_speed < AO_MS_TO_SPEED(AO_MAX_BARO_SPEED)) { ao_flight_state = ao_flight_coast; ao_wakeup(DATA_TO_XDATA(&ao_flight_state)); @@ -647,7 +646,7 @@ ao_flight(void) */ if (ao_speed < 0 #if !HAS_ACCEL - && (ao_raw_alt >= AO_MAX_BARO_HEIGHT || ao_error_h_sq_avg < 30) + && (ao_raw_alt >= AO_MAX_BARO_HEIGHT || ao_error_h_sq_avg < 100) #endif ) { diff --git a/src/make-kalman b/src/make-kalman index 6fb181ec..5a25e1ec 100644 --- a/src/make-kalman +++ b/src/make-kalman @@ -2,8 +2,8 @@ cd ../kalman -SIGMA_BOTH="-M 2 -H 4 -A 4" -SIGMA_BARO="-M 2 -H 4 -A 4" +SIGMA_BOTH="-M 2 -H 6 -A 2" +SIGMA_BARO="-M 2 -H 6 -A 2" SIGMA_ACCEL="-M 2 -H 4 -A 4" nickle kalman.5c -p AO_BOTH -c both -t 0.01 $SIGMA_BOTH