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>
#define IGNITE_ON_P0 0
#define PACKET_HAS_MASTER 0
#define PACKET_HAS_SLAVE 1
#define IGNITE_ON_P0 0
#define PACKET_HAS_MASTER 0
#define PACKET_HAS_SLAVE 1
#define HAS_COMPANION 1
#define COMPANION_CS_ON_P1 1
#define HAS_COMPANION 1
#define COMPANION_CS_ON_P1 1
-vpath % ..:../core:../drivers
+vpath % ..:../core:../drivers:../util
-PROGS=ao_flight_test ao_flight_test_baro ao_flight_test_accel ao_gps_test ao_gps_test_skytraq ao_convert_test
+PROGS=ao_flight_test ao_flight_test_baro ao_flight_test_accel ao_flight_test_noisy_accel ao_gps_test ao_gps_test_skytraq ao_convert_test
+
+KALMAN=make-kalman
CFLAGS=-I.. -I. -I../core -I../drivers -O0 -g
CFLAGS=-I.. -I. -I../core -I../drivers -O0 -g
ao_flight_test: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c altitude.h ao_kalman.h
cc $(CFLAGS) -o $@ $<
ao_flight_test: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c altitude.h ao_kalman.h
cc $(CFLAGS) -o $@ $<
+ao_flight_test_noisy_accel: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c altitude.h ao_kalman.h
+ cc -DNOISY_ACCEL=1 $(CFLAGS) -o $@ $<
+
ao_flight_test_baro: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c altitude.h ao_kalman.h
cc $(CFLAGS) -o $@ -DHAS_ACCEL=0 ao_flight_test.c
ao_flight_test_baro: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c altitude.h ao_kalman.h
cc $(CFLAGS) -o $@ -DHAS_ACCEL=0 ao_flight_test.c
ao_convert_test: ao_convert_test.c ao_convert.c altitude.h
cc $(CFLAGS) -o $@ $<
ao_convert_test: ao_convert_test.c ao_convert.c altitude.h
cc $(CFLAGS) -o $@ $<
+
+ao_kalman.h: $(KALMAN)
+ (cd .. && make ao_kalman.h)
\ No newline at end of file
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="-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
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
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
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
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
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