EKF changed to 1 in flight -> Almost crashed

Hello everyone,

On today’s flight, everything were perfect except a near crash in mid air.
After having a look at the log it says “ERR : EKF_PRIMARY:1” assuming it’s switching to the backup EKF.
It might be due to the barometer indicating a wrong alt at this moment for not reason.
The drone made a strange sound and wobble for a second but it was still flyable after that …
I also need to say that I was carrying a piece of metal underneath the drone with the intention to drop it somewhere ( for drop system testing purpose ). I hope this piece of metal is not making interference with the compass.

Here are the logs :

https://www.dropbox.com/s/1bxtfgktaspoph3/ekf_primary_err.BIN?dl=1

Configuration :
Pixhawk 2.4.8
Ardupilot 4.1.5
Multistar 690Kv motors
Hobbyking 30A ESC
12x4.5 Props
BN880 GPS + Compass mounted on a 15cm mast
5500 MAH 4S Li-Po
Tarot 680 Pro frame

Regards,
Hugo

Before the really knowledgeable people get here, I am going to share a quick impression.


First I have to say that your level of vibrations is REALLY high, the measurements seem to exceed 60g with no more than 10-20g being the good performance. This may cause the readings of your two IMU units to disagree by a large margin: the one that is more sensitive - which is usually the primary one and has an index of 0 - gets fooled by large vibrations much more easily.

When Ardu detects that the readings of IMU0 are most likely erroneous, it switches to the backup sensor set, IMU1. This is what happened. However, since the readings have been in a disagreement, the copter thought it is way out of the desired attitude, which resulted in the (temporary) moment of poor control.

A poor but working advice is to disable IMU0 altogether by setting EK3_IMU_MASK=2 until you get vibrations down (most probably, by appropriate works on the mechanical side). Or, alternatively, tell Ardu that the primary IMU is the first one, IMU1, by setting EK3_PRIMARY=1. Of course, once you get to normal flying, it is better to get IMU0 back by reversing these parameter changes.


Second, your copter’s PIDs seem to be way out of tune. Here is the screenshot of how your desired and actual pitches (and also yaws) differ. In a well-tuned quad, these should be within less than a degree. Some proper tuning (beginning with autotune) is highly recommended.

1 Like

Thanks a lot for replying !

Ok i’ll order a anti-vibration plate for my pixhawk it might be the first thing to do.

So by reading your reply, the real question is : how does my hexacopter still fly that great with all those problems you see in logs ? Because IRL it seems to be great !

I’m pretty new to logs & analysing data, I only built simple Ardupilot quads that always worked fine ^^
Btw, what interface do you use to analyse .bin files ? Because the screenshot you show is way more readable than the ardupilot log review default config !

Ok i’ll run a Autotune tomorrow.

Thanks again !

Regards,

Your not fixing those vibrations with rubber. You either have damaged motors or propellers.

The tool is APMPlanner2. This is yet another piece of software similar to Mission Planner or QGroundControl that many praise for good log plotting (and blame for everything else). However, there are few online tools that many people like.

Regarding good flying: it really depends on what you want. For me, a copter is really well-tuned if you can rigidly mount a small HD camera and get a nice picture that does not cause nausea and has no jello effect - without any stabilization algorithm, of course :slight_smile: Or, which is easier to achieve, when it really flies the way you want it with no chaotic stick micro adjustments (acro mode assumed).

Generally, copters tolerate poor tuning much less if you fly more aggressively. From the logs, I can see that it was some sharp braking that caused the copter to lose IMU0. Maybe some maximal accelerations in mission-related parameters can be lowered…

Any of my motors is damaged and my props are brand new I just bought them today …

But those vibrations may be caused by my plate setup ( I put a 2nd stage on the Tarot 680 that is linked with 4 metal spacers )

Here is a pic of what it looks like :

https://imgur.com/a/QdqeDnp

Thanks for the tool :smiley:

The only quad I put a camera on it was a F450 with a 3D Gimbal and footages looked like sh… So I bought a Mavic Pro for this.
But I’m ok with that vision of a well-tuned copter and that it going to be the goal with this one.

Btw, the mission was pretty simple and the speed was 3m/s to avoid any brutal changes …
I’ll check out those accels parameters in Mission planner, thanks for the tip

You may actually have high vibrations caused by your heavy payload, if the way you mount allows it to wobble a lot. (I am no expert in good payload mounting, so I can just say it may be the cause, but cannot provide a good way to fix it).

The speed of 3 m/s is indeed rather small, but it tried to stop quite sharply (I judge by the pitch angle). Maybe not a good deal for a small copter, but could cause a huge mess for this one, especially given that its PID values do not do their job well. Hopefully, with a better tuning this will be no problem for this build as well.

As for mechanics, I do indeed think that the weak mid-plates can also be the (part of the) cause of these large vibrations. It might be that few screws are not tight, or their nuts got halfway out of the plastic (I had this problem in my first F450 clone), or just the material is not up to the load. Hard to tell exactly without a chance to touch though :slight_smile:

The payload is mounted at the frond of the drone ( not very smart, i know but it’s onlt for test purposes )
It wasn’t that heavy, the payload was a piece of metal (30g) attached with an synch audio wire to the hook of the drop system, so it may be because of the location of the payload, but surely not because of the weight.
The plate is, at least seems to be, pretty well screwed and everything is tighten.

I use this plate to take the pixhawk away from power wires interferences ( as the PDB is the main board on which the FC is supposed to be placed ). Not a smart move from Tarot but I didn’t see any tarot 680 pro build with a plate mouted like that so maybe i’m worrying too much …

Thanks for help, i’ll wait tomorrow till the rubber mounted plate arrive, and I think i’m going to get rid of that 2nd stage

That’s a terrible assembly. As @geofrancis suggested I doubt you can fix that with a FC mount plate.

Hey,
Yeah definitely.
I’m working on getting rid of this plate.
And then without this bad idea of mounting the FC like that + flight controller rubber it should be way better ( at least I hope )