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

Mavic Air Fly Away -- and recovery.

Thanks sar104

Here is the .dat file link. 18-06-24-02-45-19_FLY071.DAT

Hopefully it sheds some light on things.

Agree with what you say below and it reiterates what I said all along - matched with the video, the stick inputs didn't match what the Mavic Air did.

Mike.

Comparison of the flight data with the video demonstrates a significant compass error at the time of the excursion. Before that started, the recorded yaw was 40°, but the video in post #31 clearly shows that the actual yaw was approximately 0°. Then, during the excursion to the west, the video shows that the aircraft completes a full CCW rotation, but the IMU yaw data do not show anything other than a 30° CCW turn.

View attachment 41124
 
Thanks sar104

Here is the .dat file link. 18-06-24-02-45-19_FLY071.DAT

Hopefully it sheds some light on things.

Agree with what you say below and it reiterates what I said all along - matched with the video, the stick inputs didn't match what the Mavic Air did.

Mike.

That's very interesting. The Mavic Air has two IMUs (IMU0 and IMU1) and one compass. For this flight the aircraft was using IMU1. Looking at the comparison between magnetic yaw (compass yaw) with IMU0 yaw and IMU1 yaw shows the following:

18-06-24-02-45-19_FLY071_01.png

The magnetic yaw and IMU0 yaw clearly show the full CCW rotation during the flight excursion at around 440 s, but IMU1 (green) doesn't register it at all. It may be clearer to visualize in unwrapped rotation space:

18-06-24-02-45-19_FLY071_02.png

That would suggest an IMU z-axis rate gyro problem but, curiously, the IMU1 z-axis rate gyro sees the rotation:

18-06-24-02-45-19_FLY071_03.png

The IMU1 rate gyro (black trace) records significant CCW rotation starting at 440 s, although less total rotation than IMU0 or the compass. However, looking at the comparison of IMU0 and IMU1 roll data at that time, a serious problem is evident:

18-06-24-02-45-19_FLY071_04.png

This is not an exhaustive analysis by any means, and @BudWalker might have some additional observations, but to me it suggests either that IMU1 is faulty, or is seriously out of calibration. Have you done an IMU calibration?
 
That's very interesting. The Mavic Air has two IMUs (IMU0 and IMU1) and one compass. For this flight the aircraft was using IMU1. Looking at the comparison between magnetic yaw (compass yaw) with IMU0 yaw and IMU1 yaw shows the following:

View attachment 41153

The magnetic yaw and IMU0 yaw clearly show the full CCW rotation during the flight excursion at around 440 s, but IMU1 (green) doesn't register it at all. It may be clearer to visualize in unwrapped rotation space:

View attachment 41154

That would suggest an IMU z-axis rate gyro problem but, curiously, the IMU1 z-axis rate gyro sees the rotation:

View attachment 41155

The IMU1 rate gyro (black trace) records significant CCW rotation starting at 440 s, although less total rotation than IMU0 or the compass. However, looking at the comparison of IMU0 and IMU1 roll data at that time, a serious problem is evident:

View attachment 41156

This is not an exhaustive analysis by any means, and @BudWalker might have some additional observations, but to me it suggests either that IMU1 is faulty, or is seriously out of calibration. Have you done an IMU calibration?

Thanks again. The Mavic is only a few months old. An IMU calibration was done early on. Only the once.

It went out this weekend for first flight since this and (very slow, careful flight) was fine as has been prior.

Mike.
 
Thanks again. The Mavic is only a few months old. An IMU calibration was done early on. Only the once.

It went out this weekend for first flight since this and (very slow, careful flight) was fine as has been prior.

Mike.

I would not fly it again without calibrating the IMU, and I would then do some test flights and check the logs to see if this problem is repeated. It appeared to be triggered by aileron input.
 
Ok... Here are 2 days of quick flights. I won't comment here but will await info from the pros to have a look.

I did as requested and calibrated the IMU (Did compass as well) on this flight 3rd July.
3rd July - Google Drive

On second flight it said "compass error" and wouldn't take off until recalibrated which was done. 4th July
4th July - Google Drive

Have uploaded both .txt and .dat files.

Thanks again,

Mike.
 
Ok... Here are 2 days of quick flights. I won't comment here but will await info from the pros to have a look.

I did as requested and calibrated the IMU (Did compass as well) on this flight 3rd July.
3rd July - Google Drive

On second flight it said "compass error" and wouldn't take off until recalibrated which was done. 4th July
4th July - Google Drive

Have uploaded both .txt and .dat files.

Thanks again,

Mike.

Better perhaps, but not great. On the first flight the IMUs vs. compass yaw looks as follows;

18-07-03-05-12-05_FLY076_01.png

After the first 150 s or so the IMUs mostly agree, but there are significant deviations from the magnetic yaw. The early disagreements between the IMUs appear to be triggered by multiple CW rotations, and seems to settle down:

18-07-03-05-12-05_FLY076_02.png

Looking at the magnitude of the difference between the IMU and magnetic values:

18-07-03-05-12-05_FLY076_03.png

Those differences are larger than they should be, and are clearly a function of yaw. Plotting the difference against the yaw value shows the following pattern:

18-07-03-05-12-05_FLY076_04.png

The disagreement is maximum when the aircraft is facing approximately south.

In the second flight, things look a bit better:

18-07-04-04-05-25_FLY078_01.png

Plotting the yaw - magnetic yaw differences:

18-07-04-04-05-25_FLY078_02.png

Those differences are still larger than they should be. Plotting again in yaw space:

18-07-04-04-05-25_FLY078_03.png

If that is continuing despite calibrations then I suspect that you have a faulty compass.
 
Hi sar104,

Here is a link to 2 new logs from today - as requested I went to 30m took a photo and did a slow CW circle. Then did a photo and another circle CCW this time.

Log 11 July - Google Drive

Thanks again,

Mike.

OK - I think I understand what is happening, but not necessarily why. Looking at the comparison between the yaw data from the two IMUs and the single compass we see the following:

18-07-11-04-25-17_FLY083_01.png

IMU0 is the active IMU and its yaw value was initialized by the compass data to 41°. I don't know why IMU1 was initialized to 48°. I also cannot figure out why the IMU0 yaw drifted to equal the IMU1 yaw after takeoff, but after that the two IMUs agreed closely.

The more interesting part of the flight is the two rotations where we clearly see a periodic disagreement between the IMUs and the compass. Plotting the difference between the IMU0 yaw and the magnetic yaw against yaw, that periodicity becomes clear:

18-07-11-04-25-17_FLY083_02.png

What this shows is that the disagreement has a period of 2π, or 360°. The rate gyros have no particular periodicity in rotation - it's continuous, smooth function to them, and so a periodicity of 2π, together with the good agreement between them, strongly suggests that this is not a gyro issue. Rotation in a uniform magnetic field, on the other hand, has 2π periodicity, and this kind of variation is what would be expected if the compass were being influenced by a second magnetic field that rotates with the aircraft - i.e. an out-of-calibration compass.

The aircraft is approximately level during flight, and so the x and y magnetometers are measuring the magnetic field components that change most significantly during rotation about the z-axis. However, pitch and roll from the horizontal also bring z magnetometer measurements into play. And of course, in the presence of wind, pitch and roll also display 2π periodicity with respect to rotation about the z axis:

18-07-11-04-25-17_FLY083_03.png

Pitch and roll should obviously be π/2 (90°) out of phase with each other, as expected, and that is approximately what we see. Also clear is that the maximum negative pitch was at a yaw of around 25°, so the wind was out of the NNE. However, the point is that the 2π periodicity of pitch and roll could cause variations with similar frequency in the magnetic yaw measurement if it were sensitive to one or the other. In this case, the correlation between yaw discrepancy and roll is the much better than with pitch, possibly implicating the y magnetometer. However, for the duration of the flight, significant short-term roll excursions do not appear to change the yaw value, making that a less likely explanation.

That leaves the first explanation that the problem is due to a local magnetic field on the aircraft that has not been properly calibrated out, despite your repeated calibrations. Just to check - I assume that you did follow the MA calibration instructions precisely - they are different to the traditional Phantom method.

A couple of followup tests, if you have the time and interest:
  1. Repeat the previous test but with two full rotations rather than just one, and with video running, since that should be able to show actual heading.
  2. Fly back and forth and side to side in a straight line to vary pitch and roll without changing yaw.
I'd also be curious to know what @BudWalker thinks about this, since a successful bad compass calibration seems to be extremely uncommon.
 
  • Like
Reactions: BudWalker
Hi sar,

Just did the test as described above - link here:
14 July - Google Drive

One thing I did see during this test. I waited for a bit, took off and when it was around 20-25m it seemed to yaw to the left (without input) maybe 10-20 degrees? I did the test a second time and it did it again. Both times I was recording, both times I was around the same height. I did the same take-off 2 more times and it didn't happen.

Mike.
 
OK - I think I understand what is happening, but not necessarily why. Looking at the comparison between the yaw data from the two IMUs and the single compass we see the following:

View attachment 42023

IMU0 is the active IMU and its yaw value was initialized by the compass data to 41°. I don't know why IMU1 was initialized to 48°. I also cannot figure out why the IMU0 yaw drifted to equal the IMU1 yaw after takeoff, but after that the two IMUs agreed closely.

The more interesting part of the flight is the two rotations where we clearly see a periodic disagreement between the IMUs and the compass. Plotting the difference between the IMU0 yaw and the magnetic yaw against yaw, that periodicity becomes clear:

View attachment 42024

What this shows is that the disagreement has a period of 2π, or 360°. The rate gyros have no particular periodicity in rotation - it's continuous, smooth function to them, and so a periodicity of 2π, together with the good agreement between them, strongly suggests that this is not a gyro issue. Rotation in a uniform magnetic field, on the other hand, has 2π periodicity, and this kind of variation is what would be expected if the compass were being influenced by a second magnetic field that rotates with the aircraft - i.e. an out-of-calibration compass.

The aircraft is approximately level during flight, and so the x and y magnetometers are measuring the magnetic field components that change most significantly during rotation about the z-axis. However, pitch and roll from the horizontal also bring z magnetometer measurements into play. And of course, in the presence of wind, pitch and roll also display 2π periodicity with respect to rotation about the z axis:

View attachment 42025

Pitch and roll should obviously be π/2 (90°) out of phase with each other, as expected, and that is approximately what we see. Also clear is that the maximum negative pitch was at a yaw of around 25°, so the wind was out of the NNE. However, the point is that the 2π periodicity of pitch and roll could cause variations with similar frequency in the magnetic yaw measurement if it were sensitive to one or the other. In this case, the correlation between yaw discrepancy and roll is the much better than with pitch, possibly implicating the y magnetometer. However, for the duration of the flight, significant short-term roll excursions do not appear to change the yaw value, making that a less likely explanation.

That leaves the first explanation that the problem is due to a local magnetic field on the aircraft that has not been properly calibrated out, despite your repeated calibrations. Just to check - I assume that you did follow the MA calibration instructions precisely - they are different to the traditional Phantom method.

A couple of followup tests, if you have the time and interest:
  1. Repeat the previous test but with two full rotations rather than just one, and with video running, since that should be able to show actual heading.
  2. Fly back and forth and side to side in a straight line to vary pitch and roll without changing yaw.
I'd also be curious to know what @BudWalker thinks about this, since a successful bad compass calibration seems to be extremely uncommon.
I also cannot figure out why the IMU0 yaw drifted to equal the IMU1 yaw after takeoff, but after that the two IMUs agreed closely.

This is similar to what happens when there are enough sats and the AC can compute the declination. The declination here is 11.73° and IMU_ATTI(0):yaw - magYaw becomes 10°. The fact that IMU_ATTI(1):Yaw starts with the right value suggests that it was initialized before the Go App connected and the .DAT started being recorded. Why do you think IMU(0) is being used?

I agree it looks like what you'd expect if the compass wasn't calibrated properly. But, it's confusing enough that there can be other explanations. I suspect that a compass calibration won't change much.

@Miksterr could you do some other tests in addition to the ones suggested by @sar104 ? These don't require a flight. It's all about getting data without having to factor in the response to wind.

1. Hold the AC at arms length and turn through 3 rotations (i.e. you turn, don't turn the AC in your hands). Try to hold the AC level so as to not introduce any pitch or roll..

2. Again at arms length. Point the AC in one direction and then roll the AC left and right followed by pitching it down and up. Turn 20° and repeat the rolling and pitching. Repeat until you've come back to the first direction. Doesn't have to be precise
 
I also cannot figure out why the IMU0 yaw drifted to equal the IMU1 yaw after takeoff, but after that the two IMUs agreed closely.

This is similar to what happens when there are enough sats and the AC can compute the declination. The declination here is 11.73° and IMU_ATTI(0):yaw - magYaw becomes 10°. The fact that IMU_ATTI(1):Yaw starts with the right value suggests that it was initialized before the Go App connected and the .DAT started being recorded. Why do you think IMU(0) is being used?

I agree it looks like what you'd expect if the compass wasn't calibrated properly. But, it's confusing enough that there can be other explanations. I suspect that a compass calibration won't change much.

@Miksterr could you do some other tests in addition to the ones suggested by @sar104 ? These don't require a flight. It's all about getting data without having to factor in the response to wind.

1. Hold the AC at arms length and turn through 3 rotations (i.e. you turn, don't turn the AC in your hands). Try to hold the AC level so as to not introduce any pitch or roll..

2. Again at arms length. Point the AC in one direction and then roll the AC left and right followed by pitching it down and up. Turn 20° and repeat the rolling and pitching. Repeat until you've come back to the first direction. Doesn't have to be precise

Good points. I figured that IMU0 was being used because I had forgotten that the initialization might have occurred before the DAT file was started and also because I forgot to factor in the declination when comparing IMU yaw with magnetic yaw. Very embarrassing. It still leaves me wondering why one IMU was initialized correctly and the other not.

I haven't looked at the latest files yet.
 
  • Like
Reactions: MavicFlyer
Hi BudWalker & Sar,

Link to test as requested by Budwalker. Please advise if ok - I was as careful as I could be. Turned on, armed - disarmed did test 1, shutdown. Restarted, armed, test 2 and shutdown. So 2 distinct logs.

And again - your help is so greatly appreciated.

15 July - Google Drive

Mike.
 
Hi BudWalker & Sar,

Link to test as requested by Budwalker. Please advise if ok - I was as careful as I could be. Turned on, armed - disarmed did test 1, shutdown. Restarted, armed, test 2 and shutdown. So 2 distinct logs.

And again - your help is so greatly appreciated.

15 July - Google Drive

Mike.
@sar104 In FLY093 the gyroZ data isn't consistent with the mag data. It would seem that, at rest, gyroZ has an error of < 1.0°/sec. But, during the three CCW rotations that error becomes 6.6°/sec. I'm supposing that, if actually valid, this leaves the FC always trying correct the Yaw - especially after a rotation.
upload_2018-7-15_7-53-4.png
I looked at a few of the other .DATs to confirm that, at rest, the error was < 1.0°/sec.

1. Is it real? I checked the integration comp that DatCon does for totalGyroZ. I think it's correct, but....
2. Does it matter? Would this actually explain the slow yaw drifting?
 
@sar104 , @Miksterr
I thought some more about this. In particular, the other gyro (Gyro(1)) seems to have the same problem. That would tend to discount the supposition that Gyro(0);gyroZ had an incorrect gain gain setting. Both gyros would have to have the same incorrect gain setting.

That is, unless there is just one gyro that's being used in two IMU calcs. I looked at .DAT retrieved from the Mavic Air, not the tablet. It shows Gyro(0):gyroX and Gyro(1):gyroZ as having exactly the same values. That .DAT was from a very early FW. You can get a copy here
Dropbox - FLY070.DAT

But, this doesn't seem to be the case with the tablet .DATs.

I was asked if the MA should be sent to DJI. I'm thinking yes, since it doesn't look like there is a compelling explanation of the behavior. And, if one develops it will likely be a HW or FW issue that can only be fixed by DJI
 
Last edited:
Hi sar,

Just did the test as described above - link here:
14 July - Google Drive

One thing I did see during this test. I waited for a bit, took off and when it was around 20-25m it seemed to yaw to the left (without input) maybe 10-20 degrees? I did the test a second time and it did it again. Both times I was recording, both times I was around the same height. I did the same take-off 2 more times and it didn't happen.

Mike.

Similar behavior. The CCW turn that you mentioned is in the data. It appears to be due to drift in both z-axis rate gyros, as mentioned by @BudWalker, and is best seen by comparing the time-integrated gyro data with the unwrapped compass data:

18-07-14-04-07-28_FLY090_03.png

You can see that the rate gyros record a slow CW rotation while the compass does not, and at around 75 s the FC attempts to fix that with a CCW rotation that is recorded by the gyros and the compass - the rotation that you noticed.

Unless there are two separate problems going on here, that suggests that the gyros are the source of the problem rather than the compass, and my guess would be that there is a pitch/roll effect on the z-axis gyro that is not being corrected - that's the only explanation I can think of for the 2π periodicity of the error, which looks much as before:

18-07-14-04-07-28_FLY090_02.png

I'm not sure that this is a user-fixable issue.
 
Similar behavior. The CCW turn that you mentioned is in the data. It appears to be due to drift in both z-axis rate gyros, as mentioned by @BudWalker, and is best seen by comparing the time-integrated gyro data with the unwrapped compass data:

View attachment 42498

You can see that the rate gyros record a slow CW rotation while the compass does not, and at around 75 s the FC attempts to fix that with a CCW rotation that is recorded by the gyros and the compass - the rotation that you noticed.

Unless there are two separate problems going on here, that suggests that the gyros are the source of the problem rather than the compass, and my guess would be that there is a pitch/roll effect on the z-axis gyro that is not being corrected - that's the only explanation I can think of for the 2π periodicity of the error, which looks much as before:

View attachment 42499

I'm not sure that this is a user-fixable issue.

Thank you both Sar and Bud again for your time and help. I chatted with DJI today and have dropped it into them personally. Hopefully it gets sorted.

Mike
 
Hi all, another thank you to both Sar and Bud for their analysis of my flight logs.

My Mavic Air has been with DJI here in Australia for nearly a week and they contacted me to say there is nothing wrong with it....

I sent them the logs and more info and they subsequently responded with their own graphs (shown below) saying again there is nothing wrong with the AC.

8d4d7b26693fca482cad1a5f9af95894.png
4d03a46a8b211db9105d9cfe8fe57317.png


Really hoping it is all A-ok when it gets back home.

Mike.
 
Hi all, another thank you to both Sar and Bud for their analysis of my flight logs.

My Mavic Air has been with DJI here in Australia for nearly a week and they contacted me to say there is nothing wrong with it....

I sent them the logs and more info and they subsequently responded with their own graphs (shown below) saying again there is nothing wrong with the AC.

8d4d7b26693fca482cad1a5f9af95894.png
4d03a46a8b211db9105d9cfe8fe57317.png


Really hoping it is all A-ok when it gets back home.

Mike.

That's an interesting response from them, given that their own graphs clearly illustrate the problem.
 
  • Like
Reactions: BudWalker
That's an interesting response from them, given that their own graphs clearly illustrate the problem.
Exactly. I suspect that @Miksterr is dealing with a flight analyst wanna-be and not a DJI engineer.
 
  • Like
Reactions: sar104
Hello again SAR & Bud,

I’ll contact DJI again in the morning (Sunday evening here in Australia) and try again before it comes back.

Am I correct in that the 2 traces on their image should track more closely? Just ensuring I say the correct thing.

Mike.
 
Lycus Tech Mavic Air 3 Case

DJI Drone Deals

New Threads

Forum statistics

Threads
130,585
Messages
1,554,102
Members
159,586
Latest member
DoubleBarS