Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #15 on: March 19, 2017, 09:16:51 pm »

Indeed this looks interesting. Can you change colors, so they're not the same as AuxMag for Mag ? To me it looks like AuxMag is constant on this plot.

Sure. Figure 1 shows the graph with different colors, see if that's better. The drone was facing right and I rotated it to face me. Note that the X and Y on the onboard mag are almost overlapping

Mateusz

  • *
  • 808
Re: AuxMag won't get a decent orientation
« Reply #16 on: March 19, 2017, 09:30:23 pm »
Sure. Figure 1 shows the graph with different colors, see if that's better. The drone was facing right and I rotated it to face me. Note that the X and Y on the onboard mag are almost overlapping

Stupid question :) Is this with Use Both, or just AuxMag ? ;)

Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #17 on: March 19, 2017, 09:33:28 pm »
Stupid question :) Is this with Use Both, or just AuxMag ? ;)

I just tried with both and they have the same behaviour. It doesn't seem to make a difference :/

Mateusz

  • *
  • 808
Re: AuxMag won't get a decent orientation
« Reply #18 on: March 19, 2017, 09:39:58 pm »
I just tried with both and they have the same behaviour. It doesn't seem to make a difference :/

If you disconnect external mag, and reboot board just to be sure. Does internal mag show any  behaviour ? If on-board Mag is broken then you can't use it to determin rotations, and you would need to use AuxOnly mag, and guess rotations somehow by looking at the chip... That would explain why you couldn't get bars to zero, as internal mag wasn't giving any read-outs and wasn't valid reference...

Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #19 on: March 19, 2017, 09:45:39 pm »
If you disconnect external mag, and reboot board just to be sure. Does internal mag show any  behaviour ? If on-board Mag is broken then you can't use it to determin rotations, and you would need to use AuxOnly mag, and guess rotations somehow by looking at the chip... That would explain why you couldn't get bars to zero, as internal mag wasn't giving any read-outs and wasn't valid reference...

Oh, I think that my onboard mag is dead, hahahaha. Just look at the attached image. Well, that really explains a lot on why I couldn't get the right rotations and everything. Hmm, does it means that I should ditch my FC and buy a new one?

f5soh

  • *****
  • 4572
    • LibrePilot
Re: AuxMag won't get a decent orientation
« Reply #20 on: March 19, 2017, 09:50:14 pm »
Please post your config file
File > Export UAV data


Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #21 on: March 19, 2017, 09:54:40 pm »
Please post your config file
File > Export UAV data

Right away.


f5soh

  • *****
  • 4572
    • LibrePilot
Re: AuxMag won't get a decent orientation
« Reply #22 on: March 19, 2017, 10:08:33 pm »
The onboard mag calibration number are really strange.
Be sure there is not magnetic device around in your frame, like buzzer.

Your Auxmag calibration looks fine, you can easily adjust the AuxMag orientation settings the fusion algorithm to INSIndoor and look at heading in PFD if matches the North for example. (with frame pointing North)

Roll=180 is fine, you just need to adjust the Yaw value for a matching heading.

Mateusz

  • *
  • 808
Re: AuxMag won't get a decent orientation
« Reply #23 on: March 19, 2017, 10:28:05 pm »
External Mag
Code: [Select]
<field name="mag_bias" values="-319.968201,181.037781,-30.0836201"/>

Internal Mag
Code: [Select]
<field name="mag_bias" values="-44.587059,5.03997326,6849.60059"/>

f5soh has a point, maybe something with very strong magnetic field nearby... and before you showed mag2.JPG that both mags showed some response, so it's unlikely internal one broke just now.

Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #24 on: March 19, 2017, 10:34:25 pm »
The onboard mag calibration number are really strange.
Be sure there is not magnetic device around in your frame, like buzzer.

Your Auxmag calibration looks fine, you can easily adjust the AuxMag orientation settings the fusion algorithm to INSIndoor and look at heading in PFD if matches the North for example.

Roll=180 is fine, you just need to adjust the Yaw value for a matching heading.

Well, I have a voltage reader on the leg of my drone that beeps when the voltage is too low; is this considered a buzzer? I had to set Roll=180 and Yaw=-90 to get the right heading. It points North just fine with that, is this ok?

External Mag
Code: [Select]
<field name="mag_bias" values="-319.968201,181.037781,-30.0836201"/>

Internal Mag
Code: [Select]
<field name="mag_bias" values="-44.587059,5.03997326,6849.60059"/>

f5soh has a point, maybe something with very strong magnetic field nearby... and before you showed mag2.JPG that both mags showed some response, so it's unlikely internal one broke just now.

Let's just hope that it is not broken! Hmm, the battery is, like, RIGHT UNDER the FC. Would that be a problem?
« Last Edit: March 19, 2017, 10:39:46 pm by Jacarebs »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: AuxMag won't get a decent orientation
« Reply #25 on: March 19, 2017, 10:45:10 pm »
yes, a Lipo saver has a buzzer and magnetic fields.

Your onboard Mag is saturated.

You can reset the onboard Mag calibratio, go to the UAVOBrowser:
Set all the RevoCalibration > mag_bias values to 0 and
RevoCalibration mag_transform to 1,0,0,0,1,0,0,0,1



Look the value on scope for MagSensor, if you see value above 500 you can assume there is some magnetic disturbance around.



Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #26 on: March 19, 2017, 10:58:41 pm »
yes, a Lipo saver has a buzzer and magnetic fields.

Your onboard Mag is saturated.

You can reset the onboard Mag calibratio, go to the UAVOBrowser:
Set all the RevoCalibration > mag_bias values to 0 and
RevoCalibration mag_transform to 1,0,0,0,1,0,0,0,1

Look the value on scope for MagSensor, if you see value above 500 you can assume there is some magnetic disturbance around.

Wow, nice. I did what you said and I just got these values when pointing it nearly to west.  The highest line is the y variable of the onboard mag. What could be the magnetic disturbance? I took off the buzzer and it is still the same. Keep in mind that the onboard mag is not calibrated, tho.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: AuxMag won't get a decent orientation
« Reply #27 on: March 19, 2017, 11:06:01 pm »
Redo calibration

No need to quote a post that's just above

Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #28 on: March 19, 2017, 11:10:37 pm »
It's kinda late in here, so I don't know if I will be able to calibrate it today, but I will get it done asap and post the results when I calibrate it.

Thanks a lot :).

PS: Oh. I was just quoting to make sure it was clear, hehe.

Jacarebs

  • *
  • 22
  • My drone will eventually get along with my mag
Re: AuxMag won't get a decent orientation
« Reply #29 on: March 21, 2017, 02:11:49 am »
Ok, I just did the calibration and almost everything seems fine, besides the fact that the X coordinate on the onboard mag seems tilted, but it working and that the Y coordinate on the onboard mag doesn't move. the Z coordinate seems fine and behaves like the one on the aux mag.

Well, I will try it again and post the results as I go.

@EDIT: on the second time, things went better, but still wrong.

@EDIT#2: Well, I spent nearly 3 hours trying to calibrate it. I have even used the LP app, alpha version, to try calibrating it and see if something comes up. In the end, the app just seems to introduce many more errors, so I just stuck with my laptop. I concluded that no matter how I calibrate it, and I tried many different forms, the onboard mag may get really good readings and a really low (like 2% or something) error percentage when it is facing one side, but as soon as I rotate it, it WILL begin to give absurdly wrong readings on the onboard mag. The AuxMag seems to suffer from it too, but to a no comparable lower extent.

Is there something I can do?
« Last Edit: March 21, 2017, 03:19:02 am by Jacarebs »