connormcguirk
Posts: 3
Joined: Wed Sep 20, 2017 2:22 pm

Acceleration and Impact Sensing with the Pi 3

Wed Sep 20, 2017 11:32 pm

I'm not an advanced user but I believe this is an advanced(ish) question.

I am looking at using a Raspberry Pi 3 to log data from a crash test dummy. The dummy will be launched on a bicycle at 20 km/h and then struck by a car moving at 30 km/h. My goal is to design a measurement and data logging system that can take in acceleration and force values from the crash at a very high rate so that the peak forces during the impact are recorded. I will then take this data and interpret it using MatLab.

So far I am looking at purchasing 4 tri-axial accelerometers (https://www.sparkfun.com/products/12803), and 8 flexiforce sensors (unsure on which to use right now) that will be placed inside and around the head of the dummy. I would need to convert the analog signals from these sensors to digital and I think that I could use this AD4000 chip (http://www.analog.com/en/products/analo ... d4000.html). Also, I think that I will need this clock (https://www.sparkfun.com/datasheets/Bre ... DS3234.pdf) in order to have a high enough sample rate, this should provide me with more than I need.

I have no experience with Raspberry Pi and I was curious if what I listed above would be possible? Any recommendations, or tips on what I should do would be greatly appreciated.

User avatar
Pekka
Posts: 20
Joined: Mon Nov 19, 2012 4:11 pm

Re: Acceleration and Impact Sensing with the Pi 3

Thu Sep 21, 2017 4:33 am

We use a similar system for measuring accelerations and other quantities on a bicycle during normal ride (described here). It uses a MCP3208 ADC chip and is powerd from a battery pack. It works very well and can record 8 analogue inputs at 500 SPS (higher rates are possible if required). Our experience shows, though, that the main problem with using a RPi in crash testing is its low impact resistance because of the connectors (particularly the SD-card slot), which cannot easily be prevented from disconnecting on impact.

IanS
Posts: 231
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Acceleration and Impact Sensing with the Pi 3

Thu Sep 21, 2017 4:24 pm

There are a number of guides on converting to a read-only file structure for the Pi. How about following one of those so that data transfer to or from the SD is minimised, and trying to fasten the card in as best you can too. A Pi3 where the card needs to be pulled straight out is probably better than the Pi2 which used a push-to-release mechanism, as pressure will keep the card in place instead of unlocking it. Keep the data in memory or in a memory based file structure and then transmit it over wi-fi to another repository. You may even be able to transmit during the crash, depending on how much you are capturing.

connormcguirk
Posts: 3
Joined: Wed Sep 20, 2017 2:22 pm

Re: Acceleration and Impact Sensing with the Pi 3

Fri Sep 22, 2017 12:58 am

"There are a number of guides on converting to a read-only file structure for the Pi. How about following one of those so that data transfer to or from the SD is minimised, and trying to fasten the card in as best you can too. A Pi3 where the card needs to be pulled straight out is probably better than the Pi2 which used a push-to-release mechanism, as pressure will keep the card in place instead of unlocking it. Keep the data in memory or in a memory based file structure and then transmit it over wi-fi to another repository. You may even be able to transmit during the crash, depending on how much you are capturing."

Hi Ian, the sensors that I am looking at will be sampling at 11,000 S/s. There will be 3 accelerometers and then about 5 force sensors. I am only concerned with data logging and then interpreting the data afterwords. There will be a lot of data points.

Do you think the Pi3 is the best choice? Or would the Arduino Mega, or Teensy 3.6 be a better choice?

IanS
Posts: 231
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Acceleration and Impact Sensing with the Pi 3

Fri Sep 22, 2017 9:36 am

I am not familiar with the Teensy platform, but for high speed data capture where you want the sample time to stay regular I would seriously consider using a dedicated microprocessor like an arduino over a general purpose computer like a Pi. The problem with the Pi is that tasks running in the background may cause jitter in the timing, although you can set process priorities, CPU core affinity and exclusivity and the like to try to minimise this. Conversely, the problem with an Arduino is the limited storage, although the Mega gives you more than most models.
11KS/s x 8 sensors x (say) 16-bit readings = 170+ KB/s, so a Mega would only give you about one and half seconds storage. This is not a problem if you can trigger the capture start within a fraction of a second before the impact and you only need the initial impact, but if you want to measure the later impacts as well, as the cyclist bounces along the road, it would not be enough. One solution to triggering the capture might be to continuously capture all sensor data into a rolling buffer, overwriting old readings, while monitoring one sensor reading that you expect to show a significant impact spike. Once you see the spike then note the buffer current position, back off by a small fraction of a second, and only complete one more buffer worth of readings before stopping recording.

If you use one Arduino per sensor then you can obviously store more data, but you then have the problem of synchronising the readings. It might be possible for one to notice the initial spike and then notify the others, but you would have to check whether the overhead of checking for the signal is too high for allowing high speed data capture. Signalling via the logic level of one of the digital pins and writing/reading using PORTx manipulation rather than DigitalWrite/DigitalRead is probably fast enough - it only takes a few clock cycles rather than a few microseconds.

If you perform the data capture on a Pi, then you are going to have to use a compiled language such as C for the capture. You could probably prototype it in Python more easily, but reaching 88KS/s is likely to prove difficult. See http://codeandlife.com/2012/07/03/bench ... pio-speed/ for a speed comparison of different access methods.

Return to “Advanced users”