I got aware of Arduino-PID-library years ago when I did more stuff with Arduinos.
https://playground.arduino.cc/Code/PIDLibrary/
Especially the article series describing in detail the design decisions impressed me:
http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/
So it was clear that I would do my first PID project with that library.
Only now I really have to do my first PID controller.
I want to automatically center video on an approach for landing airplane.
I do use this simple stepper PT camera system (just 4 drops of superglue needed):
https://forum.arduino.cc/index.php?topic=647703.0
Later for capturing real airplanes, I will use a 70mm lens.
The small camera is for inhouse algorithm development.
I simulate bright air with white background, and airplane with a non-reflecting black pendulum ball.
A simple P only PID controller basically works for both stepper motors (animation speed 0.25):
https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=252176&p=1568093#p1568093
Because the 20-90fps image processing of Raspberry cameras is done on Raspbian, I wanted to make Arduino-PID-library usable there as well. After an intitial checkin of the unmodified library into my repo, I did commit some glue code in Arduino.cpp/.h (only "millis()" function was needed), and a simple PID_test.cpp that just proves that compilation works, and that millis() and using the library works as well:
$ g++ -Wall -Wextra PID_test.cpp Arduino.cpp Arduino-PID-Library/PID_v1.cpp -o PID_test
$ ./PID_test
0
100
70.000000
$
Now I will have to learn how to use the PID library, and how to manually tune PID parameters:
P.S:
millis() returns 0ms on first invocation.
In case you want 0ms correspond to program start, just call millis() as first statement.