{"id":14962000,"url":"https://github.com/f33rni/petalpid","last_synced_at":"2026-01-05T01:04:50.254Z","repository":{"id":254194692,"uuid":"845779266","full_name":"F33RNI/PetalPID","owner":"F33RNI","description":"Lightweight universal PID controller library with Ziegler–Nichols auto tuning and variable cycle time","archived":false,"fork":false,"pushed_at":"2024-09-10T09:37:28.000Z","size":75,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T10:54:57.783Z","etag":null,"topics":["arduino","arduino-library","arm","autotune","avr","blackpill","library","nichols","pid","pid-control","pid-controller","signal-processing","stm32duino","stm32f103","tuning","universal","ziegler"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/F33RNI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-21T23:05:27.000Z","updated_at":"2024-10-31T23:10:58.000Z","dependencies_parsed_at":"2024-08-22T00:54:15.097Z","dependency_job_id":"b5b1f25a-61c1-45ad-abe8-f03b9a7faf2a","html_url":"https://github.com/F33RNI/PetalPID","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"d0d7264bc759ae9d42a338af11754a124fbec4a2"},"previous_names":["f33rni/petalpid"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/F33RNI/PetalPID","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/F33RNI%2FPetalPID","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/F33RNI%2FPetalPID/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/F33RNI%2FPetalPID/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/F33RNI%2FPetalPID/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/F33RNI","download_url":"https://codeload.github.com/F33RNI/PetalPID/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/F33RNI%2FPetalPID/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280878370,"owners_count":26406641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","arduino-library","arm","autotune","avr","blackpill","library","nichols","pid","pid-control","pid-controller","signal-processing","stm32duino","stm32f103","tuning","universal","ziegler"],"created_at":"2024-09-24T13:28:40.562Z","updated_at":"2025-10-24T22:30:57.418Z","avatar_url":"https://github.com/F33RNI.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌸 PetalPID\n\n## Lightweight universal PID controller library with Ziegler–Nichols auto tuning and variable cycle time\n\n----------\n\n## Perfect PID for your project\n\n**PetalPID** is a floating-point based PID library that can be used on Arduino as well as on any other platform. Even in regular C++ code (it is possible to convert it to pure C). Unlike other libraries, **PetalPID** uses variable cycle time and the same function for the main and tuning loop, making it very easy to implement.\n\n\u003e 🚧 This's not the release version of PetalPID! Please be careful!\n\n----------\n\n## 🏗️ Getting started\n\n\u003e Example of auto-tuning process (this graph is produced by `examples/TemperatureController`)\n![Auto-tunning PID](assets/Snapshot%20[02:02:11].svg)\n\n1. Download or include this repo as a library\n\n    Example for PlatformIO:\n\n    ```ini\n    lib_deps =\n        https://github.com/F33RNI/PetalPID.git\n    ```\n\n2. Include header file in your project\n\n    ```cpp\n    #include \u003cPetalPID.h\u003e\n    ```\n\n3. Create PetalPID instance\n\n    ```cpp\n    PetalPID pid = PetalPID();\n\n    // Or\n    PetalPID pid = PetalPID(1.f, 2.f, 3.f, 0.f, 255.f);\n    ```\n\n4. Setup limits and gains (if you're not starting with auto-tune)\n\n    ```cpp\n    pid.set_min_max_output(0.f, 255.f);\n    pid.set_min_max_integral(-1000.f, 1000.f);\n    \n    pid.set_gains(1.f, 2.f, 3.f);\n    ```\n\n5. In a main loop...\n\n    ```cpp\n    // Without any delays. Call as frequent as possible\n    float pid_output = pid.calculate(measured_value, setpoint, micros());\n    ```\n\n6. Starting auto-tuning\n\n    ```cpp\n    // TYPE_P, TYPE_PI, TYPE_PD, TYPE_CLASSIC_PID, TYPE_PESSEN_INTEGRAL_RULE, TYPE_SOME_OVERSHOOT, TYPE_NO_OVERSHOOT\n    // 50 on-off cycles\n    pid.start_auto_tune(TYPE_NO_OVERSHOOT, 50);\n    ```\n\n7. Getting results\n\n    ```cpp\n    Serial.print(pid.get_p());\n    Serial.print(\"\\t\");\n    Serial.print(pid.get_i());\n    Serial.print(\"\\t\");\n    Serial.println(pid.get_d());\n    ```\n\n**More info in `📄 Documentation` section and `examples/`**\n\n----------\n\n## 📄 Documentation\n\nYou can build Doxygen documentation using provided `Doxygen` file\n\nJust clone repo and run:\n\n```shell\ndoxygen\n```\n\nThis will generate HTML and LaTeX docs. Open `docs/index.html` file to view it\n\n----------\n\n## 💡 Projects using PetalPID\n\n- [in17clock](https://github.com/F33RNI/in17clock) by Fern Lane\n    \u003e IN17 Nixie tube clock with internal DC-DC converter, random melody alarm and temperature/humidity sensor\n- [ilet-103-motor-controller](https://github.com/F33RNI/ilet-103-motor-controller) be Fern Lane\n    \u003e Digital speed controller for ILET 103 reel-to-reel deck\n\nDoes your project also use **PetalPID**? Add it to this list by creating a pull request or issue!\n\n----------\n\n## ✨ Contribution\n\n1. Clone this repo\n\n  ```shell\n  git clone https://github.com/F33RNI/PetalPID\n  ```\n\n2. Follow the `.clang-format` style while editing the code\n3. Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification\u003e) while creating commits\n4. Create pull request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff33rni%2Fpetalpid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff33rni%2Fpetalpid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff33rni%2Fpetalpid/lists"}