Help with motion sensing.

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
kolnari
 
Posts: 7
Joined: Thu Mar 15, 2012 7:32 am

Help with motion sensing.

Post by kolnari »

Hello,
I'm tring to figure out how I can sense motion using acceletromters and or gyros. I have an MM8451 and spent some time trying to figure out the outputs while moving it, but I can't see a any clear consistancy. Nor can I make much sense of the data sheet. I have searched around and found nothing that helps me.
My goal is to have a device that can indicate when it is stationary. Moving forward, backward and a bonus if it can know it's turning left or right. All of this in the X and Y plane only. i'm not concerned about the Z plane.

Thanks in Advance
Richard

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with motion sensing.

Post by adafruit_support_bill »

My goal is to have a device that can indicate when it is stationary. Moving forward, backward and a bonus if it can know it's turning left or right. All of this in the X and Y plane only. i'm not concerned about the Z plane.
Look at the readings when the device is stationary. There will be some random noise, but for the most part the readings will be close to zero in both the X and Y axis for accelerometer and the X, Y and Z axis for the gyro. The Z axis of the accelerometer will register 1G due to the force of gravity. If the accelerometer values deviate up or down significantly from the stationary readings, then the device is accelerating. If the gyro values deviate up or down from the stationary readings the device is rotating.

One thing thing to understand about the accelerometer is that it measures acceleration, not speed. So if it is moving at a constant velocity with no change in direction, the readings will be the same as if it were stationary.

User avatar
kolnari
 
Posts: 7
Joined: Thu Mar 15, 2012 7:32 am

Re: Help with motion sensing.

Post by kolnari »

Thank you!
You did clear up some things for me.
I have tried studying the output and I can't identify any consistent behavior. I've tried printing out only one value of X or Y and watching it as the board moves in a single straight line. When I move the board the same way twice I can get wildly different outputs. One time it's a negative value another time, for the same directions it's a positive value. Obviously I am missing something, but I can't figure it out. I have tried reading up on accelerometer theory and it still hasn't helped understand what I'm seeing.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with motion sensing.

Post by adafruit_support_bill »

When I move the board the same way twice I can get wildly different outputs. One time it's a negative value another time, for the same directions it's a positive value.
When you accelerate in the positive direction along the X axis, you will see positive values. If you maintain a constant speed in that direction, the values will return to zero. When you decelerate to a stop, you will see negative values.

User avatar
kolnari
 
Posts: 7
Joined: Thu Mar 15, 2012 7:32 am

Re: Help with motion sensing.

Post by kolnari »

Thank you.
That is the key thing I needed to understand.

Greatly appreciated

Richard

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”