# Displacement with accelerometer [duplicate]

I want to use a sensor to find displacement with accelerometer. How can I use accelerometer to find displacement? I want to use this for a quadcopter.

## marked as duplicate by Ian, Ben♦, Mark Booth♦Dec 15 '15 at 11:46

• i have fund a sensor named IMUs . – Ramtin Aug 6 '15 at 6:39
• Welcome to Robotics.SE - what have you tried? At the moment, your question shows no research... – Andrew Aug 6 '15 at 7:50

This will depend on what you mean by "displacement" and for how long you want to do this. Can you supply more details on what your trying to accomplish and why?

As Bending Unit 22 mentioned, you integrate acceleration to get velocity, and then integrate velocity to get position. The problem with this though that any drift/error/noise on the accelerometer gets doubled integrated and your positional error will grow quadratically, so there is a good chance you'll need additional sensors to correct for this error. Whether this error matters to you or how you want to compensate for this error will depend on what you're trying to do, providing more information would be helpful!

I want to use a sensor to find displacement with accelerometer

An accelerometer is a sensor.

How can I use accelerometer to find displacement?

By integrating twice, because acceleration is defined as the second derivative of position.

In a numerical calculation, in every step add the new value from the accelerometer to a sum (that's velocity) and add that sum to another sum, which will be the position. Also, the acceleration and velocity must both be multiplied by the change in time before summing.

velocity += acceleration*dt
position += velocity*dt

• thank you very much for your reply now i have new question how can i use that in a quadra corpor – Ramtin Aug 8 '15 at 17:28
• @Ramtin if you have a new question, ask it as such. Do not ask new questions in comments. Thank you. – Bending Unit 22 Aug 9 '15 at 15:18