Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yoshuawuyts/pid-lite
A small PID controller library
https://github.com/yoshuawuyts/pid-lite
Last synced: 7 days ago
JSON representation
A small PID controller library
- Host: GitHub
- URL: https://github.com/yoshuawuyts/pid-lite
- Owner: yoshuawuyts
- License: apache-2.0
- Created: 2020-12-20T21:44:50.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-05T10:37:01.000Z (11 months ago)
- Last Synced: 2025-01-03T12:24:17.108Z (12 days ago)
- Language: Rust
- Size: 25.4 KB
- Stars: 25
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE-APACHE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-rust-list - yoshuawuyts/pid-lite - lite?style=social"/> : A small PID controller library. (Motion Control)
- awesome-rust-list - yoshuawuyts/pid-lite - lite?style=social"/> : A small PID controller library. (Motion Control)
README
pid-lite
A small PID controller library
## Installation
```sh
$ cargo add pid-lite
```## Example
```rust
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][contributing] and take a
look at some of these issues:- [Issues labeled "good first issue"][good-first-issue]
- [Issues labeled "help wanted"][help-wanted][contributing]: https://github.com/yoshuawuyts/pid-lite/blob/master.github/CONTRIBUTING.md
[good-first-issue]: https://github.com/yoshuawuyts/pid-lite/labels/good%20first%20issue
[help-wanted]: https://github.com/yoshuawuyts/pid-lite/labels/help%20wanted## 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.