The PID Controller
The idea behind the controller is very simple. There is a state we want to achieve for our system, we have a signal telling us what the current state is, and we have an input to effect a change in the system to bring it closer to our desired state. The most commonly used controller is the PID controller (Proportional, Integral , Derivitive).
Where u is the control output, e is the error, Kp, Ki, Kd are the proportional, integral and derivative gain coefficients, respectively.
The proportional part of the controller calculates the error scaled by the proportional coefficient (Kp), the integral part sums the errors and scales the result by the integral coefficient (Ki), and finally, the derivitave part calculates the change in error and scales it by the derivitave coefficient (Kd). An important point to note here is that the derivative term is very prone to noise, whereas the integral term has a smoothing effect. This is why the Kd coefficient is set to zero for the T-Bot. The controller is named according the non-zero coefficients. For example, if Kd is zero, we are using a PI loop.
You can use the T-Bot Simulator to experiment with PID tuning parameters.