cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DS3 FIFO

L77d
Associate II

Hi,

I'm building a program to continuously get data from accelerometer LSM6DS3

I'm writing in Micropython under a PYboard v1.1 over its SPI (speed 525000kbits/s)

I want to log continuously log gyro and accelerometer to sd card

To debug, I have configured the LSM6DS3 to fill its FIFO at 26hz (Accel n Gyro are also set to 26hz (high performance))

So that I use interrupt INT1 to tell PYboard FIFO threshold (FIFO FTH) has reached a certain amount of data (516 or 1032 words) and then write those data onto the SDcard...

Here is what I can see when I plot Gyros and Accelerometers Datas.....

First LSM6DS3 is stand still on a plate, then I can see some kind of pattern on signals, this pattern is the exact period of FIFO FTH !!!! How can it be ???? (figure : FIFO FTH = 1032words of data, so 1032/6 = 172, spikes appears every 172 samples) We get the same with half FIFO FTH (516words, spikes appears every 86 samples )

L77d_0-1705396167612.png

 

 @Eleon BORLINI @Federica Bossi 

8 REPLIES 8
Federica Bossi
ST Employee

Hi @L77d ,

I'd like to ask you something to better understand the problem:

can you try to plot data without FIFO, to see if the problem is there?

then, check if the problem is in the sd writing or in the data from the sensor: I mean, try to plot the data directly (or even print the values in the terminal) while they are saved on sd card, so that you know for sure which part has the error.

also, is the spike the first sample of the batch written in the sdcard or is it the last one? (or maye neither)

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
L77d
Associate II

Hi,

At first sight, I have already take time to compare between data as they are printed in the terminal, and the data in file written on the sd card, and there is no difference.

I managed to use theINT1 pad configured on drdy flag to catch only Z axis of the accelerometer and it seems there is no more pattern, but that is not usefull for me to keep doing so....

The spikes you can see on previous picture is not the first data of the batch, the thirteenest as I remember

L77d
Associate II

I post you my configurations for both DRDY on INT1 and FTH on INT1

To be precise it is the complete map of LSM6DS3 registers

L77d_0-1705918840606.png

 

Federica Bossi
ST Employee

Hi @L77d ,

it seems that the problem is in the sensor itself, so the problem might be a real noise.

May I ask you if you are using some stepdown component on your board?

This may introduce a little vibration pattern when writing the sdcard due to a higher consumption in that time frame.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I am directly using the 3.3v from the PYboard V1.0

On the stevalMKI160V1, VDDIO is soldered to VDD

We also try to solve the problem soldering capacitor between VDD and GND on the accelerometer board and another one between VIN and GND on the PYboard but nothing as change

 

 

Federica Bossi
ST Employee

Hi @L77d ,

We think that there is a drop voltage close to our sensor related to sd card writing.

You could plot the voltage near our part and verify this.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi,

I have made a correction ...previously LSM6 was connected with usb link and had 5 volts on VDD !!

Correction is made and now 3.3v. I keep capacitor, 1µF between VDD and GND near LSM6 board and another one between VIN (5v from USB) and GND of the PYboard

The program using FTH on INT1 still show a pattern every FTH samples....(here every 86 samples FTH =0204h (516d) 516/6=86, SDCard write is done just after. Oscilloscope shows a 3.46-3.54 volts between LSM6 VDD and GND pins, with no variation

here is a global view...

L77d_1-1706003000173.png

only Az shows a significant pattern...

L77d_2-1706003112258.png

 

The other program using DRDY on INT1 does not show any pattern, SDCard writes are done every 520 samples (only Az is stored (from LSM6 registers 2Ch,2Dh))

L77d_0-1706002959225.png

 

 

Federica Bossi
ST Employee

Hi @L77d ,

As written in the datasheet the LSM6DS3 works from 1.71 V to 3.6 V, I think that 5V could have damaged the piece.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.