Sudden extreme throttle jumps with terrain following

I have encountered an issue, where during longer flights the copter suddenly bumps up all motor outputs to maximum or reduces it to minimum for a split second. After this it recovers and continues on with the mission. I have not had this problem before updating the Here2 GNSS module and my CubeBlack to Arducopter 4.0.5.

Here are the logs from both autopilots (only the primary was in control): https://we.tl/t-alp9L9Ap3k

What could cause this issue?

It could be the terrain data.
If you look closely every hickup has a corresponding quick change in the terrain altitude data.
image image image
This is the only correlating data which timed just before the hickup. Actually it causing an increasing desired climb rate, which translating to increased throttle.

I did look at the terrain logs, but didnĀ“t realise this step, because the change was so small. I do have custom, but very accurate 5m DEM data loaded in MissionPlanner, but set the terrain spacing to 50m, to try to avoid exactly this behaviour. It seems like terrain spacing is not enforced in Arducopter, so now I am in search of another way to dampen this behaviour.

  • WPNAV_ACCEL_Z is set to 100, but seems to be ignored (???) while terrain following.
  • I do not want to limit MOT_SLEW_UP_TIME, because this might also decrease stability.

Do you have any ideas?