PLCs PID Control – Introduction to Control Loop (Part 1 of 2)
A perfect example of a control loop is the action taken when adjusting hot and cold valves to maintain the water at a desired temperature. This typically involves the mixing of two process streams, the hot and cold water. The person touches the water to sense or measure its temperature. Based on this feedback they perform a control action to adjust the hot and cold water (or only hot or cold) valves until the process temperature stabilizes at the desired value.
The sensed water temperature is the process variable or process value (PV). The desired temperature is called the set point (SP). The output of the process (the water valve position) is called the manipulated variable (MV). The difference between the temperature measurement and the set point is the error (e) and quantifies whether the water is too hot or too cold and by how much.
After measuring the temperature (PV), and then calculating the error, the controller decides when to change the tap position (MV) and by how much. When the controller first turns the valve on, it may turn the hot valve only slightly if warm water is desired, or it may open the valve all the way if very hot water is desired. This is an example of a simple proportional control. In the event that hot water does not arrive quickly, the controller may try to speed-up the process by opening up the hot water valve more-and-more as time goes by. This is an example of an integral control.
Making a change that is too large when the error is small is equivalent to a high gain controller and will lead to overshoot. If the controller were to repeatedly make changes that were too large and repeatedly overshoot the target, the output would oscillate around the set point in either a constant, growing, or decaying sinusoid. If the oscillations increase with time then the system is unstable, whereas if they decrease the system is stable. If the oscillations remain at a constant magnitude the system is marginally stable.
In the interest of achieving a gradual convergence at the desired temperature (SP), the controller may wish to damp the anticipated future oscillations. So in order to compensate for this effect, the controller may elect to temper their adjustments. This can be thought of as a derivative control method.
If a controller starts from a stable state at zero error (PV = SP), then further changes by the controller will be in response to changes in other measured or unmeasured inputs to the process that impact on the process, and hence on the PV. Variables that impact on the process other than the MV are known as disturbances. Generally controllers are used to reject disturbances and/or implement set point changes. Changes in feed water temperature constitute a disturbance to the temperature control process.
In theory, a controller can be used to control any process which has a measurable output (PV), a known ideal value for that output (SP) and an input to the process (MV) that will affect the relevant (PV). Controllers are used in industry to regulate temperature, pressure, flow rate, chemical composition, speed and practically every other variable for which a measurement exists.
PID control is a generic control loop feedback mechanism (controller) widely used in industrial and automation control systems. PID calculates an “error” value as the difference between a measured process variable and a desired set point. The controller attempts to minimize the error by adjusting the process control inputs.
The PID controller calculation (algorithm) involves three separate constant parameters, and is accordingly sometimes called three-term control: the proportional – (Kp), the integral – (Ti) and derivative – (Td) values, denoted P, I, and D. These values can be interpreted in terms of time: P depends on the present error, I on the accumulation of past errors, and D is a prediction of future errors, based on current rate of change. The weighted sum of these three actions is used to adjust the process via a control element such as the position of a control valve, or the power supplied to a heating element, or modulate speed of conveyor belt.
By tuning the three parameters in the PID controller algorithm, the controller can provide control action designed for specific process requirements. The response of the controller can be described in terms of the responsiveness of the controller to an error, the degree to which the controller overshoots the set point and the degree of system oscillation. Note that the use of the PID algorithm for control does not guarantee optimal control of the system or system stability.
Some applications may require using only one or two actions to provide the appropriate system control. This is achieved by setting the other parameters to zero. A PID controller will be called a PI, PD, P controller in the absence of the respective control actions. PI controllers are fairly common, since derivative action is sensitive to measurement noise, whereas the absence of an integral term may prevent the system from reaching its target value due to the control action. There are also control loops called IPD (slower control action).
Panasonic PLCs are capable of loop controlling either with PID or IPD.
Above is just one of the FB (Function Block) examples for PID (IPD) control loop. Library can be downloaded and implemented into FPWin Pro (IEC 61131-3) software and it is ready for you to use right away. Analog, PWM and regular on/off PID control outputs are available from PID Function Block.