easyPID
An Arduino library for PID control, the feedback loop that keeps a motor, an arm, or a reading on target.
My partAuthor
In short
A hardware-agnostic Arduino PID controller library with independent instances, timing controls, anti-windup, derivative filtering, state introspection, and an optional relay autotuner.
- What it is
- A hardware-agnostic Arduino PID controller library published through Arduino Library Manager.
- Why it matters
- Most PID examples end at the equation, leaving timing, windup, noise, and diagnostics implicit — precisely the parts that decide whether a controller actually settles.
- My part
- I wrote the library, its examples, and its documentation.
Step by step
- 1
Instance
Each control loop is its own object with its own gains and state, so a project can run multiple loops without sharing global state.
- 2
Timing
Timing can be handled automatically from millis() or provided by a scheduler as an explicit delta, which keeps behavior stable when logging or another sensor changes loop duration.
- 3
Bound
Output limits and selectable anti-windup behavior treat actuator saturation as an expected operating condition rather than an afterthought.
- 4
Filter
An optional low-pass filter on the derivative term makes derivative action usable on the noisy sensors typically connected to microcontrollers.
- 5
Inspect
Per-term contributions are exposed so tuning becomes diagnosis: it is possible to see whether the integral is carrying the system or the derivative is amplifying noise.
- 6
Autotune
An optional relay autotuner deliberately drives the process into oscillation to derive candidate gains, with documented preconditions around bounded actuation and human supervision.
Results
- Arduino Library Manager
- Distribution
- contributed Device Control library
- 1.0.0, 1.1.0
- Versions
- listed on the Arduino Library Manager 2026-01-15 and 2026-08-09
- MIT
- License
- Any
- Architecture
- runs on AVR Uno-class boards and beyond
For engineersHow it is built, its limits, and its keywords.
How it works
The library exposes independent controller instances with automatic or caller-supplied timing, selectable anti-windup, optional derivative low-pass filtering, output limits, runtime tuning, and per-term state introspection. An optional relay autotuner is available with documented operating conditions.
Limits
- Tuning is system-specific; a gain set that behaves on one plant will misbehave on another.
- Autotuning drives the process into sustained oscillation and requires safe actuator bounds, a tolerant process, and a person ready to stop the run.
- Filter and anti-windup behavior are choices with tradeoffs; the library exposes them rather than hiding them.
Keywords
- PID controller
- Arduino library
- anti-windup
- derivative filtering
- relay autotuner
- embedded control