Issue with copter ascending unexpectedly in Loiter mode in foggy weather

I’m seeking assistance for an issue encountered with my copter, which is running on ArduCopter version 4.1.3 with a Pixhawk 4 flight controller.
During a flight on a foggy day, I ascend the copter to approximately 40 meters in loiter mode. Then I centered the throttle, but the copter continued to rise. Adjusting the throttle downward resulted in the copter remaining stationary, neither ascending nor descending. The ascent only ceased upon changing the flight mode.
The copter is equipped with a rangefinder, which consistently displayed a reading of about 1.5 meters throughout the flight. I understand that the copter utilizes the rangefinder at low altitudes to maintain height. Given the incorrect readings from the rangefinder, I’m curious if there’s a way to disable its use for altitude holding to prevent such risky situations. However, it’s crucial for me to retain rangefinder functionality for precision landing purposes.
I have EK3 enabled and have experimented with various settings, including setting AVOID_ENABLE to “1”(Fence only), AVOID_ALT_MIN to “0”, and trying both “-1” and “0” for EK3_RNG_USE_HGT.
My rangefinder is capable of functioning up to 100 meters, but I’ve limited its range to 25 meters through the RNGFND1_MAX_CM parameter, as its accuracy depends on the reflective properties of the surface below.

Below is the link to the log file of the flight:

Thank you in advance for your assistance.

Consider updating to ArduCopter 4.4.4 or newer. It might work as expected there.

Thank you for your suggestion.
I have updated my copter to ArduCopter version 4.4.4 today.
To replicate the inaccurate readings from the rangefinder, I placed tape between the copter’s legs. Sadly, I encountered the same issue: While in Loiter mode, the copter continued to ascend even though the throttle stick was positioned back to the center.

@amilcarlucas Thank you for your earlier suggestion to update to ArduCopter version 4.4.4. Unfortunately, I encountered the same problem as i mentioned above.
Given my tests, I’m wondering if there’s a specific parameter I might have overlooked that could prevent the rangefinder from being used as the primary altitude source at low heights?
Or could this issue be indicative of a bug in the ArduCopter version?
Your insights on how to address or work around this problem would be greatly appreciated, as I rely on the rangefinder for precision landing but need to ensure safe altitude control.

If the range finder tells that altitude is 1m and the copter should fly higher than that, it will keep on climbing. That is not a bug. That is expected and desired behaviour.

Fix the source of the problem, bad rangefinder readings.
You can filter it a bit, but ultimately the rangefinder needs to deliver correct data

I agree to @amilcarlucas.

You can try the RC option 10 RangeFinder Enable to manually disable the rangefinder in this case. But this is of course more or less a workaround.

Playing around with the RNGFND1_MIN_CM parameter (I think, the AVOID* params are the wrong idea) will not really help. If you set RNGFND*_MIN_CM i.e. to 1,5m and your rangefinder gives wrong readings with 2m, the problem is back again. What rangefinder type do you use?

Thank you, @amilcarlucas and @fingadar, for your insights.
The foggy weather was the factor causing the rangefinder (Lightware SF20) to malfunction, as it normally works reliably up to 40 meters even on surfaces that aren’t highly reflective.
I have a companion computer on board and plan to monitor this behaviour and, based on your advice, I will disable the rangefinder during flights when unexpected climbing is detected.
I am curious, have you or others encountered similar issues with bad rangefinder readings in foggy weather?

I’m actually encountering the same behaviour with foggy weather. There is also an 6 year old issue about that.

@amilcarlucas it does make sense that if the altitude rangefinder is stuck on a wrong altitude value the copter will keep on climbing (or descending), but I think this is far from desirable, at least from the user point of view.

I think a possible solution could be to add some sort of sanity check for rangefinder. From a first look on codebase it seems that the altitude rangefinder is considered healthy only from rangefinder data itself.

If someone has any suggestions about that I could try to add some cross checks with other sensors or EKF outputs. The main issue is that the altitude reading from rangefinder could be much different from other altitude source, but still be right in case of uneven terrain.

1 Like

Get a better range finder, or deactivate it’s usage via a switch in the RC transmitter.
Look at RCX_OPTION == 10 Auxiliary Functions — Copter documentation

1 Like