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

Added estimation of compass scale factor #12899

Merged
merged 7 commits into from Dec 3, 2019

Conversation

@tridge
Copy link
Contributor

tridge commented Nov 26, 2019

This adds new COMPASS_SCALE, COMPASS_SCALE2 and COMPASS_SCALE3 parameters, which give the sensor scaling factor. It is used to compensate for an incorrect scaling in a compass.
The 3D compass calibration process will set the correct value automatically, otherwise users can set the value to a known value for an existing compass.
If the scale factor is not set then the EKF will not use the WMM tables for field constraint

@tridge tridge requested a review from bugobliterator Nov 26, 2019
@WickedShell

This comment has been minimized.

Copy link
Contributor

WickedShell commented Nov 26, 2019

This needs as a minimum an opt in that makes requiring having a position a hard prerequisite for passing the calibration, and for actually arming the vehicle. From a commercial use case users need to be only using the vehicle with a single code path for how their compass calibrations are managed.

@tridge

This comment has been minimized.

Copy link
Contributor Author

tridge commented Nov 26, 2019

@WickedShell I've added a COMPASS_OPTIONS parameter as a bitmask, with one bit for requiring GPS lock for cal

@tridge tridge force-pushed the tridge:pr-compass-scaling branch from 3676479 to 64bd625 Dec 1, 2019
@tridge

This comment has been minimized.

Copy link
Contributor Author

tridge commented Dec 1, 2019

tested on a QAV250 copter, I found the calculated scale factor was consistent within about 2%

@rmackay9

This comment has been minimized.

Copy link
Contributor

rmackay9 commented Dec 2, 2019

I did a test of this branch vs master on my ancient IRIS and found that it came up with these values:

  • COMPASS_SCALE,1.064523
  • COMPASS_SCALE2,1.122877

Overall the magfield strength was larger for both compasses but also a bit more consistent with each other.

Facing West

compass1 before: 429 after: 459
compass2 before: 402 after:459

Nose Down (biggest change I could find in mag field length)

compass1 before: 452 after: 490
compass2 before: 410 after: 462

So I think this is an improvement

Here are some mag field lengths for a couple of orientations

facing west
I next checked the magfield and magfield2 values.

I found the length reported for each compass had increased.

tridge added 7 commits Nov 26, 2019
this adds new COMPASS_SCALE, COMPASS_SCALE2 and COMPASS_SCALE3
parameters, which give the sensor scaling factor. It is used to
compensate for an incorrect scaling in a compass.

The 3D compass calibration process will set the correct value
automatically, otherwise users can set the value to a known value for
an existing compass
this allows user to set that calibration requires GPS lock
added calibration scale factor
@tridge tridge force-pushed the tridge:pr-compass-scaling branch from 64bd625 to 6b1b40d Dec 2, 2019
@tridge tridge merged commit 303030c into ArduPilot:master Dec 3, 2019
4 checks passed
4 checks passed
ArduPilot.ardupilot #20191202.7 succeeded
Details
ArduPilot.ardupilot (Cygwin SITL build) Cygwin SITL build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Plane 4.0 Backports
  
Awaiting triage
Rover 4.0 backports
Awaiting triage
3 participants
You can’t perform that action at this time.