Andrew Tridgell
53b76efbd2
AP_InerialSensor: setup INT_PIN_CFG correctly
...
this restores the behavior lost with the 20789 driver change
7 years ago
Andrew Tridgell
b380143349
AP_InertialSensor: improved handling of I2C invensense sensor
...
on I2C the lower bus bandwidth changes the tradeoffs
7 years ago
Andrew Tridgell
b33c815e96
AP_InertialSensor: added whoami for prototype 20789
7 years ago
Peter Barker
71cf3941a7
AP_InertialSensor: move Invensense register defines into separate file
7 years ago
Peter Barker
3ee112843c
AP_InertialSensor: configure bypass for 20789 like we do for AK8963
7 years ago
Peter Barker
5d94172ada
AP_InertialSensor: remove clearing of BIT_USER_CTRL_I2C_MST_EN bit in user_ctrl
...
This bit should never be set on 20789
7 years ago
Andrew Tridgell
5a4f0fed2d
AP_InertialSensor: added ICM-20789 support
7 years ago
Andrew Tridgell
f4521772c1
AP_InertialSensor: don't try fast sampling on a MPU6500
...
it can't do it
7 years ago
Andrew Tridgell
d575d676b6
AP_InertialSensor: fixed another transfer without bus semaphore
7 years ago
Andrew Tridgell
2ffb8d1583
AP_InertialSensor: fixed a bug where bus semaphore not held
...
during init of the invensense driver we could do a transfer without
the bus semaphore held. That violates the locking rules for the bus
7 years ago
Andrew Tridgell
24c424ae5d
AP_InertialSensor: support over 1kHz IMUs
...
this allows for invensense IMUs to run above 1kHz by adjusting the
downsampling rate
7 years ago
Andrew Tridgell
9416165fe3
AP_InertialSensor: improved invensense debugging on ChibiOS
7 years ago
bugobliterator
1c6beaa7c4
AP_InertialSensor: use new API for DMA safe allocation
7 years ago
Lucas De Marchi
caa4e3ee89
AP_InertialSensor: remove raspilot
8 years ago
Lucas De Marchi
06fe5ce8ba
AP_InertialSensor: implement periodic thread for AuxiliaryBus
8 years ago
Andrew Tridgell
bfd8d151c8
AP_InertialSensor: lower slave rate with fast sampling
...
On an invensense IMU with fast sampling we need to lower the slave
sample rate for slave sensors such as the built-in AK8963 compass on a
MPU9250.
The slave rate is set as a multiple of the main rate, so it needs to be
much lower for fast sampling. If we leave it high then it greatly
impacts on IMU sample rate.
Without this change a MPU9250 with fast sampling and a compass enabled
will give a gyro rate of around 7200Hz. With this change it gets 7760Hz
8 years ago
Andrew Tridgell
519a293af9
AP_InertialSensor: fixed instance usage in set_gyro_oversampling()
...
thanks Francisco!
8 years ago
Andrew Tridgell
db25b6e966
AP_InertialSensor: estimate and log sensor rates for all IMUs
...
this adds IMU.GHz and IMU.AHz log fields so we can see the actual
observed sensor rates of each IMU
8 years ago
Andrew Tridgell
49cc0965c0
AP_InertialSensor: separate handling of FIFO and non-FIFO sensors
...
FIFO sensors produce data at a well known rate, but samples come in
bunches, so we can't use the system clock to calculate deltaT.
non-FIFO sensors produce data when we sample them, but that rate is
less regular due to timing jitter.
For FIFO sensors this changes makes us use a learned sample rate,
which allows for different clock speeds on sensor and system board.
For non-FIFO sensors we use the system clock to measure deltaT
the overall effect is a fix for sensors that produce samples at other
than the claimed datasheet rate.
8 years ago
Andrew Tridgell
c952e58edb
AP_InertialSensor: fixed invensense driver temp reading
...
different parts have quite different zero offsets in temperature
8 years ago
Andrew Tridgell
875274e761
AP_InertialSensor: added support for ICM-20602
...
treat the same as a 20608
8 years ago
Lucas De Marchi
2d50eb312c
AP_InertialSensor: add support to MPU6500
...
Just like and MPU9250 without mag and with different WHOAMI register.
8 years ago
murata
a3f5b4f319
AP_InertialSensor: Change from magic number 0 to definition name.
8 years ago
murata
2643e7e906
AP_InertialSensor: Unify from print or println to printf.
8 years ago
Lucas De Marchi
5472bc4de1
Global: change Device::PeriodicCb signature
...
Remove bool return as it's never being used and not supported on PX4.
8 years ago
mirkix
62fabca19d
AP_InertialSensor: Enable I2C bypass for MPU9250 conntected via I2C to access internal AK8963
8 years ago
Randy Mackay
946d30476a
AP_InertialSensor: fix whoami for MPU6k
8 years ago
Lucas De Marchi
9569ed94a9
AP_InertialSensor: Invensense: use capital letters for define
8 years ago
Andrew Tridgell
65b9b86099
AP_InertialSensor: unify MPU6000 and MPU9250 drivers
...
make a single AP_InertialSensor_Invensense driver. This avoids a lot
of duplication and will save time as new varients are added
8 years ago
Pierre Kancir
13c16e187f
InertialSensor: MPU6000 utilize an explicit type cast to avoid the loss of a fractional part
8 years ago
Randy Mackay
699279ed1f
AP_InertialSensor: fix build warning for MPU6000
8 years ago
Andrew Tridgell
f9845c93b1
AP_InertialSensor: keep transfers nicely setup for DMA on stm32
...
this avoids using stack based bounce buffers which may not support DMA
on stm32
8 years ago
Andrew Tridgell
771cedca3d
AP_InertialSensor: reduced number of SPI transfers
...
use cached copy of temperature in MPU6000 and MPU9250 to detect FIFO
error when possible
8 years ago
Andrew Tridgell
27605b0258
AP_InertialSensor: run invensese reg checking at low speed
...
config register read/write should be at low bus speed.
also change to check every 20 calls to reduce checking cost
8 years ago
Andrew Tridgell
f3a778f980
AP_InertialSensor: fixed freeing of fifo buffer
8 years ago
Andrew Tridgell
6f28c61c8d
AP_InertialSensor: changed SIZE to LEN
...
thanks to Lucas for suggestion
8 years ago
hiro2233
cb7f46d653
AP_InertialSensor: fixed handling of user_ctrl register
...
with aux bus implementations
8 years ago
Andrew Tridgell
9b4c588c09
AP_InertialSensor: adapt drivers for SPI-DMA capable systems
...
no longer need accumulate() transfers with SPI enabled DMA on stm32
8 years ago
Andrew Tridgell
28daddaaf2
AP_InertialSensor: don't use accumulate approach on Linux or I2C
8 years ago
Andrew Tridgell
d9c8db7024
AP_InertialSensor: implement a new strategy for fast sampling
...
this moves to using a 1p filter on the high rate data, followed by
averaging down to 1kHz then a 2p filter to apply configured cutoff
frequency.
It also fixes the FIFO reset to not cause data corruption. We need to
disable all FIFO channels before doing the reset, and wait for the
FIFO to stop in the sensor.
Finally it moves sampling of the MPU6000 and MPU9250 into the main
thread. That significantly improves scheduling performance as we no
longer get long FIFO SPI transfers happening during other tasks. All
transfers happen at the start of the fast loop. That makes timing much
more predictable.
Thanks to Leonard and Paul for help with this design!
8 years ago
Lucas De Marchi
87c6d5da13
AP_InertialSensor: replace panic() with return
...
When blocking forever there's no reason to call panic later since it
will never going to be reached. This reduces binary size in a few bytes
since the message isn't required anymore.
8 years ago
Andrew Tridgell
6129b1abb6
AP_InertialSensor: wait forever for semaphore on startup
...
some boards take a silly amount of time to get semaphore on startup
8 years ago
Andrew Tridgell
216cf53922
AP_InertialSensor: handle FIFO overflow for MPU6k and 9250
...
this prevents temporary corruption of INS data on FIFO overflow
8 years ago
Andrew Tridgell
624178f3be
AP_InertialSensor: added INS_FAST_SAMPLE parameter
...
this allows enable/disable of fast sampling per IMU, making
experimentation easier.
It also fixes the fast sampling to always average over 8 samples, and
fixes the 9250 to use the correct accumulator when not doing fast
sampling
8 years ago
Andrew Tridgell
c0303ffe8a
AP_InertialSensor: temporarily disable fast sampling
...
a problem has been found with the filtering with fast sampling on
ICM-20608 and MPU9250. Disable until it is solved.
8 years ago
Andrew Tridgell
c794ad9ee8
AP_InertialSensor: use smaller FIFO buffers
...
this allows for reading multiple chunks from the fifo per callback
8 years ago
Andrew Tridgell
77a83c091a
AP_InertialSensor: added register checking for MPU6000/ICM20608
8 years ago
Andrew Tridgell
af0ec41652
AP_InertialSensor: fixed accel clip detection with fast sampling
...
we need to check on every sample at the full rate
8 years ago
Andrew Tridgell
8da42b7a8b
AP_InertialSensor: fixed temperature for fast sampling case
8 years ago
Andrew Tridgell
e27a76e460
AP_InertialSensor: fixed auxiliary bus with FIFO enabled
...
make sure fifo reset doesn't check I2C master enable
8 years ago