Close

Dual IMUs and the Mean of Circulars

A project log for BorgCube ROV

Underwater robots!

tim-wilkinsonTim Wilkinson 03/10/2016 at 06:270 Comments

Today I added an additional IMU to the front of the ROV. I'm not yet sure whether having two means I get a better average idea of what's going on, or whether the mis-quote "man with one IMU knows which way is up, man with two IMUs never sure" will apply.

The second IMU is just one I bought from Adafruit and is mounted in the forward tube on the same support structure for the camera. Electrically and magnetically it's in a very different place. It sits on the I2C bus using its the alternative address.

Today's other lesson is that you can't just average angles and expect to get the right thing. For example, if you do a simple arithmetic average of 359 and 1, you get 180 when the actual angle you were hoping for is 0. A quick bit of wiki-reading and it turns out that to average angles you should do it using vectors (see https://en.wikipedia.org/wiki/Mean_of_circular_quantities), which the code now does.

Discussions