DCM Yaw inconsistent by 68 deg after battery change

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.

I would like to add that we got the same error and its the first time I’ve seen it, and this was on a brand new build.
Let it sit for some time and it didn’t go away.
Rebooted the system (power down) a couple of times and let it sit, still the same error.

In the end I picked it up, moved it about and did 360 rotation, put it down a meter from where it was and the error disappeared.

This is a large copter with a 6 layer centre stack and the external is mounted on a standoff on the top of the stack, 20cm from the PDB and 13cm from the closest battery.

In all the this time working with AC this is the first time I have encountered this error.

@Harald, @mboland, @sergbokh,

Thanks for the report on the “DCM Yaw inconsistent” pre-arm message. I think this was added to Copter-4.0 as an additional safety check of the attitude before takeoff but I’ll bring it up at our weekly dev call tomorrow and consider removing it. Copter never falls back to DCM so it might be OK to remove it especially if we are finding there are more false positives rather than real issues.

By the way “DCM” stands for “Direct Cosign Matrix” and it is attitude estimation system that pre-dates the EKF (mentioned on the wiki here)

I’m working on a smaller 7" build and experienced this error as well when using a Li-Ion. I don’t encounter the error when using a Li-Po.

This is normal situation if you have calibrated compass with a Li-Po and then uses Li-Ion. And vice versa.
Because they has different magnetic field straight and orientation.

2 Likes

We’re seeing this now too, AC 4.0.2 yaw inconsistent 33 degrees, quad immediately does a yaw (of about 30 degrees or so) on lift-off.
I’ll get the log…

We’ll try a compass calibration later today and Log Disarmed, but you can clearly see the effect in this log:

“14:34:31 PreArm: DCM Yaw inconsistent by 33 deg”

image
Orange line = Desired Yaw , Blue line = Yaw
It does this every flight now, and after the takeoff and yaw correction, Yaw and Desired Yaw are perfect.

Some may pick up that the DCM Yaw message and timing on the log graph (pictured) dont match up - this is true. The message appears later while in flight it seems, despite being labelled as a PreArm message. The message was visible on the OLED display while landed.

Despite all that - the actual effect is the radical yaw movement on lift-off.

Params from log file:
COMPASS_AUTODEC,1
COMPASS_AUTO_ROT,2
COMPASS_ENABLE,1
COMPASS_EXTERNAL,1
COMPASS_LEARN,0
COMPASS_ORIENT,0
COMPASS_PRIMARY,0
COMPASS_USE,1
COMPASS_EXTERN2,0
COMPASS_ORIENT2,0
COMPASS_USE2,1

We’re going to try COMPASS_LEARN,3 and fly around in AltHold, after learning COMPASS_LEARN should set itself to 2.
And will report if this has any effect on the Yaw during takeoff, or the DCM message.

EDIT: cant post so many replies in a row, so editing my last post

Yaw on lift-off solved: updated
I thought it was pilot error, but apparently not - he just learned to compensate for it during arming and lift-off. I’ll keep looking for the actual cause and fix.

Yaw overshoot solved, updated but not reported in this discussion earlier:
A niggling yaw overshoot issue - Compass/Motor calibration helped but the solution was to increase ATC_ACCEL_Y_MAX

DCM Yaw inconsistent not solved
This message still appears sometimes, usually while actually flying.
Unable to tell what’s causing this, except GPS positioning and GPS speed have been particularly bad the last couple of days, and it can take quite some time to get a good 3D Fix for arming. I always put it down to North Korea missile launches…

General observations
COMPASS_LEARN 3 seems to work OK, you need to also disable Fence and use AltHold or Stabilise. COMPASS_LEARN resets to 0 after a successful learning flight.
COMPASS_LEARN 2 didnt seem to make “DCM Yaw inconsistent” go away either, but didnt have any adverse effects, maybe it’s good to leave in place. I thought this was actually the default for Copter, but maybe not.

I’ll keep looking over the numerous collected logs to see if I can spot something.

Edited for more updates

Hi @rmackay9 ,
here’s a log with “DCM Yaw inconsistent” occurring. We’re seeing it come up during flight or after landing. It seems to be happening more and more lately.
Numerous compass cals and compass/motor cals are already tried, the craft is flying really well. Hnotch is enabled too.


There’s also some other messages that we dont normally see:
EKF CHECK: EKF CHECK BAD VARIANCE
EKFINAV FAILSAFE: OCCURED OR FAILED TO INITILIASE

Hopefully you can see something in there that’s causing it - or rule out any serious issues.

Hi all,

We have the same problem with our copter.
We use a 6s10p 18650 battery.
2 compass from PNI ( front one, closer to PDB is not used in flight )
2 GPS unit M8N
AC 4.0.3.

I Performed compass, compass/mot and in flight offset calibration of compass. We have inconsistent results with different batteries. They are all identical manufactured and assembled with same cells, kemestry, supplier.

If we perform calibration with one, some of them react the same with good EKF and correct magnetic reading during flights, some other allow us to have stable flight if we take off facing north or not stable flight ever…

Here you can find 2 folders named “Good battery” and “bad battery” with relatives flight logs. Pictures were taken within 1 second since the aicraft reach the requested heading with relative fast movement to avoid false reading.

As you can see from pictures inside “bad battery” folder, if the aircraft take off facing north, EKF compass is pretty low, as soon we rotate away from north, it jump to maximum but the aircraft is still 100% controllable doesn’t do any toilet bowl.
If we take off facing away from north, it keep stable hovering after take off but as soon I push forward ( or any other directions ) Aircraft starts to veering left or right and it only correct ( most of the times ) just if I move it back and forward for 50-100m once or twice, than -I think- compass re-calibrate and is flyable.
We tried in the past many different compass sensor, HMC5883, LSM303D and last PNI RM3100.
We tried to add ground connection to battery case ( made by carbon fibre )
We tried EKF3, we tried flying without compass/mot calibration, using only front compass, using both compasses. Nothing has solve the issue.

All this test were performed with consistent results on 2 aircraft that are identical.

This situation is the same of this ticket Compass calibration is ok for few flights than heading is wrong or toilet bowling

Hi Randy @rmackay9
Any hints on the DCM messages? Do you think there’s some underlying issue that’s made the DCM messages appear lately, or can they just be wiped from existance?
Are these logs any use at all?

Another log, this time with
PreArm: DCM Roll/Pitch inconsistent by 14 deg
PreArm: EKF compass variance
after the flight. There’s some other messages too, but not sure if they’re related or caused by too much acro flying… Some might say there’s no such thing as too much acro flying!

https://plot.dron.ee/AmKD

This yaw at arming and take-off is still tricking us and we cant figure out what’s causing it:


In this image you can see the arming yaw go to 2000 then come back to 1500, but desired yaw and yaw stay separated for a while (and the craft physically yaws on take off) but for the whole rest of the flight desired yaw and yaw are tightly coupled.

UPDATE
Disabled the onboard compass and just left the external (GPS) compass enabled, and also turned off the Learning:
COMPASS_USE2,0
COMPASS_LEARN,0
And another test flight has no such warnings or errors. I’ll keep an eye on this and see if it continues to hold true.
It may be that the internal compass is going faulty, since it’s never given us issues before, or maybe the COMPASS_LEARN was interfering - unsure and would like to hear opinions.

Also I set:
GPS_GNSS_MODE,67
which I think suits Australia (and maybe most of the globe) and it’s cut down our “stand around waiting for 3D fix” time from minutes to almost no time at all.

Hello, we are facing more or less same issues with RM3100. It calibrates great and overall flies great but EKF goes crazy when turning around copter in flight, same as your description. We fly with Lipos so not a battery issue.
One strange thing i noticed is that if you go in mission planner tuning panel and select the 3 axis of the magnetometer and turn it around on the table you would expect that only one axis changes but we have 2 of them mixing. Maybe there is a problem with the RM3100 driver?
Orientation is correct because we placed on the aircraft exactly the way drotek says on the manual.

Hi Corrado,

I don’t think is a RM3100 issue. We faced same issue also with other compasses.

I’m “happy” that you faced the issue with Lipo too.

Do you have 2 axis move in mission planner tuning while turning the copter on the table?

Was this ever decided upon in Dev meetings? We are seeing some DCM issues, but we are running 4.1dev, and have been for months with little to no issues.

Which battery cell orientation results in a toilet bowl and which in not?

I didn’t tested if one orientation works better that another. I believe both may be OK.
My point was you need to always keep same orientation: for compass calibration and for flights