UMass Amherst CHE 401 - Implementation of PID control in the Laboratory - Software and features

Unformatted text preview:

Implementation of PID control in the Laboratory: Software and features.You have learned about PID control and seen its potential ability to controlthe output of a process variable… If the control constants are chosen correctly, thevariable approaches and maintains a desired value, its setpoint. This variable couldbe a temperature, a reactor conversion, the effluent conversion in a separation, etc.These controllers can be implemented mechanically, by hard-wired electronics orwithin the software of a computer. Your undergraduate laboratory uses Labview®to accomplish control. The purpose of this article is to help you understand howcontrol is implemented in Labview or in a Basic software program.PID Control:PID (or PI) control starts by measuring the variable that is to be controlled.This is accomplished by an A to D (Analog to Digital) converter. This measures avoltage or current and outputs a numerical value to the computer corresponding tothis measurement. These measurements are typically 12 to 16 bits and aremeasured many times per second. Based in the control operation, a voltage is set by the use of a D to A (Digital toAnalog) converter, This sets the voltage or current to an electronic componentbased on a variable chosen in software inside the computer program.The basic equation which reflects PID control uses the difference between ameasured voltage, VD, and the setpoint , SP, to set a desired voltage, Vout. Threeconstants are employed to reflect the relative amounts of proportional, integral orderivative controlVoutc = C P * VD-SP + I * VD-SP dt0t + D *d VD-SPdtIf we call the difference between the measured variable and the setpoint the error,E, this can be rewritten:Voutc = C P * E + I * E dt0t + D *dEdtSeveral other equivalent forms are often employed:Voutc = P '* E + I '* E dt0t + D ' *dEdt ~ Kc E + 1τI* E dt0t + D ' *dEdtIt is apparent that there are several parts of the equation that need to beevaluated before control can be performed. The operator specifies set point, SP, andvalues of the controller constants: P, I and D. The computer must then evaluate thefollowing:The error, E = VD – SP,The time difference between measurements, dt = t - toldThe integral of the error with time = ∑ (E * dt) = (∑E * dt)old + E * dtThe derivative of the error with time = dE/dt = (E – Eold)/dtThese are then assembled to give the instantaneous value to set the Voltage out for this control:Vout = P*E + I*(∫ (E * dt)) + D* dE/dtThe following is a series of computer code that can perform PID control setting an outputvariable [AOT(1), analog output channel 1] based on the difference between a measuredtemperature (TM) from an analog input [AIM(1)] and a desired temperature (set point, Tset). P. Iand D constants are chosen (line 100) and are employed in the control loop (lines 200 to 300)which loop every second for 1000 seconds.100 Input “What are the control constants (P, I and D)?” Pc, Ic, Dc @ Input control constants110 Input “What is the desired temperature?” Tset @ Input for the desired temperature120 to = 0, INT = 0, Ero = 0 @ Set old time. Integral and error to zero200 For I = 1 to 1000 @ Starting the control loop210 TM=Ain(1) @ Measuring the instantaneous Temperature220 Er = TM – Tset @ Calculating the error (difference between desired and measured T)230 dEr = Er – Ero @ Calculating change in error240 tn = time @ Reading the current time250 Dt = tn - to @ Calculating delta time, Dt260 INT = Er*Dt + INT @ Updating the integral270 AOT(1)= P*Er + I*INT + D*(dEr/Dt) @setting the voltage output280 Ero = Er, to = tn @ Now define “old” error and time290 wait 1 @ Waiting for one second (can be selected)300 next I @ control loop returnThe Lab view version of these elements are shown on the attached figures:Delta t is measured/calculated:The Error is calculated from the measured variable and set point.The Proportional Part of the control comes from P, the constant, times the error.The derivative portion of the control comes from the derivative constant D timed d(error)/dtFinally the integral portion of the control is added to the P and D portions of the control. Theseare then sent out to set the output variable. You will, however, notice that there is someprotection that limits the integral control portion and that defines the limits of the output variable.Why are these


View Full Document

UMass Amherst CHE 401 - Implementation of PID control in the Laboratory - Software and features

Download Implementation of PID control in the Laboratory - Software and features
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Implementation of PID control in the Laboratory - Software and features and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Implementation of PID control in the Laboratory - Software and features 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?