Motor Compass Correction

Raspberry Pi 4 - raspbian11
BlueOS V1.4.0-beta.17
ArduRover V4.5.7
FlightController Navigator
Vehicle type - Surface Boat

We are running into problems driving our boat as we are seeing compass interference when the motors go past a certain speed. We currently can’t physically feed analog voltage/current into the Nav Hat with our current hardware design.

How do we feed our own current/voltage into ardupilot using mavlink message 147?

What BlueOS parameters do we need to modify to ensure motor compensation when PMOT is enabled?

What value should BATT_MONITOR be set to?

Are there other parameters involved?

Hi @travisty -
Is there a reason you’re using such an old, non-stable version of BlueOS? You’d be best suited to update to 1.4.2 stable… especially given your non-standard installation of it on top of Raspian?

If you’re not able to measure current with the Navigator, then calibrating the compass from a log file with current data for motor compensation won’t work. The best solution would be to move the high-current wires farther away from the Navigator - the situation is difficult due to their location.

If that’s not an option, then @williangalvani or @EliotBR can advise the best message to send to the autopilot via Mavlink2Rest to log current data, however from what I’m able to find on the motor magnetic compensation, such measurements need to have very minimal latency when making it to the logs… I’m not sure if this will be achievable with this approach, so direct measurement via the Navigator, or modifying your wire routing is likely the best solution… Can the high power wires be twisted together to reduce their net magnetic field output?
Perhaps an external GPS/Compass could be used, as on the BlueBoat? The Navigator compass modules could be disabled in favor of using this external source…

Do you have recommended external compass and how would it be wired into the NavHat? We have a blueboat and I wasn’t aware it has an external compass.

Hi @travisty -
Every BlueBoat already has an external compass as a part of the GPS - you should see it in the list of devices under Magnetometer in Vehicle Setup / Configuration. It is this model, as linked on the BlueBoat product page technical reference.

Yes, I did find it or rather I asked one of our hardware guys and he showed where it is. We are going to explore adding an external compass. Thanks

Hi Travis -
Looking into your original enquiry, on sending current/voltage data. That mavlink message 147 is intended to inform the GCS of those values, not the autopilot. There is mention of a mavlink message for smart batteries that could be used to send this value, but it is marked as experimental and also is intended for low update rate - not what you need for motor compass compensation. The list of supported BATT_MONITOR parameters values does not include Mavlink. Maybe another method on this list would work for you?

An additional external compass should help things!