Page 1 of 1

tricks for avoiding magnetometer interference ?

Posted: Mon Apr 09, 2012 6:18 pm
by wilco1967
Hi,

I wonder if anyone has some tricks to avoid the magnetometer (5883) from being affected by the current through the ESC wiring ?

On my tricopter, I have separated sensors (WM+, BMA-020, HS5883 & BP-085). Originally, the 5883 was badly affected when I run up the motors. But by moving the 5883 off the sensor board, and aprrox 5 cm up, away from the wiring, all was OK..... 8-) (it used to be approx 1 cm before)
So just a few cm extra distance quickly solved the problem.

However.
On my quad, I have a 9DOF board from Drotek.fr.... Brand really doesn't matter, and it's a very nice board. But as all sensors are mounted together, it is not possible to relocate the magnetometer.....
It sometimes completely reverses when I try to fly with Mag activated.... it's unusable like this.
On the quad, the 5883 is approx 3 cm away from the power conductors (its a flyduino Warthox quad frame, with integral power distribution).

I've tried adding some aluminium foil under the controller board to 'shield' the sensors from the power wiring below, but it made no difference (for sure no improvement, maybe it became even worse).... The foil was not electrically connected to anything (if that makes any difference).
Not sure if aluminium does anything to magnetic fields, and I might have better luck with steel / copper / whatever.

Are there any tricks that you guys have had succes with, which I could try, other than relocating the sensor ?

Thanks,
Wilco

Re: tricks for avoiding magnetometer interference ?

Posted: Mon Apr 09, 2012 10:07 pm
by Quadraf
Hi Wilco,

Twisting al power lines should help to minimise magnetic fields.

groeten Hans

Re: tricks for avoiding magnetometer interference ?

Posted: Tue Apr 10, 2012 7:24 pm
by KeesvR
I use my frame as ground, but I don't know if this is the reason why my mag is working without a problem.

You can make a circle of copper wire and connect this to ground, place this under your sensorboard, maybe its working.

Re: tricks for avoiding magnetometer interference ?

Posted: Tue Apr 10, 2012 8:37 pm
by mr.rc-cam
This fellow's video demonstrates how wiring layout impacts the mag sensor:
http://vimeo.com/29519728

- Thomas

Re: tricks for avoiding magnetometer interference ?

Posted: Wed Apr 11, 2012 8:14 am
by gompf-2
Hi Wilco

Not sure if aluminium does anything to magnetic fields, and I might have better luck with steel / copper / whatever.

No, alu doesn´t help here. You woud need MU-metal/permalloy.

Regards,
gompf

Re: tricks for avoiding magnetometer interference ?

Posted: Wed Apr 11, 2012 7:59 pm
by wilco1967
KeesvR wrote:I use my frame as ground, but I don't know if this is the reason why my mag is working without a problem.

You can make a circle of copper wire and connect this to ground, place this under your sensorboard, maybe its working.


Any idea of a proper size for that circle ?

I remember a project we did in the past to shield a control system from interference from a large 150kV, 60MW transformer, located directly under it (just the floor in between). They came up with a 4meter mesh (4 meters between two conductors....). First we didn't believe it would work, but it did....
Now that was to shield from 50Hz frequency.... but there's no frequency on the earth magnetic field (or perhaps 1 cycle/day ?).

Re: tricks for avoiding magnetometer interference ?

Posted: Wed Apr 11, 2012 8:52 pm
by gompf-2
Hi Wilco!

They came up with a 4meter mesh (4 meters between two conductors....). First we didn't believe it would work, but it did....

That´s an aktive Helmholtz compensation for stray fields, makes no sense as it induces a B field itself. If it´s a good system you can barely measure earth magnetic field inside because it´s compensated, too. I use them for SEMs/FIBs.

The most impressive thing for me in the video mr.rc-cam posted is the affect of the LiPo!? Wow!

KeesvR, are your positiv wires inside the frame?

Regards,
gompf

Re: tricks for avoiding magnetometer interference ?

Posted: Wed Apr 11, 2012 9:11 pm
by KeesvR
@Wilco: I don't know if it will work, I haven't tried it but I think it will work. Maybe 5cm diameter. It's easy to make and hopefully it give a good result. :mrgreen:

@ Gompf: No my positive wire is under the frame and ESC near the motors.

Image

Image

Image

Re: tricks for avoiding magnetometer interference ?

Posted: Sat Apr 14, 2012 7:51 pm
by Federico
I do have the drotek 9 dof and I am using a warthox centerplate for power distribution. I have the esc's right on the centerplate and I have another plate, 2.5cm over the esc for the electronics. I am using an arduino 2009 with a shield on, and on this shield I have placed the imu. So it's about 4-5 cm higher form the whartox distribution power / centraplate.
Everything works without problems!

Re: tricks for avoiding magnetometer interference ?

Posted: Sat Apr 14, 2012 9:56 pm
by wilco1967
Federico wrote:I do have the drotek 9 dof and I am using a warthox centerplate for power distribution. I have the esc's right on the centerplate and I have another plate, 2.5cm over the esc for the electronics. I am using an arduino 2009 with a shield on, and on this shield I have placed the imu. So it's about 4-5 cm higher form the whartox distribution power / centraplate.
Everything works without problems!


So if I understand correctly, it seems like those few extra cm's make all the difference ?....
Seems to confirm what I noticed on the Tri....
I have the ESC out on the arms, not like you on the centreplate.....

Let's see if I can add some longer spacers.... hopefully that improves it.
Thanks !

Re: tricks for avoiding magnetometer interference ?

Posted: Sun Apr 15, 2012 1:53 am
by Federico
I have not tested other configurations and my copter is like that by casuality, but it works. On the centerplate I have my 4 esc (25A) and a BEC, the IMU is spaced more ol less 5cm. Good luck!

Re: tricks for avoiding magnetometer interference ?

Posted: Sun Apr 15, 2012 7:08 pm
by NikTheGreek
Hi.
I'm trying to participate on those tests.
I'm building a cube from aluminium
i use aluminium sheet from coca-cola empty can.... of course you can use Pepsi or whatever you like :lol: !!!
and i ll insert the magnetometer in there.
I'll try also with other materials like coper or iron...cans ;)

The results will be posted here.

Re: tricks for avoiding magnetometer interference ?

Posted: Wed Apr 18, 2012 5:13 pm
by NikTheGreek
Aluminium shield result..... :( zero

Re: tricks for avoiding magnetometer interference ?

Posted: Wed Apr 18, 2012 6:18 pm
by mgros
NikTheGreek wrote:Aluminium shield result..... :( zero

Aluminum is not ferromagnetic material, not block the electromagnetic fields.
try use steel, but the problem will be weight.

Re: tricks for avoiding magnetometer interference ?

Posted: Wed Apr 18, 2012 8:07 pm
by gompf-2
The perfekt magnetic shield is a superconductive layer around the sensor. But we are lucky to not need lHe as the startpoint is wrong: You want to measure a field, so you can´t shield the sensor for it. You have to enhance the SNR ratio/reduce the distortions. Best way shoud be drilling/different routing of the wires and to bring some distance between sensor/source of Distortion.

Re: tricks for avoiding magnetometer interference ?

Posted: Mon Apr 23, 2012 12:50 pm
by Metroid
To find a solution you must dig in to the EMC and EMI matter. EMC stand for ElectricMagnetic Compatibility, EMI for ElectricMagnatic Interference. Search google for more answers.

Wiki EMC: http://en.wikipedia.org/wiki/Electromag ... patibility
The goal of EMC is the correct operation, in the same electromagnetic environment, of different equipment which use electromagnetic phenomena, and the avoidance of any interference effects.

Wiki EMI: http://en.wikipedia.org/wiki/Electromag ... terference
when in high frequency or radio frequency) is disturbance that affects an electrical circuit due to either electromagnetic induction or electromagnetic radiation emitted from an external source. The disturbance may interrupt, obstruct, or otherwise degrade or limit the effective performance of the circuit.

A gutter from very thin steal, coper (tin plated) that functions as the negative pole and schield. A wire trough the gutter for the positive pole can help.
A mash/braid of steal or copper (tin plated) that functions as the negative and a wire trough the mash/braid for the positive can help. Then you creat a coax type wire. It is the same type as a wire for the sparkplugs on a RC patrol motors.

Rob

Re: tricks for avoiding magnetometer interference ?

Posted: Mon Apr 23, 2012 8:38 pm
by kos
if you really want to compensate you magnetic sensor , i do not think you will be able to do it on the fly or using your motor rpm to deduce a voltage to applies to a solenoid..

http://myreckonings.com/wordpress/2009/ ... on-part-i/

Image


but here is the procedure for a static compensation

La plupart des compas présenteront des erreurs de déviation. Il est presque impossible de maintenir une distance de sécurité entre votre compas et des objets magnétiques indésirables, ce qui signifie que vous devez faire avec des valeurs connues de déviation dès lors qu’elles ne sont pas trop grandes. Mais la déviation peut être réduite à zéro (ou aussi proche que possible de ce chiffre) si votre compas est compensé, ou ajusté.



Assurez-vous que le matériau magnétique est en fiable et dans une position comme s’il était en mer. Ensuite, vous pouvez commencer le processus de compensation. Voici les deux méthodes de compensation existantes.



Compensation, Première méthode

1. Une fois que le compas est à l’emplacement souhaité mais pas totalement sécurisé, sélectionnez une direction sur la carte en utilisant deux repères identifiables, des bouées ou des points à terre qui sont dans l’intervalle de 10° de la ligne Nord-Sud. Sélectionnez la direction de manière à pouvoir manœuvrer votre embarcation, pour vous rapprocher du relèvement de la marque que vous avez sélectionnée.

2. En partant de l’alignement de ces repères Nord-Sud, et en les maintenant alignés, maintenez le bateau sur cette ligne. Tournez le compensateur bâbord/tribord jusqu’à ce que le compas lise correctement.

3. Inversez votre direction et orientez le bateau vers le Sud, tout en conservant les marques alignées ainsi que précisé à l’étape 2. Si le compas lit de manière incorrecte, il y a une erreur d’alignement. Pour le corriger, faites tourner le compas lui-même pour corriger la moitié de l’erreur. Ensuite réitérez les étapes 1 et 2 et revérifiez.

4. Répétez les étapes 1à3, sauf que cette fois, vous devez utiliser une direction Est-Ouest et le compensateur avant-après.

5 Quand tout ceci est fini, sécurisez le compas dans sa position finale.



Compensation, deuxième méthode

1. Une fois en mer, avec le compas dans l’emplacement souhaité, mais pas totalement sécurisé, obtenez le cap à partir de votre GPS vers une bouée ou un point à terre qui se trouve dans l’intervalle de 10 degrés de la ligne Nord/Sud.

2. Placez votre bateau le long de cette ligne et barrez directement vers cette marque. Tournez le compensateur bâbord/tribord jusqu’à ce que le cap du compas soit aligné sur le cap donné par le GPS.

3. Vérifiez la route du Sud en barrant le plus loin de la marque, à si une erreur d’alignement est détectée, faites tourner le compas lui-même pour corriger la moitié de l’erreur. Ensuite répétez les étapes 1 et 2 et revérifiez.

4. Répétez les étapes 1 à 3 pour la route Est/Ouest en utilisant le compensateur avant-après. Tout erreur d’alignement devrait être éliminée lors de la partie initiale de la procédure.

5. Lorsque vous avez fini, sécurisez le compas dans sa position finale * Lorsque vous avez recours à cette méthode, N’utilisez pas les informations de cap parce que ce n’est pas précis en temps réel.

Re: tricks for avoiding magnetometer interference ?

Posted: Tue Apr 24, 2012 9:00 pm
by wilco1967
I don't think the static deviation described in that article is the main concern for our multicopters. It would be a rather constant deviation....
For normal flying, it's not absolute north that's important, but only relative variations (not for GPS coming home though)..
For our multi's, it's mostly the varing motor current through the wiring that cause the biggest errors (at least on mine...).

If for example I do a high power climb, I often observe the quad do a rapid yaw as it 'thinks' the north has changed. When power is lowered, it often quickly returns to the original heading.
Also noticed strong influences from for example cars parked near to where I'm flying (not hit them yet... ;-)

I doubt there is a good shielding possible from ESC / Wiring / Battery magnetic effects (other than distance, and twisting / shielding of wiring), which will NOT shield the earth magnetic field as well....

Perhaps a calibration table in software, where one can put for say 0, 10%, 20% 30% ... 100% throttle the observed magnetic deviation for your individual quad, and correct the heading, but it would be cumbersome to adjust, and I'm not sure if a different battery, would throw it all off again....

just an idea.....

Re: tricks for avoiding magnetometer interference ?

Posted: Sun Jun 03, 2012 5:51 am
by tomge
Hi guys,

Would this be a possibillity?
If the powerlines are the problem, why not get the away from the fc?
In stead off running the power wires from the esc's to the center, make a ring out of something non ferro with a diameter of 30cm on which you attach the power lines.
Only on 1 arm you run 1 pair of twisted wires to th battery.
I have my crius board over 6cm above the powerdistribution board at thr moment, but am still getting 5 to 8° of drift on the mag at full throttle.
In ff flight the quad yaws to the right.
Head hold isn't that good either...

What do you guys think?

Tom

Re: tricks for avoiding magnetometer interference ?

Posted: Sun Jun 03, 2012 1:59 pm
by kos
tomge wrote:Hi guys,

Would this be a possibillity?
If the powerlines are the problem, why not get the away from the fc?
In stead off running the power wires from the esc's to the center, make a ring out of something non ferro with a diameter of 30cm on which you attach the power lines.
Only on 1 arm you run 1 pair of twisted wires to th battery.
I have my crius board over 6cm above the powerdistribution board at thr moment, but am still getting 5 to 8° of drift on the mag at full throttle.
In ff flight the quad yaws to the right.
Head hold isn't that good either...

What do you guys think?

Tom



there is no mag correction when the multi is too much inclined , might explain you issue in forward flight.

Code: Select all

#if MAG
    if (abs(rcCommand[YAW]) <70 && magMode) {
      int16_t dif = heading - magHold;
      if (dif <= - 180) dif += 360;
      if (dif >= + 180) dif -= 360;
      if ( smallAngle25 ) { rcCommand[YAW] -= dif*conf.P8[PIDMAG]/30;  // 18 deg}
      else { /*we do nothing*/}
    } else magHold = heading;
  #endif


at full throttle the dynPid attenuation and global PID might overtake the mag correction .. my 2 cents

Re: tricks for avoiding magnetometer interference ?

Posted: Thu May 26, 2016 2:41 pm
by waqarrashid33
Hey I am new to the filed of copters.. I am doing a small project on a quad-copter which a friend of mine built as a hobby. We are facing this same problem and I was thinking if we can use four batteries one for each propeller then we won't need that much of power lines and we can simply place these batteries near to its propeller. What do you guys think about this? Any useful links or direction..

Re: tricks for avoiding magnetometer interference ?

Posted: Thu May 26, 2016 4:14 pm
by Kbev5709
waqarrashid33 wrote:Hey I am new to the filed of copters.. I am doing a small project on a quad-copter which a friend of mine built as a hobby. We are facing this same problem and I was thinking if we can use four batteries one for each propeller then we won't need that much of power lines and we can simply place these batteries near to its propeller. What do you guys think about this? Any useful links or direction..

Well, since you dug this topic up from the grave, an answer should be in order I guess. The idea of one battery per ESC per motor is awesome if you can overcome all the weight issues that four Li Po batteries would introduce. Not very likely that you can, but one battery per motor would work otherwise.

Re: tricks for avoiding magnetometer interference ?

Posted: Thu Jun 09, 2016 2:34 pm
by waqarrashid33
Kbev5709 wrote:Well, since you dug this topic up from the grave, an answer should be in order I guess. The idea of one battery per ESC per motor is awesome if you can overcome all the weight issues that four Li Po batteries would introduce. Not very likely that you can, but one battery per motor would work otherwise.


Thanks for your response, We ended up rewiring the power wires as far away as possible.. now the wires goes straight from one motor to another and it had surprisingly good effect. now It can hold position and only moves 1-2m from hold position. Before that the it used to move in big circles of 10-15 meters.