Introduction to PID control

Article Tools

Popular Articles

Everyone uses control loops. Anytime you adjust how you do something based on previous results, you are forming your own control loop.

For example, when you want to drive your car at 65 mph, you depress the accelerator until the speedometer reports the target speed — simple. But what happens when you start driving up a hill? The car slows because the torque to move a car at 65 mph on flat road is no longer enough — so you respond by pressing the accelerator further down. Your foot, the speedometer, and your brain have formed a control loop. American cars have offered automated speed control loops — also known as cruise control — since 1958.

Similarly, modern industrial controls are often required to regulate processes as part of a control loop. The controller receives a setpoint request from the programmer and compares it to a measured feedback. The setpoint can be thought of as where I want to be and feedback can be thought of as where I really am. The difference between the setpoint and feedback is called the error ε. The job of the controller is to eliminate the error — so where I am is where I want to be.

How do PID loops work?

PID is an acronym for the mathematical terms Proportional, Integral, and Derivative. Proportional means a constant multiple. A number is said to be a proportion to another if there exists a constant n such that y = nx. This n can be positive or negative, greater or less than one. To make the formula more accurate by PID controller standards, proportion is given by KP and the x term is the control loop error ε: y = KP(ε).

The term Integral means the summation of a function over a given interval. In the case of controller PID that is the sum of error over time: y = ∫f (ε)dt.

Finally, Derivative is the rate of change during a given interval. Interpreted by a PID controller:

All three of these PID controller components create output based on measured error of the process being regulated. If a control loop functions properly, any changes in error caused by setpoint changes or process disturbances are quickly eliminated by the combination of the three factors P, I, and D. Let us now analyze how each contributes to performance.

Proportional factor

The proportional factor is easiest to understand: The output of the proportional factor is the product of gain and measured error ε. Hence, larger proportional gain or error makes for greater output from the proportional factor. Setting the proportional gain too high causes a controller to repeatedly overshoot the setpoint, leading to oscillation.

The downside to a proportional-only loop is that when error becomes too small, loop output becomes negligible. Therefore, even when the proportional loop reaches steady state, there is still error. The larger the proportional gain, the smaller the steady state error — but the larger the proportional gain, the more likely the loop is to become unstable. This dilemma leads to inevitable steady-state error called offset.

Integral factor

Think of the integral factor as a basket in which the loop stores all measured error (∫ε). Remember that error can be positive or negative, so sometimes error fills the basket (when positive error is added to positive error or negative error is added to negative) and sometimes it empties the basket — as when positive error is added to negative, or vice versa.

When the integral factor functions properly in the control loop, the basket is nearly empty. Even when error is so small that the proportional factor is no longer effective, the integral is still hard at work, collecting error until it is large enough to matter — as part of the integral's function is to eliminate steady-state offset.

In fact, most control loop action at steady state is due to the integral factor. Controllers that feature integral reset prove it: Resetting the integral when a loop is in steady state causes controller output to momentarily drop to zero as the integral “basket” is emptied.

The downside to the integral factor is that it strongly contributes to controller output overshoot past the target setpoint. The shorter the integral time, the more aggressively the integral works.

Derivative factor

The derivative factor is the least understood and used of the three factors. In fact, a majority of PID loops in the real world are really just PI loops. That does not negate the fact that there are certain applications in which the derivative plays a very important role. The proportional corrects instances of error, the integral corrects accumulation of error, and the derivative corrects present error versus error the last time it was checked.

In other words, the derivative is looking at the rate of change of the error Δε. The more error changes or the longer the derivative time, the larger the derivative factor becomes. The effect of the derivative is to counteract the overshoot caused by P and I. When the error is large, the P and the I will push the controller output. This controller response makes error change quickly, which in turn causes the derivative to more aggressively counteract the P and the I. A properly used derivative allows for more aggressive proportional and integral factors. Larger derivative time makes the derivative more aggressively dampen P and I.


Acceptable Use Policy
blog comments powered by Disqus

Marketplace

eNewsletter

EngineeringTV


The Latest Videos from EngineeringTV.com

Back to Top