Error terrain alt variance

Got this error constantly when taking off in an Auto mission last week. The EKF terrain bar is pinned red so I come back down and land. Only happens when climbing… So being this was a job, just ascended real slow keeping the Terrain bar in the orange and at mission alt, bob’s you uncle. Job done and I’m not using that unit for two weeks so I thought I could put it off. Well, getting the same thing on my other units now. Is it possible there’s something up between mission planner and 3.4? BTW, I updated to the latest MP beta with the same results.

It’s a known bug (just a reporting problem, not really a problem in the EKF) in 3.4-rc5. It’s already fixed in master and will be included in rc6.

That’s awesome. So just ignore it for now? Error messages and red bars freak me out. Especially on a 1300mm X8!

There’s no way it will trigger a failsafe right?

No failsafe, no. You only need to worry about it if you are using a range finder with the EKF.

Thank you for the response : )

“You only need to worry about it if you are using a range finder with the EKF.”

@OXINARF
Well I’m using a Lidar-Lite V3 so do you care to elaborate?

Sure. The EKF uses the range finder in two cases: you are using optical flow (and have configured the EKF to do so) or you are using the range finder as a height reference (and configured the EKF to do so with the EK2_RNG_USE_HGT parameter). Those are the two cases where the terrain altitude variance is important.

For the second by using the range finder as a height reference for Auto Terrain Missions it was suggested not to change the EK2_RNG_USE_HGT from the default of 0 to 1. Do you agree and when would someone want EKF to use the range finder as a reference when it operates correctly in the master or rc6?

This might be confusing but the range finder can be used for different things. When you talk about being a height reference for “Auto Terrain Missions” you are talking about terrain following. In that case, your vehicle is supposed to maintain the same height to the ground.
The EKF tries to have an accurate “absolute” height - so when your copter doesn’t move up or down the EKF height value should stay the same. This isn’t so easy as the sensors available (baro, IMUs, GPS) to the EKF are noisy and some change with temperature. The height provided by a Lidar is much more stable. So when you use EK2_RNG_USE_HGT (and it’s a percentage, so 0 to 100, -1 to disable which is the default) the EKF will try to use the Lidar to have a better height estimate, but only uses it when it estimates that the terrain isn’t changing.

I hope that I was clear enough. It’s not easy to explain the EKF and I think that if you can’t fully understand what EK2_RNG_USE_HGT does, then you shouldn’t use it. And by the way, as far as we know, it is working correctly in rc5.

Yes I’m talking about terrain following. I’m only using it as I understand it’s the only way to be sure the range finder is being used during the mission. Example being the video “Terrain Following Mission at 2m”. I need this accuracy at low altitude on flat terrain. Is there a way to use the range finder as the primary height source for a relative mission instead of what I’ve been trying to do today using the terrain missions?

That depends on what you need. Do you need to always maintain the same height to the ground? If that is what you need then terrain following is the right choice.
If you don’t want to always maintain the same height to the ground and have a flat terrain (and aren’t flying at high speed) you can use the EK2_RNG_USE_HGT option which should give EKF a more accurate height.

These two options overlap on some scenarios, which is why it’s not easy to say what you should or not be using.

I have noticed a downwardly bias in the Z axis, i.e. up down with respect to the world reference due to vibration induced bias in some accelerometers giving a false drop in height, static test your Z accelerometer from zero to full prop power, see if you get a vibrational induced error in the accelerometer Z value (very common)

Especially important if you are not single order kalman filtering your hight. I.e no sonar (wont work ovèr 10-15 meters or laser altìmeter above that or using variable height opical flow dimension methods)

AC3.4-rc6 will be out later this week and includes the correction to not report the EKF terrain variance unless the EKF is using the range finder (normally only done when using optical flow).