Tuning advices needed: Undesired oscillations during landing

Hello everyone.
We were flying a big bird today (details below), but we saw some undesired flying characteristics during only the landing (well actually when descending).
We did all the tuning (AFAIK) steps before, and the vehicle flies great (at least it seems so).
Except…
During landing (only), the vehicle starts to oscillate (bot observable visually during flight and in the logs).
I saw, during some wind when loitering, the vehicle tries to win the fight to wind and oscillates a bit, but I don’t think it leads to any undesired system state (crashing :smiley:).
But similar behavior during descending concerns me.
Apart from that, climbing and flying are all good.
So here are the logs:
https://drive.google.com/drive/folders/1GfXTSe9vy6jB4NHG_UkJuoL8hMcU7x53?usp=sharing
log30.bin is the most important one I think.
These are the vehicle specs:

  • Type: Quadcopter
  • Frame: X, 1026mm size (diagonal)
  • Motors: T-Motor Antigravity MN7005 KV230
  • Propellers: 24x7.2in
  • Weight: 6500gr
  • Battery: 6s 22000mAh
  • Duration: 57min

For a workaround, we lowered the speed down from 1.5m/s to 1m/s and see nothing to worry about during landing but I think it is just sweeping under the carpet.
Any ideas on how to improve this?
All suggestions are quite welcome and I can test it within the day and share the results.
Thanks for all the contributions.
Wish you all the best.
Mustafa.

Please do all these things in the order I’ve written them.

I would first update to latest stable version firmware.
Definitely set up the battery monitor properly and set these:
BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2
BATT_ARM_VOLT,22.10
BATT_CRT_VOLT,21.00
BATT_LOW_VOLT,21.60
FENCE_ENABLE,1

For general tuning, was this Autotuned or manual tuned?

I think you could set these parameters
ATC_ACCEL_P_MAX
ATC_ACCEL_R_MAX
to this lower value : 40000 (or maybe 60000). Your existing values might be a bit high for the size of your props and frame.

Set up the Harmonic Notch Filter
INS_HNTCH_ENABLE,1 ← set this then refresh params to see the rest
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.19
INS_HNTCH_FREQ,42
INS_HNTCH_BW,21
INS_HNTCH_ATT,40
INS_LOG_BAT_MASK,7
INS_LOG_BAT_OPT,0

After all that, do a test flight of mostly hover and some gentle pitch and roll movements, use only Stabilise and AltHold flight modes at first.
If everything is OK use Loiter.
If you see instability in Loiter (but AltHold is nice) then reduce all these to half their present value
PSC_POSXY_P
PSC_VELXY_D
PSC_VELXY_I
PSC_VELXY_P

Now test a couple of different values for MOT_THST_EXPO - this can be a contributor to that descent stability. You can safely try a little higher (0.77) or even lower (0.73) and see what effect that has without altering anything else or retuning.

Let’s see the new log after all that!
We will be able to fine tune the Harmonic Notch and more.

ATC_RAT_RLL_D and ATC_RAT_PIT_D seem very low but leave them for now, maybe revisit if everything else comes up OK

2 Likes

Hi @xfacta.
Sorry for the late response.
We did everything you said.
Here are the logs for today’s flight:
https://drive.google.com/drive/folders/1Fkv9W3VfweH2VyvRRhVjLgYXG9telBor?usp=sharing
Please note that there was a strong wind today (NNW, 17kph/25kph).
Visually I might say the performance of MOT_THST_EXPO is 0.73 < 0.75 < 0.77 (performance wise).
The performance of MOT_THST_EXPO=0.73 was really bad (of course visually I’m saying) and VIBEs were really high on this flight.
Log 12 contains just a gentle test to check whether everything is fine or not.
Log 13 includes all the tests.

This is all autotuned :slight_smile:.
I set all the parameters according to your suggestions and enabled the battery voltage monitor using a calibrated voltage divider.

I reduced them to 60000 for now.
Thanks so much from now.

I would say update these params and do another test flight. See if you can move to Autotune if you think stability is good enough.

The HNOTCH data is different between logs
Maybe this will be better:
INS_HNTCH_FREQ,80
INS_HNTCH_BW,40
INS_HNTCH_REF, 0.17

INS_LOG_BAT_OPT,2 ← so we can see the result

These reduced so Loiter is not trying to maintain the position so stringently and potentially inducing some of the oscillations you see
PSC_POSXY_P,0.5
PSC_VELXY_D,0.25
PSC_VELXY_I,0.5
PSC_VELXY_P,1.0

What ESCs do you have?

1 Like

Hello @xfacta, sorry for the delayed response.
Today we get a chance to test the Drone in our test field.
Before moving on to your PSC suggestions, we did some test flights with HNTCH 80/40, 40/20, and disabled.
Here are the logs:
https://drive.google.com/drive/folders/1pEPI7zvnyAQH4qSXLcWGtxmzsGlMoPac?usp=share_link

They are T-Motor Alpha 40A ESC.

We also did some flights with your PSC_* suggestions before (with our parameters, without HNTCH) the flight was terrible w.r.t. old PSC_* parameters.
When sticks were released in LOITER mode, the response was too slow, and also the vehicle was unable to hold its altitude, and has poor performance maintaining its current location when the wind blows.
I will also do some flights with those (suggested PSC_* parameters) again and share the log files.
Thanks for your time.

Set
ATC_THR_MIX_MAN,0.5
INS_ACCEL_FILTER,10 ← as per a big discussion elsewhere
INS_ENABLE_MASK,7
INS_FAST_SAMPLE,1
MOT_PWM_MAX,1940 ← these suit your ESCs
MOT_PWM_MIN,1100

Definitely keep the Harmonic Notch Filter on with
INS_HNTCH_FREQ,40
INS_HNTCH_BW,20
INS_HNTCH_OPTS,1

and keep this as 0 for now, there’s still a bit of a mess of frequencies to examine in subsequent flights
INS_LOG_BAT_OPT,0
Maybe see if you can balance the props better.

You will need to recheck MOT_SPIN_ARM and MOT_SPIN_MIN after changing those motor PWM values. Get MOT_SPIN_ARM as low as possibly yet reliable. Keep in mind MOT_SPIN_ARM < MOT_SPIN_MIN < MOT_THST_HOVER .
Also INS_HNTCH_REF < MOT_THST_HOVER
Ideally INS_HNTCH_REF = MOT_THST_HOVER x 0.6 (These are just rough calculations and there is an exact equation if you need it)
but MOT_THST_HOVER x 0.8 will be OK if MOT_THST_HOVER x 0.6 works out to be lower than MOT_SPIN_MIN

Do some hover tests and gentle movements, let the MOT_THST_HOVER relearn in AltHold.
Always be ready to take over in Stabilize mode.

Those PSC_* params I suggested should not affect overall stability at all, they just lessen how hard the copter tries to hold an exact position. This usually lowers apparent oscillations in Loiter.
To see the difference you have to start in AltHold, move around a bit and hover (observe reactions and stability) then change into Loiter and do the same.

1 Like

Hello, again @xfacta today we did some flights with the suggested parameters.
https://drive.google.com/drive/folders/1GeqgRrxkvfchDqjhd5Dh3duuuQbWE_-b?usp=share_link
The flights were really good.
The first flight was about hover learning.
On the second log, we did some flight with updating:

This was also nice.

That looks really good now
Set INS_LOG_BAT_OPT,2 for the next flights so we can check that HNOTCH is working properly, but it looks like it is set up correctly now.
If you set AUTOTUNE_AGGR,0.075 I think you’d be able to run Autotune judging by how well the aircraft was following your stick inputs. Although tuning is very good now, so at least save the params you have.

Just some minor things I’d look at for next flights, to see if they make any difference

I suspect ATC_RAT_PIT_D,0.002486 can safely go up to 0.0035 to better match the Roll values. Roll has fractionally better performance, less noisy attitude control.

Do a test flight with lots of yaw and maybe figure 8’s if you can. I suspect these can go lower
ATC_RAT_YAW_P,1.467337
ATC_RAT_YAW_I,0.146734
to about 0.8/0.08

Autotune would probably adjust those, and more, if you felt like running it. Many would say you dont need to.

2 Likes

@xfacta, Here is today’s flight with the suggested parameters:
https://drive.google.com/drive/folders/1VkVxKhwKI_N5_rflqJ9h6kIQM1wdL-8z?usp=share_link
In the logs, I think performance on the pitch axes is as good as on the roll axes.
Visually, the flights were excellent, too (especially improved on pitch and yaw axes).
Copter has poor performance on holding altitude though but this could be due to the ground effect since I can’t go higher than 4-5 meters because of the ceiling of the test field.
I will attempt to do an autotune within a few days on in a rural field.

If you are testing indoors, then yes the pressure does funny things to the altitude.

I’d probably change INS_HNTCH_FREQ,38 although this is a very minor change.
You could set
INS_LOG_BAT_MASK,0
INS_LOG_BAT_OPT,0
to stop the extra HNOTCH logging since it is working well.

Also since there was good Yaw activity in that log I ran it through magfit, you can set these values just to get the compass(es) a bit more exact
OMPASS_OFS_X 186
COMPASS_OFS_Y -28
COMPASS_OFS_Z -66
COMPASS_DIA_X 1.125
COMPASS_DIA_Y 1.200
COMPASS_DIA_Z 1.102
COMPASS_ODI_X 0.008
COMPASS_ODI_Y 0.050
COMPASS_ODI_Z 0.006
OMPASS_OFS2_X 52
COMPASS_OFS2_Y -107
COMPASS_OFS2_Z 27
COMPASS_DIA2_X 1.008
COMPASS_DIA2_Y 1.010
COMPASS_DIA2_Z 0.940
COMPASS_ODI2_X 0.002
COMPASS_ODI2_Y -0.020
COMPASS_ODI2_Z -0.002

Apart from that there’s not much else to do.
If you add a payload, only adjust these Accel values based on the minimum (existing) takeoff weight and the new (increased) 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)

They can be rounded to the nearest 100 or 1000, the exact 10’s or 1’s digits dont really matter, and there’s no need for decimal places.

@xfacta, this is today’s logs with applying compass parameters and setting filter frequency to 38.
https://drive.google.com/drive/folders/1F506QU6PFzcwLyhLr72fHG4t6NhOUN30?usp=share_link
This flight was also nice I think.
I think the yaw can’t get better than this:

I will set them on the next flight.

1 Like

But if I’m not mistaken, I was hearing some high-frequency sounds from the motors (different that yesterday’s flight).
IDK whether this can be seen in the logs or not; or maybe I’m just focused on that and was hearing what I want to hear.
I’m ready to autotune.
In a topic I saw, repeating the autotune many times with (0.0075, not 0.075) performs better.
What do you think?

Only use Auotune Aggressiveness 0.075 up to 0.1
Dont go below that. Once or maybe twice will be enough.

1 Like