Presentation is loading. Please wait.

Presentation is loading. Please wait.

Proportional Integral Differential (PID) Control

Similar presentations


Presentation on theme: "Proportional Integral Differential (PID) Control"— Presentation transcript:

1 Proportional Integral Differential (PID) Control
Proportional Control Equation Example PI Control Numerical Integration PID Control Web Simulation Numerical Differentiation A 3-mode opamp controller Industrial PID tuning Summary Proportional Integral Differential (PID) Control 1 This presentation introduces equations and graphical examples of proportional, integral, and derivative control, which is one of the early methods of control, and which is still widely used in industry. Applicable PID equations and how to perform numerical integration and differentiation using Excel to simulate the PID waveforms are discussed along with examples of the use of these equations. A handy web simulation is discussed and several Excel simulations are provided for you to download and run. A 3-mode opamp controller that could be used to provide PID control is discussed along with some companies that provide PID tuning in industry. Transition First is a look at an equation for the proportional control mode.

2 Proportional Control-1
Error Output + Input signal Actuator (Plant) Controller e r - b Transducer 2 An equation that can be used to express the proportional control mode is shown near the top of the slide. The general feedback control block diagram is the same as the one used in the previous presentation. This general diagram is applicable to any control method and you will see that the block diagram for any of the PID type controllers is in the same form. Notice that the error is the input signal or setpoint minus the feedback signal. The relative error that can be expressed as a percentage of the full range of the feedback signal using the formula shown near the bottom of the slide. Transition: Next is a different look at proportional control using this block diagram. Feedback Signal

3 Proportional Control-2
Error Output + K G e r p - b H 3 A control loop with K as the gain of the controller, G as the gain of the plant, and H as the gain of the feedback loop is shown near the top of the slide. The block diagram algebra shown on the left shows that the output, p, is the Gain of the plant times the gain of the controller times the error. Then, using algebra, the error is (r-Hp). The algebra is continued on the right of the slide so that the output can be expressed using the formula at the bottom right of the page. This formula at the bottom right of the page is a classic formula for feedback control systems and can be used with more complex systems by using Laplace or Z transforms to express the differential equations representing the controller, plant, and feedback systems. Transition: Next is an example of a system using proportional control.

4 Proportional Control-3
Error Output + K G=8 e r p - b H=1/8 4 A simple example of a proportional control loop is shown here with the controller gain = K, the plant gain just a real number, 8, and the feedback gain = 1/8. You can see that the output is proportional to the input in the formula at the bottom left with K/(1+K) being the constant of proportionality. If you have taken a differential equation course in the math department or EET 307, you know that Laplace transforms are an engineering method used to simplify the use of linear differential equations. The top formula on the right shows that even using Laplace transforms, which are functions of the complex variable, s, the output is not directly proportional to the input because of the complex variables, functions of s, that are involved. z-transforms are used to describe systems in terms of difference equations. This enables digital systems to be described using block diagrams. Laplace transform systems can also be converted to a z-transform nomenclature. The lower equation on the right shows that the output has the same relationship as with Laplace transforms for a system described in terms of z-transforms. The courses CPET472 & EET472 use a more mathematical approach to control systems using Laplace and z-transforms and frequency analysis. Transition: Next is a look at the offset caused by using strictly proportional control.

5 Proportional Control-4
Error Output + K=1/4 G=4 e r K=4 G=4 p - b H=1 H=1 5 Two examples of the use of proportional control are shown on the slide. The example in black and on the left of the slide shows a proportional gain of ¼ and a plant gain of 4 with a feedback gain of 1. Substituting into the equation derived earlier, the output is ½ of the input. If the proportional gain is increased by a factor of 16 to 4, the output becomes 16/17 th of the input. But, with the feedback system shown, the output can never equal the input because of the feedback. So, even with a high gain system, the output can be close to the input as in the equations on the right. You should verify that for a proportional gain of K=25 in this system, the output becomes 100/101 of the input, but they are not equal. Transition: Next, I will go back to the textbook view and continue the discussion of proportional control.

6 PC-5 + + kp p p0 ep Output Proportional controller Setpoint
In terms of % of span 6 The equation used in the text to explain the proportional control mode requires a different block diagram that considers only a part of the overall control loop, since this class does not use Laplace transforms, which are needed to explain the entire loop. What is done well in this text is providing an initial feel for the effect of the different parts of the PID controller. You can see that the block diagram shown at the top right of the slide reflects the equation at the top left, which is from the text. This equation defines the error as the difference between the actual output value and the setpoint value divided by the proportional gain, kp. This is shown in the 2nd equation near the top of the slide. Another equation relating the error to the output, which is the actual value of the controlled variable and the setpoint, which is the desired value is shown near the bottom right of the slide, in the red box. This equation says that the error, as a fraction of the maximum range or span is the difference between the actual value and the setpoint divided by the span. Transition: An example of the use of this formula is Problem 9.8 in the text, and this will be discussed next. In units of the output PC-5

7 9.8 For a proportional controller, the controlled variable is a process temperature with a range of 500 to 1300C and a setpoint of 73.50C. Under nominal conditions, the setpoint is maintained with an output of 50%. Find the proportional offset that results from a load change which requires a 55% output if the proportional gain is (a) .1 (b) .7 (c) 2.0 and (d) 5.0 PC-6 In terms of % of span 7 Problem 9.8 is shown at the top of the page and the equations on the left are from the previous page. The equations on the right are derived from these definitions. The top equation on the right shows that the problem specifies a change in the load that requires a 55% output and uses the top equation on the left in the form defined by the 2nd equation on the left. The 2nd equation on the right uses the definition given by the bottom equation on the left with the numbers provided in the problem to define ep and this is set equal to the result of the top left equation. The equation for the output temperature is derived and provided on the bottom right. Substituting the kp from parts a and d into this equation provides solutions. Part a says that the output temperature for a very low gain proportional controller is 33.50C which is FAR from the desired setpoint of 73.50C. With a relatively high value of proportional gain of 5 in part (d), the output temperature is 72.70C which is close to the desired setpoint. Notice that even with a relatively large proportional gain, the output is still offset from the desired output, which is the setpoint of 73.50C. Verify for yourself that even with a proportional gain of 40, the output would be 73.40C which is close to, but not exactly the desired output. The difference between the desired output and the actual value is called the offset and is always present with a proportional controller. That is the major disadvantage of a proportional controller. Transition: Next is additional discussion of proportional control with a web example. Output Temperature= T=33.50C (d) T=72.70C In units of the output

8 PC-7 High heat load: air conditioner takes Red-line is On-Off Control
a while to bring temp down. Red-line is On-Off Control (furnace on at 60) (air conditioner on at 80) Green-line is Proportional Control: above 70 air- conditioner fan speed increases proportional to the T-700 Cold wind: heater takes a while to bring temp up. 8 The graph shown on the slide is from the website shown near the bottom. The explanation shown on the slide is in my words and an explanation similar to that at the website is provided next. On-off control keeps the temperature pretty much within the range from 60 to 80, but allows the temperature to vary freely between the limits. Suppose instead of just switching the furnace and air conditioner on and off, we coupled the temperature reading to the gas valve on the furnace: the further the temperature falls below 70, the more heat the furnace generates. Likewise, as soon as the temperature rises above 70, the air conditioner starts, but we rig it to generate more and more cooling as the temperature rises. We'll end up with a system that behaves like this. If you visit the website, the On-Off control is called Bang-Bang control. Bang-Bang control is an old term that means the device is turned on to its maximum potential or is turned off. For instance, the heater would be on at it maximum possible production when it is on and so would the air-conditioner. Another example of Bang-Bang control is that when a motor is turned on it is at its maximum possible torque output. For a jet engine, Bang-Bang control would mean that when it is turned on it is at its maximum thrust. There is an entire mathematical theory of Bang-Bang control using the calculus of variations in graduate level control theory. But, back to this example, it is obvious from the graph that the proportional control enables tighter control of the temperature than a simple on-off control scheme. Transition: Next is a look at a web simulation of PID tuning. Green-line is Proportional Control: below 70 amount of furnace gas increases proportional to the 700 – T. Time of day PC-7

9 PC-8 On-Off Control Proportional Control
9 The website shown near the center of the slide has a Temperature Control Simulation. If you leave the simulation in the original On-Off control setting, the top graph appears showing that on-off control does the job of changing the temperature from one setting to another, but that there are oscillations as the heat control is alternately turned on and off to keep the temperature near the desired temperature. The controller parameters for this on-off control are shown on the upper right of the slide. If you change the setting of the simulation to PID control and make the Integral and Derivative values in the right column = 0, you get Proportional Temperature control. The values used in this simulation, at the website shown are to the right of the bottom graph. If you click on the graph, it is redrawn and you get the 2nd graph shown on the slide. This graph illustrates the benefit of proportional control, in that the temperature settles to close to the desired value. However, the drawback of proportional control is that the temperature does NOT settle to the exact desired value. There is always an offset, which can be reduced with a large proportional gain, but not made zero with just proportional control. This is why proportional control is not used much, by itself, but is generally combined with Integral or Derivative control in a feedback control system. Transition: Next is a look at the effect of Proportional-Integral control using this same web simulation. Proportional Control PC-8

10 Proportional-Integral (PI) Control
10 Using the controller parameters shown on the right of the slide and then clicking the graph to redraw it, the graph shown on the left appears. Notice that the D, for derivative, control is set at 0 so the result is PI control. You can see that the Proportional-Integral control eliminates the offset which is the result of Proportional control alone. Remember that PI control is commonly used and the integral portion eliminates the proportional offset. The large overshoot of the output, here temperature, is undesirable, as is the oscillation. To improve this output you can adjust just the Proportional and Integral terms, or you can add a derivative term. A derivative term has a number of effects on the output and is not always necessary, which is why PI controllers are common. Transition: Next is a look at the same simulation with PID control. Proportional-Integral (PI) Control

11 Proportional-Integral-Derivative (PID) Control
11 The derivative portion of the PID controller is added for this simulation graph. It shows that this particular PID controller is the best one thus far since the temperature rises quickly to the desired value and stays at this value with no overshoot or oscillation. There is a rapid rise in the output, which is temperature in this example, and there are no oscillations. PID control is widely used in industry and is effective for most control purposes. Programmable Logic Controllers generally have a PID module that can be purchased so that this form of control can be implemented using a PLC. You should go to this website and “play” with the P, I, and D settings and see how the output changes with different settings. There are numerous mathematical procedures as well as practical procedures for tuning PID loops. Transition: Next is a look at the equations defining the composite modes. Proportional-Integral-Derivative (PID) Control

12 PI, PD, and PID Composite Mode Equations
12 The equations for the three composite modes are shown here, as expressed in the text. The Proportional-Integral mode is common and eliminates the offset of the proportional only mode. Remember that integration is the area under a curve, so the integral of the error is that area between the error curve and the axis. The constant in the upper equation is the initial value at time t=0. The integration is started at time t=0 and goes until an unspecified time t, meaning that it is continuous integration as long as the system is turned on. The Proportional-Derivative equation and its PD action is not used as much as the other two because it does not automatically eliminate an offset error due to proportional control. Remember that the derivative is the slope of a curve, so what this action does is increase the correction when the slope of the error is steeper and decrease the action when there is a smaller slope. The PID equation combines all three action and can be tuned for best response. Tuning can be quite complex mathematically. The title of a booklet that explains PID tuning without extensive mathematics is shown in blue on the slide. More information is available at the website shown and I have a number of copies of the booklet if you would like to borrow one for a while. Transition: Next is a look at how these equations can be visualized using an example from the text. CONTROLLER TUNING AND CONTROL LOOP PERFORMANCE, A PRIMER, SECOND EDITION Subtitled PID WITHOUT THE MATH by David W. St. Clair

13 Example 9.8 in text Equation: percent 13
Example 9.8 in the text has the equation shown near the top of the slide. To simulate this using Excel, the error waveform is plotted, in blue, near the bottom of the graph. Then, the proportional portion is plotted, in red, near the top of the graph. Note that the proportional response is just a constant, here 5, times the error. Transition: Next is a look at the integral portion of the response.

14 Ex 9.8 +20% would just raise the PI curve. 14
The equation for this example is shown again in the upper left. The proportional and the Integral portions of the equation are shown on the graph. Then, the Proportional and Integral columns are added to get the result of the PI for this example. The factor of 20% is not included in the graph, but would just increase the entire graph by 20, like adding a DC value to a sine wave or other function on an oscilloscope. The proportional portion, in yellow, is just a multiple of the error. Notice that the Integral of the error takes a straight line with a slope and makes it into a parabolic waveform. This is just the result of integrating t to get t2/2, hence a straight line t becomes a parabolic waveform in t2. The Integral and proportional curves are just added point by point in Excel to get the PI curve shown. The Excel program is available for you to download from the web. You should download the program and ensure that you understand how the equations used in Excel were developed. Transition: Next is a look at numerical integration using the Excel program as an example. +20% would just raise the PI curve. Ex 9.8

15 Simple Numerical Integration
3 Calculations: .1*1 +0=.1 .1*2+.1=.3 .1*3+.3=.6 .1*3+.6=.9 .1*3+.9=1.2 etc. volts 2 1 0.1 0.2 0.3 0.4 15 Lets use the graph on the left of the slide to show how the simplest form of numerical integration is done. What is needed is the integral of the curve from 0 to 0.4 seconds. All you need to do is find the area between the red curve and the 0 axis. To do this, you break down the curve into smaller segments. The smaller the segments along the time axis, the more accurate the result will be, but here, lets use .1 second increments. The area between 0 and .1 seconds can be found exactly using the formula for the area of a triangle, but what is needed is a more general method that can enable the computer to calculate the area no matter what type of curve is integrated. So, what is done in the simplest form of numerical integration is to have the computer, in this case Excel, calculate the area of each of the rectangles. First the area of the left, yellow rectangle is calculated as .1*1=.1. Then the area of the 1st orange rectangle is calculated as .1*2=.2 and added to the first value since we are calculating the total area. This gives a result of .3. Then the area of the next, yellow rectangle is calculated as .1*3=.3 and added to the running total to get .6. Then the area of the next, orange rectangle is calculated as .1*3=.3 and again added to the total to get .9. Then, this is done again to get 1.2. An approximate curve is shown on the graph with the red dots showing the approximate points. You should realize that these calculations are approximate, but, as you make the delta t smaller, the calculation of area will get more accurate. The first 3 points should define a parabolic curve, but this is not readily visible with only 3 points. The integral of a constant is a line, with the slope of the constant, and this is what the 4th and 5th points should show. Again, these calculations are correct, but there are not enough points to show a good result, but that is not the case with the Excel graph plotted on the previous slides and available for you to download and study. Transition: Next is an example of a PID problem using the PID equation. seconds Simple Numerical Integration

16 16 A 2nd Excel spreadsheet was created using the equation for a PID system shown at the top left of the slide. The same error waveform was used, so the proportional curve, in yellow is the same as for the previous example. Similarly, the Integral of the error waveform is the same as in the previous example. Here, the derivative term is also included. The derivative of a waveform is the slope of the waveform at each point. You can see that the error waveform is just 1/5 th of the proportional waveform, so its derivative is its slope, which is 1 while it increases to its maximum value of 5 and then 0 after that since the slope of a horizontal line is zero. The Excel spreadsheet with this example is also available for download and study. Transition: Next is a look at a simple method of finding the numerical derivative of a curve in Excel. PID Example

17 Numerical Derivative 3 Calculations: (1-0)/(1-0)=1 (2-1)/(2-1)=1
(3-2)/(3-2)=1 (3-3)/(4-3)=0 (3-3)/(5-4)=0 etc. volts 2 1 1 2 3 4 5 17 Since a numerical derivative is just the slope of a curve, a simple way to calculate it numerically is to take the change in amplitude of the curve over a small range and divide it by the change in time. So, here, this gives the results shown on the slide. The slope is correct in places, but is not completely correct because the time differences are to large. The smaller the time differences, the closer the results of these calculations are to the actual derivative of any curve. Transition: Next is a look at an operational amplifier circuit to implement a PID controller. seconds Numerical Derivative

18 Opamp PID Circuit Set kp Set kI Set kD 18
A parallel implementation of an opamp PID controller is shown on the slide. The PSpice circuit is included on the web for you to download, but it is not a working circuit. The circuit was drawn using PSpice for convenience, but PSpice components were not used for the opamps, they were simply drawn using the PSpice drawing tool. An equation for a PID controller is shown at the top left of the slide. The feedback voltage is subtracted from the setpoint, or input voltage using a standard differential amplifier, called the error amplifier on the slide. Each of the 3 portions of the PID controller is implemented so the proportional, Integral, and derivative constants can be set separately. The three parallel PID components are then added using an inverting summer so that the output is the sum of the factors. Notice that the factors for kP, kD, and kI are not the same as those used in the text or in an earlier equation that was the same as the text, but are each separated out. Perhaps from this simple opamp circuit you can see how the earlier web simulation would be set up so that you could easily adjust, in the program, each of the 3 factors. Transition: Next is a look at some industrial strength PID tuners from web pages. Set kD Opamp PID Circuit

19 Industrial PID Tuning http://www.expertune.com/
DCS: Digital Control System. DCS refers to larger analog control systems like Fisher, Foxboro, Honeywell, and Bailey systems. DCS's were traditionally used for PID control in the process industries, whereas PLC's were used for discrete or logic processing. However, PLC's are gaining capability and acceptance in doing PID control. Most utilities, refineries and larger chemical plants use DCS's. These systems cost from 20 thousand to millions of dollars. DCS systems by: ABB ( ), Bailey, Foxboro ( ), Fisher, Moore, Honeywell, Yokogawa, etc. 19 The company website for Expertune Inc. has tutorials and sells PID tuners for PLC’s and for DCS’s. The definition of a DCS is shown on the slide and some of the makers of these large scale DCS systems are shown on the slide from the Expertune website. Two of the websites for companies making the DCS systems are also shown. Note that ABB is not Allen-Bradley, but a huge conglomerate that I had not heard of before. Transition: Next is a look at a tuning system for PID controllers using MATLAB.

20 Matlab PID Tuning-1 http://www.mathworks.com/ 20
Matlab stands for Mathematics laboratory and is an industry standard for control system software. At the top of this slide is an example of 3rd party software, from Finland, that uses Matlab for tuning PID loops. At the bottom of the slide is another example of 3rd party software, from Belgium, that works with Matlab for tuning of PID loops. If you work in any area of control, you will frequently hear the PID term and you should have some knowledge of how PID tuning is done. This slide is designed to show you that there is a great deal of software available to help with PID tuning, at a cost, and that it is widely used throughout the world for tuning control loops. Transition: Next is a slide summarizing what was covered in this presentation.

21 Summary Introduction Proportional Control PI Control PID Control
Equation Example PI Control Numerical Integration PID Control Web Simulation Numerical Differentiation A 3-mode opamp controller Industrial PID tuning This presentation introduced proportional control with equations and an example and then discussed the PI equation and numerical integration with an example. PID control was covered, using a web simulation, equations, a discussion of how to perform numerical differentiation, and an example of an opamp 3-mode controller. Some companies that provide PID tuning products were also discussed. Transition: So long until the next presentation.


Download ppt "Proportional Integral Differential (PID) Control"

Similar presentations


Ads by Google