User:Spiel496/PID

An automobile cruise control serves as a good example to describe PID loops and control in general. The goal of the cruise control is to accelerate the car to a target speed and then maintain that speed even in the presence of hills and wind.


 * Open Loop
 * One could control the speed without feedback. Through experiments one determines how much throttle is necessary for each target speed:
 * $$u(t) = f(s)$$


 * Bang-bang controller
 * Feedback provides a way for the controller to compensate for changes in the system. The simplest feedback control algorithm would be to apply maximum throttle (100%) whenever the speed is too low, and release the pedal completely (0%) whenever the speed is too high. This strategy would indeed get the car to the target speed. Once the target speed is reached, the throttle drops to zero until the speed drops below the target, and the process repeats. It would be an uncomfortable ride.

PID formula

 * Proportional term
 * The output of this controller proportional to the error. Even using this term alone, a controller can approach the set point more rapidly than the open loop controller can, but without the severe oscillations of a bang-bang controller. In the cruise control example, if the car is initially at rest, the proportional term may put the throttle at 100%. But as it approaches the target speed, the throttle will back off. There are some significant limitations to the P controller. First, it in order for the throttle value to be non-zero, there must be some speed error. Increasing the gain reduces the steady-state error and and produces a faster response, but this can lead to an oscillation.


 * Proportional control, with feed-forward
 * The performance of a proportional controller can be greatly improved by combining it with an open-loop control.


 * Integral term
 * The steady-state error can be eliminated by adding an integral term, forming a PI controller. As long as the error is non-zero, the integrator output will grow. The error will eventually be driven to zero. PI controllers tend to overshoot the set point. At the moment the car first reaches the target speed, the output of the P term is zero, but the integrator will


 * Derivative term
 * Adding a term proportional to the derivative will reduce the overshoot.