39 #ifndef PRECISIONACCELEROMETER_H 40 #define PRECISIONACCELEROMETER_H 43 #define ACCEL_CAL_AVERAGING_SECS 2 44 #define MAX_ACCEL_CAL_ORIENTATIONS 12
79 volatile int8_t *AccelCalPacketOn
86 volatile int8_t *AccelCalPacketOn
118 #endif // PRECISIONACCELEROMETER_H int16_t iStoreLocation
-1 for none, 0 to 11 for the 12 storage locations
void fRunAccelCalibration(struct AccelCalibration *pthisAccelCal, struct AccelBuffer *pthisAccelBuffer, struct AccelSensor *pthisAccel)
function runs the precision accelerometer calibration
void fComputeAccelCalibration4(struct AccelBuffer *pthisAccelBuffer, struct AccelCalibration *pthisAccelCal, struct AccelSensor *pthisAccel)
calculate the 4 element calibration from the available measurements
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.
The AccelSensor structure stores raw and processed measurements for a 3-axis accelerometer.
float fSumGs[3]
averaging sum for current storage location
void fInitializeAccelCalibration(struct AccelCalibration *pthisAccelCal, struct AccelBuffer *pthisAccelBuffer, volatile int8_t *AccelCalPacketOn)
Initialize the accelerometer calibration functions.
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
int16_t iStoreFlags
denotes which measurements are present
int16_t iStoreCounter
number of remaining iterations at FUSION_HZ to average measurement
precision accelerometer calibration structure
void fComputeAccelCalibration7(struct AccelBuffer *pthisAccelBuffer, struct AccelCalibration *pthisAccelCal, struct AccelSensor *pthisAccel)
calculate the 7 element calibration from the available measurements
#define MAX_ACCEL_CAL_ORIENTATIONS
number of stored precision accelerometer measurements
float fGsStored[MAX_ACCEL_CAL_ORIENTATIONS][3]
uncalibrated accelerometer measurements (g)
struct AccelBuffer AccelBuffer
accelerometer measurement buffer
void fComputeAccelCalibration10(struct AccelBuffer *pthisAccelBuffer, struct AccelCalibration *pthisAccelCal, struct AccelSensor *pthisAccel)
calculate the 10 element calibration from the available measurements