Servers by jDrones

Lidar in AltHold

Hi everybody,
I want to use the BENEWAKE TFMINI plus as an altitude sensor for indoor flights.
Right now I have the drone on my workbench so I am not sure if this will effect my problem.

I set up the rangefinder parameters and i can see the correctly measured distance.
However, the altitude in ALTHOLD mode does not refer to this reading ( picture attached)
Basically the questions comes down to this:
a) The Altitude in the HUD does not equal the altitude the controller uses for its calculation
b) For some reason the controller refuses to use the Lidar Reading for the altitude.

Besides the ones specific to the TFmini i set the following parameter:

Thank you all very much!


I don’t have a lot of experience with indoor flight but it looks like the EKF is unhappy for some reason. Maybe try clicking on the EKF label to see why. I suspect if it gets very unhappy with the rangefinder readings it may stop using them.

By the way, in general we strongly recommend against changing the EK2_ALT_SOURCE to 1 (RangeFinder). We have the following warnings on the terrain following wiki page for non-autonomous modes:

Do not set the EK2_ALT_SOURCE or EK3_ALT_SOURCE parameters. These parameters should be left at “0” (barometer).

Do not set the EK2_RNG_USE_HGT or EK3_RNG_USE_HGT parameters. These parameters should be left at “-1”.

Your case (indoor flight) is the one place where this may be OK though. Just make sure that the ground below the copter really is flat.

Hi, thanks for your help!

Attached you will find a picture of the unhappy EKF. The rise of “position (vert)” is induced by shaking my lidar and this is the highest spike that i could create. When the drone is just standing on the bench and the lidar is just aiming on a surface there is hardly any rise.
I can definitely see that position (vert) depends on the movement of the Lidar.
I think that the EKF is unhappy as I am not using GPS and I am not offering a different position system.

I would have questions regarding this warning as I might be misunderstanding the documentation:
If I would not set those parameters and leave them on default, would my rangefinder actually do anything?

I really want to use this drone only indoors in a lab with a bright and very flat ground surface. The barometer however is absolutely useless as a big AC and ceiling fans create a very mixed atmosphere.

Which parameters would have to be set for this usecase? The purpose of the lidar is to create a stable ALTHOLD for trimming and tuning and to make sure that the drone does not rise for the ceiling (8m height)

Thank you all very much and cheers!EKF_unhappy

1 Like


OK, this sounds like the one use case where setting EK2_ALT_SOURCE = 1 is the correct thing to do. The EKF definitely won’t have a horizontal position estimate so those two red lines are fine.

The altitude that you see on the HUD is the height above home which is different from the EKF’s altitude estimate so I wouldn’t worry too much about the discrepancy.

I think it might be good to walk around with the drone (or at least lift it up and down) and make sure the altitude estimate climbs and descends as expected.

Great! I will set the parameter EK2_ALT_SOURCE = 1 and try out how it works.
Yesterday did try the drone outside with the recommended settings for terrain following
over a flat surface but added a small table in the flightzone to verify the usage of the rangefinder and it worked fine.
I will try out both settings inside now and give an update.

Thanks for your help!

PS: Should EK2_RNG_USE_HGT be set to -1 or 70? if EK2_ALT_SOURCE is set to 1?

Servers by jDrones