A PID controller uses proportional, integral and derivative modes to minimize the difference between a measured process variable and desired set point. It is commonly used in industrial control applications to regulate variables such as temperature, flow and pressure. The controller calculates an "error value" as the difference between the measured process variable and set point, then applies corrective action proportional to that error, as well as to the integral of past errors and the rate of change of the error. Tuning the controller involves adjusting the proportional, integral and derivative constants to achieve the desired closed-loop response.