ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
magnetic_config.h
Go to the documentation of this file.
1 /*
2  * magnetic_config.h
3  *
4  * Created on: Nov 26, 2014
5  * Author: B37804
6  */
7 
8 #ifndef MAGNETIC_CONFIG_H_
9 #define MAGNETIC_CONFIG_H_
10 
11 // geomagnetic model parameters
12 #define DEFAULTB 50.0F // default geomagnetic field (uT)
13 #define INV_DEFAULTB (1.0F/50.0F) // default geomagnetic field (1/uT)
14 
15 // magnetic calibration constants
16 #ifdef USE_SMALL_MAGBUFFER
17 // FXLC95000CL magnetic buffer parameters
18 #define MAGBUFFSIZEX 6 // x dimension in magnetometer buffer (6x12 equals 72 elements)
19 #define MAGBUFFSIZEY (2 * MAGBUFFSIZEX) // y dimension in magnetometer buffer (6x12 equals 72 elements)
20 #define MINMEASUREMENTS4CAL 40 // minimum number of measurements for 4 element calibration
21 #define MINMEASUREMENTS7CAL 55 // minimum number of measurements for 7 element calibration
22 #define MINMEASUREMENTS10CAL 60 // minimum number of measurements for 10 element calibration
23 #define MAXMEASUREMENTS 65 // maximum number of measurements used for calibration
24 #else
25 // Kinetis magnetic buffer parameters
26 #define MAGBUFFSIZEX 12 // x dimension in magnetometer buffer (12x24 equals 288 elements)
27 #define MAGBUFFSIZEY (2 * MAGBUFFSIZEX) // y dimension in magnetometer buffer (12x24 equals 288 elements)
28 #define MINMEASUREMENTS4CAL 40 // minimum number of measurements for 4 element calibration
29 #define MINMEASUREMENTS7CAL 100 // minimum number of measurements for 7 element calibration
30 #define MINMEASUREMENTS10CAL 150 // minimum number of measurements for 10 element calibration
31 #define MAXMEASUREMENTS 240 // maximum number of measurements used for calibration
32 #endif
33 
34 // parameters common to Kinetis and Galla
35 #define INTERVAL4CAL 75 // 3s at 25Hz: 4 element interval (samples)
36 #define INTERVAL7CAL 250 // 10s at 25Hz: 7 element interval (samples)
37 #define INTERVAL10CAL 750 // 30s at 25Hz: 10 element interval (samples)
38 #define MINBFITUT 10.0F // minimum acceptable geomagnetic field B (uT) for valid calibration
39 #define MAXBFITUT 90.0F // maximum acceptable geomagnetic field B (uT) for valid calibration
40 #define FITERRORAGINGSECS 7200.0F // 2 hours: time (s) for fit error to increase (age) by e=2.718
41 
42 //#define FUTPERCOUNT (1.0F/256.0F) // Really uT per LSB in AC_FIXED(16,8,1) notation
43 #define FUTPERCOUNT (0.1F)
44 
45 #if 1
46 #define MESHDELTACOUNTS (50) // magnetic buffer mesh spacing in counts (here 5uT)
47 #else
48 #define MESHDELTACOUNTS (0x500) // magnetic buffer mesh spacing in uT AC_FIXED(16,8,1) (here 5uT * 256 )
49 #endif
50 
51 
52 #endif /* MAGNETIC_CONFIG_H_ */