Fixing DJI's Compass Problem

Mindflights said:
Hey
I am living in Greece but I bought my Phantom 2 from Buildyourowndrone.com UK
around 5 of March, 2014

I have drifting problems with circles etc since the first day,
It is difficult to make it steady and hover even if I have 11 satelites and calibrated everything usually before every flight!

Today it started to make circles with big speed and tried to run away twice!

here is my footage
http://youtu.be/zUEpz_6OyEI

I am very experienced with Phantom 1 and no similar problems up to now, but this is defective for sure!

You are definitely having a problem there and it does look like the classic toilet bowl effect but it is not related to magnetic declination issue which is the focus of this thread. Your problem looks much more serious. Fortuantely, the declination issue doesn't cause flyaways. It does cause a lot of "oh crap" moments when you think your Phantom is going stop and instead it hooks off into a tree!

You need to look at your compass values and degauss if needed, recalibrate IMU. Do the compass calibration in an area away from ALL metal. If you still have an issue, post it up in a separate thread and we can try to figure it out.
 
Here's the problem in video:

[youtube]http://www.youtube.com/watch?v=9BUilGeH74Q[/youtube]
 
....and a +1 from southeastern California...
 
Great video explanation Ian. I hope DJI listen and can resolve the issue.
 
Did any of you try the fix they explain on page 29 of the NAZA manual which states to turn the GPS modual to represent the magnetic declination of your location?
 
That is for the puck where the GPS and compass are in the same unit. Rotating the GPS on a Phantom will have no effect. I believe some have tried rotating the compass on the leg, but that did not seem to resolve this issue.
 
Xgeek,

I rotated the compass and it seemed to solve the TB issue as I posted yesterday.

The j hook is still there however.

Tom

Cape Cod Ma.
 
A few observations:

(1) The GPS system only knows about track - nothing about the orientation of the Phantom (the direction it is facing);

(2) The compass only knows about orientation - nothing about track;

(3) In the absence of yaw corrections from the Naza, forward stick will make the Phantom move in the direction in which it is actually facing.

As noted, if there is a discrepancy between bearing (as determined by the magnetic compass reading plus the local estimated declination) and actual bearing (the real direction it is facing), then the Phantom will not be facing the direction that the flight controller assumes, and so when it is instructed to fly forwards the GPS track will not be in the direction expected by the controller. As the track is established, the controller will apply yaw correction to make the direction of flight agree with the direction that it (mistakenly) assumes the Phantom to be facing - exactly as it would if the Phantom were flying in a cross-wind. That would produce the observed hook and the subsequent drift.

Now I'm speculating somewhat, but on the return leg the deviation will be in the wrong direction for it to be caused by the same cross-wind, and I would expect the controller to be programmed to interpret this as implying imbalanced thrust between left and right motors, leading to a learned permanent correction that inadvertently inserts yaw (to the left in your case), which might also result in the circling behavior seen on hover.

I'm somewhat confused by the observations that the problem somewhat corrects with flight time, but anyway, that aside, going back to the observation that the GPS and compass measure independent, though interacting, parameters, then if the only error here is the declination adjustment of the magnetic compass reading then one would expect that rotating the compass module (so that the controller correctly establishes the direction in which the Phantom is facing) would inevitably fix the problem. Given that GPS modules generally include either algorithms for calculating declination or almanacs for looking up declination, and noting that some users have reported finding that adjusting the compass sensor orientation by up to twice the local declination fixes the problem, I wonder whether the affected GPS modules/flight controllers have the correct declination magnitude but wrong direction (sign) in either their calculation or lookup.

Has anyone rotated the compass sensor by exactly double the local declination correction (in the opposite direction to the declination of course) and still seen the same problem?
 
Yes, I tried both the exact declination and then double the declination. Double was the only setting that allowed you to get straight flight right from take off. I was slightly confused as to why double was needed but I was glad I tried it as it appeared to fix the problem... for a few minutes... until the Phantom started hooking in the other direction!

You could be on to something though. It could be that the Naza has a declination signage problem. It's simply applying the compensation in the wrong direction which instead of fixing it, is making it twice as bad. That might also explain why course lock seems to be off by almost double the declination. I take the course lock as a indication of where the compass is really pointing without any influence from GPS or subsequent adaption. Mine has been about 20 degrees to the left from the take off heading.

Side note: I wish the OSD had a friggin' heading indicator! Time to get the Teensy wired up to the CAN bus and do some hacks.

I do think there is more to it than just a sign change otherwise when I added 24 degrees to the compass, it should have worked fine which it only did for a while. I do know there is definitely adaption taking place. And the adaption is temporary, as in only for the duration of the flight. And the adaption seems to always find the right way forward EXCEPT when I had the compass all the way out at +24 degrees. For some reason, the adaption at that point was introducing a deviation.
 
Yes it is hard to rotate. I simply loosened all the screws and wedged some thick paper in to offset it as much as I could. then put a dab of locktite on the screws and snugged them up. I estimate maybe 20-30 deg which is close to double my 17 deg var.

Tom
 
tom3holer said:
Yes it is hard to rotate. I simply loosened all the screws and wedged some thick paper in to offset it as much as I could. then put a dab of locktite on the screws and snugged them up. I estimate maybe 20-30 deg which is close to double my 17 deg var.

But you're still getting the hook, yes?
 
ianwood said:
Yes, I tried both the exact declination and then double the declination. Double was the only setting that allowed you to get straight flight right from take off. I was slightly confused as to why double was needed but I was glad I tried it as it appeared to fix the problem... for a few minutes... until the Phantom started hooking in the other direction!

You could be on to something though. It could be that the Naza has a declination signage problem. It's simply applying the compensation in the wrong direction which instead of fixing it, is making it twice as bad. That might also explain why course lock seems to be off by almost double the declination. I take the course lock as a indication of where the compass is really pointing without any influence from GPS or subsequent adaption. Mine has been about 20 degrees to the left from the take off heading.

Side note: I wish the OSD had a friggin' heading indicator! Time to get the Teensy wired up to the CAN bus and do some hacks.

I do think there is more to it than just a sign change otherwise when I added 24 degrees to the compass, it should have worked fine which it only did for a while. I do know there is definitely adaption taking place. And the adaption is temporary, as in only for the duration of the flight. And the adaption seems to always find the right way forward EXCEPT when I had the compass all the way out at +24 degrees. For some reason, the adaption at that point was introducing a deviation.

I cannot imagine why it would start correctly and then later begin to hook the other way. Starting correctly implies that the compass bearing and track are in agreement - as one would expect if the sensor realignment worked. Did you reset everything to default after rotating the compass sensor, just in case some of the learned behavior is non-volatile? Does the opposite hook go away with increasing flight time, or persist?
 
sar104 said:
I cannot imagine why it would start correctly and then later begin to hook the other way. Starting correctly implies that the compass bearing and track are in agreement - as one would expect if the sensor realignment worked. Did you reset everything to default after rotating the compass sensor, just in case some of the learned behavior is non-volatile? Does the opposite hook go away with increasing flight time, or persist?

There's nothing to reset. I re-calibrated the compass each time when I was testing it in different positions. But regardless, the adaption is clearly volatile. Each time I fly with the compass in the normal position, the hook is terrible and then it cleans up and then everything is straight and good. I turn off the Phantom, put another battery in and the hook is terrible again as if the previous corrections never happened. One of my recommendations to DJI, if they will consider nothing else, is to make the adaption non-volatile.

As for the hook going the other way when I shimmed it double the declination, I was as surprised as you are. And very disappointed too as I thought for a few brief minutes that I had fixed the problem.
 
Hello, I'm NEW HERE!! But not to the RC World of electronics :) ... Let me start by saying my first flight was an oopsy a few weeks ago (NOT HUMAN ERROR). Did all the updates, and did "allot" of online research on "here and YouTube". I was hesitant on even flying the Phantom, and kept it grounded until I made sure ALL MY GADGETS had firmware updates etc.. I know the Groundstation Datalink is hoopla, but I'm patient! But, in reference to this hook and spin, yes I have experienced this and then some. Yes, very adequate and compulsive on instruction including GROUNDZERO (homepoint calibration, satellite coverage, wifi, powerlines and towers).. I did what most would consider A BAD THING, but without any doubt it was heading towards traffic and children at a local baseball field... I "dumped it" after (NO RETURN HOME OR HOVER) losing my composure because of the dreaded FLYAWAYS and did panic ... Yes, somehow someway recovered in ATT "I believe" and dumped the levers, and she fell about 150' :( The damage was minimal, for that im thankful, but for this thing to do what it did out of nowhere, my reactions saved a dreaded injury, possibly an accident so forth.. She is GROUNDED, and "has been" until the much needed ATTENTION is given on firmware and other updates.. I refuse to give up on this hobby and my toys because of possible errors, firmware, and or human error. Thanks for the heads up ianwood :) !! Keep them coming!! Sorry for the long note... STEP IT UP "DJI"!!!
 
ianwood said:
Side note: I wish the OSD had a friggin' heading indicator! Time to get the Teensy wired up to the CAN bus and do some hacks.

You can use the azimuth readout to get a bearing on the direction of travel.
 
xgeek said:
You can use the azimuth readout to get a bearing on the direction of travel.

Yes but it's relative to the home location. I'd like both a bearing to home location and a heading off of true north (i.e. what the compass is reading adjusted for declination).
 
Not sure I follow. 0 degrees is the bearing from you home location to true north. In the video you posted you could track the bearing you flew down and calculate the drift and J hook.

Surely you could note the azimuth direction at take off and calculate the offset at the point you let go of the forward stick and then calculate the amount of Hook?

Maybe a Flytrex could help you plot the deviation but am not sure of the sampling resolution of the Flytrex.
 
xgeek said:
Not sure I follow. 0 degrees is the bearing from you home location to true north. In the video you posted you could track the bearing you flew down and calculate the drift and J hook.

Surely you could note the azimuth direction at take off and calculate the offset at the point you let go of the forward stick and then calculate the amount of Hook?

Maybe a Flytrex could help you plot the deviation but am not sure of the sampling resolution of the Flytrex.

Azimuth tells me plenty for the hooking. I was more generalizing about the OSD's lack of useful information so we're digressing but whatever...

OSD gives me azimuth and the Phantom's relative heading to me. What I don't know is the Phantom's true heading. The relative heading is not very helpful. Azimuth and course are all you need. And, might as well keep the course to home bug so it can be idiot proof.

Flytrex is interesting but much more can be done with a $20 Arduino that weighs 11g and hooks up to the Phantom's CAN bus. There are already customized OSDs that have GPS coords, HDOP, RSSI, etc. It can modulate data down the audio channel of the vTX to an Android headphone socket where an app turns it into a data stream. And once Ground Station comes out, there should be a whole new batch of CAN bus messages that will tell us how to send commands to the Naza.

Anyway, back to the main subject...
 
I responded to your post over at rcgroups, but so that I can be 'officially' registered here as having the problem - add me to the list.

I have this exact issue with both my P2 and P2V. I am located in Santa Barbara, CA.

Thanks for discovering this. I was going insane trying to troubleshoot this.
 

Members online

Forum statistics

Threads
143,090
Messages
1,467,571
Members
104,974
Latest member
shimuafeni fredrik