Proortional-Integral-Derivative PID Controls Dr M.J. Willis Det. of Chemial and Proess Engineering University of Newastle e-mail: mark.willis@nl.a.uk Written: 7 th November, 998 Udated: 6 th Otober, 999 Aims and Objetives The PID algorithm is the most oular feedbak ontroller used within the roess industries. It has been suessfully used for over 50 years. It is a robust easily understood algorithm that an rovide exellent ontrol erformane desite the varied dynami harateristis of roess lant. These leture notes, introdue the Proortional- Integral- Derivative (PID) ontrol algorithm. disuss the role of the three modes of the algorithm. highlight different algorithm strutures. Disuss methods that have evolved over the last 50 years as aids in ontrol loo tuning. After omletion of this setion of the ourse a student should be aable of aroahing a loo tuning roblem in a ometent and effiient manner and have suffiient knowledge to effetively tune a PID ontrol algorithm.
The Proortional-Integral-Derivative (PID) algorithm As the name suggests, the PID algorithm onsists of three basi modes, the Proortional mode, the Integral and the Derivative modes. When utilising this algorithm it is neessary to deide whih modes are to be used (P, I or D?) and then seify the arameters (or settings) for eah mode used. enerally, three basi algorithms are used P, PI or PID. A Proortional algorithm The mathematial reresentation is, mv() s (Lalae domain) or mv() t mv + k e() t (time domain) (3) es () k The roortional mode adjusts the outut signal in diret roortion to the ontroller inut (whih is the error signal, e). The adjustable arameter to be seified is the ontroller gain, k. This is not to be onfused with the roess gain, k. The larger k the more the ontroller outut will hange for a given error. For instane, with a gain of an error of 0% of sale will hange the ontroller outut by 0% of sale. Many instrument manufaturers use Proortional Band (PB) instead of k. The time domain exression also indiates that the ontroller requires alibration around the steady-state oerating oint. This is indiated by the onstant term mv ss. This reresents the 'steady-state' signal for the mv and is used to ensure that at zero error the v is at setoint. In the Lalae domain this term disaears, beause of the deviation variable reresentation. ss A roortional ontroller redues error but does not eliminate it (unless the roess has naturally integrating roerties), i.e. an offset between the atual and desired value will normally exist. A roortional integral algorithm The mathematial reresentation is, mv() s k + or mv() t mvss + k e() t etdt () es () Ts + i T i The additional integral mode (often referred to as reset) orrets for any offset (error) that may our between the desired value (setoint) and the roess (4) This is defined as the range over whih the error must hange in order to drive the ontroller outut over full range. The PB also tells you how large the error has to be before the maniulated variable reahes 0 or 00%. The PB is generally entered around the setoint ausing the outut to be at 50% when the setoint and the roess outut are equal. 2
outut automatially over time 2. The adjustable arameter to be seified is the integral time (Ti) of the ontroller. Where does the term reset ome from? Reset is often used to desribe the integral mode. Reset is the time it takes for the integral ation to rodue the same hange in mv as the P modes initial (stati) hange. Consider the following figure, mv Oen Loo Resonse of a PI ontroller to a ste in e Initial ste due to P of magnitude K e k edt T i ke 0 T time i Figure () The resonse of a PI algorithm to a ste in error Figure () shows the outut that would be obtained from a PI ontroller given a ste hange in error. The outut immediately stes due to the P mode. The magnitude of the ste u is K e. The integral mode then auses the mv to ram. Over the eriod 'time 0 to time T I ' the mv again inreases by K e. Integral wind-u When a ontroller that ossesses integral ation reeives an error signal for signifiant eriods of time the integral term of the ontroller will inrease at a rate governed by the integral time of the ontroller. This will eventually ause the maniulated variable to reah 00 % (or 0 %) of its sale, i.e. its maximum or minimum limits. This is known as integral wind-u. A sustained error an our due to a number of senarios, one of the more ommon being ontrol system override. Override ours when another ontroller takes over ontrol of a artiular loo, e.g. beause of safety reasons. The original ontroller is not swithed off, so it still reeives an error signal, whih through time, winds-u the integral omonent unless something is done to sto this ourring. There are many tehniques that may be used to sto this 2 Different ontrol manufaturers use different definitions for the integral mode of a ontroller. It an be defined as minutes, minutes/reeat or reeats er minute. The differene is very imortant to note so as to ensure roblems do not our during a tuning exerise. Remember the name game. T i is the integral time (minutes), if seified as reeats / minute then it is /T i that must be entered into the ontroller, while minutes / reeat is again T i. This is onfusing and is omounded by the fat that manufaturers are not onsistent! 3
haening. One method is known as external reset feedbak (Luyben, 990). Here, the signal of the ontrol valve is also sent to the ontroller. The ontroller ossess logi that enables it to integrate the error when its signal is going to the ontrol value, but breaks the loo if the override ontroller is maniulating the valve. A Proortional Integral Derivative algorithm The mathematial reresentation is, mv() s k + + TD s or mv t mv k e t etdt T de () t () ss + () + () + D es () Ts i T i dt Derivative ation (also alled rate or re-at) antiiates where the roess is heading by looking at the time rate of hange of the ontrolled variable (its derivative). T D is the rate time and this haraterises the derivative ation (with units of minutes). In theory derivative ation should always imrove dynami resonse and it does in many loos. In others, however, the roblem of noisy signals makes the use of derivative ation undesirable (differentiating noisy signals an translate into exessive mv movement). Derivative ation deends on the sloe of the error, unlike P and I. If the error is onstant derivative ation has no effet. Revision Exerise Use Matlab / Simulink to exlore the effet a ste hange in error has on the various modes of an ideal PID ontrol algorithm. Assume that k, T i 0 mins and T D 5mins. PID algorithms an be different Not all manufatures rodue PID s that onform to the ideal 'textbook' struture. So before ommening tuning it is imortant to know the onfiguration of the PID algorithm! The majority of text-book tuning rules are only valid for the ideal arhiteture. If the algorithm is different then the ontroller arameters suggested by a artiular tuning methodology will have to be altered. (5) 4
Ideal PID The mathematial reresentation of this algorithm is: mv() s k + + TD s es () Ts i One disadvantage of this ideal 'textbook' onfiguration is that a sudden hange in setoint (and hene e) will ause the derivative term to beome very large and thus rovide a derivative kik to the final ontrol element - this is undesirable. An alternative imlementation is mv() s k + Ts es () + T D svs () i The derivative mode ats on the measurement and not the error. After a hange in setoint the outut will move slowly avoiding "derivative kik" after setoint hanges. This is therefore a standard feature of most ommerial ontrollers. Series (interating) PID The mathematial reresentation of this algorithm is: mv() s k + es Ts T D () s i As with the ideal imlementation the series mode an inlude either derivative on the error or derivative on the measurement. In whih ase, the mathematial reresentation is, Parallel PID mv() s k + where e(s) SP - T es () Ts D sv(s) i The mathematial desrition is, mv() s ke() s + Ts es () + T D ses () i The roortional gain only ats on the error, whereas with the ideal algorithm it ats on the integral and derivative modes as well. Revision Exerises. Draw the blok diagram reresentation of the ideal, series (interating) and arallel PID ontrol laws. 2. Write down the 'time-domain' mathematial reresentation of the ideal (without derivative kik), series (interating) and arallel PID ontrol laws. 5
3. Suose that the ontroller settings for an ideal PID algorithm are given by, k, T i, T D. Work out the onversion fators required to ensure that a arallel imlementation of the PID algorithm will rovide the same mv signal given the same error signal. Controller tuning Controller tuning involves the seletion of the best values of k, Ti and T D (if a PID algorithm is being used). This is often a subjetive roedure and is ertainly roess deendent. A number of methods have been roosed in the literature over the last 50 years. However, reent surveys indiate, 30 % of installed ontrollers oerate in manual. 30 % of loos inrease variability. 25 % of loos use default settings. 30 % of loos have equiment roblems. A ossible exlanation for this is lak of understanding of roess dynamis, lak of understanding of the PID algorithm or lak of knowledge regarding effetive tuning roedures. This setion of the notes onentrates on PID tuning roedures. The suggestion being that if a PID an be roerly tuned there is muh soe to imrove the oerational erformane of hemial roess lant. When tuning a PID algorithm, generally the aim is to math some reoneived 'ideal' resonse rofile for the losed loo system. The following resonse rofiles are tyial. Servo Control For a unit ste hange in setoint (0 - ) the two resonse rofiles shown in figure 2 ould be obtained (deending uon the roess dynamis and ontroller settings),.5 0.5.5 0.5 0 0 0 20 40 60 Time (minutes) 0 20 40 60 80 00 Time (minutes) Figure (2) Underdamed (LHS) and overdamed (RHS) system resonse to a unit hange in setoint (PI ontrol). Terms used to desribe underdamed resonse harateristis are, 6
Overshoot: this is the magnitude by whih the ontrolled variable 'swings' ast the setoint. 5/0% overshoot is normally aetable for most loos. Rise time: the time it takes for the roess outut to ahieve the new desired value. One-third the dominant roess time onstant would be tyial. Deay ratio: this is the ratio of the maximum amlitude of suessive osillations. Settling time: the time it takes for the roess outut to die to between, say +/- 5% of setoint. These harateristis are often used as objetives during a tuning exerise. Regulatory Control For a unit ste hange in the dv, the following tye of resonse rofile may be desired,.5 0.5 0-0.5-0 0 20 30 40 50 Time (minutes) Figure (3) Disturbane rejetion ( a tyial resonse rofile) i.e. the disturbane initially auses the roess to move away from the desired value (whih is set to zero in this figure). The ontroller then adjusts the mv so that the v slowly moves bak to setoint. In other words the imat that the disturbane has on the losed loo system is eliminated and the system returns to the desired value. A transfer funtion that ould be used to model this behaviour is, v() s s dv() s λ (6) λs + where the onstant λ models the eak effet of the disturbane as well as the seed at whih the system returns to steady-state. Tuning Rules Rules of thumb 7
The following rules of thumb are intended to give ball-ark figure ontroller settings. The settings () assume a series algorithm, the others are for ideal PID Loo Tye PB(%) I (mins) D (mins) Liquid level < 00 0 - Temerature 20-60 2-5 I/4 Flow 50 0. - Liquid Pressure () 50-500 0.005 - - 0.5 as Pressure () - 50 0. - 50 0.02-0. Chromatograh () 00-2000 0-20 0. - 20 Often, with level systems exat setoint following is not essential, hene roortional ontrol is often used. Temerature loo dynamis an be slow beause of roess heat transfer lags. Deadtime is ossible, eseially in heat exhangers and temerature is not normally noisy. Consequently PID ontrol is normally referred. Flow loo dynamis are generally fast (of the order of seonds). Control valve dynamis are normally the slowest in the loo. Flow systems are noisy. However, noise an often be dealt with simly by reduing the gain. Ziegler Nihols losed loo method The method is straightforward. First, set the ontroller to P mode only. Next, set the gain of the ontroller (k ) to a small value. Make a small setoint (or load) hange and observe the resonse of the ontrolled variable. If k is low the resonse should be sluggish. Inrease k by a fator of two and make another small hange in the setoint or the load. Kee inreasing k (by a fator of two) until the resonse beomes osillatory. Finally, adjust k until a resonse is obtained that rodues ontinuous osillations. This is known as the ultimate gain (ku). Note the eriod of the osillations (Pu). The ontrol law settings are then obtained from the following table, k T i T D P ku/2 PI Ku/2.2 Pu/.2 PID Ku/.7 Pu/2 Pu/8 8
Pratial use of the tehnique It is unwise to fore the system into a situation where there are ontinuous osillations as this reresents the limit at whih the feedbak system is stable. enerally, it is a good idea to sto at the oint where some osillation has been obtained. It is then ossible to aroximate the eriod (Pu) and if the gain at this oint is taken as the ultimate gain (ku), then this will rovide a more onservative tuning regime. Cohen - Coon This method deends uon the identifiation of a suitable roess model (lant identifiation has been overed in revious letures). Cohen-Coon reommended the following settings to give resonses having ¼ deay ratios, minimum offset and other favourable roerties, k T i T D P τ θ ( + ) k θ 3 τ PI τ 9 θ 30 + 3( θ / τ) ( + ) θ k θ 0 2τ 9+ 20( θ / τ) PID τ 4 θ 32 + 6( θ / τ) ( + ) θ k θ 3 4τ 3 + 8( θ / τ) 4 θ + 2( θ / τ) In the table k is the roess gain, τ the roess time onstant and θ the roess time delay. Pratial use of the tehnique If the roess delay is small (in the limit as it aroahes zero) inreasingly large ontroller gains will be redited. The method is therefore not suitable for systems where there is zero or virtually no time delay. Diret synthesis This is a model based tuning tehnique. It uses an identified roess model in onjuntion with a user seified losed loo resonse harateristi. An advantage of this aroah is that it rovides insight into the role of the 'model' in ontrol system design. A disadvantage of the aroah is that a PID ontroller may not be realised unless an aroriate model form is used to synthesise the ontrol law. 9
Tuning for servo ontrol Let the symbol reresent the roess dynamis and the ontroller dynamis. If all other dynami elements within the loo are ignored then the following losed loo transfer funtion an be derived, v SP (6) + this an be re-arranged to give an exression for the feedbak ontrol law as, v SP v SP In other words, the ontroller omrises the inverse of the roess model (ommon to model based design tehniques) as well as a seifiation for the losed loo resonse harateristi, v/sp. A roess model an be obtained through lant identifiation. The losed loo resonse harateristi, v/sp must be seified. A simle seifiation is, v SP λs + λ is a user seified losed loo time onstant. (7) (8) Substituting this into equation (7) and re-arranging gives, ` τ s + τ + s k s k λ λ λ τs where it has been assumed that the roess transfer funtion is, k () s τ s + ie. first order, no dead-time. (9) (0) Based on this roess desrition, the ideal form of a PI ontroller results, where, k τ k λ and T i τ () What do you do if you want derivative ation? The first order model results in a ontrol law that is of the PI tye. If you wish to synthesis a PID ontroller, there are two otions hoose T D Ti/4 0
model the roess using a 2 nd order transfer funtion. Revision Exerise Starting with a seond order roess transfer funtion show that a PID ontrol struture an be develoed using the diret synthesis derivation tehnique. What are the settings of the PID ontroller (in terms of the oeffiients of the seond order roess transfer funtion)? Systems with time delay Throughout this ourse, our basi assumtion has been that we an model systems using the following transfer funtion, sθ ke () s τ s + (2) i.e. a first order lus dead-time transfer funtion. If this were the ase, what tye of ontrol law would result using the diret synthesis roedure? Following the derivation resented, the following ontrol law results, sθ e λs+ e sϑ (3) Note that the following resonse seifiation was used (as the time delay annot be removed from the roess), sθ v e SP λs + (4) The ontrol law, equation (3) is of non-standard form beause of the timedelay terms. Suose that e sθ is aroximated by a st order Taylor series exansion, i.e. e sθ - θs Substituting into the denominator of equation (3) and re-arranging gives, sθ e (5) ( λ + θ) s It is not neessary to aroximate the time delay in the numerator of equation (3) as this is anelled by an idential term in the roess transfer funtion, (s) giving, τ s + τ + k + s k + ( λ θ) ( λ θ) τ s whih is the form of an ideal PI ontroller where, (6)
k k τ ( θ + λ) and T i τ (7) Note the intuitive nature of the ontroller gain alulation: as the roess time delay inreases the ontroller gain will derease. Tuning for regulatory ontrol With referene to the losed loo blok diagram, for regulatory ontrol the following losed loo transfer funtion may be derived, v (8) dv + This losed loo exression an be re-arranged to give an exression for the feedbak ontrol law as, Y d Y d (9) Again, the ontroller onsists of the inverse of the roess model as well as a seifiation for the losed loo resonse harateristi, v/dv. The roess model is obtained through lant identifiation however, the losed loo resonse harateristi, v/dv, must be seified by the designer. Using the simle seifiation desribed earlier, v() s s dv() s λ (20) λs + where λ is user seified. Substituting this into equation (9) and re-arranging gives, λs (2) This is exatly the same form as equation (9) for servo ontrol. Hene the ontroller gain and integral term for a PI ontroller is given by, k τ k λ and T i τ (22) Final Remarks The notes have reviewed PID ontrol, disussed the modes of the various ontrol algorithms, the different strutures of algorithms that exist and standard tuning rules. The tuning rules reviewed inlude, Ziegler-Nihols, Cohen- Coon, and diret synthesis. Remember: 2
the tuning rules are only valid for the 'ideal' PID ontrol struture and any redition of ontrol law settings should be adjusted if an alternative PID imlementation is used. the tuning rules are only valid for self-regulating roesses (i.e oen loo stable roesses suh as those that may be desribed by the st order lus dead-time desrition). Lukily most roess systems are self-regulating the exetion to the rule being level systems. Tuning of level ontrollers will be the subjet of the next setion of the notes. 3