Pages: [1]   Go Down
Author Topic: HELP: tri axis Accelerometer smoothing  (Read 771 times)
0 Members and 1 Guest are viewing this topic.
Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Georgina Ontario
Offline Offline
Sr. Member
****
Karma: 5
Posts: 437
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Just another Hacker

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2590
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 Try:  File / Examples / Analog / Smoothing
Logged

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2073
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley tnx
Logged

Georgina Ontario
Offline Offline
Sr. Member
****
Karma: 5
Posts: 437
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Just another Hacker

Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

i tried it sir
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26273
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good.
How was it?
Logged

"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.

Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: