Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C/++/# Need help with accelerometer data processing

  1. May 16, 2016 #1
    Hi,
    am working on a vehicle tracking device, i am using LIS3Dh accelerometer to get the acceleration data.
    i am using TM4c1231e6pz controller. I need to implement a harsh breaking alert, I am having difficulty in finding out which direction the vehicle is moving since the axis are not aligned with the vehicle. it can be fixed in any direction in the vehicle. I checked online I found methods to find the total acceleration only. can anyone tell me how to find the orientation of the vehicle and the direction in which its moving irrespective of how the device is fixed on the vehicle. I don't have a gyro sensor .

    am desperate....

    thanks in advance
     
  2. jcsd
  3. May 16, 2016 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Total acceleration could work, assuming harsh breaking leads to larger accelerations than driving in a curve or accelerating forwards. Otherwise you'll need some calibration, assuming the orientation in the car is unknown but fixed. First get the direction of gravity - that is easy. Then you are just left with two dimensions. Traffic lights should work for that: the car has acceleration in some fixed direction (it stops), then absolutely no acceleration for some time, then acceleration in the opposite direction (it starts moving again). That pattern should be unique to traffic lights (and maybe stop and go traffic), and it gives you access to the forward/backward direction. Using multiple traffic light stops can improve the accuracy.
     
  4. May 16, 2016 #3
    what you suggested could work, my doubt is ,suppose the device is fixed in such a way that when the vehicle moves forward it is at angle 45 degree with the x and y axis, then both x and y axis would have components of acceleration ,so from both x axis and y axis data how can I calculate the acceleration ?
     
  5. May 16, 2016 #4

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    With a coordinate transformation.
     
  6. May 16, 2016 #5
    I know, Its possible when we know the angle, but in my case when I give my product to a client , I have no idea how they are going to fix it (they might fix it upside down sidewise or just leave it hanging from the connector etc..) so the angle is also unknown... that's my real issue
     
  7. May 16, 2016 #6

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    That's the point of the traffic light stops to calibrate it (=figure out how it is oriented in the car).

    If it is hanging freely, or changing its orientation frequently, forget it.
     
  8. May 16, 2016 #7
    ok. Anyway thanks a lot. some of your ideas are really good , I will work on it. and try to calibrate it using the traffic light idea
     
  9. Aug 16, 2016 #8
    I have a couple thoughts. I process accelerometer data [almost] daily so I'm quite familiar with working with them. Be sure to look up whether your accelerometer excludes the effects of gravity (many do).

    1.) First thing I would do is integrate the acceleration time history (look up trapezoidal numerical integration) to get the velocity components. Then, do this again to get displacement. (One word of caution, you may need to high pass filter the data before each integration at approximately 5 Hz to remove the DC component which can make the Vel. TH and Disp. TH incorrect). The vehicle is going to displace the most in the direction it is traveling and the total velocity will be the greatest in the direction of travel as well. I would plot all of the velocity time histories together and the displacement time histories together. Since it's not oriented with the vehicle axis, it will be at minimum a combination of the 2 directions (or possibly all 3) to figure out the orientation. If you do the entire time segment, you should see where braking begins, acceleration starts, etc. If you see that 2 velocities and/or displacements are near the same and are the highest, then those 2 are in the direction of travel 45° from the axis of travel and the other direction is orthogonal.

    2.) Additionally, road vibration is mostly Gaussian random vibration (although some sources have shown vehicle random vibration is actually more random than random vibration...i.e. higher Kurtosis value). So consider that you will have random vibration, vehicle acceleration (and deceleration and centripetal motion), and shocks (and also noise) possibly all in one single time segment measurement. This is not just some object accelerating in a straight line in a vacuum with no outside influence. These can all be converted to power spectra, but it may not be as beneficial... but things such as velocity Power Spectral Density (PSD) and displacement PSD can be computed--something else to consider calculating. So in other words, don't be surprised if the results don't come out to exactly what you anticipate. Filtering of the data may be required to get what you want.

    I think the first one will help you the most.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Need help with accelerometer data processing
  1. Data Processing (Replies: 5)

Loading...