Chapter8FrequencyResponse
Goals
Explainwhatfrequencyresponseisandhowitisusedtocharacterizeunknownsystems
ExplainhowtogenerateaBodeplotfromaknowntransferfunction
ExplainhowtoanalyzetheBodeplotofanunknownsystemtodetermineitstransferfunction
ExplainhowtodeterminerelativestabilityfromaBodeplot
ExplaintheanalysisofsteadystateerrorusingtheBodeplot
ExplainhowtodesignPIDcontrollersusingtheBodeplot
Introduction
Socalledfrequencyresponseisanotherverycommonmethodforlookingatsystems.Frequency
responsereferstoanalternativewayofexcitingasystem(asopposedtostepresponse,whereasystem
issubjectedtoasudden,constantinput).Anunknownsystemisexcitedwithasinusoidalinput,its
sinusoidaloutputisobserved,andsomeconjecturecanbemadeastowhatkindofsystemitis.The
wordfrequencyisusedbecausetypicallythefrequencyoftheinputsinusoidischanged,andtheoutput
isobservedoverarangeofinputfrequencies.Thusoneuseofthismethodistocharacterizeunknown
systemsbyinputtingsinewavesofdifferentfrequenciesandobservingtheoutputanditsvariationwith
frequency.
Butfrequencyresponseandtheresultingplotsofthissinusoidalexcitationcanalsobeusedtogaugea
systemsstability,toseeitssteadystateerror,andtodesigncontrollers.Itoffersanotherlookata
systembesidesthatgivenbytherootlocus.ThemainfromtheabovesinusoidalinputtestisaBode
plot,whichreallyconsistsoftwoplots,amagnitudeplotandaphaseangleplot.TheBodeplotcanbe
usedtoconfirmtherootlocusrenditionofthesystemandviceversa.
Bodeplots
Asstatedabove,themaingraphicaltoolofthefrequencyresponseapproachtosystemanalysisisthe
Bodeplot.TheBodeplotisalittleoddandtakessomegettingusedto.Thereisabruteforcewayto
generateaBodeplot,whichisdescribedhere.Thesystemisunknown.Itisablackboxthatwillbe
subjectedtosinusoidinputsofvaryingfrequencytodetermineitscontents.Theconventional
frequencyresponseexperimentisillustratedinFigure8.1.
1 A,
1i
1
A,
1o
1
2 A,
1i
2
3 A,
1i
3
Unknown
system
2o
3o
81
Chapter8FrequencyResponse
Figure8.1Bruteforcefrequencyresponsedetermination
Thisfigureillustratesseveralthingsusingthethreesamplesinewaves.Itisnormalfortheexperimenter
tokeeptheinputsinewaveatthesameamplitudeandthenadjustthefrequencytoanumberof
differentsettings,usuallymovingfromslowtofast.Inalinearsystem,theoutputfrequencyisthesame
astheinputfrequency,asshownabove.Iftheoutputfrequencyandtheinputfrequencyarenotthe
same,thentheunknownsystemisnotlinear,andfrequencyresponsetechniquesareinvalidforfurther
analysis.Noteintheaboveexamplethatinthefirsttrial,theoutputamplitudeissmallerthantheinput
amplitude.Inthesecondtrial,theoutputamplitudeisnowlargerthantheinputamplitude.Inthelast
trial,theoutputamplitudeisonceagainsmallerthantheinputamplitude.Youmayhaveexperienced
suchaphenomenonyourselfwhendrivingacarwithunbalancedfronttires.Oneapproachesacertain
speed,andthesteeringwheelbeginstoshakebecauseoftheunbalance.Ifonedrivesfaster,the
shakingsubsides.Thatisresonance,whenoneisexcitingthesystematitsnaturalfrequency.
TheamplitudeormagnituderatioaboveisgiventhesymbolM.So
.ItisobviousthatMisa
functionof,thedrivingfrequency.Lessobviousbutnoticeableuponcloserinspectionisthatthe
inputandoutputsinusoidshaveaphaseshift.Inthefirsttrial,theoutputisinphasewiththeinput,but
inthesecondandthirdtrials,thesinusoidisshiftedfurtherandfurtherbackinphase.Sothephase
angle,,isalsoafunctionof.Intrial1 =0.Intrial2 =90.Inthethirdtrial,itis180.The
minussignindicatesthatthephaseoftheoutputisshiftedback.So,forinstance,intrial2,apeakofthe
outputoccurs90afterthepeakoftheinput.Whatis90?Afullcycleofasinusoidis360,so90is
justaquarterofthat.Figure8.2showswhatanoscilloscopewouldlooklikecapturinganinputand
outputfromasinglefrequencyresponsetest.Withbothsinusoidsplotted,onecanthenseeand
interpretthephaseshift.
82
Chapter8FrequencyResponse
Figure8.2Oscilloscopeplotfromasinglefrequencyresponsetest
Inthisplot,channel1istheinputandchannel2theoutput(alwaysgoodpractice).Notethattheinput
andoutputfrequenciesarethesame,anindicationofalinearsystem.Thefrequencyatwhichthistrial
ismadecanbedeterminedfromtheplotasfollows.Theperiodbetweentwoadjacentpeaksonthe
samecurvecoversabout6.5blocks,andeachblockrepresents50msec,so
1000
19.3
.Butnormallytheexperimenterwhoproducedtheaboveplotispumping
theunknownsystemwithasignalgeneratorandisadjustingthisfrequencydirectly.Heorshesimply
recordsitwhilemakingthetest.
Thecurvewiththelargestamplitudeaboveisonchannel1,sotheinput.Sincetheverticalscaleofthe
twochannelsisthesame,itisobviousthatthereisamagnitudegainoflessthan1forthistrial.The
inputrangesoverabout4verticalblocks.Thepeaktopeakamplitudeoftheoutputrangesoverabout
1.5
1.5blocks,sothemagnituderatiois
4 0.375or8.5decibels(seebelow).Ittakessome
practicetopickthephaseangleoffofascreenshot.Ifwelookattheabove,wenotethatthehorizontal
distancebetweentwoadjacentpeaksonthesamecurveis360.Sothedistancebetweenthefirstpeak
oftheinputcurveanditsnextzerocrossingis90.Ifwelookatthepeakoftheoutputcurverelativeto
thepeakoftheinputcurve,weseethatitoccursabouthalfwaybetweentheinputcurvesfirstpeak
43.The
anditsnextzerocrossing,perhapsalittlesooner.Sothephaseshiftisabout43,or
negativesignindicatesthattheoutputcurvelagstheinputcurve(theoutputcurvespeakhappensafter
theinputcurves).Bothofthesemeasurementscouldbemademoreaccuratelyusingthecursorson
theoscilloscope.
83
Chapter8FrequencyResponse
ThedependencyofMand onisthekeytounderstandingwhatisinsidetheblackbox.Thesetwo
quantitiesareplottedagainstintwoplots,whichtogetherareknownasaBodeplot.Theplotsare
alignedvertically,sothatbothhavethesamescale.AtypicalBodeplotisshowninFigure8.3.
Figure8.3Bodeplotmadefromfrequencyresponsetests
TheBodeplothassomeuniquecharacteristics.First,isplottedonalogarithmicscale.Thisallowsone
toplotagreaterrangeoffrequenciesthanalinearscalewouldallow.Noteabovethatthescale
rangesfrom0.1rad/secto100rad/sec.Second,Misplottedindecibels.Adecibelisdefinedasthe
base10logarithmofaquantitymultipliedby20.So20log(M)isplotted,notMdirectly.Thereasonfor
thisisgivenbelow.isplotteddirectlyindegrees.Aboverangesfrom90atlowfrequenciesto180
athighfrequencies.
Thissummarizesthenormallaboratoryprocedurefollowedforcharacterizinganunknownsystemusing
frequencyresponseasopposedtostepresponse.Stepresponseisstillavalidmethod.Infactoftenthe
twoareusedtogethertoconfirmwhateachisshowing.Frequencyresponseprovides,however,afiner
insightintoanunknownsystemsstructure,sinceitrevealsresponsesfrequencybyfrequency.Some
partsofasystemmayhavenoresponseatoneexcitationfrequencybutbecomeactiveatanother
excitationfrequency.Thepresenceofallbutthedominantcomponentsofasystemareusuallynot
noticeableinastepresponse.
Bodeplotfromaknowntransferfunction
84
Chapter8FrequencyResponse
TheabovemethodforqueryinganunknownsystemproducesaBodeplot.ThentheBodeplotcanbe
interpretedtorevealthecomponentsoftheunknownsystem.TounderstandhowtointerpretaBode
plot,itisusefulknowhowtogenerateaBodeplotfromaknowtransferfunction.Theprocedurefor
doingthisissimple,onlygivenandnotprovenhere.Onereplacessinthetransferfunctionwithj.
|
|,themagnitudeoftheresultingfunctionand
Then
,theangleoftheresulting
function.Anexampleillustratesthisbest.
Example8.1
FindMandasfunctionsofforthetransferfunction
Solution:
Onereplacesswithj :
Boththenumeratoranddenominatorarecomplexnumbers.Themagnitudeofafractionofcomplex
numbersisthemagnitudeofthenumeratordividedbythemagnitudeofthedenominator.So
15
1
4
Atsmallvaluesof ,
0.Atlargevaluesof ,
.Thesevalues,convertedinto
decibels,showwherethemagnitudeplotoftheBodeplotstartsandends.
For,theangleofafractionofcomplexnumbersistheangleofthenumeratorminustheangleofthe
denominator.15j isontheimaginaryaxisforallvaluesof ,sotheangleofthenumeratorisalways
90.Inthedenominator,ifissmall,the1dominates.Itisapositiverealnumber,soitisatanangleof
0and=90(
).Ifislarge,2jdominates.Itisalsoontheverticalaxis,soitsangleis
also90.Thusathigh , approaches0.Notealsothatat=0.5rad/sec,theangleofthe
denominatoris45.So=9045=45.thusstartsoffonthelefthandsideofthephaseplotat90.
Itdropsandpassesthrough45at=0.5rad/secandthenapproaches0atlargevaluesof.Onecan
confirmthisinMatlabwiththefunctionbode([15,0],[2,1]).ButtobeabletointerpretBodeplots,one
mustunderstandhowvaryingchangesthevalueofMand.
Bodeplotsofcommontransferfunctioncomponents
Analysissimilartothiscanbemadeforcommontransferfunctioncomponents(gain,integrator,
differentiator,firstandsecondorderlags,firstandsecondorderleads).(Alagisafirstorsecond
ordercomponentinthedenominatore.g.
.Aleadisafirstorsecondorderinthe
numeratore.g.
1.)Ifthisisdone,Table8.1results.Thistablecanthenbeusedto
interpretBodeplotsofunknownsystemstoseewhatcommoncomponentstheycontain.Some
featuresofcommoncomponentsareworthemphasizing.
85
Chapter8FrequencyResponse
Component
Bodeplot
Characteristics
20 log K
IfK>1,20logK>0
IfK<1,20logK<0
Gainhaszerophase.Sowhenitisaddedtoa
system,itsimplyshiftsthesystemslogmagcurve
up(K>1)ordown(K<1).
Gain,K
0
cd
dB/d
0
2
Differentiator,s
90
0
IfK>1,20logK>0
IfK<1,20logK<0
Gainhaszerophase.Sowhenitisaddedtoa
system,itsimplyshiftsthesystemslogmagcurve
up(K>1)ordown(K<1).
-2 0
dB /
dc d
Integrator,
0
-90
IfK>1,20logK>0
IfK<1,20logK<0
Gainhaszerophase.Sowhenitisaddedtoa
system,itsimplyshiftsthesystemslogmagcurve
up(K>1)ordown(K<1).
1
0
1storderlead,
Ts+1
/ dcd
20 dB
90
0
IfK>1,20logK>0
IfK<1,20logK<0
Gainhaszerophase.Sowhenitisaddedtoa
system,itsimplyshiftsthesystemslogmagcurve
up(K>1)ordown(K<1).
B = 1/
-20 dB
/dcd
st
1 orderlag,
0
-90
IfK>1,20logK>0
IfK<1,20logK<0
Gainhaszerophase.Sowhenitisaddedtoa
system,itsimplyshiftsthesystemslogmagcurve
up(K>1)ordown(K<1).
= 1/
B
Table8.1Bodeplotsofcommoncomponents(part1)
86
Chapter8FrequencyResponse
Component
Bodeplot
0
2ndorderlead,
1
dcd
dB/
0
4
180
0
Startsoutwith0logmag.Asymptotestartsa40
dB/dcdriseatbreakfrequency,whichisthenatural
frequency.
Behaviorrightaroundbreakfrequencydependson.
Phasecurvestartsat0andrisesto180degrees.Itisat
90degreesatbreakfrequency.
-4 0
2ndorderlag,
0
-180
Characteristics
dB
/ dc
d
Startsoutwith0logmag.Asymptotestartsa40
dB/dcdriseatbreakfrequency,whichisthenatural
frequency.
Behaviorrightaroundbreakfrequencydependson.
Phasecurvestartsat0andrisesto180degrees.Itisat
90degreesatbreakfrequency.
Table8.1Bodeplotsofcommoncomponents(part2)
ThistableshowstheasymptotesusedtodrawBodeplotsofthesecomponents.Thefirstandsecond
orderleadsandlagscandeviatefromtheseasymptotes.Secondordersystemswithlow deviate
significantlyfromtheasymptotesintheneighborhoodofn.
Ingeneralansinthenumeratorcausesariseinthemagnitudeandphaseplots.Ansinthe
denominatorcausesafallinthemagnitudeandphasecurvesasincreases.Notethatallleadsand
lagsstarttheirmagnitudeandphaseplotsat0.Atthebreakfrequency
forafirstorderlead
orlagorthenaturalfrequencyforasecondorderleadoflag,themagnitudeplotbreaksupward(leads)
ordownward(lags).Thisrisingorfallingslopeforafirstorderisattherateof20dB/dcdforafirst
orderand40dB/dcdforasecondorder.
OnecantellalotbyinspectingthestartingpointsofaBodeplot,thelefthandsidesoftheplotsofan
unknownfunction.Ifthestartingslopeofthemagnitudecurveis0,thenthereisnodifferentiatornor
integratorpresentinthesystem.Ifthebeginningslopeofthemagnitudecurveisupward,thenone
wouldconcludethereisadifferentiatorpresent.Onecoulddeterminethebeginningslopeandtellhow
manyintegratorsarepresent.Ifoneintegratorispresent,theupwardslopewouldbe20dB/dcd.If
insteadtheupwardslopewere40dB/dcd,thenonecouldconcludethattherearetwodifferentiators
present.Onecouldconfirmthisbylookingatthelefthandsideofthephaseplot.Adifferentiatorhasa
constantof90,evenonthelefthandsideofthephaseplot.Sowithonedifferentiator,thephase
plotwouldstartat90andthemagnitudeplotwouldhaveaninitialupwardslopeof20dB/dcd.
87
Chapter8FrequencyResponse
NowwecanseewhyoneplotsMindecibelsandnotinnormalunitsinaBodeplot.Anunknown
systemismadeupofanumberofthecomponentsshowninTable8.1.Taketheexample
16
3
1
16
7
Inthephaseplot,thephaseofthefunctionG(j)isthesumofthephaseanglesofthecomponents.
Thusatlow,allthetermsthataddtorealnumbersdropout.Therealnumberdominates,sofor
low,thesecomponentshaveaphaseangleof0.The
termhasaphaseof180.Sothe
phaseplotsstartsoutat180.Themagnitude,however,arenotaddedlikethephaseanglesofthe
componentsare.Theyformproductsinsteadofsums.So
|
16
9
1
16
49
49
Butifwetakethelogofbothsidesandmultiplybothsidesby20togetdecibels
20
20
20
20 log 16
16
20
20 log
1
49
Sotheproductturnsintoasum,andasdecibelsonecansuperimposethemagnitudesofthe
componentstogettheentiremagnitudeofthetransferfunction.Thuswithboththemagnitudeand
phaseplots,onecansimplysuperimposethecomponentstogetthemagnitude(indecibels)andthe
phaseplotsoftheentiretransferfunction.
OfcourseininterpretingtheBodeplotofanunknownsystem,oneisseeingtheplotoftheentire
system,andonemustpickoutthecomponentsfromthewhole.Table8.1iskeytothis,becauseit
detailshowtheBodeplotsofindividualcomponents.Withanunderstandingofthesesystems
behaviorasvaries,onecanpicktheindividualcomponentsoutoftheBodeplotofanentireunknown
system.
InterpretingaBodeplotofanunknownsystemtogetitstransferfunction
SeveralexampleswillillustratehowonegoesaboutanalyzingtheBodeplotofanunknownsystemto
getitstransferfunctionexperimentally.
Example8.2
AnalyzethefollowingBodeplotandsuggestthetransferfunctionthatproducedthisplot.
88
Chapter8FrequencyResponse
Solution:
BycomparingtheplotwiththeentriesofTable8.1,onecanseealmostimmediatelythatthisisan
integrator.Themagnitudeplotdropssteadilyeachdecadeby20dB,thebeginningslopeofthe
magnitudeplotisnot0(soitisnotafirstorderlag),andthephaseangleisaconstant90.Butisthere
againinvolved?ApureintegratorsBodeplotcrossestheaxis(0dB)at=1rad/sec.At=1
rad/sec(100),themagnitudeisabout25dBinthisexample.Sothemagnitudeplothasbeenpushedup
about25dB.Notethatagainhas=0forall,soagainhasnoinfluenceonthephasecurve.Thus
thissystemisanintegratorwithagain.Againsmagnitudecurveisastraightlineat20log(K),sothe
effectofagainistodisplacethemagnitudecurveupward(ifK>1)ordownward(ifK<1).Sincethe
magnitudecurvehasbeenpushedupby25dBat=1rad/sec,
20
log
log
10
25
25
20
1.25
18
Sothesuggestedtransferfunctionis
18
OneshouldalwaysthenconfirmthisconjecturebycheckingitwiththeMatlabbode()functionhere
bode([18],[1,0]).
89
Chapter8FrequencyResponse
Theroleplayedbythegainisveryimportant,sinceitisnormalinacontrollooptoadjustthe
controllersgain.Addingagainsimplydeflectsthemagnitudecurveupordownandhasnoeffecton
thephasecurve.Theabilityofthegaincurvetochangemagnitudebuthavenoeffectonphasewillbe
exploitedindesigningcontrollersusingBodeplots.
Example8.2
AnalyzetheBodeplotofFigure8.3andconjecturewhattransferfunctionproducedthisplot.
Figure8.3Bodeplotmadefromfrequencyresponsetests
Solution:
Thefigureisreproducedhereforconvenience.Featurestonoticeare:
Themagnitudeplotstartsoffwithanupwardslope.Theslopeseemstobe20dB/dcd,sothis
indicativeofadifferentiator.
Adifferentiatorwithnogainpassesthrough100rad/secat0dB.Intheaboveplottheupward
slopingpartofthecurvepassesthrough100atabout14dB.Sothereisagainherealso.
Thephasecurvestartsat90andendsat180,soatotalphaseshiftof270.Eachsinthe
denominator(integrator,1storderlag)dropstheeventualphaseangleby90(a2ndorderlag
dropsitby180).
810
Chapter8FrequencyResponse
Soitlooksliketheremaybeadifferentiatorandthenthreessinthedenominatorofthetransfer
function.Thiscanbeconfirmedalsobyinspectingthefinalslopeofthemagnitudecurve.Itis40
dB/dcd.Thisindicatesanexcessoftwossinthedenominator.
Nowitissomewhatdifficulttoascertainwherethesetermswithssinthedenominatorhavetheirbreak
frequencies(1storderlags)ornaturalfrequency(2ndorderlags).Alotseemstobehappeningbetween
1< <10.Thereisnoevidentbumpinthemagnitudecurve,however,whichwouldindicatethe
presenceofanunderdampedsecondorderinthedenominator(a2ndorderlag).Soperhapsforafirst
guessitisusefultospeculatethattherearethree1storderlagsinthistransferfunctionbetween1and
10.Theirproximitywithinthisnarrowrangewillmakeithardtoidentifythemindividually.
Thephaseplotofa1storderlagshowsthatatthebreakfrequency(B)thephasehasdroppedby45.
Ifonelooksforthefrequencywherethephaseis45belowthestartingfrequency,onecanspeculate
thatthatisthebreakfrequencyforthefirst1storderlag.Intheabovephaseplot,thiswouldbeat
abouthalfwaybetween100andthenextverticalline.100=1,and101=10.Sothenextverticalline
after100is2.Thehalfwaypointisnot,however,1.5,sincethelogarithmicscaleisuneven.Sothe
halfwaypointwouldbemorelike1.3.Wecanspeculatethenthatthefirst1storderlagisat=1.3.
Each1storderlagbringsintotala90phaseshifttothephasecurve.Ifthethreesupposed1storder
lagswereallwidelyseparatedontheaxis,onecouldjustlookonthephasecurvewhere was45,
45,and135tofindthethreebreakfrequencies.Butapparentlythethree1storderlagsarejammed
togetherwithinanarrowrangeof,sothesecondonebecomesactivebeforetheeffectofthefirst
onehassubsided.SoB2willoccurbefore =45,andB3occurbefore=135.Thusweareleft
withonlythechoiceofguessingatthesebreakfrequencies,thenmakingaBodeplotoftheresulting
transferfunction,comparingitwiththegivenplot,andthenadjustingitthroughtrialanderroruntil
thereisamatch.TryB1=1.3,B2=6,andB3=12.Thesegive1storderlagsof
,
,and
Forthegain,weneed
20
log
14
0.2
10
Sothefirststabatatransferfunctionis
0.2
1
1
1.3
1
1
6
1
1
12
1
1
0.2 1.3 6 12
1.3
6
12
TheMatlabcommandsequence
>>s=tf(s)
>>g=19*s/((s+1.3)*(s+6)*(s+12))
811
19
1.3
12
Chapter8FrequencyResponse
>>bode(g)
givestheBodeplotofourconjecturedtransferfunction:
Figure8.4Bodediagramofsurmisedfunction
Acomparisonofthetwoplotsshowsthattheyarenottoofarremovedfromoneanother,soasafirst
guess,thistransferfunctionisarelativelygoodmatch.Onecouldmakefurthersmalladjustmentsto
refinethefittotherequiredexactness.
StabilityviaBodeplotsgainandphasemargin
AnothertypeofusefuldiagramincontrolsistheNyquistdiagram.OurfocushereisontheBode
diagram,butyoushouldknowwhataNyquistdiagramis.TogettheNyquistDiagramforatransfer
functionG(s)thisiswhatyoudo.JustlikefortheBodeplot,replacetheswithj.Thenyouvarythe
frequency,,overtherange0.Foreach,youwillgetacomplexnumber:G(j)=[Mag(G(j)),
Ang(G(j)].HereiswhereyoudifferfromtheBodePlot.Insteadofmakingtwoplots,youmakeasingle
one,apolarplot.ThisiscalledtheNyquistdiagram.
It'seasytogetNyquistdiagramsinMatlab.Youmightwanttotrythefollowingcommands:
>> s = zpk('s')
>> gol = 1/((s+2)*(s+5))
>> nyquist(g0l)
812
Chapter8FrequencyResponse
YoucanalsogetaNyquistdiagraminsideMatlab'sltiviewer:
>> s = zpk('s')
>> gol = 1/((s+2)*(s+5))
>> ltiview(gol)
Oncetheviewercomesup,gototheEditmenuandchoosePlotConfigurations...Stickwiththesingle
plot(choicesontheleft).Thenontheright,underResponseType,firstitem,chooseNyquist.
TheNyquistdiagramisusefulprimarilyfordeterminingsystemstability.Whatyouneedtoknowisthis:
Forastablesystem(noclosedlooppolesintherighthalfplane),theopenloopsystemwillhavethese
properties:
1. When = -180,Mshouldbe<1
2. WhenM=1, shouldbe>180
Thesefactsareneededtounderstandgainandphasemargin.
Thegainmarginandphasemarginareusefulfordeterminingrelativestability,i.e.notjustwhetheror
notasystemisstablebutalsohowstablethesystemis.
20logM=0dB
12.06dB
=0
=180
GM =phasecrossoverfrequency
Figure8.5Gainmargin
Figure8.5showsaportionofatypicalBodePlotforanopenlooptransferfunction.Itillustrateswhat
thegainmargin(GM)is.AswasstatedinthediscussionofNyquiststability,when =180,Mshouldbe
<1.TofindGM,firstfindthephasecrossoverfrequency,GM.Thisisthefrequencywherethephase
curvepassesthrough180.Getthemagnitudeatthatfrequency.Intheaboveplot,GM=12.06dB.
WhatthismeansisthatatGMtheactualmagnitudeis
M=1012.06/20=0.2495
813
Chapter8FrequencyResponse
RememberthatnegativemagnitudesontheBodemagnitudeplotmeanactualvaluesofmagnitudethat
arebetween0and1.
Alsorecallthataddingagaintoatransferfunctiononlyshiftsthemagnitudecurveup(K>1)ordown(K
<1).Theaddedgaindoesnotaffectthe curvebecauseK's for all > 0. Sotheaboveshowsthata
gainofK=12.06dBcouldbeaddedtothesystembeforemakingitunstable.
K=12.06dB=1012.06/20=4.01
Notethat4.01*0.2495=1.0.
ThephasemarginreflectsthesecondNyquiststabilitycriterion:whenM=1, shouldbe>
180.
20logM=0dB
=0
=143.6
= 180
M =gain crossoverfrequency
Figure8.6Phasemargin
Figure8.6showsaportionofatypicalBodeplotforanopenlooptransferfunction.Itillustrateswhat
thephasemargin(M)is.Tofind M,firstfindthegaincrossoverfrequency, M. Thisisthefrequency
whereM=1.RecallatM=1,20dBlogM=20log1=0.So Miswherethemagnitudecurvecrosses
theaxis.Getthephaseatthatfrequency.Intheaboveplot, atMis143.6.Thephasemarginis
theamountthephaseangleisabove = -180atthegaincrossoverfrequency.
M =143.6(180)=36.4
AruleofthumbforgoodresponseisGM>6dB,30< M<60.
Example8.3
ForthesystemwhoseBodePlotisgivenbelow,find
1) GM
2) M
814
Chapter8FrequencyResponse
3) GM
4) M
Figure8.7Bodeplotofunknownfunction
815
Chapter8FrequencyResponse
Solution:
GM=20dB
M=180138
=42deg
GM =2.2rad/sec
M=0.8rad/sec
Figure8.8Solutiontoaboveexample
Forpracticeyoumightwanttotrytodeterminethetransferfunctionforthesystemabove.
Analternatewayandanongraphicalwaytosolvetheaboveproblemisfirsttodeterminethetransfer
function.Forthisexampleitis
5
1
Youcanlookforthephasecrossoverfrequencyandthegaincrossoverfrequencybytrialanderror.Put
yourcalculatorintopolarmode,sothatanswersaredisplayedinpolarformat.Thensimplyreplaces
withj, andlet varyfromsmallvaluestolargevalues.
Sinceboththemagnitudecurveandthephasecurvegenerallyslopedowntotheright,you
shouldfindthephasecrossoverfrequencyfirst.Keeptryingvaluesofjuntilyoufindout
where=180.Thisisthephasecrossoverfrequency.Getthemagnitudeatthispointand
calculate20logM.ThisisthevalueMatthephasecrossoverfrequency.20log(M)isthegain
margin.
KeeplookingtotherightuntilyoufindthepointwhereM=1.Thisisthegaincrossover
frequency.Getthephaseatthisfrequency.Then
816
Chapter8FrequencyResponse
M= (180)
Performanceandgainandphasemargin
Thereisadirectconnectionbetweenphasemarginand.Wehavealreadyseenthatthereisadirect
connectionbetweenandpercentovershoot.SothereisadirectconnectionbetweenMand%OS.
TherelationshipbetweenMandis
90
arctan
100%or
Thespeedofasystemdependsonandn.FromChapter4weknow
and
nisafunctionofandthegaincrossoverfrequency,M:
or
2
Inpracticeitisoftendifficulttoseparatethetwosystemperformanceindices%OSandspeed.One
cannotadjustthephasemarginwithouthavinganeffectonthegaincrossoverfrequencyandthusthe
speedofthesystem.TakethesystemshowninFigure8.7forexample.Toincreasethephasemargin
usingasimplegainadjustment,onelowersthemagnitudecurve.Thismakesthefrequencywherethe
magnitudecrosses0dBshifttotheleft,i.e.toalowerfrequency.Butloweringthegaincrossover
frequencymakesthesystemslower.
SeeingsteadystateerroronBodeplots
817
Chapter8FrequencyResponse
Unliketherootlocus,wherethesteadystateerrorinasystemisveryhardtodeduce,itcanbereadily
seenonaBodediagram.RecallfromChapter6thattheopenlooptransferfunctionisusedtoanalyze
steadystateerror(ess)andthatthestaticerrorconstantsKp,Kv,andKaareusedtocalculatethe
actualsteadystateerror.Recallalsothatthereisapatternforsteadystateerror.Atype0system
subjectedtoastepinputwillhaveafinitesteadystateerror.Atype1systemsubjectedtoastepinput
willhaveess=0andsoon.Thetypeofthesystemisthenumberoffreeintegratorsintheopenloop
transferfunction.WehaveseenabovethatfreeintegratorshaveadistinctivesignatureinBode
diagrams.Anintegratorhasa20dB/dcdslopeonthelefthandsideoftheBodemagnitudeplotanda
90phaseanglefortheentirerangeofontheBodephaseplot.SoiftheBodeplotofanopenloop
systemhasonlynonzeropolesandzerosi.e.neitherpolesnorzerosattheoriginthemagnitudeplot
willstartoffwithaflatrunbeforebreakingupordown.Thephaseplotwillalsobeginat0.Thisisa
type0system.Atype1system,withitssinglefreeintegrator,willthushaveamagnitudeplotwitha20
dB/dcdslopeandaphaseplotthatstartsoutat90.Atype2systemwillhaveamagnitudeplotwitha
startingslopeof40dB/dcdslopeandastartingphaseangleof180.
PIDcontrollerdesignviaBodeplots
RememberthatthenormaldesignaimsofPIDcontrollersaretominimizeoreliminatesteadystate
error,toreducepercentovershoot,andtosetthespeedofasystem.Rememberalsothatwhatonecan
andcannotdooftendependsonthecapabilitiesoftheactuator.Onecan,forinstance,designa
controllertoproducealloftheoutputcommandsthatwillmeetanyaimssetforthesystem.Butifthe
actuatoristooweaktoperformtheseactions,itwillsimplysaturateanddomuchlessthanisbeing
askedofit.Soduringandafterallcontroldesign,oneshouldthenchecktoseehowmuchtheactuator
issaturating.Ifitissaturatingoften,thenoneneedstopurchaseandinstallabiggeractuatororback
offthedemandsbeingputontheactuator.Eveninstallingabiggeractuatormaynotbetheanswerto
performanceshortfalls.Abiggeractuatoralsostressesthesystem,theplant,more.Forexamplea
largerhydrauliccylinderwillbeabletoproducemoreforcethanasmallerone,thuscausingmore
accelerationontheplant.Theinternalstructureofthedevicebeingacceleratedmaynotbedesignedto
takesuchhighaccelerations.Thusonemustalwaysbeawareoftheconsequencesdownstreaminthe
loopwhenalargeractuatorisinstalled.
Todesignacontrollerforasystemviafrequencyresponse,weusetheBodediagramoftheopenloop
system.Thecontrollerscontributionsareaddedtothisexistingsystem,consistingofactuator,plant,
andsensor.ThusithelpstoseewhateachvariantofthePIDcontrollercontributestothesystem.The
variantsare,ofcourse,P,PI,PD,andPID.ThePIDcontroller,however,isjustaPIwithDaddedoraPD
withIadded.
Pcontroller
Figure8.9showstheBodediagramforaPonlycontrollerwithKPastheproportionalgain.Sinceonlya
gainisaddedandsinceagainhas=0forall,aPonlycontrolleronlyelevatesordepressesthe
magnitudeplotfortheexistingsystem.Thegainmargin,GM,ofthesystemisdefinedastheamountof
818
Chapter8FrequencyResponse
gain,indecibels,thatcouldbeaddedtothesystembeforedrivingittomarginalstability.Thuswhen
designingaproportionalcontroller,oneneedstobeawarethatforthesystemtoremainstable,
10
20logM
KP
KP
Figure8.9BodecontributionofaPonlycontroller
Aswehaveseen,acommonobjectiveindesigningacontrolleristoletthesystemhaveaspecified
percentovershoot(%OS).AndaswesawinChapter4,%OSisintimatelytiedtothedampingratio,:
100%or
%
%
Fromthe%OSspecified,onedetermines
FromthisonedeterminestherequiredM
Onelooksattheexistingsystemandfindsthefrequencywhere=180+M
OnefindsthevalueofMatthisfrequency
OnesetsKPsothat20dBlog(KP)raisesorlowersthemagnitudesothatitis1atthisfrequency
Withtheadjustmentinstep5,oneismakingthisthegaincrossoverfrequency,wherethephase
marginismeasured.
PIcontroller
Aswehaveseen,aPIcontrollerhasthetransferfunction
819
Chapter8FrequencyResponse
1
1
ThuswithaPIcontrolleroneisaddingagain(KI),afirstorderlead(soazero),andanintegrator(apole
attheorigin).The increasesthesystemtypeandthuseliminatessteadystateerror.Thatisnormally
whyoneusesaPIcontroller.
KP
s+1
KI
20logM
KI
1
s
Composite
1
10
100
KP
s+1
KI
KI
0.1
90
1
s
KI
KP
Figure8.10BodecontributionofaPIcontroller
Figure8.10showstheBodeplotofaPIcontroller.Thereareseveralfeaturestonotice.Theeffectof
theintegratorcanbeseenbytheinitial20dB/dcdslopeatthelowfrequencies,onthelefthandsideof
thediagram.Onealsonotesonthephaseplotthatbeginsat90,alsoanartifactoftheintegrator.
Thusthecontrollerwillbringess=0toatype0systemwithastepinput,themostwidespreaduseofa
PIcontroller.Alsonoteworthyisthefactthatazeroisadded,soafirstorderlead.ThefrequencyKI/KP
isimportant.ItplacestheactionoftheleadhorizontallyontheBodeplot.Itis,indeed,thebreak
frequencyofthefirstorderlead.
SoifthedesireistoaddIcontroltoasystemtoeliminateitssteadystateerrorwhilenotchangingthe
dynamicsofthesystemitsgain,phasemargin,orphasecrossoverfrequency(relatedtosystem
speed)onecoulddothefollowing:
1. SetKPsuchthatKI/KPisonedecadebelowtheexistinggaincrossoverfrequency.Theeffecton
phaseofafirstorderleadorlaggenerallyoccursovertwodecades.Soonedecadeafterthe
breakfrequencythe90phaseadjustmentoftheintegratorhasbeenremoved.
820
Chapter8FrequencyResponse
2. SetKIsothattheflat,highfrequencypartofthePImagnitudecurverunsalongtheaxis.This
willmakethegainathigherfrequenciesthesameasitisintheuncompensatedsystem.
Amoregenerictuningmethod,onethatdoesnotnecessarilypreserveexistingsystemdynamics,would
be:
1. Installthepoleattheorigintolimitoreliminatesteadystateerror.
2. LookattheBodediagramoftheresultingopenlooptransferfunctiontoseewhatelseneedsto
bedone.Stilltobedeterminedisthelocationofthecontrollerpoleandtheoverallcontroller
gain.Particularlylookatthephaseplotandseewhatneedstobedonetousetheaddedphase
ofthezerotogettherequiredM,whichisrelatedtoandthe%OSofastepinput.Fromthis
analysis,setthelocationofthebreakfrequencyofthe1storderlead(thelocationofthezero).
Thisbreakfrequencyisthen1/T(=B).
3. AddthezeroandthenchecktheresultingBode,i.e.checkthephaseplotandseewhereGC
needstobetogettheMneeded.
4. Atthefrequencydeterminedin3,note20dBlog(M).Thisisthegainthatneedstobeaddedto
makethefrequencyGC.Addthisfrequency.ChecktheresultingBodediagramtoseeifthe
phasemarginiswhatwasspecified.Checkthestepresponsetoseeifthe%OSiswithin
specifications.
Ofcourseasalwaystheproblemofactuatorsaturationmustbetakenintoaccount.MovingKI/KPtothe
leftmeansincreasingKP,andsincethescaleonaBodeplotislogarithmic,movingKI/KPonedecadeto
theleftmeansincreasingKPbyafactorof10.Soduetoactuatorlimitations,itmaybeimpossibletoset
KIsohighormoveKI/KPsofartotheleft.Onemayhavetocompromisewithareductioninsystemgain
andafasterKI/KP.Thereductioninsystemgainwilldepresstheexistingsystemsmagnitudeplotand
pushthegaincrossoverfrequencytotheleft,whichrepresentsanincreaseinsystemresponsetime.
IncreasingKI/KPmeansthatthephasecorrectionto0maynotoccursoonenough,sotheexistingphase
marginofthesystemmaybelowered.Thuswillbelowered,andthe%OSwillcorrespondingly
increase.Asisalwaysthecaseincontrols,youcannotgetsomethingfornothing.Eliminatingsteady
stateerroroftenbringswithittheconsequencesthatthesystemspeedanditsstabilitysuffers.
PDcontroller
ThetransferfunctionofaPDcontrolleris
Sothisisasinglezeroorfirstorderleadwithagaincontributionalso.Thefirstorderleadsbreak
frequencyisatKP/KD.TheBodeplotforthiscontrollerisshowninFigure8.11.NotethatthePD
controllerwillraisetherighthandendofboththemagnitudeandphaseplotsoftheexistingopenloop
system.Byraisingthephaseplot,oneincreasesthephasemarginM.Thisincreasesandthuslowers
%OS.Sothesystembecomesmorestable.Thiseffectisnotsoeasytodesign,becausetherighthand
endofthemagnitudeplotisalsoraised.ThisshiftsthegaincrossoverfrequencyMtotheright.
821
Chapter8FrequencyResponse
Shiftingthisfrequencytotherightisbeneficial.Becauseoftherelationshipgivenabovebetweenn
and M,thiswillmakethesystemfaster.But,initself,movingMtotherightbringsoneintoaregion
oflower,sothephasemarginislower.Summingthisup,addingaPDcontrolleraddsphasetothe
highfrequencyendoftheexistingopenloopsystem.Thistendstoraisethephasemargin,stabilizing
thesystem.ButthePDcontrolleralsoliftstherighthandendofthemagnitudeplot.Thismovesthe
gaincrossoverfrequencytotheright,whichspeedsthesystemup.Butsincethephasecurvegenerally
hasanegativeslope,thebenefittothephasecurvecontributedbythephasecontributionofthePD
controllerisnotfullyrealized.Theexamplebelowillustratesthis.
20logM
KP
Composite
1
10
100
KD
s+1
KP
0.1
KD
s+1
KP
KP
90
KP
KD
Figure8.11BodecontributionofaPDcontroller
AsfarassettingKPandKDgoes,asimplifyingstrategywouldbetosetKP=1.ThensetKDsothatKP/KDis
intheproperlocationtoliftthephasecurveaswanted.
Example8.4
Asystemhastheopenlooptransferfunction
1
1500
5
15
ThestabilityofthissystemcanbegaugedusingthesequenceofMatlabcommands:
>> s = tf(s)
>> gol = 1500/((s+1)*(s+5)*(s+15))
>> margin(gol)
822
Chapter8FrequencyResponse
Figure8.12Bodeplotofaboveopenlooptransferfunction
Obviouslythesystemisnotverystable.Itisdesiredtoincreasethephasemarginto60whilenot
loweringthelowfrequencygainofthesystem.Todothis,wewilldesignaPDcontroller.Ifoneignores
theeffectoftheelevationofthemagnitudecurvewiththePDcontroller,thenweneedtoadd53of
phaseataround9rad/sec.IfwelookatthePDcontributionscurvesgiveninFigure8.12,weseethatat
thebreakfrequencyofthePDcontroller,thephasecontributionis45.Soifwesetthebreakfrequency
at9rad/sec,wewouldgeta45contributionthere.Sincewewantat53contribution,wesetthe
breakfrequencyofthePDalittlelowerthan9rad/sec,at,say,3rad/sec.ThusthefirsttrialPD
controllerwillhaveKP=1tokeepthelowfrequencygainasitwasintheoriginalsystem.Thenweset
KD=1/3,sothatKP/KD=3.Thus
3 .Wetrythisusing,again,theMatlabmargin(gol)
function:
>> gpd = (1/3)*(s+3)
>> golpd = gpd * gol
>> margin(golpd)
Thisproduces
823
Chapter8FrequencyResponse
Figure8.13PDcompensatedsystemofExample8.4
Thusaimingforaphaseelevationof53togiveaMof60,wehavecomeupshort.Becauseofthe
simultaneouselevationofthemagnitudecurve,thegaincrossoverfrequencyhasshiftedtotheright,so
thatitisnowabout20rad/secinsteadoftheoriginal9rad/sec.Thishasmadethesystemfaster,but
thephasemarginisstilltoolow.Thesolutionistosetthegaincrossoverfrequencylower,thusaimfor
morephasecontribution,tocompensatefortherightwardshiftofthegaincrossoverfrequency.The
problemwiththisisthatthismakestheelevationofthemagnitudecurveevenlargertoo.InfactasM
isshiftedeverfurtherleftwardbyloweringKD,theincreaseinthecontributionofphasedeclineswhile
theincreaseinthecontributionofmagnitudestaysthesame.FurthertrialshiftingMleftwardshows
thatusingthismethod,achievingaMof60isimpossible.
AnalternativemethodologywouldbetoallowKPtofloattoo.Asshown,shiftingMrightwardactually
spedupthesystem.IfthemaingoalistoachieveaMof60,onecouldemploynowagainreduction
toachievethisgoal.ByacloserinspectionoftheBodeplotofthisfunction,oneseesthatataround10
or11rad/sec,thephaseangleisabout120.Atthisfrequencythemagnitudeisabout22dB.Thusby
applyingagainreductionof22dB,onewillachieveaMofabout60.
4
20 log
10
Thisyields
824
0.631
Chapter8FrequencyResponse
Figure8.14AlternativemethodofPDcontrolforExample8.4
Thuswithalittlereductioninlowfrequencygain(KPsetto0.631insteadof1),wehaveachievedthe
desiredresult.
PIDcontroller
ThePIDcontrollerhasthetransferfunction
Sothecontrollercontributestwozerosandadditionallyonepoleattheorigin.Thecontrollerisactually
acombinationofaPIandaPD.Thepoleattheoriginisinstalledtoincreasethesystemtypeandthus
tolimitoreliminatesteadystateerror.Thezeroisaddedtostabilizethesystem,toaddphaseangleto
reduceovershoot.
Ifthenumeratoroftheabovetransferfunctionisanalyzed,onecanseethatthezeroswillbeat
4
2
Thusthezerosaddedwillbecomplexif4
Figure8.15.
.Otherwisethezeroswillberealasshownin
825
Chapter8FrequencyResponse
Im
2
K+K4KK
P
P
D I
2KD
Re
2
KK4KK
P
P
D I
2KD
Figure8.15Zero/polemapofPIDcontroller
TheBodeplotofthePIDcontrollerisshowninFigure8.16.Noteworthyfeaturesare
TheintegratorgivestheMplotaninitialslopeof20dB/dcd.Thefirstzerothenturnsthisdrop
intoaflatrun.Thesecondzeroproducesanupwardslopeof20dB/dcdafterthesecondbreak
frequency.
Thephasecurvestartsat90becauseoftheintegrator.Thefirstzeroliftsthisby90to0.The
secondzeroliftsthisanother90toahighfrequencyvalueof90.Thisphaseliftisusedto
increasethephasemarginofthesystemtowhichthecontrollerisapplied.Ifthezerosarefar
apart,theflatrunoftheMplotwillbelongandthetwophaseliftswillbedistinct.Ifthezeros
areclosertogether,theflatrunwillbeshortandthephaseliftswillbesomewhatcombined
(onewillnotbefinishedbeforetheotherbegins).
AgaincanbeusedtoraiseorlowertheflatpartoftheMplot,asneeded.Recall,addingagain
doesnotaffectthephaseplot,becausethephasecontributionofagainis0forall.
Theliftingofthemagnitudeplotbythesecondzerohasapositiveeffect.Thismakesthephase
crossoverfrequencyhigherbecauseitliftstherighthandendofthemagnitudecurveofthe
existingsystem.Butsincethephasegenerallydecreaseswithw,thisliftingmaymakethephase
loweratthehighergaincrossoverfrequency,soMislower.Thisscenarioistheproblemwith
PDcontrolasseenonaBodediagram.TheproblemsnotedaboveforPDcontrolgenerally
applytotheDpartofPIDcontroltoo.
826
Chapter8FrequencyResponse
T1 s+1
20logM
T2 s+1
Composite
0.1
10
1
s
100
T1 s+1
K
T2 s+1
90
1
s
Figure8.16BodecontributionofaPIDcontroller
SymmetricalOptimumafrequencyresponsebasedPIDtuningmethod
Problems
827