9

I am currently studying DSP and FFT, I am very new to this and have been doing electronics for a long time with Arduino and hobby projects. Recently, I am doing a project with the goal to map potholes along your daily commute in the car, measuring road roughness. This is not the road profile, but the subjected roughness of the ride the driver feels during the trip. I have an acceleration mounted to measure Z-axis "vertical" acceleration of the car, when a pothole is struck the shocks and springs dampen the force as per the quarter car model for simplicity.

Basically I want to be able to create a detector that will detect potholes by using FFT to find the dominating frequency of the vertical acceleration, then I can maybe match it to pattern to detect door slamming of the car door, or a man-hole cover from a pothole maybe in the future.

I'm not sure if FFT is the way to go, any input or advice and ideas are greatly appreciated, I have made a low pass filter to filter out the higher frequency vibration from the drive train and engine.

Any ideas on the subjected "roughness" felt by the passengers/driver in the car? I was thinking of doing road tests on a smooth road, gravel road, brick road, bad road, and coming up with a threshold of the magnitude of the vertical acceleration and making a scale somehow on what is considered "rough"

The potholes detected would be also logged with GPS their locations, I'm trying to use the Rasberry Pi for this, with data storage and its speed as a good project for it.

Thanks any help or ideas is appreciated, books, tutorials, wisdom, etc

UPDATE:

Carry over additional data here:

https://electronics.stackexchange.com/questions/56238/accelerometer-data-smoothing-filtering-pothole-detection

zacharoni16
  • 193
  • 1
  • 6
  • 2
    PAK-9's answer below has some good suggestions. Step 1 for you should probably be to collect some data using road tests (as you suggested) to see what the features you would like to detect actually look like. – Jason R Jan 04 '13 at 17:34
  • Are you going to automatically submit them to seeclickfix.com? :) – endolith Jan 04 '13 at 18:24
  • Yes I could if I get it working correctly lol, The city of Boston made a smartphone app that does this, they had thousands of dollars in grants to people for their submissions. Mine is going to be a simple subset of that, I imagine with a smartphone most people move it around in their car, so you would have to have the phone in a holder to get accurate readings or detingish from dropping the phone or moving it while the car is moving. So I'm using an external accelerometer to avoid those complications – zacharoni16 Jan 04 '13 at 18:30
  • @user978563 What is this external brand of accelerometer that you are using btw? – Spacey Jan 04 '13 at 18:57
  • Brand is KXPS5-3157

    Datasheet

    http://www.dz863.com/downloadpdf-lovdnabsxg-KXPS5-3157.pdf

    – zacharoni16 Jan 04 '13 at 19:09
  • @user978563 Are you sure the link works? It just takes me to the home page.., no PDF. – Spacey Jan 04 '13 at 19:28
  • @Mohammad try this their site wont directly link the pdf, scroll down its under the "Kionix" image http://www.dz863.com/datasheet-87341963-KXPS5-3157_3g-Tri-axis-Accelerometer-Specifications/ – zacharoni16 Jan 04 '13 at 19:29
  • @user978563 I see, it can be saved directly, but not opened in tab. – Spacey Jan 04 '13 at 19:33

1 Answers1

8

You are not really interested in the frequency information in your signal so much as detectable features - as such I would suggest that there isn't that much utility in an FFT here.

What you really want to do is correlate the continuous 'car signal' recorded in the car with a different signal which is the 'signature' of the pothole bump. You will need to acquire this signature by recording it in a car going over a pothole (perhaps recording many and using them to produce a generic signal which is a good representation of a pothole). Once you have it you can cross correlate it with your car signal. You may want to do this in the frequency domain in which case you should cross correlate the FFT of your signature with a sliding FFT of the car signal.

You may want to process the car signal before you use it to remove, for example, high frequency noise (with a lowpass filter). You can do this pretty effectively by eye - play around with various filters on car signals to see which removes the most extraneous information while leaving the important pothole information intact.

PAK-9
  • 810
  • 4
  • 14
  • Would this cross correlation be very hard to do programatically? I want this to be all done automatically in software. I guess the hardest part is to get the "generic signal" for a pothole broad enough to match the FFT against the FFT of the current data in the car.

    The sliding FFT, what would the windowing function be? The one thing that confuses me about FFT is the window, it would be a sliding window? It seems like the pothole frequencies occur in the 5HZ to 20HZ range very low frequency do to SHM of the dampened suspension

    – zacharoni16 Jan 04 '13 at 17:21
  • 2
    Cross correlation is not especially difficult to do programatically, it is very similar to convolution (both of which are essentially iterating over two arrays and performing some function with a sample from each) - I am sure there are libraries available if you do not want to write your own. The signature may be a little difficult to acquire but if you get a load of data you should see some features emerging, plus cross correlation is not binary, the result is essentially a 'confidence' value so you can threshold it however you want. – PAK-9 Jan 04 '13 at 17:29
  • 1
    The windowing fn of the sliding FFT can be whatever you want, it shouldn't affect the result too dramatically. I would expect to see a big impulse which is damped over a short period (SHM of the suspension as you say) so you may be able to synthesise something like this based on observations of the signals. – PAK-9 Jan 04 '13 at 17:35
  • AH that makes sense, the difficult part is getting the signature is there any tutorial or book or site with a similar example of the procedure, right now I'm thinking I just need to make synthetic bumps kinda like speed bumps, and potholes and driver over them a bunch of times to get lots of data. I'm not sure what features I should consider for the signature though – zacharoni16 Jan 04 '13 at 17:35
  • 2
    Just driving over a load of bumps and holes then chopping those parts of the signal out will give you a library of signatures. FFT each of them to give you a spectral signature, if some are widly different on visual inspection then seperate them out into groups which are similar. You can then perform some sort of averaging on each group of signatures to end up with a final 'master' signature from each group which you can compare against car signals. – PAK-9 Jan 04 '13 at 17:40
  • You really need to start by making a recording and looking at it with your eyes, both waveform view and spectrogram view, to see what a pothole looks like on the graph and what features distinguish it from other bumps. After you know what you're trying to catch, you can start programming something to catch it. – endolith Jan 04 '13 at 18:27
  • Sounds good, I'm getting started after work, thanks for all your help are you available if/when I run into trouble lol. The averaging function is it a simple average,weighted, moving? I guess I'll have to experiment lol ugh or I'm thinking too hard – zacharoni16 Jan 04 '13 at 18:33
  • Yes I wouldn't overthink it at this stage, just grab some data first and start playing with it :) – PAK-9 Jan 04 '13 at 18:38
  • @user978563 The thing is neither you nor I know what a pot-hole signal looks like based on accelerometer readings just yet. This is a good example of a project that needs real data to start. "Not all potholes are created equal". What if there was a cascade of them? What if there was a gradual one? You need many examples so that you can make your 'dictionary'. Once you have that, then you can start to 'correlate', by many methods. How are you collecting your data? I might be able to help you at the correlation stage. – Spacey Jan 04 '13 at 19:01
  • Basically I have a KXPS5-3157 accelerometer hooked up to measure the Z-axis acceleration on the driver seat of the car. The data is logged by an arduino onto an SD card. I need to refine the data logging, and have it "mark" when a pothole is about to be struck, also I'm not sure yet if this accelerometer is the correct sensitivity yet. my goal is to get a lot of data, the correlation and signature stage I'll really need advice and help and I appreciate it, the KXPS5 is just an accelerometer I had laying around since I'm low on money to afford to buy one unless I have to – zacharoni16 Jan 04 '13 at 19:12
  • I will post data here tonight or by the end of the weekend hopefully so we all can get a better idea – zacharoni16 Jan 04 '13 at 19:23
  • @zacharoni16 So any luck gathering data? :-) – Spacey Jan 08 '13 at 16:25
  • @Mohammad I'm having trouble with getting the data. I'm using the arduino, would I have to have accurate time reference, like sampling rate to have the acceleration with respect to time? Not sure to sample 1 time a second? Do I need a real time clock? I'm plotting the data but it's just acceleration data with no time reference right now... Any help Mohammed or Pak-9 thank you. I think the acceleration data with no time reference is useless? – zacharoni16 Jan 18 '13 at 19:23
  • @zacharoni16 Shoot me an email and we can take it from there instead of cluttering here. – Spacey Jan 18 '13 at 20:12