The text of a manual · part 12 of 14
SIMATIC TI560T/TI565T Technical Product Description: B Loop Operation, pages 101 to 108
Pages 101 to 108 of 122, from SIMATIC TI560T/TI565T Technical Product Description
The original document is the PDF (565 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Texas Instruments 500-5008 and Siemens 500-5008
Page 101
Appendix B
Loop Operation B.1
B.2
B.3
TI565T Loop Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-2
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Analog Variables and Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Loop Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PID Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Standard PID (Discrete Form) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reset Windup Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Freeze Bias When Output Goes Out of Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adjusting the Bias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Eliminating Proportional, Integral, or Derivative Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . Velocity PID Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-2 B-2 B-2 B-3 B-4 B-6 B-7 B-8 B-9 B-10
Loop Alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-11
Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Auto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cascade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mode Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bumpless Transfer of Contorl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-13 B-13 B-13 B-14 B-15
Special Computations on Output, PV, or Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-16
Forward and Reverse Acting Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Square Root of the Process Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Error Squared Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Error Deadband Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Derivative Gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ramp/Soak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SF Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B-16 B-16 B-17 B-17 B-18 B-19 B-19
SIMATIC TI560T/TI565T Technical Product Description
Loop Operation
B-1
Page 102
B.1
TI565T Loop Algorithms
Overview
This appendix describes the implementation of PID control loops as done at Texas Instruments in the TI565T controller. The discussion includes algorithms used, options that may be selected, and performance. This introductory section gives the basics of PID control as implemented by the TI565T. A detailed description of the actual algorithms used is contained in the next sections.
Analog Variables and Scaling
The Series 500 and Series 505 have three kinds of I/O points - discrete, analog, and word. Discrete points (denoted by Xn for inputs and Yn for outputs) are single bits with 0 corresponding to “off” and 1 corresponding to “on”. Word points (denoted by WXn for inputs and WYn for outputs) are 16-bit wide words, the interpretation of the bits being dependent on the type of I/O module. Of primary interest to our discussion are analog I/O points. Analog points (also denoted by WXn for inputs and WYn for outputs) are 16-bit integers scaled by type of I/O point as follows: 0% OFFSET
Stored as an integer variable in the the range of 0 to 32000. (This would typically correspond to an actual range of 0 to +5 volts.)
20% OFFSET
Stored as an integer variable in the range of 6400 to 32000. (This would typically correspond to an actual range or 1 to +5 volts or 4 to 20 milliamps.)
BIPOLAR
Stored as an integer variable in the range of –32000 to 32000. (This would typically correspond to an actual range of –5 to +5 volts.)
All of these representations are referred to as scaled integers. Loop Variables
B-2
Loop Operation
In TI565T loops, there are two primary variables that the loop must access. These are the input to the loop - called the Process Variable, and the output from the loop - called the output. Both are analog variables. For each loop, the TI565T allows you to specify the location of the variable and the manner in which it is scaled.
SIMATIC TI560T/TI565T Technical Product Description
Page 103
When the TI565T reads the Process Variable for a loop, it will automatically convert it from a scaled integer to a floating point number in the range 0.0 to 1.0 (0.0 represents PV Low Range; 1.0 represents PV High Range). These values are referred to as normalized real numbers. All loop calculations are performed using normalized reals. The output from the loop is also a normalized real, which will be converted to a scaled integer when stored to memory. The TI565T allows you to specify the range of the Process Variable in engineering units (for example, degrees centigrade). External references to loop variables are always in engineering units. The normalized real format is only used internal to the TI565T for the purpose of loop calculations. PID Control
The TI565T provides feedback loops using the PID (Proportional-Integral-Derivative) algorithm. The controller output M is computed from the measured process variable PV as follows: Let
- -
- Then
-
By proper choice of the Ti and Td values, the integral and/or derivative action may be eliminated resulting in the other common types of loops - P, PI, and PD. The TI565T also provides a mechanism whereby the I, ID, and D loops may be obtained.
SIMATIC TI560T/TI565T Technical Product Description
Loop Operation
B-3
Page 104
TI565T Loop Algorithms (continued) Standard PID (Discrete Form)
The output M(t) above may be approximated using a discrete form of the PID equation. Let T s Samplerate K c Proportionalgain K i Coefficientoftheintegralterm K sT K r Coefficientoftheintegralterm K dT T i Resetorintegraltime T d Derivativetimeorrate SP Setpoint PV n ProcessVariableatnthsample e n Erroratnthsamplegivenby e n SP PV n M towhichthecontrolleroutputhasbeeninitialized Then e K e n
M n K ce n K i i r n
B-4
Loop Operation
SIMATIC TI560T/TI565T Technical Product Description
Page 105
This form of the PID equation is referred to as the position form since the actual actuator position is computed. The TI565T also provides a velocity form of the PID equation which computes the change in actuator position. The velocity equation is described later in this section. The TI565T modifies the standard equation slightly to use the derivative of the Process Variable instead of the error as follows.
-
-
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. The TI565T also combines the integral sum and the initial output into a single term called the bias (denoted in this document by Mx ). This results in the following set of equations.
- The TI565T will always keep the output M in the interval [0.0,1.0]. This is done by clamping M to the nearer of 0.0 and 1.0 whenever the calculated output falls outside this range.
SIMATIC TI560T/TI565T Technical Product Description
Loop Operation
B-5
Page 106
TI565T Loop Algorithms (continued) Reset Windup Protection
Reset windup can occur if reset action is specified and the computation of the bias term Mx is performed exactly as shown in the equation below.
For example, consider an application in which the output is controlling a valve and the PV goes to some value PVa such that PVa > SP and does not change for a period of time. Since the error e will always be negative, this 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 more negative. When the PV finally does come back down below the SP, the valve will stay closed until the error e is positive long enough to cause the bias Mx to become positive. The controller is guaranteed to undershoot. A similar problem will occur if the error becomes positive for an extended period of time because the PV is less than the SP. One way to solve the problem is to clamp the bias between 0.0 and 1.0. The TI565T 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 guarantee an undershoot. The TI565T solves the undershoot (and the corresponding overshoot) problem in one of two ways depending on how the loop is programmed - by freezing the bias term, or by adjusting the bias term.
B-6
Loop Operation
SIMATIC TI560T/TI565T Technical Product Description
Page 107
Freeze Bias When Output Goes Out of Range
If the “Freeze Bias When Output Goes Out of Range” option is selected, the TI565T simply stops changing the bias Mx whenever the computed output M goes outside the interval [0.0, 1.0]. When this option is selected, the computation of the output M and bias Mx is done as follows. Trial bias term
- +- )
Trial output
- +- * * - )
Actual output
- +- if
- t-
- +- if v- - v-
- +- if
- u-
- +- if v- - v-
New bias term
- +-
*
* otherwise
Thus in our 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 had the bias been allowed to go all the way to zero. This action has the effect of lessening the amount of overshoot.
SIMATIC TI560T/TI565T Technical Product Description
Loop Operation
B-7
Page 108
TI565T Loop Algorithms (continued) Adjusting the Bias
The default action of the TI565T is a slightly more sophisticated operation which makes the computation of the bias term conditional on the computation of the output as follows: Trial bias term
- - +-
) - *
Trial output
-- +-
* * ) -
Actual output
- - +- if
-- t-
- - +- - if v- -- v
- - +- if
-- u-
- - +- - if v- -- v-
New bias term
- - +- *
* * if output - - w-
With this method, the output device begins to respond as soon as the PV begins to come down. If the loop is properly tuned, overshoot can be eliminated entirely. (This assumes that the setpoint is not changing. 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.
NOTE: If large step changes to the setpoint are anticipated, then it is probably better to select the freeze bias option. Otherwise the default action is best.
B-8
Loop Operation
SIMATIC TI560T/TI565T Technical Product Description