Skip to content
Plasmatree edited this page Mar 11, 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 volatge. 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 separate plot.
  2. Place your logfiles, blackbox_decode.exe and PID-Analyzer.exe in the same folder. (<-- Download links)
  3. Run PID-Analyzer.exe (this takes some seconds, it sets up a complete virtual python environment)
  4. Drag and drop your file into the command window and press enter
  5. Type in an optional name that will be appended to the log name. Or don't. Press Enter.
  6. The logs are separated into temp files, read, analyzed and temp files deleted again.
  7. A plot window opens and a .png image is saved automatically

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

Clone this wiki locally