cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble runing MotionGC_Update function.

PMach.1
Senior

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

22 REPLIES 22

Hi Pedro,

I'm not sure if it's going to solve your problem but maybe you can try to follow the settings we use in Gyroscope Calibration sample application for LSM6DSO sensor:

knobs.AccThr = 0.008f

knobs.GyroThr = 0.15f

freq = sample_freq = ACC_ODR = GYR_ODR = 50

ACC_FS = 4

GYR_FS = 2000

Regards,

Petr

Hi, Petr,

Thanks for the suggestions.

The output data rate that you sugested is not available for the LSM9DS1, since it only works with the gyroscope turned off, as you can see below from the drivers:

0693W000008zlJdQAI.jpg 

I did set to 59.5Hz since it is the closest data rate available for both accelerometer and magnetometer. I set the remaining values to the ones you indicated. Still, the issue persists and I don't really think it is because of the data rate.

PMach.1
Senior

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?

I don't think it's related to ODR either. If you also tried the thresholds in knobs and full-scale I recommended and it didn't help, you can try to store about 10-20 seconds datalog file including timestamp and send to me. I'll try to replicate the calibration with your data on my side. Anyway if the bias_update variable is always 0 it seems your sensor is not stable enough, as you already stated. It would be nice if you would be able to try another sensor, some newer model like LSM6DSO or similar.

Hi, Petr,

I also tried on a different LSM9DS1 IMU to check if the previous was broken. The results were the same.

Unfortunately, I have no newer model available. Also, as I am testing in a custom designed board, I imagine it would be difficult to replace the IMU for a different model like the LSM6DSO because it should be unlikelly that the pins and eventually the PCB layout would match.

About the data logging: would you recommend a specific way to do it, or just the data (and which values)?

You can store it in some text way, for example in .csv file like in the attached example but it doesn't necessarily have to be exactly the same. This is the format I can easily open and test but I can somehow reformat the data you'll send. Thanks.

Hi, Petr,

Pelase, find attached the data log. Hope it is ok the way it is. Please let me know in case something's missing.

Many thanks

Unfortunately your datalog doesn't contain accelerometer data which are necesary for calibration too. Please update the datalog.

Hi, Petr,

You're right. Sorry. Please, check this new one.

0693W00000ANp3DQAT.png