Mateusz

  • *
  • 791
Re: AuxMag won't get a decent orientation
« Reply #30 on: March 21, 2017, 08:36:44 am »
What rotations do you put in ? Scopes will only agree when all  rotations are correct and neither of Mags is saturated by some stronger magnetic field nearby.
You need both conditions simultaneously, good rotations and no magnetic interference.

You have quite a few options, but I guess you thought about them already
  • Do calibration outside of frame just to determine correct rotations
  • Do calibration outside of frame with small HM5883L chip (L883 symbol) if you have one at hand and can place it same way as is on GPS just to determine correct AuxMag rotations
  • Use FC or mobile phone app to determine source of magnetic interference
  • Mount FC in different place

You don't need internal Mag for flight, the only time you need it is to determine correct rotations for the AuxMag. If AuxMag rotations are wrong, then measurement might be pointing in completely another direction then it should be. One way or the other, you just need to get these rotations right, whole thing does not need to be even mounted in frame but must only be oriented the same way. Once you have values correct, you can put that back in and calibrate AuxMag, set it to "Use Aux Only" and keep fingers crossed that external one is not affected by strong magnetic field source.

Companies such as DJI have magnetometer in Phantom installed in landing gear http://wiki.dji.com/en/index.php/Phantom-Mount_the_Landing_Gear_with_the_Compass_Module
This is also to avoid magnetic interference from power distribution board and motors. Anything that performs switching of current, generates magnetic field, same with power lines and of course magnets often used in buzzers.

You need to experiment a bit. Maybe someone else can help more...

Re: AuxMag won't get a decent orientation
« Reply #31 on: March 21, 2017, 09:05:49 am »
All the Pixhawk I2C Aux mags should use either 180,0,180 for board rotation or 0,180,0 (they are the same 3D rotation) if the GPS/mag is mounted normally.  At least all the ones I have tested use this.

Board rotation does not affect the health of the mag, but if rotation is wrong, the PFD / HUD will go crazy in INS13 (Outdoor) mode.

By the way you should be using INS13 (Outdoor) mode.  I assume from the posts I read that you have a Revo class FC.

https://librepilot.atlassian.net/wiki/display/LPDOC/Aux+Mag+Setup+and+Calibration

Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #32 on: March 22, 2017, 05:29:41 am »
What rotations do you put in ? Scopes will only agree when all  rotations are correct and neither of Mags is saturated by some stronger magnetic field nearby.
You need both conditions simultaneously, good rotations and no magnetic interference.

You have quite a few options, but I guess you thought about them already
  • Do calibration outside of frame just to determine correct rotations
  • Do calibration outside of frame with small HM5883L chip (L883 symbol) if you have one at hand and can place it same way as is on GPS just to determine correct AuxMag rotations
  • Use FC or mobile phone app to determine source of magnetic interference
  • Mount FC in different place

You don't need internal Mag for flight, the only time you need it is to determine correct rotations for the AuxMag. If AuxMag rotations are wrong, then measurement might be pointing in completely another direction then it should be. One way or the other, you just need to get these rotations right, whole thing does not need to be even mounted in frame but must only be oriented the same way. Once you have values correct, you can put that back in and calibrate AuxMag, set it to "Use Aux Only" and keep fingers crossed that external one is not affected by strong magnetic field source.

Companies such as DJI have magnetometer in Phantom installed in landing gear http://wiki.dji.com/en/index.php/Phantom-Mount_the_Landing_Gear_with_the_Compass_Module
This is also to avoid magnetic interference from power distribution board and motors. Anything that performs switching of current, generates magnetic field, same with power lines and of course magnets often used in buzzers.

You need to experiment a bit. Maybe someone else can help more...

I've been putting 180,0,-90, but does it matter when I rotate the drone and the readings simply go nuts? I mean, are the error percentages on the Magnetometer tab directly linked to the rotations or they are independent of it? because if they are, they may be a really strong cause of the high error percentages I'm getting. I may try to take the FC out of the drone to see if it makes any difference calibrating, but I don't think I will be able to maintain this calibration, since none of the electric circuits will be involved and the tutorials always says that I should do it while the FC is on the drone.

I haven't got an HM5883L chip at hand :/. I could buy it, but it'd run me at least for 50 bucks in here, maybe more.

Well, I will take the FC out of the drone the next time I lay my hand on it and see what comes out of it. As I recall, that's how I managed to get good readings last time. I will try it soon and post the results. Thanks for the idea :).

All the Pixhawk I2C Aux mags should use either 180,0,180 for board rotation or 0,180,0 (they are the same 3D rotation) if the GPS/mag is mounted normally.  At least all the ones I have tested use this.

Board rotation does not affect the health of the mag, but if rotation is wrong, the PFD / HUD will go crazy in INS13 (Outdoor) mode.

By the way you should be using INS13 (Outdoor) mode.  I assume from the posts I read that you have a Revo class FC.

https://librepilot.atlassian.net/wiki/display/LPDOC/Aux+Mag+Setup+and+Calibration

Yeah, I do have a Revo FC and I've been using INS13 (Outdoor) mode. I've been on that page and read it already, but my problem is not the AuxMag, I've always managed to get good readings on that one. The problem is mainly on the onboard mag, which always gets bad readings, but thanks for the help anyways. As I said to Mateusz, I will take the FC out of the drone and try to calibrate the mag to see how it goes.

I will post results as soon as I get the calibration of the mag done outside of the drone.

Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #33 on: March 22, 2017, 06:29:46 am »
BEHOLD, FOR I HAVE GOT A PERFECT CALIBRATION.

Ok, so it seems that my frame may have some issues. I just took the FC and the AuxMag out of the drone and tried calibrating it. On my first try, I got 6% max error and the rotations just worked flawlessly with 180,0,-45. The board is simply behaving just like it should, as weird as it may seem. Well, my friends, we seem to have found that I have a magnetic issue on my frame, didn't we? Now, do you guys have any tips about how to solve it?

Thanks a lot!!! I'm really excited to know that the board and the AuxMag aren't broken :DD

@EDIT: ok, I just have disassembled every bit of my drone and found the cause of the problems: my gimbal simply has a HUGE magnetic field interference. As soon as I get it near my board, it just moves from 0.5% to 100% error in a heartbeat. Well, this is the cause. Do you guys have any idea on how I can solve it or if I need to ditch this gimbal? I have the Feiyutech's Mini 3D gimbal and a photo is attached for reference. It is a metal chassis with 3 DOF.

@EDIT2: I figured that if I increase the distance between the FC and the gimbal, the interference is non existent. If I put them at, like, 10cm apart, if just works fine. I will figure out a way to move them apart and will calibrate it again. I will get this done ASAP and will report as soon as I calibrate it!!! :D
« Last Edit: March 22, 2017, 08:01:05 am by Jacarebs »

Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #34 on: March 25, 2017, 05:34:51 pm »
Ok, so I've been waiting a couple days for some parts that I was going to replace on my drone, like its landing gear and such. Turns out that increasing the distance from the FC to the gimbal really did the trick :). I could get a nice calibration and now the mag is not a problem anymore!

Thanks a lot for the help, guys /o/

Do you guys have any ideas on what I could look up to improve from now on?