Skip to main content
Explorer
January 7, 2024
Solved

lsm6dsr sensor motion information

  • January 7, 2024
  • 3 replies
  • 3285 views

Hello everyone, I am working with the lsm6dsr sensor. How can I solve the position information or how much I move with this sensor? I am looking at projects with examples on github, but I could not find how to solve the directions, how much the sensor moves, etc. with this sensor. I would be glad if you can help.

    This topic has been closed for replies.
    Best answer by Federica Bossi

    Hi @burak_Guzeller ,

    A 9-axis IMU that I recommend you is LSM9DS1 that combines a 3D digital linear acceleration sensor, a 3D digital angular rate sensor, and a 3D digital magnetic sensor.

    Otherwise, if you want to use the LSM6DSR you have two choises:

    1) If you haven't done the board and the connections yet, you could connect both DSR and magnetometer to the microcontroller, take data from both, use MotionFX to calculate quaternions.

    2) If you have already connected only the LSM6DSR to the micro, you can connect the magnetomer in sensorhub to the LSM6DSR, so that through the LSM6DSR you read both the IMU itself and the mag, at that point in the fw you have the data of both and you can manage them with the MotionFX.

    3 replies

    Technical Moderator
    January 8, 2024

    Hi @burak_Guzeller ,

    What do you mean by "how much I move with this sensor"?

    What is your application?

    Let me know so that I can help you in the most appropriate way. Thanks!

    Explorer
    January 8, 2024

    My goal is to make position predictions using this sensor based on given latitude and longitude data. Can I observe the movement of an object using this sensor alone, or is a magnetometer necessary? I would appreciate it if you could provide information. I am using this GitHub link, but I am not sure about its accuracy: https://github.com/kriswiner/LSM9DS1/blob/master/quaternionFilters.ino. Thank you for providing information

    Technical Moderator
    January 9, 2024

    Hi @burak_Guzeller ,

    If you don't use a GPS, a magnetomer is needed to define the direction of the sensor at the starting point. Ideally, then you can proceed without the magnetometer.

    You could have a look at our MotionFX Library, here you can find the user manual.

    Explorer
    January 9, 2024

    A magnetometer is mandatory in the motionFx library, but how can I find the direction without a magnetometer? Is there any sample code etc.? Thank you.

    Technical Moderator
    January 9, 2024

    Hi @burak_Guzeller ,

    You always need a magnetomer or GPS at the beginning.

    You could also look at the design tips for dead reckoning.

    Technical Moderator
    January 10, 2024

    Hi @burak_Guzeller ,

    A 9-axis IMU that I recommend you is LSM9DS1 that combines a 3D digital linear acceleration sensor, a 3D digital angular rate sensor, and a 3D digital magnetic sensor.

    Otherwise, if you want to use the LSM6DSR you have two choises:

    1) If you haven't done the board and the connections yet, you could connect both DSR and magnetometer to the microcontroller, take data from both, use MotionFX to calculate quaternions.

    2) If you have already connected only the LSM6DSR to the micro, you can connect the magnetomer in sensorhub to the LSM6DSR, so that through the LSM6DSR you read both the IMU itself and the mag, at that point in the fw you have the data of both and you can manage them with the MotionFX.

    Explorer
    January 16, 2024

    Well, thank you very much, my last request from you is that since I do not have a magnetometer, my primary goal will be to calculate the displacement. I do not have much knowledge about which functions to use for this. Can you guide me for this? I want to calculate the displacement in the data coming from the sensor. For example, if I am to move 20 cm to the right. Or if I am going to move left, how can I use the algorithm or functions that calculate this? Which functions can I use? I would be grateful if you could guide me. Or is it an example github code etc. vr? Thank you very much.