Gps with Aux mag problem
« on: July 17, 2016, 08:34:53 pm »
Hi everyone, 

I'm just about ready to give up on this board due to endless hours of trying to get GPS navigation to work.  As the onboard mag is pretty useless I decided to hook up my Aux mag with neo 6 gps. I have ins13 set and I have run through the full calibration procedure numerous times but Mt quad appears to be rolling around all over the place in gcs.  The compass display also shows a constantly moving incorrect direction.  I've tried rotating the mag 180 as suggested in other post but still no luck.  I had high hopes for this board as it flies great without any gps connected but I wanted the benefits of gps as well.  Just seems like a huge headache to get this thing up and running.

Mateusz

  • *
  • 808
Re: Gps with Aux mag problem
« Reply #1 on: July 17, 2016, 11:12:53 pm »
External mag with anything besides OP GPS is supported only in development branch. Which means you must have build it yourself, make sure it's up to date and report version. Symptoms you describe from my experience are related to incorrectly aligned or rotated mag or some other problems with Mag in general (maybe user error). Post screens of mag wizard as well.

Wagsy

  • *
  • 87
    • Rotorpix
Re: Gps with Aux mag problem
« Reply #2 on: July 18, 2016, 10:57:13 am »
Yes on board Mag is no good, make sure you have it set for external mag not both or internal.
A good Mag cal is very important, you should get a green in the Ground Control Station.

I just set up my REVO in a Custom 400 frame with a GPS V9 on top.
Position hold and RTB and land all works.

I see the next version, when the boys release it, will allow us to use other GPS's with built in Mags.

Mateusz

  • *
  • 808
Re: Gps with Aux mag problem
« Reply #3 on: July 18, 2016, 02:42:44 pm »
From what I understand using Mag for all axes assures it works under all conditions. Using Mag for yaw axis only makes it easier to set up and would work for most cases but specific condition and location together would cause problems. So devs to my knowledge decided to use solution that always works but is harder to set up for beginners. This is because mag is also used for up-down orientation. It's either choice for devs to use all information and hope people will set up their builds correct, or discard sensor axis and work with something that is more likely to work out of the box but not always correct. There might be another fusion algo in future I heard giving less importance to one mag axis... For now only option is to get complete 3D mag set right.

Re: Gps with Aux mag problem
« Reply #4 on: July 18, 2016, 09:16:08 pm »
Thanks for the quick reply guys,  I've also tried setting the xyz axis to zero on the mag settings page as suggested in another post,  the roll ends up having to be 120 degrees though and when all at  zero the attitude gadget still looks like the quad is off bt around 45 degrees. I don't really know what else to do to be honest,  ice even tried erasing all settings  and loading the firmware again.
Any help would be hugely appreciated if anyone has any other ideas.  Thanks

Mateusz

  • *
  • 808

Re: Gps with Aux mag problem
« Reply #6 on: July 18, 2016, 10:03:30 pm »
Yes.  That is the full document.  In particular:
- mag must be mounted upright and with arrow pointing forward
- for APM/PixHawk I2C mag, you will probably have to make BoardRotation.Pitch=180 (Roll and Yaw zero)
(that is the same as Roll=180 Pitch=0 Yaw=180 which also works)

Be aware that there was a code mixup (corrected in 'next' a month or two ago) that required different BoardRotation.  I recommend that you run a recent 'next'.

Re: Gps with Aux mag problem
« Reply #7 on: July 18, 2016, 10:08:04 pm »
and mag and FC must both be mounted in the frame.  If you move one without moving the other the exact same amount, the firmware does not know which one to believe.

In GCS display, model flipping around and incorrect orientation is generally caused by incorrectly set BoardRotation.

Also be aware that if you have tilted motors (race tilt) then there are other adjustments necessary.  See the wiki article.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Gps with Aux mag problem
« Reply #8 on: July 18, 2016, 11:13:44 pm »
Using Next you can also use the 3 bars to check/find the correct orientation.
The onboard mag cannot be used most of the time for flight but while setup it can be used as reference.



Another simple solution is check the two mag traces and check if they are sync.
Windows menu > Edit gadget mode and select "Raw Magnetometers" for a scope.



Re: Gps with Aux mag problem
« Reply #9 on: July 19, 2016, 01:29:55 am »
Thanks a lot for all your help guys,  it's late here now so I will try all of the suggestions tomorrow and report back.  I'm interested in using the 'next'  code as you describe but I really don't have much experience in building code and I'm using a version which I found in the forums.  I know I am asking a lot  but would anyone happen to have the mentioned build for Windows where the rotation mixup was fixed?

Many thanks guys

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Gps with Aux mag problem
« Reply #10 on: July 19, 2016, 01:42:25 am »
The rotation mixup was only related to Sparky board if i'm not wrong.