From 6a330432979ddd2b7f17add225c52873fb6622a6 Mon Sep 17 00:00:00 2001 From: peabody124 Date: Fri, 26 Nov 2010 15:57:12 +0000 Subject: [PATCH] AHRS: Tweak setting when mag is used to allow greater error in vector length and start using from power up git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2158 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/AHRS/ahrs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flight/AHRS/ahrs.c b/flight/AHRS/ahrs.c index 9a9eeee6e..45a4a852a 100644 --- a/flight/AHRS/ahrs.c +++ b/flight/AHRS/ahrs.c @@ -44,7 +44,7 @@ #define INSGPS_GPS_MINSAT 6 /* 2 seconds triggers reinit of position */ #define INSGPS_GPS_MINPDOP 3.5 /* minimum PDOP for postition updates */ #define INSGPS_MAGLEN 1000 -#define INSGPS_MAGTOL 0.2 /* error in magnetic vector length to use */ +#define INSGPS_MAGTOL 0.5 /* error in magnetic vector length to use */ // For debugging the raw sensors //#define DUMP_RAW @@ -668,8 +668,7 @@ void process_mag_data() HomeLocationGet(&home); if (PIOS_HMC5843_NewDataAvailable() && (home.Set == HOMELOCATION_SET_TRUE) && - ((home.Be[0] != 0) || (home.Be[1] != 0) || (home.Be[2] != 0)) && - ((float) timer_count() / timer_rate() > 5)) { + ((home.Be[0] != 0) || (home.Be[1] != 0) || (home.Be[2] != 0))) { PIOS_HMC5843_ReadMag(mag_data.raw.axis); // Swap the axis here to acount for orientation of mag chip (notice 0 and 1 swapped in raw) mag_data.scaled.axis[0] = (mag_data.raw.axis[1] * mag_data.calibration.scale[0]) + mag_data.calibration.bias[0];