Skip to content
Plasmatree edited this page May 29, 2018 · 7 revisions

Welcome to the PID-Analyzer wiki!

What is this?

The PID-Analyzer tool uses blackbox data analysis to determine the average step response of your Multirotor. In other words: How the input "What your drone is commanded to do" is related to the output: "What your drone really does".

In Betaflight (and most other firmware) these are related by a loop consisting of the PID controller who’s parameters are set in firmware, the physical system (motors, props, battery, geometry, distribution of mass...) and the gyro+filters. Changes at any of these points affect the drone’s behaviour and thus the system response.

Why is this useful?

Common tuning technique requires the pilot to produce precise input and exact observation of the reaction in real time. To make the smallest artefacts of reaction observable very high changes of input are required. This is why you do flips and rolls to provoke over swings during the tuning process. Good pilots can easily produce the required quality input and are experienced enough to recognize smallest changes in reaction. Mapping these to the current settings and knowing what to change is often still a challenge, requiring educated guesses. Furthermore, discussion of tuning results is often left to description “feel” which is something solely the flying pilot can experience. By visualizing the characteristic system response this tool offers:

  • Tuning independent of skills
  • It doesn’t matter which mode (acro, angle…) you use the result will be the same
  • No FPV feed required (yay LOS!)
  • 20s of logged flight are usually enough to test a setting
  • Tunes of different setups and from different pilots can be compared

Set up your quad

Best practice for the initial settings is:

  • set the filters as required by your setup (there is lots of content on this topic on the internet, try Joshua Bardwell’s youtube channel to start)
  • D-setpoint weight = 0
  • TPA = 0
  • V-Bat compensation ON
  • Antigravity OFF

These settings will prohibit any dynamic modification of the PID parameters related to the style of your input while compensating for the indirect change caused by dropping battery voltage. Nevertheless, I encourage you to change theses at a later point to explore their influence!

How to use this program:

  1. Record your log. Logs of 20s seem to give sufficient statistics. If it's slightly windy, longer logs can still give reasonable results. You can record multiple logs in one session: Each entry will yield a seperate plot.
  2. Place your logfiles, blackbox_decode.exe (Windows download) and PID-Analyzer.exe (Windows download) in the same folder. You can also specify where to find these executables via command-line flags.
  3. Run PID-Analyzer.exe (this takes some seconds, it sets up a complete virtual python environment). Either interactively enter your .BBL files (drop one or more logs into cmd), or pass your .BBL file(s) via flags, like PID-Analyzer --log one.BBL --log two.BBL directly when run in cli mode.
  4. The logs are separated into temp files, read, analyzed and temp files deleted again.
  5. A plot window opens and a .png image is saved automatically in the folder correspoding to you entered name (default is \tmp).

The windows executable includes a virtual python environment and only requires you to drag and drop your Betaflight blackbox logfile into the cmd window.