small medium large xlarge

Back to: All Forums  Arduino
Generic-user-small
28 Mar 2011, 05:27
Lawrence Gill (9 posts)

Hi Maik,

In chapter 6, on page 121 begins the code for the MotionSensor/Buffering sketch. You have the BUFFER_SIZE set to 16. On the following pages you suggest resetting it to a value of “1” and noticing the jitter. I did see the values changing by several points as set to “1”. But returning the value to 16, I still see ‘some’ jitter. Even increasing the BUFFER_SIZE to as high as “64” there is still ‘some’ jitter. In both cases it is essentially the axes values varying by 1 increment. My question is whether this 1 point variance is considered acceptable? On page 123 you mention “the acceleration data we measure now is sufficiently accurate”, which hints that it is not yet 100% locked on, but accurate ‘enough’. I just wanted to clarify this?

Maik_schmidt_avatar2_pragsmall
28 Mar 2011, 14:27
Maik Schmidt (122 posts)

Hi Lawrence!

Getting an accuracy of 100% with sensors such as an accelerometer is nearly impossible. The slightest vibration of your desk will have an effect and even rounding issues might be a problem from time to time. Fortunately, for most real-world applications like video gaming this doesn’t matter. Still you have to de-jitter your input data to avoid completely unreliable results.

Best, Maik

Generic-user-small
29 Mar 2011, 18:57
Lawrence Gill (9 posts)

Hi Maik,

Thanks for clarifying that. I see this as very much similar to a project I have done which built, from a kit, is a Digital Read Out for 3 scales on a milling machine, used on the 3 axes. Jitter from the scales was also an issue in that application, so the fellow who wrote the program for the kit included the ability to increase or decrease a filtering value, which prevented the display from changing unless the scale output changed by a certain amount (in fractions of thousandths of an inch). The scale displays are accurate to 0.0005”.

So the same thing could be done in the code to use this sensor, comparing the amount of change in each loop getting the new value, and not print the changed value to the serial port unless the change exceeded the desired threshold. In your sketch I am using from the book, a filter threshold value of 1 would be likely be sufficient when the sensitivity is set to “16”. That is all the variance I am seeing for the most part, so it would make the displayed numbers very steady I think.

Have a nice day!

You must be logged in to comment