Massive amounts of noise on US-D1 radar rangefinder, leads to erratic altitude hold

I’m using a US-D1 as my rangefinder, and there is massive amounts of what i think is noise in the system. When switched to break mode, the vehicle holds altitude fine. when vehicle is above rngfnd_max_cm, it holds altitude fine. While using the rangefinder, the vehicle bobs up and down erratically in a range of about a meter. I’m flying over a grass field and the radar clears all landing gear within its FOV of 43 deg.

I tried changing the rngfnd_filt parameter from 0.5 to 5hz, it changes nothing. Is this parameter not supposed to smooth out the rangefinder signal? CTUN.Salt follows rangefinder exactly.
The top is 5hz signal, bottom is .5hz. separate flights as i rebooted in between, but They’re both synced to 20s.

I’d love any help, especially with why rngfnd_filt is not smoothing the rangefinder signal (if thats what the parameter is supposed to do). Thank you.

The surface tracking by rangefinder has some logics to prevent glitch on it, and this is not the worst signal I have ever saw, are you sure your altitude controller is doing well? Tried to disable surface tracking to check how it behaves only on barometer?

It is always a good thing to post the logs so someone can review and try to help.

yeah ill try to get logs out soon. the altitude hold with just the barometer does well. it’s extremely evident seeing the vehicle start and stop oscillating when surface tracking is on/off. really points it to being a rangefinder issue, esp since I’ve used this rangefinder before on CAN and its precision is very good, it definitely doesn’t jump up/down 30cm.

Here’s the log file for the .5hz filter:

heres the log for the 5hz filter:

Man, I took a quick look here, and your rangefinder signal seems very ok to me…

But I have other consideration about your logs: update your GPSs to the latest firmware ASAP! You are having some messages flooding indicating that you are running out dated versions.

I really do not know if there is anyway to improve your performance, maybe putting EKF3 sources of height on GPS instead of barometer could help you, despite the fact I found your baro signal ok…

And if possible, update to the latest stable ArduCopter 4.3 version.

What sensor is this one exactly? You had to use start using it because of the GPSs here you installed on the CAN bus?

You have increased the filter frequency here, that reduces the amount of filtering. Try setting it to 0.1 or 0.05 Hz. It will respond slower but it will be smoother.

If you don’t want the aircraft to follow the noise as aggressively then you can reduce:
PSC_JERK_Z 1 to 2.5 m/s/s/s

I would start with lower filter setting.

Alt controller is doing fine.

The problem here is that the radar rangefinder is returning ranges that are varying by up to 1m. The only real option here is to reduce the filter frequency further.

2 Likes

Nice, thanks for the feedback @Leonardthall!

Any news on how reducing the filter frequency went?

We havent been able to fly yet. I do remember turning it down to .05 when i was initially doing the testing. If i recall correctly that didnt do anything either, but I will fly again soon and confirm this.

1 Like

ok. Tried to scale these the same. does not look like there’s any difference in noise.

Rngfnd_filt: .1

rngfnd_filt: .5

rngfnd_filt: .05

rngfnd_filt: 0 (should be disabled)

the plot of CTUN_SAlt follows RFND_Dist perfectly (Except for moments of increased pitch/roll, as to be expected)

Logs:
https://drive.google.com/drive/folders/1dJvp7lRBU0cYs1lJYxVd9WMXSGe4KrJA?usp=sharing

Thanks @ohitstarik!

I think we have found the problem. We will let you know when we have something to test!

2 Likes

Could you test this:
https://drive.google.com/file/d/1xaiQ1mYOdmcCQFTQIHtVt91QsGzeT6de/view?usp=sharing

I would suggest RNGFND_FILT - 0.1 and 0.5

2 Likes

That seems to have did it man. rfnd_filt looks like its effecting output data. Thank you for your help. Will this be implemented in master/4.3.3 stable?

at .5 (the center was me flying over the roof of our building)


https://drive.google.com/file/d/1BtYRr2G8JSI-sD8emyY-lNiuJjDOCFmp/view?usp=share_link

at .1


https://drive.google.com/file/d/110A_JWhYU1nBO_6fIZ4k4_nEDH6g4ydl/view?usp=share_link

at .1 the vehicle had a very slow oscillation with a period of a second or two which i chalked up to delayed output signal because of high filtering (a guess) but .5 was doing fine and i wasnt seeing the vehicle bop up and down. the amplitude of the noise seems noticeably lower compared to pre-your fix.

2 Likes

It didn’t make it into 4.3.3 but is going into master. It will go into 4.3.4 if there is one. The code I sent you is 4.3.3 with that patch.

3 Likes

Hello @Leonardthall

Could you share with us the branch where you worked in this patch please?

Here is the PR. It is very small.

2 Likes

Nice catch man!

Thanks for sharing!

so from the looks of it my problem still exists - i’m now stuck between the vehicle bobbing up and down occasionally at .5 or the vehicle oscillating altitude at .3. but this fix definitely changes things compared to before - where changes varying from 5 to .1 would do absolutely nothing, so this fixed the filtering from what i can tell.

Is there any way we can get the filtered rfnd altitude plotted as well as the raw data? its only the raw data being plotted right now. maybe in ctun.salt or a new rfnd.distFiltered parameter.

edit:
moved this to feature request: