DJI Mavic, Air and Mini Drones
Friendly, Helpful & Knowledgeable Community
Join Us Now

Compass Error - Crash

lukemil

Member
Joined
May 20, 2018
Messages
7
Reactions
0
Age
57
Yesterday while flying my MPP, on a nice long roundabout route, I experienced a compass error and then a crash. I was out in a ballfield and had flown approximately 4000 feet away at about 380 feet high. I got down to about 40% battery and hit the RTH button. I had flown a little in sport mode, but switched back to position mode. The unit got pretty close, but then gave the compass error and flew very fast in large circle. It would respond to altitude control, but nothing else. Not wanting it to lose power, fly away, or crash into something, I forced a landing. Unfortunately, while it came down slowly, it was still traveling in the big circle and broke a front leg off when it skidded along the ground.

Flight log here:
DJI Flight Log Viewer - PhantomHelp.com

Any wisdom is appreciated. The unit will have to go back to DJI, but I'm trying to figure out if it was my fault or theirs.
 
I have the .DAT file, but I get an error from this site when I try to upload it. Is there a better way? Sorry to be a noob.
 
Last edited:
Got it. Thanks.
 

Attachments

  • 2018-07-02_18-33-12_FLY021.txt
    7.8 MB · Views: 11
Got it. Thanks.

That's an unusual event. Aside from the obvious circles that it flew as shown in the flight track shown in post #2, the issue is clearly visible in the IMU data:

2018-07-02_18-33-12_FLY021_01.png

The yaw and magnetic yaw values diverge many times during the flight, which is not good, but the oscillations at the end are clear, and cause the FC to apply out-of-phase corrections which lead to the circular flight:

2018-07-02_18-33-12_FLY021_03.png

The question is what caused this - it's obviously not a simple offset between the magnetometer (compass data) and the IMU yaw of the kind that arises when the IMU yaw is incorrectly initialized. Unwrapping the IMU and magnetic yaw values and the integrated Z-axis rate gyro data to give total rotation perhaps gives a clue:

2018-07-02_18-33-12_FLY021_02.png

If you know what you are looking at here then you will likely think it very strange. The IMU and magnetic yaw values track poorly, but with general agreement. The integrated rate gyro data follow the same general pattern for most of the flight, and some of the discrepancies there will be because pitch and roll are moving the z axis around. However, at around 915 s, when the oscillatory, circular flight starts, the compass indicates that the aircraft yaw (heading) is oscillating back and forth between around 50° and 100°, while the z-axis rate gyro indicates that the aircraft heading is continuously rotating clockwise, through approximately 3 full turns.

It seems unlikely that the compass would have missed those rotations - it would take some significant magnetic interference to hide them. Now I'm getting into the realm of guesswork, but to me that suggests that the rate gyro, or the processing of the rate gyro data, went badly wrong at that point. Perhaps @BudWalker could take a look at the data for a second opinion.
 
Last edited:
That's an unusual event. Aside from the obvious circles that it flew as shown in the flight track shown in post #2, the issue is clearly visible in the IMU data:

View attachment 41330

The yaw and magnetic yaw values diverge many times during the flight, which is not good, but the oscillations at the end are clear, and cause the FC to apply out-of-phase corrections which lead to the circular flight:

View attachment 41331

The question is what caused this - it's obviously not a simple offset between the magnetometer (compass data) and the IMU yaw of the kind that arises when the IMU yaw is incorrectly initialized. Unwrapping the IMU and magnetic yaw values and the integrated Z-axis rate gyro data to give total rotation perhaps gives a clue:

View attachment 41332

If you know what you are looking at here then you will likely think it very strange. The IMU and magnetic yaw values track poorly, but with general agreement. The integrated rate gyro data follow the same general pattern for most of the flight, and some of the discrepancies there will be because pitch and roll are moving the z axis around. However, at around 915 s, when the oscillatory, circular flight starts, the compass indicates that the aircraft yaw (heading) is oscillating back and forth between around 50° and 100°, while the z-axis rate gyro indicates that the aircraft heading is continuously rotating clockwise, through approximately 3 full turns.

It seems unlikely that the compass would have missed those rotations - it would take some significant magnetic interference to hide them. Now I'm getting into the realm of guesswork, but to me that suggests that the rate gyro, or the processing of the rate gyro data, went badly wrong at that point. Perhaps @BudWalker could take a look at the data for a second opinion.
I've been trying to confirm that the AC was actually oscillating between 50° and 100° by looking at the raw mag, accel, and position data. Very confusing, I didn't get very far with that.

If the integrated gyroZ was claiming that the AC turned through 3 rotations wouldn't the FC have turned it 3 rotations in the other direction?

And, isn't it possible that the integrated gyroZ doesn't reflect the actual heading. The AC was pitching and rolling at the same frequency. Can't quite see it but I think the right phase relationship between pitch, roll and heading would introduce a bias in the integrated gyroZ.... Maybe not.
 
  • Like
Reactions: lukemil
I've been trying to confirm that the AC was actually oscillating between 50° and 100° by looking at the raw mag, accel, and position data. Very confusing, I didn't get very far with that.

If the integrated gyroZ was claiming that the AC turned through 3 rotations wouldn't the FC have turned it 3 rotations in the other direction?

And, isn't it possible that the integrated gyroZ doesn't reflect the actual heading. The AC was pitching and rolling at the same frequency. Can't quite see it but I think the right phase relationship between pitch, roll and heading would introduce a bias in the integrated gyroZ.... Maybe not.

The pitch and roll data will change the magnitude of the gyro-z measurements, but should not change the sign, which is what would be required to change rotation into oscillation. I ran into the same problem trying to figure out how to confirm what the aircraft was doing, heading-wise - there are only compass data and gyro data. However, note that the magnetic yaw, direction of travel and pitch/roll have a constant phase relationship through that part of the flight, which means, unambiguously I think, that the aircraft was not rotating. It doesn't prove that it was oscillating 50° - 100° though.

The FC apparently did not attempt to rotate the aircraft to counter the gyro_z data because it seems to have ignored it - IMU yaw is almost constant at around 55°.
 
  • Like
Reactions: BudWalker
Thank you. The depth of knowledge on this board is impressive. I wish I understood more.
 
Almost everything about this event is puzzling. I think that the behavior was likely due to an incorrect compass calibration, but it's difficult to be certain. The MP has two compasses, but for some reason only one of them appears in the DAT files. In any case, looking at the end of the RTH approach from the SW, the magnetic yaw value is reasonably constant, as expected, until the FC changes pitch to slow the aircraft. At that point the compass registers a CCW turn but he recorded IMU yaw - the value that the FC actually uses - stays constant. The GPS location data indicate that the direction of travel turns left, and the FC adds right roll. That right roll is the start of the toilet bowl flight, with the aircraft making one very tight circle and then entering a set of 15 m diameter CCW circles. The circles indicate that the aircraft heading is not correct, so that the FC's attempts to correct are in the wrong direction. The interesting difference here is that the heading is not constant either - it is clear from looking at the combined motor momentum that the FC is adjusting heading to try to match the IMU yaw value (typical behavior) but overshooting, possibly because of the toilet bowl flight.

The first graph below shows the flight path at the end in terms of GPS location, IMU recorded position, and location based on recorded IMU velocity. The GPS data (green) are most likely correct. The location derived from IMU velocity is different, and that's common when there are yaw errors. What is strange is that the IMU recorded location is identical to the GPS location - that means, I think, that it is ignoring its inertial data. Strange.

2018-07-02_18-33-12_FLY021_06.png

The next graph shows the flight data entering the transition to toilet bowl flight.

2018-07-02_18-33-12_FLY021_05.png

The initial CCW change in magnetic yaw coincides with the change in pitch, and it's notable that there are several points in the flight where that happens, suggesting that it's not real. However, that also coincides here with a drop in CCW motor angular momentum which would cause it to turn CCW. I cannot see why the FC did that. Following that, the pitch and roll clearly cause the circular flight.

The periodic variations in motor angular momentum have to be causing yaw variations, but they are almost certainly not correctly measured by the compass - hence the continued toilet bowl. In support of that, I used a quaternion method to calculate the z-axis tilt direction from pitch, roll and yaw, which will be the direction in which the motors are pushing the aircraft. Using the magnetic yaw value did not result in the difference between the tilt axis and the direction of travel (due to wind) showing zero crossings at two headings 180° apart (which it should, presumably).

2018-07-02_18-33-12_FLY021_07.png

I recommend recalibrating everything and then flying again to see if these variations of magnetic yaw with pitch and/or roll are still present.
 
I'm sorry to disappoint after you spent so much time analyzing the data, but I sent it back to DJI for repair. We'll see if they charge my DJI Care or accept responsibility. Will advise.
 
I'm sorry to disappoint after you spent so much time analyzing the data, but I sent it back to DJI for repair. We'll see if they charge my DJI Care or accept responsibility. Will advise.

No problem - that may have been the best solution anyway.
 
So.... I am flying my MP over my house and up about 115'. I was testing my RTH button. I was so excited because, the drone returned to the exact same spot 4 times in a row. THEN... I flew it a 5th time and hit the RTH, the drone came over the home spot, flew in wide circles, until it crashed into the branches of a tree. :( Why would it fly home perfect 4 times and the 5th time it messed up? It was flown from the same spot every time. Also I would add, there is a 9.5K solar array on my roof. Would that interfere with the compass?
 
Flight Records
 

Attachments

  • DJIFlightRecord_2018-07-04_[12-47-10].txt
    161.6 KB · Views: 3
  • DJIFlightRecord_2018-07-04_[12-50-19].txt
    91.3 KB · Views: 0
  • DJIFlightRecord_2018-07-04_[12-52-20].txt
    98.2 KB · Views: 0
  • DJIFlightRecord_2018-07-04_[12-53-59].txt
    202.2 KB · Views: 0
  • DJIFlightRecord_2018-07-04_[16-09-30].txt
    9.6 KB · Views: 0
  • DJIFlightRecord_2018-07-04_[17-25-07].txt
    44 KB · Views: 0
  • DJIFlightRecord_2018-07-04_[17-27-45].txt
    64.4 KB · Views: 0
  • DJIFlightRecord_2018-07-04_[17-29-09].txt
    103.1 KB · Views: 0
  • DJIFlightRecord_2018-07-04_[17-30-46].txt
    65.3 KB · Views: 0
  • DJIFlightRecord_2018-07-04_[17-32-11].txt
    133.2 KB · Views: 0
More Flight Records
 

Attachments

  • DJIFlightRecord_2018-07-04_[17-35-14].txt
    138.8 KB · Views: 1
  • DJIFlightRecord_2018-07-04_[17-38-04].txt
    107 KB · Views: 0
Lycus Tech Mavic Air 3 Case

DJI Drone Deals

New Threads

Forum statistics

Threads
130,592
Messages
1,554,170
Members
159,596
Latest member
da4o98