Using the mesmic 2125 to compute velocity and distance
Hello all,
·
I've been trying to use the mesmic 2125 dual axis accelerometer to compute distance. However, the noise in the system makes it very difficult to get a good reading.
·
Basically, I find the acceleration off the accelerometer; I then plug that data into a running sum·to compute the velocity. After which, I then plug that value into another running sum to compute the distance.
·
It’s a rather crude way to find the integral but it works for my purposes. The problem is though, that·I can't get good readings from the accelerometer to account for·the acceleration and delacceleration. What ends up happing pretty much is that the equation either runs wild, or if I scale it down, it becomes pretty much un-sensitive at low speeds and·is inaccurate.·
·
What I would like to know is if there is anyone who has managed to get this type of calculation to work, or if there is a way to filter out the noise. The reading off the accelerometer is never constant, which is essentially the problem. I get a raw reading after conversion of a value in to the 1000ths decimal place. But since the value jumps around so much I must scale it in order to prevent the equation from running wild. But as I said before, the calculation won't work anymore at low speeds.
Also,·I'm almost finished with my robot, I'll be posting it in the completed projects section after I finish making the code. I just need to program the main loop and tweak the driver methods some. (look up my recent post sto see what·I'm talking about).·
Thank you, for your help!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 11/10/2008 5:16:53 AM GMT
·
I've been trying to use the mesmic 2125 dual axis accelerometer to compute distance. However, the noise in the system makes it very difficult to get a good reading.
·
Basically, I find the acceleration off the accelerometer; I then plug that data into a running sum·to compute the velocity. After which, I then plug that value into another running sum to compute the distance.
·
It’s a rather crude way to find the integral but it works for my purposes. The problem is though, that·I can't get good readings from the accelerometer to account for·the acceleration and delacceleration. What ends up happing pretty much is that the equation either runs wild, or if I scale it down, it becomes pretty much un-sensitive at low speeds and·is inaccurate.·
·
What I would like to know is if there is anyone who has managed to get this type of calculation to work, or if there is a way to filter out the noise. The reading off the accelerometer is never constant, which is essentially the problem. I get a raw reading after conversion of a value in to the 1000ths decimal place. But since the value jumps around so much I must scale it in order to prevent the equation from running wild. But as I said before, the calculation won't work anymore at low speeds.
Also,·I'm almost finished with my robot, I'll be posting it in the completed projects section after I finish making the code. I just need to program the main loop and tweak the driver methods some. (look up my recent post sto see what·I'm talking about).·
Thank you, for your help!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 11/10/2008 5:16:53 AM GMT
Comments
You might try incorporating a Kalman filter into your code that measures the accelerometer output to reduce the noise.
Just a thought.
Regards,
TCIII
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
So, while doing my conversion I came up with a little problem. The Mesmic 2125 is a +/- 2g accelerometer right? Well, when using the equation given by parallax I only get +/- 1 resolution. Does he output really swing between +/-2 or do I need to scale my final ouput by 2? Or does that value refer to something completely different?
I may be getting a different value because I'm using a different equation. Mine is:
axis_acceleration = (((axis_reading_raw * BS2_scale) * 8) - 40000)
When the output is around 2500 which I believe is the middle for the Mesmic with the pulse in using basic stamp 2. The acceleration should equal zero. The input value is scaled by 2 regularly because the Basic stamp 2 needs to scale the pulse in value by two. The rest of the equation was derived from the original with after a larger scale was applied.
Is this correct? Or am I missing something?
Thank you, for your help.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
try this link.