13 #ifndef PRECISIONACCELEROMETER_H 14 #define PRECISIONACCELEROMETER_H 17 #define ACCEL_CAL_AVERAGING_SECS 2 18 #define MAX_ACCEL_CAL_ORIENTATIONS 12
53 volatile int8_t *AccelCalPacketOn
60 volatile int8_t *AccelCalPacketOn
92 #endif // PRECISIONACCELEROMETER_H struct AccelCalibration AccelCalibration
precision accelerometer calibration structure
void fUpdateAccelBuffer(struct AccelCalibration *pthisAccelCal, struct AccelBuffer *pthisAccelBuffer, struct AccelSensor *pthisAccel, volatile int8_t *AccelCalPacketOn)
Update the buffer used to store samples used for accelerometer calibration.
void fComputeAccelCalibration10(struct AccelBuffer *pthisAccelBuffer, struct AccelCalibration *pthisAccelCal, struct AccelSensor *pthisAccel)
calculate the 10 element calibration from the available measurements
int16_t iStoreCounter
number of remaining iterations at FUSION_HZ to average measurement
struct AccelBuffer AccelBuffer
accelerometer measurement buffer
void fRunAccelCalibration(struct AccelCalibration *pthisAccelCal, struct AccelBuffer *pthisAccelBuffer, struct AccelSensor *pthisAccel)
function runs the precision accelerometer calibration
The AccelSensor structure stores raw and processed measurements for a 3-axis accelerometer.
void fInitializeAccelCalibration(struct AccelCalibration *pthisAccelCal, struct AccelBuffer *pthisAccelBuffer, volatile int8_t *AccelCalPacketOn)
Initialize the accelerometer calibration functions.
precision accelerometer calibration structure
int16_t iStoreFlags
denotes which measurements are present
void fInvertAccelCal(struct AccelSensor *pthisAccel, struct AccelCalibration *pthisAccelCal)
function maps the accelerometer data fGs (g) onto precision calibrated and de-rotated data fGc (g)...
accelerometer measurement buffer
void fComputeAccelCalibration7(struct AccelBuffer *pthisAccelBuffer, struct AccelCalibration *pthisAccelCal, struct AccelSensor *pthisAccel)
calculate the 7 element calibration from the available measurements
float fGsStored[MAX_ACCEL_CAL_ORIENTATIONS][3]
uncalibrated accelerometer measurements (g)
float fSumGs[3]
averaging sum for current storage location
void fComputeAccelCalibration4(struct AccelBuffer *pthisAccelBuffer, struct AccelCalibration *pthisAccelCal, struct AccelSensor *pthisAccel)
calculate the 4 element calibration from the available measurements
int16_t iStoreLocation
-1 for none, 0 to 11 for the 12 storage locations
#define MAX_ACCEL_CAL_ORIENTATIONS
number of stored precision accelerometer measurements