summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-10-08 22:19:52 -0600
committerKeith Packard <keithp@keithp.com>2011-10-08 22:23:16 -0600
commitca036c5616c3e745c0b878ed90618d4ff710c0e5 (patch)
treee695913d8b6ad4ae65ed3d22811fcda08fedffca /src/util
parent26d7eb7149da8c797d7e704d75f73af2d2aa52c2 (diff)
altos: Improve TM v1.0 apogee estimate
v1.0 boards have noisy accelerometer data caused by interactions between RF transmission and the accelerometer measurements; this noise generates a negative bias in the accelerometer readings. The net effect is that the estimated speed is lower than the actual speed, causing early an apogee estimate. By increasing the sigma value for accelerometer data, the kalman filter 'trusts' the acceleration data less, putting more weight on the barometer data. This causes the estimated time of apogee to be closer to the correct value. This reduces the response to changes in acceleration. This new value is applied solely to TeleMetrum v1.0 boards. v1.1 boards correct for this error, and hence can use the correct sigma value for the accelerometer. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/make-kalman22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/util/make-kalman b/src/util/make-kalman
index 397d6020..fd33bab0 100644
--- a/src/util/make-kalman
+++ b/src/util/make-kalman
@@ -5,11 +5,32 @@ cd $1 2> /dev/null 1>&2
SIGMA_BOTH="-M 2 -H 6 -A 2"
SIGMA_BARO="-M 2 -H 6 -A 2"
SIGMA_ACCEL="-M 2 -H 4 -A 4"
+SIGMA_BOTH_NOISY_ACCEL="-M 2 -H 6 -A 3"
+
+echo '#if NOISY_ACCEL'
+echo
+echo '/* TeleMetrum v1.0 boards have noisy accelerometer values'
+echo ' * increase the sigma value for accel data to compensate.'
+echo ' * This improves the accuracy of apogee detection.'
+echo ' */'
+echo
+
+nickle kalman.5c -p AO_BOTH -c both -t 0.01 $SIGMA_BOTH_NOISY_ACCEL
+nickle kalman.5c -p AO_BOTH -c both -t 0.1 $SIGMA_BOTH_NOISY_ACCEL
+nickle kalman.5c -p AO_BOTH -c both -t 1 $SIGMA_BOTH_NOISY_ACCEL
+
+echo '#endif'
+echo
+echo '#ifndef AO_BOTH_K00_100'
+echo
nickle kalman.5c -p AO_BOTH -c both -t 0.01 $SIGMA_BOTH
nickle kalman.5c -p AO_BOTH -c both -t 0.1 $SIGMA_BOTH
nickle kalman.5c -p AO_BOTH -c both -t 1 $SIGMA_BOTH
+echo '#endif'
+echo
+
nickle kalman.5c -p AO_ACCEL -c accel -t 0.01 $SIGMA_ACCEL
nickle kalman.5c -p AO_ACCEL -c accel -t 0.1 $SIGMA_ACCEL
nickle kalman.5c -p AO_ACCEL -c accel -t 1 $SIGMA_ACCEL
@@ -17,3 +38,4 @@ nickle kalman.5c -p AO_ACCEL -c accel -t 1 $SIGMA_ACCEL
nickle kalman.5c -p AO_BARO -c baro -t 0.01 $SIGMA_BARO
nickle kalman.5c -p AO_BARO -c baro -t 0.1 $SIGMA_BARO
nickle kalman.5c -p AO_BARO -c baro -t 1 $SIGMA_BARO
+