Discovering two RM3100 magnetometers on DroneCAN

I have what is hopefully a quick question on setting up a pair of DroneCAN external compasses on a large hexcopter (12kg or so) - Arducopter 4.4.0.

The autopilot on the hexcopter is an Orange Cube that lies in the middle of the carbon fiber frame, surrounded by other circuits (including two F9P GNSS receivers) and under the batteries, so it’s not to be trusted too much with the drone orientation (I do recall it being upset quite a few times in the past). To “fix” the problem I decided to add two external compasses (and pump them up in priority for EKF3).

I bought two RM3100 from Holybro:

as well as two Qio Tek (also RM3100):

We installed two of the Holybro RM3100 (DroneCAN) on to the frame and plugged one in CAN1 and one in CAN2. Initially (upon boot) I was unable to see any of the sensors, but after some head scratching and searching I found that I need to enable the CAN drivers (with CAN_Px_DRIVER parameter). After I enabled both CANs, one of the two magnetometers was discovered but the other one was not. I’m not sure why not and what to do to fix it. I’m not sure what the problem is - I suspect it’s the fact that both are from the same brand and respond to the same CAN ID? Is that the case?

After that I tried about 100 different things but none worked:

  • I checked that both magnetometers work (by swapping them one at a time, and each was able to be recognized), so none are dead
  • I tried to put both magnetometers on the same interface (CAN1) (didn’t work)
  • I tried to put them on the same and different drivers
  • I tried to reset the database (with CAN_Dx_UC_OPTION)

In pretty much all cases either one magnetometer is found on Bus 0 or on Bus 1 with device ID 124 (regardless of which of the two magnetometers were plugged in).

The only thing that seemed to work well for a brief moment was swapping one of the HolyBro magnetometer with a Qio Tek magnetometer (at which point I had two working magnetometers with device IDs 124 and 125), but going back to the two HolyBro magnetometers only showed one, and then trying later the Qio Tek again I was unable to replicate the success.

I think that I tried all combinations of reset or not, sensor 1 in CAN1, sensor 2 in CAN2 or both in the same, or CAN2, or reverse, single driver or more, etc. No success.

To make matters worse, sometimes the external magnetometer is discovered on “Bus 1” (which corresponds to CAN1 I guess, where it’s actually plugged in), and other times it’s on Bus 0 (which I don’t know to what corresponds if anything).

Any idea on what I can try to figure it out? I guess I don’t necessarily need two external magnetometers if all goes well, but I really want for the case whenp things do not go well: later in the field I found that my “working” external magnetometer is quite noisy (I think - I’m still looking at the data).

I tried to look at the documentation on the DroneCAN setup, but it has no details on the “discovery” process: it’s assumed that it “just works” (which I’m sure is wonderful when it happens :-).

Thanks for the help,
Mihai

I can understand your confusion well; I’ve struggled with some of the same questions before.

CAN_Dx_PROTOCOL is the driver you want to use; you can have one or multiple. (e.g. one Instance of DroneCAN, one Instance of KDECAN)

CAN_Px_DRIVER selects which driver to assign to this port. You can have all ports assigned to one driver instance (e.g. set them all to 1), or to different ones (set them differently). I think all DroneCAN drivers share the database, but I am unsure about that.

To connect two of the same DroneCAN devices, like the magnetometer from Holybro, you usually have to connect one of them, change the used ID in the device itself, and then connect the second one. In the compass, the parameter to change would be “CAN_NODE,” I think.

Two F9P? Why not moving baseline RTK?

Raphael, thank you for your reply - I think we’re getting “closer” to a solution, but I still do not understand something: when you say “change the used ID in the device itself”, what does that mean, and how to do it? I thought to connect to the device using something else (i.e., a bridge of some sort to a computer), but I’m not sure if such a thing exists or how to use it. If that can be done through the autopilot that would be great - is Mission Planner of help here? Do I get my fingers in the parameters? Thanks for the help.
Mihai

Oli,

we’ve been running moving base RTK for over a year now, and it works amazingly … 98% of the time. The problem is with the remaining 2% of the time when it fails and the drone is 1km away over a forest and decides that it has no idea how to go to the next waypoint or to RTL and has to LAND. That’s what prompted the purchase of the RM3100s. If I get them to work right I may still enable moving base as primary but I need the backup from the magnetometers.

1 Like

You can try to set COMPASS_PRIO1_ID; COMPASS_PRIO2_ID; COMPASS_PRIO3_ID to 0; and restart the flight control. It will re-obtain the compass id. When an id is written, the new compass id cannot be obtained. So it doesn’t recognize the new compass.

Here’s how to connect to the DroneCAN device.
https://ardupilot.org/planner/docs/mission-planner-initial-setup.html#dronecan-uavcan-slcan

Nowadays I prefer Mavlink-CAN1 (connect to the FC via Mavlink first, then click on the button in the MP screen)
When you click on “Menu” for the correct device, you can select “Parameters” and will get a parameter screen, where you can change the parameters in the DroneCAN device.

Sorry for not including that immediately.

Thanks a million! I didn’t know about SLCAN. I’ll try it out and report on success (or failure :slight_smile: )
Cheers,
Mihai

Oh, well. The second device had a bad connection - once that was fixed, both magnetometers were recognized. Onto the field to test stuff (after we twist the power cables).

1 Like