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

Almost had a fly away with my Mini

OK ... so it's still a mystery why you end up with a disagreement between IMUYaw & magYaw up to 70 degrees ... that's enough to cause what you experienced. And it's also a mystery why the IMUYaw un-noted by all other sensors turns to align with magYaw for a short period & then goes back to disagree with 70 degrees.

As the forums wisest ( @sar104 ) tried to tech me not long ago ... it can also be that something on the Mini itself have been magnetized ... either some gadget attached to the drone or that it have been stored near some magnetic (standing on top of a loud speaker, or in a trunk of a car for instance). If we look at the magnetic field during the flight (magMod) it changes dramatically ... in line with how the Mini pitches, this can if I understood sar104 correctly indicate just that. But again it doesn't explain the IMUYaw movement ... think we have to wait for sar104 to chime in & give us som clarity ;)

View attachment 103457

I'm pretty sure that this is either a compass problem or a rate gyro problem, and not a simple case of magnetic interference at startup. The key here, I think, is to compare the magnetic yaw, IMU yaw, and the yaw computed purely from the rate gyros (not in the log file - you have to derive it from the quaternions). That shows the following:

yaw.png

After initialization the values diverge as the aircraft is moved and placed on the ground. That's inconclusive in terms of cause. After takeoff, note that the FC sees the discrepancy and increases the magnetomter data weighting in the sensor fusion algorithm to converge the IMU yaw with the magnetic yaw. That's not a real rotation though, as seen from the inertial solution.

At around 30 seconds the aircraft starts moving and the FC appears to have new code (relative to previous firmware) that detects that the yaw is inconsistent with the aircraft attitude and direction of motion, and applies an abrupt second correction to fix the IMU yaw.

So how do we determine whether it is the compass or the rate gyros that are wrong? After takeoff the changes in yaw as recorded by the rate gyros and the compass broadly agree - they just have different starting values. If the aircraft was pointing at the sunset at takeoff (sunset was at 320° which is -40° yaw) then the inertial yaw (-41°) is correct and the IMU yaw (-91°) is wrong. Also, the FC IMU yaw correction at 30 seconds indicates that the magnetic yaw was inconsistent with the aircraft movement. Those two observations suggest that the compass was reading incorrectly in flight, which suggests that it requires calibration and, possibly, that the aircraft has become magnetized.

The magnetic modulus is not way out of spec, but it has more variation than normal:

magmod.png

A definitive test would be to take off with the aircraft carefully aligned pointing north (or any other known direction) and then rotate the aircraft through several rotations CW and CCW. The resulting DAT file should contain plenty of data with which to diagnose any problems.
 
  • Like
Reactions: slup
Do I understand correctly that this shouldn't have happened (ok, this one obvious...) and I should've been prompted to do compas calibration before taking off (not so obvious, I guess)?

What you're saying for me to do, is to calibrate the compass (even if it does not suggest to do so, ok thats normal) and then fly up (any advised height? As I would be super careful this time and maybe get up to 30 meters max) and rotate 2 or 3 full rotations clock wise, then stop and then rotate 2 or 3 times counter clock wise? After that I should export DAT files and share them here. Did I get you correctly @sar104 ?

Sorry if this sounds obvious, but as English is not my primary language, I want to make sure I got you correctly.

I have also reported this to DJI support with all the data earlier today. I will avoid another flight and wait for what DJI will respond with. I really don't want to loose my mini, when they might request it to be shipped to them for replacement.

I will definitely let you know what will be DJI support response and then will see if I can make the test.

Thanks a lot once again for all the efforts looking into my issue.
 
Do I understand correctly that this shouldn't have happened (ok, this one obvious...) and I should've been prompted to do compas calibration before taking off (not so obvious, I guess)?

What you're saying for me to do, is to calibrate the compass (even if it does not suggest to do so, ok thats normal) and then fly up (any advised height? As I would be super careful this time and maybe get up to 30 meters max) and rotate 2 or 3 full rotations clock wise, then stop and then rotate 2 or 3 times counter clock wise? After that I should export DAT files and share them here. Did I get you correctly @sar104 ?

Sorry if this sounds obvious, but as English is not my primary language, I want to make sure I got you correctly.

I have also reported this to DJI support with all the data earlier today. I will avoid another flight and wait for what DJI will respond with. I really don't want to loose my mini, when they might request it to be shipped to them for replacement.

I will definitely let you know what will be DJI support response and then will see if I can make the test.

Thanks a lot once again for all the efforts looking into my issue.

Actually I'd be interested in seeing the data from a test flight before and after doing a compass calibration, but I understand the reluctance to fly. Unfortunately without those data it will be difficult to determine a fix. It is most unlikely that DJI will analyze it carefully enough to get the answer.
 
If DJI will not respond with anything useful, I will put prop guards on and will do the test between the apple and cherry trees in the garden (with reasonable distance, if you can say so). If it will try to fly away, trees will stop it from flying away. Altitude would be just few feet of the ground then. What do you think @sar104 ? :)
 
If DJI will not respond with anything useful, I will put prop guards on and will do the test between the apple and cherry trees in the garden (with reasonable distance, if you can say so). If it will try to fly away, trees will stop it from flying away. Altitude would be just few feet of the ground then. What do you think @sar104 ? :)

Sounds good. And if you keep it close to the ground the VPS should assist.
 
Actually I'd be interested in seeing the data from a test flight before and after doing a compass calibration, but I understand the reluctance to fly. Unfortunately without those data it will be difficult to determine a fix. It is most unlikely that DJI will analyze it carefully enough to get the answer.
Can it be sufficient to do "the test flight" by hand ..?
 
  • Like
Reactions: sar104
I did "test flight by hand". I did the test in one go - powered everything up, doing rotations, then calibrating the compass and doing rotations again. I also did a screen recording, if that would be needed just in case.
 

Attachments

  • 2020-06-04_08-56-06_FLY017.DAT
    1.1 MB · Views: 4
Last edited:
Yeah ... this looks much better!

Just looking at the disagreement between IMUYaw & magYaw ... still 50-60 degrees before the calibration but to a healthy around max 10 degrees after. Note that the disagreement peaks in north-south direction.

1591265932831.png

Adding in the magnetic field modulus (magMod in Red) ...

Before calibration:

1591266088996.png

And after the calibration, note now how much better the AC's internal mag field is compensated for in the magMod graph:

1591266130699.png

I would say you're good to go ... let's see if @sar104 want to add something.
 
@slup that sounds promising.

Meanwhile DJI support responded that they are analysing the data. Interesting what they will say.

What I actually would like to do no matter what DJI support will respond - I would like to keep my Mini unused for day or so and do the "test flight by hand" procedure once again (without prior repeated compass calibration) to check if compass didn't go out of "whack" once again just after being unused for some time.

After this experience it seems I will be doing compass calibration much more often that DJI Fly app prompts me to.
 
Yeah ... this looks much better!

Just looking at the disagreement between IMUYaw & magYaw ... still 50-60 degrees before the calibration but to a healthy around max 10 degrees after. Note that the disagreement peaks in north-south direction.

View attachment 103580

Adding in the magnetic field modulus (magMod in Red) ...

Before calibration:

View attachment 103581

And after the calibration, note now how much better the AC's internal mag field is compensated for in the magMod graph:

View attachment 103582

I would say you're good to go ... let's see if @sar104 want to add something.

Agreed - that looks much better.
 
  • Like
Reactions: Just360
@slup I tried using CsvView app to check for the data myself, but my views are looking a bit different than yours (i.e. last DAT file) - data seems the same, but views are different. What app are you using? If its the same, how did you open those views?
 
@slup I tried using CsvView app to check for the data myself, but my views are looking a bit different than yours (i.e. last DAT file) - data seems the same, but views are different. What app are you using? If its the same, how did you open those views?
Yes, I'm using CsvView ... and always start with open an "Empty" chart, and fill in those signals I want to look at from the signal picker below the chart. The names of the signals used in this case you find in my earlier attached charts & the legend under them.
 
  • Like
Reactions: Just360
@slup, I did a quick test (hand flight) today once again - no compass calibration, drone was stored as usual since last test done. Can you please have a quick look if it seems still all good?
 

Attachments

  • 2020-06-05_10-34-38_FLY023.DAT
    705.1 KB · Views: 6
@slup, I did a quick test (hand flight) today once again - no compass calibration, drone was stored as usual since last test done. Can you please have a quick look if it seems still all good?
Still look's good ... on par with what I see from my MA1, I can see Yaw-magYaw values up to 30 during short periods in a flight sometimes & that doesn't affect anything ... when it starts to be more consistent up to those values I do a compass calibration ... meaning it's rare that I do it. If I notice that the AC are crabbing (going a bit sideways) to much without reason I do it also. Usually it's the time limit or distance limit build into the firmware that forces me to calibrate.

Now I think you can check this of by yourself ... have left the signal picker open in the pic. below so you can see what signals I chose (all from the IMU_ATTI(0) section) ... also if you want to zoom into the graph (which I have done here), either draw a square by mouse click/hold - draw diagonally - release mouse hold. Or use the mouse scroll wheel.

1591345896813.png
 
  • Like
Reactions: sar104
Trying to get same view as you did of last test, but mine looks like this. Looks similar, but I cant find Yaw-magYaw. I guess I am doing something wrong. Could it be that mac version somehow works differently? :)View attachment 103790
CsvView needs to be told that you want the magnetometer calculations performed.
1591382058077.png
Then load the .DAT again.
 
Thanks a lot @BudWalker - I will be now analysing all previous data as well to understand how those conclusions were made from data perspective.

You guys are awesome @sar104 @slup thanks a lot.

Still waiting for DJI to respond.
 
  • Like
Reactions: slup
Lycus Tech Mavic Air 3 Case

DJI Drone Deals

New Threads

Forum statistics

Threads
131,222
Messages
1,561,014
Members
160,176
Latest member
Tore Korsnes