A M E M B E R O F T H E K E N D A L L G R O U P
Basics of PID control in a Programmable Automation Controller Technology Summit September, 2018 Eric Paquette
Definitions-PID A Proportional Integral Derivative controller (PID controller) is a control loop feedback mechanism commonly used in industrial control systems. A PID controller continuously calculates an error value as the difference between a desired setpoint (SP) and a measured process variable (PV) and applies a correction to an output called the control variable (CV) based on proportional, integral, and derivative terms. These are denoted as P, I, and D which give their name to the controller type
PID Model Independent Gains Control Variable Process Variable
PID Model Dependent Gains
Response Curves A Underdamped B Overdamped C Oscillatory D Critically Damped Which one is correct?
Definitions- Proportional PROPORTIONAL TERM accounts for present values of the error. For example, if the error is large and positive, the control output will also be large and positive. A high PROPORTIONAL GAIN results in a large change in the output for a given change in the error. For instance, if the error term has a magnitude of 10, a proportional gain of 5 would produce a proportional response of 50. If the proportional gain is too high, the system can become unstable If the proportional gain is too small, this results in a small output response to a large input error, and a less responsive or less sensitive controller. Proportional Only controllers will operate with a steady state error
Effects of varying Kp
Definitions- Integral Integral Term The integral term addresses how long the measured variable has been away from the desired set point. The integral term integrates or continually sums up error over time. As a result, even a small error amount of persistent error calculated in the process will accumulate to a considerable amount over time
Definitions- Derivative DERIVATIVE TERM The derivative term considers how fast the error value changes at an instant in time. The derivative computation yields a rate of change or slope of the error curve. The derivative response is proportional to the rate of change of the process variable. Increasing the derivative time (T d ) parameter will cause the control system to react more strongly to changes in the error term and will increase the speed of the overall control system response. Most practical control systems use very small derivative time (T d ), because the Derivative Response is highly sensitive to noise in the process variable signal. If the sensor feedback signal is noisy or if the control loop rate is too slow, the derivative response can make the control system unstable
Periodic or Continuous Task? The PID should be used in a Periodic Task. In this case, the rung should be unconditional The period of the task should be matched with the loop update time of the PID. The period used is typically at least 10 times faster than the Process Time Constant If using a Continuous Task, the PID must be regulated with a Timer bit. Match the timer preset with the loop update time of the PID. If this is not done, then the calculations of the PID will be inconsistent. The scan time of the processor will affect the contributions of the integral and derivative terms.
Process Time Constant The Process Time Constant is equal to the time it takes for the process to change 63.2% of the total change in the measured variable. The smaller the time constant, the faster the process.
Process Deadtime Process Dead-Time is the time that passes from the moment the step change in the controller output is made until the moment when the measured variable shows a clear initial response to that change. Process Dead-Time arises because of transportation lag and/or sample or instrumentation lag. Transportation lag is defined as the time it takes for material to travel from one point to another. Similarly, sample or instrument lag is defined as the time it takes to collect, analyze or process a measured variable sample. The larger the Process Dead-Time relative to the Process Time Constant, the more difficult the associated process will be to control.
Adding the Ladder PID and Tags Enter the following for the ladder PID: A Tag for operator manual control if desired, or leave 0 if not used (used in operator manual control) The output tag that you ll use to drive the process (CV) The tag that holds the PV value A backing tag of type PID for internal storage Set these three fields to zero if you don t use them (cascade and bumpless restart of output module) These are display values from PID backing tag
Configuring the PID - Scaling Tab Unscaled Min/Max: This should match the range from the input card Engineering units: This is what the setpoint is specified in and what the status below uses. The range the PID will use for its output This is the range the Tieback tag will use (used in operator manual control) 0 if not used If you change while the processor is running, you must uncheck this box once
Scaling, more important than you think
Configuring the PID - Alarms Tab The PID has built-in alarming. Can be used by the program to indicate that the PV is out of range. Is not essential for PID operation - does not have to be used. Specify alarm limit values if desired, or leave all 0 if you don t use.
Configuring the PID - Configuration Tab Choose Derivative of PV or Error Enter the desired Loop Update Time Choose the Control Action PV SP or SP-PV Cooling Heating Choose independent or dependent equation form. This affects tuning. Enter a range to limit the CV to. Enter 100 and 0 for no limit Enter Deadband value. Freezes CV when PV is close enough. Can save on valve wear or help stabilize system. Leave 0 if not used. Additional Options
Configuring the PID - Tuning Tab Use Set Output to directly control the output when software manual is checked. Setpoint is what the PID tries to drive the PV to. Manual mode feeds the Tieback tag directly to the PID output. Output bias, also known as feedforward, is directly added to the output. Enter the PID gains here. These numbers can be adjusted to tune the loop. Current values and status to monitor PID state.
Adding the Ladder PID - Timing The Ladder PID is not self-regulated (timed). Needs to be regulated with Timer or Periodic Task, otherwise, output will be wild. PID should only be executed as fast as process needs to conserve CPU resources. The period at which the PID is scanned true should be filled into the Loop Update Time. Programmer must make sure that this is filled in manually or update programmatically PID_Backing_Tag.UPD.
Adding a Function Block PIDE and Tags The Function Block PIDE Connect a tag for setpoint Connect process measurement tag Connect the process control tag Connect a tag for manual output control Set True for Program Control Set for the mode desired
Tuning your PID gains Many different methods Google it Typically done manually by changing the setpoint and observing the change in the process variable Can be done in closed or open loop
Typical Controls Engineer Method 1. Set Integral and Derivative gains to zero 2. Adjust the Proportional gain just until it starts to oscillate. 3. Cut Proportional gain in half 4. Start adding Integral gain until it looks good. Never use derivative, it just gets you in trouble
References Using the PIDE Instruction White Paper Logix5000 Controllers Advanced Process Control Reference Manual Logix5000 Controllers General Instructions Reference Manual Knowledgebase ID 462378 Knowledgebase ID 493756 Kendall ftp site: ftp://12.192.249.152/kcl/west MI (Grand Rapids, Holland & Muskegon)
Demo Let s Play!