ISSDK  1.8
IoT Sensing Software Development Kit
Functions
precisionAccelerometer.c File Reference

Implements accelerometer calibration routines. More...

#include <stdio.h>
#include "sensor_fusion.h"
#include "fusion.h"
Include dependency graph for precisionAccelerometer.c:

Go to the source code of this file.

Functions

void fInitializeAccelCalibration (struct AccelCalibration *pthisAccelCal, struct AccelBuffer *pthisAccelBuffer, volatile int8 *AccelCalPacketOn)
 Initialize the accelerometer calibration functions. More...
 
void fUpdateAccelBuffer (struct AccelCalibration *pthisAccelCal, struct AccelBuffer *pthisAccelBuffer, struct AccelSensor *pthisAccel, volatile int8 *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...
 

Detailed Description

Implements accelerometer calibration routines.

Definition in file precisionAccelerometer.c.

Function Documentation

◆ fComputeAccelCalibration10()

void fComputeAccelCalibration10 ( struct AccelBuffer pthisAccelBuffer,
struct AccelCalibration pthisAccelCal,
struct AccelSensor pthisAccel 
)

calculate the 10 element calibration from the available measurements

Parameters
pthisAccelBufferBuffer of measurements used as input to the accel calibration functions
pthisAccelCalAccelerometer calibration parameter structure
pthisAccelPointer 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fComputeAccelCalibration4()

void fComputeAccelCalibration4 ( struct AccelBuffer pthisAccelBuffer,
struct AccelCalibration pthisAccelCal,
struct AccelSensor pthisAccel 
)

calculate the 4 element calibration from the available measurements

Parameters
pthisAccelBufferBuffer of measurements used as input to the accel calibration functions
pthisAccelCalAccelerometer calibration parameter structure
pthisAccelPointer 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fComputeAccelCalibration7()

void fComputeAccelCalibration7 ( struct AccelBuffer pthisAccelBuffer,
struct AccelCalibration pthisAccelCal,
struct AccelSensor pthisAccel 
)

calculate the 7 element calibration from the available measurements

Parameters
pthisAccelBufferBuffer of measurements used as input to the accel calibration functions
pthisAccelCalAccelerometer calibration parameter structure
pthisAccelPointer 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fInitializeAccelCalibration()

void fInitializeAccelCalibration ( struct AccelCalibration pthisAccelCal,
struct AccelBuffer pthisAccelBuffer,
volatile int8 AccelCalPacketOn 
)

Initialize the accelerometer calibration functions.

Parameters
pthisAccelCalAccelerometer calibration parameter structure
pthisAccelBufferBuffer of measurements used as input to the accel calibration functions
AccelCalPacketOnUsed 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fInvertAccelCal()

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)

Parameters
pthisAccelPointer to the accelerometer input/state structure
pthisAccelCalAccelerometer 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().

Here is the caller graph for this function:

◆ fRunAccelCalibration()

void fRunAccelCalibration ( struct AccelCalibration pthisAccelCal,
struct AccelBuffer pthisAccelBuffer,
struct AccelSensor pthisAccel 
)

function runs the precision accelerometer calibration

Parameters
pthisAccelCalAccelerometer calibration parameter structure
pthisAccelBufferBuffer of measurements used as input to the accel calibration functions
pthisAccelPointer 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fUpdateAccelBuffer()

void fUpdateAccelBuffer ( struct AccelCalibration pthisAccelCal,
struct AccelBuffer pthisAccelBuffer,
struct AccelSensor pthisAccel,
volatile int8 AccelCalPacketOn 
)

Update the buffer used to store samples used for accelerometer calibration.

Parameters
pthisAccelCalAccelerometer calibration parameter structure
pthisAccelBufferBuffer of measurements used as input to the accel calibration functions
pthisAccelPointer to the accelerometer input/state structure
AccelCalPacketOnUsed 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().

Here is the call graph for this function:
Here is the caller graph for this function: