Sudden oscillations amidst Auto Mission

Hi ,

I was running a loop endurance mission yesterday and the flight was going well but suddenly amidst the flight, the copter started to oscillate violently and I had to switch to AltHold which did not do any good so then switched to stabilize which made it stable. I safely landed the drone and inspected everything thoroughly but couldn’t find anything obvious. Now I am going to attempt another flight tomorrow to see if this is repeatable.

I read the log also which clearly shows oscillations but couldn’t find the reason behind it
Help me figure this out

LOG: https://drive.google.com/file/d/1vOd4TJGsTrjD4_dtgpjrAXmSk33rUlRo/view?usp=sharing

Configuration: 41-inch Quadcopter, 36Kg AUW without payload

Thanks,
MindProbe

First up I’d like to say the attitude control is excellent for such a large sized copter.

I could not see a specific reason for that sudden instability - could it have been a wind gust?
You have very low values for ATC_ACCEL_x_MAX which would make recovery difficult.
Also MOT_THST_EXPO can play a role here, mentioned below.
I might have missed the real reason too and hopefully others will check.

I think you should retest and lower MOT_SPIN_ARM and MOT_SPIN_MIN since the motors were hitting minimum during that instability. The motors are not going near minimum during normal flight, but those values look high - although your testing would be the proof of the correct values since not many people get to work with 40" props.
Also there’s a little bit of instability during descent so it’s possible your MOT_THST_EXPO is too high and could be lowered to about 0.85 - Your ascent and descent testing would confirm this.
If you change MOT_THST_EXPO then retest MOT_SPIN_ARM and MOT_SPIN_MIN then allow hover thrust to relearn.

You should definitely set the correct failsafe voltages and actions. Also with a copter this size (or anything bigger than say 9inch props) you should enable and configure the Fence.

It looks like FFT is targeting the first harmonic instead of the base frequency, actually it’s even a bit higher than the first harmonic, so not I’m sure what the in-flight FFT is doing.
Although manually setting the correct base frequency (probably about 30Hz) could take it down into the control frequencies you dont want to filter out those low frequencies.
I would probably change over to throttle-based notch filtering and set
FFT_ENABLE,0
INS_HNTCH_MODE,1
INS_HNTCH_FREQ,65
INS_HNTCH_BW,30
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_REF,0.125
INS_HNTCH_OPTS,4
INS_LOG_BAT_OPT,4
and see what sort of FFT graphs that produces.

Thanks for the reply

Yes, we spent a lot of time on vibration isolation, and am very proud of that :grinning:

Being a cargo drone, we have set this so that the payload doesn’t move inside

Even after ESC calibration, the motor starts spinning at 15% throttle

I think this would be a good reason to invest in Thrust stand

We hadn’t set any of these because we are still working on tuning, and it was not ready for auto modes as of then but yes now it ready so we’ll implement safety failsafes before next flight

And for FFT, since we have isolated the FC so well i feel like HNTCH wont be even needed anymore, but we have been looking for bdshot in this scale which is proving very hard to find.
If you know of any such product then please do share (200A 24s ESC with bdshot)

Interesting! Are you at liberty to go into a little detail?

If you dont want to spend time making your own, this might be a good one: https://www.foxtechfpv.com/ly-30kgf-propulsion-system-test-platform.html

The thrust limit is too low for the stand you are recommending
Iam thinking of this one Flight Stand 150: UAV and eVTOL Thrust Stand - Tyto Robotics

1 Like

I may be able to answer some questions here and if not i’ll DM

are you saying ATC_ACCEL_x_MAX doesnt need to change if payload doesnt move? I dont think thats true (I could be wrong @xfacta )

I dont understand what you mean

we have lowered the accel max significantly so that the copter accelerates (angular) slowly and doesn’t affect the cargo inside.

This is one of the reasons for ATC_ACCEL_x_MAX to exist - to limit rapid attitude adjustments so a payload is not damaged (think camera gimbal, or sloshing liquid), or so a copter doesnt damage itself trying to fight the extra inertia of a payload.
There’s also ATC_RATE_x_MAX and ATC_RAT_x_SMAX which hardly anyone ever uses.

You have ATC_ACCEL_P/R_MAX,8500 which is right on 60% of the normally calculated value for those sized props, 14500. I would caution against going this low compared to the normal value, or the autotuned value. We’ve seen where even small copters with good Trust:Weight can start to lose attitude control when this is lowered too much even when using the calculation for adding a payload:

new ATC_ACCEL_P_MAX = ATC_ACCEL_P_MAX x (min_TOW / max_TOW)
new ATC_ACCEL_R_MAX = ATC_ACCEL_R_MAX x (min_TOW / max_TOW)
new ATC_ACCEL_Y_MAX = ATC_ACCEL_Y_MAX x (min_TOW / max_TOW)

I would try around 10000 and see how that performs.

Background:
Prop size is what we initially base ATC_ACCEL_MAX on because otherwise we would have to know a lot more about a copter. Prop size gives us a very good starting point as it’s loosely related to takeoff weight and thrust to weight ratio and frame size. Autotune comes up with a value that suits the power/drive system.

With the Angle P values 6 and 4.5 - were that derived from manual tuning, or Autotuned values then lowered a bit?
I’d be tempted to increase those a bit to handle disturbances better - if wind really was a cause of your oscillations.

There’s a bit of the oscillation reflected in the position controller, but I cant tell which was first. The position controller doesnt seem to have bad oscillations or high desired accels or velocities. So it’s variations are likely just a symptom.
Never the less I’d probably lower these

PSC_POSXY_P,0.5
PSC_VELXY_D,0.25

and you already have a couple of the other lower-than-default PSC values I would suggest.

Carefully consider my recommendation to change to throttle-based notch filtering. I believe the in-flight FFT is not targeting the correct frequency.

FFT_ENABLE,0
INS_HNTCH_MODE,1
INS_HNTCH_FREQ,65
INS_HNTCH_BW,30
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_REF,0.125
INS_HNTCH_OPTS,4
INS_LOG_BAT_OPT,4

I’d be glad if someone could come up with a better explanation than just “wind” - but those accells are quite low.

Oh I see now. Generally, as @xfacta showed, these are recommended to scale with weight to keep up with increased moment of inertia. If you dont scale them, you will see slower attitude response, or even lose control. Payload shifting might be fine if the distances are relatively small, e.g. dont move the overall CG much. How much can the payload shift?

I think your problem is MOT_THST_EXPO 0.91. I have not seen anything over 0.8, especially when you use high min throttle (and that is a good idea if you are heavily loaded).

Yes, I agree. I have seen people do a static thrust test using the whole aircraft and some scales but the thrust stand makes things a lot easier.

Well done! Many people would not have had the piece of mind to go through this process. Notice the aircraft became stable as soon as the throttle increased:

Well I actually do not know
Being the nature of the application, it could be loaded up with anything that fits weight and volume limitations
That’s the reason for keeping accels so low

I actually did not think of that, just went with the defaults calculated by “initial parameter calculation”
I’ll lower it to 0.8 and we might get a thrust stand soon enough so I’ll get the accurate value

So I’ve calibrated the ESC endpoints from 1000-2000 multiple times but for some reason, the motor always starts spinning at 15% throttle. The other ESCs that I’ve worked with before usually start between 5-7% but this one doesn’t. That’s why the Spin arm is set at 0.15 and spin min is set at 0.2 which is not at all high in this particular case.

Will definitely change to throttle-based notch filtering once i have an accurate value for MOT_THST_EXPO

Yes, they were derived from auto-tune and rounded of to a lower figure

And on this topic, why is it that the isolated IMUs have higher vibration that the rigid one? The same thing is true for another cube orange based hexacopter I was working on

Can you explain this a bit more in detail, I usually don’t inspect PSC logs so very little idea on how to make a conclusion out of those

Any specific reason why it suddenly plummeted to zero?

You can set the harmonic notch filter settings I suggested right away. Something may just need slight adjustment later.

The behaviour the Leonard pointed out in your log

Matches closely with our general rule for setting MOT_THST_EXPO

  • set too high you can see instability at low throttle
  • set too low you can see instability at high throttle

So 0.80 would be a good start as per Leonards recommendation. And I would say this would be completely safe, and likely not need any further adjustment.
You will have to use motor test again to check and set MOT_SPIN_ARM and MOT_SPIN_MIN then spend some time in AltHold to get a good MOT_THST_HOVER value.

I’ll check the Initial Parameters section in MissionPlanner because it should not produce such a high expo even for 40inch props. My spreadsheet only goes as high as 0.88 for 50inch, which may still be too high.
If someone can afford to buy 50inch props they should be doing all in their power to get them on a thrust stand and do their own tests before flying - either that or they might be a bit crazy.

What ESCs do you have?
If it’s the T-Motor Alpha for example, you will need to set
MOT_PWM_MIN,1100
MOT_PWM_MAX,1940
and then do the checks for MOT_SPIN_ARM and MOT_SPIN_MIN

All those MOT_PWM and MOT_SPIN parameters are closely related and you cant make major changes to one without checking the others.

So in summary, you can immediately set the recommended expo and harmonic notch values.
Verify your ESC brand and model and it’s expected PWM range - some have a fixed range that cannot be calibrated.
Then motor test to check and set MOT_SPIN_ARM and MOT_SPIN_MIN