Once again about MAG

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
Ainadiel
Posts: 17
Joined: Fri Jun 08, 2012 3:37 pm

Once again about MAG

Post by Ainadiel »

Hi there.
I am using newest 2.1 multiwii for my HEX and for some reason when i am taking off and sometimes during the flight HEX is yawing to left... i am not sure if it is something wrong with soft or my hex because this board (DOF10) was working fine in my quad before...
I was applying the same procedure when applying v2.1 as i did with previous versions and have completely no idea what is wrong.
Is anybody else having similar problems?

signal15
Posts: 37
Joined: Sat Jun 23, 2012 8:44 pm

Re: Once again about MAG

Post by signal15 »

Do you have mag turned on or off?

vistauser
Posts: 14
Joined: Mon Jul 25, 2011 7:58 pm
Location: Germering, Southern Germany

Re: Once again about MAG

Post by vistauser »

Same happens here.
Without switching mag on heading hold is perfect. After some seconds with mag - on copter starts irratigly to yaw to the left.
I think on my sensor board the mag is active per default. What for is the option with the switch?

Any thoughts about?
Olaf

Ainadiel
Posts: 17
Joined: Fri Jun 08, 2012 3:37 pm

Re: Once again about MAG

Post by Ainadiel »

in my case when MAG is off it seems to be fine... when i switch MAG on it starts yawing to left. stops after (about) 90 degrees... after another test i crashed and broke my landing gear... i had similar problem with mag in my quad but then the declination was corrupted... latest version before 2.1 release candidate was fine...

i tried to recalibrate mag... for some reason some values always shows -5000...

can't say why...

Sebbi
Posts: 478
Joined: Sun Jul 08, 2012 1:08 am
Location: Germany
Contact:

Re: Once again about MAG

Post by Sebbi »

You might need to recalibrate the mag as calibration is lost on update.

signal15
Posts: 37
Joined: Sat Jun 23, 2012 8:44 pm

Re: Once again about MAG

Post by signal15 »

Keep in mind that your power wires and battery produce a magnetic field. Everything may look fine when you are powering the board through the USB cable, but when the battery is plugged in and drawing current, it may be flaking out your mag sensor.

I was having problems with mine, but it turned out it was because I had calibrated it over a steel table. Once I calibrated it over the concrete floor, it seems to work fine.

Ainadiel
Posts: 17
Joined: Fri Jun 08, 2012 3:37 pm

Re: Once again about MAG

Post by Ainadiel »

well i think that must be the problem than, especially that all my electronics including esc are closed in plastic square box... esc are in about 30mm from my sensor board...
( https://dl.dropbox.com/u/24880984/20120717_103023.jpg )
but what is interesting i had the same set up before with my quad and everything was working fine!
i see if once i rebuild electronics and put them further apart might help. i do not really want to put esc nex to motors just because i want to make my hex6 waterproof...

wilco1967
Posts: 156
Joined: Thu Aug 18, 2011 6:04 pm
Location: Winterswijk, Netherlands

Re: Once again about MAG

Post by wilco1967 »

Ainadiel wrote:Hi there.
I am using newest 2.1 multiwii for my HEX and for some reason when i am taking off and sometimes during the flight HEX is yawing to left... i am not sure if it is something wrong with soft or my hex because this board (DOF10) was working fine in my quad before...
I was applying the same procedure when applying v2.1 as i did with previous versions and have completely no idea what is wrong.
Is anybody else having similar problems?


I have some similar behaviour on my quad
Sometimes, the quad strongly wants to yaw left (always left, never right). Most of the time it is just fine.
Using 328P with Drotec 9DOF board with ITG3200, BMA180, HMC5883. The mag is not perfect (affected by motor current), but yaw happens with mag OFF.... With mag on, it keeps heading just fine (even though it's not perfect)

Never did this before (ok... it would drift a little, but not so violent)... it seems to have started somewhere in de pre release candidates (not sure where exactly), but I also removed and replaced the sensor during that time so it could be related to that... But I see nothing wrong with the sensor data. :roll:

I'm flying also a Tri with the last pre-release before official 2.1, and that is perfect (MEGA / MPU6050 / 5883)....

Ainadiel
Posts: 17
Joined: Fri Jun 08, 2012 3:37 pm

Re: Once again about MAG

Post by Ainadiel »

see mine is yawing to left... but just to check it i changed axis orientation for MAG only
(I replaced #define MAG_ORIENTATION(X, Y, Z) {magADC[ROLL] = X; magADC[PITCH] = Y; magADC[YAW] = -Z;} with
#define MAG_ORIENTATION(X, Y, Z) {magADC[ROLL] = -Y; magADC[PITCH] = X; magADC[YAW] = Z;} ) and i played with all possible combinations...
the final effect was the same: it yaw sometimes but this time it depend on either axis - sometimes it yaw to left and sometimes to right

I was wondering if someone who has more knowledge about multiwii 2.1 code could help us solve this problem... other wise i have to go back to mwii2.0 dev 20120618 - this one was working correctly

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: Once again about MAG

Post by nhadrian »

Hi,

check the behaviour of the copter in GUI! Rotate aroung in pitch, roll, yaw and watch the small copter-like indicator. If you see that ie. moving around roll causes movements around yaw too will mean that there is some error in orientation config. When rotate around yaw and first it looks good but after rotating it turns slowly to any different direction means that you have false mag calibration.

BR
Adrian

ps.: I suggest to test all kind of strange behaviour all times in GUI first, and try to understand the origin of it.....

tedani
Posts: 1
Joined: Sat Mar 10, 2012 5:37 am

Re: Once again about MAG

Post by tedani »

I have the same problem. MAG values were quite steady in the beginning, and then, after about 20 seconds, the values especially yaw started to fluctuate.

Watch this video: http://www.youtube.com/watch?v=7O6G7z54Rhk

vistauser
Posts: 14
Joined: Mon Jul 25, 2011 7:58 pm
Location: Germering, Southern Germany

Re: Once again about MAG

Post by vistauser »

Hi,

yesterday I made it! Copter doesnt yaw to the left anymore with MAG switched on.
Howto:
Clear eeprom first prior flashing new firmware, do all settings new in gui and also do all calibrations.
Clear eeprom is a tool from arduino v 1.01.

Good luck
Olaf

Ainadiel
Posts: 17
Joined: Fri Jun 08, 2012 3:37 pm

Re: Once again about MAG

Post by Ainadiel »

seems like your solution works for my hex6... thx

also i rebuild electronics and screen all/most of the cables... hex6 is keeping direction event during the wind - now just adjust PIDs and can go for long flight...

wilco1967
Posts: 156
Joined: Thu Aug 18, 2011 6:04 pm
Location: Winterswijk, Netherlands

Re: Once again about MAG

Post by wilco1967 »

same here......
Clearing the eprom seemed to have solved it....

Thanks !

cswiger
Posts: 12
Joined: Wed Jun 20, 2012 11:43 pm

Re: Once again about MAG

Post by cswiger »

yes, my Witespy quad goes about 45° off with WOT. I'm wondering if stuff like this would help : http://www.lessemf.com/mag-shld.html

Ainadiel
Posts: 17
Joined: Fri Jun 08, 2012 3:37 pm

Re: Once again about MAG

Post by Ainadiel »

Not sure how you want to place that on your quad... i was thinking about using ferrite beads ( http://www.maplin.co.uk/ferrite-rings-and-beads-32792 ).

thought that i can place one of them between each motor and esc... gonna buy some of them next week and see if that would help...

cswiger
Posts: 12
Joined: Wed Jun 20, 2012 11:43 pm

Re: Once again about MAG

Post by cswiger »

Ferrite beads are good for filtering out high frequency noise from interfering with radios, like digital square pulses can create a lot of odd frequency harmonics (http://en.wikipedia.org/wiki/Ferrite_bead) - but what we have here is a static or slowly varying magnetic field cause by the dc in the power cables (http://en.wikipedia.org/wiki/Electromag ... _shielding).

Just to get an idea of the magnitude involved, using this calculator http://hyperphysics.phy-astr.gsu.edu/hb ... ur.html#c2, an 18 amp current thru a wire at a distance of 1 inch (0.0254 meters) is 1.26 Gauss, whereas the earths magnetic field varies between 0.25–0.65 Gauss (http://en.wikipedia.org/wiki/Earth%27s_magnetic_field). So I'm thinking a tube or wrapping the power cables in some high mu shielding foil might channel the lines of force away from the compass, but have no idea how it would effect the geomagnetic field.

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: Once again about MAG

Post by Pyrofer »

Move the mag away from all power circuits.

Every mm makes a difference and its the only way to do this, trying shielding is a no-win situation.

I had problems like this so I moved the power layer to the bottom of the quad and moved the mag and sensors higher up on the top. It works without issue now.

Woppit
Posts: 22
Joined: Tue Jul 17, 2012 11:47 pm

Re: Once again about MAG

Post by Woppit »

Hi all, and thanks to all those developing this fantastic software.

I have been running Multiwii from v2.0 (now on v2.1) on 2 crius se boards, 1 on a quad and the other on a Y6 with no problems.
I have just upgraded the Y6 to a Crius AIO board (for GPS use) and all is rock solid except the mag heading
lock, this will stay locked for a short time then rotate left or right on the yaw axis. I have tried all i can think
of to sort this, but so far failed. I have cleared the eeprom a few times and re-flashed and re-calibrated the
mag sensor and still have drift, on the gui all is stable and the compass heading is perfect in all directions (no drift!)
anyone else had this? any help would be great.

thanks Woppit

Ainadiel
Posts: 17
Joined: Fri Jun 08, 2012 3:37 pm

Re: Once again about MAG

Post by Ainadiel »

hmmm i Moved esc outside the box, move sensor board as high as i can... and i run test... i connect hex6x to gui and without props i took some readings... even on full throttle mag was giving me the same values as on min throttle... so i am assuming that in my case magnetic field does not corrupt readings... however i noticed that motors are not return to the same speed... for example if i roll to left and leave stick motors spinning in complete different speed than before roll... is that correct?
im going to record video next time.

and by the way does anybody have mwi2.0 dev20120622? by mistake i delete mine and on that everything was working fine for me...

Woppit
Posts: 22
Joined: Tue Jul 17, 2012 11:47 pm

Re: Once again about MAG

Post by Woppit »

Hi Ainadiel

I have the file you need, if you have not got it yet let me know how to get it to you.

Woppit

Ainadiel
Posts: 17
Joined: Fri Jun 08, 2012 3:37 pm

Re: Once again about MAG

Post by Ainadiel »

yes please :D check your PM for details

thanks!

Post Reply