Rangefiner on fast speed low Altitude quadcopter

Hello everyone iam start using rangefinder lidar TFmini plus for controlling Altitude above ground in speed around 90 kmh on around 3 meter hight but unfortunately it’s not holding altitude even on very low speed i test it in hovering the rangefinder respond well but when speed up it’s not, any parameters can be tuned to adjust Altitude hold response using rangefiner?

Hi @edfeeoc,

If you can post an onboard log we can have a look.

The most likely issue is that the sonar is not reporting the distances correctly but that’s just a guess at this point.

1 Like

thanks here is the log

I decrease SURFTRAK_TC=0.1 it improve but still losing altitudes even with low speed.

And what is the effect of RNGFND_FILT

Hi did you take a look at the log… :pray:

Hi @edfeeoc,

Thanks for the log.

So it looks to me like surface tracking is working while the sensor itself is providing good data.

Below is a picture of the “Desired Sonar Alt” (aka CTUN.DSAlt) in red and the “Sonar Alt” (CTUN.SAlt) in green and they basically match. There’s quite a bit of noise in the actual but I think that’s because the speed and angle of the vehicle are changing a lot.

When the vehicle is moving very aggressively it looks like the rangefinder stops working but we also see that the barometer altitude is incredibly noisy. I suspect the autopilot is completely exposed and this is causing the EKF altitude estimate to be very noisy. Especially for good control at low altitudes this will need to be improved.

By the way, changing the EKF’s altitude source to rangefinder is NOT the solution in case that idea comes to mind.

Hope that helps…

1 Like

Many thanks for the analysis So I have to put more foam underneath the barometer? And close the flight controller area and what about this parameter RNGFND_FILT

Hi @edfeeoc,

Yes, protecting the barometer from direct wind passing over it should help I’m sure.

Re RNGFND_FILT, lower numbers will increase the filtering. So it will lead to smoother values being fed into the surface tracking feature which should lead to a smoother altitude response from the vehicle. Smoother is not always better though, it also adds lag.

Conversely increasing the RNGFND_FILT value will lead to a quicker response.

1 Like

Thanks a lot this is clear appreciate your support. :pray::pray::pray:

One last question is there any compensation for quadcopter tilting angle against lidar position facing down to correct distance…?

Yes, there is compensation already.

2 Likes

I changed the parameters as advised last time good improvement than before the only thing is I do not think that this parameter is working as stated or it’s not accept values less than 1 sec

SURFTRAK_TC=0.01

Latest log for test today

Hi @rmackay9 the problem is somewhat related to my drone also, without rangefinder Altitude is steady and good, when activated the copter altitude varies when hovering. There is noise in the CTUN.SAlt. Can you help which parameters I can change to eliminate the Noise. I changed RNGFND_FILT from 0.5 to 1.25 not much difference.

LOG

Hi @edfeeoc,

I just tested in the simulator and I was able to set SURFTRAK_TC to 0.01 or even 0 (which disables the filter). The parameter descriptions also show values between 0 and 5 are acceptable so maybe you could try again?

The logs still show a lot of barometer interference so I think testing at lower speeds to confirm that it works as expected might be a first good step and then move onto higher speeds. If you’ve got a good quality GPS (e.g Ublox F9P) then you could try switching to use that instead of baro (set EK3_SRC1_POSZ = 3) but I’m not sure how well that will work at low altitudes. The GPS has more lag and drifts up and down a bit. It’s not sensitive to changes in the frame though.

Anyway, this does not look like software issue which is good news. It’s really frame, sensor and configuration related I think.

1 Like

Hi @Rajesh_Reddy,

Noise is generally caused by the sensor itself so it’s not something that we can resolve in software except try to ignore it using the filtering parameters I’ve mentioned above (e.g. RNGFND_FILT).

I see you’re using the NoopLoop TOF-SenseP which is new for 4.5 so there is the chance for a bug in the driver although I think it has been well tested. FYI @rishabsingh3003

Thanks for your time, iam currently using mateksys M10Q gps should I switch to RTK F9P or I can test this GPS as altitude source 1.

Secondly if I try to Add external barometer may it help too or what do you think and what may be root cause of barometer noise that I can try to eliminate or at least decrease it…

Hi just share with you latest test low Altitude flight with mateksys M10Q GPS reaching speed 117kmh and altitude slight change if we use RTK it should be better.


1 Like

Hi @edfeeoc,

Thanks for the log. That’s looking pretty good considering the speed.

So you’ve switched EK3_SRC1_POSZ=3 (GPS) so it’s using GPS for altitude which seems to be working fine and the vehicle is staying within about a meter of the target altitude above terrain which seems pretty good so well done!

1 Like

Yes many thanks the results is very good visually except as you mentioned one meter error if I switch to RTK Ublox F9P do you think the Altitude precision maybe increase?

1 Like

@edfeeoc,

It’s hard to say if switching to an F9P will make enough of a difference to be noticeable. It will certainly be better but how much better is hard to know.

2 Likes

@Rajesh_Reddy I was investigating this issue and just tried the NoopLoop P on my Copter and I could not reproduce the problem.

I had a another look at your log. It looks like you are using Copter 4.3.7, whereas we introduced this sensor in Copter 4.5. Is this a custom firmware? In that case is this even a NoopLoop P or some other sensor with a custom driver that you wrote?

I also had a look at your SERIALx_PROTOCOL list, which does not seem to enable a serial rangefinder. So this looks to me like its some other RangeFinder.

1 Like