Compass Orientation automatically set wrong

Hi!
@picoflug recently discovered here, that the auto orientation feature sets the compass orientation to a wrong value after compass calibration. I could reproduce his problem with a Neo V2 GNSS and a Pixhawk 2.1 cube with ArduCopter V4.0.3 heli. After the calibration and reboot, the compass orientation is set to Yaw270 although the external compass and the Pixhawk are aligned perfectly with the arrows pointing in the same direction. The heading of the aircraft-symbol on the map is correct and precise. I did not mix up the ticks for internal and external compasses. I checked that with the live plotting feature of MissionPlanner. I can’t be absolutely sure, that it isn’t a problem of the Neo V2. I haven’t used that in my other setups, but since @picoflug is experiencing the same problem with another system, it’s more likely a problem of the auto orientation feature. In flight (PosHold), Holger is experiencing severe effects of toilet bowling despite the heading on the map seems to be correct. I can’t confirm the toilet bowling, because I’m using another setup (with 3.6.8) in my helicopter. Does anyone have similar problems?

2 Likes

I have 3 of those GPS units. I could test on copter 4.0.3 and see what I find

Thank you very much, Dave. That would be great!

What exactly are the steps to reproduce? Is it just compass calibration, reboot and then fly?

Yes. Actually just a compass calibration and reboot would already be pretty interesting. If you have a wrong value for the compass orientation after that, it could be a problem in the code.

1 Like

Felix,
I received today a brand-new CUAV V5 nano with the CUAV NEO GPS V2. Mounted the FC on a block of wood for all the calibrations. After compass calibration I see the same yaw 270 which is wrong.
FW= 4.0.3. as a Hexacopter.
I was reading the discussion between you and Holger and that is the reason why I am not fiddling further until this has been sorted. Btw all my upgrades on the other 3 aircraft into FW 4.0.3 was perfect. But not this new setup with the new FC.

1 Like

Thank you very much for your feedback, Fred! Your observations are really interesting. So you’re seeing the same behavior as Holger and me. The confusing thing is: Why don’t you have the problem in your three other machines? I assume, you didn’t do a new compass calibration there? Maybe just upgrading is fine and the problem only occurs during the calibration process? Either way there is something not working correctly. Do you think, it’s caused by the Neo V2 GPS or have you also tried other compass units?

By the way: Have you checked the accelerometers of your new CUAV V5? I’d recommend to do that before you fly. I had two units (CUAV V5+) which weren’t behaving as expected. When I calibrated them level and then flipped them over 180 degrees, they had an error of about 5.3 degrees around the pitch axis. My Pixhawk 2.1 Cube never had that problem.

After loading the Hexacopter FW 4.0.3 I connected the GPS, a radio and a small 3S battery on the timber board. I did first the full accelerometer calibration and than the compass calibration. Both finished with success. But the yaw changed from none to yaw 270. That is all I did. I repeated that a few times, the same result.
This FC should replace an older Pixhawk 1 in my Hexacopter. But not anymore.
All 3 aircraft got all the upgrade to FW 4.0.3 No new calibrations after upgrade. I also tested all 3 = 1 Heli, 1 quadcopter and my new Hexacoter. All 3 are flying normally in all modes I am using.
The new CUAN V5 nano is on the shelf now until I find an answer to that problem with the yaw 270.

Guys, if you don’t want the software to automatically set the mag orientation then set COMPASS_AUTO_ROT to 0. You’ll probably find it set to 2.

The x-> y-> z-> markings on the mag chip don’t always agree with the arrow on the unit. Depends on how the mag chip was put in when the unit was assembled. I’d have to look at the code to see how it determines the orientation of the chip, but it’s probably based on the offsets.

So set the auto_rot feature to zero, calibrate and look at the offsets. Then try it with the way the software wants it done. You’ll probably find you have better offsets using the auto_rot.

If you want to make sure, take the unit apart and examine the x-> y-> z-> markings on the mag chip. It could be installed in the unit wrong, not agreeing with the arrow on the unit. Or the mag chip could’ve come in contact with a shipment of neo magnets during shipping and it needs to be degaussed.

Those magnetometers are not a “compass”. A compass only knows north and south poles. The magnetometer knows its orientation to the earth’s mag field, including roll or pitch. It could actually be used to replace a gyro to determine aircraft attitude if software was written for it. It is a very sensitive unit. Even a magnetic screwdriver can screw one up and cause it to need to be deguassed.

They are not easy to degauss. I’ve had them get screwed up before and tried it. I’ve had about 5% success rate in degaussing one. It’s easier to solder in a new mag chip if it gets accidentally screwed up on the bench by getting it too close to powerful magnets. A box of 1 x 2 x .5 N52’s at a distance of 1 foot will blow one all to hell and it will never work again. Don’t ask me how I know.

1 Like

Thank you for your detailed report, Fred. So it looks like it’s a problem with the Neo V2 module. I took the unit apart and saw what Chris already suspected. There is a Chip with a little arrow pointing in the 270 deg direction. Seems the problem is solved. I just was a little confused, because @picoflug said, he is experiencing severe toilet bowling effects with the helicopter where the unit is installed in. I thought that is coming from a wrong compass orientation. But since we all see the aircraft pointing in the correct direction on the map, and we found out, that the chip is just installed with a 90 degree offset in the GPS module, I don’t think that is the cause of Holgers problems.

Thank you, Chris for bringing to our attention, that the magnetometers can be damaged so easily. I didn’t know that. I’ve never seen a warning concerning this problem. For example I’m using a magnetic switch to power on and off the aircraft. And most of us are working with powerful electric motors with strong magnets inside. So we have to be careful when we’re installing, testing and storing all these things…

1 Like

Is this what you are referring to?

Yellow arrow points front

And this arrow points to 9 o’clock or 270 degrees (not sure is this is the magnetometers)

Yes, I was referring to the thing in your second picture. The large white block in your first picture is the GPS unit. I was also a bit confused, because the thing of your second picture is right underneath the holes in the cover where I suspected the buzzer. But it is the only thing I can find that looks like a magnetometer and since it’s pointing to 9 o’clock, it would explain our problems with the 270-degree offset. Maybe Chris can tell us if we’re right…?

I have that same gps chip on some of my smaller 5" inav quads, so I knew the white block was the GPS.

I should check my neo v2 pro can GPS as well

@Felix, you are correct. That’s why the auto compass orientation wants to set it to that. It’s not a problem. As long as the software “knows” what the orientation of that chip is it will do the rest in the software.

You could try to “force it” to the orientation of the marking on the case, but the offsets will be very large. So just leave it at 270 like the software wants, it has the least offsets there. It will work fine.

After calibration make sure your x and y components of the mag output agree with what hemisphere you are in. Northern hemisphere z should be positive value. Pitch the heli nose down, x should increase. Roll it right y should increase.

Southern hemisphere, z is negative. and x and y should decrease (opposite of the northern hemisphere) with pitch down and roll right.

If that all looks good and agrees after calibration of the unit, you are good to go.

1 Like

Felix,
look at the bottom of the photo where the Heli is hovering. You can clearly see that the CUAV NEO V2 is mounted on the tail with the front arrow to 3 a clock and you see the green lights at 9 a clock.
The cable entry is confusing. Or even the opposite. Surely not front arrow to the front.
This should be in the manual that the magnetometer is fitted not in the flight direction, IMO, (but yaw270).

Yes, you are right. Interesting observation. The compass is definitely not mounted with the arrow to the front there. But we don’t know, how the COMPASS_ORIENT parameter is adjusted there. He could have mounted it any way he liked… And yes, you’re right. The manufacturer should have added a little note, that the orientation is yaw 270. That would have prevented a lot of confusion. By the way: I received such a note with the Here GNSS that came with my first Pixhawk 2.1 Cube. The funny thing about it: The Here GNSS doesn’t have an offset. It’s working perfectly with the arrow to the front and compass orientation set to “none”.

1 Like

Doesn’t make any difference who made it. I had a HERE one in Sept '18 that it took me 2 hours of fiddling around with it to get it to calibrate. It was Yaw 270. That was before the auto compass orient thing was implemented.

Again, it does not make any difference what the orientation of the chip is in relation to the arrow on the case. That setting is basically obsolete after the auto orientation feature was implemented. Just let it do what it does and it will work fine.

All those mag chips calibrate with offsets. Even if it agrees with the arrow on the case. Never seen one with calibration offsets of zero.

I have mine doing the yaw 270 as well did the rot to 0 calibrated and its till doin the yaw 270, is there something i should change or is the yaw at 270 just fine for flying(still building the hex)

Just thinking out loud:
Power up the UAV NOT pointing north, connect to GCS and see if the HUD shows the true direction. Move the UAV around and see if the HUD follows correctly.