Hexacopter crash in auto mode- too fast?

Hi, I decided to fly my Hexa in auto mode but at a faster horizontal speed. Few mins. later, it was on the way to waypoint 3 and it spun out of control( yaw and pitch), like violently! I tried to save it by switching modes but it seemed to make the issue worse, I wasn’t able to save it!

  1. Upon assessing the damaged copter, I noticed that the ESC soldering from PDB had been broken, I think it had happened when it crashed because the motor seems to have been working fine. I also noticed that the GPS was unplugged, could’ve been from the crash as well.
  2. On the other hand I did get a Potential thrust loss (5) error, and also a compass error, but by the time I saw them I was already trying to save the Hexa from crashing so, not sure if it was because of the violent spinning.
  3. all connections other than that are intact, and all motors are spinning without any interference

So, is it because I tried going too fast? or was there some other issue? any input would help, thank you!

the log: Filebin | b35oy6hqsfwcop7d

It looks like it had reached maximum speed, some motors have ramped up to near maximum and some are at minimum to achieve the lean angle. Oscillations and near loss of control causes all motors to reduce output to maintain stability at one point but the oscillations are too much.
Switching to Loiter does almost help, but not quite.

The problem is the tuning is not sufficient to cope with disturbances or high speeds (in this case) and recover. PIDs are at defaults and there’s a few other things that could be improved before destructively testing to the limits.

The Harmonic Notch Filter is not set correctly, it probably needs to be
INS_HNTCH_REF,0.1
INS_HNTCH_FREQ,68
INS_HNTCH_BW,34

MOT_SPIN_MIN,0.15 → maybe 0.13
ATC_THR_MIX_MAN,0.5

Do a flight in AltHold with just hovering and gentle movements, try to do some circles or figure 8’s
Let’s see that log in case we need to make more adjustments.
Then you should be able to run Autotune.

1 Like

Completely Agree! I never want to do this again!
and the copter seemed to be superr stable at loiter without auto tuning, so I figured I was happy with the defaults and left it that way!

The copter’s arm is broken, from the rescue attempts rather than the crash! :frowning: so will get it fixed and update in the thread!

So I made two flights, and both flights were similar too rocky, and too unstable to be able to fly properly.
background: after the crash, I rebuilt it (the copter’s 3 arms were bent or broken)and updated the firmware to 4.3.2. I was waiting for the winds to settle down, but then it just wouldn’t so, I took the test flight nevertheless. There was gust, around 5 knots, but I have flown it in more winds in the past.

The copter was very unstable and super rocky. I tried analyzing the logs, and from what I understand, there are some vibrations, but from what I have read, vibration until 30 should not cause significant problems.
I was wondering if my copter overcompensating for the movements. I calibrated the compass once before I took off…in that case, should I do the accel calibration as well?
does need to be tuned?
from what I can see, everything seems to be in a place physically.

edit: I forgot to post the bin files!

I made two flights, loiter seems much worse than stabilize, so I flew in stabilize itself! the second flight was worse than the first!

The vibrations don’t look too bad. You might have a bit of torque imbalance between the CW and CCW spinning motors, but since you mentioned you were flying in higher winds I wouldn’t get too worried about that. I think what you’re seeing is the PID tuning.

Follow @xfacta Shawn’s advice and get the setup done correctly before you go too far. Set up the notch filter per his suggestions and set INS_LOG_BAT_OPT, 1 (or 4) then do a test flight in AltHold to get an FFT log. Here’s some reading: Measuring Vibration with IMU Batch Sampler — Copter documentation

1 Like

@xfacta @Allister Thanks for your contribution guys!
Was too calm in the morning, so I test-flew the copter and
It was relatively stable, so I guess it was uncontrollable because it was gusty yesterday! This brings me to a question, I have a 3.5kg Hexa, powered by 1.5 -2kg thrust at 100% motors , what is the maximum wind speed I should fly it in? isn’t 5 to 6 knots light to medium winds?

In the test flight, alt hold was bad, I could not take my hands off the controller as it kept drifting to the right and back. It constantly needed inputs and hence did not do an 8 figure.
At loiter however, the copter was stable with slight movements, and it was in loiter that I moved the copter much. But a little while in loiter winds picked up a bit, 8km/h at tops, and the drone seemed like it had a bit difficult time trying to stay stable. Hence I kept the copter close to the ground, around 2-3 meters.

will this test flight be enough or should I do more?

Also, Can you guys help me understand how you come up with this number for the Harmonic notch filter?

Here is the bin: Easyupload.io - Upload files for free and transfer big files easily.

Harmonic Notch
See in this graph the first peak is around 62Hz to 70Hz, then the next is at 132Hz, then 194Hz and 257Hz
All are approximately 66 Hz apart. This means they are harmonics (mulitiples) of the primary noise source, the first peak at about 66Hz.
And INS_HNTCH_REF = hover_thrust * (min_freq / hover_freq)^2
So for INS_HNTCH_REF we could use 0.142 based on the graph and your hover thrust of 0.292

image

So to be more technically correct than we set it up earlier, you could set
INS_HNTCH_FREQ,66
INS_HNTCH_BW,33
INS_HNTCH_REF,0.142
INS_HNTCH_HMNCS,7 ← filter the 1st, 2nd and 3rd harmonics
INS_LOG_BAT_OPT,2 ← to check the result

In regards to Stability I would cautiously try these and see if you get better stability
ATC_ANG_RLL_P,6.5
ATC_ANG_PIT_P,6.5
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
…a bit higher Angle P’s and more balanced Rate PID’s
The ANG P’s might be able to go up quite a bit higher yet, but let’s see the result so far.

1 Like

Wow!, Thank you for that, I am sure I would have never figured that one out!

So I did two flights, one with a tuned harmonic notch and without PID changes, and another with the suggested PID.
What I noticed s that it flies better and the roll and pitch did stabilize. Yet it is not completely stable… there was a slight wind, and when hovering the drone kept rocking… when I move it around, it doesn’t seem so bad, in fact, it feels a bit smooth, and responds to inputs very well that I flew only looking at the camera and away from my eyesight.

So, should I try autotuning next? and would autotuning stop the rocking motion in the winds? I was also wondering if my copter is underpowered or unbalanced.

here is the BIN: Upload Files | Free File Upload and Transfer Up To 10 GB

Set
INS_LOG_BAT_OPT,4
It’s been set to 3 for some flights and it’s not very useful to us that way.

It seems to be NOT underpowered - cant say how it will react to a payload though.
I’ve seen quads where you can add a significant payload and it makes hardly any difference to the motor outputs, and others that suffer badly with only a small payload.
Clearly component selection, and how they work together, makes a big difference.

You could try another round of PID changes and see if it improves stability further:
ATC_ANG_RLL_P,7.5
ATC_ANG_PIT_P,7.5
ATC_RAT_RLL_P,0.10
ATC_RAT_RLL_I,0.10
ATC_RAT_RLL_D,0.0035
ATC_RAT_PIT_P,0.10
ATC_RAT_PIT_I,0.10
ATC_RAT_PIT_D,0.0035

Just be cautious about the take off and if stability is worse land and put back the previous values.

1 Like

So, I revised the PID, but it still kept rocking, so I went back and made some changes to the previous one, I reduced the angle of roll and pitch for the PID keeping the rates to 0.12 and D 0.006. and it seemed to stop the rocking! I took it up in calm winds, and it seemed quite stable!

So, I went ahead with autotuning, and the roll and pitch Autotune worked amazingly without any errors. but then when it came to the yaw, I got an error message “Autotune: failing to level, please tune manually”.

So I switched it to loiter and then back to Autotune and I got the same error. so I switched it to loiter again and I landed the copter.
So, why am I getting this error?
and
Since I did not land and disarm in autotune, I suppose the autotune for pitch and roll is not saved?

I did get a GPS glitch error during the yaw autotuning, which cleared on its own in a few seconds, ( I did panic a little though), is this the reason? and is GPS glitch error a serious problem?

Also, I very slightly changed the AHRS trim roll in the previous flights and it seemed to solve the rolling to the right, in stabilize and altitude hold, problem… is this okay to do?

Apologies for this, but then I can’t see option 4 in the said parameter, there is 1, 3- post filtering, and 7-pre and post filtering. I read in the documentation that pre and post filtering might be confusing, I can enable it if required and do another flight…

EDIT:
the log file: Upload Files | Free File Upload and Transfer Up To 10 GB

Here are the values. You can manual enter them and try again just tuning the yaw using the AUTOTUNE_AXES parameter.

2022-12-28 18:40:32.585 AutoTune: Pitch Rate: P:0.297, I:0.297, D:0.0123
2022-12-28 18:40:32.585 AutoTune: Pitch Angle P:11.788, Max Accel:71147

2022-12-28 18:37:23.018 AutoTune: Roll Rate: P:0.382, I:0.382, D:0.0166
2022-12-28 18:37:23.018 AutoTune: Roll Angle P:12.996, Max Accel:74130

1 Like

For the drifting to one side, you need to set the copter perfectly level across the top of the props or motors and then press Calibrate Level in MissionPlanner Accel Calibration section.

You can put in these values from Autotune
ATC_ACCEL_P_MAX,71147
ATC_ACCEL_R_MAX,74130
ATC_ANG_PIT_P,11.788
ATC_ANG_RLL_P,12.996
ATC_RAT_PIT_P,0.297
ATC_RAT_PIT_I,0.297
ATC_RAT_PIT_D,0.0123
ATC_RAT_RLL_P,0.382
ATC_RAT_RLL_I,0.382
ATC_RAT_RLL_D,0.0166
then set AUTOTUNE_AXES,4 to do just Yaw by itself

Just find INS_LOG_BAT_OPT in the Full Parameter Tree and put in a digit 4

If you dont switch in and out of Autotune mode the yaw Autotune might have worked regardless of the messages. I’ve seen those too and then Autotune worked anyway, so it can be a bit confusing.
Did it actually stop and cease to do any more twitching?
In the log it looks like Autotune only stopped when you switched out of Autotune mode.

Dont try and test the new PIDs without first landing to save the new Autotuned values - people get confused and lose the new values.
Best and easiest to do the test in a new flight.

1 Like

Allister beat me to it, but my formatting is 37% nicer

2 Likes

Cheers mate! I’d go so far as to say at least 40% better.

1 Like

Thank you so much for your inputs both of you! The Autotuning is complete finally! but then I think it is way too much though., it compensates way too much, especially if there is a little wind, and it rocks a lot (only pitch and roll though)! So much so that I am a bit skeptical to take it higher!
So, I was wondering if I should reduce the PIDs by myself or reduce the aggressiveness of the autotune and put it in another autotune flight, should I only put it in autotune pitch and roll?

Yes! I was quite surprised myself! there wasn’t any twitching (at least none too strong).

We would need to see the log of the new test flight to tell anything further.

appologies, here is the bin from a flight today! - Easyupload.io - Upload files for free and transfer big files easily.

I did some forward-backward movement and some 360s, 8s, just the basic in loiter mode.
when it moves it seems better but when it hovers it shakes violently. especially on the roll, a little on the pitch. When the wind picked up a bit, it shook more…
when i switch to stabilise mode, it is very smooth, no rocking movement.

Also, I did a slight “payload” test, since you mentioned how it will react to the payload. it seems more stable with payload! I did not observe significant rocking movement (idk if this information is helpful but I am quite happy cheap 15 dollar Chinese motors could lift this weight)
I attached 3kgs first, then 6, and afterwards reduced it to around 4.
6kg was too much, 4 was manageable but 3 was much better!

BIN - Easyupload.io - Upload files for free and transfer big files easily.

You have
INS_HNTCH_MODE,0
which means the Harmonic Notch filter is disabled.
it needs to be
INS_HNTCH_MODE,1

Unfortunately there’s also still a physical yaw imbalance, like twisted motor mounts or arms.
This is producing frequencies of both 60Hz and 70Hz because of the different RPM that the groups of motors are forced to run at.
The Yaw imbalance definitely contributes to the lack of stability. You can imagine the clockwise and anticlockwise motors using valuable RPM and effort to counteract each other, leaving less RPM overhead for stability. If we reduce the yaw overhead the copter will be more stable in pitch and roll, but more likely to yaw with little control.

If it proves to be impossible to fix the twisted motor mounts then you could run two notches:

INS_HNTCH_FREQ,60
INS_HNTCH_BW,30
INS_HNTCH_HMNCS,3
INS_HNTC2_ENABLE,1
INS_HNTC2_BW,35
INS_HNTC2_FM_RAT,0.7
INS_HNTC2_FREQ,70
INS_HNTC2_HMNCS,3
INS_HNTC2_REF,0.142
INS_HNTC2_MODE,1
INS_HNTC2_REF,0

After that (either fixing the yaw imbalance, or implementing the 2nd notch) I would run Autotune on Pitch and Roll axis.
Although the second notch might help with tuning, it’s highly advisable to fix the physical yaw problem first rather than mask it with some parameter changes. No amount of filters will compensate for the RPM overhead used to control yaw, taking away from general stability.

1 Like

Woah! That’s quite shocking!
I am surprised how the hnotch is 0! I did not do any modifications to it! I keep switching from using the latest mission planner on the laptop to the mission planner/q ground control Application in android (while flying) …will that in any way mess with the parameters?

Sure, I will try to balance the motors and remove and check the arms for any bends if any!
I am cautious of motor imbalances which is why I change copter arms even if there is slightly noticeable distress to it! (esp. every time I crash)
After your reply, I do notice that one of the props is, albeit very less, chipped in the side…can that be the reason?
Either way, I will look into it and update! Thanks a ton!

You can easily see which arms or motor mounts are twisted by pointing all the prop tips to each other.
The tips should all be pointing reasonably to the tip of the neighboring prop. If one tip is up a bit and the neighboring prop tip is down a bit (for example) you will be able to trace it back to one motor/arm. There will be one or more props that are not as horizontal as the rest, and it’s tips will be lower at one end and higher at the other end in relation to its neighboring props.

See in this pic all the props are “pointing” to each other
image

You’ll be able to see if one arm or motor mount is twisted if one of the props are out of line.

The other problem is when the arms or whole frame twists while in flight - no amount of adjustment on the ground will solve that. Time for a real frame.

Small chips and marks on the props wont affect the yaw bias, but will affect the prop balance and vibrations if they are bad enough.

1 Like