1、GEPIDPID Part 1 of 3 (Part 2 | Part 3) Overview | Operands | Reference Array Parameters | Operation | Setting User Parameters | Example | CPU SupportOverviewThe Proportional Integral Derivative (PID) built-in function block is a general purpose algorithm used for closed-loop process control. When it
2、 receives power flow through a contact, the PID built-in function block compares a Process Variable (PV) feedback with a desired process Set Point (SP) and updates a Control Variable (CV) output based on the error.The PID built-in function block uses PID loop gains and other parameters stored in the
3、 Reference Array, a 40-WORD array, to solve the PID algorithm at the desired time interval. All parameters are 16-bit WORDs for compatibility with 16-bit analog process variables. This allows %AI memory to be used for input Process Variables and %AQ to be used for output Control Variables.As scaled
4、16-bit integer numbers, many parameters must be defined in either PV counts or units, or CV counts or units. For example, the SP input must be scaled over the same range as PV because the PID built-in function block calculates the error from the difference of these two inputs. The PV and CV counts c
5、an range from -32768 or 0 to +32767, matching analog scaling, or from 0 to 10000, to display variables as 0.00% to 100.00%. The PV and CV Counts do not have to have the same scaling, in which case there will be scale factors included in the PID gains.The power flow output is energized when the built
6、-in function block is performed without calculation error. If at least one calculation error exists, there is no power flow output.Note: PID does not execute more often than once every 10 milliseconds. This could change your results if you set it up to execute every scan and the scan is less than 10
7、 milliseconds. In such a case, PID does not run until enough scans have occurred to accumulate an elapsed time of 10 milliseconds. For example, if the scan time is 9 milliseconds, PID executes every other scan with an elapsed time of 18 milliseconds for every time it executes.OperandsOperandData Typ
8、eMemory AreaDescription?one-dimensional WORD array of 40 wordsR, P, L, W, symbolicThis is a 40-word array: the Reference Array. This is the PID built-in function block control information, which contains both user and internal parameters. The 40 consecutive words must not be shared.SPINT variable or
9、 constant; BOOL array of length 16 or more (restrictions apply)data flow, I, Q, M, T, G, R, P, L, AI, AQ, W, symbolic, I/O variableThe control loop or process Set Point. Comparing the PV Counts to SP, PID adjusts the output CV so that PV matches SP (zero error).PVINT variable; BOOL array of length 1
10、6 or more (restrictions apply)data flow, I, Q, M, T, G, R, P, L, AI, AQ, W, symbolic, I/O variableThe control loop Process Variable input. Must be scaled over the same range as SP. Often a %AI input.MANPower flow Manual mode indicator. When energized to 1 (through a contact), the PID built-in functi
11、on block is in Manual mode. If MAN is not energized (0), the PID built-in function block is in Automatic mode.UPPower flow If energized along with MAN, UP adjusts the CV up by 1 CV per solution, that is, 1 CV per access to the PID built-in function block.DNPower flow If energized along with MAN, DN
12、adjusts the CV down by 1 CV per solution, that is, 1 CV per access to the PID built-in function block.CVINT variable; BOOL array of length 16 or more (restrictions apply)data flow, I, Q, M, T, G, R, P, L, AI, AQ, W, symbolic, I/O variableThe Control Variable output to the process. Often a %AQ analog
13、 output.Reference Array ParametersBesides the two input words and the three Manual control contacts, the PID built-in function block requires 13 user-defined parameters in the Reference Array. These parameters must be set before calling the built-in function block. The other 27 parameters are used b
14、y the Controller and are non-configurable. The %Ref shown in the table below is the beginning address of the Reference Array (the ? operand). The number after the plus sign is the offset in the array. For example, if the Reference Array starts at %R100, %R113 contains the Manual Command (%Ref+0013)
15、used to set the Control Variable and the integrator in Manual mode.Note: The Reference Array must be %R, %P, or %L registers. Every PID built-in function block in the logic must use a different 40-word array even if all 13 user parameters are the same, because other words in the array are used for i
16、nternal PID data storage. Ensure that there are at least 40 %R, %P, or %L registers between the starting reference address and the highest configurable %R, %P, or %L register.Register and ParameterLow Bit Units and Range of ValuesDescription%REF+0000Loop NumberUINT. 0 to 255Optional. Loop number; nu
17、mber of the PID built-in function block. For user display only. Provides a common identification in the Controller with the loop number defined by an operator interface device.Note: The loop number is displayed under the built-in function block address when logic is monitored from the LD editor.%REF
18、+0001AlgorithmUINT. Non-configurable. Set and maintained by the Controller.1 = ISA algorithm (PID_ISA)2 = Independent algorithm (PID_IND)%REF+0002Sample PeriodLow bit set at 1 represents 10ms. UINT. Range: 0 (every scan) to 65,535 (10.9 Min).The shortest time in 10ms increments, between solutions of
19、 the PID algorithm. For example, use a 10 for a 100ms sample period.If Sample Period is 0, the algorithm is solved every time PID is called, unless the scan is under 10ms. See Sample Period and PID Scheduling.The PID algorithm is solved only if the current Controller elapsed time clock is at or late
20、r than the last PID solution time plus this Sample Period.PID compensates for the actual time elapsed since the last execution, within 100 microseconds.%REF+0003Dead Band +PV Counts. 0 to 32767 (never negative)Integer (INT) values defining the upper (+) and lower (-) Dead Band limits in PV Counts. I
21、f no Dead Band is required, these values must be 0. If the PID Error (SP PV) or (PV- SP) is above the (-) value and below the (+) value, the PID calculations are solved with an Error of 0.If non-zero, the (+) value must be greater than 0 and the (-) value less than 0 or the PID built-in function blo
22、ck will not work.Tip: Leave these at 0 until the PID loop gains are set up or tuned. After that, a Dead Band might be added to avoid small CV output changes due to variations in error, perhaps to reduce mechanical wear.Note: The Deadband Action bit determines how PID uses the deadband limits.%REF+00
23、04Dead Band PV Counts. -32768 to 0 (never positive)%REF+0005In the PID_IND algorithm, this word stores the Proportional Gain, KpIn the PID_ISA algorithm, this word stores the Controller gain, KcLow bit set at 1 represents 1% of (CV%)/(PV%). Range of represented values: 0 to 327.67%The change in the
24、CV in CV Counts for a 100 PV Count change in the Error Term. It is displayed as 0.00 %/% with an implied decimal point of 2. A Kp or Kc entered as 450 is displayed as 4.50 and results in a (Kp*Error/100) or (Kc*Error/100) = (450*Error/100) contribution to the PID Output.Tip: When the PID_IND algorit
25、hm is used, Kp is generally the first gain set to adjust a PID loop, a PD loop (Proportional Derivative) or a PI loop (Proportional Integral, which is rarely used). Using Kp by itself may be sufficient to control certain types of processes.%REF+0006Derivative GainKdLow bit set at 1 represents 0.01 s
26、econds. Integer. Range of represented values: 0 to 327.67 sec.The change in the CV in CV Counts if the Error or PV changes 1 PV Count every 10ms. Entered as a time with the low bit indicating 10ms, it is displayed as 0.00 seconds with an implied decimal point of 2. For example, a Kd entered as 120 i
27、s displayed as 1.20 Sec and results in a Kd * (delta Error)/(delta time) = (120*4/3) contribution to the PID Output if Error was changing by 4 PV Counts every 30ms.Tip: When the PID_IND algorithm is used, Kd can be used to speed up a slow loop response, but is very sensitive to PV input noise. (On P
28、ACSystems, you can alleviate noise sensitivity by using the derivative filter, which is enabled by setting bit 5 of the Config Word.) In some processes, you can omit Kd and control the process by using Kp by itself or Kp in combination with Ki.%REF+0007Integral RateKiLow bit set at 1 represents 1 re
29、peat/1000 seconds. Integer values, 0 to 32,767, representing the values 0 to 32.767 repeats/secThe change in the CV in CV Counts if the Error is a constant 1 PV Count. Displayed as 0.000 Repeats/Sec with an implied decimal point of 3. For example, a Ki entered as 1400 is displayed as 1.400 Repeats/S
30、ec and results in a (Ki * Error * dt) = (1400*20*50/1000) contribution to PID Output for an Error of 20 PV Counts and a 50ms Controller scan time (Sample Period of 0).Tip: When the PID_IND algorithm is used, Ki is usually the second gain set in a PID loop, Kp being the first gain set. Ki can be omit
31、ted entirely in a PD (Proportional Derivative) loop or P (Proportional only) loop. Ki provides inertia to the control system, that is, it acts as an automatic bias.%REF+0008CV Bias/Output OffsetCV Counts. Integer, -32768 to +32767 (add to integrator output)Number of CV Counts added to the PID Output
32、 before the rate and amplitude clamps. Can be used to set non-zero CV values if only Kp Proportional gains are used, or for feed forward control of this PID loop output from another control loop.For example, if you want to let the built-in function block regulate error around the output midpoint, set the Bias to the midpoint of the range. For example, for a full range 0 through +32,767, +16,383 is the midpoint.Note: In the PID_IND algorithm, Ki acts as an auto
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2