I am trying to measure linear acceleration using an H3lis100dl (www.st.com/resource/en/datasheet/h3lis100dl.pdf) with an arduino. I am measuring high g accelerations thus using the 100g accelerometer. The issue is that whenever I slightly tap the accelerometer it shows that the linear acceleration is around 7-8 g and even sometimes more, which is not possible. So, to check this I hooked up an MPU6050 (16g) along with the h3lis on the same board. And as you can see in Fig 1, on tapping the board slightly, the MPU6050 shows a slight movement suggesting that a low g movement has occurred but the H3lis can peak upto 7-8 g's. The y-axis in the figure is in m/s2. Red - H23lis, Blue - MPU6050.
Now if I don't tap the board and only do a rotation or a continuous sweeping sort of movement. I get a bell sort of a curve and in this case both the readings are pretty much in sync (Fig 2 & 3).
So, the 100g accelerometer under a sudden shock situation is not responding in the right way. Also, I get a constant noise in the H3lis signal shown in Fig 4, and also visible in other figures that H3lis readings fluctuate a lot.
Any suggestions for figuring out and rectifying the H3lis behavior, under a sudden movement situation and improving the noise response(I am doing a simple averaging to control the noise).
Yes, a tap or a hit can really be 7-8g. A low-pass filter might be useful to filter out short disturbances.
I'm not familiar with that sensor. If it has no internal filtering you must sample at a higher speed than any predicted input and use a digital filter (averager) to remove this noise. If you cannot sample fast enough then you must look for a different sensor.
I think the device is behaving perfectly according to its spec.
The noise specification is 1g rms at 400Hz sample rate, for instance, and the offset rating is "typical +/- 1.5g",
which means nothing, the word "typical" is no guarantee of a particular device's behaviour - you are
expected to enable high pass filter.
And several g for a tap is probably spot on. Its timescale for responding is a new ms only remember.
Another thought struck me - all mechanical instruments have resonances, and a sharp tap is most likely
to energize the natural resonance of the accelerometer (yes, it will be designed to dampen
down any resonances, but typically not completely in order to increase the frequency response).
Thus a tap input might well read somewhat high, due do resonant overshoot. A good datasheet would
have a frequency response graph indicating how big an effect this is, and allowing correction for it. It
may be that the resonance is above the frequencies visible to a 400Hz sample rate, ie the sample rate
could hide this effect.
MarkT:
The noise specification is 1g rms at 400Hz sample rate, for instance, and the offset rating is "typical +/- 1.5g",
which means nothing, the word "typical" is no guarantee of a particular device's behaviour - you are
expected to enable high pass filter.
Thanks for the reply guys, I am already using the High pass filter. The offset is not much of an issue rather the noise that rides upon that. @MarkT you are right, the noise according to the output data rate (ODR) of 400 Hz is 1g and that is what I get, so any techniques to reduce this noise, like filtering of some sort.
I did some more testing and found out that upon lowering the ODR to 50 Hz the response on the tap doesn't exceed beyond 3g which previously was going upto 7-8g and even 12g. This happened because of the internal low pass filter which is now set to 37 Hz but previously was 292 Hz.
So, lowering the cutoff for H3lis improves the situation, but now the other problem is that the cutoff is not programmable rather tied to the output data rate (ODR) of the sensor. So, inorder to get 37 HZ, the ODR was set at 50Hz where as I was using 400 Hz before that.
Any ideas on keeping the ODR 400 Hz but reducing the cutoff to say 37 Hz. May be implementing a digital low pass filter, I am already doing a simple averaging.
The reason their filtering tracks the sample rate is that its an anti-aliasing filter to reject noise above
the nyquist limit from getting into the ADC. You probably want that. You can still average / filter as
well.
Since you're talking about accelerometers please look at this question for me:
I am collecting accel data at 1Khz for up to 5 seconds, which would be up to about 5,000 values. Probably they can be 3 or 4 digit int. How do I store these so I can after the loop of collection is done, go back and do operations to them - i.e. the high value, the low, etc?
I could also collect fewer samples if memory is a problem because that's not the real question I have. I just want to gather the data and then go back and look at it. Thank you.