cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DS3 strange values in FIFO

Christian Koch
Associate
Posted on April 05, 2017 at 11:44

I have an LSM6DS3 gyro / accelerometer connected to a Raspberry Pi 3B using i�c. I'm using the internal FIFO to get samples from the gyro and accelerometer. The data is plausible most of the time, however, every now and then there is a strange sequence of values when I read the FIFO:

sample output:

47    -240    -371    143    -238    -378    ...

138    -240    -369    141    -238    -361    ...

137    -238    -381    134    -247    -373    ...

130    -229    -367    133    -235    -370    ...

134    -236    -364    127    -241    -371    ...

2609    -155    453    

1110    1497    2450    -73    160    499    7588    6995    16508    

15758    10954    28583    11959    7888    20306    10    508    64    9    -56    -411    

117    -190    -295    142    -250    -271    ...

133    -232    -408    133    -235    -319    ...

136    -240    -388    129    -238    -361    ...

142    -240    -378    143    -240    -354    ...

139    -238    -375    137    -244    -374    ...

so there is one readout without any samples, followed by three readouts with implausible data.

This behaviour always occurs for the first readout when I connect, then afterwards it occurs sporadically.

Can you tell me where this could come from?

thanks, best regards

Christian

#lsm6ds3 #sensor #accelerometer
1 REPLY 1
Petr S
ST Employee
Posted on April 05, 2017 at 16:36

Hello,

You can try following recommendations:

  1. do not read the data too fast, experiment with slowing it down just a little bit;
  2. it's not recommended to read the whole content of the FIFO, try leaving at least one sample or better the whole pattern in the FIFO and start next reading once the FIFO is almost full again;
  3. make sure you're aligned with the pattern while reading the data, I mean to make sure you really read AccX, AccY... GyrX... when you think you read it based on the pattern value (you can for example check the pattern value in the beginning of reading data and if it's not 0 read and discard the data in cycle until you get to the pattern 0, then start normal reading).

I hope it helps.

Best regards,

Petr