AC 4.0.5 landing gear problem

Is it possible that you disabled automatic landing gear retraction/depolynment only dependent on altitude in arducopter 4.0.5?
I had in arducopter 4.0.3 i had setup, that above 40m it retracts automatically and below 35m it deploys automatically. and it worked every time in LOITER mode. And i need it to be like that. However i needed to upload flight controller to 4.0.5 . i havent changed any landing gear or servo parameter. When i try to retract manualy, it works. However it is not working automatically at all since update retract alt,deploy alt, servox_function all set as before update. I tried to change LGR_OPTION from 3 to 0. Didnt help. Please tell me whats going on.

These are my settings.
As i mentioned i tried LGR_OPTION = 0/3
And i am sure wiring is correct since when i try to raise the LGR manually. it works.
With these settings it worked with 4.0.3
I hope you havent disable this option in LOITER. Because if not, there seems to be a big bug.
@rmackay9 ?

Nobody?
Can at least someone tell me if this option was removed from arducopter on purpose or is it just bug / wrong settings in my case?
BTW. here are my servo settings:
image
Landing gear is connected to aux-2 and with manual deploynment it works fine.
and here is graph which clearly shows that despite the fact drone is above retractment altitude, the signal on AUX-2 is still for deploynment.

No one? Come on. I have to be missing something obvious.

It seems to work OK in the Simulator in Loiter which runs 4.1-dev. So I would guess it didn’t change in 4.0.5 but don’t have an actual craft to test it.

Are you using the same settings as i am?

Using these and monitoring Chan10 output while changing altitude in Loiter.
LGR

So exactly the same settings works for you and dont work for me.

I assume you also have servo10_function set to 29

Yes, right. That’s the channel I was monitoring on the status screen while flying in the Simulator. The only difference I see in the Changelog from 4.0.3 to 4.0.5 is this:
b) Landing gear auto deploy/retract configurable using LGR_OPTIONS param

You had this at o I had it at 3. It’s not clear to me if 0 is a valid value as this is a bitmask value.

As i wrote before, i made some tests also with LGR_OPTIONS set to 3, because i also wasn`t sure how it should be set based on ardupilot wiki. But the result was the same.
Even less understandable is the fact, that when i decide to try to retract LGR with RC channel, it works.
So what really worries me is :
If there is some weird issue with PWM outputs, how can i be sure, the automatic parachute deploynment which is connected to servo9 output will actually happened in critical situation?

Ok. I think i have a solution to my mystery. Yet i was no able to test it yet. Aproximately at the same time as my landing gear stopped working i installed irlock with lidar. I still have my alt_source set to 0, but i think landing gear is taking alt from lidar. Lidar is set to 30m maximum, and landing gear should retract at 40 meters. So that would explain it. I will try that on monday, but i think that would explain it. When i have no lidar connected on small drone, but i have it set exactly the same way as on a big drone, the landing gear retracts how it should.
By the way, only these parameters are different between large and small drone.

Ok. I found the source of the problem.
Whenever lidar is connected, despite the fact that is not set as altsource, the landing gear operates from lidar readings. It is very stupid, because above 35-40m (where my lidar looses signal) it wont switch to gps/baro altitutde readings. So if i set retract at 25m and deploy to 20m, it retracts at 25m how it should, but when it reaches lidar maximum altitude (mine is set in AC to 35m) and goes above what lidar is capable of measure …cca 40m it has none/chaotic lidar readings, the LGR deploys. It is a stupid feature/bug and it should be corrected. When drone goes lower lets say from 50 to 35m and its above retract alt, the lgr retracts because readings are above25m and when it goes lower then 20m the lgr deploys how it should.
So basicly despite the fact that lidar is not set as altsource, it is only altsource for landing gear. Which is bad, because drone usually flies higher then lidar range.