Hey everyone,

Please forgive me if this has been asked before.  I searched for related questions, but couldn't find any.

I was just taking a look at the latest ArduIMU code and I find it curious that the comment in the ADC code says that the oversampling and averaging being used is increasing the resolution of the ADC.

It appears to me that the sum of all of the samples is just being divided by the number of samples.  I don't see how that can provide any increased resolution, that just provides an averaged value that should help reduce noise.  I don't have any experience in this area, but everything that I've read states that to increase the resolution by n bits you would add 4 ^ n samples then right shift the sum n bits.  So the sum of four 10 bit samples divided by 2 will give you an 11 bit result.  Or 16 samples divided by 4 to get a 12 bit value... 

Here's a link to Atmel's App Note on the subject:

http://www.atmel.com/dyn/resources/prod_documents/doc8003.pdf


I have have just started implementing this in my code.  For my application I'm looking for a more precise roll angle and I'm hoping oversampling/averaging to obtain a 12 bit resolution will help out.

Please let me know if I'm just confused.  :)

Thanks,
Dave

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer
    Another great read

    http://www.mdpi.com/1424-8220/9/5/3767/pdf
  • Dave,
    The method you describe is necessary to increase resolution correctly if you work with binary integer data. The ArduIMU code sidesteps that problem by converting accumulated data to a floating point number before averaging (see the cast in the code).

    Both methods increase bit width (necessary for extra precision) and both are correct, just select the method that works best for your data. ArduIMU does subsequent floating point operations on data so converting to floats early is logical.
  • See this post for real-world details as applied to MEMS sensors.
  • Developer
    You are spot on, I'm not really following it in the code either. The ISR and the way it is laid out makes it hard to follow but i'm seeing what you are seeing. Doug? Jose?
This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…