Go Down

Topic: HELP: tri axis Accelerometer smoothing (Read 841 times) previous topic - next topic

packingtape

hello, is there anyone who have code for smoothing the output of the accelerometer..? for 2 servo txn :)

WillR

That's often just averaging a "few" reads -- 2,3,4 reads, average o/p -- whatever.
Just another Hacker

Magician

Try:  File / Examples / Analog / Smoothing

pito

Try in loop:
{
new_value = A * get_new_value() + B * old_value;
...
old_value = new_value
}
where A + B = 1.0

for example A=0.1 and B=0.9, the smaller the A the stronger the low-pass filtering effect.
p.

packingtape


That's often just averaging a "few" reads -- 2,3,4 reads, average o/p -- whatever.


sir can you have example..? i got some code in the google but it's not working my newbie :) tnx

WillR

It has already been pointed out that the Arduino compiler comes with examples that shows how to do this.

I have over fourty years in designing and building computer systems. The first thing I did with my new Arduino is to compile test and run every example that I could get to work.

If I am not too proud to use the examples to learn -- maybe you could try it too. When I had trouble with specific items people were happy to help.

I will not write your code. Nor it seems will the other experienced people. It's just too much...

If you want a course for beginners -- use google -- maybe there are some tutorials.
Just another Hacker


AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

packingtape

i'ts working but a little bit un smooth.. sir what about Kalman method.>? it is good to used..?

Go Up