-
Notifications
You must be signed in to change notification settings - Fork 79
Gyro Calibrated Data and Bias #60
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
Comments
Hi Ilia (@ibaranov-cp ),
Issue #50 has more information about these. But these are the individual bias registers in DMP memory space - not bias data returned via the FIFO. The gyro biases do not actually get mentioned in the section about FIFO Output. The following are mentioned:
The Data Output Control Register bit flags do not mention the biases, so there is no way to request them explicitly. They are not mentioned in the Motion Event Control Register either. They are also not mentioned in the two DMP Header bytes, which precede the data in the FIFO. We only know they could be returned via the FIFO because they are mentioned in the InvenSense Nucleo example code (which ZaneL wrapped in his Teensy-ICM-20948 library). This line shows where they would be stored in the decoded FIFO data. This line adds GYRO_BIAS_DATA_SZ (SiZe) to the expected byte count. These two lines perform the data extraction from the FIFO packet. Our code does the same thing. Note that the bias data is appended to the raw gyro data, not the calibrated data. Another piece of weirdness is this. The InvenSense code suggests that the calibrated gyro data set is not supported as GYRO_CALIBR_SET is not mentioned in inv_icm20948_inv_decode_one_ivory_fifo_packet. In our code, we skip over the Gyro_Calibr data here. IIRC I confirmed that we needed to do this by requesting the calibrated gyro data and then checking that it was not actually returned in the FIFO data (even though the DMP_header_bitmap_Gyro_Calibr bit was set in the header!). Long story short - I think we are doing everything we can to try and get the gyro bias data to you. But the DMP seems to insist on returning zeros (just like in #50). If you find a solution, please let me know. Best wishes, |
Just to prove I'm not making up the part about the Gyro Calibr set not being supported... Here are the notes I took at the time. |
Thank you so much @PaulZC for diving into this detail. I don't know I have much to add, but I will take a deep dive myself and see if there is anything useful I can contribute. Not likely though, your explanation and details above make perfect sense :) |
Well something very interesting is going on. I added the just lines shown in #50, no other changes, to my FIFO data processing section:
I then shake/twist (very quickly) and tap the board on the table, and actually seem to get some data:
Perhaps by reading bias registers, we are setting some secret internal flag in the device?? |
It gets even wilder @PaulZC (again, I am unsure if this is a wild goose chase and I am just reading garbage...) I tried the above trick for gyro calibrated as well, uncommented the lines you pointed here: and got:
|
One more strange data point: I've now commented back out all my changes (both to the ICM_20948_C.c library, gyro_calibrated related items, and the reading the register change). I also completely pulled power from the board to ensure a clean slate. Now running just the Raw Gyro data as I did before, the IMU starts publishing bias data after ~20 seconds of sitting on the table:
And these values are not some static zombie register, after a few more minutes the values have changed:
And my code is now just (ignore the json part, that for my application)
|
Code now checked in, the example here is large since it contains a bunch of stuff you don't care about from my project, but it could be helpful: |
Hi Ilia (@ibaranov-cp ), |
Hi Ilia (@ibaranov-cp ), Please try version 1.2.6 of the library. I have made a small but important change which is needed to allow the DMP to work correctly. I will be interested to know if you are now able to record the bias data? Best wishes, |
Hello, My apologies for the slow response, I've tested with 1.2.7 and have gotten similar bias values that I did before from the raw gyro from Raw_Gyro.Data.BiasX, Raw_Gyro.Data.BiasY and Raw_Gyro.Data.BiasZ The Gyro Calibrated values are still not available, but from your earlier comments that does seem expected. I think we are good to close this issue |
Thank you Ilia (@ibaranov-cp ), |
Subject of the issue
Hello,
First off, awesome library, thank you very much! I'm integrating it into a project here:
https://github.com/Blueprint-Foundry/Shelly
Your workbench
Steps to reproduce
I edited the DMP_RawAccel example to get Raw Gyro data, so replacing where needed:
INV_ICM20948_SENSOR_RAW_GYROSCOPE
DMP_ODR_Reg_Gyro
DMP_header_bitmap_Gyro
etc.
I then read the XYZ values for gyro, and XYZ bias values instead of the original Accel values.
Expected behaviour
I should be able to read both gyro data and bias data
Actual behaviour
I only get gyro data, bias data is always 0.00. Example:
gyro: X:4.00 Y:14.00 Z:5.00 XB:0.00 YB:0.00 ZB:0.00
gyro: X:3.00 Y:5.00 Z:7.00 XB:0.00 YB:0.00 ZB:0.00
This all started in trying to use the calibrated Gyro field, however that never output data of any kind. Hence I though to use raw data + bias and make my own, but the bias is missing.
I assume there is some configuration step missing?
Request to you awesome folks: Perhaps an example .ino file for Gyro calibrated data and Raw data? :)
(note: all other functions I've tried so far work fine: Quat9, Accel, etc. So I think my chip is healthy since the Quat9 values seem sane.)
The text was updated successfully, but these errors were encountered: