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

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:

Hi @ohitstarik,

Any further changes are a significantly larger project. We have an EKF prediction of ground level that we would like to move to but this will be a slower project. We will also need to improve logging around this as you have noted.

There is a halfway solution where we could filter the ground level prediction that should let us set a lower filter value without getting oscillation. However this would be custom code that probably won’t end up in master.

@ohitstarik
I’m experiencing a similar (probably the same) issue and it seems to still be there in AC4.3.5RC1. Is there any other solution you can suggest to overcome it?

Would anybody like to test some code for me?

I could back port this to 4.3.4 or I can provide master.

1 Like

I’ll get that code from github and test it.

@Leonardthall
I’ve checked 4.4.0 dev and all the issues are gone, confirming that the code you suggested was applied.
Thanks a lot.

It was not a noise issue, it was an issue with the terrain following logic when using rangefinder.