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

Crt for bmi270 #8487

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Crt for bmi270 #8487

wants to merge 4 commits into from

Conversation

shota3527
Copy link
Contributor

@shota3527 shota3527 commented Oct 21, 2022

This pr is for reference only, do not merge

This pr performs Component ReTrimming Feature CRT (Fast, motionless SENS Error Compensation)(gyro scale factor calibration) on bmi270 gyro on startup of INAV.

Why it is needed

The internal scale factor of the bmi270 needs to be calibrated, on others gyros, it is often done in the manufacturing process.
Demonstration of gyro scale factor error
https://www.youtube.com/watch?v=hnNc33QCbM8

How to use

Non-volatile memory of the bmi270 only guarantees 10+ writing operations, proceed with caution.
some of the operation might unsafe at current state
After Flashing, Do not move the flight controller in the process.
Power up your FC and wait. Roughly 70s after startup, the calibration value will be stored in the Non-volatile memory of the bmi270.
When the process is finished, you can now connect to FC via the configurator to confirm that.
Disconnect the configurator and enter DFU mode, Then you can flash your FC with any firmware you like.

Notes

seems like manual calibration have better accuracy than this

@ledvinap
Copy link
Contributor

This should be implemented as CLI command. It's far too easy to start board multiple times and ruin NVM.
It's on INav maintainers if this is desired feature (It will then work for BF with reflash cycle)

@JulioCesarMatias
Copy link
Collaborator

well... In my opinion, I don't think we need it.

What we really need is to correct the OSR4 of the BMI270 so that the cutoff frequency of the LPF is reduced.

@DzikuVx
Copy link
Member

DzikuVx commented Oct 22, 2022

@shota3527 super happy that you took a look at it! You are our hero after pulling the new AHRS off.
I have a suggestion on this. Or actually 2 sugestions

  1. could you extract OCR4 to a separate PR
  2. code CRT as a CLI command as @ledvinap suggested? This indeed seems like something user should do manually, not during startup

Thanks in advance

@shota3527
Copy link
Contributor Author

shota3527 commented Oct 22, 2022

I will open a pr on hardware lpf settings separately
CRT requires 8KB config file included in the firmware, so it is better not to include it in the master branch. I opened this pr for the reference to develop a specialized tool to perform it.

After the CRT , the gyro scale factor on matekf411TE/bmi270 did improve but still worse than other gyros I own. And the manual adjuststed scale factor by change the scale in inav was better than the CRT result on my bmi270
I will open another pr to allow manual adjust the xyz scale factor by cli for all gyro, and see if it is needed or not.

@shota3527
Copy link
Contributor Author

#8495 hardware lpf fix
#8496 custom scale factor on gyro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants