|
TinyRobotics
|
Implements a simple, header-only Proportional-Integral-Derivative (PID) controller. More...
#include <PIDController.h>
Public Member Functions | |
| bool | begin (N dt, N min, N max, N kp, N ki, N kd) |
| void | setDt (N dt) |
| N | calculate (N target, N measured) |
Protected Attributes | |
| N | dt = 1.0f |
| N | max = 0.0f |
| N | min = 0.0f |
| N | kp = 0.0f |
| N | kd = 0.0f |
| N | ki = 0.0f |
| N | preerror = 0.0f |
| N | integral = 0.0f |
Implements a simple, header-only Proportional-Integral-Derivative (PID) controller.
This class provides a basic PID controller for closed-loop control of processes such as motors, temperature, position, and more. The controller computes a control output based on the error between a target setpoint and a measured process value, using configurable proportional, integral, and derivative gains.
begin() to configure, calculate() to compute control output