Skip to main content
Visitor II
October 26, 2020
Solved

finding Speed of moving vehicle with Accelerometer

  • October 26, 2020
  • 8 replies
  • 7369 views

Dear,

I am trying to find speed of a moving vehicle using accelerometer. Is there any acclerometer with you(ST) ? Please Suggest me one. If any body done with this Project, please Share your Experience.

Thank You.

    This topic has been closed for replies.
    Best answer by Eleon BORLINI

    Hi @NMale.1​ ,

    I tried to answer to your question on this thread.

    -Eleon

    8 replies

    ST Employee
    October 26, 2020

    Hi @NMale.1​ ,

    you can use, at first order, the basic kinematic formula of physics and thus V = V0 + a*t.

    where "t" is your sample period (1/ODR), "V0" is your previous velocity (0m/s if yoor vehicle starts from stationary position), "a" is your axis acceleration value. You need to understand that the velocity is the vector sum of each of the x,y,z axes. However the actual velocity may differ due to noise on each of the axis inputs. That's where using just acceleration data as the only input to the system will cause a noticeable error in the velocity after a couple of periods.

    So you need to periodically check the acceleration value, low pass filtering the sensor output, maybe averaging in time.

    A standard accelerometer such as the recent LIS2DW12 can face this task.

    If however you want to be more precise, for example monitoring the current position of a device, an automotive sensor combining accelerometer and gyroscope data can be used, for example the ASM330LHH (or ISM330DHCX). I suggest you to check the X-CUBE-MEMS1 package running on STM32 MCUs for the ST sensors, which has a lot of examples and applications for the position recognition of an object, such as MotionPE library that estimates the real position of a device.

    -Eleon

    NMale.1Author
    Visitor II
    October 27, 2020

    Hi Eleon Borlini,

    Thank you for your replay.

    Above given accelerometers, will they give me -Ve values(2's complement) while in deceleration? and +ve values(2's complement) in Acceleration?. can you Please explain me , How they behave in dynamic motion?. Is offset of accelerometer (after Factory Calibrated) is constant when the accelerometer is in Rest? or it changes with time?. Is anybody tried this project before?

    I want above specifications , Please explain clearly .

    Thank you in Advance.

    ST Employee
    October 28, 2020

    Hi @NMale.1​ ,

    when you write "Ve", do you mean the velocity calculation or the acceleration module (i.e. sqrt(a_x^2+a_y^2+a_z^2))? I ask you because the "V" indicates sometimes the overall acceleration vector.

    In the first case, the velocity / speed is not an output of the acceleration sensors, but should be calculated in post processing, since the integration function is delicate and must take into account of the integrated acceleration noise. For this reason, you have to periodically calibrate the accelerometer (e.g. initial offset cancellation), and trigger the acquisition and the integration on the actual ODR. These algorithms (at least ST ones) are not open, so for this you should contact Sales and representatives from your geographical area.

    There is another possibility, that is using quaternions (that estimate the position of the device in the 3D space), that uses accelerometer, gyroscope and magnetometer. You can see the MotionFX user manual for this purpose.

    Moreover, in ST portfolio there is a dedicated module that is designed for calculating the vehicle’s position, height, heading and velocity in an automotive environment, i.e. TESEO-DRAW.

    -Eleon

    NMale.1Author
    Visitor II
    October 28, 2020

    @Eleon BORLINI​ 

    it(Ve) was not Velocity. I am asking for wheather accelerometer gives me negative values or positive values in Deceleration condition

    Please answer me.

    ST Employee
    October 28, 2020

    Hi @NMale.1​ , of course if the acceleration is negative (deceleration), the dataout of the accelerometer will be negative, while velocity will be positive from the above formula calculation V_dec = V_max - a*t.

    -Eleon

    NMale.1Author
    Visitor II
    October 28, 2020

    I am asking about the values from Accelerometer sensor through I2C . Have you Tested Practically the values of accelerometer in deceleration and acceleration. If you have the reports of test Please share me.

    Please answer

    ST Employee
    October 28, 2020

    You can simply turn upside down the accelerometer: in one case, you will see the earth (gravity) acceleration with positive sign in one position, and negative in the other position...

    0693W0000059aBNQAY.png0693W0000059aBSQAY.png-Eleon

    NMale.1Author
    Visitor II
    October 28, 2020

    Greetings,

    In TESEO_DRAW they are using ODOMETER. I want to find the speed without ODOMETER, with only accelerometer or IMU sensors.

    Please answer my doubts.

    NMale.1Author
    Visitor II
    October 28, 2020

    Greetings,

    I want to calculate speed from acceleration, I have to integrate the acceleration data, means every time i have to add the samples of the axis which was parallel to the ground (not affected by Gravity of earth). It was not actually depends on gravity. the movement of the vehicle suppose assume in X direction , i have to add X axis acceleration values every time after Certain time (let 1 Sec). When it accelerate it should give positive values and when it decelerate(means speed is not Zero, difference in speed is Negative) it should have to give negative values.

    I want an accelerometer with that Qualities ; if You have that type of accelerometer Please suggest me one. Please check wheather it giving Negative values in deceleration or not

    Please reply me

    Graduate II
    October 28, 2020

    All the X, Y and Z values are signed.

    The accelerometer is not free floating, there will be some hard and established mounting to the body of the vehicle. The static state will need to be calibrated or trimmed out. Should be possible to determine where the Z / Down direction is.​

    NMale.1Author
    Visitor II
    October 28, 2020

    @Community member​ 

    Your answer is not relevent to my question. Please check my question once. i am asking about the values given by sensor in deceleration.

    please read total convesation and answer my doubt.Please help me.

    Graduate II
    October 28, 2020

    I think the top post gave you a couple of specific parts you could review the documentation for or evaluate further.

    They simply report the acceleration forces acting on it in 3D, as signed values, in the directions it is occurring relative to the mounting.

    If you compute the acceleration as sqrt(x*x + y*y + z*z) clearly that's always going to be positive.

    The devices don't really have an understanding of forward/backward. You're going to have to do the vector math on the values.

    If it moves entirely along the X axis of the device, that will be positive and negative as it accelerates and decelerates.

    Perhaps you have colleagues or an immediate supervisor that can help you review the supporting documentation for the assort 3/6-DOF devices ST offers.

    NMale.1Author
    Visitor II
    October 30, 2020

    Greetings,

    @Community member​ &@Eleon BORLINI​ 

    In data sheet of LIS3DH accelerometer , they have given that output is 16 bit and it has two 8bit registers. But the LSB register always giving me output as ZERO. only MSB register changing the data while moving the object.

    Please Help me......

    ST Employee
    October 30, 2020

    Hi @NMale.1​ ,

    I tried to answer to your question on this thread.

    -Eleon