I'm working with YEI-3Space sensors to acquire accelerometer data. I need accurate data (both on amplitude and on time), because I need to analyse if I fulfill the ISO 2631 about Mechanical vibration and shock.
I'm working on Linux, with a RaspberryPi, connecting the sensor with an USB cable. These are the configuration commands I'm sending to the sensor:
- Get corrected accelerometer -> ":80,39,255,255,255,255,255,255,255"
- Configure Response Header Bitfield for timestamp -> ":221,2" (So, the sensors will get the timestamp and send it to the RaspberryPi).
- Configure streaming timing -> ":82,6250,200000000,0" (So 160Hz sampling frequency).
However, the data I'm acquiring is not consistent on the 160Hz sampling frequency. The acquired timestamp difference should always be 6250 (us), but instead it is always changing in a range between 5100(us) and 7700(us).
Does it mean I'm doing something wrong in the configuration of the sensor? Is there any option to have a constant and consistent sampling frequency?
The timestamp value indicates the acc data sampling instant, doesn't it?
Mild deviations between timestamps is normal behavior. Since the accelerometer is not sending out unique data faster than you are sampling, you shouldn't lose any data due to this. If you would like to see exactly consistent intervals between each sample, I would recommend linearly interpolating the data between samples to find the data at the desired timestamps.
I hope this helps,
Great Eric! Thanks for you answer.
I think this lack of consistency on the sampling frequency should be clearly explained in the manual, because for some applications it is really important to know the sampling characteristics for later analysis (frequencial, i.e.).