https://github.com/adrianguel/openpid

Modern C++ PID controller library with Python visualization support using pybind11 and Plotly.

https://github.com/adrianguel/openpid

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.1%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Modern C++ PID controller library with Python visualization support using pybind11 and Plotly.

Basic Info
  • Host: GitHub
  • Owner: AdrianGuel
  • License: mit
  • Language: Makefile
  • Default Branch: main
  • Homepage:
  • Size: 3.45 MB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

image

📄 OpenPID_README.md ```markdown

OpenPID

Important: under construction!!

OpenPID is a lightweight and modern PID controller library written in C++ with simulation tools for mass-spring-damper systems. It supports both real-time C++ applications and Python visualization via pybind11.


🚀 Features

  • Header-only, templated PID<T> controller
  • Mass-Spring-Damper simulation class for testing
  • CMake-based build system
  • Python bindings using pybind11
  • Interactive animations and plots using Plotly
  • Poetry-managed Python environment

🗂️ Project Structure

OpenPID/ ├── include/ # Header files (pid.hpp, msd_system.hpp) ├── src/ # (Optional) C++ implementation files ├── examples/ # C++ examples ├── simulate/ # Python simulation scripts ├── tests/ # Unit tests ├── build/ # CMake build output (ignored) ├── pybind11/ # pybind11 submodule ├── bindings.cpp # C++ ↔ Python interface ├── CMakeLists.txt # CMake configuration ├── README.md # This file └── pyproject.toml # Poetry config


⚙️ Building the C++ Library & Python Bindings

🔧 Prerequisites

  • CMake ≥ 3.14
  • Python ≥ 3.8
  • Poetry (pip install poetry)
  • pybind11 as a submodule:

bash git submodule update --init --recursive

🛠️ Build the C++ & Python Module

bash mkdir -p build && cd build cmake .. make

This will produce openpid*.so, the Python module.


🧪 Python Simulation & Visualization

🔁 Setup Python Environment (using Poetry)

bash poetry install --no-root

▶️ Run the animated simulation

bash poetry run python simulate/simulate.py

This launches an animated Plotly graph of the PID-controlled mass-spring-damper system.


🧩 Example: C++ Usage

```cpp

include "pid.hpp"

PID pid(1.0f, 0.5f, 0.1f); float control = pid.compute(1.0f, 0.8f, 0.01f); ```


📚 License

This project is licensed under the MIT License — see LICENSE for details.


✨ Credits

Created by Adrián Guel. Inspired by the need for intuitive control simulation tools in both research and teaching. ```

Owner

  • Name: A.-J. Guel-Cortez
  • Login: AdrianGuel
  • Kind: user
  • Location: UK
  • Company: Coventry University

I am a Mechatronics Engineer with a Master's in Automation and currently a PhD candidate in complex systems.

GitHub Events

Total
  • Watch event: 2
  • Push event: 16
  • Pull request event: 2
  • Fork event: 2
  • Create event: 3
Last Year
  • Watch event: 2
  • Push event: 16
  • Pull request event: 2
  • Fork event: 2
  • Create event: 3

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 0
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • AdrianGuel (2)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

pyproject.toml pypi
  • matplotlib (>=3.10.1,<4.0.0)
  • plotly (>=6.0.1,<7.0.0)