Skip to main content
Visitor II
Sep 18, 2025 9:43 PM UTC
Question

strange problem with lsm6dsv320x HG accelerometer

Hi

We are testing out the lsm6dsv320x, which will be used on our new board.

The low G accelerometer is working fine, however the high G looks to be reporting wrong values.

If I use a simple calculation to computer the angles, the high G  is off by about 3-4 degrees

This is the formula i use to calculate the angles

 AccXangle = (math.atan2(ACCy,ACCz)*RAD_TO_DEG)
 AccYangle = (math.atan2(ACCz,ACCx)+M_PI)*RAD_TO_DEG

Below is an example of the results of both formulas when the sensor is horizontal. The last two columns are for the high G sensor.  you can see that it is different from the low G sensor. My expectation is that they should be reporting the same result.

ACCX_angleACCY_angle ACCX_HG_angleACCY_HG_angle
-0.06-0.20 -4.44-4.620
0.03-0.17 -3.67-4.120
0.03-0.23 -3.84-3.610
-0.03-0.17 -3.61-4.240
-0.03-0.17 -2.91-5.130
0.03-0.20 -3.50-4.240
0.00-0.20 -4.47-3.080
0.00-0.20 -3.05-5.680
0.03-0.20 -4.15-4.380
-0.03-0.20 -3.71-3.250
-0.03-0.20 -3.96-4.070
0.00-0.20 -2.97-4.880
0.00-0.23 -2.94-3.790
-0.03-0.17 -2.74-3.480
0.00-0.20 -3.70-3.760
0.00-0.20 -3.99-3.690
-0.03-0.23 -4.56-5.360
0.03-0.20 -2.46-3.690
0.03-0.23 -3.52-4.790
0.00-0.20 -3.15-4.010
0.00-0.17 -2.87-2.350
-0.03-0.20 -3.75-3.750

 

This is how we initialise  the sensor

 writeByte(LSM6DSV320X_ADDRESS,LSM6DSV320X_CTRL3, 0b01000000) # Block data update
 writeByte(LSM6DSV320X_ADDRESS,LSM6DSV320X_CTRL1, 0b00000101) # High performance mode, 60Hz
 writeByte(LSM6DSV320X_ADDRESS,LSM6DSV320X_CTRL1_XL_HG, 0b10011000) #Enable high G. 480Hz ODR 32G
 writeByte(LSM6DSV320X_ADDRESS,LSM6DSV320X_CTRL8, 0b00000011) # 16G
 writeByte(LSM6DSV320X_ADDRESS,LSM6DSV320X_CTRL2,0b00011010) #1.92KHz, high-accuracy ODR mode
 writeByte(LSM6DSV320X_ADDRESS,LSM6DSV320X_CTRL6, 0b00000100) # 2000dps

 

This topic has been closed for replies.

1 reply

Federica Bossi
ST Technical Moderator
Oct 1, 2025 12:40 PM UTC

Hi @richardp ,

The low-G and high-G accelerometers inside the LSM6DSV320X are separate sensing elements optimized for different ranges and sensitivities.

They have different offsets, scale factors, and noise characteristics that cause slight discrepancies in angle calculations.

I suggest you to use low G accelerometer for angle calculation.

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