Digital PID for ESP32, which can be used manually or with a timer handled by the library. The PID expects a constant cycle time, take it into account if not using the timer. I did this library because ...
The ABCs of PID control. Considerations for interfacing elements in the electrical circuit to accomplish those parts of the PID function for position control. Firmware code implementation.