Home
Chapter 8 - AutomationDirect
Contents
1. default G DirectSOFT 5 Programming pid Ladder View lej x File Edt Search View Toos PLC Debug Window Help 1 EDIT d B NP umida Rea PET BY m ot COE KCN Saree Hel bre t e d PAEA E M x E Ladder View de M x E z SP read from operator interface then converted to BIF Mone ear oni rm Element Sew Eds 74 mi de Ej T 6 LA 1 on SP from DIP I SPI 4 3 0 2600 F2 ra M 4 BIN F3 5 5 Ar 7 pur F2 8 Setpoint sek V3002 F3 3 hol PY from a 4 20mA analog input then converteredtof 4r SFZ alt LD 1H ite On PV from 4 20mA sa 13 8P1 14 4 1 f 2500 15 B BIN 44 16 17 hal UT LE xj Process Variable 2 For Heb press Fl v3003 zs For Help press F1 lfine 00029707680 06 0004 003 001 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 DLO06 Micro PLC User Manual 3rd Edition Rev C 8 49 Chapter 8 PID Loop Operation 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 gt PID View rae The PID View can also be opened by clicking on the PID View button from the PLC Setup toolbar if it is in view
2. Bit 15 14131211109 87 65 4 321 0 conditions can prohibit a particular mode change see next i N Cascade Manual page Automatic The normal state of these mode request bits is 000 To request a mode change you must 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 mode changes are DirectSOFT 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 be necessary after application startup if mode changes are part of the application Ladder program ladder logic can request any loop mode when the PLC is in Run Mode This will 8 Use the program shown to the right to SET the mode bit do not use an OUT coil On a 0 1 transition of X0 the rung sets the Go to Auto Mode Auto bit equal to 1 The loop controller resets it d XO B2000 1 J SET Operator panel interface the operators panel to ladder logic using standard methods then use the logic to the right to set the mode bit Since mode changes can only be requested the PID loop controller will decide when to permit 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
3. ii DirectSOFT 5 Programming pid Ladder View BBE Eje Edt Search View Took PLC Debug Window Heb z 4 v LadderView Cul a g Gl ey El 9 ME v EAE Bele ERAT uy bui Mnemonic View Status Cross Reference View z x 7 T NN ti Oo MODE H jo pm aie SP read fom operator interface hen converted to I P Ele v Staus Bar Edis 4 5 ds jj E 4 On SP from DIP IT2 E Options P1 4E Qd Themes 0 r4 v2600 Fe wal R Color Setup F nl a BIN F3 E di Zoomln 6 aij Zoom Out du Fr LI pur F2 EA Setpoint F Le y3002 F3 3 T PV from a 4 20mA analog input then converteredtot 4r Shr2 ii ne o ji 12 pn PV from 4 20mA swa 13 SP 14 4c t 2500 TF 15 Mey BIN 44 16 1 17 fial our Lr I E l Process Variable 2 For Help press Ft v3003 mz s Changes to this view type OK OnineDSCEL 06 RENEHUHEEEN 00029707680 06 0004003001 The PID View will open and appear over the Ladder View which can be brought into view by clicking on its 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 EZ DirectSOFT 5 Programming pid PID View Fle Edt Search View Too PLC Debug Window Heb 8x Pal T3 EDIT aZ time Rp ue gt E i ki du Oe A MODE Noe ca E A E e 4E d b E Help 2 fer 3 zalege Pb B xf Lae vi
4. Bit 1514131211109 8 76543210 Bit 1514131211109 8 76543210 DL06 Micro PLC User Manual 3rd Edition Rev C 8 45 Chapter 8 PID Loop Operation EEE 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 Control Setpoint Value Y Error Term Loop Output Manufacturing Calculation Process Process Variable zl 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 DLO6 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 diagra
5. Alarm Programming Error The PV Alarm threshold values must have certain mathematical relationships to be valid The requirements are listed below If not met the Alarm Programming Error bit will be set as indicated to the right PID Mode and Alarm Status V 06 Bit 15 14 131211109 8 7 65 4 3 21 0 t Alarm Programming Error PV Absolute Alarm value requirements Low low Low High High high PV Deviation Alarm requirements Yellow Red Loop Calculation Overflow Underflow Error This error occurs whenever the output reaches its a PID Mode and Alarm Status V 06 upper or lower limit and the PV does not reach the setpoint A typical example might be when a rere eran ee a ee 3 803 300 valve is stuck the output is at its limit but the PV has not reached setpoint Loop Calculation Overflow Underflow Error see the automationdirect com website can also be setup to read these error bits using the PID NOTE Overflow underflow can be alarmed in PID View The optional C more operator interface panel Faceplate templates 8 38 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation E Ramp Soak R S Ramp Soak is the last dialog available in the PID setup The basic PID does not require any entries to be made in order to operate the PID loop Ramp Soak will be disc
6. rog 0 1 2 3 4 15 6 T 8 9 N ce N N N N 99 N A N 1 DS c N u hel oco N co wo ce wo hart wo N Read data only when alarm enable bit transitions from 0 to 1 Read data only on PLC Mode change Read on the fly means that the content of V memory can be changed while the PID loop is in operation 8 20 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation PID Mode Setting 1 Bit Descriptions Addr 00 The individual bit definitions of the PID Mode Setting 1 word Addr 00 are listed in the following table PID Mode Setting 1 Description Read Write Bit 1 Manual Mode Loop Operation request write 01 request Automatic Mode Loop Operation request write 01 request Cascade Mode Loop Operation request write 01 request Bumpless Transfer select write Mode Mode II Direct or Reverse Acting Loop select write Direct Reverse Position Velocity Algorithm select write Position Velocity PV Linear Square Root Extract select write Linear Sq root Error Term Linear Squared select write Linear Squared Error Deadband enable write Disable Enable Derivative Gain Limit select write Off On Bias Integrator Freeze select write Off On Ramp Soak Operation select write Off On PV Alarm Monitor select write Off On PV Deviation alarm select write Off On PV rate of change alarm select write Off On
7. Loop with CPU Loop Independent mode of CPU mode o3 0 1 2 3 4 5 6 7 8 Loop mode is independent from CPU mode when set write DL06 Micro PLC User Manual 3rd Edition Rev C 8 2 1 Chapter 8 PID Loop Operation EEE PID Mode Setting 2 Bit Descriptions Addr 01 The individual bit definitions of the PID Mode Setting 2 word Addr 01 are listed in the following table PID Mode 2 Word Description Read Write Bit 0 Bit 1 Input PV and Control Output Range Unipolar Bipolar 0 select See Notes 2 and 3 write unipolar bipolar 1 Input Output Data Format select See Notes 2 and 3 write 12 bit 15 bit 2 Analog Input filter write off on 3 SP Input limit enable write disable enable 4 ntegral Gain Reset units select write seconds minutes 5 Select Auto tune PID algorithm write closed loop open loop 6 Auto tune selection write PID PI only rate 0 Auto tune start A auto tune 7 See Note 1 read write cancel done force start 8 PID Scan Clock internal use read B Input Output Data Format 16 bit select 9 See Notes 1 and 2 write not 16 bit select 16 bit Select separate data format for input and output 10 See Notes 2 and 3 write same format separate formats Control Output Range Unipolar Bipolar select 11 See Notes 2 and 3 write unipolar bipolar 12 Output Data Format select See Notes 2 a
8. 0 12 I Gain 3 00 INN Dev Alarms High 0 13 reao e 579 peafa Low o ta como CEN 5 mm 5 LL ate sec low OW LOW 15 D pras Imi Autotune I 117 Dutput Action Control Method E c 9 en C Closed Loop Limit Cycle BER xl c C Pn Ninani nnn Sten Reanna X For Help press Fi Mon Apr 10 12 58 51 2006 Value 255 OK Online DSCBL 06 l RGA 00030 07680 o6 DL06 Micro PLC User Manual 3rd Edition Rev C 8 5 Chapter 8 PID Loop Operation ee 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 8 52 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Tl Using the Special PID Features 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 How to Change Loop Modes The first three bits of the PID Mode 1 word V 00 request PID Mode 1 Setting V 00 the operating mode of the corresponding loop Note these bits are mode change requests not commands certain
9. 0 Value X Monitor Rate of Change 0 Monitor Limit Alarms Checking this box will allow all of the PV limit alarms to be monitored once the limits are entered The PV absolute value alarms are organized as two upper and two lower alarms The alarm status is false as long as the PV value remains in the region between the upper and lower alarms as shown below The alarms nearest the safe zone are named High Alarm and Low Alarm If the loop loses control the PV will cross one of these thresholds first Therefore you can program the appropriate alarm threshold values in the loop table locations shown below to the right The data format is the same as the PV and SP 12 bit or 15 bit The threshold values for these alarms should be set to give an operator an early warning if the process loses control High high Alarm Loop Table High Alarm V 16 XXXX High high Alarm T PV rtm acr e NR cssc V 15 XXXX High Alarm V 14 XXXX Low AI Low Alarm e NE lulius Low low Alarm V 13 XXXX Low low Alarm NOTE The Alarm dialog can be left as it first appears without alarm entries The alarms can then be setup in the DirectSOFT PID View DLO06 Micro PLC User Manual 3rd Edition Rev C 8 3 5 Chapter 8 PID Loop Operation If the process remains out of control for some time the PV will eventually cross one of the outer alarm thresholds named High high alarm and
10. A The derivative limit is probably enabled see section on derivative gain limiting DLO06 Micro PLC User Manual 3rd Edition Rev C 8 75 Chapter 8 PID Loop Operation EM Q The loop Setpoint appears to be changing by itself A Check the following for possible causes The Ramp Soak generator is enabled and is generating setpoints f this symptom occurs on loop Manual to Auto Mode changes the loop is in Bumpless Transfer 1 Check your ladder program to verify it is not writing to the SP location V 02 in the loop table A quick way to do this is to temporarily place an end coil at the beginning of your program then go to PLC Run Mode Q The SP and PV values I enter with DirectSOFT work okay but these values do not work properly when the ladder program writes the data A The PID View in DirectSOFT lets you enter SP PV and Bias values in decimal and displays them in decimal for your convenience For example when the data format is 12 bit unipolar the values range from 0 to 4095 However the loop table actually requires these in hex so DirectSOFT converts them for you The values in the table range from 0 to FFE for 12 bit unipolar format Q The loop seems unstable and impossible to tune no matter what gains I use A Check the following for possible causes 8 The loop sample time is set too long Refer to the section near the front of this chapter on selecting the loop update time The gains are too
11. Mx if0 lt M lt 1 Mx M Ke x e Kr PV PV otherwise By adjusting the bias the valve will begin to open as soon as the PV begins to come down If the loop is properly tuned overshoot can be eliminated entirely If the output went out of range due to a setpoint change then the loop probably will oscillate because we must wait for the bias term to stabilize again The choice of whether to use the default loop action or to freeze the bias is dependent on the application If large step changes to the setpoint are anticipated then it is probably better to select the freeze bias option see page 8 34 DL06 Micro PLC User Manual 3rd Edition Rev C 8 1 1 Chapter 8 PID Loop Operation EM Step Bias Proportional to Step Change in SP This feature reduces oscillation caused by a step change in setpoint when the adjusting bias feature is used Mx Mx SP SP ifthe loop is direct acting Mx 2Mx SP SP ifthe loop is reverse acting Mx 0 ifMx lt 0 Mx Mx if0 lt Mx lt 1 Mx 1 ifM gt 1 Eliminating Proportional Integral or Derivative Action It is not always necessary to run a full three mode PID control loop Most loops require only the PI terms or just the P term Parts of the PID equation may be eliminated by choosing appropriate values for the gain Kc reset Ti and rate Td yielding a P PI PD I and even an ID and a D loop Eliminating Integral Action The effect of integral action on the output may be elimi
12. Program cpg r Rocio T tina 4r 1 Mode Manual v High High D 12 Gain 000 m T DevAams High o de sec Bas 0 dag 13 Reset 0 00 p Pef Low o 14 Min oud Rate 0 00 sec Yellow 0 LowLow 0 16 Autotune T Output Action Control Method C FowaidActing G Pl C Closed Loon Lint Cycle Z 42H 18 aj E gt Fri Mar 10 17 25 26 2006 Value 7 oy Data error OK Online DSCBL 06 Progam 00029 07680 06 Loop Tile 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 details of each word in the table This is also a good data type reference for each word in the table Scale the time axis of the viewing window by using this input box The trend can be cleared and restarted from the left at anytim Ii DirectSOFT 5 Programming rtd example PID View 4 x File Edit Search View Tools PLC Debug window Help 8x Ry X a Process Variable and Read unite Nes Open Help Setpoint trends are color coded The loop name area turns red whenever is an overflow error there PVIIB BIAS 760 5 OUT565 6 V1400 651 7 V2102 28 Ir V2ioo m Loop Num 1 RTD test 4 Fs Settings Variables Alarms 10 X100 OFF P PLC Mode Run sple Rocio I Limit Alarms I1 Mode auo gt igh High ml ode Auto PvE HighHigh
13. Refer to the wiring guidelines in Chapter 2 of this manual and to the DO OPTIONS M manual The most common wiring errors when installing PID loop controls are Reversing the polarity of sensor or actuator wiring connections Incorrect signal ground connections between loop components Step 6 Loop Parameters After wiring and installation choose the loop setup parameters The easiest method for programming the loop tables is using DirectSOFT 5 0 or later This software provides PID Setup using dialog boxes to simplify the task Note It is important to understand the meaning of all loop parameters mentioned in this chapter before choosing values to enter Step 7 Check Open Loop Performance With the sensor and actuator wiring done and loop parameters entered we must manually and carefully check out the new control system using the Manual mode Verify that the PV value from the sensor is correct e If it is safe to do so gradually increase the control output up above 0 and see if the PV responds and moves in the correct direction Step 8 Loop Tuning If the Open Loop Test page 8 40 shows the PV reading is correct and the control output has the proper effect on the process you can follow the closed loop tuning procedure see page 8 45 In this step the loop is tuned so the PV automatically follows the SP Step 9 Run Process Cycle If the closed loop test shows the PV will follow small changes in the SP consider runni
14. The DL06 also combines the integral sum and the initial output into a single term called the bias Mx This results in the following set of equations Mx M Mx Kixe Mx M Kc x e Kr PV PV Mx The DLO06 by default will keep the normalized output M in the range of 0 0 to 1 0 This is done by clamping M to the nearer of 0 0 or 1 0 whenever the calculated output falls outside this range The DL06 also allows you to specify the minimum and maximum output limit values within the range 0 to 4095 in BCD if using 12 bit unipolar NOTE The equations and algorithms or parts of in this chapter are only for references Analysis of these equations can be found in most good text books about process control Reset Windup Protection Reset windup can occur if reset action integral term is specified and the computation of the bias term Mx is Mx Kix e Mx For example assume the output is controlling a valve and the PV remains at some value greater than the setpoint The negative error e will cause the bias term Mx to constantly decrease until the output M goes to 0 closing the valve However since the error term is still negative the bias will continue to decrease becoming ever more negative When the PV finally does come back down below the SP the valve will stay closed until the error is positive for long enough to cause the bias to become positive again This will cause the process variable to undershoot One
15. automatically reads the major loop s control output and displays it for the minor loop s SP The minor loop s normal SP location V 02 remains unchanged Now we use the loop parameter arrangement above and draw its equivalent loop diagram shown below V 02 Auto Manual Process Variable Major loop Minor Cascaded loop r 1 Loop Control Output V 05 J Cascade Coste Calculation Remote Setpoint x Loop Output _ SP Local SP Calculation QO0 L J Remember that a major loop goes to Manual Mode automatically if its minor loop is taken out of Cascade Mode 8 66 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation R e Tuning Cascaded Loops In tuning cascaded loops you will need to de couple the cascade relationship and tune the loops individually using one of the loop tuning procedures previously covered 1 If you are not using auto tuning then find the loop sample rate for the minor loop using the method discussed earlier in this chapter Then set the sample rate of the major loop slower than the minor loop by a factor of 10 Use this as a starting point 2 Tune the minor loop first Leave the major loop in Manual Mode and you will need to generate SP changes for the minor loop manually as described in the loop tuning procedure 3 Verify the minor loop gives a critically damped response to a 10 SP chang
16. have a major minor relationship and work together to ultimately control one PV Cascade Mode An operational mode of a loop in which it receives its SP from another loop s output Continuous Control Control of a process done by delivering a smooth analog signal as the control output Control Output The numerical result of a PID equation which is sent by the loop with the intention of e nulling out the current error Derivative Gain A constant that determines the magnitude of the PID derivative term in response to the current error Direct Acting Loop A loop in which the PV increases in response to a control output increase In other words the process has a positive gain Error The difference in value between the SP and PV Error SP PV Error Deadband An optional feature which makes the loop insensitive to errors when they are small You can specify the size of the deadband Error Squared An optional feature which multiplies the error by itself but retains the original algebraic sign It reduces the effect of small errors while magnifying the effect of large errors Feedforward A method of optimizing the control response of a loop when a change in setpoint or disturbance offset is known and has a quantifiable effect on the bias term Integral Gain A constant that determines the magnitude of the PID integral term in response to the current error Major Loop In cascade control it is the loop that generates a setpoint
17. here error 10 of SP range Over damped PV response SP 5096 here i PV Change the SP to the 6096 point of the range The response may take awhile but you will see that there isn t any oscillation This response is not desirable since it takes a long time to correct the error also there is a difference between the SP and the PV 60 here 1096 of SP range PV response SP 5096 T PV ncrease the Proportional gain for example to 2 0 The control output will be greater and the response time will be quicker The trend should resemble the figure below DLO06 Micro PLC User Manual 3rd Edition Rev C e 4 Chapter 8 PID Loop Operation 60 here Error 50 here SP PV Now return the Proportional gain to the stable response for example 9 7 The error SP PV should be small but not at zero Next add a small amount of Integral gain reset in order for the error to reach zero Begin by using 80 seconds adjust in minutes if necessary The error should get smaller Set the Integral gain to a lower value such as 50 for a different response If there is no response continue to decrease the reset value until the response becomes unstable See the figure below 60 here N 1096 of SP range SP 5096 here PV Under damped PV response For discussion let us say that a reset value of 35 made the
18. proportioning control for the applications that need it Let s take a moment to review how alternately turning a load on and off can control a process The diagram below shows a hot air balloon following a path across some mountains The desired path is the setpoint The balloon pilot turns the burner on and off alternately which is his control output The large mass of air in the balloon effectively averages the effect of the burner converting the bursts of heat into a continuous effect slowly changing balloon temperature and ultimately the altitude which is the process variable Time proportioning control approximates continuous control by virtue of its duty cycle the ratio of ON time to OFF time The following figure shows an example of how duty cycle approximates a continuous level when it is averaged by a large process mass HF period Desired Effect On Off onf l Control Off If we were to plot the on off times of the burner in the hot air balloon we would probably see a very similar relationship to its effect on balloon temperature and altitude 8 68 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation On Off Control Program Example The following ladder segment provides a time proportioned on off control output It converts the continuous output in V2005 to on off control usin
19. we duplicate the procedure but subtracting desired change amount instead The following figure shows the results Oven door PV Bias Closed Open Closed Feed forward by Feed forward X The step changes in the bias are the result of our two feed forward writes to the bias term We can see the PV variations are greatly reduced The same technique may be applied for changes in setpoint DL06 Micro PLC User Manual 3rd Edition Rev C 8 7 1 Chapter 8 PID Loop Operation EEE PID Example Program Program Setup for the PID Loop After setting up the PID loop or loops with DirectSOFT you will need to edit your RLL program to include the rungs needed to setup the analog I O module to be used by the PID loop s The following example program shows how an RTD module F0 04RTD and an analog combination module FO 2AD2DA 2 are used and setup for a PID loop This example assumes that the PID table for loop 1 has a beginning address of V2100 All of the analog I O modules used with the DLO6 are setup in a similar manner Refer to the DL05 DLO06 Options Manual for the setup information for the particular module that you will be using DirectSOFT Set up for a FO O4RTD located in Slot 1 to use the four inputs One input will be used for PID loop 1 The inputs will be read in binary format 0 4095 Input 1 V2000 Inp
20. 0 2 We highly recommend using DirectSOFT for the auto tuning interface The duration of 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 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 closed 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 below PLC System Process Variable N Response sl Limit cycle wave Closed Loop Auto Tuning Control Setpoint Value Error Term Loop Output Manufacturing Calculation Process Process Variable L 4 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 response the auto
21. 0 SP Deadband_Below_SP lt PV lt SP Deadband_Above_SP e P PV otherwise The error will be squared first if both Error Squared and Error Deadband is selected Derivative Gain Limiting When the coefficient of the derivative term Kr is a large value noise introduced into the PV can result in erratic loop output This problem is corrected by specifying a derivative gain limiting coefficient Kd Derivative gain limiting is a first order filter applied to the derivative term computation Y as shown below Xa Yai T e P PV 7 Ya Td Position Algorithm Ts Mx Kixe Mx M Kcxe Kr x Y Y Mx Velocity Algorithm AM Kc x e 1 Ki x e Kr Y 2 Y Ya DLO06 Micro PLC User Manual 3rd Edition Rev C 8 5 Chapter 8 PID Loop Operation EM Ten Steps to Successful Process Control Controllers such as the DLO6 PLC provide sophisticated process control features Automated control systems can be difficult to debug because a given symptom can have many possible causes We recommend a careful step by step approach to bringing new control loops online Step 1 Know the Recipe The most important is how to produce your product This knowledge is the foundation for designing an effective control system A good process recipe will do the following Identify all relevant Process Variables such as temperature pressure or flow rates etc which need precise control Plot the des
22. 1 into the V memory location for PID loop 1 PV PID loop 1 begins with V2100 LD _On BP1 RTD1 5 1 v2000 OUT Loop 1 PV V2103 Store PID loop 1 control output binary data in V memoryto Ch 1 analog output LD On SP1 Loop 1 Output 8 H I V2105 IOUT Analog Out 1 v2020 The setpoint SP value stored in V memory is converted from BCD to binary and stored to Loop 1 SP LD on Setpoint Location SP1 7 v1400 Note The value stored in V1400 must be in the same scale as the PV value or tenths of a degree in this example BIN IOUT Loop 1 SP V2102 Select PID loop 1 Manual Made Manual Mode Request Loop 1 Manual B2100 0 x0 8 i SET Select PID loop 1 Auto Mode Auto Mode Request Loop 1 Auto x B2100 1 9 irl SET 10 END 1 NOP DLO06 Micro PLC User Manual 3rd Edition Rev C 8 73 Chapter 8 PID Loop Operation a u M Hg P Note that the modules used in the PID loop example program were set up for binary format They could have been set up for BCD format In the latter case the BCD data would have to be converted to binary format before being stored to the setpoint and process variable and the control output would have to be converted from BCD to binary before being stored to the analog output By following the steps outlined in this chapter you should be able to set up workable PID control loops The DzrectSOFT Programming Software Manual provides more information for t
23. Automatic Mode Indication read Auto Cascade Mode Indication read Cascade PV Input LOW LOW Alarm read On PV Input LOW Alarm read On PV Input HIGH Alarm read On PV Input HIGH HIGH Alarm read On PV Input YELLOW Deviation Alarm read On PV Input RED Deviation Alarm read On PV Input Rate of Change Alarm read On Alarm Value Programming Error read Error Loop Calculation Overflow Underflow read Error Loop in Auto Tune indication read On Auto Tune error indication read 14 15 Reserved for Future Use Ramp Soak Table Flags Addr 33 The individual bit definitions of the Ramp Soak Table Flag Addr 33 word are listed in the following table Ramp Soak Flag Bit Description Read Write Bit 1 Start Ramp Soak Profile write 01 Start Hold Ramp Soak Profile write 01 Hold Resume Ramp soak Profile write 01 Resume Jog Ramp Soak Profile write 01 Jog Ramp Soak Profile Complete read Complete PV Input Ramp Soak Deviation read On Ramp Soak Profile in Hold read Off On Reserved read Current Step in R S Profile read decode as byte hex 0 1 2 3 4 5 6 7 8 NI OD O1 A o N in IN Bits 8 15 must be read as a byte to indicate the current segment number of the Ramp Soak generator in the profile This byte will have the values 1 2 3 4 5 6 7 8 9 A B C D E F and 10 which represent segments 1 to 16 respectively If the b
24. Control Output and Integrator sum Step 4 Select I O Modules After deciding the number of loops PV variables to measure and SP values you can choose the appropriate I O module Refer to the figure on the next page In many cases you will be able to share input or output modules or use an analog I O combination module among several control loops The example shown sends the PV and Control Output signals for two loops through the same set of modules Automationdirect offers DL06 analog input modules with 4 channels per module that accept 0 20mA or 4 20mA signals Also analog input and output combination modules are now available Thermocouple and RTD modules can also be used to maintain temperatures to a 10th of a degree Refer to the sales catalog for further information on these modules or find the modules on our website www automationdirect com 8 16 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation DLO6 CPU Input V memory Digital Module Output Loop 1 Data Channel 1 PV SP OUT gt Channel 1 Process 1 Loop 2 Data Channel 2 PV SP OUT Channel 2 Process 2 H gt Channel 3 Channel 4 Step 5 Wiring and Installation After selection and procurement of all loop components and I O module s you can perform the wiring and installation
25. Loop Error Flags BITS 0 or 1 read tette NOTE The V memory data is stored in SRAM memory If power is removed from the CPU for an extended period of time the PID Setup Parameters will be lost It is recommended to use the optional battery backup to retain the memory in SRAM Another option is to use the MOV instruction which places the data in 8 non volatile memory when setting up the parameters in the ladder program PID Error Flags The CPU reports any programming errors of the setup parameters in V7640 and V7641 It does this by setting the appropriate bits in V7642 on program to run mode transitions PID Error Flags V7642 Bit 15 14131211109 87 65 4 3 2 1 0 If you use the DzrectSOFT loop setup dialog box its automatic range checking prohibits possible setup errors However the setup parameters may be written using other methods such as RLL so the error flag register may be helpful in those cases The following table lists the errors reported in V7642 As a quick check if the CPU is in Run mode and V7642 0000 there are no programming errors Error Description 0 no error 1 error The starting address in V7640 is out of the lower V memory range The starting address in V7640 is out of the upper V memory range The number of loops selected in V7641 is greater than 8 The loop table extends past straddles the boundary at V7377 Use
26. SP and PV only periodically Setpoint SP The desired value for the process variable The setpoint SP is the input command to the loop controller during closed loop operation Soak Deviation The soak deviation is a measure of the difference between the SP and PV during a soak segment of the Ramp Soak profile when the Ramp Soak generator is active Step Response The behavior of the process variable in response to a step change in the SP in closed loop operation or a step change in the control output in open loop operation Transfer To change from one loop operational mode to another between Manual Auto or Cascade The word transfer probably refers to the transfer of control of the control output or the SP depending on the particular mode change Velocity Algorithm The control output is calculated to represent the rate of change velocity for the PV to become equal to the SP 8 78 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation M Bibliography Fundamentals of Process Control Theory Second Edition Application Concepts of Process Control Author Paul W Murrill Author Paul W Murrill Publisher Instrument Society of America Publisher Instrument Society of America ISBN 1 55617 297 4 ISBN 1 55617 080 7 PID Controllers Theory Design and Tuning 2nd Edition Author Fundamentals of Temperature Pressure and Flow Measurements K Astrom and T Hagglund Third edition Publisher Instrume
27. T OFF OFF 69 de 67 ON ON ON TIME The ON OFF controller is used in some industrial control applications but is not practical in the majority of industrial control processes The most common process controller that is used in industry is the PID controller 8 4 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Umum E I The PID controller controls a continuous feedback loop that keeps the process output control variable flowing normally by taking corrective action whenever there is a deviation from the desired value setpoint of the process variable PV such as rate of flow temperature voltage etc An error occurs when an operator manually changes the setpoint or when an event valve opened closed etc or a disturbance cold water wind etc changes the load thus causing a change in the process variable The PID controller receives signals from sensors and computes corrective action to the actuator from a computation based on the error Proportional the sum of all previous errors Integral and the rate of change of the error Derivative We can look at the PID controller in more simple terms Take the cruise control on an automobile as an example Let s say that we are cruising on an interstate highway in a car equipped with cruise control The driver decides to engage the cruise control by turning it ON then he manu
28. The error is used in the algorithm computation to provide corrective action at the control output The function of the control action is based on an output control which is proportional to the instantaneous error value The integral control action reset action provides additional compensation to the control output which causes a change in proportion to the value of the change of error over a period of time The derivative control action rate change adds compensation to the control output which causes a change in proportion to the rate of change of error These three modes are used to provide the desired control action in Proportional P Proportional Integral PI or Proportional Integral Derivative PID control fashion 8 6 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Standard DL05 06 analog input modules are used to interface to field transmitters to obtain the PV These transmitters normally provide a 4 20mA current or an analog voltage of various ranges for the control loop For temperature control thermocouple or RTD can be connected directly to the appropriate module The PID control algorithm residing in the CPU memory receives information from the user program primarily control parameters and setpoints Once the CPU makes the PID calculation the result may be used to directly control an actuator connected to a 4 20mA current output module to control a valve With DirectSOFT additional
29. control output unstable Return the reset value to the stable value such as 38 Be careful with this adjustment since the oscillation can destroy the process The control output response should be optimal now without a Derivative gain The example recorded values are Proportional gain 9 7 and Integral gain 38 seconds Note that the error has been minimized Minimum Oscillations Shortest response time The foregone method is the most common method used to tune a PID an Derivative gain is almost never used in a temperature control loop This method can also be used for other control loops but other parameters may need to be added for a stable control output Test your loop for a high PV of 80 and again for a low PV of 20 and correct the values if necessary Small adjustments of the parameters can make the control output more precise or more unstable It is sometimes acceptable to have a small overshoot to make the control output react quicker 8 42 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation III The derivative gain can be helpful for those control loops which are not controlling temperature For these loops try adding a value of 0 5 for the derivative gain and see if this improves the control output If there is little or no response increase the derivative by increments of 0 5 until there is an improvement to the output trend Recall that the derivative ga
30. from its normal location at V 02 to using the control output value V 05 from another loop So in Auto or Manual modes the loop calculation uses the data at V 02 In Cascade Mode the loop calculation reads the control output from another loop s parameter table V 05 Another loop Cascaded loop Loop Control Output V 05 Cascade Calculation Setpoint Loop Control Output Calculation Normal SP V 02 Auto Manual Process Variable As pictured below a loop can be changed from one mode to another but cannot go from Manual Mode directly to Cascade or vice versa This mode change is prohibited because a loop would be changing two data sources at the same time and could cause a loss of control GD Gam 8 Once the CPU is operating in the Run Mode the normal operation of the PID loop controller is to read the loop data and perform calculations on each scan of the RLL program When the CPU is placed in the Program Mode the RLL program halts operation and all PID loops are automatically put into the Manual Mode The PID parameters can then be changed if desired Similarly by placing the CPU in the Run mode the PID loops are returned to the operational mode which they were previously in i e Manual Automatic and Cascade With this selection you automatically affect the modes by changing the CPU mode CPU Modes Mode change Ga gt Loop Mode Linking 0 loop follows PLC mode i PID M
31. has optimal performance in dynamic conditions The quality of a loop s performance may generally be judged by how well the PV follows the SP after an SP step change It is important to keep in mind that understanding the process is fundamental to getting a well designed control loop Sensors must be in appropriate locations and valves must be sized correctly with appropriate trim PID control does not have typical values There isn t one control process that is identical to another Manual Tuning vs Auto Tuning You may enter the PID gain values to tune your loops manual tuning or you can rely on the PID processing engine in the CPU to automatically calculate the gain values auto tuning Most experienced process engineers will have a favorite method the DL06 will accommodate either preference The use of auto tuning can eliminate much of the trial and error of the manual tuning approach especially if you do not have a lot of loop tuning experience However performing the auto tuning procedure will get the gains close to optimal values but additional manual tuning can get the gain values to their optimal values 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 tune procedures will affect the process including inducing large changes in the control output value Make sure you thoroughly consider the impact of any changes to minimi
32. high Start out by reducing the derivative gain to zero Then reduce the integral gain and the proportional gain if necessary There is too much transfer lag in your process This means the PV reacts sluggishly to control output changes There may be too much distance between actuator and PV sensor or the actuator may be weak in its ability to transfer energy into the process There may be a process disturbance that is over powering the loop Make sure the PV is relatively steady when the SP is not changing 8 76 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Glossary of PID Loop Terminology Automatic Mode An operational mode of a loop in which it makes PID calculations and updates the loop s control output Bias Freeze A method of preserving the bias value operating point for a control output by inhibiting the integrator when the output goes out of range The benefit is a faster loop recovery Bias Term In the position form of the PID equation it is the sum of the integrator and the initial control output value Bumpless Transfer A method of changing the operation mode of a loop while avoiding the usual sudden change in control output level This consequence is avoided by artificially making the SP and PV equal or the bias term and control output equal at the moment of mode change Cascaded Loops A cascaded loop receives its setpoint from the output of another loop Cascaded loops
33. location V 06 in the loop table The parallel 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 Input from Operator Manual Control Output from another loop Control Output b Setpoint gt Error Term Loop a Calculation Normal Source e a Auto Cascade Process Variable g Cascade Auto Manual Mode Select PID Mode m Control PID Mode 1 Setting V 00 Loop Mode and Alarm Status V 06 Bit 1514131211109 87 654 3 21 0 Bit 514131211109 87 654 3 21 0 Mode Request Mode Monitoring E Cascade Manual Cascade Manual Automatic Automatic DLO06 Micro PLC User Manual 3rd Edition Rev C 8 53 Chapter 8 PID Loop Operation EEE Operator Panel Control of PID Modes Since the modes Manual Auto and Cascade are the most fundamental and important PID loop controls you may want to hard wire mode control switches to an operator s panel Most applications will need only Manual and Auto selections Cascade is used in special applications Remember that mode controls are really mode request bits and the actual loop mode is indicated elsewhere The following figure shows an operators panel using momentary push buttons to request PID mode change
34. program to ensure only one source attempts to write the SP value at V 02 at any particular time Setpoint Sources Operator Input Ramp soak generator Setpoint V 02 _ Ladder Program P d Another loop s output cascade Loop Control Output Calculation Process Variable If the SP for your process rarely changes or can tolerate step changes you probably will not need to use the ramp soak generator However some processes require precisely controlled SP value changes The ramp soak generator can greatly reduce the amount of programming required for these applications The terms ramp and soak have special meanings in the A SP process control industry and refer to desired setpoint SP i x os Soak values in temperature control applications In the figure to the right the setpoint increases during the ramp segment pamp It remains steady at one value during the soak segment sipe bk x Complex SP profiles can be generated by specifying a series dime of ramp soak segments The ramp segments are specified in SP units per second time The soak time is also programmable in minutes It is instructive to view the ramp soak generator as a dedicated function to generate SP values as shown below It has two categories of inputs which determine the SP values generated The ramp soak table must be programmed in advance containing the values that will define the ramp soak profi
35. see the DirectSOFT Programming Software Manual and it can be used to establish initial PID parameter values Auto tuning is the best guess the CPU can do after some trial tests The loop controller offers both closed loop and open loop methods The following sections 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 shown below DirectSOFT will manipulate these bits automatically when you use the auto tune feature within DirectSOFT Or you may have your ladder logic access these bits 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 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 off 0 when done Auto Tune Function Start Auto Tune Auto Tune 0 to 1 transition Active O PID tuning Auto Tune Auto Tuning Hooper Piituning Error Auto Tuning Controls O closed loop Status 1 open loop PID Mode 2 Setting V 01 Loop Mode and Alarm Status V 06
36. setup Also values are not required to be entered in the Tuning dialog but they can set later in the DirectSOFT PID View Error Term Selection The error term is internal to the CPUs PID loop controller and is generated again in each PID calculation Although its data is not directly accessible you can easily calculate it by subtracting Error SP PV If the PV square root extract is enabled then Error VPV In any case the size of the error and algebraic sign determine the next change of the control output for each PID Error Squared When selected the squared error function simply squares the error term but preserves the original algebraic sign which is used in the calculation This affects the Control calculation Output by diminishing its response to smaller error values but maintaining its response to larger errors Some situations in which the error squared term might be useful Noisy PV signal using a squared error term can reduce the effect of low frequency electrical noise on the PV which will make the control system jittery A squared error maintains the response to larger errors Non linear process some processes such as chemical pH control require non linear controllers for best results Another application is surge tank control where the Control Output signal must be smooth DLO06 Micro PLC User Manual 3rd Edition Rev C 8 33 Chapter 8 PID Loop Operation es Enable D
37. time interval The constant K1000 sets the preset at 10 seconds 1 000 ticks The N C enabling contact TO makes the timer self resetting TO is on for one scan each 10 seconds when it resets itself and T1 At the end of the 10 second period TO turns on and loads the control output value binary from the loop table V 05 location V2005 The BTOR instruction changes the number in the accumulator to a real number Dividing the control output by 4 095 converts the 0 4095 range to 0 1000 which matchs the number of ticks in the 10 second timer range This instruction converts the real number back to binary This step prepares the number for conversion to BCD There is no real to BCD instruction Convert the number in the accumulator to BCD format This satisfies the timer preset format requirement Output the result to V1400 In our example this is the location of the timer preset for the second timer The second fast timer also counts in increments of 01 seconds so its range is variable from 0 to a maximum of 1000 ticks or 10 seconds This timer s output T1 turns off the output coil YO when the preset is reached The N C T1 contact inverts the T1 timer output The control output is on at the beginning of the 10 second time interval YO turns off when T1 times out The STRNE contact prevents YO from energizing during the one scan when TO resets T1 YO is the actual control output END coil marks the
38. will need to be setup here that is select Unipolar or Bipolar format and the bit structure This area is not available and is grayed out if Common format has been chosen see page 8 26 WARNING If the Upper Limit is set to zero the output will never get above zero In effect there will be no contro output DLO06 Micro PLC User Manual 3rd Edition Rev C 8 3 1 Chapter 8 PID Loop Operation EEE Enter PID Parameters Another PID setup dialog Tuning is for entering the PID parameters shown as Gain Proportional Gain Reset Integral Gain and Rate Derivative Gain Setup PID Loop 1 Loop 2 SPV Output Tung Alarms ms Setup Gain Bias Error Gain Proportional Gain 10 00 Enor Squared Copy Reset Integral Gain 0 00 Enable Deadband Help FreezeBias Units Seconds C Minutes w Rate Derivative Gain 0 00 sec Derivative mo 2 gain limiting ciag E Recall the position and velocity forms of the PID loop equations which were introduced earlier The equations basically show the three components of the PID calculation Proportional Gain P Integral Gain I and Derivative Gain D The following diagram shows a form of the PID calculation in which the control output is the sum of the proportional gain integral gain and derivative gain With each calculation of the loop each term receives the same error signal value Loop Calculation P Setpoint Error Term as Contr
39. 0 to 4095 15 bit 0 to 32767 or 16 bit 0 to 65535 format or Bipolar data format which ranges from negative to positive 4095 to 4095 or 32767 to 32767 and requires a sign bit Bipolar selection displays input output as magnitude plus sign not two s complement The bipolar selection is not available when 16 bit data format is selected 8 26 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation M Setpoint V 02 Loop Control Output V 05 B Calculation PID Mode 2 Setting V 01 Process Variable V 03 Bit 15 141312111098 76543210 Data formats LSB Bit 15 141312111098 765 4 32 10 00 12 bit unipolar 0 to OFFF 0 to 4095 Select data i 01 12 bit bipolar 0 to OFFF 8FFF to 8001 emat ung a 0 to 4095 4095 to 4095 10 15 bit unipolar 0 to 32767 11 15 bit bipolar 0 to 7FFF FFFF to 8001 0 to 32767 32767 to 32767 Ej sign bit Magnitude plus sign The data format determines the numerical interface between the PID loop and the PV sensor and the control output device This selects the data format for both the SP and the PV Loop Mode Loop Mode is a special feature that allows the PID loop controller to perform closed loop control while the CPU is in the Program Mode Careful thought must be taken before using this feature c
40. APTER PID Loop OPERATION In This Chapter DLOG PID COMMS araogen d yo y QURE 99 4 5 619 aes Oe eR ac 8 2 Introduction to PID Control 454 x4 ex e a eR ES Oe ees 8 4 Introducing DLO6 PID Control aui nto o t e aes 8 6 PID Lop ODE NOs C gt 8 9 Ten Steps to Successful Process Control 4 22 co nn 8 16 PID Loop Set p 8 18 PID Loop TUNING s dodi 6b dco Ee ee dee e don e aae wan 8 40 Using the Special PID Features 4 race Ok hex RE des 8 53 Ramp Soak Generator 4 1st a bad eed bo OR e e e a 8 58 DirectSOFT Ramp Soak Example 52e br e oaks acres 8 63 Cascade COMI ieri ste Per we ae ee io wwe ee REV eU 8 65 Time Proportioning Control sb diae Rr ar enr Ro o e aces 8 68 Feedforward Control j 22 2244 see cr eh Rar REG RE sees 8 70 PID Example Program auc i qoae ee IUE Peor d Rok eor s deca 8 72 Troubleshooting Tips 22e ioa Roch eade OC RUE ee EORR OR ADR 8 75 Glossary of PID Loop Terminology 2s rex 8 77 BIDHOOGEFADE 6 4 66 po eee eee eee e e D B ca races 8 79 Chapter 8 PID Loop Operation i DLO6 PID Control DL06 PID Control Features Along with control functions discussed in this manual the DL06 PLC features PID process control capability The DL06 PID process control loops offer the same features offered in much larger PLCs The primary features are Up to 8 PID loops individual programmable sample rates Manual Automatic and Cascade loop operation modes Two types of bu
41. Low low alarm Their threshold values are programmed using the loop table registers listed above A High high or Low low alarm indicates a serious condition exists and needs the immediate attention of the operator The PV Absolute Value Alarms are reported in the four bits in PID Mode and Alarm Status V 06 the PID Mode and Alarm Status word in the loop table as shown to the right We highly recommend using ladder logic Xl to monitor these bits The bit of word instructions make this High high Alarm mij Bit 15 14 13 1211109876543210 E x High Alarm easy to do Additionally you can monitor PID alarms using E ete DirectSOFT Low low Alarm PV Deviation Alarms The PV Deviation Alarms monitor the PV deviation with respect to the SP value The deviation alarm has two programmable thresholds and each threshold is applied equally above and below the current SP value In the figure below the smaller deviation alarm is called the Yellow Deviation indicating a cautionary condition for the loop The larger deviation alarm is called the Red Deviation indicating a strong error condition for the loop The threshold values use the loop parameter table locations V 17 and V 20 as shown 8 Red Deviation Alarm Red Yellow Deviation Alarm Yellow Loop Table SP Green V 17 XXXX Yellow Deviation Alarm i V 20 XXXX Red Deviation Alarm Yellow Deviation Alarm Y
42. Off On 6 Ramp Soak Profile in Hold read Off On 7 Reserved read Off On 8 1 Current Step in R S Profile read decode as byte hex Ramp Soak Generator Enable The main enable control to permit ramp soak PID Mode 1 Setting V 00 generation of the SP value is accomplished with bit 11 in the PID Mode 1 Setting V 00 word as shown Bit 151419121109 87 65 43 210 to the right The other ramp soak controls in V 33 Ramp Soak shown in the table above will not operate unless this Generator Enable bit 1 during the entire ramp soak process Ramp Soak Controls The four main controls for the ramp soak generator are in bits Pamp Soak Settings V 33 0 to 3 of the ramp soak settings word in the loop parameter table DzrectSOFT controls these bits directly from the m ramp soak settings dialog However you must use ladder logic Resume all to control these bits during program execution We Hold recommend using the bit of word instructions Start Bit 15 14131211109 8 7 65 4 32 1 0 Ladder logic must set a control bit to a 1 to command the corresponding function When the loop controller reads the ramp soak value it automatically turns off the bit for you Therefore a reset of the bit is not required when the CPU is in Run Mode The example program rung to the right shows how an Start R S Generator external switch X0 can turn on and the PD contact uses xo B2033 0 the leading
43. PLC is in Program Mode New loops automatically begin in Manual Mode Loop Mode Override In normal conditions the mode of a loop is determined by the request to V 00 bits 0 1 and 2 However some conditions exist which will prevent a requested mode change from occurring A loop that is not set independent of PLC mode cannot change modes when the PLC is in Program mode A major loop of a cascaded pair of loops cannot go from Manual to Auto until its minor loop is in Cascade mode In other situations the PID loop controller will automatically change the mode of the loop to ensure safe operation A loop which develops an error condition automatically goes to Manual If the minor loop of a cascaded pair of loops leaves Cascade Mode for any reason its major loop automatically goes to Manual Mode DLO0G Micro PLC User Manual 3rd Edition Rev C 8 54 Chapter 8 PID Loop Operation n PV Analog Filter A noisy PV signal can make tuning difficult and can cause the control output to be more extreme than necessary as the output tries to respond to the peaks and valleys of the PV There are two equivalent methods of filtering the PV input to make the loop more stable The first method is accomplished using the DL06 s built in filter The second method achieves a similar result using ladder logic The DL06 Built in Analog Filter The DL06 provides a selectable first order low pass PV input filter We only recommend t
44. The PID controller sometimes called a closed loop controller Regardless of type analog controllers require input signals from electronic sensors such as pressure differential pressure level flow meter or thermocouples As an example one of the most common analog control applications is located in your house for controlling either heat or air conditioning the thermostat You wish for your house to be at a comfortable temperature so you set a thermostat to a desired temperature setpoint You then select the comfort mode either heat or A C A 8 temperature sensing device normally a thermistor is located within the thermostat If the thermostat is set for heat and the setpoint is set for 69 the furnace will be turned on to provide heat at normally 2 below the setpoint In this case it would turn on at 67 When the temperature reaches 71 2 above setpoint the furnace will turn off In the opposite example if the thermostat is set for A C cooling the thermostat will turn the A C unit on off opposite the heat setting For instance if the thermostat is set to cool at 76 the A C unit will turn on when the sensed temperature reaches 2 above the setpoint or 78 and turn off when the temperature reaches 74 This would be considered to be an ON OFF controller The waveform below shows the action of the heating cycle Note that there is a slight overshoot at the turn off point also a slight undershoot at the turn on point
45. Using DirectSOFT s PID View will be a real time saver because it will draw the profile on screen for you Be sure to set the trending timebase slow enough to display completed ramp soak segment pairs in the waveform window 8 62 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation ee dae DirectSOFT Ramp Soak Example The following example will step you through the Ramp Soak setup Setup the Profile in PID Setup The first step is to use Setup PID in DirectSOFT to set the profile of your process Open the Setup PID window and select the R S tab and then enter the Ramp and Soak data Loop 1 sPPV Sutput Tuning Alarms ZK Vetle Locaion V5000 V 5Caz Rarp Sask Enable Change Flame Soak Siope Time Deviation 0 83 2 20 20 u 20 uU 1 00 1 1 Program the Ramp Soak Control in Relay Ladder Refer to the Ramp Soak Flag Bit Description table on page 8 60 when adding the control rungs to your program similar to the ladder rungs below Start R S x100 B7033 0 13 p X sET Hold RIS X101 B7033 1 14 A 87 Resume R S X102 B7033 2 15 E FF sET Enable R S X107 57000 11 OUT NOP END DLO06 Micro PLC User Manual 3rd Edition Rev C 8 63 Chapter 8 PID Loop Operation ss Test the Profile Test your profile using PID View 8 64 DLO06 Micro PLC User Manual 3rd Edition Rev C Chap
46. alled Independent of CPU mode in the dialog Before continuing with the PID setup a knowledge of the three PID loop modes will be helpful The DLO06 provides the three standard control modes Manual Automatic and Cascade The sources of the three basic variables SP PV and control output are different for each mode In Manual Mode the loop is not executing PID calculations however loop alarms are still active With regard to the loop table the CPU stops writing values to location V 05 control output for that loop Jt is expected that an operator or other intelligent source is manually controlling the output by observing the PV and writing data to the control output as necessary to keep the process under control The drawing below shows the equivalent schematic diagram of manual mode operation Input from Operator Manual s Control Output V 05 a Loop Calculation Auto In Automatic Mode the loop operates normally and generates new control output values It calculates the PID equation and writes the result in location V 05 every sample period of that loop The equivalent schematic diagram is shown below Input from Operator Manual Control Output V 05 2 Loop Calculation Auto DL06 Micro PLC User Manual 3rd Edition Rev C 8 27 Chapter 8 PID Loop Operation In Cascade Mode the loop operates as it does in Automatic Mode with one important difference The data source for the SP changes
47. ally brings the car to the desired cruising speed say 70 miles per hour Once the cruise speed is reached the SET button is pushed fixing the speed at 70 mph the setpoint Now the car is cruising at a steady 70 mph until it comes to a hill to go up As the car goes up the hill it tends to slow down The speed sensor senses this and causes the throttle to increase the fuel to the engine The vehicle speeds up to maintain 70 mph without jerking the car and it reaches the top at the set speed When the car levels out after reaching the top of the hill it will speed up The speed sensor senses this and signals the throttle to provide less fuel to the engine thus the engine slows down allowing the car to maintain the 70 mph speed How does this application apply to PID control Lets look at the function of D I and D terms Proportional is commonly referred to as Proportional Gain The proportional term is the corrective action which is proportional to the error that is the change of the manipulated variable is equal to the proportional gain multiplied by the error the activating signal In mathematical terms Proportional action proportional gain X error Error Setpoint SP Process Variable PV Applying this to the cruise control the speed was set at 70 mph which is the Setpoint The speed sensor senses the actual speed of the car and sends this signal to the cruise controller as the Process Variable PV When the car is on a le
48. an address closer to V1200 Establishing the Loop Table Size and Location On a PROGRAM to RUN mode transition the CPU reads the loop setup parameters as pictured below At that moment the CPU learns the location of the loop table and the number of loops it configures Then during the ladder program scan the PID Loop task uses the loop data to perform calculations generate alarms and so on There are some loop table parameters the CPU will read or write on every loop calculation CPU Tasks V Memory Space User Data __ READ EA Ladder WTE LOOP Program J gt DATA M CONFIGURE m Pd MONITOR J lt gt PID Loop Sa Task T BEA SS Setup Parameters LEA READ V7640 V7641 A cm at powerup DirectSOFT32 Programming Software 8 18 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation NOTE The DL06 CPU s PID algorithm requires DirectSOFT Version 5 0 or later and firmware version 2 1 or later See our website for more information www automationdirect com The Loop Table contains data for only the number of loops that are selected The address for the table is stored in V7641 Each loop configuration occupies 32 words 0 to 37 octal in V Memory User Data the loop table bud LOOP 1 i r _v_ V2037 32 words For example consider an application with 4 loops and V2000 1 V2040 LOOP 2 has been chosen as the st
49. arting location The Loop Parameter v2077 32 words will occupy V2000 V2037 for loop 1 V2040 V2077 for LOOP 3 loop 2 and so on Loop 4 occupies V2140 V2177 awe LOOP 4 Determine the block of V memory to be used for each PID 32 words loop Besides being the beginning of the PID parameter memory block the first address will be the start of loop 1 parameters Remember there are 32 words 0 to 37 octal needed for each loop Once you have determined the beginning V memory address to be used you can setup and store the PID parameters either directly in your RLL program or by the using PID Setup in DirectSOFT NOTE Whether one or more loops are being setup this block of V memory will only be used for the e j PID loop parameters do not use this block of memory for anything else in your program Using DirectSOFT is the simplest way to setup the parameters To setup the PID parameters the DL06 must be powered up and connected to the programming computer The parameters can only be entered in PID setup when the PLC is in the Program mode Once the parameters have been entered and saved for each loop changes made through the PID setup can be made but only in Program Mode You can type the beginning address in the PID Table Address dialog found when the PID Setup is opened in DirectSOFT This can be seen in the diagram below After the address has been entered the memory range will appear Also entering the numb
50. cycle will depend on the mass of your process A slowly changing PV will result in a longer auto tune cycle time When the auto tuning is complete the proportional and integral gain values are automatically updated in loop table locations V 10 and V 11 respectively The derivative is calculated if you autotune for PID and updated in loop table location V 12 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 closed 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 DLO06 Micro PLC User Manual 3rd Edition Rev C 8 55 Chapter 8 PID Loop Operation EM The algorithm which the built in filter follows is yi k xi yi 1 yi 1 yi is the current output of the filter xi is the current input to the filter yi 1 is the previous output of the filter k is the PV Analog Input Filter Factor Creating an Analog Filter in Ladder Logic A similar algorithm can be built in your ladder program Your analog inputs can be filtered effectively using either method The following programming example describes the ladder logic you will need Be sure to change the example memory locations to those that fit your application Filtering can induce a 1 part in 1000 error in your output because of rounding If your process cannot tolerate a 1 part in 1000 error do not u
51. d soak segment pair as pictured below Ramp End Value specifies the destination SP value for the end of the ramp Use the same data format for this number as you use for the SP It may be above or below the beginning SP value so the slope could be up or down we don t have to know the starting SP value for ramp 1 Ramp Slope specifies the SP increase in counts units per second It isa BCD number from 00 00 to 99 99 uses implied decimal point Soak Duration specifies the time for the soak segment in minutes ranging from 000 1 to 999 9 minutes in BCD implied decimal point Soak PV Deviation optional specifies an allowable PV deviation above and below the SP value during the soak period A PV deviation alarm status bit is generated by the ramp soak generator Ramp End gt gt SP Value Soak PV Ramp Soak Table deviation V 00 XXXX Ramp End SP Value duration V 03 XXXX Soak PV Deviation _ V 01 XXXX Ramp Slope Slope 8 SP p Soak E V 02 XXXX Soak Duration E segment becomes active The ramp segment becomes active when the previous soak segment ends If the ramp is the first segment it becomes active when the ramp soak generator is started and automatically assumes the present SP as the starting SP Description Description Ramp End SP Value Ramp End SP Value Ramp Slope Ramp Slope Soak Duration Soak Duration Soak PV Deviation Soak PV Deviation Ramp End SP Value Ra
52. d to operate the PID loop independent of the CPU mode then you must take certain steps to make it possible to make loop parameter changes You can temporarily make the loops follow the CPU mode by changing bit 15 to 0 Then you will be able to place the loop into Manual Mode using DirectSOFT After you change the loop s parameter settings restore bit 15 to a value of 1 to re establish PID operation independent of CPU DLO06 Micro PLC User Manual 3rd Edition Rev C 8 29 Chapter 8 PID Loop Operation You may optionally configure each loop to access its analog I O PV and control output by placing proper values in the associated loop table registers in your RLL program The following figure shows the loop table parameters at V 36 and V 37 and their auto transfer role to access the analog values directly Setpoint V 02 Error Loop Control output V 05 gt Calculation Process variable V 03 Loop Table V2036 OX XX Base Slot Channel number for PV V2037 OX XX Base Slot Channel number for Output XX OX Channel number 1 to 4 Slot number 1 to 4 Base 0 8 When these loop table parameters are programmed directly a value of 0102 in register V2036 directs the loop controller to read the PV data from channel 1 of the analog input A value of 0000 in either register tells the loop controller not to access the corresponding analog value directly In that case ladder logic must be used to transfer the value b
53. ddr 10 Gain Proportional Setting word BCD Yes Addr 11 Reset Integral Time Setting word BCD Yes Addr 12 Rate Derivative Time Setting word BCD Yes Addr 13 PV Value Low low Alarm word binary No Addr 14 PV Value Low Alarm word binary No Addr 15 PV Value High Alarm word binary No Addr 16 PV Value High high Alarm word binary No Addr 17 PV Value deviation alarm YELLOW word binary No Addr 20 PV Value deviation alarm RED word binary No Addr 21 PV Value rate of change alarm word binary No Addr 22 PV Value alarm hysteresis setting word binary No Addr 23 PV Value error deadband setting word binary Yes Addr 24 PV low pass filter constant word BCD Yes Addr 25 Loop derivative gain limiting factor setting word BCD No Addr 26 SP value lower limit setting word binary Yes Addr 27 SP value upper limit setting word binary Yes Addr 30 Control output value lower limit setting word binary No Addr 31 Control output value upper limit setting word binary No Addr 32 Remote SP Value V Memory Address Pointer word hex Yes Addr 33 Ramp Soak Setting Flag bit Yes Addr 34 Ramp Soak Programming Table Starting Address word hex No Addr 35 Ramp Soak Programming Table Error Flags bits No Addr 36 PV auto transfer channel number word hex Yes Addr 37 Control output auto transfer channel number word hex Yes CO N 9 a A N al al a
54. determines the magnitude of the PID proportional term in response to the current error PV Absolute Alarm A programmable alarm that compares the PV value to alarm threshold values PV Deviation Alarm A programmable alarm that compares the difference between the SP and PV values to a deviation threshold value Ramp Soak Profile A set of SP values called a profile which is generated in real time upon each loop EI calculation The profile consists of a series of ramp and soak segment pairs greatly simplifying the task of programming the PLC to generate such SP sequences Rate Also called differentiator the rate term responds to the changes in the error term Remote Setpoint The location where a loop reads its setpoint when it is configured as the minor loop in a cascaded loop topology Reset Also called integrator the reset term adds each sampled error to the previous maintaining a running total called the bias Reset Windup A condition created when the loop is unable to find equilibrium and the persistent error causes the integrator reset sum to grow excessively windup Reset windup causes an extra recovery delay when the original loop fault is remedied Reverse Acting Loop A loop in which the PV increases in response to a control output decrease In other words the process has a negative gain Sampling time The time between PID calculations The CPU method of process control is called a sampling controller because it samples the
55. e If you have more than two loops cascaded together the outer most major loop must be in Auto Mode during normal operation and all inner loops in Cascade Mode Unfortunately we are unable to retain this convention when controlling loop modes Remember that NOTE Technically both major and minor loops are cascaded in strict process control terminology all minor loops will be in Cascade Mode and only the outer most major loop will be in Auto Mode You can cascade together as many loops as necessary on the DLO6 and you may have multiple groups of cascaded loops For proper operation on cascaded loops you must use the same data range 12 15 bit and unipolar bipolar settings on the major and minor loop To prepare a loop for Cascade Mode operation as a minor loop you must program its remote Setpoint Pointer in its loop parameter table location V 32 as shown below The pointer must be the address of the V 05 location control output of the major loop In Cascade Mode the minor loop will ignore the its local SP register V 02 and read the major loop s control output as its SP instead 8 Major Loop Auto mode Minor Loop Cascade Mode Loop Table Loop Table V 02 XXXX SP V 02 X V 03 XXXX PV V 03 XXXX PV V 05 XXXX Control Output V 05 XXXX Control Output ET V 32 XXXX Remote SP Pointer When using DirectSOFT s PID View to watch the SP value of the minor loop DirectSOFT
56. e PV Alarm Hysteresis The PV Limit Alarms and PV Deviation Alarms are programmed using threshold values When the absolute value or deviation exceeds the threshold the alarm status becomes true Real world PV signals have some noise on them which can cause some fluctuation in the PV value in the CPU As the PV value crosses an alarm threshold its fluctuations will cause the alarm to be intermittent and annoy process operators The solution is to use the PV Alarm Hysteresis feature DL06 Micro PLC User Manual 3rd Edition Rev C 8 13 Chapter 8 PID Loop Operation EEE Loop Operating Modes The DL06 loop controller operates in one of three modes either Manual Automatic or Cascade Manual In manual mode the control output is determined by the operator not the loop controller While in manual mode the loop controller will still monitor all of the alarms including High High High Low Low Low Yellow deviation Orange deviation and Rate of Change Automatic In automatic mode the loop controller computes the control output based on the programmed parameters stored in V memory All alarms are monitored while in automatic Cascade Cascade mode is an option with the DL06 PLC and is used in special control applications If the cascade feature is used the loop will operate as it would if in automatic mode except for the fact that a cascaded loop has a setpoint which is the control output from another loop Special Loop Calcu
57. e while in Auto Mode Then we are finished tuning the minor loop 4 In this step you will need to get the minor loop in Cascade Mode and then the Major loop in Auto Mode We will be tuning the major loop with the minor loop treated as a series component its overall process Therefore do not go back and tune the minor loop again while tuning the major loop 5 Tune the major loop following the standard loop tuning procedure in this section The response of the major loop PV is actually the overall response of the cascaded loops together DL06 Micro PLC User Manual 3rd Edition Rev C 8 67 Chapter 8 PID Loop Operation i Time Proportioning Control The PID loop controller in the DLO6 CPU generates a smooth control output signal across a numerical range The control output value is suitable to drive an analog output module which connects to the process In the process control field this is called continuous control because the output is on at some level continuously While continuous control can be smooth and robust the cost of the loop components such as actuator heater amplifiers can be expensive A simpler form of control is called time proportioning control This method uses actuators which are either on or off no in between Loop components for on off based control systems are lower cost than their continuous control counterparts In this section we will show you how to convert the control output of a loop to time
58. eadband When selected the enable deadband function takes a range of small error values near zero and simply substitutes zero as the value of the error If the error is larger than the deadband range then the error value is used normally Freeze Bias The term reset windup refers to an undesirable characteristic of integrator behavior which occurs naturally under certain conditions Refer to the figure below Suppose the PV signal becomes disconnected and the PV value goes to zero While this is a serious loop fault it is made worse by reset windup Notice the bias reset term keeps integrating normally during the PV disconnect until its upper limit is reached When the PV signal returns the bias value is saturated windup and takes a long time to return to normal The loop output consequently has an extended recovery time Until recovery the output level is wrong and causes further problems PV 0 PV loss PV loss Reset windup Freeze bias enabled N E S ome OUI aa kj E E Recovery time Recovery time In the second PV signal loss episode in the figure the freeze bias feature is enabled It causes the bias value to freeze when the control output goes out of bounds Much of the reset windup is thus avoided and the output recovery time is much less For most applications the freeze bias feature will work with the loop as described above It is suggested to enable this feature by selec
59. ect the process variable will equal the setpoint Control Output The result of the loop calculation which becomes a command for the process such as the heater level in an oven This is sometimes referred to as control variable Error Term The algebraic difference between the process variable and the setpoint This is the control loop error and is equal to zero when the process variable is equal to the setpoint desired value A well behaved control loop is able to maintain a small error term magnitude Manipulated Variable This is what is used to effect the controlled variable For example the fuel used in a furnace might be manipulated in order to control the temperature Disturbance Something in the system that changes such that corrective action is required For instance when controlling a flow and the upstream pressure drops the control valve must open wider in order to keep flow constant The drop in upstream pressure is the disturbance Final Control Element This is the physical device used to control the manipulated variable Valves are probably the most widely used final control element Lag Time The time it takes for the process to respond to a change in manipulated variable This is also known as the capacitance of the system When youre in the shower and you turn up the hot water a little the time it takes before the water gets hot is the lag time Dead Time The time it takes for a change in the pr
60. edge to set the proper control bit to start the HTI SET ramp soak profile This uses the Set Bit of word instruction DL06 Micro PLC User Manual 3rd Edition Rev C 8 6 Chapter 8 PID Loop Operation es The normal state for the ramp soak control bits is all zeros Ladder logic must set only one control bit at a time Start a 0 to 1 transition will start the ramp soak profile The CPU must be in Run Mode and the loop can be in Manual or Auto Mode If the profile is not interrupted by a Hold or Jog command it finishes normally e Hold a 0 to 1 transition will stop the ramp soak profile in its current state and the SP value will be frozen Resume a 0 to 1 transition cause the ramp soak generator to resume operation if it is in the hold state The SP values will resume from their previous value Jog a 0 to 1 transition will cause the ramp soak generator to truncate the current segment step and go to the next segment Ramp Soak Profile Monitoring You can monitor the Ramp Soak profile status using other bits Ramp Soak Settings V 33 in the Ramp Soak Settings V 33 word shown to the right Bit 1514131211109 87 65 4 3 2 1 O R S Profile Complete 1 when the last programmed step is R S Profile in Hold A done Soak PV Deviation e Soak PV Deviation 1 when the error SP PV exceeds the R S Profile Complete specified deviation in the R S
61. ellow Red Deviation Alarm Red The thresholds define zones which fluctuate with the SP value The green zone which surrounds the SP value represents a safe no alarm condition The yellow zones lie outside the green zone and the red zones are beyond those The PV Deviation Alarms are reported in the two bits in the PID Mode and Alarm Status word in the loop table as shown to the right We highly recommend using ladder logic to monitor these bits The bit of word instructions make this s Red Deviation easy to do Additionally you can monitor PID alarms using yellow Deviation DirectSOFT The PV Deviation Alarm can be independently enabled and disabled from the other PV alarms using bit 13 of the PID Mode 1 Setting V 00 word Remember the alarm hysteresis feature works in conjunction with both the deviation and absolute value alarms and is discussed at the end of this section PID Mode and Alarm Status V 06 Bit 15 141312111098 76543210 8 36 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation MMMM PV Rate of Change Alarm An excellent way to get an early warning of a process fault is to monitor the rate of change of the PV Most batch processes have large masses and slowly changing PV values A relatively fast changing PV will result from a broken signal wire for either the PV or control output a SP value error or other cau
62. end of the main program DLO06 Micro PLC User Manual 3rd Edition Rev C 8 69 Chapter 8 PID Loop Operation i Feedforward Control Feedforward control is an enhancement to standard closed loop control It is most useful for diminishing the effects of a quantifiable and predictable loop disturbance or sudden change in setpoint Use of this feature is an option available to you on the DL06 However it s best to implement and tune a loop without feedforward and adding it only if better loop performance is still needed The term feedforward refers to the control technique involved shown in the diagram below The incoming setpoint value is fed forward around the PID equation and summed with the output Feedforward path 3 Setpoint Loop Control Output py Calculation 2 j Process Variable working region or operating point for the control output When the error fluctuates around its zero point the output fluctuates around the bias value Now when there is a change in setpoint an error is generated and the output must change to a new operating point This also happens if a disturbance introduces a new offset in the loop The loop does not really know its way to the new operating point the integrator bias must increment decrement until the error disappears and then the bias has found the new operating point 8 In the previous section on the bias term we said that the bias term value establ
63. er of PID loops 1 to 8 will set the total V memory range for the number of loops entered After the V memory address has been entered the necessary PID parameters for a basic loop operation for each loop can be setup with the dialogs made available Set PID Table Address Table Start Address W y Number of loops 12 4 Rss Memory Range Y2000 2077 Iv Re read PID data from PLC Update and Exit Cancel NOTE Have an edited program open then click on PLC gt Setup gt PID to access the Setup PID dialog DL06 Micro PLC User Manual 3rd Edition Rev C 8 19 Chapter 8 PID Loop Operation ij Loop Table Word Definitions These are the loop parameters associated with each of the four loops available in the DLO6 The parameters are listed in the following table The address offset is in octal to help you locate specific parameters in the loop table For example if a table begins at V2000 then the location of the reset integral term is Addr 11 or V2011 Do not use the Word in the first column to calculate addresses Address Offset Description Format thea Addr 0 PID Loop Mode Setting 1 bits Yes Addr 1 PID Loop Mode Setting 2 bits Yes Addr 2 Setpoint Value SP word binary Yes Addr 3 Process Variable PV word binary Yes Addr 4 Bias Integrator Value word binary Yes Addr 5 Control Output Value word binary Yes Addr 6 Loop Mode and Alarm Status bits Addr 7 Sample Rate Setting word BCD Yes A
64. etween the analog input and the loop table NOTE When auto transfer to from I O is used the analog data for all of the channels on the analog module cannot be accessed by any other method i e pointer or multiplex SP PV Addresses An SP PV dialog will be made available to setup how the setpoint SP and the process variable PV will be used in the loop If this loop is the minor loop of a cascaded pair enter that control output address in the Remote SP from Cascaded Loop Output area It is sometimes desirable to limit the range of setpoint values allowed to be entered To activate this feature check the box next to Enable Limiting This will activate the Upper and Lower fields for the values to be entered Set the limits around the SP value to prevent an operator from entering a Loop 1 Loop 2 Doc Configure F Output Tuning lg Setpoint Variable Process Variable Address V2002 Address V2003 Square root I Auto Transfer From Remote Setpoint from Cascaded zI E d Loop Dutput c n I Enable Limiting c n 8 30 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation setpoint value outside of a safe range The Square root box is only checked for certain PID loops such as a flow control loop If the Auto transfer from I O module is selected a first order low pass filter can be used by checking the Enable Filter box The filter coefficient is user s
65. ew PD Ve E H e z E E Loop Tiie Soup i lt Element Staus Eds Sec Div A Ei Acn fil 20 Bal pa V uh ral Reset M 3 5 6 41H 7 F2 ral Loop Num 1 44 da s Settings Variables Alam E 1 PLCMode Pogam se F RoC jt mi Mode Manual 7 iz E T2 Gan 000 al ee E my 2 ae ha Reet PC Win ouf Rate 000 sec Yelow _ ts 44 he Autotune j T j Daou Acton Conch gt Mad E C FowerdActng Pl C ag 2 18 x K gt For Help press F1 Fii Mar 1017 14 41 2006 Value 9 iy For Help press F1 OK OnlneDSCELOS Progam 00023 07680 06 aj 8 50 DL06 Micro PLC User Manual 3rd Edition Rev C 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 The diagram EX DirectSOFT 5 Programming pid PID View File Edt Search View Tools PLC Debug Window Help s EDIT MODE E ol la Sic AB Hote AZ oo oe i umts x EET Ladder view PID View il H boer z wono z DB lfittoon tne Setup z Element Status Edits 4 Sec Div Ei tn il m ls SPO 3 mo Halt PV 4 BlASO Reset 5 6 7 j 8 Loop Num 1 24 Loop Title 4l 9 Settings Variables Alarms PLC Mode
66. for the cascaded loop Manual Mode An operational mode of a loop it which the PID calculations are stopped The operator must manually control the loop by writing to the control output value directly Minor Loop In cascade control the minor loop is the subordinate loop that receives its SP from the major loop On Off Control A simple method of controlling a process through on off application of energy into the system The mass of the process averages the on off effect for a relatively smooth PV A simple ladder program can convert the DL06 s continuous loop output to on off control DL06 Micro PLC User Manual 3rd Edition Rev C 8 77 Chapter 8 PID Loop Operation EEE PID Loop A mathematical method of closed loop control involving the sum of three terms based on proportional integral and derivative error values The three terms have independent gain constants allowing one to optimize tune the loop for a particular physical system Position Algorithm The control output is calculated so it responds to the displacement position of the PV from the SP error term Process A manufacturing procedure which adds value to raw materials Process control particularly refers to inducing chemical changes to the material in process Process Variable PV A quantitative measurement of a physical property of the material in process which affects final product quality and is important to monitor and control Proportional Gain A constant that
67. g DirectSOFT it displays the SP PV Bias and Control output in decimal BCD converting it to binary before updating the loop table Q The Ramp Soak Generator does not operate when I activate the Start bit A Check the following for possible causes e The Ramp Soak enable bit is off Check the status of bit 11 of loop parameter table location V 00 It must be set 1 The hold bit or other bits in the Ramp Soak control are on The beginning SP value and the first ramp ending SP value are the same so first ramp segment has no slope and consequently has no duration The ramp soak generator moves quickly to the soak segment giving the illusion the first ramp is not working The loop is in Cascade Mode and is trying to get the SP remotely The SP upper limit value in the loop table location V 27 is too low Check your ladder program to verify it is not writing to the SP location V 02 in the loop table A quick way to do this is to temporarily place an end coil at the beginning of your program then go to PLC Run Mode and manually start the ramp soak generator Q The PV value in the table is constant even though the analog module receives the PV signal A Your ladder program must read the analog value from the module successfully and write it into the loop table V 03 location Verify the analog module is generating the value and the ladder is working Q The Derivative gain doesn t seem to have any affect on the output
68. g the output coil YO SP PV Calculation Loop V2005 ya continuous Time YO Proportioning Process my f U on off The example program uses two timers to generate On Off control It makes the following assumptions which you can alter to fit your application The loop table starts at V2000 so the control output is at V2005 The data format of the control output is 12 bit unipolar 0 FFF The time base one full cycle for the On Off waveform is 10 seconds We use a fast timer 0 01 sec tick counting to 1000 ticks 10 seconds The On Off control output is YO The time proportioning program must match the resolution of the output 1 part in 1000 to the resolution of the time base of TO also 1 part in 1000 NOTE Some processes change too fast for time proportioning control Consider the speed of your process when you choose this contro method Use continuous control for processes that change too fast for time proportioning control Also consider using a solid state switch for a longer switch life instead of a relay TO TO TMRF TO K1000 LD V2005 TO BTOR DIVR R4 095 RTOB BCD OUT V1400 T1 TA1 KO TMRF T1 V1400 YO ou END A fast timer 0 01 sec timebase establishes the primary
69. he other PV alarms using bit 14 of the PID Mode 1 Setting V 00 word The alarm hysteresis feature discussed next does not affect the Rate of Change Alarm DLO06 Micro PLC User Manual 3rd Edition Rev C 8 3 7 Chapter 8 PID Loop Operation I PV Alarm Hysteresis The PV Absolute Value Alarm and PV Deviation Alarm are programmed using threshold values When the absolute value or deviation exceeds the threshold the alarm status becomes true Real world PV signals have some noise on them which can cause some fluctuation in the PV value in the CPU As the PV value crosses an alarm threshold its fluctuations cause the alarm to be intermittent and annoy process operators The solution is to use the PV Alarm Hysteresis feature The PV Alarm Hysteresis amount is programmable from 1 to 200 binary decimal When using the PV Deviation Alarm the programmed hysteresis amount must be less than the programmed deviation amount The figure below shows how the hysteresis is applied when the PV value goes past a threshold and descends back through it Alarm threshold T Hysteresis m Loop Table V 22 XXXX PV Alarm Hysteresis PV Alarm 1 0 The hysteresis amount is applied after the threshold is crossed and toward the safe zone In this way the alarm activates immediately above the programmed threshold value It delays turning off until the PV value has returned through the threshold by the hysteresis amount
70. he use of a filter during auto tuning or PID control if there is noise on the input signal You may disable the filter after auto tuning is complete or continue to use it if the PV input signal is noisy gt Loop Control Output gt Calculation t Unfiltered PV A 0 L Process Variable 1 Filtered p ec v Do PID Mode 2 Setting V 01 E 1 Bit 15 14131211109 87 65 4 3 21 0 Loop Table PV filter V 24 XXXX Filter constant enable disable Bit 2 of PID Mode Setting 2 provides the enable disable control for the low pass PV filter O disable 1 enable The roll off frequency of the single pole low pass filter is controlled by using register V 24 in the loop parameter table the filter constant The data format of the filter constant value is BCD with an implied decimal point 00X X as follows The filter constant has a valid range of 000 1 to 001 0 The smaller the filter value the greater the filtering performed for example the value 001 0 provides no filtering DirectSOFT converts values above the valid range to 001 0 and values below this range to 000 1 Values close to 001 0 result in higher roll off frequencies while values closer to 000 1 result in lower roll off frequencies We highly recommend using DirectSOFT for the auto tuning interface The duration of each auto tuning
71. he use of PID View For a step by step tutorial go to the Technical Support section located on our website www automationdirect com Once you are at the website click on Technical Support Home After this page opens find and select Guided Tutorials located under the Using Your Products column An Animated Tutorial page will open Under Available Tutorials find PID Trainer and select View the Powerpoint slide show and begin viewing the tutorial The Powerpoint Viewer can be downloaded if your computer does not have Powerpoint installed 8 74 DLO0G Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation l Troubleshooting Tips Q The loop will not go into Automatic Mode A Check the following for possible causes A PV alarm exists or a PV alarm programming error exists The loop is the major loop of a cascaded pair and the minor loop is not in Cascade Mode Q The Control Output stays at zero constantly when the loop is in Automatic Mode A Check the following for possible causes The Control Output upper limit in loop table location V 31 is zero The loop is driven into saturation because the error never goes to zero value and changes algebraic sign Q The Control Output value is not zero but it is incorrect A Check the following for possible causes The gain values are entered improperly Remember gains are entered in the loop table in BCD e while the SP and PV are in binary If you are usin
72. his block called Process pono Auto Transfer From from analog input with the cascada i io aeoe information grayed out Checking the box to the left o s Enans of the Auto Transfer From will highlight the z Slot 1 2 Factor information Select O Module then enter the slot t Memes chanet 24 eon number in which the input module resides Next select the analog input channel of your choice The second choice is V Memory When this is 1 0 Module Process Variable selected the V memory address from where the PV Address v2003 mE is transferred must be specified V Auto Transfer From ae Whichever method of auto transfer is used it is 140 Module pede RU wu recommended to check the Enable Filter Factor a c N F B low pass filter and specify the coefficient Output Address V2005 Range Upper Limit 4095 4085 You should also select the analog output for the control output to be transferred to This is done in the PID setup Output dialog shown here The block of information in this dialog is grayed out until the box next to Auto transfer to I O module is checked Once checked enter the slot number where the output module is residing and then enter the analog output channel number Lower Limit 0 0 IV Auto transfer to 1 0 module Slot ep 4 74 Channel NOTE To make changes to any loop table parameters the PID loop must be in Manual mode and the PLC must be stopped If you have selecte
73. in reacts with a rate of change of the error DL06 Micro PLC User Manual 3rd Edition Rev C 8 43 Chapter 8 PID Loop Operation B 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 E 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 amp 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
74. ion Ramp End SP Value re Ramp End SP Value Ramp Slope Ramp Slope Soak Duration 1 Soak Duration V2034 3000 Octal Pointer to R S table Soak PV Deviation ro Soak PV Deviation Ramp End SP Value n Ramp End SP Value Ramp Slope ro Ramp Slope Soak Duration 1 Soak Duration CO NI Nio SaD aA aA BY A CO PY po A Soak PV Deviation y olo 1 al eA B Co G9 PH N Ie CO ry Soak PV Deviation Ramp Soak Table Programming Error Flags Addr 35 The individual bit definitions of the Ramp Soak Table Programming Error Flags word Addr 35 are listed in the following table Further details are given in the PID Loop Mode section and in the PV Alarm section later in chapter 8 R S Error Flag Bit Description Read Write Starting Addr out of lower V memory range read Starting Addr out of upper V memory range read Reserved for Future Use Starting Addr in System Parameter V memory Range read Reserved for Future Use 8 24 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Configure the PID Loop Once the PID table is established in V memory configuring the PID loop continues with the DirectSOFT PID setup configuration dialog You will need to check and fill in the data required to control the PID loop Select Configure and the following dialog wi
75. ion is enabled If it is disabled the Filter Value is not updated On the first scan from Program to Run mode the Filter Value is initialized to 0 to give the e calculation a consistent starting point Since the following binary filter example does not write directly to the PID PV location the BCD filter could be used with BCD values and then converted to BIN FilterB Example Following is an example of how the FilterB IBox is used in a ladder program The instruction is used to filter a binary value that is in V2000 Timer T1 is set to 0 5 seconds the rate at which the filter calculation will be performed The filter constant is set to 3 0 A larger value will increase the smoothing effect of the filter A value of 1 results with no filtering The filtered value will be placed in V2100 C100 Filter Over Time Binary 1 FILTERB Filter Freq Timer Filter Freq Time 0 01 sec Raw Data Binary Filter Divisor 1 100 Filtered Value Binary NOTE See Chapter 5 page 242 for more detailed information DLO06 Micro PLC User Manual 3rd Edition Rev C 8 57 Chapter 8 PID Loop Operation M es Ramp Soak Generator Introduction Our discussion of basic loop operation noted the setpoint for a loop will be generated in various ways depending on the loop operating mode and programming preferences In the figure below the ramp soak generator is one of the ways the SP may be generated It is the responsibility of your ladder
76. ired Setpoint values for each process variables for the duration of one process cycle Step 2 Plan Loop Control Strategy This simply means choosing the method the machine will use to maintain control over the Process Variables to follow their Setpoints This involves many issues and trade offs such as energy efficiency equipment costs ability to service the machine during production and more You must also determine how to generate the Setpoint value during the process and whether a machine operator can change the SP Step 3 Size and Scale Loop Components Assuming the control strategy is sound it is still crucial to properly size the actuator and properly scale the sensors Choose an actuator heater pump etc which matches the size of the load An oversized actuator will have an overwhelming effect on your process after a SP change However an undersized actuator will allow the PV to lag or drift away from the SP after a SP change or process disturbance Choose a PV sensor which matches the range of interest and control for our process Decide the resolution of control you need for the PV such as within 2 C and make sure the sensor input value provides the loop with at least 5 times that resolution at LSB level However an over sensitive sensor can cause control oscillations etc The DL06 provides 12 bit and 15 bit unipolar and bipolar data format options and a 16 bit unipolar option This selection affects SP PV
77. ishes a Suppose that we are able to know a sudden setpoint change is about to occur common in some applications We can avoid much of the resulting error in the first place if we can quickly change the output to the new operating point If we know from previous testing what the operating point bias value will be after the setpoint change we can artificially change the output directly which is feedforward The benefits of using feedforward are The SP PV error is reduced during predictable setpoint changes or loop offset disturbances Proper use of feedforward will allow us to reduce the integrator gain Reducing integrator gain gives us an even more stable control system Feedforward is very easy to use in the DL06 loop controller as shown below The bias term has been made available to the user in a special read write location at PID Parameter Table location V 04 Parameter Table location V 04 Loop Calculation kp P Setpoint Error T be L Control Output EXPO SS 4 3 ki I XXXX Bias Term eres Process Variable kd D 8 70 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation To change the bias operating point ladder logic only has to write the desired value to V 04 The PID loop calculation first reads the bias value from V 04 and modifies the value based on the current integrator calculation Then it writes the resul
78. ladder logic programming both time proportioning eg heaters for temperature control and position actuator eg reversible motor on a valve type of control schemes can be easily implemented This chapter will explain how to set up the PID control loop how to implement the software and how to tune the loop The following block diagram shows the key parts of a PID control loop The path from the PLC to the manufacturing process and back to the PLC is the closed loop control Loop Configuring External and Monitoring Disturbances PLC System i i j Setpoint Value Error Term Loop Control Output gt Manufacturing x Calculation Process i Process Variable DL06 Micro PLC User Manual 3rd Edition Rev C 8 7 Chapter 8 PID Loop Operation Ee Process Control Definitions Manufacturing Process the set of actions that adds value to raw materials The process can involve physical changes and or chemical changes to the material The changes render the material more useful for a particular purpose ultimately used in a final product Process Variable The controlled variable part of the process that you wish to control It may be temperature pressure level flow composition density the ratio of two streams etc Also known as the actual value Setpoint This is the target for the process variable When all conditions of the process are corr
79. large setpoint changes For position form of PID this inhibits integrator action when the control output reaches 0 or 100 speeds up loop recovery when output recovers from saturation Specify a tolerance plus and minus for the error term SP PV so that no change in control output value is made Minimum loop update rate Bumpless Transfer Bumpless Transfer II Anti windup Freeze Bias Error Deadband Alarm Feature Specifications PV Alarm Hysteresis Specify 1 to 200 word binary does not affect all alarms such as PV Rate of Change Alarm PV Alarm Points Select PV alarm settings for Low low Low High and High high conditions PV Deviation Specify alarms for two ranges of PV deviation from the setpoint value Rate of Change Detect when PV exceeds a rate of change limit you specify DLO06 Micro PLC User Manual 3rd Edition Rev C 8 3 Chapter 8 PID Loop Operation i Introduction to PID Control What is PID Control In this discussion we will explain why PID control is used in process control instead of trying to provide control by simply using an analog input and a discrete output There are many types of analog controllers available and the proper selection will depend upon the particular application There are two types of analog controllers that are used throughout industry 1 The ON OFF controller sometimes referred to as an open loop controller 2
80. lations Reverse Acting Loop Although the PID algorithm is used in a direct or forward acting loop controller there are times when a reverse acting control output is needed The DL06 loop controller allows a loop to operate as reverse acting With a reverse acting loop the output is driven in the opposite direction of the error For example if SP gt PV then a reverse acting controller will decrease the output to increase the PV Mx Kixe Mx M Kcexe Kr PV PV Mx Square Root of the Process Variable Square root is selected whenever the PV is from a device such as an orifice meter which requires this calculation Error Squared Control Whenever error squared control is selected the error is calculated as e SP PV x ABS SP PV A loop using the error squared is less responsive than a loop using just the error however it will respond faster with a large error The smaller the error the less responsive the loop Error squared control would typically be used in a PH control application 8 14 DLO0G Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Error Deadband Control With error deadband control no control action is taken if the PV is within the specified deadband area around the setpoint The error deadband is the same above and below the setpoint Once the PV is outside of the error deadband around the setpoint the entire error is used in the loop calculation e
81. le The loop reads from the table during each PID calculation as necessary The ramp soak controls are bits in a special loop table word that control the real time start stop functionality of the ramp soak generator The ladder program can monitor the status of the ramp soak profile current ramp segment number Ramp soak table gt Ramp soak Setpoint Y Loop Control Output Ramp soak controls Generator Calculation Process Variable 8 58 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Now that we have described the general ramp soak generator operation we list its specific features Each loop has its own ramp soak generator use is optional You may specify up to eight ramp soak steps 16 segments The ramp soak generator can run any time the PLC is in Run mode Its operation is independent of the loop mode Manual or Auto Ramp soak real time controls include Start Hold Resume and Jog Ramp soak monitoring includes Profile Complete Soak Deviation SP minus PV and current ramp soak step number The following figure shows an SP profile consisting of ramp soak segment pairs The segments are individually numbered as steps from 1 to 16 The slope of each of the ramp segments may be either increasing or decreasing The ramp soak generator automatically knows whether to increase or decrease the SP based on the relative values of a ramp s end point
82. ll appear for this process Loop 1 Loop 2 Dec Configure SP PV Output Tuning amp Algorithm SP P amp Output Format Loop Mode Position C Velocity Common format I Independent C Independent format of CPU mode Sample Rate 0 05 sec Common Data Format Unipolar data format Bipolar data format Forward Acting C Reverse Acting marse Mo 12 bit data format f Bumpless 15 bit data format C Bumpless ll 16 bit data format Select the Algorithm Type e Chose either Position or Velocity The default algorithm is Position This is the choice for most applications which include heating and cooling loops as well as most position and level control loops A typical velocity control will consist of a process variable such as a flow totalizer in a flow control loop Enter the Sample Rate The main tasks of the CPU fall into categories as shown to the right The list represents the tasks done when the CPU is in Run Mode on pe each PLC scan Note that PID loop calculations occur after the ladder m logic task Service The sample rate of a control loop is simply the frequency of the PID EE calculation Each calculation generates a new control output value With e the DL06 CPU you can set the sample rate of a loop from 50 ms to PLC Program 99 99 seconds Most loops do not require a fresh PID calculation on can i every PLC scan Some loops may need to be calculated onl
83. m 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 296 then the step change on the output is increased to 2096 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 296 output is changed at 2096 Open Loop Auto Tune Cycle Wave Step PV Tangent f Rr Slope SP Process Wave LrRr Er sec za YA Step Change Am 10 Output Value Time sec Auto Tune Cycle PID Cycle Sie pai r PID Cycle bs Auto Tune Start Auto Turfe End 8 46 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation When the loop tuning observations are complete the loop controller computes Rr P g p P P 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 PID Tuning PI Tuning P 1 2 Am LrRr P 0 9 Am LrRr l 2 0 Lr 1 3 33 Lr D 0 5 Lr D 0 Sample Rate 0 056 Lr Sample Rate 0 12 Lr Am Output step change 10 0 1 20
84. mp End SP Value Ramp Slope Ramp Slope Soak Duration Soak Duration Soak PV Deviation Soak PV Deviation Ramp End SP Value Ramp End SP Value Ramp Slope Ramp Slope Soak Duration Soak Duration Soak PV Deviation Soak PV Deviation Ramp End SP Value Ramp End SP Value Ramp Slope Ramp Slope Soak Duration Soak Duration Soak PV Deviation Soak PV Deviation CO N N g o A Al a BY CY CO NIN 8 60 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation EEEEEEIIEIMIEIIGGGUSSG GO LELLIIC QLULLL OQCOORELLEDLCL LELELLELLLLLLLLCOU KLQOLUOLS CALL EAPLGILEULTLLUqLCRPRSLLLLEELLBLSCERLLULULEL CLLULU PBPEEOOALLLCLeLIEGLHLLOODELOLLL LZECILLTLCELRLCLCLLLLCELRHGOGSEAOAGRQ 2 Many applications do not require all 16 R S steps Use all zeros in the table for unused steps The R S generator ends the profile when it finds ramp slope 0 Ramp Soak Table Flags The individual bit definitions of the Ramp Soak Table Flag Addr 33 word is listed in the following table Ramp Soak Flag Bit Description Read Write Bit 1 0 Start Ramp Soak Profile write 01 Start 1 Hold Ramp Soak Profile write 01 Hold 2 Resume Ramp Soak Profile write 01 Resume 3 Jog Ramp Soak Profile write 01 Jog 4 Ramp Soak Profile Complete read Complete 5 PV Input Ramp Soak Deviation read
85. mpless transfer available Full featured alarms Ramp soak generator with up to 16 segments Auto Tuning The DL06 CPU has process control loop capability in addition to ladder program execution You can select and configure up to eight loops All sensor and actuator wiring connects directly to DLOG analog modules All process variables gain values alarm levels etc associated with each loop reside in a Loop Variable Table in the CPU The DL06 CPU reads process variable PV inputs during each scan Then it makes PID loop calculations during a dedicated time slice on each PLC scan updating the control output value The control loops use a Proportional Integral Derivative PID algorithm to generate the control output This chapter describes how the loops operate and how to configure and tune the loops Analog Input DLO6 PID Loop Calculations CE Analog Output DirectSOFT programming software release 5 or later is used for configuring analog control loops in the DL06 DzrectSOFT 5 uses dialog boxes to help you set up the individual loops After completing the setup you can use DirectSOFT s PID Trend View to tune each loop The configuration and tuning selections you make are stored in the DL06 s V memory RAM The loop parameters also may be saved to disk for recall later 8 2 DLO06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation EERIE EEE PID Loop Feature Specifications Number
86. nated by setting Ti 9999 When this is done the 8 user may then manually control the bias term Mx to eliminate any steady state offset Eliminating Derivative Action The effect of derivative action on the output may be eliminated by setting Td 0 most loops do not require a D parameter it may make the loop unstable Eliminating Proportional Action Although rarely done the effect of proportional term on the output may be eliminated by setting Kc 0 Since Kc is also normally a multiplier of the integral coefficient Ki and the derivative coefficient Kr the CPU makes the computation of these values conditional on the value of Kc as follows Ki Kc Is Ti ifKc 0 Ki Ts Ti if Kc 0 Lor ID only Kr Kc Td Ts ifKc 0 Kr Td Ts if Kc 0 ID or D only Velocity Form of the PID Equation The standard position form of the PID equation computes the actual actuator position An alternative form of the PID equation computes the change in actuator position This form of the equation is referred to as the velocity PID equation and is obtained by subtracting the equation at time n from the equation at time n 1 The velocity equation is given by AM M M AM Kc x en ep1 Ki PV 2 PV PV 8 12 DLO0G Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Bumpless Transfer The DLO6 loop controller provides for bumpless mode changes A bumpless transfer from man
87. nd 3 write 12 bit 15 bit 13 Output data format 16 bit select See Notes 2 and 3 write not 16 bit select16 bit 14 15 Reserved for future use NOTE 1 Bit 7 can be used to cancel Autotune mode by setting it to 0 mE NOTE 2 If the value in bit 9 is 0 then the values in bits 0 and 1 are read If the value in bit 9 is 1 then the values in bits 0 and 1 are not read and bit 9 defines the data format the range is automatically unipolar ionis NOTE 3 If the value in bit 10 is 0 then the values in bits 0 1 and 9 define the input and output ranges and data formats the values in bits 11 12 and 13 are not read If the value in bit 10 is 1 then the values in bits 0 1 and 9 define only the input range and data format and bits 11 12 and 13 are read and define the output range and data format the output range and data format If bit 10 and bit 13 each have a value of 1 then bits 11 and 12 are NOTE 4 If bit 10 has a value of 1 and bit 13 has a value of 0 then bits 11 and 12 are read and define not read and bit 13 defines the data format the output range is automatically unipolar 8 22 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation M Mode Alarm Monitoring Word Addr 06 The individual bit definitions of the Mode Alarm monitoring Addr 06 word are listed in the following table Mode Alarm Bit Description Read Write Bit 1 Manual Mode Indication read Manual
88. ng an actual process cycle You will need to have completed the programming which will generate the desired SP in real time In this step you may want to run a small test batch of product through the machine watching the SP change according to the recipe WARNING Be sure the Emergency Stop and power down provision is readily accessible in case the process goes out of control Damage to equipment and or serious injury to personnel can result from loss of control of some processes Step 10 Save Parameters When the loop tests and tuning sessions are complete be sure to save all loop setup parameters to disk DL06 Micro PLC User Manual 3rd Edition Rev C 8 1 7 Chapter 8 PID Loop Operation EEE PID Loop Setup Some Things to Do and Know Before Starting Have your analog module installed and operational before beginning the loop setup refer to the DL05 06 Option Modules User Manual DO OPTIONS M The DL06 PLC gets its PID loop processing instructions from V memory tables There isn t a PID instruction that can be used in RLL such as a block to setup the PID loop control Instead the CPU reads the setup parameters from system V memory locations These locations are shown in the table below for reference only they can be used in a RLL program if needed Address Setup Parameter Data type Ranges Read Write Loop Parameter V1200 V7340 A V7640 Table Pointer Octal V10000 V17740 write V7641 Number of Loops BCD 1 8 write V7642
89. nt Society of America Author Robert P Benedict ISBN 1 55617 516 7 Publisher John Wiley and Sons ISBN 0 471 89383 8 Process Industrial Instruments amp Controls Handbook Fourth pH Measurement and Control Second Edition Edition Author Gregory K McMillan uthor Editor in Chief Douglas M Considine Publisher Instrument Society of America Publisher McGraw Hill Inc ISBN 0 07 012445 0 ISBN 1 55617 483 7 rogrammable Controllers Concepts and Applications First Fundamentals of Programmable Logic Controllers Sensors and dition Communications uthors C T Jones and L A Bryan Author Jon Stenerson ublisher International Programmable Controls Publisher Prentice Hall ISBN 0 13 726860 2 BN 0 915425 00 9 gt O59 2 En rocess Control Third Edition Instrument Engineers Handbook Process Measurement and Analysis Third Edition Instrument uthor Editor in Chief Bela G Liptak Engineer s Handbook ublisher Chilton ISBN 0 8019 8242 1 Author Editor in Chief Bela G Liptak Publisher Chilton ISBN 0 8019 8197 2 CAU DLO06 Micro PLC User Manual 3rd Edition Rev C 8 79
90. ocess to be recognized Composition analyzers and quality control are usually sources of significant dead time Loop Configuring Operator initiated selections which set up and optimize the performance of a control loop The loop calculation function uses the configuration parameters in real time to adjust gains offsets etc Loop Monitoring The function which allows an operator to observe the status and performance of a control loop This is used in conjunction with the loop configuring to optimize the performance of a loop minimize the error term 8 8 DLO06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation l PID Loop Operation The Proportional Integral Derivative PID algorithm is widely used in process control The PID method of control adapts well to electronic solutions whether implemented in analog or digital CPU components The DL06 CPU implements the PID equations digitally by solving the basic equations in software I O modules serve only to convert electronic signals into digital form or vice versa The DLO0G uses two types of PID controls position and velocity These terms usually refer to motion control situations but here we use them in a different sense PID Position Algorithm The control output is calculated so it responds to the displacement position of the PV from the SP error term PID Velocity Algorithm The control output is calculated to represent the
91. ode 1 Setting V 00 1 loop is independent of PLC mode Bit 1514131211109 87 65 4 3 21 0 Loop Modes Mode change huomasi Mode change If bit 15 is set to one then the loops will run independently of the CPU mode It is like having two independent processors in the CPU one is running the RLL program and the other is running the process loops 8 28 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation E Having the ability to run loops independently of the RLL program makes it feasible to make a ladder logic change while the process is still running This is especially beneficial for large mass continuous processes that are difficult or costly to interrupt The independent of CPU is the feature used for this If you need to operate the PID loops while the RLL program is halted in Program Mode either select the Independent of CPU mode in the dialog or edit your program to set and reset bit 15 of PID Mode 1 word V 00 in your RLL program If the bit is set to a zero the loop will follow the CPU mode then when the CPU is placed in the Program Mode all loops will be forced into the Manual Mode When Independent of CPU mode is used you should also set the PV to be read directly from an analog input module This can easily be done in the PID setup dialog SP PV The SP PV dialog has a block entitled Process Variable There is a block within t
92. of loops Selectable 8 maximum CPU V memory needed 32 words V locations per loop selected 64 words if using ramp soak PID algorithm Position or Velocity form of the PID equation Control Output polarity Selectable direct acting or reverse acting Error term curves Selectable as linear square root of error and error squared Loop update rate time between PID calculation 0 05 to 99 99 seconds user programmable 0 05 seconds for 1 to 4 loops 0 1 seconds for 5 to 8 loops Loop modes Automatic Manual operator control or Cascade control Ramp Soak Generator Up to 8 ramp soak steps 16 segments per loop with indication of ramp soak step number PV curves Select standard linear or square root extract for flow meter input Set Point Limits Specify minimum and maximum setpoint values Process Variable Limits Specify minimum and maximum Process Variable values Proportional Gain Specify gains of 0 01 to 99 99 Integrator Reset Specify reset time of 0 1 to 99 99 in units of seconds or minutes Derivative Rate Specify the derivative time from 0 01 to 99 99 seconds Rate Limits Specify derivative gain limiting from 1 to 20 Automatically sets the bias equal to the control output and the setpoint equal to the process variable when control switches from manual to automatic Automatically sets the bias equal to the control output when control switches from manual to automatic Step Bias Provides proportional bias adjustment for
93. ol Output gt ae E Process Variable The P I and D gains are 4 digit BCD numbers with values from 0000 to 9999 They contain an implied decimal point in the middle so the values are actually 00 00 to 99 99 Some gain values have units Proportional gain has no unit Integral gain may be selected in seconds or in minutes and Derivative gain is in seconds Gain Proportional Gain This is the most basic gain of the three Values range from 0000 to 9999 but they are used internally as xx xx An entry of 0000 effectively removes the proportional term from the PID equation This accommodates applications which need integral only loops Reset Integral Gain Values range from 0001 to 9998 but they are used internally as xx xx An entry of 0000 or 9999 causes the integral gain to be effectively removing the integrator term from the PID equation This accommodates applications which need proportional only loops The units of integral gain may be either seconds or minutes as shown in the above dialog Rate Derivative Gain Values which can be entered range from 0001 to 9999 but they are used internally as XX XX An entry of 0000 allows removal of the derivative term from the PID equation a common practice This accommodates applications which require only proportional and or integral loops Most control loops will operate as a PI loop 8 32 DL06 Micro PLC U
94. own below Kpc 4M a X0 Tpc 0 M Amplitude of output PID Tuning PI Tuning P 0 45 Kpc P 0 30 Kpc 2 0 60 Tpc 1 00 Tpc D 0 10 Tpc D 0 Sample Rate 0 014 Tpc 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 8 48 DL06 Micro PLC User Manual 3rd Edition Rev C 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 gt Data View gt New the keyboard shortcut Ctrl Shift F3 or the Data button on the Status toolbar By default the Data View window is assigned Datal 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
95. p is called the minor loop and the outside loop is called the major loop For overall stability the minor loop must be the fastest responding loop of the two try a factor of 10 for a better response time We do have to add the additional sensor to measure the intermediate variable PV for process A Notice the setpoint for the minor loop is automatically generated for us by using the output of the major loop Once the cascaded control is programmed and debugged we only need to deal with the original setpoint and process variable at the system level The cascaded loops behave as one loop but with Setpoint Loop B Output B Setpoint X LoopA Calculation Major Loop Calculation Minor Loop External External Disturbances Disturbances Output A Process A Process B secondary primary PV Process A PV Process B improved performance over the previous single loop solution One of the benefits to cascade control can be seen by examining its response to external disturbances Remember the minor loop is faster acting than the major loop Therefore if a DLO06 Micro PLC User Manual 3rd Edition Rev C 8 65 Chapter 8 PID Loop Operation Cascaded Loops in the DL06 CPU In the use of the term cascaded loops we must make an important distinction Only the minor loop will actually be in the Cascade Mode In normal operation the major loop must be in Auto Mod
96. pecified The use of this filter is recommended during closed loop auto tuning If the Independent format had been checked previously make the Data format selections here NOTE The SP PV dialog can be left as it first appears for basic PID operation Set Control Output Limits Another dialog that will be available in the PID setup will be the Output dialog The control output address V 05 determined by the PID loop table beginning address will be in view Enter the output range limits Upper Limit and Lower Limit that will meet the requirement of the process and which will agree with the data format that has been selected For a basic PID operation using a 12 bit output module set the Upper Limit to 4095 and leave the Loop 1 Loop 2 Doc Configure SP Pv SL Output E Address 2005 pa Upper Limit 4085 4095 Lower Limit 0 0 T Auto transfer to 1 0 module VUE o te toe sojo el Chernet f0 f Lower Limit set to 0 Check the box next for Auto transfer to I O module if there is a need to send the control output to a certain analog output module as in the case of using the Loop Mode independent of CPU Mode otherwise the PID output signal cannot control the analog output when the PLC is not in RUN Mode If the Auto transfer to I O module feature is checked all channels of the module must be used for PID control outputs If Independent format has been previously chosen the Output Data Format
97. 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 8 2uH DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Auto Tuning Procedure 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 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 consider the impact of any changes to minimize the risk of injury to personnel or damage to equipment The auto tune in the DLOG is not intended to be used as a replacement for your process knowledge Once the physical loop components are connected to the PLC auto tuning can be initiated within DirectSOFT
98. rate of change velocity for the PV to become equal to the SP Position Form of the PID Equation Referring to the control output equation on page 8 6 the DL06 CPU approximates the output M t using a discrete position form of the PID equation Let Ts Sample rate E Kc Proportional gain Ki Kc Ts Ti Coefficient of integral term Kr Kc Td Ts Coefficient of derivative term Ti Reset or integral time Td Derivative time or rate SP Setpoint PV Process variable at n sample en SP PV Error at ntt sample M Value to which the controller output has been initialized Then M Control output at n sample M Ke xe Ki X ej Kr e ep1 M This form of the PID equation is referred to as the position form since the actual actuator position is computed The velocity form of the PID equation computes the change in actuator position The CPU modifies the standard equation slightly to use the derivative of the process variable instead of the error as follows M Kc e Ki gt e Kr PV PV M These two forms are equivalent unless the setpoint is changed In the original equation a large step change in the setpoint will cause a correspondingly large change in the error resulting in a bump to the process due to derivative action This bump is not present in the second form of the equation DLO06 Micro PLC User Manual 3rd Edition Rev C 8 9 Chapter 8 PID Loop Operation mE
99. s The panel s mode indicators do not connect to the switches but interface to the corresponding data locations Operator s Panel ru Manual T Auto Mode Request Mode Monitorin Cascade 3 PID Mode 1 Setting V 00 my Loop Mode and Alarm Status V 06 Bit 15 14131211109 8 7 65 4 8 2 1 0 Bit 1514131211109 8 7 65 4 8 2 1 0 8 PLC Modes Effect on Loop Modes If you have selected the option for the loops to follow the PLC mode the PLC modes Program Run interact with the loops as a group The following summarizes this interaction When the PLC is in Program Mode all loops are placed in Manual Mode and no loop calculations occur However note that output modules including analog outputs turn off in PLC Program Mode So actual manual control is not possible when the PLC is in Program Mode The only time the CPU will allow a loop mode change is during PLC Run Mode operation As such the CPU records the modes of all 4 loops as the desired mode of operation If power failure and restoration occurs during PLC Run Mode the CPU returns all loops to their prior mode which could be Manual Auto or Cascade e On a Program to Run mode transition the CPU forces each loop to return to its prior mode recorded during the last PLC Run Mode You can add and configure new loops only when the
100. s These values come from the ramp soak table 15 16 14 13 Ramp Soak Ramp Soak Step SP Ramp Soak Table Memory Space The parameters which define the ramp soak profile for a loop are in a ramp soak table Each User Data loop may have its own ramp soak table but it is optional Recall the Loop Parameter table consists v2000 LOOP 1 voos4 V2037 32 words 3000 octal of a 32 word block of memory for each loop and v2040 ERN together they occupy one contiguous memory v2077 RR V2074 area However the ramp soak table for a loop is y 3600 Octal individually located because it is optional for each yi loop An address pointer in location V 34 in the V3000 Ramp Soak 1 k loop table specifies the starting location of the 32 words ramp soak table i In the example to the right the loop parameter 1 tables for Loop 1 and 2 occupy contiguous 32 word blocks as shown Each has a pointer to its V3600 Ramp Soak 2 y ramp soak table independently located elsewhere B2 Words in user V memory Of course you may locate all the tables in one group as long as they do not overlap DL06 Micro PLC User Manual 3rd Edition Rev C 8 59 Chapter 8 PID Loop Operation i The parameters in the ramp soak table must be user defined the most convenient way is to use DirectSOFT which features a special editor for this table Four parameters are required to define a ramp an
101. se filtering Because of the rounding error you should not use zero or full scale as alarm points Additionally the smaller the filter constant the greater the smoothing effect but the slower the response time Be sure a slower response is acceptable in controlling your process SP1 Loads the analog signal which is a BCD value V Doo and has been loaded from V memory location I V2000 into the accumulator Contact SP1 is always on Converts the BCD value in the accumulator BIN to binary This instruction is not needed if the analog value is originally brought in as a binary number BTOR Converts the binary value in the accumulator to a real number Subtracts the real number stored in location SUBR 1400 from the real number in the V1400 accumulator and stores the result in the accumulator V1400 is the designated workspace in this example Multiplies the real number in the MULR accumulator by 0 2 the filter factor and stores the result in the accumulator This is the filtered value Adds the real number stored in ADDR location V1400 to the real number V1400 filtered value in the accumulator and stores the result in the accumulator Copies the value in the accumulator OUTD i V1400 to location V1400 Converts the real number in the accumulator to a binary value and stores the result in the accumulator RTOB Converts the binary value in the acc
102. ser Manual 3rd Edition Rev C Chapter 8 PID Loop Operation NOTE You may elect to leave the tuning dialog blank and enter the tuning parameters in the DirectSOFT PID View Loop Calculation Proportional Control i utput Setpoint Error Term 4 i Integral 5 Outp d 9 L Derivative bi Process Variable Derivative gain limited a SERES Loop Tabl e d V 25 OOXX Derivative Gain Limit Derivative Gain Limiting The derivative gain rate has an optional gain limiting feature This is provided because the derivative gain reacts badly to PV signal noise or other causes of sudden PV fluctuations The function of the gain limiting The gain limit can be particularly useful during loop tuning Most loops can tolerate only a little derivative gain without If this option is checked a Limit from 0 to 20 must also be entered NOTE When first configuring a loop it s best to use the standard error term until after the loop is 4 is shown in the diagram below going into uncontrolled oscillations Bit 15 141312111098 76543210 PID Mode 1 Setting V 00 Derivative gain limit select tuned Once the loop is tuned you will be able to tell if these functions will enhance control The Error Squared and or Enable Deadband can be selected later in the PID
103. ses If the operator responds to a PV Rate of Change Alarm quickly and effectively the PV absolute value will not reach the point where the material in process would be ruined The DLO6 loop controller provides a programmable PV Rate of Change Alarm as shown below The rate of change is specified in PV units change per loop sample time This value is programmed into the loop table location V 21 PV slope OK PV slope excessive Loop Table V 21 XXXX PV Rate of Change Alarm PV x Pd PID Mode and Alarm Status V 06 A rate of change alarm le Bit 15 14131211109 8 76543210 Sample time Sample time F PV Rate of e Change Alarm As an example suppose the PV is the temperature for your process and you want an alarm whenever the temperature changes faster than 15 degrees minute The PV counts per degree and the loop sample rate must be known Then suppose the PV value in V 03 location represents 10 counts per degree and the loop sample rate is 2 seconds Use the formula below to convert our engineering units to counts sample period 15 degrees 10 counts degree 150 Alarm Rate of Change 9 X 9 5counts sample period 1 minute 30 loop samples min 30 From the calculation result you would program the value 5 in the loop table for the rate of change The PV Rate of Change Alarm can be independently enabled and disabled from t
104. t back to location V 04 This arrangement creates a sort of transparent bias term All you have to do to implement feed forward control is write the correct value to the bias term at the right time see the following example once at the moment when the new bias operating point is to occur If ladder logic writes the bias NOTE When writing the bias term one must be careful to design ladder logic to write the value only value on every scan the loop s integrator is effectively disabled Feedforward Example How do we know when to write to the bias term and what value to write Suppose we have an oven temperature control loop and we have already tuned the loop for optimal performance Refer to the figure below We notice that when the operator opens the oven door the temperature sags a bit while the loop bias adjusts to the heat loss Then when the door closes the temperature rises above the SP until the loop adjusts again Feedforward control can help diminish this effect Oven door PV Bias Closed Open PV excess L dme p oq oq 99e el Closed First we record the amount of bias change the loop controller generates when the door opens or closes Then we write a ladder program to monitor the position of an oven door limit switch When the door opens our ladder program reads the current bias value from V 04 adds the desired change amount and writes it back to V 04 When the door closes
105. table R S Profile in Hold 1 when the profile was active but is now in hold Ramp Soak Settings V 33 The number of the current step is available in the upper 8 bits Ramp Soak Settings V 33 of the Ramp Soak Settings V 33 word The bits represent a 2 digit hex number ranging from 1 to 10 Ladder logic can monitor these to synchronize other parts of the program with Current Profile Step 2 digit hex the ramp soak profile Load this word to the accumulator and Value 01 to 10 hex shift right 8 bits and you have the step number ee Bit 514131211109 8 76543210 Ramp Soak Programming Errors The starting address for the ramp soak table must be a valid Ramp Soak Table Error V 35 location If the address points outside the range of user V memory one of the bits to the right will turn on when the Bit 15 141312111098 765 4 32 1 0 Starting Address set in ramp soak generator is started We recommend using reserved system V memory DirectSOFT to configure the ramp soak table It automatically starting Address set out of range checks the addresses for you ad lal Starting Address set out Testing Your Ramp Soak Profile of V memory lower range It s a good idea to test your ramp soak profile before using it to control the process This is easy to do because the ramp soak generator will run even when the loop is in Manual Mode
106. ter 8 PID Loop Operation Cascade Control Introduction Using cascaded loops is an advanced control technique superior to individual loop control in certain situations As the name implies cascade means that one loop is connected to another loop In addition to Manual open loop and Auto closed loop Modes the DL06 also provides Cascaded Mode NOTE Using cascaded loops is an advanced process control technique therefore we recommend their use only for experienced process control engineers When a manufacturing process is complex and contains a lag time from control input to process variable output even the most perfectly tuned single loop around the process may yield slow and inaccurate control It may be the actuator operates on one physical property which eventually affects the process variable measured by a different physical property Identifying the intermediate variable allows us to divide the process into two parts as shown Control input following figure PROCESS Intermediate Process Process A Variable Process B Variable PV in 7 E The principle of cascaded loops is simply that we add another process loop to more precisely control the intermediate variable This separates the source of the control lag into two parts as well The diagram below shows a cascade control system showing that it is simply one loop nested inside another The inside loo
107. their operation also depends on which PID algorithm you are using the position or velocity form of the PID equation Note that you must use Bumpless Transfer type I when using the 8 velocity form of the PID algorithm Transfer Type SES PID Algorithm Manual to Auto Auto to Cascade Transfer Action Transfer Action Position Forces Bias Control Output Forces Major Loop Output Bumpless 0 Forces SP PV Minor Loop PV Transfer Velocity Forces SP PV Forces Major Loop Output Minor Loop PV Bumpless Position Forces Bias Control Output none Transfer II Velocity none none The transfer type can also be selected in an RLL program by setting bit 3 of PID Mode 1 V 00 setting as shown PID Mode 1 Setting V 00 Bumpless Transfer I II Select Bit 15 14 131211109 8 7 65 4 3 210 SP PV amp Output Format This block allows you to select either Common format or Independent format Common format is the default and is most commonly used With this format both SP PV and Output will have the same data structure Both will have the same number of bits and either bipolar or unipolar If Independent format is selected the data structure selections will be grayed out The reason for this is that they become independently selectable in the SP PV and the Output dialogs Common Data Format Select either Unipolar data format which is positive data only in 12 bit
108. thematically derived control systems In addition the DL06 has built in PID control algorithms that can be implemented The basic function of PID closed loop process control is to maintain certain process characteristics at desired setpoints As a rule the process deviates from the desired setpoint reference as a result of load material changes and interaction with other processes During this control the actual condition of the process characteristics liquid level temperature motor control etc is measured as a process variable PV and compared with the target setpoint SP When deviations occur an error is generated by the difference between the process variable actual value and the setpoint desired value Once an error is detected the function of the control loop is to modify the control output in order to force the error to zero 8 The DLO06 PID control provides feedback loops using the PID algorithm The control output is computed from the measured process variable as follows Let K proportional gain T Reset or integral time Tg Derivative time or rate SP Setpoint PV t Process Variable at time t e t SP PV t PV deviation from setpoint at time t or PV error Then M t Control output at time t t M Kc e t 1 7 f eG dx Ty didt et M The analog input module receives the process variable in analog form along with an operator entered setpoint the CPU computes the error
109. ting it in the dialog Bit 10 of PID Mode 1 Setting V 00 word can also be set in RLL end of the data range If you have set limits on the control output other than the range i e 0 4095 for a unipolar 12 bit loop the bias term still uses the end of range for the stopping point and bias freeze will not work f NOTE The freeze bias feature stops the bias term from changing when the control output reaches the 8 34 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation E Setup the PID Alarms Although the setup of the PID alarms is optional you surely would not want to operate a process without monitoring it The performance of a process control loop may generally be measured by how closely the process variable matches the setpoint Most process control loops in industry operate continuously and will eventually lose control of the PV due to an error condition Process alarms are vital in early discovery of a loop error condition and can alert plant personnel to manually control a loop or take other measures until the error condition has been repaired The alarm thresholds are fully programmable and each type of alarm may be independently enabled and monitored The following diagram shows the Alarm dialog in the PID setup which simplifies the alarm setup Loop 1 Loop 2 Monitor Limit Alarms 1 Enable PV Deviation Alarms HighHigh 0 Red 0 High Yellow 0 0 Low 0 Alarm hysteresis Low Low
110. tune function calculates the gains and the sample time It automatically places the results in the corresponding registers in the loop table DLO06 Micro PLC User Manual 3rd Edition Rev C 8 47 Chapter 8 PID Loop Operation EM 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 SP mE dU NE EI Process Wave Output Value i i 3 n gt lt gt To PID Cycle z gt a PID Cycle Auto Tune Cycle Auto Tune Start Auto Tune End Calculation of 8 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 sh
111. ual mode to automatic mode is achieved by preventing the control output from changing immediately after the mode change When a loop is switched from Manual mode to Automatic mode the setpoint and Bias are initialized as follows Position PID Algorithm Velocity PID Algorithm SP PV SP PV Mx M The bumpless transfer feature of the DLO06 is available in two types Bumpless I and Bumpless II see page 8 26 The transfer type is selected when the loop is set up Loop Alarms The DL06 allows the user to specify alarm conditions that are to be monitored for each loop Alarm conditions are reported to the CPU by setting up the alarms in DirectSOFT using the PID setup alarm dialog when the loop is setup The alarm features for each loop are PV Limit Specify up to four PV alarm points High High PV rises above the programmed High High Alarm Limit High PV rises above the programmed High Alarm Limit Low PV fails below the Low Alarm Limit Low Low PV fails below the Low Low Limit PV Deviation Alarm Specify an alarm for High and Low PV deviation from the setpoint Yellow Deviation An alarm for High High and Low Low PV deviation from the setpoint Orange Deviation may also be specified When the PV is further from the setpoint than the programmed Yellow or Orange Deviation Limit the corresponding alarm bit is activated Rate of Change This alarm is set when the PV changes faster than a specified rate of change limit
112. umulator BCD to a BCD number Note the BCD instruction is not needed for PID loop PV loop PV is a binary number OUT Loads the BCD number filtered value from the accumulator into location V1402 to use V1402 h er in your application or PID loop 8 56 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Use the DirectSOFT 5 Filter Intelligent Box Instruction For those who are using DirectSOFT 5 you have the opportunity to use Intelligent Box IBox instruction IB 402 Filter Over Time in Binary decimal This Box will perform a first order filter on the Raw Data on a defined time interval The equation is New Old Raw Old FDC where VIXA New New Filtered Value Filter Over Time Binary Old Old Filtered Value FILTERB IB 402 FDC Filter Divisor Constant Filter Freq Timer TO 3 e Filter Freq Time 0 01 sec Raw Data Binary Filter Divisor 1 100 Filtered Value Binary Raw Raw Data x e The Filter Divisor Constant is an integer in the range K1 to K100 such that if it equaled K1 then no filtering is performed z e 5 The rate at which the calculation is performed is specified by time in hundredths of a second 0 01 seconds as the Filter Freq Time parameter Note that this Timer instruction is embedded in the IBox and must NOT be used any other place in your program Power flow controls whether the calculat
113. uning the auto tuning procedure will automatically calculate the sample rate in addition to the PID gains 8 40 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Manual Tuning Procedure It is not necessary to try to obtain the best values for the P I and D parameters in the PID loop by trial and error Following is a typical procedure for tuning a temperature control loop which you may use to tune your loop Monitor the values of SP PV and CV with a loop trending instrument or use the PID View feature in DirectSOFT see page 8 49 vertical scale feature for both SP PV area and Bias Control Output areas The auto scaling feature would otherwise change the vertical scale on the process parameters and add confusion to the loop tuning process NOTE We recommend using the PID View Tuning and Trending window to select manual for the Adjust the gains so the Proportional Gain 0 5 or 1 0 1 0 is a good value based on experience Integral Gain 9999 this basically eliminates reset and Derivative Gain 0000 This disables the integrator and derivative terms and provides some proportional gain Check the bias value in the PID View and set it to zero Set the SP to a value equal to 5096 of the full range Now select Auto Mode If the loop will not stay in Auto Mode check the troubleshooting tips at the end of this chapter Allow the PV to stabilize around the 5096 point of the range 60
114. ussed in another section Setup PID Loop 1 Loop 2 sP Pv Output Tuning Alarms X Table Location 2722 272 Change Ramp Soak Enable Copy Help E a Complete the PID Setup Once you have filled in the necessary information for the basic PID setup the configuration should be saved The icons on the Setup PID dialog will allow you to save the configuration to the PLC and to disk The save to icons have the arrow pointing to the PLC and disk The read from icons have the arrows pointing away from the PLC and disk An optional feature is available with the Doc tab in the Setup PID window You enter a name and description for the loop This is useful if there is more than one PID loop in your application x Loop 1 Loop 2 Doc Configure SP PV Output Tuning gt c Title Loop Title Dm EM r Comment P _ Save to disk Add your personalized documentation for this loop Save to PLC NOTE It is good practice to save your project after setting up the PID loop by selecting File from the menu toolbar then Save project gt to disk In addition to saving your entire project all the PID parameters are also saved DLO06 Micro PLC User Manual 3rd Edition Rev C 8 39 Chapter 8 PID Loop Operation ee PID Loop Tuning Once you have set up a PID loop it must be tuned in order for it to work The goal of loop tuning is to adjust the loop gains so the loop
115. ut 2 V2002 Input 3 V2004 Input 4 V2006 _FirstScan LD SFO 1 1 Keano Note The inputs will be read in binary format 0 4095 only if the temperature does not OUT go above 409 5 degrees Full range is 65535 which equates to 6 553 5 degrees since the Slot 1 data format amp no RTD card reads directly in tenths of a degree The input resolution of the PID loop needs of channels to be set based on the max temperature of the application since the RTD card is always vroo 16 bit resolution DA ji 02000 OUT Slot 1 Input pointer vro1 Setthe RTD type to platinum 100 ohm _FirstScan LD SPO 2 ia OUT jPtt 0 RTD V703 Set to read degrees F and select up scale burnout _FirstScan Lo SP0 3 KO OUT Degrees F V704 OUT Burnout V706 Program continued on next page 8 72 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation MMMM Example program continued Set up for a F0 2AD2DA 2 for Slot 2 to use both inputs and outputs The inputs and outputs will be read in binary format 0 4095 Input Ch 12 V2010 Input Ch 27 V2011 Output Ch 1 V2020 Output Ch 2 V2021 _FirstScan LD i 4 1 K8282 OUT Slot 2 data format amp no of channels V710 LDA ji 02010 IOUT Slot 2 Input pointer vn LDA 02020 QUT Slot 2 Output pointer vn2 Store the binary value for RTD input
116. vel highway the speed is maintained at 70 mph thus no error since the error would be SP PV 0 When the car goes up the hill the speed sensor detected a slow down of the car SP PV error The proportional gain would cause the output of the speed controller to bring the car back to the setpoint of 70 mph This would be the Controlled Output Integral this term is often referred to as Reset action It provides additional compensation to the control output which causes a change in proportion to the value of the error over a period of time In other words the reset term is the integral sum of the error values over a period of time Derivative this term is referred to as rate The Rate action adds compensation to the control output which causes a change in proportion to the rate of change of error Its job is to anticipate the probable growth of the error and generate a contribution to the output in advance DLO06 Micro PLC User Manual 3rd Edition Rev C 8 5 Chapter 8 PID Loop Operation i Introducing DLO6 PID Control The DLO6 is capable of controlling a process variable such as those already mentioned As previously mentioned the control of a variable such as temperature at a given level setpoint as long as there are no disturbances cold water in the process The DL06 PLC has the ability to directly accept signals from electronic sensors such as thermocouples pressure VFDs etc These signals may be used in ma
117. way to solve the problem is to simply clamp the normalized bias between 0 0 and 1 0 The DL06 CPU does this However if this is the only thing that is done then the output will not move off 0 0 thus opening the valve until the PV has become less than the SP This will also cause the process variable to undershoot The DL06 CPU is programmed to solve the overshoot problem by either freezing the bias term or by adjusting the bias term 8 10 DL06 Micro PLC User Manual 3rd Edition Rev C Chapter 8 PID Loop Operation Freeze Bias If the Freeze Bias option is selected when setting up the PID loop discussed later then the CPU simply stops changing the bias Mx whenever the computed normalized output M goes outside the interval 0 0 to 1 0 Mx Kixe Mx M Kc x e Kr PV PV Mx 0 if M lt 0 M if0 lt SMS1 1 M M M ifM gt 1 Mx Mx if0 lt M lt 1 Mx Mx otherwise Thus in this example the bias will probably not go all the way to zero so that when the PV does begin to come down the loop will begin to open the valve sooner than it would have if the bias had been allowed to go all the way to zero This action has the effect of reducing the E amount of overshoot Adjusting the Bias The normal action of the CPU is to adjust the bias term when the output goes out of range as shown below Mx Kixe Mx M Kc x e Kr PV PV Mx 0 ifM lt 0 M if0 lt MS1 1 M M M ifM gt 1 Mx
118. y once in E 1000 scans d Enter 0 05 sec or the sample rate of your choice for each loop and the dba CPU automatically schedules and executes PID calculations on the rr appropriate scans Ww om Outputs Y NOTE If more than 4 loops are programmed enter a minimum of 0 1 second DL06 Micro PLC User Manual 3rd Edition Rev C 8 25 Chapter 8 PID Loop Operation Te Select Forward Reverse It is important to know which direction the control output will respond to the error SP PV either forward or reverse A forward direct acting control loop means that whenever the control output increases the process variable will also increase The control outputs of most PID loops are forward acting such as a heating control loop An increase in heat applied will increase the PV temperature A reverse acting control loop is one where an increase in the control output results in a decrease in the PV A common example of this would be a refrigeration system where an increase in the cooling input causes a decrease in the PV temperature The Transfer Mode Choose either Bumpless I or Bumpless II to provide a smooth transition of the control output from Manual Mode to Auto Mode Choosing Bumpless I will set the SP equal to the PV when the control output is switched from Manual to Auto If this is not desired choose Bumplessll The characteristics of Bumpless I and II transfer types are listed in the chart below Note that
119. yte 0 then the Ramp Soak table is not active DLO06 Micro PLC User Manual 3rd Edition Rev C 8 23 Chapter 8 PID Loop Operation EEE Ramp Soak Table Location Addr 34 Each loop that you configure has the option of using a built in Ramp Soak generator dedicated to that loop This feature generates SP values that follow a profile To use the Ramp Soak feature you must program a separate table of 32 words with appropriate values The DirectSOFT dialog box makes this easy to do In the loop table the Ramp Soak Table Pointer at Addr 34 must point to the start of the ramp soak data for that loop This may be anywhere in user memory and does not have to adjoin to the Loop Parameter table as shown to the left Each R S table requires 32 words regardless of the number of segments programmed The ramp soak table parameters are defined in the table below Further details are in the section on Ramp Soak Operation in this chapter V Memory Space User Data v2000 LOOP 1 2037 32 words LOOP 2 32 words V3000 Ramp Soak 1 32 words Description Description Ramp End SP Value co Ramp End SP Value Ramp Slope ce Ramp Slope Soak Duration 1 Soak Duration Soak PV Deviation ro Soak PV Deviation Ramp End SP Value 1 Ramp End SP Value Ramp Slope i Ramp Slope Soak Duration 1 Soak Duration Soak PV Deviation i Soak PV Deviat
120. ze the risk of injury to personnel or damage to equipment The auto tune in the DLOG is not intended to be used as a replacement for your process knowledge Open Loop Test Whether you use manual or auto tuning it is very important to verify basic characteristics of a newly installed process before attempting to tune it With the loop in Manual Mode verify the following items for each new loop Setpoint verify that the SP source can generate a setpoint Put the PLC in Run Mode and leave the loop in Manual Mode then monitor the loop table location V 02 to see the SP value s If you are using the ramp soak generator test it now Process Variable verify that the PV value is an accurate measurement and the PV data arriving in the loop table location V 03 is correct If the PV signal is very noisy consider filtering the input either through hardware RC low pass filter or using the filter in this chapter Control Output if it is safe to do so manually change the output a small amount perhaps 1096 and observe its affect on the process variable Verify the process is direct acting or reverse acting and check the setting for the control output inverted or non inverted Make sure the control output upper and lower limits are not equal to each other Sample Rate while operating open loop this is a good time to find the ideal sample rate see Configure the PID Loop on page 8 25 However if you are going to use auto t
Download Pdf Manuals
Related Search
Related Contents
MINISTÉRIO DA EDUCAÇÃO SECRETARIA DE Samsung BT62CDBSTL User Manual BodyCraft TourTrainer none User's Manual Graco 312394V User's Manual HARDY Emilie - Groupe d`étude de la main en orthèse et rééducation Click here Pass Your Private Pilot Checkride ADPRO® Fast Scan AMPL CPLEX 9.0 User Guide Copyright © All rights reserved.
Failed to retrieve file