iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.08k stars 1.46k forks source link

VSpd telemetry error accumulates in flight #9987

Open dingrgh opened 4 months ago

dingrgh commented 4 months ago

Current Behavior

Platform: iNav FC mounted in a motor glider. VSpd telemetry parameter accumulates an error with a offset of up to +2m/s after about 30 minutes in the air. At the start of the flight, there is zero error. At the end of the flight, with the aircraft sitting on the ground, telemetry shows it is still climbing. This error is also noticeable in flight if the vario tones are enabled (i.e. a climb indicated when the glider is actually descending). Screenshot 2024-04-28 at 3 36 51 PM

Steps to Reproduce

  1. Arm. Launch and fly.
  2. After about, say, 30 minutes in the air, land.
  3. Check VSpd telemetry with the aircraft sitting on the ground to observe the offset.
  4. Confirm that the Alt telemetry figure is correct (i.e. not changing).

Expected behavior

At the end of the flight, the VSPD telemetry should show zero m/s when sitting stationary on the ground.

Suggested solution(s)

The error was probably introduced in code changes for barometric and GPS alt.

Additional context

This VSpd error only started after I updated from iNav 6.0 to iNav 7.1.0. iNav Dump: (https://pastebin.com/7ZSPq3p6)


dingrgh commented 4 months ago

I did more flights with iNav 7.1.0 to confirm that the problem was repeatable. I even tried setting CLI parameter inav_w_z_gps_v to zero (default is 0.1) to remove all dependence on GPS vertical speed but it did not fix the problem.

I downgraded the firmware to iNav 7.0.0 and can confirm that the problem went away. I can only conclude that some change to the Vertical Speed code from 7.0.0 to 7.1.0 is causing the problem.

Summary: Rolling back to iNav 7.0.0 is a workaround for this issue.

Frank0587 commented 4 months ago

Hey, I had similar problems. The Baro was no longer used for altitude and vario. The default setting for “inav_use_gps_no_baro” has been changed from OFF to ON. After the CLI command “set inav_use_gps_no_baro = OFF” it works perfectly again. I hope this will solve your problem too.

dingrgh commented 4 months ago

Hey, I had similar problems. The Baro was no longer used for altitude and vario. The default setting for “inav_use_gps_no_baro” has been changed from OFF to ON. After the CLI command “set inav_use_gps_no_baro = OFF” it works perfectly again. I hope this will solve your problem too.

I will try this and report back in a week or so...

dingrgh commented 4 months ago

The VSpd issue may be related to #10040.

sensei-hacker commented 4 months ago

The VSpd issue may be related to #10040.

I created #100400 based partly on reading this and finding out that inav_use_gps_no_baro doesn't do what some thought it did. It does exactly what the name says - it uses the GPS and not the baro.

Suggest turning off inav_use_gps_no_baro.

dingrgh commented 3 months ago

I have done several flights (iNav 7.1.1) with “inav_use_gps_no_baro” set to OFF. Unfortunately, the VSpd residual offset problem is still present.

So the problem is not likely to be related to #10040 but is a result of something that was changed in the Z velocity position estimator code between iNav 7.0.0 and iNav 7.1.x.

To be clear, there is no problem observed with the altitude telemetry. Only the VSpd telemetry.

dingrgh commented 3 months ago

Update: Workaround found...

Version: iNav 7.1.1

Things I tried that didn't solve the problem:

What worked finally:

As mentioned in a previous post, rolling back to iNav 7.0.0 (without the changes above) also works around the problem.

Clearly, the problem introduced by code changes in iNav 7.1.0 will have to be fixed as I suspect it will affect other navigation functions in some annoying, hard-to-pinpoint way.

silicongarage commented 2 months ago

Problem is still not fixed in latest iNav 7.1.2

VARIO shows +2 ft/sec accumulated upon landing after ~30min flying.
This is what I've tried.

I have not tried inav_w_z_gps_p = 0 as I want the GPS to correct any ALT drift of the BARO

It's interesting the ELRS telemetry docs specify two different VARIO packets for GPS and BARO, from which one might infer the VARIO types should not be blended https://github.com/crsf-wg/crsf/wiki/CRSF_FRAMETYPE_BARO_ALTITUDE

Use this telemetry type for barometer-based variometers to include altitude and vertical speed in a single packet. GPS-based variometers should use the CRSF_FRAMETYPE_GPS and CRSF_FRAMETYPE_VARIO packets separately.

HW: Speedybee F405 Wing FW: iNav 7.1.2 LNK: ELRS 3.4.3