STABILIZE mode failed to level the craft and then RTL caused a fly-away and crash

I made this one in STABILIZE mode just flying around after I’d finished testing different settings.

https://www.dropbox.com/s/johr5ffaket5zfd/14%2001-12-2022%2014-35-02.bin?dl=0

The video I posted previously is using the same settings.

Thanks.

Edit: autotune has “failed to level” with all settings I have attempted so far.

OK, let’s try some changes to see if you can get past the “Failed to Level” in Auto Tune.
ATC_ANG_PIT_P,14
ATC_ANG_RLL_P,14
ATC_ANG_YAW_P,6
INS_ACCEL_FILTER,10

I would have built this for 4S power. At what looks like a hover (Tho ~.45) the average motor output (~1700us) is higher than desirable (low thrust/weight).

In any case make those parameter changes only and let’s see if you can get thru a pitch or roll Auto Tune. Just try one axis.

I tried the settings as suggested and no luck with the autotune (just tuning roll). It seemed to wobble more with the settings suggested:

I tried disabling the notch filter and felt things got better although the autotune still gave “failed to level” messages. Here is the disabled notch filter attempt; sadly the battery ran out and it was too windy anyway to be honest.

I also tried halving the settings that you suggested, as well as using the suggested settings with INS_ACCEL_FILTER set to 5 and also 20. In all cases, it was still wobbly and would not autotune.

I’d be willing to retry the no-notch filter test with the suggested settings. What do you think? I would have thought having the notch filter would help.

Yes do that. Set INS_LOG_BAT_MASK to 1 and INS_LOG_OPT to 4 and make an AltHold Hover flight.

Also I think MOT_SPIN_MIN should be reduced as under demand your motors are bouncing off of minimum. Use Motor test to determine MOT_SPIN_ARM and set MIN a bit higher.

Here we see 2 motors at minimum and 2 with an average of ~1700us. Sure you don’t want to try a 4S battery :slight_smile:

1 Like

Will INS_LOG_BAT_OPT show anything given I have the notch filter disabled?

A problem I see that has caused me to raise MOT_SPIN_ARM is that one motor is “shy” when it comes to starting to spin so I have increased it.

I believe the motor difference is due to me not placing the battery symmetrically on the drone in the first log. Oops.

4S is certainly an option for me but I would have to go to Li-Ion for space concerns as the drone is a bit cramped.

Set to 4 shows log data pre and post filter. W/o the Notch filter enabled it will only have the results of the standard low pass filter for post, its always present. That would be interesting to see.

That doesn’t sound good. When I see that problem I have replaced the motor. I guess lower it as far as you can with them running evenly in Motor Test.

Yea, I can appreciate that. There are some 4S LiPo form factors that are fat and short that might work.

1 Like

BTW, I think 3S should be sufficient because this drone can really move when it wants to. Certainly can go at 65mph at least.

I adjusted MOT_SPIN_ARM/MOT_SPIN_MIN and was able to reduce them to 9% and 12% respectively. I now have:

INS_LOG_BAT_MASK = 1
INS_LOG_BAT_OPT = 4
INS_ACCEL_FILTER = 10
ATC_ANG_PIT_P = 14
ATC_ANG_RLL_P = 14
ATC_ANG_YAW_P = 6

Here is the log file of the run:

It did not autotune and wobbled a fair bit. Here is a short video in ALTHOLD. I tried to keep the camera still:

I tried halving the last 3 parameters I mentioned above but no improvement. (Log available if you need it).

Thanks again.

I don’t agree, it’s underpowered/overweight. It’s clear from the average motor output at hover which is close to 1800us. This should be 1500us or below for proper stability control under all circumstances.

Set these for the Notch Filter:
INS_HNTCH_ATT,40
INS_HNTCH_BW,90
INS_HNTCH_FM_RAT,1
INS_HNTCH_FREQ,180
INS_HNTCH_HMNCS,3
INS_HNTCH_MODE,1
INS_HNTCH_OPTS,0
INS_HNTCH_REF,0.400

You can see the pitch and roll oscillation in the log. Try lowering the Rate P&I for both to .04 and see if it’s reduced. Here is an example:

2 Likes

Okay, I set the params as suggested. Still wobbles and fails to level during autotune (ALTHOLD). These are the params I changed to 0.04 by the way:

Here is a screenshot of Roll/DesRoll:

Here is the log: https://www.dropbox.com/s/gitaszg3ex821xl/0.04.bin?dl=0
Video clip: https://www.dropbox.com/s/slmn313bf61x1lf/154242.mkv?dl=0

Due to the failed autotune I decided to also try 0.08 for P&I and here is a screenshot of that run:

Along with the log: https://www.dropbox.com/s/82v17n2y6h6pnso/0.08.bin?dl=0
Video clip: https://www.dropbox.com/s/jq06i5y6dked8h4/155258.mkv?dl=0

0.08 wasn’t much better it seems.

Do you think we are getting any closer to being able to autotune? I see there is still the oscillation in both graphs.

Thanks.

No, not really. .04 clearly isn’t suitable You have chased these parameters all over the place and it still is not stable enough for an Autotune. I would suggest addressing the thrust/weight issue, rest all to default and start over. Or go to the Manual Tune Wiki page and work your way thru it using in-flight tuning. It’s time consuming but it’s how I usually do it.

1 Like

I have read the manual tune pages before but it always talks about “oscillations” and “over corrections to inputs”.

My problem does not fit this description IMO because what I have is random perturbations, not lack of stability in the traditional control sense. I’ve watched tuning videos including Randy’s one on the wiki and the drone does not have these random disturbances.

Given all your help, IMO, the issue is possibly related to aliasing of high frequency vibrations that affects the FC.

I have a 20g steel plate that is bent to shape to fit over the FC so I will glue that in place and see what results I get. Not ideal given the drone only weighs about 450g but such is life. It’s only a 5% increase and should dampen vibrations.

Cheers for now.

I’ve added a steel cage to the FC which triples its mass from 11g to 33g. This should significantly reduce vibrations.

The pre-notch filter FFT now becomes:

If I use the “advanced” filter (the one with sqrt in) to calculate the INS_HNTCH_REF I get 0.399 and this post-filter graph:

If I use the basic setting to the MOT_THST_HOVER I get this slightly better post-filter graph:

Note that these 2 post-filter tests were done in gusty wind conditions. I have not attempted auto-tune as it’s too windy, but the drone does seem to twitch less.

Some bonus graphs. Roll/des roll:

Vibe:

The drone does overcorrect a bit but I like this problem as it now behaves in a more classically unstable way rather than having random perturbations.

Have you got a recent log for us to check?

1 Like

Yes, sorry, wasn’t sure whether to post it. Here is when the notch filter was disabled and I was recording the pre-filter FFT.

https://www.dropbox.com/s/wvjr8k9gha8hv11/FFT%20LOG.bin?dl=0

Here is the run with the REF parameter set to the hover power (i.e. the most stable setup I have) and getting the post-filter FFT:

https://www.dropbox.com/s/vlmi07klvbjo87g/INS_HNTCH_REF%20%3D%200.447.bin?dl=0

Until you improve the thrust/weight condition I think you will be challenged finding a good tune for this craft. At present there is both Pitch and Roll Oscillation:


1 Like

That weighted flight controller mount certainly knocked out the vibrations.

For filter-related stuff use these:
INS_ACCEL_FILTER,10
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_REF,0.28
INS_LOG_BAT_OPT,4 ← record pre and post filter, no need for separate flights

INS_HNTCH_REF,0.4657708 should be 0.28 or the HNOTCH will only work above hover throttle
The formula is
INS_HNTCH_REF = hover_thrust * (min_freq / hover_freq)^2
= 0.45 * (147/186)^2

I would try these PIDs and see how that goes with the improved filtering
ATC_ANG_RLL_P,6.0
ATC_ANG_PIT_P,6.0
ATC_RAT_RLL_P,0.10
ATC_RAT_RLL_I,0.10
ATC_RAT_RLL_D,0.005
ATC_RAT_PIT_P,0.10
ATC_RAT_PIT_I,0.10
ATC_RAT_PIT_D,0.005
As always be cautious, land immediately if stability is worse.

1 Like

Current total weight is 480g. I can go to 4S with 33% increased battery energy for a 30g penalty.

Would I need more powerful motors if I went down this road?

Edit: got the weight wrong. It’s 665g.

What motors and props do you have now? It’s a long thread not sure you mentioned it somewhere.

But by all means give Shawn’s suggestions a try. Looking back you have tried a wide range of parameter adjustments to little positive effect so more eyes on it can’t hurt.

1 Like

2204-2300KV motors with 2-bladed 5045 props.

480g is take-off-weight with the 3S battery? Because at that weight there should be sufficient thrust. Can you add current logging?

1 Like