Altitude fluctuations in ALTH using barometer

Hello,

I am looking for some assistance on barometer fluctuations I am experiencing.

Vehicle and parameter setup:
2.5" copter on a MicoAir H743V2 AIO. This board has the SPL06 barometer and I have covered it with open cell foam. MTF-01. No GPS onboard. I have EK3_SRC1_POSZ set to barometer and also have EK3_RNG_USE_HGT set to 95 and EK3_RNG_USE_SPD to 0.5. I have this set so that when the vehicle is generally still and close to the ground, it will use the rangefinder, otherwise it will use the barometer.

Test flight and observations:
Indoor flight. I took off in stabilize and switched to ALTH. I did some generally quick pitch and roll maneuvers in order to observe the result, which was quick altitude changes. This graph is messy for a reason, I wanted to show one of the two RC inputs I was giving it (pitch and roll). At about 50 seconds, the desired and Alt and DAlt shoot up, evidenced by the rangefinder’s increasing altitude reading. At about 58 seconds I reduce throttle to lower the vehicle and get a decent height while still in ALTH. Then with some more pitch and roll, the vehicle loses altitude.

Log:

Attempted log analysis:
XKF3[0].IPD shows maybe I should set EK3_ALT_M_NSE to somewhere between 0.5 and 1.0?
XKF4[0].SH is well below 1.

Generally, baro for ALTH is ok when not moving or moving slowly. But as soon as I introduce some speed, things get weird. What am I missing here?

I’d welcome feedback and recommended changes to make this better.

Thank you

We had similar issues and our solution was also to change the EK3_ALT_M_NSE parameter

I have also experienced altitude fluctuations during indoor flights in ALT_HOLD mode with no GPS, but I haven’t had the time to investigate the issue in detail.

All I can say is that in the past, we flew extensively with EK2 (ArduCopter 4.0.5), and it always worked fine. Since updating to newer versions using EK3, we’ve been seeing this behavior — even in a perfect hover, there are sometimes slow oscillations of about ±0.5 m. I agree that the problem lies in the estimation rather than on the control side.

Was this an effective solution with consistent results?

Yes, it was. On a 3`` ducted fan drone.

Thanks @amilcarlucas that is good to know. I plan to test this out and report back soon!

I watched one of Andy Piper’s videos where he was adjusting params for a Pavo20 barometer. I incorporated some of those changes and I did two more test flights: one outdoors (pretty windy) and one indoors.

Here are the log files:
Outdoors
Indoors

Before the changes, abrupt altitude fluctuations typically happened when I went full pitch and then changed direction hard.

After the changes, the altitude fluctuates were not as abrupt. Of course being outside, those fluctuations were less noticeable than when indoors. But, overall, I feel like it’s in a better spot.

EK3_ALT_M_NSE = 0.75
EK3_ABIAS_P_NSE = 0.002
EK3_GBIAS_P_NSE = 0.0001
EK3_GLITCH_RAD = 0
EK3_HGT_I_GATE = 300
EK3_POS_I_GATE = 300
EK3_VEL_I_GATE = 300

Thoughts from the experts are welcome.