When EK2_ALT_SOURCE was on 1, Drone did not change barometer

I have ArduCopter for research. and my drone is equipped lidar.
Exactly, I want to switch baro, lidar. So I set up EK2_ALT_SOURCE was on 1.
And then I tried takeoff 50m.
Lidar Maximum height is 40m. so I think that after relative alt reached 40m, drone’s altitude automatically switch to baro.
But :frowning: I saw that relative alt became weird. -3, -7, -10, -3 … after that, drone falling down.
What should I do for switch baro, lidar automatically?
Please teach me. :slight_smile:

Hi @111164,

For my knowledge, EK2_ALT_SOURCE = 1 use only and only the Lidar.

I suggest to use the parameter EK2_RNG_USE_HGT (Range finder switch height percentage).
If the altitude is higher than EK2_RNG_USE_HGT * RNGFND1_MAX_CM, then the Lidar is not used any more.
For this, you need I think that EK2_ALT_SOURCE = 0

PS. EK2_RNG_USE_HGT is by default -1 (no Lidar used), and maximum value is 70 (70%)

Thank you!!
I have to test tomorrow. Thank you so much.

@KiloNovemberDelta you said EK2_ALT_SOURCE = 1 use only and only the Lidar. I have used maxbotix rangefinder instead of lider. it could be work??

When I say Lidar, I should say “Rangefinder”, which can be Sonar or Lidar :wink:
So yes, it should work in your case