Brain dump of my Microquad (5", 7") tuning experience for acro

After some hiatus just enjoying my 7" ardupilot and other betaflight builds, I decided to try building a 5" ardupilot freestyle/long-range quad. Since I took some notes and I had a ton of experience from my 7", getting my 5" up and running didn’t take too long.

But I realized that for someone new to this, it’s actually fairly difficult to come up with a decent acrobatic tune. So I thought I’d brain-dump my experience for anyone building a similar 6S setup.

Some of this may be contradictory to conventional wisdom, but whatever I figured out through some throught, trial, and error has worked very well for me. This is not intended to replace/supe-cede advice from the devs/experts. If your setup is significantly different, YMMV. Always apply first principles.

  1. setting motor_thrust_expo to a low value (like 0.1, 0.2) with a high motor_min is better than a lower motor_min with a higher thrust_expo. On my 5" 6S 1750kv build I run motor_min of 0.08 and expo of 0.1.

1b. The reason I ended up here is I found lower motor_min and higher expo (like 0.4~0.6) caused very hot motors at low throttle. Could never get rid of it.

#2. if I fly acro with air mode, dropping to zero throttle causes motors to spin down eventually, even though mix_man is set to 4. This causes quad to lose authority during hang-time. I worked around this by adding a small offset to my Radio’s throttle output when ACRO switch is down, so throttle never hits absolute zero. Make sure you account for throttle channel deadzone (mine is set to zero).

#3. Auto-tune gets me to a place where the quad won’t go out of control, but in terms of acrobatic flight performance it only got me like 60% of the way to a good tune. Apply PID tuning principles from UAVTech to tune the PID (like taking care of PD balance, and finding limits of D).

3b. I can increase gyro_filter to 100hz (even pushed 140hz on my 7").

3c. Be very aware that the ATC parameters like ATC_P and rate slows down responses before the PID loop. Conventional wisdom is that if the quad to drop ATC_P/rate if quad is not behaving well, but that’s just masking a bad underlying PID tune and filtering. So work on fixing your underlying PID tune and filter, then pushing your ATC_P upwards. My ‘aha’ moment was when I could push my ATC_P from 18 to 30 to fix some lagginess and unexpected drift when throttling out of a dive. This then revealed some bounceback, which meant I could further improve my PID tuning.

3d. my latest PIDs for my 1300mAh 6S 1750kV 5" Diatone Roma running HQ 5x4.3x3 v1S is around P/I/D = 0.7/1/0.02 for ROLL, Pitch. And 0.4/0.5/0 for yaw. It is not perfect, but it serves as a reference for you.

3e. I found the PID tuning is not forgiving if you drop the quad’s weight by a decent amount (ie. drop in a smaller battery and shed 150gram)

  1. aim to set up notch filters.

  2. After getting a good acro tune, I found the loiter PSC’s controller default tuning causes wobbling in loiter. The quad’s just too responsive. You can tune the PSC controller down to fix that.

1 Like

And for those interested, this is my PSC tuning from my 7". While I spent many many hours trying to think through what the parameters did (honestly I still don’t quite get all of it), I only spent a 2 hours actually tuning this.

It can probably be better and I’m very interested to feedback and thoughts on how to tune this.

PSC_from_Chimera7H743.param (462 Bytes)

This is very strange. All I can think of is that maybe your harmonic notch configuration is not letting the filter go low enough and so you have extra noise at low throttle. There was a bug in airmode also that would affect spin min - https://github.com/ArduPilot/ardupilot/pull/20929

This is a bug, fixed by https://github.com/ArduPilot/ardupilot/pull/20929

This has mostly been fixed in autotune - Allow high ANGLE_P gains in autotune by andyp1per · Pull Request #20649 · ArduPilot/ardupilot · GitHub

Thanks Andy, I come back to 4.2.1 and there’s so much that’s improved =D

And yes, I was wondering if I had imagined/dreamed ATC was limited to 18; so it was updating to 4.2 that got me over the hump :slight_smile:

You presumably saw my tuning videos for these size frames:

Thanks, I’ve just jumped back in to build a 2nd frame (and eventually 3rd frame) and update to 4.2. I haven’t seen those. I’ll take a look.

There is a whole series …

https://discuss.ardupilot.org/t/arducopter-7-long-range-standard-build/77368/95

https://discuss.ardupilot.org/t/arducopter-5-long-range-standard-build/81546/71

I’m going to highlight this timestamp where you talk about tuning Yaw. I’ve just built a 3rd quad and I felt like I couldn’t get a handle on Yaw (with Yaw-D set to zero).

Really going to take your advice and try tuning yaw =D

Makes a massive difference and once you have tuned yaw you can retune pitch and roll and find they go much tighter

I seem to be hitting a wall in how ‘locked in’ I can make my latest ultra-light 5" quad feel. Hard to describe. It feels like it’s randomly ‘loose’ when I’m giving it a mix of yaw/roll/pitch to do a hard turn-around and I goose the throttle up a bit. The nose doesn’t track fast enough.

If I singular roll/pitch it’s very much locked in. And descending through my propwash actually is so-so, only small wiggling. My RP auto-tune actually comes out to fairly good values (like 35 angle_p, 600,000 accel MA).

I do question the quality of my yaw tune and I wonder if I’m being forced to push yaw P/I (like up to 0.4/0.04) because the FLTE is too low (it’s around 2-3). Is it safe/better to significantly bump the FLTE for yaw and drop the PI?

I was wondering if it’s to do with lag with the attitude (angle) tracking rather than the rate loop, and what I can try tweaking. Or should I add a little bit of feedforward?

FLTE is based on what Leonard calls Yaw’s “physical D”, so generally the value found by autotune is good enough. Have you tuned yaw D? Once autotune has tuned yaw, yaw D is the key thing you need to change.

my 5" Rekon has the best tune of any of my quads - so its certainly possible. Also what flight controller and parameters?

I’ve tried a few values for , like 0.2/0.02/0.005 up to 0.45/0.05/0.01. Yaw feels better with the higher PIDs.

I’m using a Goku F745 Versatile pro. I built an AOS LR5 with 2004 motors, 5x2.5x3 props and a 6S 3000mAh Lion.

I’m attaching my params from one of my dumps… ignore the PID tune since it may not have been one of the better combinations I’ve flown.

2022-07-11_AOSLR5_4b_yawManual03_AutoTuneAgain_motExpo055_SpinMin010__yaw_feels_loose.param (18.5 KB)

Not sure I follow - did you follow the yaw D tuning procedure in my video?

Quick summary -

  • autotune twice all axes
  • increase yaw D in 10x increments from 0.0001 until oscillation occurs
  • back off yaw D 25% from max non-oscillating point
  • change yaw ACCEL_MAX to 0 and observe maximum overall acceleration in yaw
  • set yaw ACCEL_MAX to that value
  • autotune twice roll and pitch only

How do we figure the ACCEL_MAX from the data log? I couldn’t find the log param (and am I supposed to calculate the slope of att.yaw)?

And should dropping accel_max to 0 allow for uncapped acceleration? My yaw rate remains pretty slow with it set to 0.

I should add that 10x increment steps is too aggressive if we’re in the 0.01 range; I didn’t follow instructions exactly :slight_smile: like 0.01 → 0.05 already causes the quad to just begin to enter a yaw-oscillation-fly-away, so I ended up somewhere around 0.02 for yaw-D.

  • Yaw to maximum with ACCEL_MAX set to 0. Measure the yaw delta (should be PILOT_Y_RATE or ACRO_Y_RATE) and divide by the time to get the accel. Set ACCEL_MAX to this
  • Yes
  • You need to do this just off the ground with ESTOP at the ready. Obviously if bisecting the value is quicker then do that