pid-lite

Crates.iopid-lite
lib.rspid-lite
version1.2.0
sourcesrc
created_at2020-12-24 22:05:14.60976
updated_at2024-02-05 10:32:55.447602
descriptionA small PID controller library
homepage
repositoryhttps://github.com/yoshuawuyts/pid-lite
max_upload_size
id326986
size32,544
Yosh (yoshuawuyts)

documentation

https://docs.rs/pid-lite

README

pid-lite

A small PID controller library

Crates.io version Download docs.rs docs

API Docs | Releases | Contributing

Installation

$ cargo add pid-lite

Example

use pid_lite::Controller;
use std::thread;
use std::time::Duration;

let target = 80.0;
let mut controller = Controller::new(target, 0.25, 0.01, 0.01);

loop {
    let correction = controller.update(measure());
    apply_correction(correction);
    thread::sleep(Duration::from_secs(1));
}

Safety

This crate uses #![deny(unsafe_code)] to ensure everything is implemented in 100% Safe Rust.

Contributing

Want to join us? Check out our "Contributing" guide and take a look at some of these issues:

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Commit count: 14

cargo fmt