NKF1 logs discrepancy?


This might be a silly question, but I’d rather learn things directly from the developers. I’m working on implementing an extended state observer to estimate the unmodeled dynamics of a quadcopter. I noticed in the code that the NKF logs estimates of the position and velocity, which are obtained using an EKF by sensor fusion. So, I use these variables in my algorithm.

However, I found it strange that the position and velocity don’t seem to be related. The integral of the velocity is way off compared to the position, and the derivate of the position seems to be truer to the flight pattern compared to the velocity. I can confirm this because I saw the quad going up and down over the launchpad dead on. The flight pattern was a straight vertical flight and horizontally steady. Literally, two waypoints one over the other. The figure below shows the position and velocity, as well as the flight trajectory.
My conclusion is that the position log from the NKF1 is more reliable even for calculating velocity. Either I’m missing something here, or the EKF is doing something fuzzy.
I will appreciate if anyone can clear this up for me.

Autopilot board: Pixhawk CubeBlack
ArduPilot version: 3.6.12
GPS: Here+ V2