shark_pid

Embedded 2-DOF PID controller that matches the Simulink PID Controller (2DOF) block.

Author
Tran Nguyen Binh
Website
https://github.com/nguyenbinh-shark/shark_pid
Category
Signal Input/Output
License
MIT
Library Type
Contributed
Architectures
Any

Every parameter maps one-to-one onto a field of the Simulink PID Controller (2DOF) block, so a model you tune in simulation is the controller that runs on the microcontroller - they agree to numerical noise even while the output is saturated. Explicit dt in every term so gains survive a change of loop rate. Setpoint weighting b and c, filter coefficient N, trapezoidal or backward-Euler integration, clamping and back-calculation anti-windup, integrator limits, NaN/Inf rejection and bumpless manual-to-auto transfer. The core has no Arduino or HAL dependency, so the same file builds for STM32, ESP-IDF or a PC simulation.

Downloads

Filename Release Date File Size
shark_pid-1.0.0.zip 2026-08-30 189.00 KiB