MPU 6050 accelerometer delay

Hi,

I am experiencing a problem when measuring angle

I am using this formula, so I get a 0 – 127 range for a 90 degree angle
pitch = atan2(accele_x, accele_z) * 80.8507;

Things work ok, but if I move the sensor too quickly in the required direction, the motion data first takes off in the opposite direction before it reverses and then moves to the correct angle. Or perhaps it is overshooting and then coming back. The overall time to go in the wrong direction and then get back to where it should be, takes about 20mS. That’s a guess, but when applied to audio, I can hear the delay, so I guess it is at least 20mS.

At slower speeds the data moves in the correct direction. I could fuse it with the gyro data, but that filtering introduces its own small delay.

The gyroscope responds in the correction direction regardless of how quick the sensor is moved.

It seems to be inherent within the sensor, but I wonder.

Regards
Tim

In order to measure tilt angles, an accelerometer must be in a fixed orientation, at least during the measurement.

As soon as it starts to move, it is accelerating, and the total acceleration is no longer the Earth's gravity g, as is assumed.

As for delays, few people understand what is going on inside the MPU6050. It is quite old, and there are now much better and faster accelerometers/IMUs. I like the ones from Pololu, especially the AltIMU10 series.

If you are interested in making a state of the art absolute orientation sensor, consider using RTIMUlib with one of those.

The MPU-6050 is indeed outdated. Sometimes the wrong capacitors are used on the modules, making it a lot more noisy.
The MPU-9250 is better. It also does not need those specific capacitors, so there is less that can go wrong.
There are other new good sensors as well.

The Pololu AltIMU-10 v5 modules use seperate chips for acceleration and gyro, I think that is outdated as well ::slight_smile:
@jremington, which RTIMUlib for Arduino on github are you referring to ? Some versions use the I2Cdev library, which has a bug that makes it slower for no reason, it is not according to the Arduino Wire library and it is not very compatible and it is no longer maintained. There are a lot of derivatives that have changed and added to that library, and meanwhile keeping the bugs.

@tim77777, do you understand the explanation of jremington about the acceleration ? The accelerometer can not measure a fast changing angle, because fast changes means acceleration.

An accelerometer can be used as spirit level with a very slow filter.

To measure the angle fast, you need sensor fusion to combine it with the gyro. That makes the output a lot more steady. The AHRS filter that jremington wrote about in the link is the best option.

yep, thanks for all that.