Skip to content

Rangefinder data should not be used in ALTHOLD and other flight modes #10917

Open
@ABLomas

Description

@ABLomas

Wiki says:

Current support of rangefinders in INAV is very limited. They are used only to:
landing detection for multirotors
automated landing support for fixed wings
Experimental terrain following (Surface) flight mode activated with SURFACE and ALTHOLD flight mode

(even inav_w_z_surface_p description says "Setting is used on both airplanes and multirotors when rangefinder is present and Surface mode enabled")

Based on documentation it looks like rangefinder data will be used only on LANDING or SURFACE modes (on flying wing).
But it's not true. I set up plane with TOF10120 rangefinder and did not set up SURFACE or landing modes, used only ALTHOLD. I output rangefinder data on OSD and checked - it was working correctly at ~0...0.5m range (a bit low, yes, but this is in bright daylight). Then run WP mission flight with 120m preset altitude and plane started to fluctuate upwards every few seconds (using motor and pitch up).
I tried to set inav_default_alt_sensor to BARO_ONLY, GPS_ONLY but results were even worse. OSD shows huge altitude fluctuations, sometimes even going negative, while plane flies straight, but at the same point rangefinder triggers showing 0.0m (instead of "--"). Reviewing blackbox data confirms, that GPS and baro data stays at +/- constant altitude, while navPos[2] jumps a lot (and plane tries to correct altitude).

I disabled rangefinder and repeated the same (130km) mission, altitude was spot-on, zero issues.

It's really not possible to prevent false-positives trigger on bright daylight using laser-based altimeters, i tried VL53L0X, TFLuna too, all can show false reading sometimes. I know about rangefinder_median_filter but this does not fix issue.

There are two ways how to fix this:

  1. Enable rangefinder data ONLY in related flight modes (SURFACE, LANDING...)
  2. Have hard limit on rangefinder data readings. Most rangefinders are useless above 5m anyway and those lucky NRA users can set upper limit higher.

For now there's no way to set-up long range mission using INAV8 and rangefinder with autolanding, as lots of energy (~30% increase) will be consumed by "altitude corrections based on false positives".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions