cancel
Showing results for 
Search instead for 
Did you mean: 

Always High vibration in Z axis IIS3DWB accelerometer

SMaju.1
Associate II

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.

0693W00000Bd1XXQAZ.jpg 

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 

0693W00000Bd1TVQAZ.jpg0693W00000Bd1UiQAJ.jpg 

0693W00000Bd1TuQAJ.jpg0693W00000Bd1UJQAZ.jpg0693W00000Bd1UsQAJ.jpg0693W00000Bd1VWQAZ.jpgIn fft view also all axis showing correct frequency but z axis is showing much higher amplitude

0693W00000Bd1WAQAZ.jpg0693W00000Bd1WeQAJ.jpgNow I am clueless what is wrong, is both IC faulty? or something wrong in settings

Thanks for reading any help appreciated.

24 REPLIES 24
Eleon BORLINI
ST Employee

Hi @SMaju.1​ ,

thank you for the detailed explanation of the issue.

I would ask you some questions to try to narrow down the issue:

  • Did you try to configure the 3 axis mode (enabling the bits in CTRL6_C (15h) named XL_AXIS_SEL[1:0] = xxb (11 = Z-axis);
  • Did you try to configure the BDU bit in CTRL3_C (12h) register? With this bit the output registers are not updated until MSB and LSB have been read) 
    • You wrote: >> Not using int pins, mcu controlling sampling speed 12.5 khz sampling speed and 6.3khz bandwidth: this means that the sampling frequency is less than double of the device bandwidth, so I'm concerned whether the signal can be properly reconstructed and, if there is some issue, aliases effects can rise --> could you try to increase the sampling speed from MCU side (even if you are shaking at 500kHz)? Note also that IIS3DWB ODR is fixed to 26.667kHz.
  • There could be also the possibility that the spikes you see are true: in the LIS3DSH case the maximum ODR speed is 1600 Hz, while in the IIS3DWB case you have a fixed, high rate of 26.667kHz, so it's possible that the spurious spikes are above 1600Hz, but can be detected by ODR speed of 26.667kHz.
  • The Z axis might have a higher offset than the X and Y ones: you can try with compensating the offset configuring the OFF_Z (12h) register.
  • You can try configuring lower than 16g Full Scale, such as 4g and 8g, and check the behaviour.

Let me please know whether some of these tests can solve or mitigate the issue.

-Eleon

@Eleon BORLINI​  Thanks a lot for your reply , I have tested as per you suggestion .your question answer below

Did you try to configure the 3 axis mode (enabling the bits in CTRL6_C (15h) named XL_AXIS_SEL[1:0] = xxb (11 = Z-axis);

     = yes only noise increased but z axis still deflecting high

Did you try to configure the BDU bit in CTRL3_C (12h) register? With this bit the output registers are not updated until MSB and LSB have been read) 

     = yes but nothing changed

You wrote: >> Not using int pins, mcu controlling sampling speed 12.5 khz sampling speed and 6.3khz bandwidth: this means that the sampling frequency is less than double of the device bandwidth, so I'm concerned whether the signal can be properly reconstructed and, if there is some issue, aliases effects can rise --> could you try to increase the sampling speed from MCU side (even if you are shaking at 500kHz)? Note also that IIS3DWB ODR is fixed to 26.667kHz.

    

  = datasheet mentioned that "Ultra-wide and flat frequency response range: from dc to 6 kHz (±3 dB point)" so I kept bandwidth on that limit. 

       I tried high sampling speed 26 Khz ( bandwidth of 13khz ) but results is same high z vibration, I am shaking at 500hz not 500khz btw 

There could be also the possibility that the spikes you see are true: in the LIS3DSH case the maximum ODR speed is 1600 Hz, while in the IIS3DWB case you have a fixed, high rate of 26.667kHz, so it's possible that the spurious spikes are above 1600Hz, but can be detected by ODR speed of 26.667kHz.

     = if you check fft images vibration is at 500 hz which is in range of both lis3dh and iis3dwb and there is no powerful spike after 1000 hz as captured by iis3dwb . if we just compare iis3dwb x axis and z axis z is much powerful than x at 500hz itself so we can ignore higher frequency spikes right?

please note i have checked changing orientation of axes if source z axis really having high vibration then after rotating iis3dwb 90 degree , x or y axis vibration should be increased right? but z axis always showing high sensitivity in what ever angle I connect to vibration source.

The Z axis might have a higher offset than the X and Y ones: you can try with compensating the offset configuring the OFF_Z (12h) register.

= I think offset is not issue here while z in parallel with earth (1g) while no vibration its showing 1g. if we apply vibration z axis defecting (up down) keep 1g range in middle. please check time vs g graph image. similarly after rotating 90 degree or any other degree offset also get changed but still Z axis showing high movement.

You can try configuring lower than 16g Full Scale, such as 4g and 8g, and check the behaviour.

= yes I tried 2g mode 4g mode but that did not solved the issue.

here comparison image of lis3dsh vs iis3dwb at same vibration source same orientation same location

0693W00000Czlv9QAB.jpg 

0693W00000CzlvEQAR.jpg 

waiting for you further help

Thank you @SMaju.1​ for the detailed analysis.

I'm wondering if it could be a failure related to the specific part... do you have the possibility to test another iis3dwb device, different from the two ones you already tested?

-Eleon

SMaju.1
Associate II

Thanks for quick reply @Eleon BORLINI​ 

I was also thinking the specific lot of IC having some fault. or may be while soldering manually high heat might damaged both IC ? though everything working fine except that z axis sensitivity and after seeing first IC issue I minimum heat possible on second IC

I am from India and to get two small ic it took almost two weeks and lots of amount as shipping from US and import duties handling charges etc.

can you help me by tracking that lot of IC I can share you order date details etc. Is manufacturing defect happens?

can you suggest me some ready pcb module with IIS3Dwb.

on different note if I use high sampling rate like 26.6khz FFT resolution also getting low (gap between two frequency going to be high example 500hz peak might appear 505 or 495hz ) . currently I am taking 2048 samples I can not increase that due limited storage memory and processing power, is there any other way to deal with that.

also in industrial vibration meter they shows 800 or 1600 line fft , but as per FFT processing rules sample number must be power of 2 like 512 , 1024 or 2048 , I have tried DFT but its super slow. I have searched lot but did not find how they are creating 800 line fft. can you please give me any clue.

Thanks again for your time. waiting for your reply.

Hi @SMaju.1​ ,

>> or may be while soldering manually high heat might damaged both IC?

It is a possibility, especially in case the heating is directional along a specific axis of the device, the Z axis in your case.

>> can you help me by tracking that lot of IC I can share you order date details etc. Is manufacturing defect happens?

For lot tracking, I suggest you to use the st.com contact page, that should be able to guide you better than me.

>> can you suggest me some ready pcb module with IIS3DWB.

Yes of course, I suggest you to use the STEVAL-MKI208V1K evaluation tool, that is designed precisely for minimizing the spurious vibrations of the setup. It is available for example in the ST eStore (LINK).

>> about FFT resolution

The decrease in resolution is normal if you acquire at 26kHz but you use only 2048 FFT points... If you cannot increase the number of FFT points, I would suggest you to try taking a power of 2 number of points from the time-domain data (or at least data that are temporal multiple of the frequency you are interested in) and use them for building the FFT. But are you seeing repeatable peaks in the FFT, even if you have not precisely the 800 or 1600 points?

Let me know whether this can help you, especially for the point related to the STEVAL.

-Eleon

@Eleon BORLINI​  thanks for reply

I have re ordered IIS3DWB IC and  STEVAL-MKI208V1K , i will revert once i receive those .

can you send me document case study or link about

1> how industrial vibration meter (https://buy.wilcoxon.com/mac800.html) converts acceleration values to velocity value, I want to achieve same result [ RMS Velocity ] using IIS3DWB .

2> why industrial vibration meter usees 800 line FFT not 1024 line

any hint will help thanks in advance.

Hi @SMaju.1​ ,

I don't know specifically that industrial meter, but please note that it is not compatible with the IIS3DWB.

In fact, the MAC800 is an analogic voltage to g converter, that can be interfaced with sensors like these ones from PCB Piezotronics, but not with (digital) MEMS sensors.

The usual setup converting the raw acceleration data coming from the STEVAL-MKI208V1K is the STEVAL-MKI109V3 board, that can be interfaced with almost all ST sensors except from microphones and time of flight.

In this last case, the conversion formula from LSB to physical units can be found in the IIS3DWB datasheet or on Github (in the case of FS = 2g):

float_t iis3dwb_from_fs2g_to_mg(int16_t lsb)
{
  return ((float_t)lsb * 0.061f);
}

-Eleon

@Eleon BORLINI​ @Douglas MILLER​ 

hi again, you misinterpret my question this time

1> I am not using IIS3DWB with industrial vibration meter rather I am trying to make a new vibration meter with IIS3DWB which can output (vibration velocity mm-s)

2> I know how to convert LSB to Acceleration ( g ) and please check top image z axis values are near 1g when stable.

now back to the main issue

I re ordered 2 new ICs from mouser electronics replaced old IC

after testing got same problematic result ( X axis , Y axis ok but z axis vibration amplitude is much higher than actual

I also ordered STEVAL-MKI208V1K as per you suggestion connected with my processor but got same problem

so as the IC is already soldered we can eliminate IC damaged during hot Air soldering

0693W00000D1m0hQAB.jpg 

0693W00000D1m1kQAB.jpg 

so let me summarize

1> its not calculation error ( lsb to g ) as 1g can be seen when no vibration

2> its not offset error ,connect to vibration source in any direction but z axis movement always high

3> hardware (IC) is ok

as per data sheet this ic is for industrial application purpose like vibration monitoring so is that applied in anywhere? by anyone? can i get some real life case study documents ? am I only one facing this issue ?

I think developers of this IC can answer

I do not know why st support is taking too long to response

Eleon BORLINI
ST Employee

Hi @SMaju.1​ ,

thank you for the update.

I have double-checked internally, and we have some more requests / suggestions for you to try (the two most important are underlined below):

  1. Which is the INT pin configuration in your setup? Are you leaving them floating? It is better to tie them to VddIO or to GND.
  2. Could you increase the SPI speed up to 10MHz?
  3. Can you work at an acquisition speed of 26.6kHz?
  4. Can you set the BDU bit as default?
  5. Can you try to acquire the data in FIFO mode (or at least synchronously)?
  6. Did you improved the vibration setup when you used the ST adapter board?

Maybe the LIS3DSH is more robust in some sense to generic configuration since the capabilities of the IIS3DWB are much higher.

-Eleon