![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
Implements accelerometer calibration routines. More...
Go to the source code of this file.
Data Structures | |
struct | AccelBuffer |
accelerometer measurement buffer More... | |
struct | AccelCalibration |
precision accelerometer calibration structure More... | |
Macros | |
#define | ACCEL_CAL_AVERAGING_SECS 2 |
calibration constants More... | |
#define | MAX_ACCEL_CAL_ORIENTATIONS 12 |
number of stored precision accelerometer measurements More... | |
Typedefs | |
typedef struct AccelBuffer | AccelBuffer |
accelerometer measurement buffer More... | |
typedef struct AccelCalibration | AccelCalibration |
precision accelerometer calibration structure More... | |
Functions | |
void | fInitializeAccelCalibration (struct AccelCalibration *pthisAccelCal, struct AccelBuffer *pthisAccelBuffer, volatile int8_t *AccelCalPacketOn) |
Initialize the accelerometer calibration functions. More... | |
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. More... | |
void | fInvertAccelCal (struct AccelSensor *pthisAccel, struct AccelCalibration *pthisAccelCal) |
function maps the accelerometer data fGs (g) onto precision calibrated and de-rotated data fGc (g), iGc (counts) More... | |
void | fRunAccelCalibration (struct AccelCalibration *pthisAccelCal, struct AccelBuffer *pthisAccelBuffer, struct AccelSensor *pthisAccel) |
function runs the precision accelerometer calibration More... | |
void | fComputeAccelCalibration4 (struct AccelBuffer *pthisAccelBuffer, struct AccelCalibration *pthisAccelCal, struct AccelSensor *pthisAccel) |
calculate the 4 element calibration from the available measurements More... | |
void | fComputeAccelCalibration7 (struct AccelBuffer *pthisAccelBuffer, struct AccelCalibration *pthisAccelCal, struct AccelSensor *pthisAccel) |
calculate the 7 element calibration from the available measurements More... | |
void | fComputeAccelCalibration10 (struct AccelBuffer *pthisAccelBuffer, struct AccelCalibration *pthisAccelCal, struct AccelSensor *pthisAccel) |
calculate the 10 element calibration from the available measurements More... | |
Implements accelerometer calibration routines.
Definition in file precisionAccelerometer.h.
#define ACCEL_CAL_AVERAGING_SECS 2 |
calibration constants
calibration measurement averaging period (s)
Definition at line 17 of file precisionAccelerometer.h.
Referenced by DecodeCommandBytes(), and fUpdateAccelBuffer().
#define MAX_ACCEL_CAL_ORIENTATIONS 12 |
number of stored precision accelerometer measurements
Definition at line 18 of file precisionAccelerometer.h.
Referenced by CreateAndSendPackets(), fComputeAccelCalibration10(), fComputeAccelCalibration4(), fComputeAccelCalibration7(), fInitializeAccelCalibration(), and fRunAccelCalibration().
typedef struct AccelBuffer AccelBuffer |
accelerometer measurement buffer
typedef struct AccelCalibration AccelCalibration |
precision accelerometer calibration structure
void fComputeAccelCalibration10 | ( | struct AccelBuffer * | pthisAccelBuffer, |
struct AccelCalibration * | pthisAccelCal, | ||
struct AccelSensor * | pthisAccel | ||
) |
calculate the 10 element calibration from the available measurements
pthisAccelBuffer | Buffer of measurements used as input to the accel calibration functions |
pthisAccelCal | Accelerometer calibration parameter structure |
pthisAccel | Pointer to the accelerometer input/state structure |
Definition at line 424 of file precisionAccelerometer.c.
References CHX, CHY, CHZ, f3x3matrixAeqInvSymB(), f3x3matrixAeqMinusA(), f3x3matrixDetA(), AccelCalibration::fA, fEigenCompute10(), AccelBuffer::fGsStored, AccelCalibration::finvA, AccelCalibration::finvW, AccelCalibration::fmatA, AccelCalibration::fmatB, AccelCalibration::fV, AccelCalibration::fvecA, AccelBuffer::iStoreFlags, and MAX_ACCEL_CAL_ORIENTATIONS.
Referenced by fRunAccelCalibration().
void fComputeAccelCalibration4 | ( | struct AccelBuffer * | pthisAccelBuffer, |
struct AccelCalibration * | pthisAccelCal, | ||
struct AccelSensor * | pthisAccel | ||
) |
calculate the 4 element calibration from the available measurements
pthisAccelBuffer | Buffer of measurements used as input to the accel calibration functions |
pthisAccelCal | Accelerometer calibration parameter structure |
pthisAccel | Pointer to the accelerometer input/state structure |
Definition at line 215 of file precisionAccelerometer.c.
References CHX, CHY, CHZ, AccelBuffer::fGsStored, AccelCalibration::finvW, AccelCalibration::fmatA, fmatrixAeqInvA(), AccelCalibration::fV, AccelCalibration::fvecA, AccelCalibration::fvecB, AccelBuffer::iStoreFlags, and MAX_ACCEL_CAL_ORIENTATIONS.
Referenced by fRunAccelCalibration().
void fComputeAccelCalibration7 | ( | struct AccelBuffer * | pthisAccelBuffer, |
struct AccelCalibration * | pthisAccelCal, | ||
struct AccelSensor * | pthisAccel | ||
) |
calculate the 7 element calibration from the available measurements
pthisAccelBuffer | Buffer of measurements used as input to the accel calibration functions |
pthisAccelCal | Accelerometer calibration parameter structure |
pthisAccel | Pointer to the accelerometer input/state structure |
Definition at line 330 of file precisionAccelerometer.c.
References CHX, CHY, CHZ, f3x3matrixAeqScalar(), fEigenCompute10(), AccelBuffer::fGsStored, AccelCalibration::finvW, AccelCalibration::fmatA, AccelCalibration::fmatB, AccelCalibration::fV, AccelCalibration::fvecA, AccelBuffer::iStoreFlags, and MAX_ACCEL_CAL_ORIENTATIONS.
Referenced by fRunAccelCalibration().
void fInitializeAccelCalibration | ( | struct AccelCalibration * | pthisAccelCal, |
struct AccelBuffer * | pthisAccelBuffer, | ||
volatile int8_t * | AccelCalPacketOn | ||
) |
Initialize the accelerometer calibration functions.
pthisAccelCal | Accelerometer calibration parameter structure |
pthisAccelBuffer | Buffer of measurements used as input to the accel calibration functions |
AccelCalPacketOn | Used to coordinate calibration sample storage and communications |
Definition at line 18 of file precisionAccelerometer.c.
References ACCEL_NVM_OFFSET, CALIBRATION_NVM_ADDR, CHX, CHY, CHZ, f3x3matrixAeqI(), AccelCalibration::finvW, AccelCalibration::fR0, AccelCalibration::fV, AccelBuffer::iStoreCounter, AccelBuffer::iStoreFlags, AccelBuffer::iStoreLocation, and MAX_ACCEL_CAL_ORIENTATIONS.
Referenced by DecodeCommandBytes(), and initializeFusionEngine().
void fInvertAccelCal | ( | struct AccelSensor * | pthisAccel, |
struct AccelCalibration * | pthisAccelCal | ||
) |
function maps the accelerometer data fGs (g) onto precision calibrated and de-rotated data fGc (g), iGc (counts)
pthisAccel | Pointer to the accelerometer input/state structure |
pthisAccelCal | Accelerometer calibration parameter structure |
Definition at line 118 of file precisionAccelerometer.c.
References CHX, CHY, CHZ, AccelSensor::fGc, AccelSensor::fGs, AccelCalibration::finvW, AccelCalibration::fR0, AccelCalibration::fV, AccelSensor::iCountsPerg, and AccelSensor::iGc.
Referenced by initializeSensors().
void fRunAccelCalibration | ( | struct AccelCalibration * | pthisAccelCal, |
struct AccelBuffer * | pthisAccelBuffer, | ||
struct AccelSensor * | pthisAccel | ||
) |
function runs the precision accelerometer calibration
pthisAccelCal | Accelerometer calibration parameter structure |
pthisAccelBuffer | Buffer of measurements used as input to the accel calibration functions |
pthisAccel | Pointer to the accelerometer input/state structure |
Definition at line 157 of file precisionAccelerometer.c.
References CHX, CHZ, f3DOFTiltAndroid(), f3DOFTiltNED(), f3DOFTiltWin8(), fComputeAccelCalibration10(), fComputeAccelCalibration4(), fComputeAccelCalibration7(), AccelBuffer::fGsStored, AccelCalibration::finvW, AccelCalibration::fR0, AccelCalibration::fV, fVeq3x3AxV(), AccelBuffer::iStoreFlags, and MAX_ACCEL_CAL_ORIENTATIONS.
Referenced by fUpdateAccelBuffer().
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.
pthisAccelCal | Accelerometer calibration parameter structure |
pthisAccelBuffer | Buffer of measurements used as input to the accel calibration functions |
pthisAccel | Pointer to the accelerometer input/state structure |
AccelCalPacketOn | Used to coordinate calibration sample storage and communications |
Definition at line 66 of file precisionAccelerometer.c.
References ACCEL_CAL_AVERAGING_SECS, CHX, CHZ, AccelSensor::fGs, AccelBuffer::fGsStored, fRunAccelCalibration(), AccelBuffer::fSumGs, FUSION_HZ, AccelBuffer::iStoreCounter, AccelBuffer::iStoreFlags, and AccelBuffer::iStoreLocation.
Referenced by initializeSensors().