Compass Configuration with PixRacer

I’m using a Pixracer autopilot from mrobotics and also the mrobotics uGPS/compass unit. Arduplane 3.8.2 and Mission Planner 1.3.50.

The compass calibrates fine and everything works well - until I power up the motor. With the motor running Mission Planner reports that the EFK is failing (compass indicator turns yellow). At full power the EKF compass indicator goes red.

I moved the GPS/compass about 20 inches away out onto the wing, but I still get the condition. It must be that the ESC and associated wiring is directly below the Pixracer in the fuselage. The motor is about eight inches forward of the Pixracer.

Can you recommend any fixes for this problem?

Thanks,

Paul

Have you tried disabling the internal compasses, and relying solely on your external one?

Yes, configured only compass #2 as external.

An idea:
The system automatically designates each of the 3 compasses (1 external, 2 internal) as numbers #1, #2, and #3. My experience is that it designates the external compass as #1 if detected. Have you verified that #2 is in fact the external one?

If in fact #2 is not your external compass, that could explain your problems…

(a quick check is to detach the external compass from your airframe and rotate it by hand while leaving the airplane still. You should observe changes in Mag2 in the Status tab in Mission Planner, while Mag1 and Mag3 remain fairly unchanged)

hunt0r,

I think you are on to this problem. With compass #2 designated as the one external compass, actually turning the comas by hand does not change the heading seen in Mission Planner - so #2 may still be the internal compass.

However, I tried configuring compass #1 with the same results! #3 would not even respond at all.

Here’s a basic question: Do I need a separate cable for the compass part of the GPS unit? I am currently using only a single cable and the GPS works.

Thanks,

Paul

Unfortunately, I’m unfamiliar with your hardware.

I might still be able to help… could you send links to the relevant GPS and Pixracer documentation? Or if there’s no documentation, perhaps the link where you purchased them?

GPS/compass unit:
https://store.mrobotics.io/product-p/mro-ugps-samm8q-01.htm

Pixracer:

I tried another GPS/Compass unit and its compass also did not work. Here is the other GPS/compass that I tried unsuccessfully:

https://store.mrobotics.io/mRo-GPS-u-Blox-Neo-M8N-HMC5983-Compass-p/gps002-mr.htm

So I think it is something in the Pixracer/Arduplane setup.

I’ve never worked with a Pixracer, so I don’t know how much I can help.

An idea: each detected compass sets a COMPASS_DEV_ID parameter for all 3 compasses. I think 0 = not-detected. Those might give clues whether the compass is never detected, or is detected but not functioning correctly because of some configuration/parameter issue?

I’ve contacted the vendor; perhaps they will provide some tips.

Thanks hunt0r,

Paul

Hut0r,

Where exactly can you see the COMPASS_DEV_ID parameters while the system is running?

I did not see them among the items in the Mission Planner status screen.

Thanks,

Paul

Can you check the parameters using the “Full Parameter List” (or something similar) in the Config/Tuning tab of Mission Planner? You’ll have to be connected to your vehicle.

(sorry, I don’t have MP in front of me.)

Ok, those. Looking at them, there does not seem to be a way to disable the internal compass. Still hoping to sort it out with the vendor.

Thanks again,

Paul

Still trying to sort how to run with a single external compass; below is an excerpt of my configuration:

In the Mission Planner GUI I have:

Enable Compasses = checked
Primary Compass = 2
In the Compass #2 box I have both “Use This Compass” and “Externally Mounted” checked, and no rotation.

Excerpts of the compass section from the parameters file. I appears that both compass #1 and #2 may be active. Am I reading this correctly? If so, how can I turn off the internal compass(es)?

COMPASS_EXTERN2,1
COMPASS_EXTERN3,0
COMPASS_EXTERNAL,0
.
COMPASS_OFS_X,-82.35384
COMPASS_OFS_Y,57.9438
COMPASS_OFS_Z,-56.48816
COMPASS_OFS2_X,-172.7349
COMPASS_OFS2_Y,-342.9156
COMPASS_OFS2_Z,-194.0893
COMPASS_OFS3_X,0
COMPASS_OFS3_Y,0
COMPASS_OFS3_Z,0
.
COMPASS_ORIENT,0
COMPASS_ORIENT2,0
COMPASS_ORIENT3,0
.
COMPASS_PRIMARY,1
COMPASS_TYPEMASK,4096
.
COMPASS_USE,0
COMPASS_USE2,1
COMPASS_USE3,0

Thanks,

Paul

Also spent more time unsuccessfully after reading about compasses in Advanced Compass Configuration in the Docs. No joy yet.

I currently have this setup, but it doesn’t work. The heading is off by something between 90 and 180 degrees, and whenever I turn the plane I get the ERROR COMPASS VARIANCE ERROR.

New Pixracer, Arduplane 3.8.2, Mission Planner 1.3.50.

Any ideas? I’m watching a beautiful day pass me by because I have no working compass.

Thanks again,

Paul

I think the first thing to determine is whether or not your external compass is being correctly connected, detected, and then communicating with your system. Have you already verified this? If so, how?

If you don’t know how to do this, one idea: Post the values of your COMPASS_DEV_ID parameters, that might help us figure it out.

Configured the compasses again to the only settings in which they give sensible headings - compass #2 as primary. But the system still generates ERROR COMPASS VARIATION and COMPASS HEALTH alarms:

Here are excerpts from the parameters list:

and:

Note that I was able to take a flight and even run a small automated mission - during most of which the compass errors persisted, and during which I was ready to switch to manual mode if things went bad. Most interesting.

I see that your Dev ID’s are 460042 and 263178. Will you do a little test for me? Will you find the Dev ID’s with the external compass+GPS disconnected?

Follow these steps:

  1. disconnect from MP,
  2. disconnect your external GPS/compass from your Pixracer,
  3. re-boot your pixracer by un-powering and re-powering it, and then
  4. connect with MP

Whichever Dev ID is missing is your external one. If both Dev ID’s are there while the external is physically disconnected, I don’t think your external is being connected correctly, and we’ll need to figure out why.

Ok, with the GPS/compass unit disconnected we have this:

COMPASS_DEV_ID = 460042
COMPASS_DEV_ID2 = 263178

With the external GPS/compass connected, I get exactly the same compass IDs.

So your intuition is correct: The external compass is not being detected by the autopilot.

I’ll pass this on to mRobotics. Thanks again Hunt0r,

Paul

1 Like

Later I tried another compass known to work, and I got a third COMPASS_DEV_ID:

So the first compass I was using was not being seen by the autopilot.

Thanks for your help hunt0r,

Paul

1 Like