Errorous readings with SF40c

I am currently testing avoidance with a SF40c lidar sensor and have a problem, that the copter suddenly brakes even though objcets are further away. In the logs it can be seen, that there is some issue with the readings from the sensor. There are some spikes down to 4.33 meters, but otherwise the readings are correct. Anyone else experienced a similar issue?
Using copter 4.0.4 with CubeBlack

Logs: https://we.tl/t-yALaSkX39F

Were you flying in foggy conditions?

HI @Hoehenarbeit
There is this very common problem that when a copter pitches forward aggressively… The lidar may pick up the ground as an obstacle. Can you verify by looking at your pitch and altitude logs?

This problem has improved a lot in the current master (4.1 dev) with the Path Planning algorithms.
EDIT:
I just saw that you have uploaded the logs… Didn’t see them before.

My guess might just be right…

No, sunshine and clear skies.

Unfortunately that is not the case here. This a large hexacopter meant for surveying and carrying heavy payloads and not a racecopter.


Also in the logs you can see, that the copter was flying almost level at around 9m altitude, when the obstacle spike occured. As a result of this the copter pitched and rolled back, because it thought, that it was avoiding an obstacle.

After this event I deactivated AVOID with an auxiliary switch, but shortly after you can see, that there is a second spike down to the same value of 4.33m. Also after landing two more spikes can be seen down to the same value of 4.33m.

I suspect this might be a driver issue. I will test more, this time on a smaller expandable copter and report back.

I can recreate the same issue on a different copter with a different FC (Pixhawk 4). Here I have attached two logs (one recent and one from two months ago), where the problem can clearly be seen: https://we.tl/t-ptt3781uwq
The spikes almost always go down to 4.33m, so it is indeed either a driver issue, or a hardware fault. I will try to contact lightware and see what they say.

Maybe @rmackay9 could take a look a look at the logs? In your testing did you experience such spikes with your unit?

Just to report back, I have sent back the unit to Lightware and they switched the electronics inside. Unfortunately the problem still persists, the only difference is, that the spikes are now always at a value of 4.71m (instead of 4.33m with the older hardware).

Hi @Hoehenarbeit. I don’t know what the issue is, but I have added a low pass filter to Copter 4.1 Beta on proximity sensors. This means these spikes should no longer persist… I understand this is not the solution, but it will at least make the sensor useable.

I tried it with 4.1beta-3, but the copter still sometimes pitches up unexpectedly.

@Hoehenarbeit log would be helpful. In beta 3 we have a lot of logging available. Also please make sure, param PRX_LOG_RAW is set to 1 so that we can see if the filter is working or not