Skip to content
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

Support high-resolution sampling on ICM4xxxx IMUs #25069

Merged
merged 6 commits into from
Oct 25, 2023

Conversation

andyp1per
Copy link
Collaborator

@andyp1per andyp1per commented Sep 21, 2023

ICM42688, IIM42652, ICM42670, ICM45686 support higher resolution gyro and accel data in the FIFO. This higher resolution is particularly useful on large range devices (ICM45686) and prevents the quantization that would otherwise occur with these devices.

High-resolution support is enabled via INS_HIRES_SAMPLE which is a mask that can be used in a similar way to INS_FAST_SAMPLE

This also fixes a bug with filter setup where we were relying on device ids that had not yet been set.

This work was sponsored by CubePIlot

@andyp1per
Copy link
Collaborator Author

Flown on my 5" quad no issues

@tridge
Copy link
Contributor

tridge commented Sep 24, 2023

@andyp1per I'd like a discuss a bit, particularly regarding testing on all the v3 variants, and if we need the parameter or should just always enable

Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few changes:

  • needs to be under an #if, enabled in hwdef.dat
  • needs careful testing on all supported IMUs
  • need to test with raw 32kHz fifo logging to ensure this is really a benefit, with logging of the raw 32bit signed number
  • we need to check if enabling high res changes gyro or accel offsets

andyp1per and others added 5 commits October 17, 2023 20:21
enable high-resolution support on all ICM4xxxx sensors
create INS_HIRES_SAMPLE mask
adjust high-resolution sampling for correct byte ordering and depth
correct high resolution scaling on 18bit ICM4xxxx IMUs
control highres via HAL_INS_HIGHRES_SAMPLE
we use the instance numbers during filter configuration to check if
fast sampling is enabled. We need to ensure these instance numbers
have been setup before the filtering functions get called
we need to rotate the data so that FFT displays match the configured
orientation
Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving to an enum class will help

@tridge tridge removed the DevCallEU label Oct 18, 2023
@tridge tridge merged commit 7ca2a4d into ArduPilot:master Oct 25, 2023
86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants