by Joe Evans

Pumps & Systems, February 2008

Editor's Note: This is the second part of a two-part series on Process Control. The first part discussed the P-proportional control-of PID. This month we'll look at I and D. To read part one, click here.

Last month, we ended our discussion of proportional control by saying there are times when P alone cannot provide the accuracy required by a process. Take, for example, a constant pressure booster system under VFD control. If changes in flow and the resulting change in pressure occurred gradually over a long period of time, the VFD could use proportional control to keep pressure constant.

However, this is seldom the case. Abrupt flow changes are typical, and their duration can vary substantially depending upon the application and time of day. When a proportional control system is forced to act on a rapidly changing event, it tends to overreact. Once it has overreacted in one direction, it will probably overreact in the other. These "oscillations" can cause instability and, in rare cases, a total loss of control. Therefore, some fine tuning of that proportional algorithm is necessary if a VFD is to maintain constant pressure under a host of differing conditions.

Unlike humans who might monitor several conditions within a system at the same time, the VFD usually monitors only one. It could be the output of a pressure transducer, flowmeter or ultrasonic level device. Regardless of the input, it is always one dimensional-just a stream of varying electric current that equates to PSI, GPM, or feet. If you were controlling that pump, your multitasking brain would allow you to add additional dimensions to this basic information.

Suppose that you have been tasked with controlling the speed of a centrifugal pump in order to maintain some constant pressure. You know nothing about the flow and head characteristics of the pump, and you have never heard of the affinity laws. You have only two tools-a joystick that will allow you to increase or decrease speed and a pressure gauge that shows the system pressure. If the pressure drops, you would move the joystick in a direction that increases speed and try to get the pressure back to the set point. If pressure rises past the set point, your hand would react in the opposite direction.

In the beginning, you will probably overreact to the changes in pressure displayed by the gauge. This is human instinct at work-if some is good, more is better! But, as you gain experience, that simple pressure gauge will provide you with additional information that will allow you to better control pump speed and the resulting pressure it produces.

One of the first things you will notice is that the range and duration of the pressure drops are not the same. Some will be very small (2-psi to 3-psi) and last for just a few seconds. Others may also be small but last for minutes. Some will be much larger and last for varying amounts of time. The gauge will also indicate how quickly these changes occur. Some changes in pressure may be large but occur slowly, while others can occur in the blink of an eye. Interestingly enough, your analog brain will begin to incorporate this additional information into your control scheme, and your ability to control speed and pressure will increase significantly.

The I and D components of PID attempt to do exactly what your human brain did-add additional dimensions to the rather limited information received by the controller. Basically, they provide information that can help the controller decide upon "how much" and "how quickly" it reacts to a particular change in pressure.

The Integral and Derivative

The "fine tuning" I referred to earlier involves the integral and derivative. These functions are two essential components of the mathematics known as calculus and although they can seem complex, their function is pretty straightforward. In calculus, the derivative is used to illustrate the rate of change of some value. The integral does the exact opposite and converts the derivative back into its original value. So, if the derivative of distance is velocity, the integral of velocity is distance. It follows then that the derivative of a 5-psi pressure reduction is the change in pressure per unit of time, and the integral of that change over time is the total change itself.

Integration allows us to measure the area under a complex curve that is continuously changing over time and differentiation allows us to calculate the rate of change at any point on that curve. Okay, that may not be an adequate explanation. Perhaps if we expand on it a bit and see how these two functions affect the proportional control logic, it will become clearer.

The Integral

The integral function acts as the traffic cop for the proportional algorithm and tries to keep it from overreacting in one direction or another. I like to refer to it as the "how much" function since it keeps track of the errors that occur and uses that information to reduce those errors in the future.

Almost every time a proportional controller attempts to bring a change in system pressure back to the set point, it makes a mistake. By mistake, I mean that it initially misses the set point. Part of the reason is that, even today, the proportional control algorithm used by the typical VFD does not take into account the affinity law that governs centrifugal pump pressure-the one that says pressure changes as the square of a change in speed. Thus, the proportional algorithm tends to overcorrect pressure changes. Figure 1 below illustrates this point.

Figure 1. Proportional Control ErrorThe blue curve in Figure 1 plots the percent change in system pressure over time. The red, horizontal line at zero on the Y axis is the set point pressure. Here is what happens. At time 0, the controller receives a message that the system pressure has dropped 10 percent, so it immediately initiates a proportional speed increase. After about one second, the pressure returns to the set point, but then it increases for another second and hits its max at 5 percent over set point. By this point, the proportional controller realizes that it has made a mistake and instructs the drive to slow the pump. Yet again, it overcorrects in the opposite direction. Over the next few seconds, it continues to adjust speed until pressure finally remains near the set point.

The curve in Figure 1 represents the total error that occurred during the pressure correction and can be broken down into three different pieces of information. The first is rise time, or the time it takes for the pressure to increase from its low point to the set point. The second is overshoot and represents the maximum pressure that occurred. The third is settling time, or the time required for pressure to settle about the set point.

The beauty of the integral function is that it can calculate the area under this complex curve and come up with a numerical value that describes the total error that occurred. It can then use that quantity to police the proportional controller the next time a pressure change occurs. For example, if the controller sees a 10 percent drop in pressure and decides to increase speed by 10 percent, the integral will say, "Nope, can't let you do that. Based on your past performance I am going to limit your increase to 7 percent." The integral tracks the error quantity continuously, and its response will continue to increase until the error is reduced to zero. This probably never happens but it does substantially reduce the total error that results from proportional control alone. In fact, many VFD processes-including some pump applications-find PI control more than adequate and don't even use the D in PID.

The Derivative

As I said earlier, the derivative function (or D) allows us to calculate the rate of change of some quantity that is undergoing a nonlinear increase or decrease. In our example, this quantity is pressure, and pressure seldom changes in a linear fashion. More often its change is in the form of a complex curve. The derivative continuously monitors the rate at which pressure is changing and informs the controller as to how quickly it should react to some change. You can think of it as the "how quickly" function.

Figure 2 below contrasts the curves generated by a 10 percent pressure drop that occurs over a period of 1.5 and 2.5 seconds. As you can see, the blue curve-generated by the 1.5 second drop-is quite a bit steeper than the red one that occurs over 2.5 seconds, and the steeper the curve, the faster its rate of change. Since the rate of change is much greater for the 1.5 second drop, the derivative function would cause the controller to respond more quickly to that drop and more slowly to the 2.5 second drop.

Figure 2. Derivative ControlI said the feedback seen by the VFD is usually one-dimensional, but that single source provides a continuous stream of information. Depending upon the processing power of the controller, it might be monitored anywhere from 5 to 10 times each second. Since the controller is continuously updated with new pressure information, both the integral and derivative functions can drastically increase the accuracy of the proportional algorithm by providing it with real time guidance.

One of the advantages of the typical VFD is that the P, I, and D logic is an integral part of the system.  If your particular application works well with P and I alone, there is no need to use D. If reaction time is critical, D is always available.