Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
#include "std.h"
#include "generated/airframe.h"
#include "subsystems/imu.h"
#include "peripherals/itg3200.h"
#include "peripherals/adxl345_i2c.h"
Go to the source code of this file.
Data Structures | |
struct | ImuUmarim |
Macros | |
#define | IMU_GYRO_P_SIGN 1 |
#define | IMU_GYRO_Q_SIGN 1 |
#define | IMU_GYRO_R_SIGN 1 |
#define | IMU_ACCEL_X_SIGN 1 |
#define | IMU_ACCEL_Y_SIGN 1 |
#define | IMU_ACCEL_Z_SIGN 1 |
#define | IMU_GYRO_P_SENS 4.973 |
default gyro sensitivy and neutral from the datasheet ITG3200 has 14.375 LSB/(deg/s) sens = 1/14.375 * pi/180 * 2^INT32_RATE_FRAC sens = 1/14.375 * pi/180 * 4096 = 4.973126 More... | |
#define | IMU_GYRO_P_SENS_NUM 4973 |
#define | IMU_GYRO_P_SENS_DEN 1000 |
#define | IMU_GYRO_Q_SENS 4.973 |
#define | IMU_GYRO_Q_SENS_NUM 4973 |
#define | IMU_GYRO_Q_SENS_DEN 1000 |
#define | IMU_GYRO_R_SENS 4.973 |
#define | IMU_GYRO_R_SENS_NUM 4973 |
#define | IMU_GYRO_R_SENS_DEN 1000 |
#define | IMU_GYRO_P_NEUTRAL 0 |
#define | IMU_GYRO_Q_NEUTRAL 0 |
#define | IMU_GYRO_R_NEUTRAL 0 |
#define | IMU_ACCEL_X_SENS 37.91 |
default accel sensitivy from the ADXL345 datasheet sensitivity of x & y axes depends on supply voltage: More... | |
#define | IMU_ACCEL_X_SENS_NUM 3791 |
#define | IMU_ACCEL_X_SENS_DEN 100 |
#define | IMU_ACCEL_Y_SENS 37.91 |
#define | IMU_ACCEL_Y_SENS_NUM 3791 |
#define | IMU_ACCEL_Y_SENS_DEN 100 |
#define | IMU_ACCEL_Z_SENS 39.24 |
#define | IMU_ACCEL_Z_SENS_NUM 39.24 |
#define | IMU_ACCEL_Z_SENS_DEN 100 |
#define | IMU_ACCEL_X_NEUTRAL 0 |
#define | IMU_ACCEL_Y_NEUTRAL 0 |
#define | IMU_ACCEL_Z_NEUTRAL 0 |
Functions | |
void | imu_umarim_init (void) |
void | imu_umarim_periodic (void) |
void | imu_umarim_event (void) |
void | imu_umarim_downlink_raw (void) |
Variables | |
volatile bool | gyr_valid |
volatile bool | acc_valid |
struct ImuUmarim | imu_umarim |
struct ImuUmarim |
Definition at line 108 of file imu_umarim.h.
Data Fields | ||
---|---|---|
struct Adxl345_I2c | adxl | |
struct Itg3200 | itg |
#define IMU_ACCEL_X_NEUTRAL 0 |
Definition at line 100 of file imu_umarim.h.
#define IMU_ACCEL_X_SENS 37.91 |
default accel sensitivy from the ADXL345 datasheet sensitivity of x & y axes depends on supply voltage:
what about the offset at 3.3V?
Definition at line 89 of file imu_umarim.h.
#define IMU_ACCEL_X_SENS_DEN 100 |
Definition at line 91 of file imu_umarim.h.
#define IMU_ACCEL_X_SENS_NUM 3791 |
Definition at line 90 of file imu_umarim.h.
#define IMU_ACCEL_X_SIGN 1 |
Definition at line 49 of file imu_umarim.h.
#define IMU_ACCEL_Y_NEUTRAL 0 |
Definition at line 101 of file imu_umarim.h.
#define IMU_ACCEL_Y_SENS 37.91 |
Definition at line 92 of file imu_umarim.h.
#define IMU_ACCEL_Y_SENS_DEN 100 |
Definition at line 94 of file imu_umarim.h.
#define IMU_ACCEL_Y_SENS_NUM 3791 |
Definition at line 93 of file imu_umarim.h.
#define IMU_ACCEL_Y_SIGN 1 |
Definition at line 50 of file imu_umarim.h.
#define IMU_ACCEL_Z_NEUTRAL 0 |
Definition at line 102 of file imu_umarim.h.
#define IMU_ACCEL_Z_SENS 39.24 |
Definition at line 95 of file imu_umarim.h.
#define IMU_ACCEL_Z_SENS_DEN 100 |
Definition at line 97 of file imu_umarim.h.
#define IMU_ACCEL_Z_SENS_NUM 39.24 |
Definition at line 96 of file imu_umarim.h.
#define IMU_ACCEL_Z_SIGN 1 |
Definition at line 51 of file imu_umarim.h.
#define IMU_GYRO_P_NEUTRAL 0 |
Definition at line 71 of file imu_umarim.h.
#define IMU_GYRO_P_SENS 4.973 |
default gyro sensitivy and neutral from the datasheet ITG3200 has 14.375 LSB/(deg/s) sens = 1/14.375 * pi/180 * 2^INT32_RATE_FRAC sens = 1/14.375 * pi/180 * 4096 = 4.973126
Definition at line 60 of file imu_umarim.h.
#define IMU_GYRO_P_SENS_DEN 1000 |
Definition at line 62 of file imu_umarim.h.
#define IMU_GYRO_P_SENS_NUM 4973 |
Definition at line 61 of file imu_umarim.h.
#define IMU_GYRO_P_SIGN 1 |
Definition at line 44 of file imu_umarim.h.
#define IMU_GYRO_Q_NEUTRAL 0 |
Definition at line 72 of file imu_umarim.h.
#define IMU_GYRO_Q_SENS 4.973 |
Definition at line 63 of file imu_umarim.h.
#define IMU_GYRO_Q_SENS_DEN 1000 |
Definition at line 65 of file imu_umarim.h.
#define IMU_GYRO_Q_SENS_NUM 4973 |
Definition at line 64 of file imu_umarim.h.
#define IMU_GYRO_Q_SIGN 1 |
Definition at line 45 of file imu_umarim.h.
#define IMU_GYRO_R_NEUTRAL 0 |
Definition at line 73 of file imu_umarim.h.
#define IMU_GYRO_R_SENS 4.973 |
Definition at line 66 of file imu_umarim.h.
#define IMU_GYRO_R_SENS_DEN 1000 |
Definition at line 68 of file imu_umarim.h.
#define IMU_GYRO_R_SENS_NUM 4973 |
Definition at line 67 of file imu_umarim.h.
#define IMU_GYRO_R_SIGN 1 |
Definition at line 46 of file imu_umarim.h.
void imu_umarim_downlink_raw | ( | void | ) |
Definition at line 94 of file imu_umarim.c.
References Imu::accel_unscaled, DefaultChannel, DefaultDevice, Imu::gyro_unscaled, imu, Int32Rates::p, Int32Rates::q, Int32Rates::r, Int32Vect3::x, Int32Vect3::y, and Int32Vect3::z.
void imu_umarim_event | ( | void | ) |
Definition at line 103 of file imu_umarim.c.
References Imu::accel, Imu::accel_unscaled, ImuUmarim::adxl, adxl345_i2c_event(), Adxl345_I2c::data, Itg3200::data, Adxl345_I2c::data_available, Itg3200::data_available, get_sys_time_usec(), Imu::gyro, Imu::gyro_unscaled, imu, IMU_BOARD_ID, imu_scale_accel(), imu_scale_gyro(), imu_umarim, ImuUmarim::itg, itg3200_event(), RATES_COPY, and VECT3_ASSIGN.
void imu_umarim_init | ( | void | ) |
Definition at line 66 of file imu_umarim.c.
References ImuUmarim::adxl, ADXL345_ADDR_ALT, adxl345_i2c_init(), Adxl345_I2c::config, Itg3200::config, Itg3200Config::dlpf_cfg, ImuUmarim::itg, ITG3200_ADDR_ALT, itg3200_init(), Adxl345Config::range, Adxl345Config::rate, Itg3200Config::smplrt_div, UMARIM_ACCEL_RANGE, UMARIM_ACCEL_RATE, UMARIM_GYRO_LOWPASS, and UMARIM_GYRO_SMPLRT_DIV.
void imu_umarim_periodic | ( | void | ) |
Definition at line 83 of file imu_umarim.c.
References ImuUmarim::adxl, adxl345_i2c_periodic(), imu_umarim, ImuUmarim::itg, and itg3200_periodic().
volatile bool acc_valid |
volatile bool gyr_valid |
struct ImuUmarim imu_umarim |
Definition at line 64 of file imu_umarim.c.
Referenced by imu_umarim_event(), and imu_umarim_periodic().