Hi,
I am using MPU9250 with Raspberry Pi and coding with Python. I am trying to make a virtual compass. The compass is working fine. But when I move the compass swiftly, it takes some time (around 2 seconds) to stabilize to the new direction. MPU9250 records a few (around 5) data points during the interval but it takes time to output it. Is there any way of reducing this latency and increasing the number of data points so that the virtual compass will follow the real motion more simultaneously?
I have been using the following Python library - Link. I have tried using "Accel Full Scale Select 16G" and "Gyro Full Scale Select 2000dps" but there was no observable difference.
Have you actually read the datasheet of the MPU? Or are you relying solely on what the software library tells you? If not, you need to read it. Libraries don't make all options available (or make them available but obscure them due to lack of detail). For example, the MPU has configurable sampling rates and filters which are the first place you would normally look and it is odd you mention library configuration options before mentioning these.
How swift is swift? A snap turn of the wrist is a lot more than the 2000deg/s of the MPU9250.
You also do not say what readings you are referring to. The MPU has magnetometer, acceleromter, gyro, and sensor fused readings.
If the compass has no trouble keeping up with a more reasonable turn rate, you might be saturating the gyro and many gyros give false readings when that happens (the output doesn't just saturate at the max angular velocity. It becomes unstable and oscillates or gives a wild reading).