Rapid oscillations in Loiter post Autotune

2023-07-07 14-06-37.bin

And this is the section of flight I checked - I still had it loaded up in Chrome from earlier :slight_smile:

New Autotune today with the updated filter settings.

Top Tip for copying roll PIDs to pitch as it saved battery and therefore provided more time for testing.

I ran Autotune at 0.1 Autotune Aggr

The outcome was the PIDS was significantly higher than I expected the vibrations were back and pretty intense.

And the frame was almost jerked in roll and pitch rather than smooth movements.

Parameter NEW OLD
ATC_ACCEL_R_MAX 31505.38 34820.5
ATC_ACCEL_Y_MAX 7214.993 10000
ATC_ANG_RLL_P 11.1957 6.926874
ATC_ANG_YAW_P 5.090511 4.664969
ATC_RAT_PIT_D 0.03100722 0.006
ATC_RAT_PIT_I 0.3140357 0.12
ATC_RAT_PIT_P 0.3140357 0.12
ATC_RAT_RLL_D 0.03100722 0.006
ATC_RAT_RLL_I 0.3140357 0.12
ATC_RAT_RLL_P 0.3140357 0.12
ATC_RAT_YAW_I 0.1364851 0.08
ATC_RAT_YAW_P 1.364851 0.8

I had a look at the FFT data for gyro as well

Shows 34Hz for post-filter sampling.

image

I had a look at the new tool with the current notch settings. From what I can see the filter it still covering the frequency.

The vibration was previously addressed with the reduction in PIDs and change to MOT_THST_EXPO,0.78

Seems AUTOTUNE pushed the PIDs up way too high again.

I was considering new Autotune_Aggr, 0.75 or lower

Hopefully you mean 0.075

1 Like

thanks, @andyp1per , nice spot. Yes, absolutely :face_with_peeking_eye:

Morning all,

Hope you’ve all had a good week so far.

I’ve been testing consistently and completed a number of autotunes and test flights this past week and a half.

0.1 (very twitchy for such a big frame)
0.75 (oscillating heavily at arming)
0.65 (the roll/pit numbers are below the .120 @xfacta provided/oscillating heavily at arming)

0.70 (I settled on this tune as it seemed better suited but still oscillating heavily)

When I complete autotune on the roll and copy across to pitch everything appears pretty balanced.
It’s not until I complete yaw that oscillations become really apparent.

I have added the spray system back on which has added some weight, but the added benefit is that it shows the oscillation more visibly.

What is it about Yaw that introduces the vibrations?

Ant

Have you got the latest log?

Hey there.

This is from yesterday.
I was starting off slow with the spray system added.

Stablize > Alt Hold > Loiter

2023-07-19 14-16-11.bin

A

The increased vibrations are coming from the the motor outputs that are very noisy due to D terms being too high. It’s lucky the motors didnt burn out.

Lower the pitch and roll D terms before changing any other pitch and roll PIDs, but they might need to go even lower yet

ATC_RAT_PIT_D,0.007
ATC_RAT_RLL_D,0.007

and lower the Yaw P/I a bit, too high and this can induce those yaw oscillations at arming.

ATC_RAT_YAW_I,0.08
ATC_RAT_YAW_P,0.8

increase the yaw accel a bit
ATC_ACCEL_Y_MAX,12000

Notch filter can be adjusted slightly:
INS_HNTCH_FREQ,28

Set these just as “situation normal”
ATC_THR_MIX_MAN,0.5
AUTOTUNE_AGGR,0.08

Now do a flight with AltHold then switch to Loiter during the flight.

EDIT: I meant to say, dont run another Autotune yet, let’s just see what we’ve got now.

That’s really interesting as it’s not that far off what you gave me before I ran autotune.

So just a slight change in what you gave me for D Terms, but significant in terms of the values Autotune output. Surprising :grinning:

And then Autotune pushed those values right up even though I ran at AUTOTUNE_AGGR,0.07

Parameter BEFORE AFTER NEW
ATC_ACCEL_Y_MAX 10000 8563.578 12000
ATC_ANG_RLL_P 6.926874 16.54115
ATC_ANG_YAW_P 4.664969 5.345037
ATC_RAT_PIT_D 0.006 0.02117835 0.007
ATC_RAT_PIT_I 0.12 0.1429629
ATC_RAT_PIT_P 0.12 0.1429629
ATC_RAT_RLL_D 0.006 0.02117835 0.007
ATC_RAT_RLL_I 0.12 0.1429629
ATC_RAT_RLL_P 0.12 0.1429629
ATC_RAT_YAW_I 0.08 0.1658985 0.08
ATC_RAT_YAW_P 0.8 1.658985 0.8
AUTOTUNE_AGGR 0.1 0.07 0.08

I see you have me at AUTOTUNE_AGGR,0.08. Is that to suggest running autotune again?

Noted :+1:

That was pretty tight.

I couldn’t see/hear any oscillation during arming.
The mode change from Althold to Loiter appeared pretty solid. I believe this is the 5th flight in the log.

I had a look with the filter review tool to see what the filter was doing but it was as obvious as the other ones I looked at.

2023-07-20 13-18-35.bin

The filter is working as planned

Save the existing params to a file, as a baseline.
Then I would run a Pitch autotune.
AUTOTUNE_AXES,2
and if it produces sensible values I would copy them to Roll and do another test flight.
Let us know what you get.

1 Like

Out of interest would there ever be a case made for dropping the gyro low pass to 10Hz?

I have been looking at the filter review tool again and noticed it almost entirely eliminated the peaks in those frequencies.

Is there a specific reason to Autotune pitch first as opposed to roll when copying across?

No, it’s rare to go below 20Hz and only if vibrations can not be fixed any other way - such as using a noisy vibrating internal combustion engine as a generator.
The Accel and Gyro filter slopes are quite gentle compared to the notch filter, so chances are it wouldn’t do much anyway.

Because of the existing values - we will see the most change in the pitch PIDs and easily see what effect Autotune has. I think Autotune stands a better chance of arriving at a good tune by increasing low PIDs, rather than starting with high PIDs (like Roll has)

Hi @xfacta

I was run vtol quick tune lua script on Nora+ flight controller on quadcopter and obtained PID larger than this Autotune done here.
But still after vtol quick tune PID it’s flying great…there is no Motor and ESC heat also noticed!.
I will share that PID screen later.

Evening.

Got as far as Autotune for PIT before running out of daylight.
Will copy these over and get an early morning flight.

Parameters BEFORE AFTER
ATC_ACCEL_P_MAX 32940.57 32594.62
ATC_ANG_PIT_P 6.597023 7.558749
ATC_RAT_PIT_D 0.007 0.02197687
ATC_RAT_PIT_I 0.1429629 0.385047
ATC_RAT_PIT_P 0.1429629 0.385047

PID gains for PIT changed quite significantly.

I’ve got a log but probably not worth looking at until I copy over the changes to RLL and get a new flight in.

Made aware of bit of yaw offset, not bad ~100uS so will check and rebalance motors with a digital level before tomorrow.

Right, so I got those gains copied over from PIT to RLL.
I completed a couple of test flights

Pretty heavy on the oscillations both at arm and in-flight so I decided it wasn’t safe to continue with those gains

2023-07-23 12-13-20.bin

Pretty noisy log as you can see.

I’ll see if I can run this at 0.07 today and see how it ouputs.

righto friends.

I just discovered I’d been Dm’ing direct so here is some of the information repurposed for you all to see.


I went through yesterday with an inclinometer and as far as I can tell everything is balanced, perpendicular to the ground and true. I checked the frame as well.

Maybe the FC offsets are out a little? I’ll calibrate again and then get some further results.
I hadn’t appreciated that I should do all this is STAB to remove the FC trying to counter.

Interesting that the subject of yaw bias isn’t discussed much as I’m quite far into the process of tuning.


Had a good run yesterday evening.

Althold
Althold roll/pitch manoeuvres
Loiter pitch & travel (loss of alt in forward motion)
Loiter pitch & travel (loss of alt in forward motion)

You may recall that we turned off MOT_HOVER_LEARN. I wasn’t sure if you meant to run it with some payload initially and then turn it off, or learn without and then add some weight.

I’ve noticed when I add some weight I lose my heading in loiter and can get some sideways drift.

20230830_

If anyone has a well-balanced Hexa log for something 20KG+ I’d love to have a look at Yaw bias for a comparison.