cancel
Showing results for 
Search instead for 
Did you mean: 

Convert raw data of gyroscope in angle

Mkuma.4
Associate II

Hi,

I am using lsm6dsl sensor. I am getting data on out registers. How to convert that raw data into angle

1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

Hi @Mkuma.4​ ,

First, please note that the gyroscope output is an angular speed, i.e. it is measured in degree per second or in radiant per second.

So, if you want to get the angle value, you have to integrate your value in time, typically with a time base where dt = 1/ODR (the output data rate).

Second, the exact formula depends on the specific part number, especially on the sensitivity (and related Full Scale) and on the bit resolution. Taking for example the LSM6DSO IMU gyro, the can be found in the datasheet p.9 and the conversion formula from LSB to milli-dps in the FS=250dps case is the following one (lsm6dso_reg.c:(

float_t lsm6dso_from_fs250_to_mdps(int16_t lsb)
{
  return ((float_t)lsb) * 8.750f;
}

If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster. 

-Eleon

View solution in original post

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @Mkuma.4​ ,

First, please note that the gyroscope output is an angular speed, i.e. it is measured in degree per second or in radiant per second.

So, if you want to get the angle value, you have to integrate your value in time, typically with a time base where dt = 1/ODR (the output data rate).

Second, the exact formula depends on the specific part number, especially on the sensitivity (and related Full Scale) and on the bit resolution. Taking for example the LSM6DSO IMU gyro, the can be found in the datasheet p.9 and the conversion formula from LSB to milli-dps in the FS=250dps case is the following one (lsm6dso_reg.c:(

float_t lsm6dso_from_fs250_to_mdps(int16_t lsb)
{
  return ((float_t)lsb) * 8.750f;
}

If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster. 

-Eleon