possilbe inaccuracy at the sampling frequency for LIS2DS12
Hello ST community,
I am interested in measuring the acceleration with two LIS2DS12 sensors at the same time. Therefore, I start the measurement (nearly at the same time) with a sampling frequency of 800Hz for 10 seconds with +-2g full scale range for both sensors. The test case is the following. Both sensors lie on the table and I apply slight shocks at the table.
My expected result is seeing the vibrations at the sensor data at the same time at both sensors. Maybe there is an offset between the two sensors due to an inaccuracy at starting both at the same time. But this offset should remain constant over the 10 seconds measurement time.
As you can see in the attached picture (measurement.png), I succecfully measured the vibrations with both sensors. There is also the offset due to the inaccuracy in starting both sensors at the same time. But if we take a closer look the offset will not remain constant. It shifts. Picture first_shock.png as the name says, shows the first shock of the measurement. The last measurement point of the first sensor before the shock occurs is at about 74ms and the same for the second sensor is at about 393ms. So the offset between the two sensors for the first shock is 319ms. If we take a look at the last_shock.png we will see an offset of 233ms between the to sensors.
Therefore, my question is how is this possible? The only two ideas I had was that I lose samples but I don't now why this should happen. And there could be a inaccuracy in clock control at the LIS2DS12 so that the sampling frequency changes over time and therefore this shift of the offset time occurs.
Further information:
Both sensors have the same configuration (800Hz, 10s, +-2g) and are in continuous mode. I read the data if there are more than 2 samples in the fifo, so the time for the read reqeust (~970µs) is less than 1/ODR (1.25ms for 800Hz). I also check the register 0x2F for fifo overflow or fifo full at each read request so no data gets lost.
