DCM Yaw inconsistent by 68 deg after battery change

Have flied one battery with no issues. Then replaced with another one (just the same parameters, weight etc.) After that something strange happened. I’ve got several “DCM Yaw inconsistent by NN deg” messages; despite the good HDOP, I was not able to enter Loiter mode (Loiter requires position msg); Few minutes later after land, it allowed me to enter loiter, but the toilet bowling was just crazy first minute or two.

What was the root cause and how to avoid that?

@sergbokh,

There seems to be a lot of interference on the compass or the compass calibration went very badly wrong because the length of the magnetic field is changing a lot during the flight.

It’s at least partially related to the throttle level (or more accurately the current being drawn from the battery).

I’d recommend moving the compass further from the power wires and/or re-doing the compass calibration and then manually check if the mag field is increasing when the throttle is raised.

By the way I also noticed that COMPASS_ORIENT = 4 which is unusual. It’s possible it’s correct but it’s unusual so I wanted to point it out.

@rmackay9 thank you for your analyzing!
I’m not using a standoff for compass so throttle influence indeed possible.
Compass orient is correct (yaw180)

The confusing thing is that it actually flying great all the time. It is just first 20-40 seconds after a takeoff when it (sometimes) performs a crazy toilet bowling.

So if it can fly with this configuration, am I right the 1-st minute bowling is just a matter of some offsets get reset after battery change or something like that?
Maybe I can just look at some values in the log, when it’s flight stabilized and then put these values to some parameters? Or there are some principal things I’m not aware of?

Please advice.

I would try the in flight compass learning.
https://ardupilot.org/copter/docs/common-compass-setup-advanced.html
towards the bottom of that page, or:

I set mine as a switch on my transmitter (I didn’t see this method mentioned in the docs, but it is in the forum post). Then fly up high away from any sources of interference, flip the switch to learn the new offsets, and it just takes a minute of flying around for it to get a great calibration.

Sergey, what kind of batteries are you using?
If you are using LiIon cells (and not LiPos), their tin foil can be magnetic (and this may vary between batteries).

1 Like

@wicked1 will give a try to get a better calibration.
@Hacky yes, there is 3x li-ion (21700) pack.

Guys, I know my compass might be not calibrated ideally, and it isn’t setup on a standoff, and li-ions are influences compas etc.

Let me clarify my question to not to discuss in a wrong direction. 99% of the time it flies just great in Loiter! If it flies great then the setup is good, does that make sense?
The question about the first teens seconds after a takeoff. Why it is toiletbowling but then good? What parameters it learns at that time?

Maybe because of inflight-compass learning?

1 Like

No, COMPASS_LEARN = 0, I’ve checked after @wicked1 mentioned that.
BTW my compass calibration is not so bad I believe
image

Well done @Hacky! I had never heard of this difference between LiPo and LiIon batteries.

I guess the EKF is learning the offsets after a minute or so. I’m going to stick with my advice that the compass should be raised up from the frame. In general I think a hardware solution to a physical problem is the best approach unless there really is no alternative.

To be accurate, tin isn’t actually magnetic. And I’m not really sure there is actually tin used in LiIon cells anyway. (could be, I have no idea) But tin is only paramagnetic.

By bringing a li ion cell (18650) & a lipo cell near the compass (in a GPS unit) and watching the EKF (Compass) in Mission Planner, you can see the difference.

1 Like

I understand what you mean but cannot fully agree here. Many things in ArduPilot were improved to solve physical problems of hobby-grade hardware. EKF2, EKF3, Notch filters etc.
Sorry, but again: it flies great 99% of time; compass calibrates with good offsets. As a user I don’t understand why this is a physical problem in my setup.

So am I! Do you know where these offsets are in the logs?

@Rob_Lefebvre: It is tin and it gets magnetic during usage. We tried demagnetization but were not very succesfull. You can make your assumptions but better would be actually measuring it… :wink:

1 Like

@Hacky you prompted me an idea that I need to check.
Magnetism is not like radiation, it has a orientation.
And I have two equal li-ion packs, but inattentive me, I made them in a different orientation, so they are 90 degrees rotated
%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5
That nicely answers the question why it often bowling after a battery change.

2 Likes

Same goes for me. I use lithium-ion batteries in all my copters and always have to take into account the orientation of the battery when placing it in. Plus they’re much more critical in terms of magnetic interference compared to a LiPo. They cused me a lot of trhubel in the past…

I’ve also struggled w/ Li-Ions and magnetometers.

I’m going to re-mention the post I deleted above…
I always thought the issue with Li-Ion’s was that they are round, spiral layers, which will produce a magnetic field. I deleted it because I realized ALL lipos are spirals of layers, unlike flat non-inductive capacitors which are a stack of separate layers.

I don’t know a lot about magnetism, but I did just confirm even the shape of a coil affects its inductance and other magnetic affects. So maybe it is related to being round.

Yea, you need to place battery at a reasonable distance from compass. And even if the distance is OK, changing battery-to-body orientation could badly affect.
Sounds obviously, but I did that mistake, because this time my battery pack is of square shape.

Yes, having enough distance between the battery and the compass is mandatory with lithium ion batteries. And in theory you could fly with the battery in a different orientation, but you’d need to recalibrate the compass first.

Hallo. I installed today 4.0.1 rc2 on a quad with 3DR Pixhawk, which has >100 flights. For the first time I got after the first battery change and the secon battery change the message „DCM Yaw inconsistent by 28 deg“. I never had hat before. Unfortunately I can not provide a log file as I did not switched on logging.

BR

Harald

1 Like

The message is something new in Copter 4.
So i think it either a not very good compass calibration or, as I’ve also noted this may occur if you power up the copter and then move it here and there. So you need to leave copter steady and this error will disappear.
BTW as advised above, the COMPAS_LEARN=3 feature did work great for me, I got much more accurate offsets calibration.