Marico

  • **
  • 52
Auxmag axis z stays unchanged.
« on: July 13, 2021, 04:11:30 pm »
Hello,
I connected aux mag  (GY-271 module based on l883 chip), module is detected correctly but I noticed (system tab) that z axis won't change values at all. It stays at 4995 mGa. Other axis (x/y) change values when mag change position. Module fail or something wrong in config?

 
« Last Edit: July 13, 2021, 04:30:47 pm by Marico »

Re: Auxmag axis z stays unchanged.
« Reply #1 on: July 13, 2021, 07:52:25 pm »
Knowing that I2C is a serial protocol that comes straight out of the chip that way, my best guess is that the mag chip is bad.

When you look at the System tab, AuxMagSettings->mag_bias, are all values zero?  If so the mag is uncalibrated, so a "bad calibration" can be ruled out.  If not zero, you can set them to zero, single click on mag_bias to highlight it, and press the red up arrow button to set these back to zero.  Power off, on and retest.

If all zeros and problem still exists, I would:
- tap it fairly hard on the table in each of the 6 "cube face" directions
- degauss it.  At least touch the strongest magnet you have to each of the 6 cube face directions to see if that changes anything.  Rare earth airplane hatch cover magnet or magnet removed from a broken brushless motor, or the strongest refrigerator note magnet you have.
- retest to see if z axis is still maxed out.

There is a small chance that calibrating the mag will help.  But first I would try to tap and degauss that mag sensor.

One of several DJI Naza flight controllers I bought new had a mag sensor that was out of range and would not calibrate.  Degaussing it with mag field from the coil of a large soldering gun fixed it.  If you have a soldering gun (not iron) you can find the strongest field by pulling the trigger and holding something made of iron or steel close to it to feel for the AC vibration.

Once it is working, to get rid of residual magnetism, switch a degausser / AC magnet on, then bring it close, then far away, then switch it off.

Marico

  • **
  • 52
Re: Auxmag axis z stays unchanged.
« Reply #2 on: July 13, 2021, 09:13:02 pm »
When you look at the System tab, AuxMagSettings->mag_bias, are all values zero?

Yes.

If so the mag is uncalibrated, so a "bad calibration" can be ruled out.  If not zero, you can set them to zero, single click on mag_bias to highlight it, and press the red up arrow button to set these back to zero.  Power off, on and retest.

Is worth trying callibration when axis z still won't change even with close to strong neodymium magnet? I tried many time and z just stays with 4995 (x/y reacts for a magnet).

If all zeros and problem still exists, I would:
- tap it fairly hard on the table in each of the 6 "cube face" directions
- degauss it.  At least touch the strongest magnet you have to each of the 6 cube face directions to see if that changes anything.  Rare earth airplane hatch cover magnet or magnet removed from a broken brushless motor, or the strongest refrigerator note magnet you have.
- retest to see if z axis is still maxed out.

I tried degauss it with soldering iron and still maxed out. :(



Re: Auxmag axis z stays unchanged.
« Reply #3 on: July 14, 2021, 09:40:21 am »
I don't have much hope, but to degauss you need to use a soldering gun, not iron.  :)

Gun has a coil of wire that acts as part of a transformer.  Iron is just a resistive heater.

Marico

  • **
  • 52
Re: Auxmag axis z stays unchanged.
« Reply #4 on: July 14, 2021, 10:18:22 am »
I don't have much hope, but to degauss you need to use a soldering gun, not iron.  :)

Gun has a coil of wire that acts as part of a transformer.  Iron is just a resistive heater.

LOL, of course I meant a soldering gun not iron.  ;D

Marico

  • **
  • 52
Re: Auxmag axis z stays unchanged.
« Reply #5 on: July 14, 2021, 10:30:44 pm »
I replaced failed aux magnetometer and GPS too. I bought a GPS module with magnetometer (ublox m8n + HMC5883L). I extended tail a little bit to mount it away from the wires and voila! After calibration Aux error rate is below 2% with running  motors (!). Now all GPS related flight modes seems to work correctly.  I just made only one test flight before it got dark, can't wait to test it more.
 I think my GPS related problems were caused by too slow (previous)  gps module. There is no direct/clear info in howtos saying "don't use NMEA only based GPS for gps flight modes, is too slow). I think GCS GUI should display such warning when user select  nmea protocol with GPS related flight modes...

Re: Auxmag axis z stays unchanged.
« Reply #6 on: July 15, 2021, 08:49:27 am »
I guess I didn't know you were using NMEA.  I had tried that in the long ago past and got a slowly oscillating attitude while sitting motionless on the ground.  I recall that it is because EKF (INS13) needs velocity data to converge well.  Ublox protocol has velocity data, but NMEA does not.

NMEA is only useful for position on map, not for GPS flight modes.

Glad to hear you got it working.  :)