Servers by jDrones

Manual compass offset tuning?

(Aaron Klugherz) #1

My rover is having compass issues. (PX4 + M8T + fake M8N)
I took it out into the wild for testing yesterday. I’ve added a fake M8N to my M8T, pretty much just for the external compass. Both GPS are getting 14+ satellites and GPS status of 4. My GPS heading is perfect when moving, but my compasses were off dramatically.
When I started, my compass heading was about 45 degrees right of (accurate) GPS heading. I tried calibration a few times (difficult on a 150# rover) and the problem got worse. Now it’s about 120 degrees right of actual heading.
I’ve done a lot of search on the topic, and found the helpful post by @TeknoMike on compass configuration. Unfortunately, with one compass enabled, tuning always fails. I have this significant deviation. With both enabled, they aren’t even close to the same heading, which causes an error.

Question: Can I just input a manual compass offset? Let the thing calibrate (incorrectly) and then just input a -Yaw offset? Once calibrated, the error is consistent.

(Kenny Trussell) #2

Have you tried the compass learning technique? It works well for me with my large mower. Prior to its introduction, I struggled just as you are. You can set a switch to enable it and then drive around in manual with lots of turns until the message appears that it is complete.

(Kenny Trussell) #3

The initial instructions are here: Testers needed for in-flight compass learning

But the code is built in to the recent versions of Ardurover, so you can set an option for a switch and perform the cal easily.

(Aaron Klugherz) #4

Edit: You beat me to it :slight_smile:

I haven’t! Thanks for the tip @ktrussell
I didn’t see that setting when I was working with the platform yesterday. Do you know off the top of your head what the parameter is called?

(Aaron Klugherz) #5

What are your thoughts with regard to multiple compasses? I get the impression that I should leave the internal PX4 compass disabled, and rely on the Chinese M8N.

(Kenny Trussell) #6

As far as I know there isn’t a specific parameter for the calibration routine. You set ch7 option (or another channel) to “Compass Learn” on the main tuning screen in Mission Planner. Then have the messages window open and flip the switch momentarily. You will see the message “Compass Learning Started.” After you drive around a minute or so in circles, you will see “Compass Learning Finished.” You will LIKE it!!!

I’ll reply to the other post in a bit.

(Aaron Klugherz) #7

Perfect. thanks, Kenny.
I’ll give it a shot in the near future.

(Kenny Trussell) #8

I have only been using Ardupilot (Rover) for about a year, so I do not claim to be a good one to answer. Perhaps others will jump in, but I do have a few observations that you can use to build your own opinion:

As far as multiple compasses, I would not think you would get much of an improvement. In my experience, the problem with compasses is not that the device itself is highly inaccurate. The problem is that the earth’s magnetic field is very weak and so any electromagnetic sources in the vicinity of the compass module will interfere and cause an offset. So, I think each compass would see the same interference. Perhaps if it is located away from the first, it would get a different reading, but which is correct? I think you would be better served trying to get one good external compass located where it will be less susceptible to interference, but that is a tall order.

Calibrating live, with the Compass Learn function, with the interference at its “normal” level is what I think is the best way to get a good reading. In the case of my mower, I have found a significant difference in compass reading with the mower blades turning versus not turning. I documented this in this video: https://www.youtube.com/watch?v=gBn3Eygo88o. So, if I am just running the mower in a tuning or practice mode without the blades running, I do a Compass Learn with the blades not running. If I am going to mow, I do it with the blades spinning.

Depending on your budget for your rover, what I think is the best way to get accurate heading is to use two of the new, great ZED-F9P RTK GPS units on your rover in a Moving Base setup. That should give spot-on accuracy. I plan to try that on my mower at some point. I am using an F9P on my rover now, with an F9P stationary base. I will add a second F9P on the rover for the compass function. ALTHOUGH, I must say that as long as I calibrate with the Compass Learn function, I get pretty good heading.

That’s my two cents, and it is worth every penny (and probably no more!)

1 Like
(Aaron Klugherz) #9

Thanks again, Kenny.
As I said in the previous post, your experience has been very helpful.

I agree that the F9P units are probably a better choice than the M8T that I bought. Cost is an issue, though, as this is just a stupid (and expensive already) attempt to mark some lines once a year. I’ve learned that I probably won’t be successful without quite a lot more effort and money. And that’s OK, it’s fun anyway! If nothing else, I’ll have a nice RC mower/snow plow or something my kids can mess around with.

I had pretty good results on Saturday with PID tuning. Even with the severe compass offset I was getting decent results. If I was mowing with a 50" deck with 12" overlap I would call it good. But I’m trying to shoot an 800’ straight line. Quite the challenge.
I’m hoping that guidance will be improved when the compass heading agrees with the GPS heading. I’ve got the M8T on the rover, and the state NTRIP network for RTK.

As an aside; How can I tell what my accuracy is? Is it GPS HDOP? And is that in decimal meters of accuracy? I have seen .4 or .3 HDOP numbers, but I have no idea how to tell if that’s raw GPS or what, if any, the NTRIP feed is contributing.

(Kenny Trussell) #10

I actually dont know how to tell the accuracy in Ardupilot and Mission Planner. I need to learn that also. You can connect to the GPS units I have with a computer via USB and run ucenter and get a horizontal and vertical accuracy estimate.

Maybe someone will help us both on your question.

(Aaron Klugherz) #11

Thanks, Kenny.

I’ll start another thread since this is off-topic.

1 Like