Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm building a quadruped (4 legs 3 DOF) for my major work in electronics at high school. I need to know the displacement of the robot and I can't use an encoding wheel. I've done my research and I found a system where I use an accelerometer, gyroscope and a magnetometer to determine the displacement but I'm not sure how to code it.

I'm using Arduino and will use compatible sensors.

I would like to be able to implement something similar to this video which demonstrates the principles evaluated in this paper. I don't need to map the data on a screen, just be able to read its displacement from its last recorded position.

EG. (Read Position) ---> (Do "stuff") ---> (Read Position) ---> (Calculate displacement caused by "stuff")

share|improve this question
1  
This question is very broad. If you can narrow it down a bit to a specific area where you are having problems you might get some good answers. If necessary post several questions for each area where you are having trouble. You do need to show what you've tried. – ChrisF Oct 4 '12 at 8:23
Well, its broad for a reason, I feel like I'm in the dark a bit. Most of the stuff I've seen has been very technical, such as This document. I was hoping someone would be able to offer a suggestion for a solution or perhaps explain in easy to understand terms about "Kalman Filtering" or what ever its called. I'm only 16 so I hope you understand. – Jordan Brown Oct 4 '12 at 9:37
@JordanBrown: There is no solution that would be easy to understand, because the topic simply isn't easy. The document (IMU filter) is the right one. You need to read it and understand it and implement all of those 20 functions shown in the diagram on page 20 there. Or you can get the complete board from x-IO. – Jan Hudec Oct 4 '12 at 10:05

closed as not a real question by Blrfl, ElYusubov, Walter, GlenH7, maple_shaft Oct 4 '12 at 14:16

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

It's not clear to me if you're using an off-the-shelf combination of the accelerometer, gyroscope, and magnetometer or if you're sourcing discrete parts and rolling your own. Either way, if you're not finding the direction you need then break up your terms and restart your research. Googling "arduino accelerometer projects" turned up quite a few relevant hits.

This one looked fairly interesting as it's also got some code.

Make Magazine has a number of programming resources for arduino as well.

There are other approaches using potentiometers that might be worth considering if the accelerometer route proves too complex.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.