Skip to main content

A simple, easy to use PID controller

Project description

simple-pid

Tests PyPI Read the Docs License Downloads Code style: black

A simple and easy to use PID controller in Python. If you want a PID controller without external dependencies that just works, this is for you! The PID was designed to be robust with help from Brett Beauregards guide.

Usage is very simple:

from simple_pid import PID
pid = PID(1, 0.1, 0.05, setpoint=1)

# Assume we have a system we want to control in controlled_system
v = controlled_system.update(0)

while True:
    # Compute new output from the PID according to the systems current value
    control = pid(v)
    
    # Feed the PID output to the system and get its current value
    v = controlled_system.update(control)

Installation

To install, run:

python -m pip install simple-pid

Documentation

Documentation, including a user guide and complete API reference, can be found here.

Tests

This project has a test suite using pytest. To run the tests, install pytest and run:

pytest -v

License

Licensed under the MIT License.

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

simple-pid-2.0.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

simple_pid-2.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file simple-pid-2.0.0.tar.gz.

File metadata

  • Download URL: simple-pid-2.0.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for simple-pid-2.0.0.tar.gz
Algorithm Hash digest
SHA256 b7649cb8912435ef4f2f4f997b10f2b85757bc9ee79d94c4fab33f9d3b84dd5b
MD5 b1a0b9af23b1606b65603427faae58ce
BLAKE2b-256 67c51e7b5921a0dbaa74f7d94f69bdc8d66dc55bef8133c3006652caf41d75dc

See more details on using hashes here.

File details

Details for the file simple_pid-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: simple_pid-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for simple_pid-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0745411c3b67c78f02850b539753802701fe2b9d9461e137b5045950bb153e49
MD5 84b4d6dddca787f104f8a678adfe9982
BLAKE2b-256 b18745331a34331fecca337b03c7c205cd12ac8a7a6031be15ff30aa478779f2

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