The text of a manual · part 13 of 38
DL06 Micro PLC User Manual, Volume 2 of 2, pages 120 to 129
Pages 120 to 129 of 370
The original document is the PDF (6.0 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Page 120
Chapter 8: PID Loop Operation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–44
Alternative Manual Tuning Procedures by Others The following tuning procedures have been extracted from various publications about PID process control. These procedures are for comparison to the procedure in this manual.
Tuning PID Controllers Two-Mode Simple Method - – for P-I controllers 1. Turn off reset and set the gain to a small value (0.5 - 1.0). 2. Increase gain until cycling starts, then decrease gain slightly. 3. Make setpoint changes to observe offset (error). 4. Increase reset to eliminate offset (error). 5. Repeat steps 2 through 4 until you obtain the largest gain and reset consistent with the criteria of the control desired, i.e., offset, overshoot, stability. Zeigler-Nichols Method– “Quarter amplitude decay” 1. Turn off reset and rate; set the proportional gain to a fairly large value. 2. Make a small setpoint change and observe how the controlled variable cycles. 3. Adjust the gain until the cycle is self-sustaining, and of constant amplitude; this value is the ultimate gain (Gu). 4. Measure the period of cycling in minutes. This is the ultimate period (Pu). 5. Calculate the controller adjustments as follows: P only: G = Gu/2 P & I : G = Gu/2.2 Ti = 1.2/Pu (repeats/minute) P-I-D: G = Gu/1.6 Ti = 2.0/Pu (repeats/minute) Td = Pu/8.0 (minutes) Pessen Method 1. Follow the procedure described above (Zeigler-Nichols) to determine the ultimate gain and ultimate period. 2. Apply the formulas below. For no overshoot during startup: G = Gu/5.0 Ti = 3/Pu (repeats/minute) Td = Pu/2 (minutes) For some overshoot, but better response to disturbances: G = Gu/3 Ti = 3/Pu (repeats/minute) Td = Pu/3 (minutes)
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 121
Chapter 8: PID Loop Operation
Auto Tuning Procedure
1 2 3 WARNING: Only authorized personnel fully familiar with all aspects of the process should make changes that affect the loop tuning constants. Using the loop auto tuning procedures will affect the process, including inducing large changes in the control output value. Make sure you thoroughly 4 consider the impact of any changes to minimize the risk of injury to personnel or damage to equipment. The auto tune in the DL06 is not intended to be used as a replacement for your process 5 knowledge. Once the physical loop components are connected to the PLC, auto tuning can be initiated 6 within DirectSOFT 5 (see the DirectSOFT 5 Programming Software Manual), and it can be used to establish initial PID parameter values. Auto tuning is the best “guess” the CPU can do 7 after some trial tests. The loop controller offers both closed-loop and open-loop methods. The following sections 8 describe how to use the auto tuning feature, and what occurs in open and closed-loop auto tuning. The controls for the auto tuning function use three bits in the PID Mode 2 word V+01, as 9 shown below. DirectSOFT 5 will manipulate these bits automatically when you use the auto tune feature within DirectSOFT 5. Or, you may have your ladder logic access these bits 10 directly for allowing control from another source such as a dedicated operator interface. The individual control bits allow you to start the auto tune procedure, select PID or PI tuning and select closed-loop or open-loop tuning. If you select PI tuning, the auto tune procedure leaves 11 the derivative gain at 0. The Loop Mode and Alarm Status word V+06 reports the auto tune status as shown. Bit 12 will be on (1) during the auto tune cycle, automatically returning to 12 off (0) when done. 13 14 A B C D The auto tuning feature for the DL06 loop controller will only run once each time it is enabled in the PID table. Therefore, auto tuning does not run continuously during operation (this would be adaptive control). Whenever there is a substantial change in loop dynamics, such as mass of process, size of actuator, etc., the tuning process will need to be repeated in order to derive new gains required for optimal control.
Auto T une Function
Auto T uning Controls
Start Auto T une (0 to 1 transition)
Auto Tune Active
0=PID tuning, 1=open PI tuning
Auto Tune Error
0=closed loop, 1=open loop
PID Mode 2 Setting V+01
Auto T uning Status
Loop Mode and Alarm Status V+06
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DL06 Micro PLC User Manual, 3rd Edition Rev. A
8–45
Page 122
Chapter 8: PID Loop Operation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Open-Loop Auto Tuning During an open-loop auto tuning cycle, the loop controller operates as shown in the diagram below. Before starting this procedure, place the loop in Manual Mode and ensure the PV and control output values are in the middle of their ranges (away from the end points). PLC System Process Variable Response
Step Function Open Loop Auto Tuning
Setpoint Value +
Error Term
Manufacturing Process
–
Process Variable
NOTE: In theory, the SP value does not matter in this case, because the loop is not closed. However, the requirement of the firmware is that the SP value must be more than 5% of the PV range from the actual PV before starting the auto tune cycle (for the DL06, 12 bit PV should be 205 counts or more below the SP for forward-acting loops, or 205 counts or more above the SP for reverse-acting loops).
When auto tuning, the loop controller induces a step change on the output and simply observes the response of the PV. From the PV response, the auto tune function calculates the gains and the sample time. It automatically places the results in the corresponding registers in the loop table. The following timing diagram shows the events which occur in the open-loop auto tuning cycle. The auto tune function takes control of the control output and induces a 10%-of-span step change. If the PV change which the loop controller observes is less than 2%, then the step change on the output is increased to 20%-of-span. * When Auto Tune starts, step change output m=10% * During Auto Tune, the controller output reached the full scale positive limit. Auto Tune stopped and the Auto Tune Error bit in the Alarm word bit turned on. * When PV change is under 2%, output is changed at 20%. Open Loop Auto Tune Cycle Wave: Step Response Method PV (%) SP
Tangent
Rr = Slope
Process Wave Base Line LrRr (%)
Lr (sec.) Time (sec) Step Change m=10%
Output Value (%)
PID Cycle
Auto Tune Cycle PID Cycle Auto Tune Start
8–46
Control Output
Loop Calculation
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Auto Tune End
Page 123
Chapter 8: PID Loop Operation When the loop tuning observations are complete, the loop controller computes Rr (maximum slope in %/sec.) and Lr (dead time in sec). The auto tune function computes the gains according to the Zeigler-Nichols equations, shown below:
1 PID Tuning PI Tuning 2 3 4 We highly recommend using DirectSOFT 5 for the auto tuning interface. The duration of 5 each auto tuning cycle will depend on the mass of the process. A slowly-changing PV will result in a longer auto tune cycle time. When the auto tuning is complete, the proportional, integral, and derivative gain values are automatically updated in loop table locations V+10, 6 V+11, and V+12 respectively. The sample time in V+07 is also updated automatically. You can test the validity of the values the auto tuning procedure yields by measuring the closed7 loop response of the PV to a step change in the output. The instructions on how to do this are in the section on the manual tuning procedure (located prior to this auto tuning section). 8 Closed-Loop Auto Tuning During a closed-loop auto tuning cycle the loop controller operates as shown in the diagram 9 below. 10 11 12
13 14 When auto tuning, the loop controller imposes a square wave on the output. Each transition of the output occurs when the PV value crosses over/under the SP value. Therefore, the frequency of the limit cycle is roughly proportional to the mass of the process. From the PV A response, the auto tune function calculates the gains and the sample time. It automatically places the results in the corresponding registers in the loop table. B C D P=1.2*m/LrRr P=0.9*m/LrRr I=2.0* Lr I=3.33* Lr D=0.5* Lr D=0 Sample Rate = 0.056* Lr Sample Rate = 0.12*Lr m = Output step change (10% = 0.1, 20% = 0.2)
PLC System
Process V ariable
Response
Limit cycle wave
Closed Loop Auto T uning
Setpoint V alue
Error T erm
+
Loop Calculation
Control Output
Manufacturing Process
–
Process Variable
DL06 Micro PLC User Manual, 3rd Edition Rev. A
8–47
Page 124
Chapter 8: PID Loop Operation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–48
The following timing diagram shows the events which occur in the closed-loop auto tuning cycle. The auto tune function examines the direction of the offset of the PV from the SP. The auto tune function then takes control of the control output and induces a full-span step change in the opposite direction. Each time the sign of the error (SP – PV) changes, the output changes full-span in the opposite direction. This proceeds through three full cycles. Xo Process Wave
SP PV
Output Value M
To PID Cycle
PID Cycle
Auto Tune Cycle Auto Tune Start
Auto Tune End
Calculation of PID parameter
Mmax = Output Value upper limit setting. Mmin = Output Value lower limit setting. This example is direct–acting. When set to reverse–acting, the output will be inverted. When the loop tuning observations are complete, the loop controller computes To (bump period) and Xo (amplitude of the PV). Then it uses these values to compute Kpc (sensitive limit) and Tpc (period limit). From these values, the loop controller auto tune function computes the PID gains and the sample rate according to the Zeigler-Nichols equations shown below: Kpc = 4M / ( *Xo) Tpc = 0 M = Amplitude of output
PID Tuning P = 0.45*Kpc I = 0.60*Tpc D = 0.10*Tpc Sample Rate = 0.014*Tpc
PI Tuning P = 0.30*Kpc I = 1.00*Tpc D=0 Sample Rate = 0.03*Tpc
Auto tuning error In open-loop tuning, if the auto tune error bit (bit 13 of loop Mode/Alarm status word V+06) is on, please verify the PV and SP values are within 5% of full scale difference, as required by the auto tune function. NOTE: If your PV fluctuates rapidly, you probably need to use the built-in analog filter (see page 8–55) or create a filter in ladder logic (see example on page 8–56).
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 125
Chapter 8: PID Loop Operation
Use Direct SOFT 5 Data View with PID View The Data View window is a very useful tool which can be used to help tune your PID loop. You can compare the variables in the PID View with the actual values in the V-memory location with Data View.
Open a New Data View Window A new Data View window can be opened in any one of three ways; the menu bar Debug > Data View > New, the keyboard shortcut Ctrl + Shift + F3 or the Data button on the Status toolbar. By default, the Data View window is assigned Data1 as the default name. This name can be changed for the current view using the Options dialog. The following diagram is an example of a newly opened Data View. The window will open next to the Ladder View by default.
The Data View window can be used just as it is shown above for troubleshooting your PID logic, and it can be most useful when tuning the PID loop.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
8–49
Page 126
Chapter 8: PID Loop Operation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–50
Open PID View The PID View can only be opened after a loop has been setup in your ladder program. PID View is opened by selecting it from the View submenu on the Menu bar, View > PID View. The PID View can also be opened by clicking on the PID View button from the PLC Setup toolbar if it is in view.
The PID View will open and appear over the Ladder View which can be brought into view by clicking on it’s tab. When using the Data View and the PID View together, each view can be sized for better use as shown on the facing page.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 127
Chapter 8: PID Loop Operation
The two views are now ready to be used to tune your loop. You will be able to see where the PID values have been set and see the process that it is controlling.
1 2 3 4 5 6 7 8 The diagram below illustrates how the to use the views to see the current SP, PV and Output values, along with the other PID addresses. Refer to the Loop Table Definitions page 8-20 for 9 details of each word in the table. This is also a good data type reference for each word in the table. 10 11 12 13 14 A B C D Scale the time axis of the viewing window by using this input box.
The trend can be cleared and restarted from the left at anytime.
Process Variable and Setpoint trends are color coded.
The loop name area turns red whenever there is an overflow error.
P I
D
DL06 Micro PLC User Manual, 3rd Edition Rev. A
8–51
Page 128
Chapter 8: PID Loop Operation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–52
With both windows positioned in this manner, you are able to see where the PID values have been set and see the process that it is controlling. In the diagram below, you can see the current SP, PV and Output values, along with the other PID addresses. Refer to the Loop Table Word Definitions (page 8-20) for details for each word in the table. This is also a good data type reference for each word in the table.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 129
Chapter 8: PID Loop Operation
Using the Special PID Features
1 2 How to Change Loop Modes The first three bits of the PID Mode 1 word (V+00) request 3 the operating mode of the corresponding loop. Note: these bits are mode change requests, not commands (certain conditions can prohibit a particular mode change – see next 4 page). The normal state of these mode request bits is “000”. To request a mode change, you must 5 SET the corresponding bit to a “1”, using a one-shot. The PID loop controller automatically resets the bits back to “000” after it reads the mode change request. Methods of requesting 6 mode changes are: • DirectSOFT 5’s PID View – this is the easiest method. Use the pull-down menu, or click on one of the radio buttons if using older DirectSOFT versions, and the appropriate bit will get set. 7 • Ladder program– ladder logic can request any loop mode when the PLC is in Run Mode. This will be necessary after application startup if mode changes are part of the application. 8 Use the program shown to the right to SET the mode bit (do not Go to Auto Mode use an OUT coil). On a 0–1 transition of X0, the rung sets the 9 Auto bit equal to 1. The loop controller resets it. • Operator panel – interface the operator’s panel to ladder logic using standard methods, then use the logic to the right to set the 10 mode bit. Since mode changes can only be requested, the PID loop controller will decide when to permit 11 mode changes and provide the loop mode status. It reports the current mode on bits 0, 1, and 2 of the Loop Mode/Alarm Status word, location V+06 in the loop table. The parallel 12 request/monitoring functions are shown in the figure below. The figure also shows the two possible mode-dependent SP sources, and the two possible Control Output sources. 13 14
A B C D It’s a good idea to understand the special features of the DL06 and how to use them. You may want to incorporate some of these features for your PID. PID Mode 1 Setting V+00
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Cascade Manual Automatic
X0
Control Output from another loop
Input from Operator
B2000.1 SET
Manual
Cascade
Control Output
Setpoint
Error T erm
+
Normal Source
Loop Calculation
–
Auto/Manual
Auto/Cascade
Process Variable Mode Select
PID Mode Control
PID Mode 1 Setting V+00
Bit 15 14 13 12 11 10 9 8
Mode Request
7
6 5
4
Loop Mode and Alarm Status V+06
3
2 1
0
Bit 15 14 13 12 11 10 9 8
7
6 5
4
3
2 1
0
Mode Monitoring
Cascade
Manual Automatic
Cascade
Manual Automatic
DL06 Micro PLC User Manual, 3rd Edition Rev. A
8–53