Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the IMU on the KroozSD Big Rotorcraft Edition board. More...
#include "std.h"
#include "generated/airframe.h"
#include "subsystems/imu.h"
#include "peripherals/mpu60x0_i2c.h"
#include "peripherals/hmc58xx.h"
#include "mcu_periph/spi.h"
Go to the source code of this file.
Data Structures | |
struct | ImuKrooz |
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_MAG_X_SIGN 1 |
#define | IMU_MAG_Y_SIGN 1 |
#define | IMU_MAG_Z_SIGN 1 |
#define | IMU_GYRO_P_SENS 0.5454 |
default gyro sensitivy and neutral from the datasheet MPU with 250 deg/s has 131.072 LSB/(deg/s) sens = 1/131.072 * pi/180 * 2^INT32_RATE_FRAC sens = 1/131.072 * pi/180 * 4096 = 0.5454 I More... | |
#define | IMU_GYRO_P_SENS_NUM 2727 |
#define | IMU_GYRO_P_SENS_DEN 5000 |
#define | IMU_GYRO_Q_SENS 0.5454 |
#define | IMU_GYRO_Q_SENS_NUM 2727 |
#define | IMU_GYRO_Q_SENS_DEN 5000 |
#define | IMU_GYRO_R_SENS 0.5454 |
#define | IMU_GYRO_R_SENS_NUM 2727 |
#define | IMU_GYRO_R_SENS_DEN 5000 |
#define | IMU_GYRO_P_NEUTRAL 0 |
#define | IMU_GYRO_Q_NEUTRAL 0 |
#define | IMU_GYRO_R_NEUTRAL 0 |
#define | IMU_ACCEL_X_SENS 0.9197 |
default accel sensitivy using 16 bit AD7689 adc MXR9500 with 1.5g has 21845 LSB/g sens = 9.81 [m/s^2] / 21845 [LSB/g] * 2^INT32_ACCEL_FRAC = 0.6131 More... | |
#define | IMU_ACCEL_X_SENS_NUM 9197 |
#define | IMU_ACCEL_X_SENS_DEN 10000 |
#define | IMU_ACCEL_Y_SENS 0.9197 |
#define | IMU_ACCEL_Y_SENS_NUM 9197 |
#define | IMU_ACCEL_Y_SENS_DEN 10000 |
#define | IMU_ACCEL_Z_SENS 0.9197 |
#define | IMU_ACCEL_Z_SENS_NUM 9197 |
#define | IMU_ACCEL_Z_SENS_DEN 10000 |
#define | IMU_ACCEL_X_NEUTRAL 32768 |
#define | IMU_ACCEL_Y_NEUTRAL 32768 |
#define | IMU_ACCEL_Z_NEUTRAL 32768 |
#define | IMU_KROOZ_ACCEL_AVG_FILTER 15 |
#define | ImuEvent imu_krooz_event |
Functions | |
void | imu_krooz_event (void) |
void | imu_krooz_downlink_raw (void) |
Variables | |
struct ImuKrooz | imu_krooz |
Driver for the IMU on the KroozSD Big Rotorcraft Edition board.
Invensense MPU-6050 Memsic MXR9500 with AD7689 Honeywell HMC-5883
Definition in file imu_krooz_memsic.h.
struct ImuKrooz |
Definition at line 107 of file imu_krooz.h.
Data Fields | ||
---|---|---|
struct Int32Vect3 | accel_filtered | |
struct Int32Vect3 | accel_sum | |
volatile uint8_t | ad7689_spi_rx_buffer[2] | |
volatile uint8_t | ad7689_spi_tx_buffer[2] | |
struct spi_transaction | ad7689_trans | |
struct Hmc58xx | hmc | |
volatile bool_t | hmc_eoc | |
volatile uint8_t | meas_nb | |
struct Uint8Vect3 | meas_nb_acc | |
struct Mpu60x0_I2c | mpu | |
volatile bool_t | mpu_eoc | |
struct Int32Rates | rates_sum | |
int32_t | temperature |
#define IMU_ACCEL_X_NEUTRAL 32768 |
Definition at line 101 of file imu_krooz_memsic.h.
#define IMU_ACCEL_X_SENS 0.9197 |
default accel sensitivy using 16 bit AD7689 adc MXR9500 with 1.5g has 21845 LSB/g sens = 9.81 [m/s^2] / 21845 [LSB/g] * 2^INT32_ACCEL_FRAC = 0.6131
Definition at line 90 of file imu_krooz_memsic.h.
#define IMU_ACCEL_X_SENS_DEN 10000 |
Definition at line 92 of file imu_krooz_memsic.h.
#define IMU_ACCEL_X_SENS_NUM 9197 |
Definition at line 91 of file imu_krooz_memsic.h.
#define IMU_ACCEL_X_SIGN 1 |
Definition at line 50 of file imu_krooz_memsic.h.
#define IMU_ACCEL_Y_NEUTRAL 32768 |
Definition at line 102 of file imu_krooz_memsic.h.
#define IMU_ACCEL_Y_SENS 0.9197 |
Definition at line 93 of file imu_krooz_memsic.h.
#define IMU_ACCEL_Y_SENS_DEN 10000 |
Definition at line 95 of file imu_krooz_memsic.h.
#define IMU_ACCEL_Y_SENS_NUM 9197 |
Definition at line 94 of file imu_krooz_memsic.h.
#define IMU_ACCEL_Y_SIGN 1 |
Definition at line 51 of file imu_krooz_memsic.h.
#define IMU_ACCEL_Z_NEUTRAL 32768 |
Definition at line 103 of file imu_krooz_memsic.h.
#define IMU_ACCEL_Z_SENS 0.9197 |
Definition at line 96 of file imu_krooz_memsic.h.
#define IMU_ACCEL_Z_SENS_DEN 10000 |
Definition at line 98 of file imu_krooz_memsic.h.
#define IMU_ACCEL_Z_SENS_NUM 9197 |
Definition at line 97 of file imu_krooz_memsic.h.
#define IMU_ACCEL_Z_SIGN 1 |
Definition at line 52 of file imu_krooz_memsic.h.
#define IMU_GYRO_P_NEUTRAL 0 |
Definition at line 78 of file imu_krooz_memsic.h.
#define IMU_GYRO_P_SENS 0.5454 |
default gyro sensitivy and neutral from the datasheet MPU with 250 deg/s has 131.072 LSB/(deg/s) sens = 1/131.072 * pi/180 * 2^INT32_RATE_FRAC sens = 1/131.072 * pi/180 * 4096 = 0.5454 I
Definition at line 67 of file imu_krooz_memsic.h.
#define IMU_GYRO_P_SENS_DEN 5000 |
Definition at line 69 of file imu_krooz_memsic.h.
#define IMU_GYRO_P_SENS_NUM 2727 |
Definition at line 68 of file imu_krooz_memsic.h.
#define IMU_GYRO_P_SIGN 1 |
Definition at line 45 of file imu_krooz_memsic.h.
#define IMU_GYRO_Q_NEUTRAL 0 |
Definition at line 79 of file imu_krooz_memsic.h.
#define IMU_GYRO_Q_SENS 0.5454 |
Definition at line 70 of file imu_krooz_memsic.h.
#define IMU_GYRO_Q_SENS_DEN 5000 |
Definition at line 72 of file imu_krooz_memsic.h.
#define IMU_GYRO_Q_SENS_NUM 2727 |
Definition at line 71 of file imu_krooz_memsic.h.
#define IMU_GYRO_Q_SIGN 1 |
Definition at line 46 of file imu_krooz_memsic.h.
#define IMU_GYRO_R_NEUTRAL 0 |
Definition at line 80 of file imu_krooz_memsic.h.
#define IMU_GYRO_R_SENS 0.5454 |
Definition at line 73 of file imu_krooz_memsic.h.
#define IMU_GYRO_R_SENS_DEN 5000 |
Definition at line 75 of file imu_krooz_memsic.h.
#define IMU_GYRO_R_SENS_NUM 2727 |
Definition at line 74 of file imu_krooz_memsic.h.
#define IMU_GYRO_R_SIGN 1 |
Definition at line 47 of file imu_krooz_memsic.h.
#define IMU_KROOZ_ACCEL_AVG_FILTER 15 |
Definition at line 107 of file imu_krooz_memsic.h.
#define IMU_MAG_X_SIGN 1 |
Definition at line 55 of file imu_krooz_memsic.h.
#define IMU_MAG_Y_SIGN 1 |
Definition at line 56 of file imu_krooz_memsic.h.
#define IMU_MAG_Z_SIGN 1 |
Definition at line 57 of file imu_krooz_memsic.h.
#define ImuEvent imu_krooz_event |
Definition at line 137 of file imu_krooz_memsic.h.
void imu_krooz_downlink_raw | ( | void | ) |
Definition at line 137 of file imu_krooz.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_krooz_event | ( | void | ) |
Definition at line 146 of file imu_krooz.c.
References ImuKrooz::accel_sum, ImuKrooz::ad7689_trans, buf, Hmc58xx::data, Mpu60x0_I2c::data_accel, Mpu60x0_I2c::data_available, Hmc58xx::data_available, Mpu60x0_I2c::data_rates, FALSE, get_sys_time_usec(), ImuKrooz::hmc, hmc58xx_event(), hmc58xx_read(), ImuKrooz::hmc_eoc, imu, IMU_BOARD_ID, imu_scale_mag(), spi_transaction::input_buf, Imu::mag, Imu::mag_unscaled, ImuKrooz::meas_nb, ImuKrooz::meas_nb_acc, median_mag, ImuKrooz::mpu, mpu60x0_i2c_event(), mpu60x0_i2c_read(), ImuKrooz::mpu_eoc, spi_transaction::output_buf, RATES_ADD, ImuKrooz::rates_sum, spi_submit(), SPITransDone, SPITransSuccess, spi_transaction::status, SysTimeTimer, SysTimeTimerStart, ImuKrooz::temperature, UpdateMedianFilterVect3Int, VECT3_ADD, VECT3_ASSIGN, Uint8Vect3::x, Int32Vect3::x, Uint8Vect3::y, Int32Vect3::y, Uint8Vect3::z, and Int32Vect3::z.
struct ImuKrooz imu_krooz |
Definition at line 61 of file imu_krooz.c.
Referenced by exti9_5_isr().