External Compass

I am struggling to keep an accurate heading with the built in pixhawk 1 compass. I can see noticeable change in heading from running motors and I can calibrate it to zeroed out heading and it works great but after a short underwater mission I can see up to 30 degree error when sitting still pointing north again. I am thinking it best to get an external compass. Any recommendations on type and how to mount and water/pressure proof?

Hi @cmarq -
Are you using a non-standard configuration of a Blue ROV2? If you have any power wires passing over or close to the pixhawk, getting a usable calibration is nigh impossible as you’ve found. The ESCs and power bus are at the opposite end of the enclosure from the Pixhawk/Navigator for this reason in the past/current standard configuration.
If you were to plug this GPS intothe Pixhawk, or something like it, you’d me able to use its motion sensors to compliment the pixhawk’s, but I’m not sure where youd mount it. I’d try and put it in the same enclosure to keep the wiring simple, but it may be tough to do so and avoid the power circuitry that’s currently causing your issue.

Hi Anthony,

I am using revision 2 of the blueROV I believe. A change we made is to add a Jetson nano directly on the backside of the raspberry pi/pixhawk. I think the fathom Ethernet was there before.

Could the Jetson be pulling enough current to cause this issue? We can’t move it anywhere else in the enclosure, so that’ll be a problem

Hi @cmarq -
How are you powering the Jetson? Maybe you could reorient it or the pixhawk in a way that would reduce interference? A DVL may be another potential solution / performance booster!

The Jetson is powered by a 5VDC step down converter that runs alongside the side of the vehicle near the pixhawk. I also have a small fan that is running pressed up against the pixhawk/raspberry pi to cool the chip off since it was throttling. The fan should be pulling constant amps as it’s on constantly so that shouldn’t be it right?

We have a DVL already, so the velocity is good, but I cannot convert to NED for position tracking without decent yaw estimation

Hi @cmarq
Both the fan and the 5V power supply are likely what are causing you issues - the fan has a moving magnetic field inherently! I had thought the DVL had it’s own IMU, but if not moving those items will likely solve your issue.
If you put the fan in another part of the tube, it can still circulate air that should help your cpu throttling, especially if pointed at the aluminum end-cap at the rear of the enclosure.

Let me try moving the fan then. I assumed that if constant current was flowing then the EMF would be a hard iron effect essentially that could be offset with calibration. My calibrations are in the green area and things work well if the vehicle is sitting still afterwards. It’s after a pool test that it starts to move away. I did a test where the vehicle was stationary and I throttled the thrusters for a while to see any interference. I need to post process those and see if there is any.

Any ideas on how I could test if the fan is the main issue?

We do have a DVL, but it doesn’t have a magnetometer

I think moving the fan and the 5V power supply could both improve your situation! Both are likely tough to compensate for as they cause transient affects, and at close range can overwhelm the sensors themselves.
If you simply unplug and remove the fan, and are able to calibrate without issue, you should be able to judge the performance before things overheat. You may be able to add heatsinks to the Pi and not use the fan?
The Navigator autopilot comes with a heatsink that does a great job cooling the Pi 4 without needing a fan…

I will have to see if the calibration holds after removing the fan. The calibration works great with the fan, it just doesn’t stay good after some runs with the rov.

I added the fan when we still had the acrylic outer pressure vessel instead of aluminum which dissipates heat better now. So maybe I can get by without the fan

So after running some tests, I can report some conclusions

  1. I tested the small fan on and off for 60 second intervals and monitored the magnetometer readings. The result was an extremely small < 1 degree deviation in heading and when looking at the raw magnetometer readings as a vector, also a small deviation of less than 1 degree, so I do not think the fan is causing an issue
  2. I tested two cases for the Jetson Nano. First, I ran a stress test of all 4 CPU’s at 100% load for 60 seconds, then off and repeated twice. The result was about a 1 degree deviation in the heading and about the same in magnetometer readings. Although it is non-zero, I don’t believe it is responsible for my 20-30 degree constant offset after a trial. The second case was turning the jetson completely off versus on with normal load. This also produced about a 1 degree offset, so it was not significant enough for me to be concerned with.
  3. Finally, I tested the motors and it seems the front two motors can cause 10-15 degree deviation of heading/magnetometer raw readings when actuated. This is an issue for sure and I can deal with this using the existing framework, but it was not the cause of my constant offset after a trial

I am wondering if the issue could be that my pressure vessel is heating up over time and is causing my calibration to become invalid. I found this discussion Magnetometer thermal behavior test - Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink where the temperature affect on bias is detailed and it seems to be significant for some sensors. Any idea if this could be valid? I plan to test this today