While in Loiter Mode: loss of altitude when executing a Yaw

Shawn, still seeing the twitch, although maybe a bit reduced. The twitch looks to be about 2-3 degrees of roll.

ARM around 6:51:27 and Loiter selected at apprx. 6:51:44

Tlog and .bin
https://drive.google.com/drive/u/0/folders/1oJu4VgNgmyL_zD6jq1j20pBN_rVmGqK6

That looks worse now.
You’ll have to go back to these, with a slightly higher D term I think.
ATC_RAT_RLL_P,0.135
ATC_RAT_RLL_I,0.135
ATC_RAT_RLL_D,0.0075
ATC_RAT_PIT_P,0.135
ATC_RAT_PIT_I,0.135
ATC_RAT_PIT_D,0.0075

I’ll keep thinking about this and checking this log and let you know if you should make a different adjustment.

On the 19th you had me try ATC_RAT_RLL_D & ATC_RAT_PIT_D: 0.00675?

Yes, after that last flight we’re going the other way :frowning:
Looking over ALL previous posts, we can probably safely set these and see if you can get off the ground and have reasonable stability:
ATC_ACCEL_R_MAX,80000
ATC_ACCEL_P_MAX,80000
ATC_ACCEL_Y_MAX,10000
ATC_ANG_RLL_P,6.0
ATC_ANG_PIT_P,6.0
ATC_ANG_YAW_P,5.0
ATC_RAT_RLL_P,0.10
ATC_RAT_RLL_I,0.10
ATC_RAT_RLL_D,0.005
ATC_RAT_PIT_P,0.10
ATC_RAT_PIT_I,0.10
ATC_RAT_PIT_D,0.005
ATC_RAT_PIT_FLTD,15.00
ATC_RAT_PIT_FLTT,15.00
ATC_RAT_RLL_FLTD,15.00
ATC_RAT_RLL_FLTT,15.00
ATC_RAT_YAW_FLTT,15.00
INS_ACCEL_FILTER,20.00
INS_GYRO_FILTER,30.00
And you can enable the Harmonic Notch Filter using the same settings from earlier since everything is still the same:
INS_HNTCH_ENABLE,1 <- set this and save then refresh params to see the rest
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.318
INS_HNTCH_FREQ,92
INS_HNTCH_BW,46
INS_HNTCH_ATT,40
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,2

Let’s see a .bin log from a very basic take off and hover for a minute with all those settings.

I’m thinking you’ll have to try increasing ATC_ANG_PIT_P and ATC_ANG_RLL_P

Hey Shawn, conducted three flight test this morning (conditions a slight breeze 4-6mph, higher at altitude). I did not make the long list of param. changes you suggested yesterday afternoon, but instead I wanted to try something. I primarily change the INS_GYRO_FILTER from 42 back to 20 (2nd and 3rd flight test) and this reduced the twitch. The 3rd flight test I retained the INS_GYRO_FILTER=20 and changed the RLL/PIT PIDS back to the previous settings you recommended. The Twitch was reduced even more. I have uploaded all three flight tests (3 separate folders) .bin and Tlog files.
https://drive.google.com/drive/u/0/folders/1oJu4VgNgmyL_zD6jq1j20pBN_rVmGqK6

If you could look at the data and let me know what you think i.e. should I move forward with the large list of param changes? Then conduct the notch filter flight?

NOTE: the params highlighted in green are the values changed to prior to the flight, the values not highlighted are the params prior to the pre-flight changes.

##Flight Test #1 ARM Arrpx. 06:55:41 – 06:56:22:

Stabilized mode only, Twitch very noticeable, HUD shows 2-4 degrees roll, primarily roll to the right.
Param. changes prior to this 1st Flight Test
image

##Flight Test #2 ARM Arrpx. 07:05:42 – 07:07_07:

Stabilized mode for a few seconds, then Loiter, Twitch not as noticeable, HUD shows 1-2 degrees roll, primarily roll to the right. Twitch more noticeable in Stab. Mode.

Param. changes prior to this 2nd Flight Test
image

##Flight Test #3 ARM Arrpx. 07:21:57 – 07:24_48:

Stabilized mode for a few seconds, then Loiter, then Stab. and made a few aggressive Roll maneuvers.

Twitch reduced a bit more with these param. settings, HUD shows 1-2 degrees roll, primarily roll to the right. Twitch more noticeable in Stab. Mode.

Param. changes prior to this 3rd Flight Test

Good work!
You should reduce these down to 10 or 15 too
ATC_RAT_PIT_FLTD
ATC_RAT_PIT_FLTT
ATC_RAT_RLL_FLTD
ATC_RAT_RLL_FLTT
ATC_RAT_YAW_FLTT
10 would be normal when you have INS_GYRO_FILTER,20 - or you could set them at 15 in case one day you try INS_GYRO_FILTER,30. Definitely set those HNOTCH parameters too, and do another test flight when you can.

Personally I’d be tempted to try Autotune on one axis after checking the HNOTCH results.

Shawn, any thoughts on why reducing INS_GYRO_FLTR from 42 to 20 reduce the Twitch?

Shawn, would it be best to conduct the Dynamic Harmonic Notch Filter before adjusting:

Stage 1” :
ATC_RAT_PIT_FLTD,15.00
ATC_RAT_PIT_FLTT,15.00
ATC_RAT_RLL_FLTD,15.00
ATC_RAT_RLL_FLTT,15.00
ATC_RAT_YAW_FLTT,15.00
INS_GYRO_FILTER,20.00

“Stage 2”
ATC_RAT_PIT_FLTD,15.00
ATC_RAT_PIT_FLTT,15.00
ATC_RAT_RLL_FLTD,15.00
ATC_RAT_RLL_FLTT,15.00
ATC_RAT_YAW_FLTT,15.00
INS_GYRO_FILTER,30.00

“Stage 3”
ATC_RAT_PIT_FLTD,20.00
ATC_RAT_PIT_FLTT,20.00
ATC_RAT_RLL_FLTD,20.00
ATC_RAT_RLL_FLTT,20.00
ATC_RAT_YAW_FLTT,20.00
INS_GYRO_FILTER,40.00

Hey Shawn, Harmonic Notch conducted. It looks like there is a large improvement (I would appreciate your input and opinion).

One thing, it looks like my Z Vib has gone up?!

Yesterday Phase 1 of Harmonic Notch:
Z Vib.
image
Harmonic Notch:
image
image

Today Phase 2 of Harmonic Notch:
Z Vib.


Harmonic Notch:
image
image

Quad motors sound like they are very synchronized, no indication of rapidly changing RPM, very stable in all modes (Stab./Loiter/AltHld).

The Quad is flying very nice and smooth!!

Ph1 yesterday, and Ph2 today .bin files:
https://drive.google.com/drive/u/0/folders/1oJu4VgNgmyL_zD6jq1j20pBN_rVmGqK6

Hey Shawn, checking in (see several message updates above this message).

So Post Harmonic Notch Filter and Post ATC_RAT_PIT/RLL/YAW changes and increasing INS_GYRO_FILTER to 40!! Happy to say the Quad is flying very stable, probably more stable than ever before! Very good control authority. One thing I am curious about, after conducting the Harmonic Notch Filter and incrementally increasing INS_GYRO_FILTER / ATC_RAT it looks like the Z Vib is also incrementally reduced. Is this what you would expect?
1st FltTst 2021-04-24 07-17-29.bin:
Zvib Post INS_GYRO_FILTER increase in ATC_RAT_(PIT/RLL/YAW=15) & INS_GYRO_FILTER=20 nc Z Vib:

2nd FltTst 2021-04-24 07-29-33.bin:
Zvib Post INS_GYRO_FILTER increase in ATC_RAT_(PIT/RLL/YAW=15 nc) & INS_GYRO_FILTER=30 Z Vib:

3rdFltTst 2021-04-24 07-41-25.bin:
Zvib Post INS_GYRO_FILTER increase in ATC_RAT_(PIT/RLL/YAW=20) & INS_GYRO_FILTER=30 nc Z Vib:

4th FltTst 2021-04-24 07-51-234.bin:
Zvib Post INS_GYRO_FILTER increase in ATC_RAT_(PIT/RLL/YAW=20) & INS_GYRO_FILTER=40 nc Z Vib:

That is really good work, those logs are looking much better now for attitude control.
You are definitely doing the right thing by setting up that harmonic notch filter and increasing the other filter values in exactly the way you have !

It would be nice to see a new log from the last flight with the 40/20 filter values.

I would probably just round off these Harmonic Notch filter values:
INS_HNTCH_FREQ,88
INS_HNTCH_BW,44
And set these so you don’t keep logging the extra HNTCH info:
INS_LOG_BAT_MASK,0
INS_LOG_BAT_OPT,0

And safe to set these if you haven’t already:
ATC_THR_MIX_MAN,0.5
PSC_ACCZ_I,0.686
PSC_ACCZ_P,0.343
They will provide better/more suitable altitude control now that there’s low risk of a fly-away.

I don’t see any reason why you couldn’t run an Autotune, probably 1 axis at a time.
Safest to try Yaw only first and see how long that takes. If you comfortable do pitch or roll.
Ultimately you’d want to be able to run each of the three axis, either together or individually.

  • AUTOTUNE_AXES -> 7:All 1:Roll Only 2:Pitch Only 4:Yaw Only 3:Roll and Pitch

Remember to let Autotune run its course then return and land WITHOUT changing modes or switching out of Autotune mode - then disarm once landed and wait a few seconds for new PID’s to be saved. I find LOITER mode is good to start with then switch into Autotune mode.

Hey Shawn,

I have turned off the Notch Filter logging (INS_LOG_BAT_MASK,0; INS_LOG_BAT_OPT,0).

Uploaded the .bin for the 40/20 filter values. https://drive.google.com/drive/u/0/folders/1oJu4VgNgmyL_zD6jq1j20pBN_rVmGqK6

A bit hesitant to run Autotune since last time it resulted in an uncontrollable oscillation and I have read several posts that others have run into this same oscillation problem. Especially since I have so much time tied up in getting this Quad to fly correctly. Maybe. What performance enhancement would you expect I would see if Autotune works correctly?

If you do run autotune, change to it from AltHold rather than Loiter. I’ve seen a few posts by experienced users recommending this as there’s a bug (iirc) which prevents autotune from loiter being as good as autotune from AltHold.

That is quite good now.
I can understand the caution about Autotune. Get some more flight time in and gradually move to more dynamic movements and flying around at different speeds. Give that quad a good work out over time.
Use Althold and Loiter modes a lot, and try these Loiter parameters for nice controlled feel
LOIT_ACC_MAX,600
LOIT_BRK_ACCEL,300
LOIT_BRK_JERK,300
LOIT_BRK_DELAY,0.30
If that all goes OK there’s no reason why Autotune shouldn’t work.

You can see in RC Out (to motors) that the lines on this graphs are nicely defined and all in a narrow range. Before the RC Out turned into a blur over a wider range.

And this latest Attitude control graph, the lines are all smoother and actual stays closer to desired - there’s a small amount of tuning that can be done, but not a lot.

Even recently, in the “Ph1 HarmNtch 2021-04-22 09-33-37.bin” log you can see how the lines are sharp and noisy. It was worse in the earlier logs but I didn’t have your older logs to show.

In parameters you could expect to see ATC_RAT_RLL_P/I/D and ATC_RAT_PIT_P/I/D to change a little bit higher but not much - mostly ATC_ANG_RLL_P and ATC_ANG_PIT_P would be a lot higher.
You could safely try increasing ATC_ANG_PIT_P and ATC_ANG_RLL_P in small steps - they have a wide range of operation so going up in whole digits will be OK, like +1.0 or +2.0 to the 4.5 values that are there now. If there’s any sign of oscillation or strangeness, just reduce them by 0.5
If you can get them in a better place, the Yaw Autotune would really help too, and it’s quite reliable and safe.

This is from a similar sized and weight quad to yours, same base plates in fact but arms are stiffer carbon fibre tube. You can see there’s almost no difference between actual and desired even for large movements. In wind this one seems like your looking at a photograph instead of an operational quad in wind.


And it’s yaw control.

It’s hard to get there with those bendy arms, but you can get closer over time once you are happy with the reliability.

Shawn, as always really great information! I will do as you suggest.

Hey is there anything I can do for you to help you in your ratings or position in this forum?

Getting your quad flying and tuned better is all the reward I need - it helps us both learn.
Keep us informed of the progress :slight_smile:

Hey Shawn, so setting up for AutoTune. My Setup, Flight Modes on 2 Switches and AutoTune selected via a 3rd switch (RC7 Opt=AutoTune).

Sorry to belabor the point but I want to very clear on use of Loiter for AutoTune. So the procedure should be: normal TO (RC7 not active, not selecting AutoTune) and climb to my AutoTune Alt. (Stab Mode), switch to Loiter, then select AutoTune via the TX 3rd SW I assigned to AutoTune (RC7 Opt=AutoTune active), and let the Quad complete the AutoTune (Yaw Axis only), RC7=AutoMode active through the AutoTune, landing and disarm and power removed.

My Question is:
After AutoTune completes can I switch the flight modes (while the TX 3rd Switch is still selecting AutoTune i.e. RC7=Autotune is active) to test out the AutoTune Yaw axis in various flight modes i.e. changing the flight modes via the 2 switches while the 3rd switch is active and selecting RC7 Opt=AutoTune.

I believe that the key to retaining the AutoTune param changes is to leave the RC7 active=AutoTune until I land and disarm the Quad. Is that correct?

Basically yes. No need to remove power, after disarm and wait a few seconds you can switch out of Autotune mode and try flying again as per normal if you have enough battery left.

I was going to check with you to see how things are going. Been getting in some flight time?

Actually, no flights for the last couple of days, should be able to get one Autotune flt. in the morn. and the rest Mon.

Thanks

Hey Shawn, well looks like AutoTune did not work?? The following is what I did and a diff. file showing pre-AT (right col) and post-AT (left col.). What the Tlog file shows is AT is active and successful AT Yaw but at 07:51:31 AutoTune (Red letters left side of HUD) disappear but AutoTune white letters right side of the HUD remain. At 07:51:34 Red Letters "AUTOTUNE: pilot overrides active is displayed on the left side of the HUD, then at 07:51:40 Simple mode off (red letters SIMPLE mode off left side HUD) is displayed and stabilize shown in white letters right side of the HUD. Disarm at 07:52:10

Preflight:

  1. Set AUTOTUNE_AXES=4 (Yaw Only)
  2. Set MP RC7 Opt=AutoTune
  3. Switches SF and SE used to select Flight Mode
  4. Switch SA used to select RC7 Opt=AutoTune

Procedure for Yaw axist AT:

  1. Normal arm, TO in Stab
  2. Switch to Loiter (sw SE)
  3. While in Loiter mode (SW SE), Select AutoTune SW SA (MP set for RC7 Opt=AutoTune)
  4. Conduct AT Yaw Axis only (Quad Yawing clockwise and counter clockwise for about 4 minutes
  5. After quad stops yawing motion (with SA active=RC7 Opt=AutoTune=active), use SE to change flight mode from Loiter to Stab (NOTE: AutoTune still active i.e. SA active=RC7=AutoTune=active)
  6. Land and disarm (NOTE: AutoTune still active i.e. SA active=RC7=AutoTune=active)
  7. Remove power after about 30 seconds

The table below is a diff. file of the params: Post AutoTune (left col.) and Pre AutoTune (right col.)
Does not look like AT Yaw Axis worked?

Upload of PreAT params file and PostAT params file and Tlog file:
https://drive.google.com/drive/u/0/folders/1oJu4VgNgmyL_zD6jq1j20pBN_rVmGqK6