TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle
TM_AHRSIMU_Functions

Library Functions. More...

Functions

void TM_AHRSIMU_Init (TM_AHRSIMU_t *AHRSIMU, float sampleRate, float beta, float inclination)
 Initializes ARHS or IMU algorithm for motion calculations. More...
 
void TM_AHRSIMU_UpdateAHRS (TM_AHRSIMU_t *AHRSIMU, float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz)
 Updates AHRS algorithm with new values and calculates roll, pitch and yaw angles. More...
 
void TM_AHRSIMU_UpdateIMU (TM_AHRSIMU_t *AHRSIMU, float gx, float gy, float gz, float ax, float ay, float az)
 Updates IMU algorithm with new values and calculates roll, pitch and yaw angles. More...
 

Detailed Description

Library Functions.

Function Documentation

void TM_AHRSIMU_Init ( TM_AHRSIMU_t AHRSIMU,
float  sampleRate,
float  beta,
float  inclination 
)

Initializes ARHS or IMU algorithm for motion calculations.

Parameters
*AHRSIMUPointer to TM_AHRSIMU_t empty structure
sampleRateSample rate frequency for updating data
betaGain for calculations and speed to stabilize. A value less than 0.2 is a good value but it mostly depends on applicaiton.
inclinationMagnetic inclination for position on earth in units of degrees. This value depends on GPS coordinates on earth.
Return values
None
void TM_AHRSIMU_UpdateAHRS ( TM_AHRSIMU_t AHRSIMU,
float  gx,
float  gy,
float  gz,
float  ax,
float  ay,
float  az,
float  mx,
float  my,
float  mz 
)

Updates AHRS algorithm with new values and calculates roll, pitch and yaw angles.

Parameters
*AHRSIMUPointer to TM_AHRSIMU_t empty structure
gx,gy,gzGyro data for X, Y and Z axis respectively. These parameters must be in units of rad/s. Use AHRSIMU_DEG2RAD if your gyro outputs data in deg/s.
ax,ay,azAccelerometer data for X, Y and Z axis respectively. These parameters must be in units of gees.
mx,my,mzMagnetic data for X, Y and Z axis respectively. These parameters must be in units of uT (micro Tesla). When all parameters are zero (magnetic sensor not used), TM_AHRSIMU_UpdateIMU is automatically called.
Return values
None
void TM_AHRSIMU_UpdateIMU ( TM_AHRSIMU_t AHRSIMU,
float  gx,
float  gy,
float  gz,
float  ax,
float  ay,
float  az 
)

Updates IMU algorithm with new values and calculates roll, pitch and yaw angles.

Parameters
*AHRSIMUPointer to TM_AHRSIMU_t empty structure
gx,gy,gzGyro data for X, Y and Z axis respectively. These parameters must be in units of rad/s. Use AHRSIMU_DEG2RAD if your gyro outputs data in deg/s.
ax,ay,azAccelerometer data for X, Y and Z axis respectively. These parameters must be in units of gees.
Return values
None