-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于陀螺仪的校准 (About gyroscope calibration) #92
Comments
这里也给出校准后数据的图和没校准的数据图对比,同样是陀螺仪的Z轴在静止状态下的数据图: 校准后的图(数据集中在0) Google Translate: Here is also a comparison between the calibrated data and the uncalibrated data, which is also the data map of the Z-axis of the gyroscope in a static state: Plot after calibration (dataset at 0) 未校准的图(数据集中在-0.6) Google Translate: Uncalibrated plot (dataset at -0.6) |
Adding a link to issue #60 - where Ilia Baranov ( @ibaranov-cp ) was investigating Gyro Calibrated Data and Bias |
@PaulZC 非常高兴看到你的回复,我打算直接在这里上传我的代码文件压缩包。 我对你的代码库进行了轻微的改动,但是配置ICM20948的步骤以及参数我是严格按照你的例程的代码来的,在"test2\main\main.c"中你会发现有一个结构体,该结构体可以方便地配置ICM20948,该结构体的介绍如下: ICM20948Settings icmSettings = { 然后接下来就介绍一下如何获取数据的,我的工程通过中断触发来获取数据,中断触发时会进入"test2\components\ICM20948\UserIcm20948.c"的"icm20948_int1_task"函数,在该函数中获取数据的函数为"ICM20948_getAGMData" void ICM20948_getAGMData(mSensorData_t * sensorData, bool isAccDmp, bool isGyrDmp, bool isMagDmp, bool isGyrBias); 第一个参数为返回获取到的数据的指针。 "icm20948_int1_task"函数中的"KeySign"为按键按下信号,当按键按下时就会变为true,再按一下就会变回false。按下一次按键就会开始在串口中输出数据。 当你正常运行我的代码后,串口就会打印如下信息: I (368) QuickPrint: UART BAUD = 2000000 I (369) ICM20948: SPI actual clock = 4000000Hz Configuration complete! 如果有什么任何疑问可以再问我,祝你愉快! |
Google Translate: @PaulZC Very happy to see your reply, I plan to upload my code file zip directly here. I have made slight changes to your code base, but the steps and parameters for configuring ICM20948 are strictly in accordance with the code of your routine. In "test2\main\main.c" you will find a structure , the structure can easily configure the ICM20948, the introduction of the structure is as follows: ICM20948Settings icmSettings = { Then I will introduce how to obtain data. My project obtains data through interrupt triggering. When the interrupt is triggered, it will enter the "icm20948_int1_task" function of "test2\components\ICM20948\UserIcm20948.c", in which the data is obtained. The function is "ICM20948_getAGMData" void ICM20948_getAGMData(mSensorData_t * sensorData, bool isAccDmp, bool isGyrDmp, bool isMagDmp, bool isGyrBias); The first parameter is a pointer to return the obtained data. The "KeySign" in the "icm20948_int1_task" function is the key press signal. When the key is pressed, it will become true, and it will return to false when the key is pressed again. Pressing a key will start outputting data in the serial port. When you run my code normally, the serial port will print the following information: I (368) QuickPrint: UART BAUD = 2000000 I (369) ICM20948: SPI actual clock = 4000000Hz Configuration complete! If you have any questions, you can ask me again, I wish you a good day! |
Thank you @ou2356 ! Very best wishes, |
Subject of the issue
@PaulZC你好,首先非常感谢你贡献的代码,这边我想对前人提出的陀螺仪校准问题进行讨论。
Google Translate: Hello @PaulZC , first of all thank you very much for the code you contributed, here I want to discuss the problem of gyroscope calibration raised by the predecessors.
Your workbench
我在brawner的代码中看到了关于陀螺仪校准的内容,(https://github.com/isouriadakis/Arduino_ICM20948_DMP_Full-Function/blob/a13508d8145e003ea83190187047fb9dc247c6fc/ICM20948/Icm20948Setup.c#L625-L632) 他的代码中注释为满量程为2^20,且固定为2000dps,然后我对他进行了如下代码处理,效果还是不错的,可以实现一定的校准。也非常感谢@brawner的代码的辛勤付出。
Google Translate: I saw the content about gyroscope calibration in brawner 's code. His code is commented that the full scale is 2^20, and it is fixed at 2000dps, and then I processed him with the following code, the effect is still good, it can be achieved certain calibration. Also a big thanks to @brawner for the hard work on the code.
int16_t x, y, z;
int16_t gyrBias[3] = {0};
gyrBias[0] = data.Raw_Gyro.Data.BiasX >> (5 - dps2000 + icmSettings.gyr_fsr);
gyrBias[1] = data.Raw_Gyro.Data.BiasY >> (5 - dps2000 + icmSettings.gyr_fsr);
gyrBias[2] = data.Raw_Gyro.Data.BiasZ >> (5 - dps2000 + icmSettings.gyr_fsr);
x = data.Raw_Gyro.Data.X - gyrBias[0]; //校准后的数据
y = data.Raw_Gyro.Data.Y - gyrBias[1]; //校准后的数据
z = data.Raw_Gyro.Data.Z - gyrBias[2]; //校准后的数据
我想说的是data.Raw_Gyro.Data.BiasX,data.Raw_Gyro.Data.BiasY,data.Raw_Gyro.Data.BiasZ并不是僵尸数据,他们是真实有用的。
Google Translate: What I want to say is that data.Raw_Gyro.Data.BiasX, data.Raw_Gyro.Data.BiasY, data.Raw_Gyro.Data.BiasZ are not zombie data, they are real and useful.
我的配置代码如下:
// Enable any additional sensors / features
success &= (myICM.enableDMPSensor(INV_ICM20948_SENSOR_GYROSCOPE) == ICM_20948_Stat_Ok);
success &= (myICM.setDMPODRrate(DMP_ODR_Reg_Gyro, 0) == ICM_20948_Stat_Ok); // Set to the maximum
加速度和陀螺仪的输出速率都设置成了225Hz。
由于我并没有使用Arduino IDE来使用您的库代码,我对你的例程代码加入了自己的一些代码实现,所以我这里就不把代码全部贴出来了,以免让你混淆,如果你需要的话请随时告诉我,我很乐意共享它。
Google Translate: The accelerometer and gyroscope output rates are both set to 225Hz.
Since I didn't use the Arduino IDE to use your library code, I added some of my own code implementation to your routine code, so I won't post all the code here, so as not to confuse you, if you need it Please feel free to let me know, I'd love to share it.
The text was updated successfully, but these errors were encountered: