Servers by jDrones

Problem of rangefinder in Auto mode

When I’m in AUTO mode I have a problem with my rangefinder who is not use.
On the other hand In LOITER mode and AltHold all work correctly and my proximity sensor work.

I have also just tested the Auto mode by activating or deactivating WPNAV_RFND_USE and it is the same thing my proximity sensor is not used.

I’m using Copter 4.0.3 and last Mission planner or Qgroundcontrol version and my flyboard controller is a Drotek pixhawk 3 Pro.
If attached my setup : 21_04_20 (RTK capteur sol vol radar aprés etalonnage accel et magneto PID).param (427 Bytes)

Thanks for your help and excuse me for my english !

auto mode act as a self-tuning mode. make sure it correctly connected to i2c port and check its value from the flight log.

In Mission Planner, the altitude setting in the mission plan must be set to „Terrain“.

In qGroundControl it is nearly not possible to work with rangefinder determined terrain following, as all functions like survey do not support arducopters rangefinder. This is a long known issue with qGroundControl.
With simple waypoints it should works (you have to set the altitude to „Terrain Frame“), but not for complex missions.
Sadly but true.

For information my rangefinder for the height control is connected on a port Telem and no I2c

I will test with the option “Terrain” but it seemed to me that this option should be activated only to use the SRTM field data, I will test.
And for the option WPNAV_RFND_USE should it be activated or not ?

WPNAV_RFND_USE must be enabled.

We flew a lot of missions last year with rangefinder, under some interesting conditions (see photo). We did thermal and multispectral flights 40m AGL, without SRTM data (in our case, SRTM is much to inaccurate).

Last year, we used AC 3.6.x of course, but Ikm quite shute that in AC 4.0 nothing changed here.

1 Like

I just did another test and in fact I had not seen but I have the following error message (Failsafe : Data terrain missing "however in the plan I see the GPS coordinates appear and it is well written SRTM )


What is your mission agl and your rangefinder max setting?

My mission AGL is of 3m end my rangefindermax setting is 700cm
I resolve the problem of Failsafe Data Terrain missing,it was the rangefinderMin which was set too high.
On the other hand I do not think that the problem of ground tracking with the rangefinder in Auto mode even settled because I started my Auto missions always the drone at altitude for this that I did not have the Failsafe before. I will still do a test to verify

Okay I tested all the solutions a bit but it doesn’t work, I’m going in circles.
What is really weird is that in Loiter mode it works perfectly, I thought that Auto mode was using Loiter mode for theft, right ?

Having not tested with version 3.6 I can not know if it is Hardware or software, someone could check if I provide a log file or other to see where the problem comes from?
Thank you

Yes, if you provide a log file, somebody should be able to look at it.

I just did another flight to get a .Log file.
I did a flight in Loiter mode at 2.5m where there is not a problem then after I programmed a mission in AUTO mode ( Terrain at 3m ) which does not work .

File Log : Fichier .Log

Can you please send me your waypoint file? If you prefer email, PM me.

Je n’avais pas enregistré le fichier Waypoint lors de ce vol, mais voici presque une copie du vol demandé très simple:

Ce qui est vraiment bizarre, c’est qu’en mode Loiter, cela fonctionne parfaitement, je pensais que le mode Auto utilisait le mode Loiter pour le vol, non ?

No one can help me, please ?

I’ve looked at your log. Here is how the altitude data looks like:

The red line is the rangefinder reading
The green line is the desired altitude based on the rangefinder reading (notice it disappears when you switch to AUTO)
The orange line is the altitude calculated by the EKF after fusing the different sensors (baro and rangefinder)
The blue line is the altitude data calculated from the barometer.
You can find that altitude data in the CTUN message (described in details here)

First thing that’s odd is that the green line (desired altitude based on rangefinder) disappears when you switch to AUTO. I converted your .bin log into a .log file to take a look at it packet by packet (with a simple app like Notepad). Here is what I see:

DSAlt becomes NaN when AUTO is activated.
My guess is it’s because it’s trying to use the SRTM terrain data that seems to be missing here):
@line = 37861 (in LOITER mode): note the “NaN” is TAlt , “2.480771” is your desired rangefinder alt in loiter mode:

CTUN, 319143978, 0.1584907, 4.422665E-05, 0.1564572, 0.1453676, 6.024798, 6.140826, 6, 2.480771, 2.56, NaN, -8, -7, 80

@ line = 67194 (in AUTO mode): your desired rangefinder alt has become NaN (=TAlt) which might explain why it’s not following rangefinder readings anymore:

CTUN, 545619893, 0.1468592, 6.400049E-05, 0.1446142, 0.1449793, 5.574391, 6.29668, 6.6, NaN, 2.26, NaN, -72, -71, 80

In your waypoint file, try changing “Frame” from “Terrain” to “relative” to see if that changes anything.

Another option: based on the graph above, the EKF relies on the baro data and seems to not give much weight to the rangefinder data. You could try to play with RNGFND_GAIN (increase it) see if that has an influence.

If that doesn’t work there are other options we can look at.

Thank you Clem,
I’m going to redo a flight by putting “Frame” to Relative and I would post the new Log file.

I thought that the RNGFND_GAIN only acted on reactivating the drone for this reason that I did not touch it, I will also see if this has an effect .

@chr89 did that solve it?

I have a understanding question:
I always thought, that during terrain following the rangefinder values are NOT fused tinto the EKF?
Maybe we can ask @rmackay9 to bring some light into this question?
Thank you very much!

1 Like

I didn’t have time to do it this week, I hope to be able to retest this week.
Previously I had tested with Relative mode but the rangefinder did not work either.

Servers by jDrones