Multirotor losing altitude in forward flight in guided mode

Dear all,
This is my first post here, so please ignore any mistakes. we have built a multirotor with the following specs.
Weight : 24.8 kg
Application : Spraying
The aircraft is auto tuned and hover stability is good. In guided mode when we gave a way point the aircraft lost 4 to 5 m of altitude and regained once it reached the destination. If anyone can help with the issue, it would be wonderful. Attaching the log.

https://drive.google.com/file/d/12LIHGfFBUo58PI7rQFYBz9-cxlT4uAsZ/view?usp=share_link

It’s not reporting such a great deviation in altitude, so this is most likely caused by prop wash plus speed and attitude changes affecting the pressure around the flight controller. If the flight controller is out in the open it might need some covering.
You can also run the wind and baro compensation procedure, which I have not tried yet, but it could be worth it for spraying and commercial operations.

https://ardupilot.org/copter/docs/airspeed-estimation.html

You can also set these, but they wont affect your altitude issue much (if at all)
ATC_THR_MIX_MAN,0.5
BATT_FS_CRT_ACT,1 ← you had 2 here
BATT_FS_LOW_ACT,2
INS_ACCEL_FILTER,10 ← the new default, very safe to set this
INS_HNTCH_ENABLE,1 ← set this then refresh params to see the rest
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.2
INS_HNTCH_FREQ,40
INS_HNTCH_BW,20
INS_HNTCH_ATT,40
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4
PSC_ACCZ_I,0.6
PSC_ACCZ_P,0.3

Good to see you had FENCE_ENABLE,1 :slight_smile:

Do a test flight with those new values I provided, mostly just hover in althold and some gentle pitch and roll. Provide thet .bin log and we can dial in that Harmonic Notch Filter.
After that you can do a Yaw autotune too.

If you get to do the wind and baro compensation procedure, please share a log and your experiences.

1 Like

We had a similar experience where the drone would lose altitude in forward flight and regain it when stopping. Later we upgraded the GPS with one that uses RTK (Septentrio), selected it as altitude source and the problem went away. So it was then most likely as @xfacta mentioned the pressure change around the autopilot which caused it. We even have a canopy covering the autopilot but still had the issue.

Maybe you could try and external barometer and experiment with it by placing it on different positions on the drone or also use an accurate GPS as altitude source.

1 Like

Hey @xfacta

Firstly thank you for responding. I work with @SaiRaj . I did enable the Dynamic Notch Filter (Throttle based) on my other multirotors and tuned successfully. The performance was exceptionally good.

However, coming to Spraying drone, the payload was 10 Kgs.

  • I didn’t know if it is ideal to tune with the payload or without the payload. Normally I would have tuned with the payload but since the payload is liquid I was concerned (the liquid keeps moving). Please suggest.
  • Since hover thrust keeps changing as the spraying happens(the amount of liquid reduces), would notch filter really help if the INS_HNTCH_REF is not close to hover throttle? Please help me with the notch fiter for this varying payload case. It’ll help a lot.
  • I am attaching the log when we hovered in Loiter mode with LOG_BAT_MASK enabled. You can see the harmonic peaks occuring at 42, 84,… Please suggest the new values before I repeat autotune. Especially the INS_HNTCH_REF for varying payload Link
  • Autopilot is completely closed from all sides. So I am unsure if the wind and baro compensation will help.

Tune with no payload or the minimum payload (minimum takeoff weight), then adjust these to suit the payload (maximum takeoff weight)

new ATC_ACCEL_P_MAX = ATC_ACCEL_P_MAX x (min_TOW / max_TOW)
new ATC_ACCEL_R_MAX = ATC_ACCEL_R_MAX x (min_TOW / max_TOW)
new ATC_ACCEL_Y_MAX = ATC_ACCEL_Y_MAX x (min_TOW / max_TOW)

You can safely round up or down the ATC_ACCEL values to the nearest hundreds or thousands, it’s not critical, and the single digits and decimal places wont matter at all.

For changing hover value (and potentially changing frequencies) you can enable the dynamic FFT and harmonic notch filter.
FFT_ENABLE,1 ← set this then refresh params to see the rest
FFT_MINHZ=30
FFT_MAXHZ = 200
INS_HNTCH_ENABLE,1 ← set this then refresh params to see the rest
INS_HNTCH_MODE=4
INS_HNTCH_REF=1
INS_HNTCH_FREQ=40
INS_HNTCH_BW=20
INS_HNTCH_OPTS=2

Keep these during tests:
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4
Then set those to 0 when tests are successfully concluded.

EDIT:
This copter from the loiter log needs this changed:
ATC_THR_MIX_MAN,0.5
and all the same parameters as I mentioned for the other copter, plus these FFT and HNOTCH params mentioned within this edited post.
The run autotune of you are happy with the stability and response.

EDIT SOME MORE:
check and adjust your GPS_GNSS_MODE to have GPS and one other constellation so it should be a value of 5 or 65 most likely - choose whichever gives you the most reliable HDOP in your area.

1 Like

Thank you for the inputs. Means a lot.

I’ll change these, test and tune and update you.

Adding more info:

this is what I found from auto analysis of log.

Test: Autotune = UNKNOWN - No ATUN log data
Test: Brownout = GOOD -
Test: Compass = GOOD - mag_field interference within limits (6.56%)

Test: Dupe Log Data = GOOD -
Test: Empty = FAIL - Empty log? Throttle never above 20%
Test: Event/Failsafe = GOOD -
Test: GPS = GOOD -
Test: IMU Mismatch = NA -
Test: Motor Balance = UNKNOWN - ‘QUAD/X’
Test: NaNs = FAIL - Found NaN in CTUN.TAlt
Found NaN in CTUN.DSAlt

Test: OpticalFlow = FAIL - ‘FLOW_FXSCALER’ not found
Test: Parameters = FAIL - ‘MAG_ENABLE’ not found
Test: PM = GOOD -
Test: Pitch/Roll = GOOD -
Test: Thrust = GOOD -
Test: VCC = UNKNOWN - No CURR log data

Yes, nothing very useful there, the auto analysis is out of date and not helping you at all.

Best to make the changes I suggest, gather some data to see if everything is good, then run Autotune.
Finally, adjust the ATC_ACCEL values to suit the increased payload.

I assume this is ArduCopter 4.2.3 ?