I’ve buckled down to learn about the EKF data and attempted a new analysis. The tutorial for the EKF at http://ardupilot.org/dev/docs/extended-kalman-filter.html#extended-kalman-filter is very helpful.
EKF3 contains all of the “innovations” for the model. Innovations are the differences between the model and the subsequent sensor data. My first graph plots the EKF3 values for IVN and IVE (GPS velocity vs. model velocity). This looks almost like a square wave with a 12-15 second period during the “upsets” in navigation.
The EKF tutorial notes that “These are an important measure of health for the navigation filter. If you have god quality IMU and GPS data they will be small and around zero” I read this as saying that only the IMU and GPS data are involved here.
My 2nd graph shows IPN and IPE added (GPS position North and East vs model position):
At the beginning of each 12-15 second period, the positions match. But they drift away for the duration of the 12-15 seconds…and then snap back to match. The drift direction matches the direction of the excessive velocity.
Could the compass still be involved. It’s doubtful As shown in the following graph (where I overlay IMX and IMY), there is a gigantic innovation for the magnetic sensors at the beginning of this sequence. But it’s so big that the EKF stops using it for navigation…therefore it can’t be a cause of the subsequent errors:
The next graph, from NFK4 (EKF4) shows SV and SP. These are estimates of GPS velocity and position errors respectively.
Notice that the velocity error occurs and then the position drifts. I conclude that the position drifts off because the velocity was wrong. In other words, the position error is an effect of the velocity error…not the root cause.
If I look at the GPS.GCrs value (and treat it as the GPS course) for the first 10 seconds of this problem, I see impossible values (shown here in red).
The course changes from due south to almost north (330 degrees) in less than 1/4 second. 4 seconds later, it goes from east to north in 1/4 second. It’s a big plane limited to 45 degree bank angle turns, so moves of that magnitude aren’t possible.
Both the GPS and IMU (as part of the PixHawk) share the characteristic of devices that have worked well w/o these errors over the last year. But I can replace the GPS far more easily and it’s less money. So, I’ll try replacing it.