Skip to main content

FPV PID Tuner CLI tools

Project description

PID Tuner CLI

A command-line toolkit for FPV drone PID analysis, including plotting gyro vs. PID, detecting D-term spikes, and browsing spike data.

🚀 Installation

Install into your (virtual) environment:

# Clone this repo and enter its directory
git clone https://github.com/yourusername/pid_tuner.git
cd pid_tuner

# Activate your venv if not already active
source .venv/bin/activate  # or your shell’s activate script

# Install in editable mode (for development):
pip install -e .

# Or install from PyPI:
pip install pid-tuner

📦 Package Structure

src/pid_tuner/
├── __init__.py       # Package entry point
├── cli.py            # Typer app with subcommands: summary, plot, spikes
├── parser.py         # load_log()
├── plotter.py        # plotting and detect_spikes()
└── stats.py          # (optional) summary logic

📖 Usage Examples

1️⃣ Summary of PID Spikes

Show runtime, total spikes, rate, D-term stats, and average throttle:

pid-tuner summary --axes roll,pitch --window 50 --threshold 2.0

2️⃣ Generate Plots

Save gyro vs PID and zoomed D-term spikes (with optional throttle overlay):

pid-tuner plot --axes roll,pitch --overlay-throttle --out-dir graphs

3️⃣ Browse Spike Details

Detect D-term spikes, save CSVs, then page through spike events:

pid-tuner spikes --axes roll,pitch --min-mag 50 --time-window 1,3 --page 1 --per-page 10

🛠️ API Reference

You can generate an API reference from the built-in docstrings using Sphinx or MkDocs with mkdocstrings. Here's a quick Sphinx setup:

  1. Install docs dependencies:

    pip install sphinx mkdocstrings
    
  2. In your project root, run:

    sphinx-quickstart docs
    
  3. Edit docs/conf.py:

    extensions = ['mkdocstrings']
    templates_path = ['_templates']
    
  4. In docs/index.rst, add:

    .. toctree::
       :maxdepth: 2
       :caption: Contents:
    
       api
    
  5. Create docs/api.rst:

    PID Tuner API
    =============
    
    .. mdinclude:: ../src/pid_tuner/cli.py
       :language: python
    
  6. Build HTML:

    sphinx-build docs docs/_build/html
    

Now open docs/_build/html/index.html for the full API.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pid_tuner-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pid_tuner-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file pid_tuner-0.1.0.tar.gz.

File metadata

  • Download URL: pid_tuner-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pid_tuner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4633dee558e3bf68d3f282da34e083f20db04851d117f7f72676e13c9be84057
MD5 5f2a31e5c003307cbebe52cf87e738c1
BLAKE2b-256 7e742422dfbb514d25a8129b265034933e872f89b5dbc322da0ffd90d74ca437

See more details on using hashes here.

File details

Details for the file pid_tuner-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pid_tuner-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pid_tuner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f142bc308c3a1f103a7c12300d19ae3bab5d84bb09c2060d353233b62a14614
MD5 e4b6079454e678c1541e118cebe062bf
BLAKE2b-256 214f9e38d5094c5244a70d9b6d65a81fc87273f1c1e09e42b3cb2020075a5597

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page