Skip to main content
Visitor II
April 7, 2021
Question

Trouble runing MotionGC_Update function.

  • April 7, 2021
  • 3 replies
  • 4736 views

Hi,

I've been trying to get the calibration values for my gyroscope using MotionGC library. I'm using the sample code available in the MotionGC starter guide but the said function return all the output values as 0. The bias_update variable is also set to 0, meaning that the sensor isn't stable, or so the guide says.

However, I'm being very careful to hold the sensor at a given position and not move it throughout the measurements.

What might be the cause of this issue?

Thanks in advance.

Kind regards,

Pedro Machado

    This topic has been closed for replies.

    3 replies

    ST Employee
    April 7, 2021

    Hi Pedro @Community member​ ,

    how are you keeping the sensor during the calibration?

    I mean, is it still on a surface or on some place that is susceptible to vibrations?

    moreover, are you able to read the right values from the sensor?

    Niccolò

    PMach.1Author
    Visitor II
    April 12, 2021

    Hi,

    The sensor is placed on top of a table, not sujected to any vibrations (at least not significant, I would dare to say). The accelerometer's Z axis is aligned with the vertical axis and the reading of this axis is around 980mg, which makes me believe the values are correct.

    ST Employee
    April 12, 2021

    Hi @Community member​ ,

    yes, the nominal value should be ok, but I would try to record some samples in a row and plot them to be sure that there are no actual vibrations ongoing.

    moreover, the gyro values are important too, can you confirm those?

    I'd like you to confirm you are following the user manual instructions, like initializing everything, for example using the function MotionGC_Initialize and calling MotionGC_SetCalParams right after that (I'm talking about page 4 of the user manual).

    Niccolò

    ST Employee
    April 8, 2021

    Hi Pedro,

    Also please verify that you pass your accelerometer and gyroscope sensor data to MotionGC library in correct units. You can use functional middleware applications in very latest version of X-CUBE-MEMS1 package v8.3.0 released about a week ago as reference if not done already. If you use different HW than the ones the sample applications are written for, you can also generate the GyroscopeCalibration application using latest STM32CubeMX tool.

    Regards,

    Petr

    PMach.1Author
    Visitor II
    April 12, 2021

    Hi,

    There are no sample applications for the sensor I am testing (LSM9DS1), that's why I am using only the MotionGC middleware and feeding it the "manually" read values. In fact, I just noticed that the units were incorrect. I already corrected them to g and dps. However, it still returns 0 for every axis.

    ST Employee
    April 12, 2021

    I still recommend to follow ALL the steps and settings performed in the IKS01A2 resp. IKS01A3 Gyroscope Calibration sample applications in X-CUBE-MEMS1 package since in principle the LSM6DSL resp. LSM6DSO Acc&Gyr combo sensors are similar to your LSM9DS1 Acc&Gyr&Mag combo sensor in terms of basic task like getting values. I still expect the main issue in the flow, mainly library initialization, data feed, ODR, TimeStamp, whatever detail that is too different than in mentioned examples.

    PMach.1Author
    Visitor II
    April 19, 2021

    I just remembered that there were some minor changes I had to make to the example available in the MotionGC user manual (UM2181) in order to compile it. Apparently, the arguments for some functions are indeed pointers to the variables, instead the variables themselves, as it is in the user manual, which indicates that there were changes in the libraries that were not updated to this manual. The function MotionGC_SetFrequency is a good example.

    Because of this, I'm afraid that there might be something else missing in the manual that results in this issue. Is there an updated version?