Skip to content

Magnetometer calibration script should be improved #14

@DavidEGrayson

Description

@DavidEGrayson

The current minimu9-ahrs-calibrator script (in minimu9-ahrs version 2.0.0) takes about 18 minutes to run and sometimes produces totally invalid calibrations (along with a warning), so there is room for improvement.

The reason that it produces invalid calibrations is that the way it assigns a score to a given calibration is to see how close the scaled sample readings are to the unit sphere. The closer the points are to the unit sphere, the better the score. Sometimes the optimization routine realizes that it can make some of the calibration numbers really large, effectively squeezing all the sample readings into a very small area that is very close to the unit sphere. As it makes the numbers larger, the score of the calibration approaches the perfect score where everything is exactly on the unit sphere.

I suspect that with the current scoring, we are hoping for the optimization algorithm to find a local maximum, but sometimes it looks a little further than we would want and finds unreasonable calibrations that actually score better.

Maybe we should explore the new type of calibration routine provided by @thesummer in issue #8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions