dvcorreia / pid

Light c++, c and rust implementation of a discrete PID for embedded devices (under development) :flags:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A discrete PID implementation optimized for embedded systems

Example

using namespace pidlib;

int main(){
    Pid<uint8_t> controller;
    controller.init(10000, 1);
    controller.tune(1, .5, .5);
    controller.limit(0, 256);

    while (1)
    {
        error = current_position - setpoint;
        controll_signal = controller.run(error);
    }
}

Features

  • Optimized for microcontrollers without floating points hardware
  • Header only library. No cpp files to compile
  • No dynamic memory allocation
  • Templating

About

Light c++, c and rust implementation of a discrete PID for embedded devices (under development) :flags:

License:MIT License


Languages

Language:C++ 81.3%Language:C 18.7%