EKF, MMC5883, AK09915 Coherence

Hey @tony-white!

Yesterday we tested our ROV and DVL after calibrating the compass by the waterside, calibrating the gyroscope, and calibrating the DVL’s gyroscope. However, we were still getting EKF Bad messages. We struggled with a few things:

While calibrating the compass within BlueOS, we weren’t able to get the calibrations into the green calibration area. After trying to calibrate the compass in BlueOS multiple times, we decided to try calibrating it within QGC. This gave us one green and one almost green/yellow calibration.

After the compass calibration, we calibrated the gyroscope within BlueOS and also calibrated the DVL’s gyroscope.

Initial Results:

Position Hold worked seamlessly in the beginning. When we tried to navigate back to our launch point using the map, we surfaced about 5 meters away from our original launch point. This was already a big improvement compared to what we’d experienced before.

When we returned to our launch point, we decided to go back up the river to test Position Hold again, perform a small circular dive, and return to the launch point on the map. While heading back up the river, we got a “Bad EKF” message followed by a “Yaw realigned” message. We saw the QGC compass immediately jump to a different angle after the yaw realignment (which seems logical).

When we tried Position Hold again, it worked well for about a minute before the ROV started drifting sideways. We were monitoring the battery voltage and current and noticed that the thrusters weren’t responding to the sideways drift and weren’t pushing the ROV back to its intended position. When the drifting paused for a few seconds, we decided to return to our launch point on the map. This time, the ROV surfaced about 25 meters away from the launch point, and its front wasn’t pointing in the correct direction. This was probably caused by the yaw realignment messing with the compass angle.

Compass Observations Post-Dive:

After our dive, we opened the BlueOS Compass screen to monitor the compass inputs and noticed some strange data:

The EKF (which should estimate orientation using the MMC5883 and AK09915 data) showed a heading that was 180 degrees off from the actual compass values. At the time of the screenshot, the MMC5883 and AK09915 values seemed correct, but the EKF heading was completely wrong. Since we used the EKF heading in QGC to navigate, it’s no surprise we surfaced 25 meters away from our original launch point!

Questions:

  1. How do the compasses work together in the ROV?
    We also saw messages indicating that the ROV was switching between Compass 0 and Compass 1. Does this mean the system alternates between the MMC5883 and AK09915 as the primary compass source? If so, how does it decide when one compass is providing faulty data?
  2. How is the map position determined?
    Is the map position calculated using the DVL’s velocity data in combination with the ROV’s heading (based on EKF data from the MMC5883 and AK09915)? If this is the case, why isn’t the DVL’s yaw angle used as an additional heading input? The DVL A50 has a built-in AHRS, right?