Survey Flight Suddenly go high!

Today , I have try a survey flight . eveything seems normal . During the flight , It comes a a erro report that show the EKF_PRIMARY changes to 1 . and at the same time ,the drone start to climb very fast. I am so confused about this problem . because I have try many times yesterday , but it had not happend . My firmware is hexa 3.4.6 . Here is the today flight log .2017-05-15 (2.5 MB)

At the time when your copter starts climbing, there too much vibration in the Z axis which will cause this problem.

Check your motors / propellers are well balanced and make sure the flight controller has good vibration dampening.

Thank you for your analising , Maybe it due to the vibe of z , I will check it . What confused me is that why the EKF_PRIMARY change it suddenly start to climb?

I had the exact same issue and I got EKF_PRIMARY-1 also. Though I don’t know the reason of it, after I added more vibration dampening, the issue was gone.

Short version: yes, try to dampen your Z vibrations.

Long version:
You are running two separate EKFs, one on each accelerometer, and they each have an estimate for your current altitude. The EKF_PRIMARY-1 error is an indication that the flight controller switched to using the second EKF, which had a different solution for your altitude. It probably did this because of the Z vibration causing the controller to decide that the first EKF’s solution was not as trustworthy as the second one. Look here:

CTUN.Alt (red) is the altitude that is used by the flight controller. It is exactly equal to -NKF1.PD, which is the first EKF altitude solution. It suddenly jumps to follow -NKF6.PD (orange), which is the second EKF altitude. This is the result EKF_PRIMARY-1 error. The pink lines NKF3.IPD and NKF8.IPD are measurements of how far off the sensor readings are from what the EKF thinks they should be. The sudden jump in the light pink line is the EKF’s filter rejecting the sensor readings.

But there is a more important thing we can see in the pink lines: they both increase at the same time that the Z vibrations increase and also at the same time as EKF altitude increases. In other words, the Z vibrations are causing the EKFs to incorrectly estimate your altitude. The EKF switching made the problem a bit worse because the second EKF was even more incorrect, but ultimately the problem appears to be Z vibrations.

Thanks for what you did . learn a lot from your graph . Still long way to go in the ekf filter .

There’s good documentation on the EKF here, if you’re interested in learning more: