Interpreting EMI

Great, looking forward to hearing your results!

Okay had a little break from the rain and here are my results of a quick test. Id like to investigate this more, and glad you brought this up. So it seems to me that these spikes are absolutely related to azimuth. For me, I have these spikes occurring at 0 and +150degrees. At least for today. Like I said, weather isn’t the best here and there are some storm clouds. Could be some relationship there. Going to take a lot more data though since today’s flights showed spikes at different azimuths.

Here are my results:

Test1: 360 degrees in small steps
https://logs.px4.io/plot_app?log=1b64547c-e614-4da8-ad39-a826b6233d6a

Test2: sweeping near zero
https://logs.px4.io/plot_app?log=a26297cd-5d4f-4ee2-bb76-2126a4fe5549

Test3: hold near -150deg
https://logs.px4.io/plot_app?log=35d477d9-4be8-45c5-b8b7-c2109dff73b1

Test4: hold near +150deg
https://logs.px4.io/plot_app?log=8056f2e4-32cf-4a67-b62c-b4b74a461377

Okay cool, this confirms what I thought.

So I suspect what’s actually happening is a hardware bug that happens at the boundary between the low byte (LSB) and high byte (MSB) in the 16 bit word which is the data from a given axis.

See page 32 of https://www.pololu.com/file/0J703/LSM303D.pdf

You will actually find that each axis (x,y, z) have their own “bad spot” (actually 2 bad spots). It’s going to be seemingly random because of the calibration/scaling that is applied to the raw data, BUT if you looked at the raw data from the sensor, you would see that the spikes happen when the raw data is 0 or 255. i.e the LSB is all 0’s or all 1’s.

This sounds like a hardware bug probably having to do with timing and some special condition that the LSB/MSB boundary evokes.

There is no solution for this other than maybe an RMA. I saw this on every single one of the MPU9250s that I tested though, which made me think it was hardware bug that was designed in. It could just be a bad batch of ICs…

Really though this is not really a practical problem (the vehicle will still fly fine) it’s just an annoyance for OCD people like you and I :slightly_smiling_face:

This is an interesting find! looking back at some previous builds with this same exact problems it does seem like there are dead spots in only two places. I have to agree with you, seems like a hardware issue completely. I have one of these builds with me, and an extra flight controller. I will try swapping flight controllers with no known problems and see if I get any different data! I will get back to you when I do! Thanks.

FYI

Seems like the same issue with MPU9250, and firmware is indeed not checking bit 1 of ST1.