You are on page 1of 3

1/10/2017

PIDTheoryExplainedNationalInstruments

PID Theory Explained


PublishDate:Mar29,2011

Overview

ProportionalIntegralDerivative(PID)controlisthemostcommoncontrolalgorithmusedinindustryandhasbeenuniversally
acceptedinindustrialcontrol.ThepopularityofPIDcontrollerscanbeattributedpartlytotheirrobustperformanceinawide
rangeofoperatingconditionsandpartlytotheirfunctionalsimplicity,whichallowsengineerstooperatetheminasimple,
straightforwardmanner.
Asthenamesuggests,PIDalgorithmconsistsofthreebasiccoefficientsproportional,integralandderivativewhicharevaried
togetoptimalresponse.Closedloopsystems,thetheoryofclassicalPIDandtheeffectsoftuningaclosedloopcontrol
systemarediscussedinthispaper.ThePIDtoolsetinLabVIEWandtheeaseofuseoftheseVIsisalsodiscussed.
Table of Contents

1.ControlSystem
2.PIDTheory
3.Tuning
4.NILabVIEWandPID
5.Summary
6.References

1. Control System

ThebasicideabehindaPIDcontrolleristoreadasensor,thencomputethedesiredactuatoroutputbycalculating
proportional,integral,andderivativeresponsesandsummingthosethreecomponentstocomputetheoutput.Beforewestart
todefinetheparametersofaPIDcontroller,weshallseewhataclosedloopsystemisandsomeoftheterminologies
associatedwithit.
Closed Loop System
Inatypicalcontrolsystem,theprocessvariableisthesystemparameterthatneedstobecontrolled,suchastemperature
(C),pressure(psi),orflowrate(liters/minute).Asensorisusedtomeasuretheprocessvariableandprovidefeedbacktothe
controlsystem.Thesetpointisthedesiredorcommandvaluefortheprocessvariable,suchas100degreesCelsiusinthe
caseofatemperaturecontrolsystem.Atanygivenmoment,thedifferencebetweentheprocessvariableandthesetpointis
usedbythecontrolsystemalgorithm(compensator),todeterminethedesiredactuatoroutputtodrivethesystem(plant).For
instance,ifthemeasuredtemperatureprocessvariableis100Candthedesiredtemperaturesetpointis120C,thenthe
actuatoroutputspecifiedbythecontrolalgorithmmightbetodriveaheater.Drivinganactuatortoturnonaheatercausesthe
systemtobecomewarmer,andresultsinanincreaseinthetemperatureprocessvariable.Thisiscalledaclosedloopcontrol
system,becausetheprocessofreadingsensorstoprovideconstantfeedbackandcalculatingthedesiredactuatoroutputis
repeatedcontinuouslyandatafixedlooprateasillustratedinfigure1.
Inmanycases,theactuatoroutputisnottheonlysignalthathasaneffectonthesystem.Forinstance,inatemperature
chambertheremightbeasourceofcoolairthatsometimesblowsintothechamberanddisturbsthetemperature.Suchaterm
isreferredtoasdisturbance.Weusuallytrytodesignthecontrolsystemtominimizetheeffectofdisturbancesontheprocess
variable.

Figure 1: Block diagram of a typical closed loop system.


Defintion of Terminlogies
Thecontroldesignprocessbeginsbydefiningtheperformancerequirements.Controlsystemperformanceisoftenmeasured
byapplyingastepfunctionasthesetpointcommandvariable,andthenmeasuringtheresponseoftheprocessvariable.
Commonly,theresponseisquantifiedbymeasuringdefinedwaveformcharacteristics.RiseTimeistheamountoftimethe
systemtakestogofrom10%to90%ofthesteadystate,orfinal,value.PercentOvershootistheamountthattheprocess
variableovershootsthefinalvalue,expressedasapercentageofthefinalvalue.Settlingtimeisthetimerequiredforthe
processvariabletosettletowithinacertainpercentage(commonly5%)ofthefinalvalue.SteadyStateErroristhefinal
differencebetweentheprocessvariableandsetpoint.Notethattheexactdefinitionofthesequantitieswillvaryinindustryand
academia.

Figure 2: Response of a typical PID closed loop system.


Afterusingoneorallofthesequantitiestodefinetheperformancerequirementsforacontrolsystem,itisusefultodefinethe
worstcaseconditionsinwhichthecontrolsystemwillbeexpectedtomeetthesedesignrequirements.Oftentimes,thereisa
disturbanceinthesystemthataffectstheprocessvariableorthemeasurementoftheprocessvariable.Itisimportantto
designacontrolsystemthatperformssatisfactorilyduringworstcaseconditions.Themeasureofhowwellthecontrolsystem
isabletoovercometheeffectsofdisturbancesisreferredtoasthedisturbancerejectionofthecontrolsystem.
Insomecases,theresponseofthesystemtoagivencontroloutputmaychangeovertimeorinrelationtosomevariable.A
nonlinearsystemisasysteminwhichthecontrolparametersthatproduceadesiredresponseatoneoperatingpointmightnot
produceasatisfactoryresponseatanotheroperatingpoint.Forinstance,achamberpartiallyfilledwithfluidwillexhibitamuch
fasterresponsetoheateroutputwhennearlyemptythanitwillwhennearlyfulloffluid.Themeasureofhowwellthecontrol
systemwilltoleratedisturbancesandnonlinearitiesisreferredtoastherobustnessofthecontrolsystem.
Somesystemsexhibitanundesirablebehaviorcalleddeadtime.Deadtimeisadelaybetweenwhenaprocessvariable
changes,andwhenthatchangecanbeobserved.Forinstance,ifatemperaturesensorisplacedfarawayfromacoldwater
fluidinletvalve,itwillnotmeasureachangeintemperatureimmediatelyifthevalveisopenedorclosed.Deadtimecanalso
becausedbyasystemoroutputactuatorthatisslowtorespondtothecontrolcommand,forinstance,avalvethatisslowto
openorclose.Acommonsourceofdeadtimeinchemicalplantsisthedelaycausedbytheflowoffluidthroughpipes.
Loopcycleisalsoanimportantparameterofaclosedloopsystem.Theintervaloftimebetweencallstoacontrolalgorithmis
theloopcycletime.Systemsthatchangequicklyorhavecomplexbehaviorrequirefastercontrollooprates.

Figure 3: Response of a closed loop system with deadtime.


Oncetheperformancerequirementshavebeenspecified,itistimetoexaminethesystemandselectanappropriatecontrol

http://www.ni.com/whitepaper/3782/en/

1/3

1/10/2017

PIDTheoryExplainedNationalInstruments

Oncetheperformancerequirementshavebeenspecified,itistimetoexaminethesystemandselectanappropriatecontrol
scheme.Inthevastmajorityofapplications,aPIDcontrolwillprovidetherequiredresults
2. PID Theory

Proportional Response
Theproportionalcomponentdependsonlyonthedifferencebetweenthesetpointandtheprocessvariable.Thisdifferenceis
referredtoastheErrorterm.Theproportionalgain(Kc)determinestheratioofoutputresponsetotheerrorsignal.For
instance,iftheerrortermhasamagnitudeof10,aproportionalgainof5wouldproduceaproportionalresponseof50.In
general,increasingtheproportionalgainwillincreasethespeedofthecontrolsystemresponse.However,iftheproportional
gainistoolarge,theprocessvariablewillbegintooscillate.IfKcisincreasedfurther,theoscillationswillbecomelargerand
thesystemwillbecomeunstableandmayevenoscillateoutofcontrol.

Figure 4: Block diagram of a basic PID control algorithm.


Integral Response
Theintegralcomponentsumstheerrortermovertime.Theresultisthatevenasmallerrortermwillcausetheintegral
componenttoincreaseslowly.Theintegralresponsewillcontinuallyincreaseovertimeunlesstheerroriszero,sotheeffectis
todrivetheSteadyStateerrortozero.SteadyStateerroristhefinaldifferencebetweentheprocessvariableandsetpoint.A
phenomenoncalledintegralwindupresultswhenintegralactionsaturatesacontrollerwithoutthecontrollerdrivingtheerror
signaltowardzero.
Derivative Response
Thederivativecomponentcausestheoutputtodecreaseiftheprocessvariableisincreasingrapidly.Thederivativeresponse
isproportionaltotherateofchangeoftheprocessvariable.Increasingthederivativetime(Td)parameterwillcausethe
controlsystemtoreactmorestronglytochangesintheerrortermandwillincreasethespeedoftheoverallcontrolsystem
response.Mostpracticalcontrolsystemsuseverysmallderivativetime(Td),becausetheDerivativeResponseishighly
sensitivetonoiseintheprocessvariablesignal.Ifthesensorfeedbacksignalisnoisyorifthecontrollooprateistooslow,the
derivativeresponsecanmakethecontrolsystemunstable
3. Tuning

TheprocessofsettingtheoptimalgainsforP,IandDtogetanidealresponsefromacontrolsystemiscalledtuning.There
aredifferentmethodsoftuningofwhichtheguessandcheckmethodandtheZieglerNicholsmethodwillbediscussed.
ThegainsofaPIDcontrollercanbeobtainedbytrialanderrormethod.Onceanengineerunderstandsthesignificanceof
eachgainparameter,thismethodbecomesrelativelyeasy.Inthismethod,theIandDtermsaresettozerofirstandthe
proportionalgainisincreaseduntiltheoutputofthelooposcillates.Asoneincreasestheproportionalgain,thesystem
becomesfaster,butcaremustbetakennotmakethesystemunstable.OncePhasbeensettoobtainadesiredfast
response,theintegraltermisincreasedtostoptheoscillations.Theintegraltermreducesthesteadystateerror,butincreases
overshoot.Someamountofovershootisalwaysnecessaryforafastsystemsothatitcouldrespondtochangesimmediately.
Theintegraltermistweakedtoachieveaminimalsteadystateerror.OncethePandIhavebeensettogetthedesiredfast
controlsystemwithminimalsteadystateerror,thederivativetermisincreaseduntiltheloopisacceptablyquicktoitssetpoint.
Increasingderivativetermdecreasesovershootandyieldshighergainwithstabilitybutwouldcausethesystemtobehighly
sensitivetonoise.Oftentimes,engineersneedtotradeoffonecharacteristicofacontrolsystemforanothertobettermeet
theirrequirements.
TheZieglerNicholsmethodisanotherpopularmethodoftuningaPIDcontroller.Itisverysimilartothetrialanderrormethod
whereinIandDaresettozeroandPisincreaseduntiltheloopstartstooscillate.Onceoscillationstarts,thecriticalgainKc
andtheperiodofoscillationsPcarenoted.TheP,IandDarethenadjustedasperthetabularcolumnshownbelow.
Control

Ti

Td

0.5Kc

PI

0.45Kc

Pc/1.2

PID

0.60Kc

0.5Pc

Pc/8

Table 1. ZieglerNichols tuning, using the oscillation method.


4. NI LabVIEW and PID

LabVIEWPIDtoolsetfeaturesawidearrayofVIsthatgreatlyhelpinthedesignofaPIDbasedcontrolsystem.Controloutput
rangelimiting,integratorantiwindupandbumplesscontrolleroutputforPIDgainchangesaresomeofthesalientfeaturesof
thePIDVI.ThePIDAdvancedVIincludesallthefeaturesofthePIDVIalongwithnonlinearintegralaction,twodegreeof
freedomcontrolanderrorsquaredcontrol.

Fig 5: VIs from the PID controls palette of LabVIEW


PIDpalettealsofeaturessomeadvancedVIslikethePIDAutotuningVIandthePIDGainScheduleVI.ThePIDAutotuningVI
helpsinrefiningthePIDparametersofacontrolsystem.OnceaneducatedguessaboutthevaluesofP,IandDhavebeen
made,thePIDAutotuningVIhelpsinrefiningthePIDparameterstoobtainbetterresponsefromthecontrolsystem.

Fig 6: Advanced VIs from the PID controls palette of LabVIEW


ThereliabilityofthecontrolssystemisgreatlyimprovedbyusingtheLabVIEWRealTimemodulerunningonarealtime
target.NationalInstrumentsprovidesthenewMSeriesDataAcquisitionboardswhichprovidehigheraccuracyandbetter
performancethananaveragecontrolsystem.

Fig 7: A typical LabVIEW VI showing PID control with a plugin NI data acquisition device
ThetightintegrationoftheseMSeriesboardswithLabVIEWminimizesthedevelopmenttimeinvolvedandgreatlyincreases
theproductivityofanyengineer.Figure7showsatypicalVIinLabVIEWshowingPIDcontrolusingNIDAQmxAPIofMseries
devices.
5. Summary

http://www.ni.com/whitepaper/3782/en/

2/3

1/10/2017

PIDTheoryExplainedNationalInstruments

ThePIDcontrolalgorithmisarobustandsimplealgorithmthatiswidelyusedintheindustry.Thealgorithmhassufficient
flexibilitytoyieldexcellentresultsinawidevarietyofapplicationsandhasbeenoneofthemainreasonsforthecontinueduse
overtheyears.NILabVIEWandNIplugindataacquisitiondevicesofferhigheraccuracyandbetterperformancetomakean
excellentPIDcontrolsystem.
6. References

1.Classical PID Control


byGrahamC.Goodwin,StefanF.Graebe,MarioE.Salgado
ControlSystemDesign,PrenticeHallPTR
2.PID Control of Continuous Processes
byJohnW.WebbRonaldA.Reis
ProgrammableLogicControllers,FourthEdition,PrenticeHallPTR

Download LabVIEW(http://www.ni.com/trylabview/)
Get Free Courseware Packets for Controls and Mechatronics(http://ni.com/academic/controls_curriculum.htm)
See Product Solutions for Teaching Controls and Mechatronics
(http://www.ni.com/academic/controls_products.htm)

http://www.ni.com/whitepaper/3782/en/

3/3

You might also like