Skip to main content

moat-lib-pid

% start main % start synopsis

An advanced PID controller in Python. It does not require a fixed feed rate, supports anti-windup, and contains an optional first-order filter for the derivative term.

% end synopsis

This module was vendorized from the advanced-pid module by Erkan Adali erkanadali91@gmail.com.

MoaT improvements include

  • a CPID subclass with a settable reference
  • saving internal state, for crash recovery and rebooting
  • introspection
  • optional strict anti-windup, for output limits that exclude zero

Usage

Usage is very simple:

from moat.lib.pid import PID

# Create PID controller
pid = PID(Kp=2.0, Ki=0.1, Kd=1.0, Tf=0.05)

# Control loop

reference = 1.0

while True:
    # Get current measurement from system
    timestamp, measurement = system.get_measurement()

    # Calculate control signal by using PID controller
    control = pid(reference - measurement, t=timestamp)

    # Feed control signal to system
    system.set_input(control)

The package's examples includes a toy mass-spring-damper system model for testing.

% end main

License

Licensed under the MIT License.

Metadata

Release files for moat-lib-pid 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moat-lib-pid 0.9.0
File Size Uploaded Provenance Actions
moat_lib_pid-0.9.0.tar.gz 9.9 kB Without provenance Details for moat_lib_pid-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for moat-lib-pid 0.9.0
File Interpreter ABI Platform Actions
moat_lib_pid-0.9.0-py3-none-any.whl Python 3 none any Details for moat_lib_pid-0.9.0-py3-none-any.whl

Total release size: 17.6 kB

Release files / moat_lib_pid-0.9.0.tar.gz

Download URL moat_lib_pid-0.9.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7a46dd42119d5df2f2dcd9cfa9be992a9c36f294eddf147f64676e250e12fc16
BLAKE2b-256 checksum
How to use checksums
8fe6940e6ace68e22c54b4dd0b19c81754b41706be45c242c3109833a36fb8b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / moat_lib_pid-0.9.0-py3-none-any.whl

Download URL moat_lib_pid-0.9.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bb90ac95832a819c7eefbbd3470a686b20dff253dfbf0bb8341f60a8f0516b9
BLAKE2b-256 checksum
How to use checksums
741e1b77ad21458af75f6b27d1cb86a83b2e68578145e7762ae792127b59d63b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for moat-lib-pid 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page