V5 Inertial Sensor Drift after Rotation

Issue:

The inertial sensor drifts by about 3 degrees after every full rotation.

Testing Setup:

  • I have secured 4 V5 Inertial Sensor - VEX Robotics on my robot. The screws are finger tight and the sensors do not move around. The sensors are placed on parts of the chassis that do not move.
  • All 4 sensors are laid flat on the robot pointing in the same direction.
  • Inertial18 is placed in the center of the robot. Inertial11 is placed at the front right. Inertial14 is placed at the rear right. Inertial20 is placed at the rear left.
  • One of the sensors, Inertial14 has been factory recalibrated on a spirit level.
  • Inertial11, 14, and 20 are brand new. Inertial18 has been used in a few competitions before.
  • The heading values are printed on the robot screen every 20 milliseconds.

Testing:

I placed the robot’s left side against a straight edge then calibrated all sensors.

Immediately after calibration, the values reported are as follows

Inertial11: 0.185
Inertial14: 0.090
Inertial18: 359.953
Inertial20: 0.053

I waited 60 seconds, and the values reported are:

Inertial11: 359.697
Inertial14: 0.344
Inertial18: 0.597
Inertial20: 359.832
Inertial11 Error: -0.303, Minute Drift: -0.488
Inertial14 Error: 0.344, Minute Drift: 0.254
Inertial18 Error: 0.597, Minute Drift: 0.644
Inertial20 Error: -0.168, Minute Drift: 0.221

These values are fine and shows that the sensor drifts only by about 0.2-0.6 degrees over a minute.

Using my hands, I slowly rotated my robot clockwise by 360 degrees. The rotation process took about 3 seconds and I kept the robot level during the rotation. I then realigned the robot on the straight edge to ensure the same heading as when calibrated. The values reported are:

Inertial11: 356.957
Inertial14: 357.220
Inertial18: 358.161
Inertial20: 359.660
Inertial11 Error: -3.043, 1st Rotate: -2.740
Inertial14 Error: -2.780, 1st Rotate: -3.124
Inertial18 Error: -1.839, 1st Rotate: -2.436
Inertial20 Error: -0.340, 1st Rotate: -0.172

Sensor 20 has an acceptable value with error of 0.34 degrees and the rotation only changed the heading by 0.172 degrees.

However, all the other sensors are now off by more than 1 degree.

I manually rotated my robot clockwise by another 360 degrees. The values reported are:

Inertial11: 354.760
Inertial14: 354.407
Inertial18: 355.485
Inertial20: 0.211
Inertial11 Error: -5.240, 1st Rotate -2.740, 2nd: -2.197
Inertial14 Error: -5.593, 1st Rotate: -3.124, 2nd: -2.813
Inertial18 Error: -1.839, 1st Rotate: -2.436, 2nd: -2.676
Inertial20 Error: -0.340, 1st Rotate: -0.172, 2nd: 0.551

Sensor 20 still has a great reading, however, the other ones are off by about 1-5 degrees now.

Finally, I rotated my robot another 360 degrees clockwise. The values now are:

Inertial11: 352.614
Inertial14: 351.730
Inertial18: 353.406
Inertial20: 0.960
Inertial11 Error: -7.386, 1st Rotate -2.740, 2nd: -2.197, 3rd: -2.146
Inertial14 Error: -8.270, 1st Rotate: -3.124, 2nd: -2.813, 3rd: -2.677
Inertial18 Error: -6.594, 1st Rotate: -2.436, 2nd: -2.676, 3rd: -2.079
Inertial20 Error: 0.960, 1st Rotate: -0.172, 2nd: 0.551, 3rd: 0.749

With sensor 14 off by 8.3 degrees.

The results show that every time Inertial11 rotates, it is off by -2.1 to -2.7 degrees, for Inertial14 it is -2.6 to -3.1, for Inertial18 it is -2.0 to -2.4 and for Inertial20 it is -0.172 to 0.749.

This has a heavy impact over the course of a 60 second autonomous period as the robot makes multiple turns, causing about 10-15 degrees of error towards the end of the program.

Is there a way to ensure the inertial sensors read more accurately?

8 Likes

I have an inertial sensor that seems to acts similarly to your sensors that are off. I’ve found that the drift isn’t necessarily a problem if it’s consistently off and you account for it in your code.

For instance, the inertial sensor I have reads about 357 degrees when turned a complete circle, but consistently goes back to within a degree of 0 degrees when turned a full circle the opposite direction. This stays the same no matter how much I turn the bot, the inertial sensor will go back to within a reasonable threshold of 0 degrees when I turn the robot back to its original position. So in our code, we account that 357 degrees is a full circle rather than 360 degrees which has worked well for us.

5 Likes

Like @laxiks said, if the drift for each sensor is predictable and constant just add, subtract, and/or multiply appropriately results from each sensor before averaging them out. Also, try to put them on rubber stands or vex foam to isolate from vibration when driving and see if that helps any.

1 Like

Thanks for the reply :blush:

I’ve found that the readings change depending on a variety of factors such as the speed of the rotation, the acceleration/deceleration, and how long we have been using the sensor.

For example, a slow turn might cause the sensor to be -3 degrees off, but a fast turn might cause it to be -5 degrees off over the same revolution.

Currently, I adjust the heading in the software whenever I issue a turn command based on an average of a few turns. It doesn’t account for speed or sudden stops.

Initially, our Inertial18 was -3 degrees off after turning full circle clockwise (heading will read 357). After a couple of weeks and I did the same test, the same sensor was -8 degrees (heading reading 352).

If this is normal then we would just have to do a turning test every week or two to adjust the error in the software.

2 Likes

If I may ask, what is the purpose of using multiple inertial sensors on your robot? Is it to average the values to get a more accurate heading/rotation?

The purpose is to test the drift of different inertial sensors

2 Likes