I have a quadcopter with Pixracer running ArduCopter 3.6.2.
am using lightware sf000b rangefinder as the downward rangefinder and as the primary height adjustment source connected directly to Pixhawk.
Flying around 3-4m height in indoor environments. During stationary test conditions, I verified that the sensor was reading good values.
But in flight, I experience several crashes where Downward sensor values decreased randomly for a moment irrespective of the actual distance during flight.
Due to these issues, the drone shoots up and crashed onto the roof.
with Logs analysis seems there are 2 different scenarios:
Sensor value freeze for a certain period (around 2~3 seconds)
Sensor value suddenly decreases and the drone shoots up.
The CTUN.DSAlt value is disappearing when the rangefinder fails. We can see how they happen together by graphing CTUN.DSAlt along with the RFND.Stat1 (status for 1st rangefinder). DAlt disappearing is correct behaviour because the vehicle is switching out of “surface tracking” mode (this is what we call it when a lidar is used to maintain altitude with a rangefinder in manual modes like AltHold, Loiter, etc).
It looks like the EKF2 has been configured to use the rangefinder for altitude which is generally a bad idea (e.g. EK2_ALT_SOURCE = 1). It may be OK to do this indoors (which is where you’re flying) but if you’re flying the vehicle in manual modes it shouldn’t be necessary.
Copter-3.6 is very old now and I agree with @BrunoBagarini that it would be good to upgrade to 4.3 and use the EKF3. The core dev team doesn’t really have the resources to support software that is this old. Although we don’t have an official policy on the matter, we tend to only provide support for the latest 2 versions (e.g. 4.3, 4.2) although sometimes we make exceptions.
I don’t really have any good ideas about why the rangefinder might fail especially after 3min or so. Maybe the 5V power supply from the autopilot isn’t sufficient… maybe an external BEC should be used. I really don’t know though.