PID ActiveX Control Help

This is the support page for the PID ActiveX Control.

Usage - Lists properties, methods, and events.

Installation - How to install the control.

Release Notes - A history of software updates.

Process Control Overview

There are many books available on process control theory. You can find them at any good technical library. Process control is a complex field of study - far too broad to cover in detail in this document. The following covers some of the basics to get you started. A lot can be learned just by "playing" with the PID control. It is possible to connect your PC to laboratory equipment through a special analog adapter and perform real process control, using the PID control in Visual Basic or Visual C++ to perform the control calculations and output.

Process control is divided into two broad categories; "Open Loop" and "Closed Loop". Open loop controllers send an output signal (air pressure or electrical) to a pneumatic valve or electronic solenoid. The level of the output signal is adjusted with no knowledge of conditions at the point of control. For example, a steam valve could be set to 50% of it's travel. The kettle of water being heated is at some unknown temperature and heats up as steam is fed to it. The temperature of the water rises continuously to some point of equilibrium. No change occurs to the steam valve setting unless the operator manually adjusts the output to the valve.This type of control is manual.

Closed loop control is a technique for automatically adjusting valve or other component settings based on the measured value of the material being controlled. For example, placing a thermocouple in the kettle of water and feeding the measured temperature back to the controller allows the controller to determine a new setting for the steam valve.

In closed loop control, the tricky part is coming up with an algorithm that determines the best setting for the valve or other device based on the measured input. It's tricky because of the large number of physical characteristics of the plant that affect the behavior of the measured feedback signal and the signal going out to the valve. Various things cause time delays in the sensing of input values and adjustment of output devices. Since there are usually more complex things to control than a kettle of water, the nature of the fluid or whatever is being controlled various widely. For example, typical chemical reactions cause enormous perturbations in the stability of the system (the extreme case being an explosion). Modern control theory attempts to quantify all these factors and produce optimum control algorithms.

Proportional Control

The simplest form of closed-loop control is "Proportional". The output signal is determined by the difference between the setpoint and the measured value in relation to the range of the controller. A multiplier (called the "Gain") is used to determine the new output value. The output is calculated as:

   ((setpoint - measured value) / (max output - min output)) x (gain/100)

A gain of 100% means, for example, a setpoint of 75 degrees and a current water temperature of 50 degrees results in an output of 25% (where the output ranges from zero to 100% of the valve range). A gain of 2 would cause an output of 50%. This assumes the span of the controller (range of measured value and setpoint) is 100.

This type of control is adequate for some systems. Industrial controls implement this type of control (as well as all those described in this document) by pneumatic elements using air pressure or by electrical components using electrical sensors and solenoids. The PID Control implements control by running a timer that periodically reads properties set by the application (the key one being the measured value). The timer period can be set using the "Poll" property.

Reset Control (Integral)

Using only Proportional Control, an output value is calculated based on the current measured value. Using only this, it is possible that the controller will not produce an output that will have an effect on the measured value.

What if 25% output is not enough to heat the water (or whatever) above 50 degrees? The controller is now at equilibrium; no further changes in water temperature will occur. The system operates at a steady offset between the setpoint and the measured value. Usually, this is not quite what is desired. The operator can correct the condition by manually setting the setpoint to 100 degrees, hoping that the controller will settle down with an offset of 25 degrees, leaving the water temperature at the desired 75 degrees. Depending on the system behavior, this may not happen. The operator may have to "play" with the setpoint to find the setting that works.

The next type of control operation attempts to correct this problem. It does, in effect, what the operator would have to do manually. That is, it resets the effective setpoint when it sees that the measured value does not come up to the setpoint over some period of time. This element of control operation is called, appropriately "Automatic Reset", or just "Reset". The numeric value for the reset is the number of times per minute that the controller adds the output calculated from the simple gain to the current output value. The output is adjusted rather than the setpoint - the effect is the same, and is preferable to putting the setpoint to a location that looks strange to the operator.

The effect of reset is to, over time, eliminate the offset between the setpoint and the measured value. The disadvantage to this technique is that reset tends to desensify the controller. That is, once the setpoint has been reached, the reset may have driven the output so high that the measured value "overshoots" the setpoint. Also, if the controller is left in operation (doing calculations) while active components of the system are turned off, the reset component will build up a large output value. When the components are turned on, the controller massively overshoots the setpoint. For example, if a manual steam valve is turned off while the controller is running, reset will eventually drive the output to 100% because the measured value never comes up to the setpoint (no steam available). When the manual valve is opened, the reset component takes no effect until the measured value has reached the setpoint. By the time the controller has determined there is no continuing offset, the measured value has overshot the setpoint by a large value. This phenomenon is sometimes called "Reset Windup".

This problem can be overcome to some extent by providing a switch to turn the controller on and off. While the system is not being used, the controller is turned off. These prevents the reset component from building up incorrect output values. The control contains an Action property for turning the controller on and off and for resetting it, which zeroes out all retained calculations.

Reset control action is also known as "Integral" control, since controller output is determined by integrating offsets over a period of time.

Derivative Control (Preact)

Many systems have lengthy delays between the sensing of temperatures or other parameters and transmission of these to the controller. There can also be extensive delays in the transmission and use of output signals from the controller. The effect of these problems is that the new adjustment at the point of control is incorrect by the time it arrives. This problem is evident in all controls by observing a phenomenon known as "Cycling", where the measured value repeatedly overshoots and undershoots the setpoint. A controller operating in this condition is said to be "hunting".

There are also process events that "surprise" the controller. A chemical reaction typically produces these at the time the chemicals begin to react. Sensitive proportional control can somewhat compensate for this problem, but Reset control tends to make things worse if the reaction occurs when the measured value is below the setpoint, since Reset will continue to boost the output until the measured value is above the setpoint.

Derivative control looks at the difference between the previous measured value and the current one. It calculates a counter-output to be applied to the proportional output. In effect, it guesses what the next measured value will be based on the slope (hence the term "Derivative") of the measured value and generates an output to "get ahead" of the process.

Derivative control is also known as "Preact". The numeric value for the preact is the number of minutes to look ahead to calculate the output. For example:

  • If the previous measured value was 45 degrees and occured 10 seconds ago
  • If the current measured value was 50 degrees and the Preact value is .5
  • The rate of change in measured value is 30 degrees per minute.
  • The preact value indicates we should use the measured value .5 minutes in the future. Based on the rate of change, the measured value will be 65 degrees in .5 minutes ( 50 (current value) + 30 (deg/min ) / .5 (min) ).
  • The preact component will calculate an output based on 65 degrees, whereas the proportional component will base its calculation on 50 degrees.
  • The outputs calculated by proportional, integral, and derivative components are added together to form the new output value.

Tuning

Setting the optimum values for Gain, Reset, and Preact is known as "Tuning" the controller. This is typically done through trial and error. Although there are many algorithms used for calculating these settings, many process systems are so complex that the trial-and-error technique is the most effective.

Controllers can become more complex by "cascading" them. In this configuration, the output from one controller is used to set the setpoint of another controller. Two controllers cascaded is the norm, but there is no technical limit. Tuning these types of controllers is usually done by tuning the controller closest to the process (called the "slave") first, and then tuning the "master".

Northeast Data Corp
Charlotte, NC 
nedatacorp@carolina.rr.com