calibrating the compass proves to be a real challenge. I now enabled my external compass module (HMC5883l) in the APM firmware and mounted it high up (20cm above the electronics) on a mast to minimize influences from the rovers body and electronics.
With the Navios internal compass I sometimes had offsets as high as +/- 300.
With the external module in the current position I get -15, 15, -48. Not bad, but the compass display in MP is really slow (over 30s for a 180° turn) and sometimes after a few circles, north and south are switched.
I thought, maybe it is something I am doing wrong, so I updated my APM2.5 copter (with 3DR external gps/compass) to version APM:copter 3.2.
I did the compass calibration in the same room/location as I did with the rover and the compass display is fast and accurate. I moved the copter in all directions, fast and slow and the compass was still spot on. Both tests/calibrations were done through 3dr radio connections, same settings.
(Ah, something new, now east and west are switched)
Ok, I will try to calibrate the compass outdoors and report back…
We’ve fixed incorrect orientation for compass on Navio, if you’d like to use it is required to recalibrate it. As for external compass - did you set the orientation for 3DR module?
There should be no difference with HMC on Navio and APM2.5.
I set compass orientation for the HMC to 0.
When did you fix the compass orientation problem? I last updated the apmrover elf a few days ago. Should I use navio or navio-experimental?
I just did a quick test outside.
First with the calibration I did indoors.
9 sats and the rover did one run down an paved farming road in guided mode quite well. On the return run in guided mode it took off in a completly random direction.
I did a calibration 15m away from my car with similar offsets as before. Again completly random driving.
Set compass learn to 1, drove up and down the road for 5min, but the heading displayed in Apmplanner did not get correct.
I then set compass-use to 0 and even then the heading did not follow the gps course.
I did not restart with each new setting, is this necessary?
I will update the apmrover elf as soon as I am home.
I have the 3DR gps/compass mounted on my quadcopter. I just used the whole copter to verify if there was something wrong in general with how I did the calibration.
On the rover I have a seperate HMC5883L module and I mounted it like I did, when I was using it with my pixhawk. X arrow to the front, y arrow to the left and z arrow up.
I think, I know why I missed the fixed compass problem. I updated the apmrover elf, but at the same time I changed from the AK8963 to the HMC5883l compass.
Yes, it is quite confusing. With the APM2.5/2.6 and the 3DR gps/comapss module, you have to set compass orientation roll 180° as the magnetometer chip is soldered to the underside of the GPS pcb. This is exactly what you said above, x stays the same, but y and z turn 180°. I used the HMC5883l module with my pixhawk, magnetometer chip and markings on top, compass orientation 0, and it worked.
One of you said the navio compass is handled as an external compass. I have the board rotated 180° yaw (AHRS orientation 4), servo connectors on the front. Is the compass rotated too in the firmware, or do I have to set it to 180° yaw with the compass_orient setting?
Anyway, I fear I will drop my rover, if I do another calibration today. The last try with updated apmrover elf did not work either, so I leave it be for now.
Compass in Navio is handled as internal and it is rotated to the board_orientation. So compass_orient stays zero. Can you try it again without the rover so that we can separate the problem? It should work when you rotate it in your hand, can you try that? If it does not there is clearly some config problem.
The NavEKF seems to have screwed up the GPS, too. I now have a fix with 8 sats indoors about 1 meter away from the window.
The rover icon on the map is moving much less than last time I tried it outdoors.
The rover icon sometimes jumped 50m away without the rover actually moving.
The rover is finally working in Auto/Guided/RTL modes. The NavEKF must have been the problem.
It is still not driving a straight line sometimes, but I did not further tune it yet.
It returned to the home point from different directions and distances (300m max) without a problem.
I also did some testing with guided mode and a simple rectangular auto mission, no problem.
No problem. Testing is fun. The rover was using the navios internal compass.
I tried to run onboard video recording with the raspicam, but the live video started to stutter. I then ran just the live video to get the testing done.
I will mount my GoPro to the rover, the next time I am letting it loose.
My post here adds quite a bit to this discussion. I’m still working on getting the external HMC5883L working on my quad, but for now using the Navio+ internal compass was the only way to get it working. Happy to share more info as it comes in.