ArduPilot's use of Cascading PID loops - and the absence of tools to manually tune outer loops

Without the benefit of an education in process control, I was unable to put ArduPilot’s approach to PID tuning into context to understand it.

Learning PX4 recently, I finally got a toehold into this area by comparing and contrasting the approach taken by these two.

I broadened my survey by asking AI to do a comparison of the approaches taken by ArduPilot, PX4, BetaFlight and iNAV.

The key thing I learned was that ArduPilot uses a “cascading” PID loop. Manual tuning requires addressing all the loop layers. Here’s an AI generated comparison for four autopilot firmware:

Here’s more detail that mentions tuning:

ArduPilot documentation encourages use of Auto Tune, and has little to support manual tuning other than the excellent PID Review Tool website. But what I didn’t realize until digging into this was the the ArduPilot PID Review Tool website only addresses the “inner loop”. By comparison, the PID Analysis offered by PX4’s Flight Review website includes step response charts for two of the most inner loops. Here’s a comparison:

For those unfamiliar, here’s an example of a PX4 PID Analysis on it’s Flight Review website. Note that there are charts for Roll Rate and Pitch Rate (inner PID loop) and Roll Angle and Pitch Angle (outer PID loop). https://review.px4.io/plot_app?plots=pid_analysis&log=722866d0-ab32-4056-82eb-7dad4aac3d44

Here’s an analogy that I hope clarifies the point I’m trying to make. In the days of carburetors, points and distributors, anyone could tune a car by following directions on tools such as a timing light, a dwell meter, and a colortune. You didn’t need to know how any of the coil, condenser, distributer or carburetor worked - you simply followed the directions on using the tools.

In my opinion, ArduPilot requires significant understanding of how it works to effectively tune what it does. While tools such as the PID Review Tool and Filter Review tool websites offer help in this area, it’s far from a complete set of tools.

ArduPilot’s Auto Tune is a wonderful tool - but it simply isn’t appropriate for all applications and it does little to help someone learn what’s going on under the hood.

1 Like

AUTOTUNE is pretty damn good in my experience.

If you want to do analytical tune you should use SysID mode to collect data for analytical tune tool. It has graphs to tune all the loops of attitude controller. For most applications navigation loops shouldn’t need tuning.

Yes Sir - AutoTune works well. Just sometimes it can’t be used.

And a manual tuning exercise helps with understanding what’s happening.

Which “analytical tune tool” are you referring to? None I’m aware of show data on the outer PID loops.

Also - I’ve always wondered what the “ACCEL” and “ANG” parameters fit into the puzzle. For those needing to manual tune, it would be nice to have guidance on them.