AHR2 alt vs EKF1 PD with AHRS_EKF_USE = 1

I was bench testing ArduPlane 3.2.2x and noticed that my alt was drifting all over the place in Mission Planner 1.3.18. The alt was drifting about 10 meters in 10 seconds. However, I do not observe the same behavior with ArduPlane 3.2.0.

Given that AHRS_EKF_USE = 1, from what I understand the AHR2.alt is roughly equal to home.alt + state.position.z so AHR2 should track -1*EKF1.PD + constant offset in the log. However, I observe that the AHR2 alt moves all over the place in the log. I check the baro alt and EKF1.PD and they booth seem to be outputting reasonble values. This behavior stops when I arm the plane however,the ahr2 alt becomes stable. When I disarm the plane the drift in alt starts again. It seems as if my home.alt was drifting all over the place, not the EKF1 pd. I’m not sure what’s going on and would appreciate some help in debugging this issue. Please find the tlog and bin log from links below. It’s easier to observe the alt drift from the Tlog. I tried to attach them directly but they are too big for direct attachment.

dropbox.com/s/lncffdikpel4hl1/2.BIN?dl=0
dropbox.com/s/hyons2695rid3 … .tlog?dl=0

Thanks a bunch,
Hao

thanks for the report! I’ve reproduced the issue and should have a fix soon