diff options
author | Keith Packard <keithp@keithp.com> | 2011-03-23 10:33:38 +0900 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-03-23 10:33:38 +0900 |
commit | 32364c9e0d346e0e5d517e18d4e90b8ff2fa944f (patch) | |
tree | 0e4d8e491265045dec86535bd603dcec52372bba | |
parent | 3d2042ccc2d29e4cb8ea39c5c69d07cb7e3daeea (diff) |
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 <keithp@keithp.com>
-rw-r--r-- | src/ao_flight.c | 5 | ||||
-rw-r--r-- | src/make-kalman | 4 |
2 files changed, 4 insertions, 5 deletions
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 |