Professional Documents
Culture Documents
PIDTheoryExplainedNationalInstruments
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.
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.
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
LabVIEWPIDtoolsetfeaturesawidearrayofVIsthatgreatlyhelpinthedesignofaPIDbasedcontrolsystem.Controloutput
rangelimiting,integratorantiwindupandbumplesscontrolleroutputforPIDgainchangesaresomeofthesalientfeaturesof
thePIDVI.ThePIDAdvancedVIincludesallthefeaturesofthePIDVIalongwithnonlinearintegralaction,twodegreeof
freedomcontrolanderrorsquaredcontrol.
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
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