Skip to main content
Visitor II
July 19, 2017
Question

LSM6DS3 problem

  • July 19, 2017
  • 3 replies
  • 1030 views
Posted on July 19, 2017 at 05:24

Hi, i am working with LSM6DS3 sensor, this is the first time i work with type of sensor. i am trying to read out gyro z data, but it very noise when sensor is immobile.Here is my log:

-120

-93

-127

-69

-79

-41

-85

-97

-72

-57

-85

-108

-59

-42

-58

-56

-66

-91

-73

-81

-64

-107

-60

-48

-77

-96

-80

-68

-57

-75

-71

-56

-64

-68

and here is my config:

LSM6DS3_WriteReg(LSM6DS3_REGISTER_CTRL1_XL, 0x61);

LSM6DS3_WriteReg(LSM6DS3_REGISTER_CTRL2_G, 0x6c);

LSM6DS3_WriteReg(LSM6DS3_REGISTER_CTRL3_C, 0x44);

LSM6DS3_WriteReg(LSM6DS3_REGISTER_CTRL4_C, 0x02);

LSM6DS3_WriteReg(LSM6DS3_REGISTER_CTRL5_C, 0x00);

LSM6DS3_WriteReg(LSM6DS3_REGISTER_CTRL6_C, 0x00);

LSM6DS3_WriteReg(LSM6DS3_REGISTER_CTRL7_G, 0x40);

LSM6DS3_WriteReg(LSM6DS3_REGISTER_CTRL8_XL, 0x00);

LSM6DS3_WriteReg(LSM6DS3_REGISTER_CTRL9_XL, 0x38);

LSM6DS3_WriteReg(LSM6DS3_REGISTER_CTRL10_C, 0x38);

Someone can give me advice? Sory for my bad eglish.

#lsm6ds3
    This topic has been closed for replies.

    3 replies

    iceAuthor
    Visitor II
    July 19, 2017
    Posted on July 19, 2017 at 10:22

    I try to caculate angle but it was drifted. here is my code

    temp = LSM6DS3_ReadGyroZ();

    if (calibration < 200) {

    if (temp < GyroLowZ)

    GyroLowZ = temp;

    if (temp > GyroHighZ)

    GyroHighZ = temp;

    calibration++;

    } else {

    if (temp > GyroHighZ || temp < GyroLowZ) {

    AngleZc = (float) (temp * k * dt);

    } else {

    AngleZc = 0;

    }

    AngleZ += AngleZc;

    }

    with k=0.07(scale= 2000dps), dt=0.0025.I had used an 

    calibration  funtion with 200 times when start but it isnt effective.

    iceAuthor
    Visitor II
    July 21, 2017
    Posted on July 21, 2017 at 09:07

    someone help me please!!!!!

    Visitor II
    September 3, 2018

    did u found a solution for this issue? I have same problem.