[Crash] Compass/Mag problem

Hello everyone,

I am having a hard time analysing this log. I just made the new version of my drone, where I changed a GPS Here2 for a Here3 and I decided to lower (remove the support) the GPS as I have seen other drone builders are doing.

I knew this could have some problems with the GPS signal, but in the tests I didn’t have much problems.

Yesterday, the drone made its first flight. No PID, just the basic calibration in order to check the mechanical design.

Today, I wanted to start a PID tunning and I began to change the FLT params. After doing this, I just wanted to check everything was OK before beginning the PID so I gave it a try to fly in LOITER mode.

As soon as I was in the air, the drone began to move in a big circle. Other drones used to do that before I did the PID but in smaller circles. As I tried to land the drone starts to move faster and faster, and (gladly I have the kill switch activated) I just stop the motors. Just some landing parts broken.

What is really driving me crazy is that, as I though it was a GPS problem I tried to fly (without landing gear) in ALTHOLD mode and the drone this time was OK. Then I changed to LOITER and it was OK too !!

I began to check the logs, and I think the Yaw of the drone was tilted 90° west. I though this was the reason why the drone moved strangely as maybe the Roll and Pitch could be reversed from my point of view but this was also the case for the second flight, where it flew OK, so I don’t understand.

I leave for the moment the log of the first flight and as well as the telem log.


Thank you very much in advance for all the help even if it is a little observation.

This was a mistake without first setting the Initial Setup Parameters in Mission planners Mandatory Hardware section.

May be I was not completely clear. I did:
Radio Calibration
Accel calibration
Compass calibration
ESC calibration
Motor order (I’m using AUX as I want to test later DShot)

What I didn’t parameter was the coeff of battery for voltage and current, and some other things like the rates of telemetry or the second GPS I have or the SYSID. So what I did was just the minimum to fly.

The setup you list here is important but there’s one more step. What Dave is talking about is the initial PID controller setup. The defaults only work for certain situations. You need to make sure that your basics are setup for your machine. The good news is there is a simple setup in MP to do all the math for you. Check out: Setting the Aircraft Up for Tuning — Copter documentation

1 Like

You were clear but it’s not the minimum to fly. It shouldn’t have left the ground without the Basic Initial parameters configured. Start here: Tuning

1 Like

According to this seminar about log analysis ArduPilot Log Analysis Seminar 16th August 2021 - YouTube, I checked the EKF3 innovations , and it looks like something went wrong with the EKF ?

In this graph you can see that you get 3 messages "EKF_YAW_RESET " after takeooff, and that the more you stay in flight, the more data is rejected by the ekf (variance above 1 especially Velocity ?)…
Also, there seems to be a "GPS Glitch error " ?

@dkemxr , could the yaw reset be caused by this lack of parameter configuration ?

(i hope to be useful, I am not an expert in log analysis)

Probably not but you are right that the EKF was not happy.

Do you have any idea of why ? I’m curious because I also had some GPS Glitch errors happening during some flights, and I do not completely understand why they occur and how the EKF works…

In this case the GPS was seeing 12 stats with a good HDOP of 0.9.
The compass was calibrated according to @Luis-Sanaria , and I don’t see any weird measurements on MAG.
I really don’t get why the gps would cause such a speed error…
As they say, they are using the Here3 GPS, which is pretty reliable IMO, even if they “lower it by removing the stand”…
Could it be caused by EM interferences caused by the drone’s body being closer ?

No. Sometimes you can see in the log a longer delay than what it’s configured for (GPA>Delta vs GPS_RATE_MS) but that’s not the case here. I typically choose which constellations to use rather than leave it as default. The GPS_GNSS_MODE parameter. Choose which are available to your location.