Putting robotics at your service™

Free shipping on orders over $200

Question on accelerometer and Atom pro code

Print view Share :
Previous topicNext topic

Page 1 of 1 [ 6 posts ]

Novice ( offline )
Posts: 73
Posted: 2012-01-29 01:16 
I wrote i little bit of basic code for an accelerometer and atom pro. It is really hard to get it working, i am just fiddling around a little right now. Only problem i keep on having is that that read out from the accelerometer is somewhat jerky, probably due to jitter etc of the servos, because when powered down there seems to be less of a problem with the value. I have tried averaging, that is to say, instead of taking one measurement i took several and averaged. I made i deadzone, but still. The deadzone has to be quit big to have it less jerky (30 percent of the range!?!). Anyone suggestions as to how the get a value that is less susceptible to instant changes? Anyone some example code how they solved it? I put a small movie in wich i reversed the x and y output. So now it doesn't level on the floor, but 'in the air'. And it does a calibrate routine first, asi said i was fiddling around. You can see it works...somewhat, but pretty jerky. Any advice is welcome...



User avatar
Guru ( offline )
Posts: 4127
Posted: 2012-01-29 18:40 
Hard to tell. I played with a 2D accelerometer, but didn't get it on a 'bot yet.

Where is the sensor located? Is it up in the "head"? If so, Looks like the "neck" is flexible; maybe it gets bounced more?

Your deadzone and averaging sounds reasonable. Maybe graph it out? A little sensor fusion (if you have other sensors) or filtering might work.

Alan KM6VV


Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


User avatar
Guru ( offline )
Posts: 3301
Posted: 2012-01-30 01:35 
Its a catch 22 on this one. Iv been observing the footage and from what i can see everything it working fine. Or as its designed to do. By this i mean as the sensor is tilting (by you) the legs are working as they should. But when you place it on the table (tilted) it won't return to normal because you haven't told it to. The sensor remains tilted because the legs are doing what their told to do by the sensor. If that makes sense. Can you post your code? You need to make a command to make the body return to normal.

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk
Create, Innovate, Inspire.


Novice ( offline )
Posts: 73
Posted: 2012-01-30 02:04 
Thanks for the reply, made me think.

About the placement. I was thinking the closer to the center (x,y and z) the better. I have fixed it to the body because it seems to experience te least amount of interference there (jitter etc.) And besides the averaging and the deadzone i was thinking about a default to zero of a kind.... so innerbreed that does make sense.

I'll try that and post the results.


User avatar
Guru ( offline )
Posts: 9256
Posted: 2012-01-30 10:57 
Some accelerometers have a place to solder in a capacitor across the analog output that can be used to directly filter the output. Might be worth a try. I think the main problem is an accelerometer will provide the angle of the object it is connected to when it is stationary, but it has errors when the object is in motion. I think if it were to be accompanied with a gyro the error could be corrected.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Novice ( offline )
Posts: 73
Posted: 2012-01-30 11:06 
Okidoki, that helps! I am first gonna be stubborn i guess and try a software sollution and then go on to the capacitor and eventually the gyro sollution....


 

All times are UTC - 5 hours [ DST ]. It is currently 2014-12-18 19:45
Feedback Form
Feedback Form