Compass rotated 90°

Switched on my quad today and EKF went crazy, compass variance. Compass showed rotated 90°.
Rebooted and everything ok.
3.6 RC12 ChibiOS
Zubax GNSS compass
Since the all compass stuff is confusing me really don’t know wich one of the compasses went nuts, if the one internal or the zubax external.
Tried to replicate the problem but didn’t show up.

I guess there is something going on in the UAVCAN driver or something in the compass stack.

regards,

Corrado

Read the release notes for 3.6.0 . zubax is no good for now…

Read them carefully, problems are related to Nuttx it seems and show a totally different problem.

Corrado

Corrado,

Any chance you could get a log? best to set LOG_DISARMED = 1 and try and reproduce the problem.

I’ve seen the compass become rotated at 90degrees after startup with some older Here GPSs (which use UBlox) if the flight controller is unplugged and then plugged back in again within 6 seconds. It was a hardware issue (now resolved) and my understanding was that the power supplied was not coming up cleanly (to 3.3V or 5V).

Hello, tried to reproduce it but i couldn’t. It just didn’t happen again. Actually it never happened before either. Only once in hundreds of boots.

I have log_disarmed activated in case it happens again. Good thing is that it is so obvious when it happens with EKF going crazy on compass that is impossible to overlook it.

Corrado

1 Like

I’ve ran into similar problems of compasses becoming rotated, which I’m pretty sure is because of different generations of GPS hardware. I’d greatly appreciate an authoritative answer on which of the following GPS modules requires changing COMPASS_ORIENT.

  1. HERE GNSS with HMC5983
  2. HERE2 GNSS with ICM20948
  3. mRobotics Purple M8N with HMC5983
  4. mRobotics Purple M8N with LIS3MDL and IST8310
  5. mRobotics SAM-M8Q with LIS3MDL

Also, it seems that the mRobotics X2.1 autopilot needs a non-default AHRS_ORIENT. Is it true?

For the mRobotics X2.1, I think if the BRD_TYPE parameter is set to 20 (and the board is rebooted) the AHRS_ORIENT can be set back to the default of 0.

I can’t give an authoritative answer on the compass rotations but I think if using Copter-3.6 all the compass-orient parameters can be left at the default of zero… and during the compass calibration procedure, it detects the orientation of all compasses and if any external compasses appear to have the compass-orient set incorrectly, it fixes it. If internal compass orientation appears incorrect the compass-calibration procedure will fail.

Resolved by firmware or on newer hardwares?
I’d like to fix mine.

FYI
I have a Here from one of earlier batches and it has been randomly rotating 90° (3.5.4 on Cube).
I thought I damaged it somehow.

Pitt,

My understanding is that it’s a hardware issue that’s been fixed in later versions of the hardware. There may be a hardware solution but I’m a little unsure. I haven’t fixed my hardware but instead I’m just more careful to not unplug and plug it back in too quickly.

So if it does rotate again, just unplug and wait a bit then plug back in?

I’ll try that
:+1:

Yes, that’s what I’ve found. wait at least 6 seconds before plugging it in again and it should be OK.

For me, plug-and-unplug or a vehicle reboot, generally clears the mag issues. Anyway, my experience is that these occurrences only affect older GPS’s with Honeywell HMC mags. One of my 2 year old mRobotic M8N module’s compass can’t even be detected by the autopilot. Is it a hardware ageing issue?

Lmk if I’m required to reproduce this issue and post a log. Otherwise, I’d aprec8 any general advice on dealing with old mags.

@Hs293Go,

re the compass not being detected, I think it’s likely to be a hardware issue especially if you’re finding that swapping in an apparently identical GPS/compass does work. The only extra thing I’d check on the AP side is that:

  • the COMPASS_TYPEMASK parameter is set to 0. This parameter is used to allow the user to turn off specific drivers. Setting it to zero means that AP will search for all supported compasses.
  • that there are not more than 3 compasses already detected. so check the COMPASS_DEVID parmeters. if they all have numbers in them then it’s detecting 3 compasses and it won’t be able to find anymore. Maybe this compass you have conversely has too many compasses on it.

Anyway, I suspect it’s hardware and none of the above advice is relevant but thought I’d mention the possibilities.

1 Like