New motors and the graphs look fuzzy

I have a small quad, 15" props, cube orange, tmotor 3508 340kv motors, and an all-up porky weight of 3.5kg. As a few people pointed out, a little underpowered. So I swapped the motors for tmotor 5006 450kv. I was using the same pids and wanted to make sure there weren’t any oscillations as the previous tune was pretty good. I noticed the actual pitch and roll are pretty fuzzy like a really fast oscillation. Not like anything I’ve seen though. Usually, an oscillation diverges from the desired graph. Am I zooming in too much lol?


Log just in case : ) Dropbox - 2023-08-12 12-43-06.bin - Simplify your life

New props without any nicks lol. I think it’s worse.

Change logging to LOG_BITMASK,180222 to remove the fast attitude. Thats is most of the fuzziness you see there.
You could also set INS_ACCEL_FILTER,10 and there’s a few other things I would adjust slightly.

INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4
ATC_RAT_YAW_I,0.08
ATC_RAT_YAW_P,0.80

The re-assess.

Thanks for checking that out! I made those changes without the fast attitude. Looks normal now. I see a little oscillation especially in pitch when deflecting the stick full and releasing. But in the data flash log, it looks to be overshoot.


But I’ve got a new issue that is definitely causing issues. Being this quad is solely used for mapping, it spends 95% of its time in forward flight (usually 8m/s). The average esc rpm based notch filter isn’t really a great solution for noise as motors 2 and 4 are mostly higher than 1 and 3 in forward flight. So I set the notch to the individual motors resulting in a major wobble.
Original settings:
av
Per motor settings:
multi
I also tried INS_HNTCH_FREQ of 50 and 40 with BW of 25 and 20. Same results. Here’s a log, but the flight is pretty short as it was a little crazy to control.

You could set this:
ATC_THR_MIX_MAN,0.5
and I think you have a spring-centred throttle, try this:
PILOT_THR_BHV,7

I would definitely use these (below) for per-motor harmonic notch filter.
I dont see any difference between parameters apart from those couple of HNOTCH changes, and I dont see any reason for the big difference in flight and stability between the two logs - so that is bit of a mystery. Plenty of copters are using this sort of configuration.
I would attempt it again with these params.

INS_HNTCH_BW,20
INS_HNTCH_FM_RAT,1
INS_HNTCH_FREQ,50
INS_HNTCH_HMNCS,3
INS_HNTCH_MODE,3
INS_HNTCH_OPTS,2
INS_HNTCH_REF,1

By the way, the BW doesnt need to be strictly half of FREQ, nor does it need to be exact to decimal places. It should be the minimum required to get the job done though, not greater than necessary.

EDIT:
I would just run Autotune and see what it’s like after that, especially yaw.
You can run the Yaw D autotune if you think it’s required (eg: not enough yaw authority) but set
ATC_RAT_YAW_D,0.001
before you do.

Well, that was interesting. I entered those params, but left INS_HNTCH_OPTS at 0 for the first flight to get a reference. Flew nice. Changed INS_HNTCH_OPTS to 2 and cray cray lol! The video shows both and the log also contains both flights. I can’t see how this would cause the oscillations on all axis. Wonder if it has something to do with the Cube Orange and its motor outputs. Currently, it’s 9, 10, 11 and 12. There were problems with output 9, but that seems to be resolved as I have pass through on all in BLHeli suite.

OK, leave INS_HNTCH_OPTS,0 for now while I think about what to do about that.

@andyp1per Hi Andy - any thoughts on the huge attitude control effect of just changing INS_HNTCH_OPTS,2

INS_HNTCH_BW,20
INS_HNTCH_FM_RAT,1
INS_HNTCH_FREQ,50
INS_HNTCH_HMNCS,3
INS_HNTCH_MODE,3
INS_HNTCH_OPTS,2
INS_HNTCH_REF,1

First part of this log has good attitude control with INS_HNTCH_OPTS,0
Then the second part with INS_HNTCH_OPTS,2 the attitude control (mostly pitch) is poor.
I suspect because Rate PIDs are so high (and even ANG P’s are fairly high) they are more affected by any phase change or lag caused by the per-motor notches.

I think running Autotune with INS_HNTCH_OPTS,0 could give different PIDs then INS_HNTCH_OPTS,2 would work OK.
I’ve not seen this effect before except where FREQ, BW and number of harmonics were wildly wrong.

Slight update:
I think we could use INS_HNTCH_FREQ,55 just as effectively as 50, but no need to change the BW.

I thought the pid’s were a mistake so I auto tuned over and over getting about the same values. The frame is crazy stiff, I even put in carbon web bracing like you’d use on a wing spar along with 25mm arms. Could explain the weight😂

Try Autotune with
AUTOTUNE_AGGR,0.08
and see what that produces, especially now the harmonic notch filter is confirmed working well (even if not per-motor)

I’ll give that a try tomorrow. I forgot to mention that tune is from the previous tmotor 3508 340kv motors that were a little underpowered. The new tmotor 5006 450kv motors spin the same prop, but have more headroom.

Yeah, I’ve seen this - it’s phase lag. You have gone from 1 notch to 4 which quadruples the phase lag if the notches are all the same. The solution is to narrow the notches - f/4 for ESC telemetry is a good starting point.

1 Like

Exellent, thanks Andy!

@X1aero1 so probably try INS_HNTCH_BW,10 with INS_HNTCH_OPTS,2 and see if you get the same detrimental effects (or not) and let us know what happens. I’m suggesting only 10 because the noise is not spread out very much with your build.

Success! I did an autotune with INS_HNTCH_OPTION still at 0. Looked pretty good. All the pid’s came down probably due to the more powerful motors. Set INS_HNTCH_OPTION to 2 with a BW of 10 and no oscillation. Did two more AT’s with the INS_HNTCH_OPTION at 2 as well. After landing and saving the values from the AT I went back up and tossed it around a bit. Feels really good. Last flight was a typical photogrammetry mission (mini) and everything seems to track. The pitch may need to come up a bit. Also noticed the draw from the more powerful motors are exactly the same as the 3508’s. That’s pretty cool. And the FFT shows the noise gone at the 10Hz BW. Thanks for all your help!

Fisrt AT and flight:

Second AT:

Mini mission:

1 Like

Good work, attitude control looks good.
If your payload is not already fitted you may want to reduce ACCEL MAX values by about 10% - or you may want to anyway for a smoother ride.

Payload was already attached. Just a small camera for mapping. Funny you mention reducing the ACCEL_MAX values though! This quad replaces a Foxtech H1. After 6 years of work, it was time to retire it. The cool thing about the H1 was the battery, camera and autopilot were mounted on a suspension. Well, not cool the autopilot was included because it was terrible to tune. Never needed a vibration mount for the camera, but I sure do now. A week of working with the other motors produced a lot of blurry photos. But it just happens that a Cube and a standard carrier board weigh exactly the same as my lens : ) Off to the shop and make some sort of vibration damper. Man, wish I knew a fraction of what you know about these systems! Thanks again!