2024-01-16 01:45 AM
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 )
2024-01-18 11:35 PM
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)
2024-01-19 09:33 AM
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
2024-01-22 02:21 AM
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
2024-01-22 05:12 AM
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.
2024-01-22 05:39 AM
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
2024-01-22 05:52 AM
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.
2024-01-23 02:05 AM
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...
only Az shows a significant pattern...
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))
2024-01-23 02:08 AM