Go Down

### Topic: HELP: tri axis Accelerometer smoothing (Read 1 time)previous topic - next topic

#### packingtape

##### Jul 20, 2012, 10:23 am
hello, is there anyone who have code for smoothing the output of the accelerometer..? for 2 servo txn

#### WillR

#1
##### Jul 20, 2012, 08:55 pm
That's often just averaging a "few" reads -- 2,3,4 reads, average o/p -- whatever.

#### Magician

#2
##### Jul 21, 2012, 01:35 am
Try:  File / Examples / Analog / Smoothing

#### pito

#3
##### Jul 22, 2012, 01:49 am
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

#4
##### Jul 22, 2012, 06:24 pm

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

#5
##### Jul 22, 2012, 07:18 pm
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.

#6
i tried it sir

#### AWOL

#7
##### Jul 22, 2012, 09:00 pm
Good.
How was it?
"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.
I speak for myself, not Arduino.

#### packingtape

#8
##### Jul 25, 2012, 07:31 pm
i'ts working but a little bit un smooth.. sir what about Kalman method.>? it is good to used..?

Go Up