Compass "drift" and roll alignment

Hey guys!

We are having some trouble with our attitude indicators.

The compass is currently living its own life, drifting off whenever it feels like it. Sometimes it looks like it has been swapped out with the “seconds hand” of a clock. Not reliable, and without pattern.

The pitch/roll indicator seems to work “as it should”, but it is tilted (or rolled) 90deg ccw. Anyone know what can cause this? The electronics enclosure looks the same as yours does online, with the navigator “hanging” on a wall rather than laying on a floor.
We have thought about rolling the entire enclosure, but that would really mess up our camera view. Any software solutions? Using “roll 90” or “roll 270” in the “mounting rotation” (BlueOS–> Vehicle Setup–> Configure–>Compass) does not seem to work.

We calibrated the unit today. I am reading about some issues being caused by nearby metals or magnets during calibrations, so we will try recalibrating outdoors tomorrow.

Also wondering about this “fitness mGauss” indicator we got after calibrating.
Not quite sure what to do with this information, but it does not look good. See photo.

Any input is greatly appreciated, as we feel quite lost without our sense of direction.

-Erling Nilsen

Hi @Erlingns95 -
From context, I would guess you’re dealing with a BlueROV2? What revision is it? Does it use a Navigator or Pixhawk?

It seems you haven’t loaded the correct default parameters for the ROV, since the AHRS orientation is not properly set. It would also seem your compass calibration is poor, given the behavior you’re seeing. Performing the calibration again, outside if possible should help. You can also complete the Gyroscope calibration from within BlueOS via the vehicle setup menu, with the vehicle completely static on land and warmed up, and this may help the EKF stability considerably.

Have you modified the vehicle, and potentially routed any power wires close to the autopilot?

1 Like

Hey buddy, not surprised to see you here:P

We are working with a custom BlueROV2. Built using an original electronics enclosure, 5x T500 thrusters for mobility, and an extra T500 for some super secret stuff. 1 00% garage-built frame. I’d like to say R4, but cannot confirm 100%.

Using RPi4 under a Navigator.

You’re probably on the right track when mentioning default parameters, I really didn’t give that much thought.

We did not load any standard parameters, as our frame and build is not 100% fitting any of them.

No unnecessary cables near the Navigator, only the ones supplying it and leaving the AUX outputs.

Hi @Erlingns95 -
Loading the default parameters for the standard or heavy ROV, and then adjusting the frame type is your best bet. This will get a lot of the tuning values at least close to values that should work for your custom vehicle, and generally help with your setup process!

2 Likes

Not having the best of luck here. Tried what you suggested, but the calibrations are never “good”. Best we’ve gotten is 11 & 12mGauss (fitness), but the compass never stays stable.

I’ve got some photos of some automatic adjustments that might mess it up for us:


EKF3 is an internal compass, right?

The "in-flight yaw alignment seems to shoot the compass arrow in a close to random direction.
Is there a way to “not use” this compass? For example just using the AK09915?

Hi @Erlingns95 -
I would guess that your custom ROV is routing power wires far too close to the Navigator /
Pi. If it’s possible to share pictures, or generally adjust the routing, that may help!

It is possible to disable a compass, and re-order their priority - this is all done in BlueOS on the Vehicle Setup / Compass page. Calibrating your Gyro there, with the unit perfectly still & warmed up, is also a good idea for heading performance.

Nope, it’s a sensor fusion and state estimation algorithm - i.e. it takes in measurements from various different sensors, and tries to estimate as much as it can about the current state (position, orientation, and their dynamics) of the vehicle. Those state estimates are predicted at potentially higher frequencies (and with smoother variations) than the sensors are providing, and factor in the consistency between different sensors to estimate the health/uncertainty.

A warning about a ground mag anomaly means the compass is behaving inconsistently with the other vehicle sensors, which could be from a poor calibration, but generally indicates it is operating near some magnetic force that is overpowering the global earth magnetic field, so the compass readings are nonsensical. That could be from a large metallic structure near where you’re operating, but (as @tony-white suggested) is also commonly caused by having power or motor wires problematically close to the autopilot, or ferro-magnetic objects like batteries.

If need be it is possible to try to compensate for motor current effects, but it is preferable to keep sensors away from strong sources of electromagnetic noise wherever possible.