High-accuracy low-frequency angle readings with Accelerometers/IMU/AHRS systems

Hey all

Reviving this topic (hope that's alright)
I'm also looking to do something similar, i.e. attitude readings using an accelerometer.

I have a 2-axis motorised mirror (in fact, current aim is to have 176 of them, and it's for an artwork, so cost is a factor!)

The accuracy requirement is ±0.1º positioning of mirror plane, so i'm generally aiming for 0.03º accuracy of all devices involved.

I have 2 geared DC motors on timing belts which (in physical fully assembled tests) can easily achieve the positional accuracy requirement. Also we have an encoder on each motor giving ~9000 steps per rotation, which is also the correct order of magnitude for accuracy required.

We need the accelerometer to 'zero tare' the position.
i.e. at the start of each day, the mirror walks back to the zero angle, using the accelerometer to find it,
and then records this as (0º,0º). From there we can use the encoders to navigate the mirrors.

Furthermore, I'd like to use the accelerometer to 'sanity check' the mirror's navigation (i.e. check that the angle reported by the accelerometer matches our dead-reckoning from the differential encoders). This is because:

  1. The structure stress can cause deviations on the order of ~0.01º
  2. The encoder sometimes reports erroneous results (i need to look into debouncing)
  3. Something else unknown could cause inaccuracies (e.g. stretching timing belts)

The mirrors will be heliostats (i.e. sun tracking), so move slow enough to ignore dynamic angle readings (we can turn off the motors and allow the system to settle before taking readings). Also we don't need to consider 'heading' (i.e. rotation parallel to gravity), only 'pitch' and 'roll' which can be read by the accelerometer).
I.e. we don't need a gyroscope (no dynamic rotation readings) and don't need a magnetometer (no heading reading, also it's not accurate anyway).

So we're looking for an accelerometer which can give pitch/roll readings accurate to 0.03º at about 1Hz (i.e. an exaggerated digital low pass filter is fine).

Does anybody have any experience with low-frequency high-accuracy angle readings with Accelerometers/IMU/AHRS systems?

Note : an iPhone is perfectly workable at 0.1º accuracy (just google 'spirit level' on your phone and try it).

Thank all!

elliotwoods:
So we're looking for an accelerometer which can give pitch/roll readings accurate to 0.03º at about 1Hz (i.e. an exaggerated digital low pass filter is fine).

You might also want a gyroscope on the IMU to get even better readings just in case. The MPU9250 is a great little IMU and very accurate, but might be a little pricey for you.

I like the ADXL345. It's easy to interface to an Arduino and it's capable of the level of accuracy you require.

Get one of the breakout boards from the major suppliers like Adafruit or Sparkfun, so you can experiment with it. But you'll probably need to go to a custom PCB for large scale. I have had no trouble soldering these on a frypan, even though they look like they will be difficult.

I don't want to discourage you, a heliostat installation with 176 elements has some really cool possibilities, or frightening if you're standing in the wrong location, but what you are asking for is hard. Do you really need that level of precision?

I would be willing to bet that an iPhone is not accurate to 0.1º. It has 0.1º resolution, and it may be repeatable to 0.1º, but it doesn't take much of a difference in solder thickness when the IMU was placed on the circuit board or the thickness of coatings on the phone parts to introduce more than 0.1º error.

Some of the better IMU's might be able to achieve that level of repeatability, but you will need to calibrate them or have some other means of tuning each element. Pay special attention to the sections of the datasheets that talk about noise and bypassing. I am very dubious that you can achieve 0.03º without a lot of work.I would start by using super stable power supplies, probably a 2 stage linear regulator (with proper loading and capacitance) or better yet, make the second stage a precision reference, if the current is low enough. I would take multiple readings and average them.

One way to tune each element would be to have a light and a sensor in known locations, then direct one element to reflect the light onto the sensor. Wiggle it around, or work in a spiral until it lands on the sensor and then you have a reference point for that element. Repeat for each element.

First : thanks all for your replies!

@sdturner -
thank you for the very thoughtful reply

yes I totally agree that it's import to differentiate:

  • accuracy (i.e. absolute values)
  • linearity (i.e. relative values)
  • repeatability
  • resolution

e.g.:

Repeatability

In the worst acceptable case, we have repeatability of 0.01º - 0.05º (but not linearity or accuracy)
In this case then the procedure would be:

  1. Manually calibrate the mirror to a known rotation (e.g. by checking the reflection against marked positions in 3D space such as with your spiral suggestion, or by using an external angle measuring device on the surface such as an inclinometer sitting on the mirror)
  2. Set this as the HOME position
  3. At the beginning of each session, walk to the HOME position and then count steps from there

And of course, the reading of the accelerometer doesn't need to match the exact angle of the mirror, we can just record the value coming out of the accelerometer at this HOME position.

Linearity

If we have linearity of 0.01º - 0.05º, then we can additionally:

  1. Use HOME position like the 'Tare' on a weighing scales, and measure accurate angles relative to this point
  2. Perform periodic 'double checking' of the mirror incline using the accelerometer to correct for inaccuracies in the encoder readings caused by dynamic stress on the system (e.g. mechanical sag)

Accuracy

Well, basically we get this for free as long as:

  1. We can get repeatable readings at a calibrated HOME position
  2. We have linearity
  3. We can do some basic maths

I generally think it's better off to computationally calibrate, than to precision engineer, e.g.:
https://kimchiandchips.com/#lightbarrierthirdedition
This is all 'post-calibrated' by a scanning procedure we made, rather than precision engineered to make each mirror in the exact shape, position, orientation.

Interesting point about voltage regulation. At present, the design is to power via:

  1. 240V -> USB (wall wart) - regulated to 5V
  2. Raspberry Pi
  3. Arduino on USB
  4. IMU on VCC/Ground from Arduino - regulated to 3.3V (i think)

In this case, I presume we want to get a high quality 5V supply, or replace that altogether (there will be a 24VDC SMPS for the motors, so we could tap that with a decent quality step down regulator, and perhaps avoid using any motors on the same SMPS whilst readings are being taken).

Yes certainly can take multiple readings and take an average (e.g. at 1Hz we can average a few hundred readings).

@MorganS
Thanks for the advice!
Is there a reason why you recommend that particular IMU over other products?
The data sheet suggests maximum resolution of 9bit / g, which suggests only a maximum angle resolution of around 0.7º. But maybe my maths is wrong there..
I'll keep my frying pan prepped..

@Power_Broker
Thank you!
How would the gyroscope help in this case?
The accelerometer delivers a static attitude reading whilst the gyroscope reports a dynamic reading.
Since we want accuracy, my presumption has been to use the static data only and not move whilst taking readings.

Thanks again all!

elliotwoods:
my presumption has been to use the static data only and not move whilst taking readings.

This is rather an odd requirement IMHO seeing that you are trying to implement a highly accurate control system.

What happens when you take a measurement and the module determines it is not at the correct angle? The system will have to move to correct itself. If it won't move to correct itself, there's no need to take IMU measurements. If it does move to correct itself, you will need a control algorithm (most likely a PID loop) using real-time feedback from the sensor, which, will be moving. Hence you will need a gyroscope as well.

@Power_Broker:

i appreciate your response. Let me outline my thinking here:

Q. Does the gyroscope increase accuracy?
A. In dynamic case, yes definitely! But since it's an integral term, its accuracy can only even be worse than the static reading which we start integrating from (i.e. the accelerometer in the static case). I.e. it should only be used during rotational movement, as it cannot increase accuracy whilst static.

Q. OK then, do we need to take readings whilst moving?
A. The mirrors move on average 0.002º per second. So if we work at the resolution limit of the system (0.03º), we should move once every 15 seconds (with my current control system, this movement takes about 50ms). Therefore there is no motion for 99.7% of the time. Therefore there's plenty of time to take a reading without the gyroscope. Also note that the rotary encoders are used to navigate movement (e.g. 'move AXIS 1 +0.02º' is handled by the encoders). The accelerometers are required to align the encoders' differential readings with the absolute frame of reference, i.e. the earth.

Thanks again for your time.

Elliot

elliotwoods:
The accelerometers are required to align the encoders' differential readings with the absolute frame of reference, i.e. the earth.

I'm a little confused. Can't you just do that ahead of time by careful planing/construction? Even still, this sounds like you only need to take a reading once and then go from there. Why do you need to constantly realign if you aligned your first mirror position and then used the rotary encoders to accurately alter the motor positions? Do you not trust your encoders?

Based on insights from:

It seems that the MPU6050 is a good starting point.
The MPU9150 contains a MPU6050 accel+gyro, plus a compass. But as mentioned above, the compass and gyro do not give any advantage in this case.
The MPU6500 is lower power and smaller but has higher noise.

We bought one this morning here for testing. I hope we can format and share our results for others.

In the mean time, 2 questions:

  1. Is there an accelerometer with higher accuracy than the MPU6050?
  2. Does anybody have any experience with using MPU6050 for high accuracy, e.g. with linear power supplies / any practical advise?

Thank you
Elliot

elliotwoods:
2. Does anybody have any experience with using MPU6050 for high accuracy, e.g. with linear power supplies / any practical advise?

It's a really nice module and easy to use. I've used it before and it's quite accurate, but I don't think I've tested it for the sheer amount of accuracy you're asking for. Might be possible, though.

Based on quick test:

Setup:

  • MacBook Pro
  • MPU6050 on floor wired to Arduino Uno
  • Averaging every 100 samples (~10Hz)
  • Accelerometer only

We get about ~0.026 degrees standard deviation over 1 minute of samples
I.e. resolution limit is around 0.026 degrees

I'm curious if this might improve if using:

  1. A 3.3V linear regulator, e.g.
    LM317 module
  2. Optocouplers on the I2C channels

We're now going to try repeatability and linearity tests.

I don't think isolating the I2C with optocouplers would reduce noise.

If the Arduino micro noise is getting into the part through the power supply then a separate power supply will help. You can test with a 3V battery, or 2 AA cells in series. With short wires from the battery to the part you will get the lowest noise possible.

Have you gone through the datasheet and used settings for the lowest range, highest sensitivity, most filtering?