altos: Ignore alt error for fast->coast. Allow larger error for baro apogee.
authorKeith Packard <keithp@keithp.com>
Wed, 23 Mar 2011 01:33:38 +0000 (10:33 +0900)
committerKeith Packard <keithp@keithp.com>
Wed, 23 Mar 2011 01:33:38 +0000 (10:33 +0900)
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 <keithp@keithp.com>
src/ao_flight.c
src/make-kalman

index 39325a69713f86116850a2314f2bcb6e20b7de4b..88f0544f83a076ce4a702a966c23c0703c3376a9 100644 (file)
@@ -626,8 +626,7 @@ ao_flight(void)
                         * but the barometer is being ignored as
                         * it may be unreliable.
                         */
                         * 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));
                        {
                                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
                         */
                        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
                                )
                        {
 #endif
                                )
                        {
index 6fb181ecc6a040562e55e49b8eeaf66c1999e5d4..5a25e1ecda8b98476c437e4e3ef405fbd0cc5fd2 100644 (file)
@@ -2,8 +2,8 @@
 
 cd ../kalman
 
 
 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
 SIGMA_ACCEL="-M 2 -H 4 -A 4"
 
 nickle kalman.5c -p AO_BOTH -c both -t 0.01 $SIGMA_BOTH