EKF2 IMU switching to compass x Messages

3DR Solo
OpenSolo (Copter 3.5)
PH2.1 (Green Cube)

Installed the PH2.1 cube to replace the PH2.0 cube. Getting messages in logs “EKF2 IMU switching to compass 1” and “EKF2 IMU switching to compass 0”. I replaced the external compass and the same messages occur. The messages can occur anytime, but are more frequent around 7 minutes into the flight and beyond.

What’s the cause and how to resolve?

Link to log file: https://www.dropbox.com/s/hda6ipgyayow1kq/RECENT.BIN?dl=0

Jim, Try just turning it off and see if things return to normal. EK2_ENABLE=0

1 Like

Is turning off using EK2_ENABLE=0 for troubleshooting, or a solution?

What is accomplished by setting this to “0”?

Will the flight controller still be able to use both the external and internal compass?

I have replied to your offline message but just for the record turning off EKF2 is just for troubleshooting. EKF2 is the default for 3.5 Copter.

1 Like

Hello Mike and Jim

Copter V3.5.3
APM = PX4

could you tell me more . It seem’s that i am facing same issue
"EKF2 IMU0 switching to compass 1" and “EKF2 IMU0 switching to compass 0” every 30 secs. any thing wrong

have a look to 00000033.BIN
https://drive.google.com/drive/folders/0B_aL-ROXonblWlFzTUd6QVdmbEU?usp=sharing

Alexis, Our nomenclature sometimes gets in our way here. When you say PX4 do you mean you are using a v4 platform or a PX4 based flight controller rather than a Pixhawk based or that you are using the PX4 flight stack?

In doing a little search it seems like a lot of similar reports.

Interesting discusion with Matt about memory problems on the Pixhawk 2.0 with EKF3 enabled. So check to make sure EKF3 is not enabled.

THis sounds the same but with EKF2 switching between optical

I changed EK2_ENABLE from 1 to 0, clicked “Write Params”, and rebooted. Now I am unable to arm. The controller indicates “Calibrating Sensors”.

Mission Planner shows that this setting is only for “making the maths run” and “for flight control need to change AHRS_EKF_TYPE”. Should this parameter be changed from a 2 to 0 to accomplish what you are suggesting?

With EK2_ENABLE set to 0 and AHRS_EKF_TYPE set to either 0 or 2, I get the same results - won’t arm. GCS (Solex and Mission Planner) report “Gyros Stabilizing”.

I changed settings back to original, 1 and 2, and I can now arm successfully.

Interesting did you try EKF1?

There are no EK1 parameters to set and AHRS_EKF_TYPE only lists 0, 2, or 3 as options.

It appears that after Copter 3.3 they made EKF_use=1 default and removed the parameter so it could not be changed. Therefore EKF2 disabled results in just EKF1 being active.
I am running 3.6dev on my Solo brd so I will have to check and see if I have any arming issues with the differrent combinations.

Thanks.
In the mean time, I think I’m going to move the new green cube from Solo1 to Solo 2 to see how that combination works.

My tests are confusing too. I have a Pixhawk 2.0 in the test Solo and with EKF2 enabled I can not calibrate the compass or accel and it will not arm. If EKF2 is not enabled it won;t work either because with the release of 3.5 EKF2 is the default and AHRS uses it.

I don’t think this is a Pixhawk 2.1/2.0 issue myself.

So I can’t arm either. If I turn EKF2 off it won’t arm, if I turn it on the previous compass cal is ignored and it can’t cal.

I just test with a Green Cube and mine acts the same.

Mike, can you share a Green Cube bin log with me? I’d like to compare some numbers to what I’m getting.

Did you get your Solo running again?

Before switching the Green Cube from Solo1 to Solo2 I decided to try one more thing. Instead of calibrating with sweeping twisty figure 8s, I tried just spinning on each axis. While the calibration reported success, the flight logs showed a variance between compasses. I calibrated again with the usual sweeping twisty figure 8s and then all EKF2 yaw adjustment and compass switching messages went away.

Today I switched the Green Cube from Solo1 to Solo2, calibrated, and it to seems to be running fine too - only time will tell.

Now I want to work on minimizing vibrations. Solo1 has over 100 hours on it and I’m wondering if the motor bearings may be causing some extra vibration. Solo2, which has maybe 10 hours on it max, has max vibration peak at 23 in the Vibration 3.3 test. Solo1 can have peaks over 30. It looks like Solo drones in general might have more vibration than other drones. Both Solos have sorbothane between the main board and battery tray.

The other thing that I notice is that running either Solo without gimbal and camera I am getting warnings in the MP Log Analyzer that there is too much variance between min and max motor averages It varies, but has hit 121 difference. I don’t remember seeing this high of difference when I was flying with gimbals.

I really hate magic. Any possibility that you calibrated in a different location that might have a unnoticed magnetic interference? Rebar in a concrete pad, a buried tank etc.
I always use Randy Mackay’s gold standard mag cal dance which is not a figure 8.
I just stuck in a Pixraptor PX4.V2 and it works fine so I am beginning to think this is a problem with the Solo firmware.

I am getting a litany of EKF switching (not sure if this is also related). The heli can be sitting on the ground and it starts.

After spending a week troubleshooting my problems are related to CANbus being enabled. My green cube does really weird things when i have Arducopter 3.6dev on it because that version has the CANbus parameters I need. So I don’t “think” issues are related. My tests show EKF2 running out of memory on the stock cube when CANbus and EKF2 are both enabled.