Almost crashed Quadcopter

Hi all,

Today I was flying my quadcopter and upon RTL, it reached home point and just before about to land, the drone tilted for about 45 degrees and was about to crash. I suddenly changed the mode to AltHold and managed to land safely. When observed in logs there was a clear deviation from the desired and actual pitch values as shown in the image below


Link to Log : https://drive.google.com/file/d/1ooGIT8WBf0WLADxIOLD9s34TOHQEKoAt/view?usp=sharing

Ask : Can someone please explain why this could have happened?

1st update to latest stable you are running old firmware on EK2. Tuning on this craft is way off. I don’t know how you arrived at this between Pitch and Roll
ATC_ANG_PIT_P,18
ATC_ANG_RLL_P,1.744479

ATC_RAT_PIT_I,0.04767863
ATC_RAT_PIT_P,0.04767863

ATC_RAT_RLL_I,0.14
ATC_RAT_RLL_P,0.14

Also, some of the Initial Tuning Parameters are not set. I would reset to default, set the Initial Tuning Parameters and start tuning again and plan on configuring the Dynamic Notch Filter.

I set this to ArduCopter 4.2 now. Please post a log once you followed Dave`s recomendations.

Hi Dave,

Thanks a tonne for responding. I was travelling last two days. Sorry I didn’t answer quickly.

I am going for the tuning now. Thanks a tonne for the recommendation. I’ll tune, do a small auto mission and then share the log here.

Also Dave, I have never tuned my drone manually. Been surviving with AutoTune only.

Do you insist on doing Manual Tuning? Please suggest.

No, not at all. Auto Tune is usually the best option. But you have to do the initial tuning work 1st before running it or you will get results like yours.

Noted. Thank you.

I have been reading about Dynamic Harmonic Notch Filter. I am using Pixhawk Cube orange. Do you recommend Throttle based Dynamic Notch FIlter or In-Flight FFT Based Harmonic Notch Setup ?
From the little reading I did, Throttle based is easy to setup.

If you don’t have Motor RPM either thru ESC Telemetry or using the Bdshot firmware then FFT would be the next best choice. But throttle based works well too.

Hi @dkemxr and @amilcarlucas

Thank you for your suggestions. I followed your instructions in the following order

  1. Flashed Arducopter 4.2.2 on my cube orange
  2. Used Missionplanner Helper to do the initial parameter setup as described in this blog. I used the following inputs in the MissionPlanner Helper Screen

Air Screw Size : 18
Battery type : LiPo 6S
Max Voltage : 4.2 V
Discharge Voltage : 3.4 V

  1. Followed instructions in Initial tuning to make sure Altitude hold was working and got the MOT_THST_HOVER. My MOT_THST_HOVER value was 0.21

  2. Setup Throttle based Dynamic Notch Filter and identified two peaks in noise during hover at 68Hz and 120 Hz as shown in the below image. Logs are attached in the link below.

  3. Used the following values for Notch Filter Configuration

INS_HNTCH_ENABLE : 1
INS_HNTCH_REF : 0.21
INS_HNTCH_FREQ : 120
INS_HNTCH_BW : 60
INS_HNTC2_ENABLE : 1
INS_HNTC2_REF : 0.21
INS_HNTC2_FREQ : 120
INS_HNTC2_BW : 60

  1. After using Notch filters the noise plots are as follows. Logs are attached in the link below

  2. Performed Autotune in the following order and the gains are as follows

ATC_ANG_PIT_P : 18.37906
ATC_ANG_RLL_P : 12.43967

ATC_RAT_PIT_I : 0.1313336
ATC_RAT_PIT_P : 0.1313336
ATC_RAT_PIT_D : 0.008305321

ATC_RAT_RLL_I : 0.1158881
ATC_RAT_RLL_P : 0.1158881
ATC_RAT_RLL_D : 0.005082444

Observations

  1. Stability and Control did improve a lot. Automatic Navigation also has become cleaner.

Ask : Can someone please review the Autotune from logs? Attached in the link below.

  1. However, ATC_ANG_PIT_P and ATC_ANG_RLL_P are not allowed to be >12. But my autotune converged to 18 and 12 respectively.

Ask : 1. What would be the cause? 2. What would be the effects if these gains are greater than 12?

  1. During Yaw tuning, Telemetry error said “Can’t level the drone. Please try manual tuning”. However I continued with the Autotune and it did converge and said Autotune successful.

Ask : 1. Can I rely on this or do I have to do manual tuning? 2. What would be the potential cause that this happens?

  1. There were two peaks in noise plots. One at 120 Hz and the other at 68 Hz.

Ask: Can I use INS_HNTC2_FREQ as 68Hz as there is a second smaller peak compared to 120 Hz?

Link for logs : Link

Don’t worry about those out of range values. They are there to catch gross entry errors.
I would set the notch center frequency at 66Hz (BW 33) and it will pick up the harmonic of that which is the largest peak.
Tuning looks good. Nice job.

1 Like

I whish the other users could learn from you. good job at following the instructions without complaining, nor deviating :slight_smile:

4 Likes

Thanks you. @dkemxr and @amilcarlucas

I have two last questions and then I am probably good to go.

Question 1: Do I have to repeat the AutoTune if I change the notch center frequency to 66 Hz from 120 Hz?

Question 2: What is the significance of having two sets of INS_HNTCH_**** and INS_HNTC2_****, if I am using the same exact values for both the sets?

Please help me understand. Thanks again in advance. Really appreciate your inputs and guidance.

You would not use the same configuration for both notch filters. To be clear you only need 1 with a center frequency at 66hz. A second filter configuration is not needed. If there are either 2 modes of vibration that are not coupled or a static mode with no harmonics then 2 notch filters can be helpful.

That makes sense. You have missed ‘Question 1’.

Do I need to repeat Autotune if I change center frequency from 120 to 66?

I would. I just went through this with a smaller quad, where I changed the notch filter so I decided to re-do the autotune. It did improve things, but I had to look at the logs to see the difference. The good thing is, if the quad is flying well already and these are just improvements or fine tuning, then autotune will run pretty quick.

Hi @dkemxr and @Allister

I changed the Notch Center frequency to 66 Hz. Repeated autotune when the winds were absolutely calm. And ended up with the following gains.

ATC_ANG_PIT_P : 11.97153
ATC_ANG_RLL_P : 13.07066
ATC_ANG_YAW_P : 5.013271

ATC_RAT_PIT_I : 0.121224
ATC_RAT_PIT_P : 0.121224
ATC_RAT_PIT_D : 0.00601697

ATC_RAT_RLL_I : 0.1002318
ATC_RAT_RLL_P :0.1002318
ATC_RAT_RLL_D : 0.005633536

And my problem resurfaced. Attached a log for an automatic mission. For about 4 times during the auto mission, there is clear offset between desired and actual pitch. Pointed below.

Ask : I am missing out on something fundamental here I think. My ESC signal wires are pretty close to the main battery wires. Would battery wires cause noise in the signals?

Link to Log : Link

You have 2 Notch filters configured. You must have missed the “to be clear” comment above… Disable the 2nd one and make a short hover flight with post filter logging to see the result. I don’t know why you are running Auto Missions before completing the tuning. Also set these as per the tuning guide based on the MOT_THST_HOVER value:
PSC_ACCZ_I
PSC_ACCZ_P