bolderflight / invensense-imu

Arduino and CMake library for communicating with the InvenSense MPU-6500, MPU-9250 and MPU-9255 nine-axis IMUs.
MIT License
498 stars 211 forks source link

sample rate higher than 1khz #60

Closed yo90bosses closed 4 years ago

yo90bosses commented 4 years ago

Im unable to get a sample rate higher than 1khz. It seems locked to that because im able to get data at max exacly 1000 times a second. Any way to increse this limit? I should be able to get 8khz

flybrianfly commented 4 years ago

Correct, this library only supports up to 1 kHz. You'd have to bypass the DLPF to reach a higher rate.

yo90bosses commented 4 years ago

Is there any way i could modify this library to get 8khz? Do i only need to change what it writes to the registers or would that mean rewriting a lot of code? Also i think im noticing a delay in the data. Is this maybe due to the DLPF being too high? Im working on a Quadcopter and the PID Loop frequency should run at least at 2Khz. Is the latency from the DLPF too high for this?

flybrianfly commented 4 years ago

I think you would need to remove or modify the DLPF setting in the begin method to get your desired rate. The appropriate bytes to send would be in the MPU-9250 datasheet.