Harmonics Filter causing extreme oscillations

Anyone can help a newbie out. Building a cinelifter with Arducopter everything flys great when the Harmonic Notch filter is disabled but once I enable it using the FFT instead of esc telemetry to handle noise the quad start to oscillate terribly. I’m flying the Swol 10in x8 configuration. Using the initial parameters.

Log files 1st Harmonic Filter Disabled

https://drive.google.com/file/d/13BAByjSOEj4nJD-PZReosaUCgDOp-6ux/view?usp=drivesdk

Log file with harmonic enabled

https://drive.google.com/file/d/11kpRsxE7r2ycGiKoWmJcafoWI9XmFhl2/view?usp=drivesdk

First set this
INS_ACCEL_FILTER,10
you didnt make a mistake, this should be the new default.

In the first log with “No Notch” you got an configuration error, the second notch filter is enabled.
This is not a big problem, but I would set
INS_HNTC2_ENABLE,0

Then in the second log with oscillations you’ve got a different error when you enabled the first notch filter
INS_HNTCH_BW,105
this will be filtering out desired movements and all sorts of things, since the FFT-derived frequency is 90Hz. This would have been the cause of the oscillations.

I would set this for throttle based notch filter now that you’ve got reasonable values to work with from the live FFT.
FFT_ENABLE,0
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.125
INS_HNTCH_FREQ,90
INS_HNTCH_BW,45
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_OPTS,0

FFT was also giving a very wide bandwidth, and I think the reason is there’s quite a weight imbalance.
Rear motors are working a lot harder to lift, making a broader spread of frequencies.

So I would better balance the craft then set
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4 (my new favourite value!)
and do another test flight to fine tune the HNOTCH values.
Let’s see that log

Thank you. I will make adjustments. Your a life saver :ring_buoy:!! I’ll follow up tomorrow!!

Actually maybe just the excessive bandwidth alone might not cause the oscillations, but maybe having that and the seconds notch filter all working in the same space may have caused problems.
Normally the first and second notch would be working with different ranges of frequencies.

2 Likes

I’ll turn off the second filter. To see what the response is.

Yes, do all the changes I detailed.
I was just thinking about the reason for the poor control…

1 Like

Well do. Thanks again I’ll follow up

Good Morning here is the updated log after making changes with your recommendations.

https://drive.google.com/file/d/1WJ_GcdY-VRqo7h3ul2Xb85Yx9RjOcwme/view?usp=share_link

Still oscillating but not as much it feels like its getting closer to getting dialed in.

That’s quite good for stabilise mode and all default PIDs.
You can adjust these:
INS_HNTCH_FREQ,128
INS_HNTCH_BW,64
INS_LOG_BAT_MASK,0
INS_LOG_BAT_OPT,0
Sorting out the balance really helped to bring those motor outputs together and narrow down the range of frequencies to filter.

See on the map, your IMU estimated position and the GPS position don’t align yet you’ve got good low vibrations. I suspect this is because of houses and trees.
image
But you could still set this to give a better GPS 3D Fix - there tends to be less certainty when the GPS units are using all available constellations and they can get overwhelmed.
GPS_GNSS_MODE,3

Also I would consider changing these:

FENCE_ENABLE,1
You wont be able to arm and fly until there’s a good 3D Fix and Home can be set - seems to take a while but think of your copter and payload disappearing off to Sea of Japan…

BATT_FS_CRT_ACT,3 usually set to 1 for Land, it’s unlikely to be able to return home with a critical battery level. Maybe BATT_FS_LOW_ACT would be good to have as 3 Smart RTL
Most often a BATT_FS_LOW_ACT has already initiated RTL (or Smart RTL) and the copter is half way home, now reached critical battery level. The only viable option will be to land.
Change
FS_OPTIONS,16 to 24 so it will “Continue if landing on any failsafe” and not start all over again if already landing.

If you have a spring-centered throttle then I set this too:
PILOT_THR_BHV,7

After all that, get out in a big open space and run Autotune!
Set a switch position to Autotune mode, switch into it once flying and let it complete (twitching stops) and then reposition, land and disarm WITHOUT touching any switches! After a few seconds the new values are saved and you can arm and fly again.
Use plenty of Althold and Loiter

Sounds good . Making adjustments now . Thanks

Ran another test flight still getting oscillations when I roll or yaw a lot better, but not sure why its continuing. I figured i should resolve before doing a auto tune. Below are logs and a video of the flight.
log 1
https://drive.google.com/file/d/1y2tg6BxuZpn3uzt5D2zATDoZl-htvvDu/view?usp=share_link

Log 2
https://drive.google.com/file/d/1bSKqoLpWBUuC_Y9Q8NGPFh5QR3S0OnS3/view?usp=share_link

Video
https://drive.google.com/file/d/1K-pvS-p6RY3poVVfFQ0TrbQNXWc0xJtr/view?usp=share_link

I think the results in the log look quite good for where you are in the tuning process (pre-PID tune configuration).

Ok I’ll go from here thanks my friend. Do you have a Facebook page??

No Anthony I don’t do Facebook.

1 Like

Just do the Autotune as I described

Finally did the Autotune and a flight! It has rained 7 days straight here . Here is the log , I did notice oscillations when recovering from a dive in Acro scared to the point I just brought it home.

https://drive.google.com/file/d/17l1tOh43nzYz0hctJBGYedZaEd2pdb82/view?usp=share_link

You can set
ATC_THR_MIX_MAN,0.5
otherwise I cant see any bad issues.

Here’s updated Compass settings courtesy of the Magfit utility
COMPASS_DIA_X,0.800
COMPASS_DIA_Y,1.185
COMPASS_DIA_Z,0.800
COMPASS_MOT_X,-10.000
COMPASS_MOT_Y,1.471
COMPASS_MOT_Z,-3.520
COMPASS_MOTCT,2
COMPASS_ODI_X,-0.200
COMPASS_ODI_Y,0.160
COMPASS_ODI_Z,0.093
COMPASS_OFS_X,-615
COMPASS_OFS_Y,-237
COMPASS_OFS_Z,-49
COMPASS_SCALE,1.00

The aggressive Pitch and Roll during that maneuver caused a ton of vibe clip events leading to an EKF Lane change and an emergency Yaw reset. I suppose it’s the reason for the oscillation you saw.

Otherwise the tune looks good.

Note: There is a message in the log I haven’t seen before. Not sure what to make of it:
ICM

This is the reason:

we check and restore the ICM20602 Y offset high register
on every update. We don’t mark the IMU unhealthy when we
do this. This is a workaround for a bug in the ICM-20602
where this register can change in flight. We log these
events to help with log analysis, but don’t shout at the
GCS to prevent possible flood

@ Dave so what’s the workaround?