iNavFlight / inav

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

Wrong Altitude Calculation Aocoda-RC F405 40A AIO DPS310 / SPL06 #10043

Open Developer-MR01 opened 3 months ago

Developer-MR01 commented 3 months ago

Current Behavior

Unbenannt

Steps to Reproduce

  1. default setup FC: Multirotor 3inch
  2. select "AUTO" @ Barometer > Result: SPL06
  3. calibrate ACCs
  4. final Reboot before starting the test
  5. place the Drone on the floor
  6. powerOn and wait for "ready to arm"
  7. connect to INAV and start "Sensors" > Barometer
  8. put the drone up to the desktop or a board (about 1m up)
  9. test with and without arm > negativ results
  10. test with Releases 6.xx up to 7.11 > negativ results

Expected behavior

constant altitude level

Suggested solution(s)

Additional context


INAV/AOCODARCF405AIO 7.1.1 May 6 2024 / 10:54:34 (dd91a871) GCC-10.3.1 20210824 (release)

MrD-RC commented 3 months ago

Is the baro covered with open cell foam?

breadoven commented 3 months ago

When disarmed the Altitude should remain around 0 regardless of height changes of the drone itself. However, when Armed altitude should follow and hold the height changes of the drone ... which it does when I tested just now.

Developer-MR01 commented 3 months ago

When disarmed the Altitude should remain around 0 regardless of height changes of the drone itself. However, when Armed altitude should follow and hold the height changes of the drone ... which it does when I tested just now.

the test cases again:

ACC calibration completed Inductive interference (cable) excluded (less noise @ ACCs)

Test Case 1 (without GPS in Config, Port disabeld) Drone placed on the ground Drone connected to battery Drone NOT armed Drone lifted to 2m height (by hand)

no Altitude value

wo_gps

Test Case 2 (without GPS Config, Port disabled) Drone placed on the ground Drone connected to battery Drone armed Drone lifted to 2m height (by hand)

Pressure changes after arming (first negativ pressure peak) no Altitude value

wo_gps_armed

Test Case 3 (with GPS) Drone placed on the ground GPS configured and connected Drone shot at battery Drone NOT armed Drone lifted to 2m height (by hand)

Altitude goes back to original value or is fading

with_gps

Test Case 4 (with GPS) Drone placed on the ground GPS configured and connected Drone connected to battery Drone armed Drone lifted to 2m altitude (by hand)

Pressure changes after arming (first negativ pressure peak) Altitude is fading Note: Scaling has changed due to the large altitude value

with_gps_armed

It seems that only the GPS value is used for the altitude calculation. If the GPS is switched off, the altitude value remains at 0

I think that the negative pressure offset after arming is caused by the propellers next to the ground - if the drone moves away from the ground, this is correct again - the same effect again after placement at a altitude of 2m on a board.

breadoven commented 3 months ago

I assume you're using version 7.1.1. If so there's a bug that disables the Baro if inav_use_gps_no_barois set to ON (default setting). Setting to OFF will enable the Baro.

Developer-MR01 commented 3 months ago

same like before...

1

11

breadoven commented 3 months ago

same like before...

image

image

Is this armed or disarmed though ?

Developer-MR01 commented 3 months ago

The first test was disarmed with GPS.

with armed same result:

2

correction: Now the altitude is also calculated without GPS, but again with the same effect

Disarmed, without GPS:

3

...and armed without GPS:

4

It seems that the current altitude value is the differential function (with LP) of the pressure function? At first the altitude is determined correctly, but then drops back to 0 over time

breadoven commented 3 months ago

Nav altitude is calculated from a weighted average of Baro and GPS altitudes + an acceleration factor. More weighting is applied to the Baro than the GPS which is why when armed the altitude is much less -ve with the Baro working than just the GPS alone (GPS altitude is just inaccurate compared to the Baro especially when it's only just got a lock with few satellites which is why you were getting -22m). Nav altitude will not just follow the Baro altitude, it's not as simple as that.

It looks to be working as expected, altitude zeroed when disarmed and reacting to height changes when armed.

Developer-MR01 commented 3 months ago

I will test it again in the open field today... fyi: during the tests at a altitude of 2m, the drone was armed the whole time. The drop in altitude did occur in armed status.

Update: I did an open field test within climbing to an Altitude of approx. 30m. The same issue here too. The altitude Value increases up and then drops back to 0m. (14 GPS SATs, sunny weather conditions).