Friday, January 28, 2011

Closed Loop and PID Control


Closed Loop and PID Control
Introduction
One of the greatest strengths of using a programmable machine control, such as a PLC, is in its capability to adapt to changing conditions. When properly designed and programmed, a machine control system is able to sense that a machine is not operating at the desired or optimum conditions and can automatically make adjustments to the machines operating parameters so that the desired performance is maintained, even when the surrounding conditions are less than ideal. In this chapter we will discuss various methods of controlling a closed loop system and the advantages and disadvantages of each
Simple Closed Loop Systems
When a control system is designed such that it receives operating information from the machine and makes adjustments to the machine sed on this operating information, the system is said to be a closed-loop system, as shown in Figure 10-1. The operating information that the controller receives from the machine is called the process variable (PV) or feedback, and the input from the operator that tells the controller the desired operating point is called the set point (SP). When operating, the controller determines whether the machine needs adjustment by comparing (by subtraction) the set point and the process variable to produce a difference (the difference is called the error), The error is amplified by a proportional gain1 factor kp in the proportional gain amplifier (sometimes called the error amplifier). The output of the proportional gain amplifier is the control variable (CV) which is connected to the controlling input of the machine. The controller takes appropriate action to modify the machines operating point until the control variable and the set point are very nearly equal. It is important to recognize that some closed loop systems do not need to be completely proportional (or analog). They can be partially discrete. For example, the thermostat that controls the heating system in a home is a discrete output device; that is, it provides an output that either switches the heater fully on or completely off. The set point for the system is the temperature dial that the homeowner can adjust, and the process variable is the room temperature. If the PV is lower than the SP, the thermostat switches on the CV, in this case a discrete on signal that switches on the heater. The system adapts to external conditions; that is on warm days when the house is comfortable, the thermostat keeps the heater off, and on very cold days, the thermostat operates the heater more often and for longer periods of time. The result is that, despite the changing outdoor temperature, the indoor temperature remains relatively constant. Some closed loop control systems are totally proportional. Consider, for example, the automobile cruise control. The operator programs the system by setting the desired vehicle speed (the SP). The controller then compares this value to the actual speed of the vehicle (the PV), and produces a CV. In this case, the CV results in the accelerator pedal being adjusted so that the vehicle speed is either increased or decreased as needed to maintain a nearly constant speed that is near the SP, even if the auto is climbing or descending hills. The CV signal that controls the accelerator pedal is not discrete, nor would we want it to be. In this application, having a discrete CV signal would result in some very abrupt speed corrections and an uncomfortable ride for the passengers. When a digital control device (such as a PLC) is used in a control system, the closed loop system may be partially or totally digital. In this case, it still functions as a proportional system, but instead of the signals being voltages or currents, they are digital bytes or words. The error signal is simply the result of digitally subtracting the SP value from the PV value, which is then multiplied by the proportional gain constant kp. Although the end result can be the same, there are some inherent advantages in using a totally digital system. First, since all numerical processing is done digitally by a microprocessor, the calibration of the fully digital control system will never drift with temperature or over time.
Second, since a microprocessor is present, it is relatively easy to have it perform more sophisticated mathematical functions on the signals such a digital filtering (called digital signal processing, discrete signal processing, or DSP), averaging, numerical integration, and numerical differentiation. As we will see in this chapter, performing advanced mathematical functions on the closed loop signals can vastly improve a systems response, accuracy and stability. Whenever the closed loop control is performed by a PLC, the actual control calculations are generally performed by a separate coprocessor so that the main processor can be freed to solve the ladder program at high speed. Otherwise, adding closed loop control to a working PLC would drastically slow the PLC scan rate.