Had a weird one a couple of days ago, and I can't quite work out why my quad did what it did ...

Basically a nice warm sunny day (usually rare for Scotland, although not his year), hardly a blip of wind (max 0.9 m/s recorded) and just plugged in a quick and simple 6 waypoint mision (100m AGL, no delays) with auto take off and RTL.

First flight went almost perfect, except I had the geofence set in to close, so it got out to 150m and then returned, but as you can see  it was a lovely straight flight.


I disconnected mission planner, switched to a fresh battery, re-connected mission planner and set the geofence out to 400m.  I then attempted to re-run the same mission but got the below result ...


From take off the quad was lisiting to the left and started to circle, before I attempted an RTL (very briefly) and then got manual control.  I added a bit too much throttle whilst trying to orientate and breached the upper failsafe (120m), so it took control and went for another mad (and fast) spinny circle, before I got control again and managed to get it more or less stable for a slightly bumpy landing (I bent one of the legs).

To me that looks like a problem with the compass, although compass MOT etc had all been completed succesfully (14%) and the last time I had an issue like this was pre firmware V3.1.  Looking at the logs (see attached) the MAG values dont look too bad (at the start of the flight at least, before it started ramping up the speed whilst circling).  GPS seemed fine (7-10 sats, HDOP ~2), vibes maybe a little out but not massive (can only see them on the T-log, as IMU was not on).

Now one thing I didn't do was re-load the mission before the second flight, and when querying the T-log (attached) it can't give me what its waypoints are.  Plus if you re-play the T-log it does not show any waypoints (although querying the APM directly afterwards did give me the correct waypoints) ... this makes me think that something odd might have occured here, as though the APM was not quite configured, or in a bit of a limbo state or something?

Anyway, that is why I am a little stuck and just wondered if somone could take a peak at the logs to see if they can work out why it went nuts.

May thanks,




You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • An update for this before I completely forget (yet again).

    The original issue still stands as unexplained but would appear to be some sort of magnetometer failure/interferance.

    The later analysis by myself (from the 5th of august onwards) was flawed as after I re-designed the quad, and started testing I found that the telemetery antenna (a dipole afair) was getting too close to the GPS/compass and so was changing to mag field randomly (NOTE that this was not the case with the original issue).

    So, quad has be redesigned, antenna moved and is flying like a champ, but I will keep my eye out for the original issue as I still do not know what caused that to occur.



  • There's either something up with your compass or you have vibration issues - can't tell without IMU logging.

    I don't see anything blatantly wrong with your compass. The compass heading looks bad, but that could be because the roll and pitch are out. Can you turn on IMU logging and go for a short flight in stabilize mode? Also, can we see a photo of how you've mounted your APM and your compass?

    • Hi Jonathan,

      Unfortunately I don't actually have a picture of it (its been going though several modifications over the last few months, and is currently in pieces as I am trying to work out how to fit a lid on it), however it is very similar to the below, except that the battery was below the quad, so the GPS (sitting up on top) was ~4 cm closer the the main body.  The quad is in a plus configuration.


      The APM itself is housed inside the main body of the quad (where the power distribution board would normally be) mounted on two bits of moongel, held on by a thin bungey type coord.  It uses a quattro 4in1 ESC that is also mounted below the main body, just above the camera gimbal that uses two mico servos and carrios a cannon A2200.  In the stack is a turnigy 9x receiver (standard antenna), 3DR 433 telemetry (V2) with dipole antenna, a 5.8ghz immersion rc Tx with spiro anntena, and right at the top a 3DR Ublox LEA-6H.  The APM is a 2.5+, modifed so that the internal compass is disabled (solder line cut).

      Also, as it is currently in pieces I can't do a quick check flight with it at the  moment, but attached is the log of its initial shake down flight which had IMU logging enabled (the flight was one week prior to the incident, different location but same quad setup).

      Thanks for taking a look at this, would be good to find out why it did what it did and more importantantly if we can spot the same issue again before a flight is initiated.



      2014-07-21 14-20-03.log

    • Could've been vibration issues. Heading looks good in this log, although you were facing one direction the whole time so it isn't a real test...

    • No worries, thanks for looking anyway.  I have just about finished my rebuild so should be flying again tomorrow, so will re-enable IMU and if it shows the same issues again,  will repost here.



    • OK ... so  the quad has been rebuilt and the compass/GPS module is now on a little aluminium plinth and the APM has been moved into the stack, still on its moongel but also with some rubber dampners at the bottom of the stack.

      Calibrations  re-done including acceleration, compass (X-81, Y-121, Z116) and compass MOT (9%).  Enabled IMU and flew the quad about a bit, and vibrations look totally fine (see below for a small example), and the quad had no issue being flown around in Alt Hold mode.


      However the compass, even though it all seemed to check out fine when calibrating, is certainly not working quite right as when enabling loiter it started toilet bowling straight away.  Log analysis indicates large changes in the mag_field (50% +) ...

      So I tried to re-calibrate the compass in the field, and initially got offsets of X0, Y0, Z0 ... Hmm, that seemed a bit odd, must have been a glitch, so I did it again and got X-59, Y-6, Z83.  A fair bit different from the first calibration (note no changes to the quad other than the location and I was well away frommetal objects etc).  Took it for another flight, same issue, same problem in the log analysis.  So tried calibrating again, and got X0, Y0, Z1 (you see where this is going right ;),  tried it once more for luck and got X-9, Y0, Z48.

      I decided not to fly again as each time I had also been checking the quads supposed heading with a compass, which sometimes seemed accurate to a degree or so, and sometimes off by 20,30, or even at one point 65 degrees.

      So I did one more test, which was to remove the props, arm the quad and give it ~30% throttle and then walked in a rough square around the field holding the quad pointing in the direction of travel.  So the GPS heading and the nav heading should (more or less) match, but what I got was the below...


      If you watch the reply of the T-log (attached) you can clearly see the quad facing randomly compared to itsreal direction of travel, so either my compass is broke, or the APM is just not reading it correctly.  Has anyone seen anything like the above before?



      2014-08-05 17-04-51.log

      2014-08-05 17-04-15.tlog

    • Do the following checks:
      - Point the FRONT of the copter towards NORTH. X magnetometer should be BIG POSITIVE. Y magnetometer should be small.
      - Point the FRONT of the copter towards WEST. Y magnetometer should be BIG POSITIVE. X magnetometer should be small.
      - Point the BOTTOM of the copter towards NORTH. Z magnetometer should be BIG POSITIVE.

      How are you doing your compass calibration? You shouldn't be getting such inconsistent results. Can you send me a tlog of a calibration (you don't have to actually run the calibration, just connect MP and rotate the copter around a lot). Do one full rotation each with the bottom, left, right, front, back of the copter down.

    • Hi, right have done what you said and the below is what I got (each direction was held for ~15 seconds), plus I re-did the calibration dance afterwards, yielding X-59,Y-31,Z97 so you can see that in the log  as well (done following the method of Chris Anderson, the attached T-log for this is CompassChecking.tlog).


      I have also added the T-log of the last (very short) flight and two compass calibrations that I did in the field yesterday, with one calibration yielding me X0,Y0,Z0.1 (log time 16:40:40 - 16:45:00) and the second X-9,Y0,Z48 (log time 16:50:35 - 16:51:50).


      Thanks again,


      2014-08-05 16-30-33.tlog


  • Developer


    I had a look at the logs assuming that it would be a compass problem because that's the normal cause when these massive circling events happen but the interference levels (i.e. compass vs throttle) look quite low.

    3701798035?profile=originalThe compass orientation also looks normal (COMPASS_ORIENT of "8" is normal for a 3dr external GPS+compass module).

    It's quite clear from the logs though that it did not know it's heading because the actual velocity doesn't track with the desired velocity.

    3701798364?profile=originalThere's no chance that the compass was knocked out of place or rotated a bit on the frame?

    By the way AC3.2 has an "EFK Check" that I'm quite certain would have caught this problem.  The copter still would have flown off in the wrong direction for a bit but not nearly to the extent you saw.

    • Randy, Thanks for taking the time to have a look, will know in the future to take a look at those velocity values (learn something new every day :) ).  The compass itself is (and was) fixed firmly at the top of the stack, impossible for it to move/be rotated unless it is physically broken off, so it wasn't that.  I did however move close to landrover (stood next to it) to configure the camera before puting the quad back on at its launch point (~15 m away) ... maybe that did something weird to the compass temporarily?

      When you say it did not know its heading, could you discern whether it had an expected heading, but just couldn't fathom how to get there, or whether it just did not have an expected heading at all?

      Going to rebuild the quad a little bit anyway as I now have a lid for it (make it slightly water resitant), so will move the compass+gps onto a little stand so that it gets even more clearance for the rest of the electronics etc.  Will also be updating to 3.2 once its ready for general release, more safety features the better :)

      For now I will just update my operating procedures and checklist to include clearing and re-loading of the mission each time, just in case that did have something to do with it, along with checking the heading with a handheld compass to see if it is off or not (before each flight).

      Dan, if anything else comes to light I will post it in here, but probably won't be flying again until somepoint next week, weather dependant.



This reply was deleted.