PID Controller Theory
Dave 2 over at the EEVBlog explains how PID works. Wikipedia also has some great info. “A proportional–integral–derivative controller (PID controller or three term controller) is a control loop feedback mechanism widely used in industrial control systems and a variety of other applications requiring continuously modulated control. A PID controller continuously calculates an error value {\displaystyle e(t)} e(t) as the difference between a desired setpoint and