The text of a manual · part 49 of 68
DL405 User Manual: Chapter 8: PID Loop Operation (DL450 only), pages 429 to 438
Pages 429 to 438 of 608, from DL405 User Manual
The original document is the PDF (8.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the AutomationDirect D4-08B-1, AutomationDirect D4-08ND3S, AutomationDirect D4-16TA, PLC Direct D4-16TD2, AutomationDirect D4-32ND3-1, Konnect-It D4-08B-1, Koyo D4-08B-1, Konnect-It D4-08ND3S, and 6 more models
Page 429
PID Loop Operation (DL450 only)
In This Chapter. . . ., DL450 PID Loop Features, Introduction to PID Control, Introducing DL450 PID Control, PID Loop Operation, Ten Steps to Successful Process Control, PID Loop Setup, PID Loop Tuning, Using the Special PID Features, Ramp/Soak Generator, DirectSOFT Ramp/Soak Example, Cascade Control, Time Proportioning Control, Feedforward Control, PID Example Program, Troubleshooting Tips, Glossary of PID Loop Terminology, Bibliography
18
Page 430
8--2
PID Loop Operation (DL450 only)
DL450 PID Control DL450 PID Control Features
Along with control functions discussed in this manual, the DL450 CPU features PID process control. The primary features are: S Up to 16 loops, individual programmable sample rates S The use of 16--bit analog inputs and outputs S Manual/Automatic/Cascaded loop capability available S Two types of bumpless transfer available S Full-featured alarms S Ramp/soak generator with up to 16 segments S Auto Tuning
The DL450 CPU has process control loop capability in addition to ladder program execution. You can select and configure up to sixteen loops. All sensor and actuator wiring connects directly to DL405 analog modules and digital output modules. All process variables, gain values, alarm levels, etc., associated with each loop reside in a Loop Variable Table in the CPU. The DL450 CPU reads process variable (PV) inputs during each scan. Then it makes PID loop calculations during a dedicated time slice on each CPU scan, updating the control output value. The control loops use the Proportional-Integral-Derivative (PID) algorithm to generate the control output command. This chapter describes how the loops operate, and what you must do to configure and tune the loops. Analog or Digital Output
Maintenance and Troubleshooting
PID Loop Operation (DL450 Only)
NOTE : The D4--450 CPU requires at least DirectSOFT32, version 3.0c, build 58 or later and CPU firmware version 1.9 (HB) and 2.446 (SH) or later to implement these features. DirectSOFT 5 is the latest programming software. See our website for more information www.automationdirect.com.
DL450 CPU PID Loop Calculations
Manufacturing Process
Analog Input
As with DirectSOFT32, DirectSOFT 5 programming software, version 5.0 or later, is used for configuring analog control loops in the DL450. DirectSOFT uses dialog boxes to help you set up the individual loops. After completing the setup, you can use DirectSOFT’s PID View to tune each loop. The configuration and tuning selections you make are stored in the DL450’s V--memory, which can be set as retentive. The loop parameters also may be saved to disk for recall later.
DL405 User Manual, 4th Edition
Page 431
PID Loop Operation (DL450 only)
Number of loops
Selectable, 16 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
Minimum loop update rate
0.05 seconds for 1 to 4 loops, 0.1 seconds for 5 to 8 loops , and 0.2 seconds for 9 to 16 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.0 to 99.99
Integrator (Reset)
Specify reset time of 0.0 to 99.99 in units of seconds or minutes
Derivative (Rate)
Specify the derivative time from 0.00 to 99.99 seconds
Rate Limits
Specify derivative gain limiting from 1 to 20
Bumpless Transfer I
Automatically initialized bias and setpoint when control switches from manual to automatic
Bumpless Transfer II
Automatically set the bias equal to the control output when control switches from manual to automatic
Step Bias
Provides proportional bias adjustment for large setpoint changes
Anti-windup (Freeze Bias)
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)
Error Deadband
Specify a tolerance (plus and minus) for the error term (SP--PV), so that no change in control output value is made
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
DL405 User Manual, 4th Edition
Maintenance
Specifications
PID Loop Operation (DL450 Only)
PID Loop Feature
8--3
Page 432
8--4
PID Loop Operation (DL450 only)
Introduction to PID Control
Maintenance and Troubleshooting
PID Loop Operation (DL450 Only)
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: S 1. The ON--OFF controller, sometimes referred to as an open loop controller. S 2. 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 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.
71_
OFF
OFF
69_
67_
SETPOINT
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.
DL405 User Manual, 4th Edition
Page 433
PID Loop Operation (DL450 only)
8--5
Maintenance
DL405 User Manual, 4th Edition
PID Loop Operation (DL450 Only)
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 manually 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 P, I and D terms: S 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 level 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. S 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. S 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.
Page 434
8--6
PID Loop Operation (DL450 only)
Maintenance and Troubleshooting
PID Loop Operation (DL450 Only)
Introducing DL450 PID Control The DL450 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 DL450 CPU has the ability to directly accept signals from electronic sensors, such as thermocouples, pressure, VFDs, etc. These signals may be used in mathematically derived control systems. In addition, the DL450 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. The DL450 PID control provides feedback loops using the PID algorithm. The control output is computed from the measured process variable as follows: Let: Kc = proportional gain Ti = Reset or integral time Td = 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(t) = Kc [ e(t) + 1/Ti ∫ 0 e(x) dx + Td d/dt e(t) ] + M0 The analog input module receives the process variable in analog form along with an operator entered setpoint; the CPU computes the error. 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.
DL405 User Manual, 4th Edition
Page 435
PID Loop Operation (DL450 only)
8--7
Standard DL405 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 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 and Monitoring
External Disturbances
PLC System
+
Error Term
Σ --
Loop Calculation
Control Output
Manufacturing Process
Process Variable
PID Loop Operation (DL450 Only)
Setpoint Value
Maintenance DL405 User Manual, 4th Edition
Page 436
8--8
PID Loop Operation (DL450 only)
Maintenance and Troubleshooting
PID Loop Operation (DL450 Only)
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 -- a measurement of some physical property of the raw materials. Measurements are made using some type of sensor. For example, if the manufacturing process uses an oven, we will have a strong interest in controlling temperature. Therefore, temperature is a process variable. Setpoint Value -- the theoretically perfect quantity of the process variable, or the desired amount which yields the best product. The machine operator knows this value, and either sets it manually or programs it into the PLC for later automated use. External Disturbances -- the unpredictable sources of error which the control system attempts to cancel by offsetting their effects. For example, if the fuel input is constant an oven will run hotter during warm weather than it does during cold weather. An oven control system must counter-act this effect to maintain a constant oven temperature during any season. Thus, the weather (which is not very predictable), is one source of disturbance to this process. 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. Loop Calculation -- the real-time application of a mathematical algorithm to the error term, generating a control output command appropriate for minimizing the error magnitude. Various control algorithms are available, and the DL450 uses the Proportional-Derivative-Integral (PID) algorithm (more on this later). Control Output -- the result of the loop calculation, which becomes a command for the process (such as the heater level in an oven). 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).
DL405 User Manual, 4th Edition
Page 437
PID Loop Operation (DL450 only)
8--9
PID Loop Operation
PID Position Algorithm
PID Loop Operation (DL450 Only)
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 DL450 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 DL450 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: S PID Position Algorithm -- The control output is calculated so it responds to the displacement (position) of the PV from the SP (error term). S PID Velocity Algorithm -- The control output is calculated to represent the rate of change (velocity) for the PV to become equal to the SP. Referring to the control output equation on page 8--6, the DL450 CPU approximates the output M(t) using a discrete position form of the PID equation. Let: Ts = Sample rate 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 PVn = Process variable at nth sample en = SP -- PVn = Error at nth sample Mo = Value to which the controller output has been initialized Then: Mn = Control output at nth sample n
Mn = Kc £ en + Ki Σ ei + Kr (en -- en--1) + Mo 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: n
Mn = Kc £ en + Ki Σ ei + Kr (PVn -- PVn--1) + Mo i=1
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.
DL405 User Manual, 4th Edition
Maintenance i=1
Page 438
8--10
PID Loop Operation (DL450 only) The DL450 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: Mxo = Mo Mx = Ki * en + Mxn--1 Mn = Kc * en -- Kr(PVn -- PVn--1) + Mxn The DL450 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 DL450 also allows you to specify the minimum and maximum output limit values (within the range 0 to 4095 in binary 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.
Maintenance and Troubleshooting
PID Loop Operation (DL450 Only)
Reset Windup Protection
Reset windup can occur if reset action (integral term) is specified and the computation of the bias term Mx is: Mx = Ki * en + Mxn--1 For example, assume the output is controlling a valve and the PV remains at some value greater than the setpoint. The negative error (en) 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 way to solve the problem is to simply clamp the normalized bias between 0.0 and 1.0. The DL450 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 DL450 CPU is programmed to solve the overshoot problem by either freezing the bias term, or by adjusting the bias term.
DL405 User Manual, 4th Edition