A PID controller is a control algorithm for the purpose of moving a system to or keeping a system at a given setpoint.
Examples:
- maintaining a constant speed on a flywheel mechanism while firing game elements
- moving to a point on the field during autononous
- maintaining the angle of an arm holding a game element
- moving a mechanism to a predetermined position
- maintaining a constant heading/rotation while driving
PID is based on error - that is, how far you are from the setpoint. P is proportional to the error, that is P = (constant) * error. I is proportional to the integral or sum of all previous error. D is proportional to the derivative or instantaneous rate of change of the error. These three values are combined to give one output, which your program uses to move the system closer to the setpoint.