pid-loop 0.0.6

PID loop for `no_std` targets
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented5 out of 5 items with examples
  • Size
  • Source code size: 17.95 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 816.5 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • dotcypress/pid-loop
    4 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dotcypress

A tiny no_std PID controller library.

This crate implements the classic windowed PID loop over abstract data type.

Introduction

A proportional-integral-derivative controller is a control loop mechanism employing feedback that is widely used in industrial control systems and a variety of other applications requiring continuously modulated control.

Examples

use pid_loop::PID;

let target = 42.0;
let mut controller = PID::<f32, 1>::new(2.0, 0.7, 0.3, 0.0, 0.0);
loop {
    let correction = controller.next(target, measure());
    apply_correction(correction);
    sleep();
}

fn sleep() { todo!() }
fn measure() -> f32 { todo!() }
fn apply_correction(_: f32) { todo!() }