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.1

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.1
File Size Uploaded Provenance Actions
moat_lib_pid-0.9.1.tar.gz 9.9 kB Without provenance Details for moat_lib_pid-0.9.1.tar.gz

Built distribution (wheel)

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

Total release size: 17.7 kB

Release files / moat_lib_pid-0.9.1.tar.gz

Download URL moat_lib_pid-0.9.1.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2e1fa04e8f4af900113808dab470cc1df736364de68da13f15858365c21ebf41
BLAKE2b-256 checksum
How to use checksums
dc497352d0285caa6d11c80bd6b53bc98d7adea32e8f95c19ece1f826b090e1d
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.1-py3-none-any.whl

Download URL moat_lib_pid-0.9.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74bee1b6973beb72f6fdefad481718710fa1fd7c5d90c8e47999c73e21cff24d
BLAKE2b-256 checksum
How to use checksums
5c213176c3d7470658b99feb967ae3a95afc2d31fd8e7e352bece85663a04f6b
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.1

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