Skip to main content
Visitor II
July 7, 2021
Question

Always High vibration in Z axis IIS3DWB accelerometer

  • July 7, 2021
  • 5 replies
  • 6673 views

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.

    This topic has been closed for replies.

    5 replies

    ST Employee
    July 15, 2021

    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

    SMaju.1Author
    Visitor II
    July 16, 2021

    @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

    ST Employee
    July 16, 2021

    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.1Author
    Visitor II
    July 16, 2021

    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.

    ST Employee
    July 21, 2021

    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

    SMaju.1Author
    Visitor II
    July 23, 2021

    @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.

    ST Employee
    August 11, 2021

    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

    SMaju.1Author
    Visitor II
    August 11, 2021

    @Eleon BORLINI​ @Douglas MILLER​ 

    Thanks for reply

    1> yes both INT pins floating , I will try after connecting both to ground.

    2> I will try 10Mhz and let you know

    3> I have already set 26.6 odr but no difference check my reply one month ago

    4> already tried set bdu bit default but no improvment

    5> I will try FiFO but my processor already timed to take readings with fixed gap.

    6> vibration setup is always same while using my pcb and ST adaptor board.

    I tried vibrating at 700hz even 100hz which is under bandwidth range of both LIS3DH and IIS3dwb. Also my vibration setup vibrating in Y axis and LIS3DSH and Industrial vibration meter both showing same but not IIS3DWB.

    let me mention again

    1> I am getting correct acceleration in all 3 axis while no vibration

    2> I am getting correct acceleration in X and Y axis while vibrating , while shaker shaking in Y axis IIS3D also showing Y is more than x but problem is Z is much higher than both X and Y

    3> Even while Z axis vibrating more but its keeping 1g in the middle after offset adjust 0g in the middle so I don't think point 1,2,3,4,5 you mentioned will change anything.

    can you please test IIS3DWB yourself (if you have) while vibrating and send me its output in CSV format

    or can you please invite IIS3DWB developer team in this discussion.

    ST Employee
    August 12, 2021

    Hi @SMaju.1​ ,

    I can share some data regarding bandwidth measures via private message, where each point of the file is the RMS value for the specific frequency.

    As test bench for BW characterization, we use a shaker from Spektra and a laser vibrometer for closing the loop. The shaker is like the one here below:

    0693W00000D2FH8QAN.png 

    -Eleon

    Visitor II
    August 26, 2021

    Hi,

    Is the raw data read out of the IIS3DWB already vibration data, or do you have to have algorithm to convert the raw data to vibration (frequency and magnitude) information?

    Thanks

    SMaju.1Author
    Visitor II
    August 26, 2021

    hi @MT.6​ 

    no IIS3DWB is accelerometer and its raw output is acceleration( g force) over time and after integration those values you get velocity in time domain. for frequency and magnitude you need to apply FFT algorithm

    Visitor II
    October 11, 2021

    Hello,

    we are facing the same situation where Z-axis measurement are higher than the other two (X and Y), is there any update on this???

    Thank you

    ST Employee
    October 12, 2021

    Hi @trinitry​ ,

    Do you have the HP filter enabled? if so, can you disable it and check?

    -Eleon

    Visitor II
    October 13, 2021

    Hello @Eleon BORLINI​ 

    we are using the HSDataloging as it is, in the code i see the following init function

    static void IIS3DWB_Sensor_Init(void)
    {
     uint8_t reg0;
     uint16_t iis3dwb_wtm_level;
     
     iis3dwb_device_id_get( &iis3dwb_ctx_instance, (uint8_t *)&reg0);
     iis3dwb_reset_set(&iis3dwb_ctx_instance, 1);
     iis3dwb_read_reg(&iis3dwb_ctx_instance, IIS3DWB_CTRL1_XL, (uint8_t *)&reg0, 1);
     reg0 |= 0xA0;
     iis3dwb_write_reg(&iis3dwb_ctx_instance, IIS3DWB_CTRL1_XL, (uint8_t *)&reg0, 1);
     
     /* Calculation of watermark and samples per int*/
     iis3dwb_wtm_level = ((uint16_t)IIS3DWB_Init_Param.ODR[0] * (uint16_t)IIS3DWB_MAX_DRDY_PERIOD);
     if (iis3dwb_wtm_level > IIS3DWB_MAX_WTM_LEVEL)
     {
     iis3dwb_wtm_level = IIS3DWB_MAX_WTM_LEVEL;
     }
     else if (iis3dwb_wtm_level < IIS3DWB_MIN_WTM_LEVEL)
     {
     iis3dwb_wtm_level = IIS3DWB_MIN_WTM_LEVEL;
     }
     
     iis3dwb_samples_per_it = iis3dwb_wtm_level;
     
     /*Set fifo in continuous / stream mode*/
     iis3dwb_i2c_interface_set(&iis3dwb_ctx_instance, IIS3DWB_I2C_DISABLE);
     iis3dwb_fifo_mode_set(&iis3dwb_ctx_instance, IIS3DWB_STREAM_MODE);
     /*Set watermark*/
     iis3dwb_fifo_watermark_set(&iis3dwb_ctx_instance, iis3dwb_wtm_level);
     /*Data Ready pulse mode*/
     iis3dwb_data_ready_mode_set(&iis3dwb_ctx_instance, IIS3DWB_DRDY_PULSED);
     /*Set full scale*/
     if(IIS3DWB_Init_Param.FS[0] < 3.0f)
     iis3dwb_xl_full_scale_set(&iis3dwb_ctx_instance, IIS3DWB_2g);
     else if(IIS3DWB_Init_Param.FS[0] < 5.0f)
     iis3dwb_xl_full_scale_set(&iis3dwb_ctx_instance, IIS3DWB_4g);
     else if(IIS3DWB_Init_Param.FS[0] < 9.0f)
     iis3dwb_xl_full_scale_set(&iis3dwb_ctx_instance, IIS3DWB_8g);
     else if(IIS3DWB_Init_Param.FS[0] < 17.0f)
     iis3dwb_xl_full_scale_set(&iis3dwb_ctx_instance, IIS3DWB_16g);
     
     /*Set 2nd stage filter*/
     iis3dwb_xl_hp_path_on_out_set(&iis3dwb_ctx_instance,IIS3DWB_LP_6k3Hz);
     
     /* FIFO_WTM_IA routing on pin INT1 */
     iis3dwb_pin_int1_route_t pin_int1_route;
     *(uint8_t*)&(pin_int1_route) = 0;
     pin_int1_route.fifo_th = 1;
     iis3dwb_pin_int1_route_set(&iis3dwb_ctx_instance, &pin_int1_route);
     
     /*Enable writing to FIFO*/
     iis3dwb_fifo_xl_batch_set(&iis3dwb_ctx_instance, IIS3DWB_XL_BATCHED_AT_26k7Hz);
     
     HAL_NVIC_EnableIRQ(IIS3DWB_INT1_EXTI_IRQn);
    }

    as i can understand the HP filter is not enabled.

    As a side question, in this init function where it calculates the iis3dwb_wtm_level it uses the IIS3DWB_MAX_WTM_LEVEL set to 256, could you please elaborate on this calculations.

    Thank you for your support