user guide - pid

22
P + I + D - Simulator [email protected] Copyright RJS 2016

Upload: richard-smith

Post on 11-Feb-2017

84 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: User Guide - PID

P + I + D - Simulator

[email protected] RJS 2016

Page 2: User Guide - PID

Contents

1 Introduction 1

2 Acknowledgments 1

3 Main window layout 23.1 Chart display panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33.2 Controller Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43.3 Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53.4 Program modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Other windows 114.1 About . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114.2 Save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114.3 Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

5 Operating the simulator 135.1 Setpoint in manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135.2 Setpoint in Program mode (P1, P2, P3, P4 or P5) . . . . . . . . . . . . . . . . . . . . . . 13

6 Understanding PID controllers 146.1 Controller Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146.2 Proportional Control (P) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146.3 Proportional Band . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156.4 Integral Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166.5 Derivative Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176.6 Proportional plus Integral (P + I) Controller . . . . . . . . . . . . . . . . . . . . . . . . . 176.7 Proportional plus Integral plus Derivative Control (P + I + D) . . . . . . . . . . . . . . . 186.8 Adaptive Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196.9 Control System Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196.10 Control System Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Page 3: User Guide - PID

1 Introduction

The PID control simulation program has been written to assist in the understanding of Proportional -Integral - Derivative (PID) controllers by power station staff. It can be used in conjunction with thefollowing training modules or as a standalone teaching application.

PID training modules

• Automatic Controls Principles

• Automatic Control Basics - NZED modules

No warranty or support is provided for this application so use at your own risk.

However if you wish to provide constructive criticism or propose improvements I can be contacted [email protected]

2 Acknowledgments

I would like to acknowledge Roger Meier’s DataPlotClasses for Xojo, without which this applicationwould have been so much harder to construct and may never have been completed. For plotting data inXojo applications it is the most full featured and easiest to use that I have come across. Many thanksRoger.

1

Page 4: User Guide - PID

3 Main window layout

The main window displayed when opening the PID Control Simulator application is shown below. Itconsists of the following areas;

(A) Chart display panel

(B) Controller Output panel

(C) Settings panel

(D) Program modes panel

A C

B D

Figure 1: Window display when application is first opened

2

Page 5: User Guide - PID

3.1 Chart display panel

Figure 2: Main window display

The chart display panel occupies the top half of the main window and displays the following 3 trends;

• Output - PID controller output.

• SP (Setpoint) - the target setpoint to which the PID controller will aim.

• PV (Process value) - The actual process reading as a result of taking into account the controlleroutput.

3

Page 6: User Guide - PID

3.2 Controller Output

A

B

C

D

Figure 3: Controller Output panel

(A) Start button - used to start the simulation running or re-start after the simulation has been paused.

(B) Stop button - used to pause/stop the simulation running. This will not reset the simulation.

(C) Reset button - will reset the simulation to its original state, however will not adjust any settings inthe Settings panel.

(D) Save button - once the simulation has run and is subsequently paused the data will be available tobe saved using the CSV file format.

Figure 4: Controller Output panel detail

Additionally the following readings from the in-ternal PID process are available in this panel;

• Proportional component of output

• Integral component of output

• Derivative component of output

• Error between SP and PV

• Output signal to process (Valve or damper,etc)

4

Page 7: User Guide - PID

3.3 Settings

A

B

C

D

E

F

Figure 5: Settings panel

(A) Setpoint (SP) - can be adjusted manually if Manual Setpoint Control is selected in the Programmodes panel or automatically if one of the preset program modes (P1 - P5) are selected.

(B) Gain - sets the proportional response of the PID controller.

(C) Integral - sets the integral response of the PID controller.

(D) Derivative - sets the derivative response of the PID controller.

(E) Clip output - limits controller output to the range 0 - 100%

(F) Limit ramp - used in conjunction with the adjacent dropdown menu to select an output ramp ratelimit so as to more realistically model the response of a real world process such as a control valveand/or damper.

5

Page 8: User Guide - PID

Figure 6: Options for limiting ramp rate

If the Limit ramp checkbox is ticked then the fol-lowing output ramp rates can be selected from thedropdown menu;

• 5%/sec

• 10%/sec

• 20%/sec

• 30%/sec

• 40%/sec

• 60%/sec

• 80%/sec

• 100%/sec

• 200%/sec

• 500%/sec

• Unlimited

6

Page 9: User Guide - PID

3.4 Program modes

A

B

C

Figure 7: Program mode panel

(A) Manual setpoint control - process setpoint (SP) can be adjusted using the setpoint slider in thesettings panel.

(B) P1 - P5 programmed modes - will automatically control the setpoint slider to follow various pre-programmed routines.

Figure 8: Program mode panel detail

• P1 Calibration (25%) - setpoint steps of25% from 0 to 100 and back. See fig 9below.

• P2 Calibration (50%) - setpoint steps of50% from 0 to 100 and back. See fig 10below.

• P3 Calibration (100%) - setpoint stepsof 100% from 0 to 100 and back. See fig11 below.

• P4 Calibration (fast) - setpoint steps of25% from 0 to 100 and back at a fasterrate. See fig 12 below.

• P5 Random process - setpoint to 50%initially then released to follow a randomvalue. See fig 13 below.

(C) Noise slider - adjustment of output noise levels so as to more closely follow real world processes.

7

Page 10: User Guide - PID

Figure 9: P1 - Calibration (25%)

Figure 10: P2 - Calibration (50%)

8

Page 11: User Guide - PID

Figure 11: P3 - Calibration (100%)

Figure 12: P4 - Calibration (fast)

9

Page 12: User Guide - PID

Figure 13: P5 - Random

Figure 14: Effect of Noise slider on controller output. Can be adjusted from minor to very annoying.

10

Page 13: User Guide - PID

4 Other windows

4.1 About

Figure 15: About window

The About window shows the current version of this application.

4.2 Save

Figure 16: Save CSV file window

Trend data (Output, Setpoint and PV) can be saved to disc in the CSV format ready to be imported inExcel or similar applications.

11

Page 14: User Guide - PID

4.3 Print

Figure 17: Print chart display panel

Figure 18: Printer settings dialog

It is possible to make a printout of the chart display panel using the menu’s at the top of the screen.This will first open the print figure dialog where resolution can be selected and then the standard OSXprint dialog box.

12

Page 15: User Guide - PID

5 Operating the simulator

5.1 Setpoint in manual

In this operational mode the setpoint slider is controlled manually and can be changed to any valuebetween 0 and 100%. The controlled variables (Settings panel) can be either changed before starting thesimulation or during operation.

The controller can be operated either in pure P, P + I or P + I + D controller modes;

• If you just require proportional response to changes in setpoint then the slider for integral andderivative (Settings panel) should be set to zero. Slider for gain should be set to some value > 0to allow some control response.

• If you require proportional and integral response to changes in setpoint then the slider for derivative(Settings panel) should be set to zero. Sliders for gain and integral should be set to some values> 0 to allow the controller to respond in P + I mode.

• If you require full proportional, integral and derivative response to changes in setpoint then allthree sliders (gain, integral and derivative) should be set to some value > 0 to allow the controllerto respond in P + I + D mode.

Additionally if you require the output to behave as a real world model (such as a valve or damper) thenthe output can be limited to 0 to 100% range by selecting the Clip output checkbox.

Also to better mimic real world processes it is possible to limit output ramp rates (such as slow re-sponse to an electric control valves vs a pneumatic one) using the Limit ramp checkbox and associateddropdown menu.

Finally the simulation of noise into the process can be accomplished using the Noise slider situatedin the Program modes panel. This can be changed from zero noise up to a rather annoying level of noise.

5.2 Setpoint in Program mode (P1, P2, P3, P4 or P5)

In this operational mode the setpoint slider is controlled automatically by the selected program mode.The other controller variables however are still under manual control and can be adjusted as above toadjust the gain, integral and derivative response of the controller.

Note: selected program will repeat over at its conclusion.

13

Page 16: User Guide - PID

6 Understanding PID controllers

6.1 Controller Actions

The requirements of a controller are determined by the nature of the process that is to be controlled. Allpractical processes involve mechanical components and/or fluids which have inertia, thermal lags, timedelays, and a dead band, and therefore will not respond instantly to any signal from the controller.

The controller must be built to allow and compensate for the practical properties and limitations, toachieve the optimum performance of the whole system. The response of a controller to a deviation istermed the ”controller action,” and is any one of a combination of the following control actions:

(i) Proportional

(ii) Integral

(iii) Derivative

(iv) Adaptive

6.2 Proportional Control (P)

Proportional control is the most basic type of feedback control, and is so-named because the controlleraction is proportional to the deviation.

The tank level control, illustrated in Figure 19, is an example of proportional control.

Figure 19:

Referring to Figure 19, the desired value is half a glass and the float operated valve opens or closes inproportion to how far the water level is above or below the desired value. If the outlet flow changes thecontroller (float/valve) will change the inlet flow to match the new outlet flow and the water level willsettle above or below the desired value, e.g. if the outlet flow increases, the water level in the tank willfall, lowering the float. This will open the valve allowing a greater water flow into the tank. When theinlet flow balances the outlet flow the float will settle again but at a level below the original level. Thedifference between the new level and the original (desired) level is called the offset (sustained deviation).This is an important feature of proportional control, i.e. it only ”arrests” the deviation and will notrestore the controlled condition to the desired value.

14

Page 17: User Guide - PID

The important facts to be drawn from this example are;

(a) A proportional control system can be set up to hold a zero deviation between set point and measuredvalue for one set of plant conditions.

(b) If the plant conditions change from those in (a) there must be a deviation between the set pointand the measured value producing the necessary deviation which changes the controller action tosuit the new plant conditions.

(c) The level adjuster must be adjusted manually to restore the measured value to the desired value forthe new plant conditions.

6.3 Proportional Band

The proportional band is the range of the controlled condition which causes the controller action tooperate through its full travel, e.g. if the float, on the water tank illustrated in Figure 19 has a shortoperating arm, only a small change in tank level will cause the valve to move between fully open andfully closed. If the operating arm is longer, a larger change in tank level is required to move the valvebetween open and closed.

The span of the water level (controlled condition) which moves the float and hence the valve fromfully open to fully closed, is called the proportional band. Figure 20 graphically shows proportionalcontrol action when there is a step change in the load, on a tank level controller.

Figure 20:

15

Page 18: User Guide - PID

6.4 Integral Controller

As previously discussed, proportional controllers produce an output directly proportional to the devi-ation. By contrast, an integral controller produces an output which changes at a rate proportional tothe deviation. The output remains static whenever the deviation becomes zero. In this way an integralcontroller is able to adjust its output to suit a variety of plant conditions and still achieve a zero deviation.

If an integral controller is used in place of the proportional controller shown in Figure 20, the responseto the step change in load would be as shown in Figure 21.

Figure 21:

An integral controller is often referred to as a reset controller because it resets the controller output tomaintain the chosen set point.

The amount of integral action that can be used in a control system is determined by considerationsof system stability.

The speed of travel of control devices and other system components is a limiting factor, e.g. thereis no advantage in increasing the controller output by say 10% of range per sec, when the associatedcontrol valve takes 10 sec. to travel 10% of its stroke.

Quantification of action of an integral controller is discussed in a following paragraph on proportionalplus integral controller as integral controllers are almost always combined with proportional controllers.

16

Page 19: User Guide - PID

6.5 Derivative Controller

Another basic type of controller is the derivative controller, so called because the controller output is thederivative of the deviation, i.e. the output is proportional to the rate of change of the error signal.

Used in a control system by itself a derivative controller has little practical use because it does notrecognise a set point, but simply resists change. It is generally used, in conjunction with a proportionalor a proportional plus integral controller, as an anticipatory device for systems with high inertia, i.e.long response time.

Properly adjusted the derivative controller provides fast correcting when the measured value beginsto move from the set point, whereas the proportional controller provides correcting action as the mea-sured value changes, and the integral controller provides corrective action after the measured value haschanged.

6.6 Proportional plus Integral (P + I) Controller

The combination of proportional and integral control offers the advantages of both actions without theirdisadvantages, i.e.

(a) Integral action gives zero error despite changes in the process which could not be fully compensatedby proportional control.

(b) Proportional control gives immediate control action in direct proportion to the deviation, whereasintegral action takes time to give adequate correction to large changes.

A large proportion of controllers used on power stations are of the proportional plus integral type whetherthey be electronic or pneumatic. The positioners used on valve and damper actuators are usually a pro-portional plus integral controller. In this case the control signal to the positioner is the set point signaland the feedback linkage from the valve or damper is the measured value transducer.

The integral action of a P + I controller is usually quantified in terms of the proportional action ofthe controller. See Figure 22

17

Page 20: User Guide - PID

6.7 Proportional plus Integral plus Derivative Control (P + I + D)

PID (P+I+D) control offers the advantages of P+I control with the added feature of anticipating adeviation of the measured value from the set point by measuring the rate of change of the error signal.

PID control is most useful in processes which have a large inertia (mechanical or thermal) and a com-paratively small control force. Derivative action gives corrective action as soon as the process begins tomove from the setpoint. See Figure 23.

Figure 22:

Figure 23:

18

Page 21: User Guide - PID

6.8 Adaptive Control

Adaptive control and adaptive controllers use a completely different approach to determine controlstrategy. These controllers which are based on microcomputer technology use computer type memory tostore historical data about the process, and real time mathematical algorithms to ”learn” the system.The adaptive controller then gives a control response which is based on its knowledge of how the systembehaved in the past. The algorithms used in this sort of controller are usually proprietary.

6.9 Control System Tuning

Determining the correct settings for the controller is critical to achieving satisfactory performance of theplant. Although it is convenient to think of the plant and the controller as being two separate aspectsof the control system, when it comes to tuning the control loop, the controller and the plant are one,and must be tuned as one. A number of techniques are available to assist in control loop tuning. Theseinclude:-

(a) ManualMost loops can be tuned by a combination of intuition and experiment. This involves tweaking thegain and integral settings until a satisfactory response is achieved for a range of operation modesand transients.

(b) AnalyticalA number of plant parameters must be determined, either by analysis, or by performing testson the plant. The controller settings can then be calculated from the plant parameters. Thistechnique is limited because the number of parameters is too small to accurately represent the sys-tem. However, analytical techniques are often used to determine a starting point for manual tuning.

Some of the newer microprocessor based, analogue loop controllers have built in algorithms fordetermining controller settings. In a setup mode, these controllers are able to inject a known testsignal into the control loop and then determine the best controller settings based on the responseto the test signal.

(c) Simulation.In recent times it has become feasible to model a system on a computer. Once modelled, it ispossible to try any number of controller settings until optimal settings are found. The accuracy ofthe results from simulation are governed by the accuracy of the simulation. This technique becomesvery expensive for all but the most simple of control loops.

6.10 Control System Performance

The criteria for judging the performance of a control system:

(a) Accuracy Unless there are stability problems, a controller incorpo rating integral control actionshould be capable of maintalning the measured value within a few percent of the set point.

(b) Speed of Response The speed of the response to a process or set point change is governed by therate at which the process itself can be changed. Attempts by the controller to hasten the responsewill probably lead to overshoot, while insufficient control action can give a slow and unsatisfactoryresponse. See Figure 24.

19

Page 22: User Guide - PID

Figure 24:

(c) Stability Incorrect controller action can cause instability in the control system to the extent thatthe system will oscillate by itself without any external oscillating forces. Such instability is usuallytermed hunting, and is often blamed on one component of a system. This can be the case, especiallyif some item is worn, has sloppy linkages, etc. Instability can also be a characteristic of the wholesystem, which can be cured by tuning the controller to match the process.

20