I can't fly my quadcopter, because my motors oscillates badly after the activation of Harmonic Notch filters

Hi guys.
I have a quadcopter, which I made myself for a project. My quadcopter was flying very well, until I activate the Harmonic Notch filters. Then, the motors starts oscillates badly, so from that moment I can’t take off my quadcopter. Also, when i disabled the filters the motors still vibrates too badly.
I changed the old ESCs and I reset my Cube Orange in the default values, but the motor vibrations still exists. I would changed my motors, but the problem appeared at the same time in the 4 motors, so I assumed that the motors works well.

This is the log file of the last normal flight, without motor vibrations (however it’s a very windy day). In this flight, I was enabled the Harmonic Notch Filters, but I don’t reboot the vehicle.
https://drive.google.com/file/d/1FOsPZ0caL_INm2ISsIcE4odwKHsoT1il/view?usp=share_link

This is the log file after I disabled the filters, with motor vibrations (still exists from then): In this flight I reboot the vehicle and the vibrations appeared. Then I disabled the filters, I reboot again the vehicle and I tried a take off, but the vibrations from motors was very high.
https://drive.google.com/file/d/1Gtvm-gm8xQJ4ZlAMCf-CcNOdHVpMHxOc/view?usp=sharing

This is the log file of the next day (with filters disabled), on which I was trying a safe take off, but the vibrations from motors was very high:
https://drive.google.com/file/d/1kWaFh7kn131xtDDL2DAos0a85ZP5gM6s/view?usp=sharing

Below, follows a video of the quadcopter, before the activation of the Harmonic Notch filters.
https://drive.google.com/file/d/1eq9RgD4QozqAD9uRTH5x4o_2DceUSbm9/view?usp=sharing

The quadcopter have the following setup:

  • 4 motors Sunnysky V4006 with almost 1 hour total flight (each motor).
  • Racestar 4x50A Metal 4in1 ESCs with BLHeli32 (the new ESCs).
  • EOLO CN17*6.2 props.
  • Cube orange autopilot.
  • Hexsoon PDB 40A.
  • Herelink system.

I was noticed that in the log file, after the activation of the filters, and especially in the value RCOUT, the PWM outputs are not normally. I think that this variance of the PWM outputs, make the motors to vibrate.

I would like your experience guys, to solve my problem and fly again my big quadcopter.
Have a beautiful day with safe flights!!!
George

1 Like

I encountered the same problem, motors oscillates after activate the Harmonic Notch filters.
then I reduced roll and pitch rate p i d, seems solved. But I don’t know if this solution is correct .

2 Likes

Access denied to the logs

If the issue remains after disabling filters then the relationship is more coincidental.

EDIT:
The problems Andy Piper describes, although seeming similar, are associated with a specific advanced configuration and I dont think this would be a problem for any “normal” configuration of the harmonic notch filter.

Thanks a lot guys for all your answers and especially Mr Andy Piper.
By the way, I have started to learn Ardupilot before 8 months ago and I have impressed with the parameters, the filters, the flight modes and all the capabilities of this software. And this online community is definitely amazing!!!

About my problem now, I will go tomorrow for flight tests, but I noticed the following:

  • The number of motor poles was wrong (=14 poles). So, I changed the parameter SERVO_BLH_POLES in the right number (=24 poles). I think, if the number of motor poles was right from the beginning, probably the activation of the Harmonic Notch filters would not cause the motor oscillations, but I’m not sure for this.
  • When I activated both filters, I reduced the parameters ATC_RAT_RLL, PIT_P, I, D and I increased the parameter INS_GYRO_FILTER (of course I changed the parameters ATC_RAT_RLL, PIT_FLTD) the oscillations decreased, but they don’t disappeared. I think that with the new setup I could take off, but my quadcopter will not be as stable as was before the activation of the filters.

My questions:

  1. Mr Andy Piper in the video, used the ESC telemetry (INS_HNTCH_MODE =3), but my ESCs don’t have this capability. Which mode can I use and with what settings?
  2. Why should Ι activate the filters, if my quadcopter before this activation was super stable. What will be the advantage of these filters in my quadcopter?
  3. After deactivating the filters, why did the motor oscillations not stop?
  4. Why did resetting to the default values not solve the problem?
  5. If the number of motor poles was correct, would the oscillations have appeared?
  6. The triple notch was a cause of the problem?

Really thanks for all your replies.
Have a great Sunday!!!
George

If you fix access to the logs I can help a lot more.

Without the telemetry from the ESC we can still set up effective throttle based filtering. It’s strange they dont output the data from the ESC.

I’ve never seen enabling filters cause an issue unless the filter was badly configured and affected the control frquencies (ie: filtering out actual movements).
Whenever these oscillations have not stopped by disabling the filters, it’s always been something else wrong, and it finally got pushed over the edge.

Check your BLHELI32 settings before going further:

  • Low RPM Power Protect = OFF
  • Low Voltage Protection = OFF (rely on the flight controller battery settings)
  • Temperature Protection = 90
  • Motor Timing = Auto

And your harmonic notch filter settings should look like:

INS_ACCEL_FLTER,10
INS_GYRO_FLTER,27
INS_HNTCH_ENABLE,1
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.2 // guessing because we havent seen the log yet
INS_HNTCH_FREQ,50  // this will be close to correct
INS_HNTCH_BW,25
INS_HNTCH_FM_RAT,0.7
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Number of poles only changes the RPM calculation - if you are not using ESC RPM data it makes no difference.

The conclusion of my video was that phase lag was the issue. Adding filters introduces phase lag which leads to oscillation. You can reduce phase lag by pushing filters higher or making the notches narrower - either way you may have to reduce PIDs.

Yes I understood that too. I’ve watched most of your videos and nearly all of the Ardupilot conference videos - all of which is very instructive. I’ve been thinking about that introduced lag recently - it’d be nice to see the logs to know what was going on.

1 Like

This is the log file in the normal flight, before I reboot the vehicle:
2023-04-10 18-41-01.bin.param (18.5 KB)

This is the log file after I reboot the vehicle and the vibrations appeared:
2023-04-10 19-50-33 …bin.param (18.5 KB)

This is the log file in the next day, while I’m trying to take off:
2023-04-11 19-46-06.bin.param (17.9 KB)

You can set the other logs access in google drive by selecting anyone with the link…
image

I’ll check those param files, might be able to see something there…

EDIT
Rate PIDs are a problem
and you’ve got two notch filters set up at 30Hz which wont be helping.

So set the other parameters I already specified
plus set or adjust these

INS_HNTC2_ENABLE,0
INS_HNTCH_OPTS,0
INS_HNTCH_REF,0.22

and lets see what the .bin log files can tell us

https://drive.google.com/file/d/1FOsPZ0caL_INm2ISsIcE4odwKHsoT1il/view?usp=sharing
https://drive.google.com/file/d/1Gtvm-gm8xQJ4ZlAMCf-CcNOdHVpMHxOc/view?usp=sharing
https://drive.google.com/file/d/1kWaFh7kn131xtDDL2DAos0a85ZP5gM6s/view?usp=sharing

That’s better.

The vibrations are just OK, so keep an eye on that. If you can do anything to improve vibrations that will help tuning plus it means you could more easily spot things degrading over time.

ATC_INPUT_TC should probably be about 0.2 for this copter. 0.15 is the default. It is a user preference but with a very low value like 0.05 you’ll be making demands the copter cant hope to satisfy.

I would try these PIDs as a relatively safe starting point.

ATC_ANG_RLL_P,6.0
ATC_ANG_PIT_P,6.0
ATC_RAT_RLL_P,0.12
ATC_RAT_RLL_I,0.12
ATC_RAT_RLL_D,0.006
ATC_RAT_PIT_P,0.12
ATC_RAT_PIT_I,0.12
ATC_RAT_PIT_D,0.006

Read through all the parameters I’ve listed in this and other replies, make sure you’ve got them all.

For the next test flight, start with Stabilise, and if that seems OK go to AltHold and try some gentle movements - nothing too radical, we’re just gathering data at the moment.
If possible use Loiter in the same flight. poshold is outdated and Loiter is so much better.

I think you already have FFT_ENABLE,0 (disabled) but just check and make it so.

So, the parameters I have to set are the following:

  • INS_ACCEL_FILTER=10

  • INS_GYRO_FILTER=27 (17in prop)

  • INS_HNTCH_ENABLE=1

  • INS_HNTCH_MODE=1

  • INS_HNTCH_REF=0.22

  • INS_HNTCH_FREQ=50

  • INS_HNTCH_BW=25

  • INS_HNTCH_FM_RAT=0.7

  • INS_HNTCH_OPTS=0

  • INS_HNTC2_ENABLE=0

  • INS_LOG_BAT_MASK=1 (for gathering data from 1st IMU)

  • INS_LOG_BAT_OPT=4 (for sampling after the filter activation)

  • FFT_ENABLE=0

  • ATC_ANG_RLL_P=6

  • ATC_ANG_PIT_P=6

  • ATC_RAT_RLL_P=0.12

  • ATC_RAT_RLL_I=0.12

  • ATC_RAT_RLL_D=0.006

  • ATC_RAT_PIT_P=0.12

  • ATC_RAT_PIT_I=0.12

  • ATC_RAT_PIT_D=0.006

My questions:

  1. Why we don’t use the FFT mode?
  2. If my quadcopter don’t respond properly, should I reduce the PID values?
  3. Why the parameter FFT_ENABLE should it be disabled?

And ATC_INPUT_TC=0.2

Mr Andy Piper really thanks for replying. I hope you are well!!!
I want to ask you, how can I make my notches narrower? I will definitely reduce the PID values, as you said. From your video, I understood that I should reduce the parameters INS_HNTCH_FREQ and INS_HNTCH_BW. Also, I will have to increase the parameter INS_GYRO_FILTER. Will these changes make my notches narrower?

Just reduce INS_HNTCH_BW, it is the ratio of INS_HNTCH_FREQ / INS_HNTCH_BW that matters

" My quadcopter was flying very well " Depending on the hardware you use your not required to do any changes to your stock tune if it fly’s well! In Mission Planner we do have a slider that mellows out the tuning only needed if you have intense issues during maiden. later if you like to tweak your craft move to the extensive tuning.

I also want you to change this
MOT_PWM_TYPE,7
to
MOT_PWM_TYPE,6
DSHOT600 seems reliable with all BLHELI ESCs and there’s no need to go to 1200

And DSHOT is not even being used. While the ESC wires are plugged into the Main Out pins only PWM is used.
You will have to change these servo outputs, use MissionPlanner Setup / Mandatory / Servo
and use the drop-down lists to move the motor outputs to Servo 9, 10 , 11 , 12 as per the picture below.
You will also need to move the physical connectors too. On the Cube carrier board they are labelled Aux Out 1, 2, 3, 4

1 and 3
The in-flight FFT has a bit of trouble picking up the low frequencies of larger props. It tends to settle on a harmonic (multiple) instead of the base frequency. Andy is making improvements we should see available soon. This can usually be made to work with some adjustment to FFT parameters, but then you’ve got to do a couple of test flights and examine FFT data just to tell if the in-flight FFT is working properly…
This could be worth the effort if you are constantly changing payloads, but normally throttle or RPM-based notch filtering is fine. You could always revisit the in-flight FFT later of required.

At the moment it’s easier to set FFT_ENABLE,0 and examine the FFT data ourselves post-flight and decide on INS_HNTCH_FREQ , INS_HNTCH_BW and INS_HNTCH_HMNCS.
I like to set these correctly even for the automatic/dynamic notch filter modes like ESC RPM, so the notch bandwidth is just what it needs to be and no more. Also when you see the specific chosen values in parameters you know someone did the work to find them and they should at least be close to being correct - like an indicator that harmonic notch filtering is set up and working.

INS_LOG_BAT_OPT=4 has the advantage of gathering pre-filter data AND also post-filter data
So we can see what to filter, and how effective it is all in one flight.

2
Your Rate PIDs were a bit strange, with I value much higher than P, and overall they were higher than we usually see.
Rate D was also quite high compared to P and I.
Usually we have P and I the same, and D would be quite small compared to P and I.

I’ve given you some values that I’ve used many times before as a starting point. Angle P is a little higher than default, and the Rate PIDs are a little lower and more sensible that what you had.
Let’s see if that smooths things out.

I would say the oscillations you had were because of the high PIDs, and became exaggerated with the mis-configured harmonic notch filters at 30Hz and triple notches. It looks like you didnt actually disable the faulty notch filters for subsequent flights, so the flight continued to be adversely affected.

I thought the FFT would be coming out with the newest version of Arducopter?

1 Like

In-flight FFT has been out for some time. It works well with smaller props/high frequencies.
The in-flight FFT seems to have trouble picking up on the low frequencies. There’s some params you could modify to see if it will work with your copter - or just use throttle or ESC RPM