2021-07-07 01:23 AM
I have got 2 new IIS3Dwb IC from same lot , I made custom PCB for those, connected to shaker and getting acceleration values and showing it through my own developed application.
Problem: Z axis seems defecting /sensitive much higher than x and y axis irrespective of vibration direction orientation.
When no vibration present every axis values seems ok and showing 1g level of gravity.
Both ic s showing same issue
Tried magnet, glue mount but no improvement.
Tried different vibration source , different vibration frequency
Changing pcb orientation didn’t help.
Not using int pins, mcu controlling sampling speed 12.5 khz sampling speed and 6.3khz bandwidth with 16g sensitivity.
Using single axis mode, fifo disabled
Pcb layout below.
When no vibration getting 1g so I believe my g conversion math is ok.
Below is my code in arduino IDE ( not complete code pasted due to length)
//IIS3DWB
#define IIS3DWB_WHO_AM_I 0x0F // should be 0x7B
#define IIS3DWB_CTRL1_XL 0x10
#define IIS3DWB_CTRL3_C 0x12
#define IIS3DWB_CTRL4_C 0x13
#define IIS3DWB_CTRL5_C 0x14
#define IIS3DWB_CTRL6_C 0x15
#define IIS3DWB_CTRL7_C 0x16
#define IIS3DWB_CTRL8_XL 0x17
#define IIS3DWB_OUT_TEMP_L 0x20
#define IIS3DWB_OUT_TEMP_H 0x21
#define IIS3DWB_OUTX_L_XL 0x28
#define IIS3DWB_OUTX_H_XL 0x29
#define IIS3DWB_OUTY_L_XL 0x2A
#define IIS3DWB_OUTY_H_XL 0x2B
#define IIS3DWB_OUTZ_L_XL 0x2C
#define IIS3DWB_OUTZ_H_XL 0x2D
#define IIS3DWB_FIFO_CTRL4 0x0A
----then---
SPI.begin();
SPI.beginTransaction(SPISettings(5000000,MSBFIRST,SPI_MODE3));
writeRegister(IIS3DWB_CTRL1_XL,0x04); // power down and 16g mode
writeRegister(IIS3DWB_FIFO_CTRL4,0x00); // disable fifo
writeRegister(IIS3DWB_CTRL8_XL,0x00); // low pass 6.3khz
writeRegister(IIS3DWB_CTRL6_C,0x01); // single axis mode start with x
writeRegister(IIS3DWB_CTRL1_XL,0xA4); // power on again and 16g mode START WITH 16G
---------then -----
SPI.begin();
SPI.beginTransaction(SPISettings(5000000,MSBFIRST,SPI_MODE3));
writeRegister(IIS3DWB_CTRL1_XL,0x04); // power down and 16g mode
writeRegister(IIS3DWB_CTRL6_C,0x01); // single axis mode x axis
writeRegister(IIS3DWB_CTRL1_XL,0xA4); // power on again and 16g mode START WITH 16G
delay(50);
for(int j=0; j<2048; j++){ ///////loop
////TURN ON ACC
//
memset(rawData, 0, sizeof(rawData)); // reset
readBytes(IIS3DWB_OUTX_L_XL, 6, &rawData[0]); // Read the 6 raw accel data registers into data array
x = (int16_t)(((int16_t)rawData[1] << 8) | rawData[0]) ; // Turn the MSB and LSB into a signed 16-bit value
// make a string for assembling the data to log:
accvalue[j] = x;
}
SPI.end();
------then smilarly for y and z-----
SPI.begin();
SPI.beginTransaction(SPISettings(5000000,MSBFIRST,SPI_MODE3));
writeRegister(IIS3DWB_CTRL1_XL,0x04); // power down and 16g mode
writeRegister(IIS3DWB_CTRL6_C,0x03); // single axis mode z axis
writeRegister(IIS3DWB_CTRL1_XL,0xA4); // power on again and 16g mode START WITH 16G
delay(50);
for(int j=0; j<2048; j++){ ///////loop
memset(rawData, 0, sizeof(rawData)); // reset
readBytes(IIS3DWB_OUTX_L_XL, 6, &rawData[0]); // Read the 6 raw accel data registers into data array
z = (int16_t)(((int16_t)rawData[5] << 8) | rawData[4]) ;
prevCycle = startCycle+6350;
delay(10); /// sampaling timing controll
// make a string for assembling the data to log:
accvalue[j] = z;
}
currentMillis =micros()-bMillis;
accvalue[2050] =currentMillis;
////TURN OFf acc
//SPI.end();
-----------some more functions -----------
////// accelerometer access fuction
void readBytes(uint8_t reg, uint8_t count, uint8_t * dest)
{
digitalWrite(accspi, LOW);
SPI.transfer((reg & 0x7F) | 0x80);
SPI.transfer(dest, count);
digitalWrite(accspi, HIGH);
}
void writeRegister(char registerAddress, char value) {
digitalWrite(accspi, LOW);
SPI.transfer(registerAddress);
SPI.transfer(value);
digitalWrite(accspi, HIGH);
}
I compared IIS3dwb output with LIS3DSH output placing same place same orientation , when shaking at 500 hz lis3dsh showing y axis is having high g and its correct as shaker is shaking in Y axis. However IIS3dwb showing Z axis is sensing higher g values than y axis. Which is surely not true. To crosscheck I changed axis orientation against vibration orientation, but still z axis is sensing high g
In fft view also all axis showing correct frequency but z axis is showing much higher amplitude
Now I am clueless what is wrong, is both IC faulty? or something wrong in settings
Thanks for reading any help appreciated.
2021-10-29 07:01 AM
Hello Eleon,
i have set the acquisition in FIFO mode
iis3dwb_fifo_mode_set(&iis3dwb_ctx_instance, IIS3DWB_FIFO_MODE);
with the following plot
then i set the mode in Stream
iis3dwb_fifo_mode_set(&iis3dwb_ctx_instance, IIS3DWB_STREAM_MODE);
with the following plot
As you can see i still get high amplitude in Z although the movement is performed by hand along y-axis
waiting for your comments/thoughts
Thank you
2021-11-03 03:51 AM
Hi @trinitry ,
thank you for the details.
Maybe there is something wrong in cross axis of that batch of samples.
Or otherwise samples could have been damaged during the soldering process.
Did you also have the possibility to test the product on the STEVAL-MKI208V1K adapter?
-Eleon
2021-11-03 04:34 AM
Hello @Eleon BORLINI ,
I repeat the experiment with a new board (we are using the STWINKT1B) -
and the results moving the board along Y-axis (by hand) shown bellow
As you see the Z-axis (using a new board) has the same behaviour - it was noticed in other boards too.
If there is a damage during the soldering process, we need to discuss of how to proceed as we do have acquire a good number of those (around 50).
For your suggestion, using the STEVAL-MKI208V1K adapter,
we are already order (trying to get, maybe you could elaborate on this) a couple of those with additional IIS3DWB sensors to evaluate.
waiting for your soonest reply
Thank you
2021-11-03 09:56 AM
@trinitry @Eleon BORLINI
I don't think its a batch issue as yours batch and mine definitely not same , I believe developers knows this issue but not disclosing
if you expand all my previous post you can see I have already tested (image also there) STEVAL-MKI208V1K which is pre soldered so its definitely not soldering issue .
St support not taking the issue seriously , so after wasting lot of time and money after this ic I finally moved on to IIM42352 and placed it on same custom pcb as pin alignment are same. the problem is gone.
2021-11-04 04:53 AM
Hi @SMaju.1 , @trinitry ,
I understand your point.
From my visibility, we had no issues during the characterization of this device.
I have however directly involved the developers and the validation people now, and here below you can find their comments:
About the spikes at 16g, we think they are due to issues related to reading issue especially coming from the asynchronous communication at 12kHz. But the main issue for us is related to the mechanical fixing of the board: if you "glue" it to the edge in that way probably the board flaps heavily (and it's not even a small board).
You might try to repeat the test with vibration along Y axis but this time fixing the board in a flat position on the top of the shaker, and not cantilever-like.
As side note, we checked the post-solder offset and it actually tends to concentrate around 100mg, so the offset along Z is real. This can be however cancelled by configuring the USR offset registers.
By the way, is the board you used for the LIS3DSH as big as the IIS3DWB one?
-Eleon