You are on page 1of 27

Chaptei 8 Fiequency Response

81

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.

Unknown
system
1 A, A,
A,
A,
2
3
1i 1o
1i
2o
3o
1i
1 1
2
2
3
3
Chaptei 8 Fiequency Response

82

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=
A
c
A
i
.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.
Chaptei 8 Fiequency Response

83

Figure8.2Oscilloscopeplotfromasinglefrequencyresponsetest
Inthisplot,channel1istheinputandchannel2theoutput(alwaysgoodpractice).Notethattheinput
andoutputfrequenciesarethesame,anindicationofalinearsystem.Thefrequencyatwhichthistrial
ismadecanbedeterminedfromtheplotasfollows.Theperiodbetweentwoadjacentpeaksonthe
samecurvecoversabout6.5blocks,andeachblockrepresents50msec,so =
2n
6.550 mscc

[1uuu
mscc
scc
= 19.S roJscc.Butnormallytheexperimenterwhoproducedtheaboveplotispumping
theunknownsystemwithasignalgeneratorandisadjustingthisfrequencydirectly.Heorshesimply
recordsitwhilemakingthetest.
Thecurvewiththelargestamplitudeaboveisonchannel1,sotheinput.Sincetheverticalscaleofthe
twochannelsisthesame,itisobviousthatthereisamagnitudegainoflessthan1forthistrial.The
inputrangesoverabout4verticalblocks.Thepeaktopeakamplitudeoftheoutputrangesoverabout
1.5blocks,sothemagnituderatioisH =
1.S
4
, = u.S7Sor8.5decibels(seebelow).Ittakessome
practicetopickthephaseangleoffofascreenshot.Ifwelookattheabove,wenotethatthehorizontal
distancebetweentwoadjacentpeaksonthesamecurveis360.Sothedistancebetweenthefirstpeak
oftheinputcurveanditsnextzerocrossingis90.Ifwelookatthepeakoftheoutputcurverelativeto
thepeakoftheinputcurve,weseethatitoccursabouthalfwaybetweentheinputcurvesfirstpeak
anditsnextzerocrossing,perhapsalittlesooner.Sothephaseshiftisabout43,or = -4S.The
negativesignindicatesthattheoutputcurvelagstheinputcurve(theoutputcurvespeakhappensafter
theinputcurves).Bothofthesemeasurementscouldbemademoreaccuratelyusingthecursorson
theoscilloscope.
Chaptei 8 Fiequency Response

84

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
Chaptei 8 Fiequency Response

85

TheabovemethodforqueryinganunknownsystemproducesaBodeplot.ThentheBodeplotcanbe
interpretedtorevealthecomponentsoftheunknownsystem.TounderstandhowtointerpretaBode
plot,itisusefulknowhowtogenerateaBodeplotfromaknowtransferfunction.Theprocedurefor
doingthisissimple,onlygivenandnotprovenhere.Onereplacessinthetransferfunctionwithj.
ThenH = |0(])|,themagnitudeoftheresultingfunctionand = z0(]),theangleoftheresulting
function.Anexampleillustratesthisbest.
Example8.1
FindMandasfunctionsofforthetransferfunction0(s) =
15s
2s+1
.
Solution:
Onereplacesswithj : 0(]) =
15]o
2]o+1

Boththenumeratoranddenominatorarecomplexnumbers.Themagnitudeofafractionofcomplex
numbersisthemagnitudeofthenumeratordividedbythemagnitudeofthedenominator.So
H = H() =
1S
4
2
+1
2

Atsmallvaluesof ,H =
0
1
= u.Atlargevaluesof ,H =
15o
4o
2
=
15
2
.Thesevalues,convertedinto
decibels,showwherethemagnitudeplotoftheBodeplotstartsandends.
For,theangleofafractionofcomplexnumbersistheangleofthenumeratorminustheangleofthe
denominator.15j isontheimaginaryaxisforallvaluesof ,sotheangleofthenumeratorisalways
90.Inthedenominator,ifissmall,the1dominates.Itisapositiverealnumber,soitisatanangleof
0and=90(znum -zJcn).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.0(s) =
1
1s+1
.Aleadisafirstorsecondorderinthe
numeratore.g.0(s) = I s + 1.)Ifthisisdone,Table8.1results.Thistablecanthenbeusedto
interpretBodeplotsofunknownsystemstoseewhatcommoncomponentstheycontain.Some
featuresofcommoncomponentsareworthemphasizing.

Chaptei 8 Fiequency Response

86

Component Bodeplot Characteristics


Gain,K
0
0
20 log K
IfK>1,20logK>0
IfK<1,20logK<0
Gainhaszerophase.Sowhenitisaddedtoa
system,itsimplyshiftsthesystemslogmagcurve
up(K>1)ordown(K<1).
Differentiator,s
0
0
90
1
2
0

d
B
/d
c
d
IfK>1,20logK>0
IfK<1,20logK<0
Gainhaszerophase.Sowhenitisaddedtoa
system,itsimplyshiftsthesystemslogmagcurve
up(K>1)ordown(K<1).
Integrator,
1
s

0
0
-90
1
-
2
0
d
B
/
d
c
d
IfK>1,20logK>0
IfK<1,20logK<0
Gainhaszerophase.Sowhenitisaddedtoa
system,itsimplyshiftsthesystemslogmagcurve
up(K>1)ordown(K<1).
1
st
orderlead,
Ts+1
0
0
= 1/
B
20
d
B/dc
d
90
IfK>1,20logK>0
IfK<1,20logK<0
Gainhaszerophase.Sowhenitisaddedtoa
system,itsimplyshiftsthesystemslogmagcurve
up(K>1)ordown(K<1).
1
st
orderlag,
1
1s+1

0
0
= 1/
B
-20
d
B/d
cd
-90
IfK>1,20logK>0
IfK<1,20logK<0
Gainhaszerophase.Sowhenitisaddedtoa
system,itsimplyshiftsthesystemslogmagcurve
up(K>1)ordown(K<1).

Table8.1Bodeplotsofcommoncomponents(part1)

Chaptei 8 Fiequency Response

87

Component Bodeplot Characteristics


2
nd
orderlead,
1
o
n
2
s
2
+
2
o
n
s + 1
0
0

n
4
0

d
B
/
d
c
d
180
Startsoutwith0logmag.Asymptotestartsa40
dB/dcdriseatbreakfrequency,whichisthenatural
frequency.
Behaviorrightaroundbreakfrequencydependson.
Phasecurvestartsat0andrisesto180degrees.Itisat
90degreesatbreakfrequency.
2
nd
orderlag,
1
1
n
n
2
s
2
+
2{
n
n
s+1

0
0

n
-4
0
d
B
/d
c
d
-180
Startsoutwith0logmag.Asymptotestartsa40
dB/dcdriseatbreakfrequency,whichisthenatural
frequency.
Behaviorrightaroundbreakfrequencydependson.
Phasecurvestartsat0andrisesto180degrees.Itisat
90degreesatbreakfrequency.

Table8.1Bodeplotsofcommoncomponents(part2)
ThistableshowstheasymptotesusedtodrawBodeplotsofthesecomponents.Thefirstandsecond
orderleadsandlagscandeviatefromtheseasymptotes.Secondordersystemswithlow deviate
significantlyfromtheasymptotesintheneighborhoodof
n
.
Ingeneralansinthenumeratorcausesariseinthemagnitudeandphaseplots.Ansinthe
denominatorcausesafallinthemagnitudeandphasecurvesasincreases.Notethatallleadsand
lagsstarttheirmagnitudeandphaseplotsat0.Atthebreakfrequency[
B
=
1
1
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.
Chaptei 8 Fiequency Response

88

NowwecanseewhyoneplotsMindecibelsandnotinnormalunitsinaBodeplot.Anunknown
systemismadeupofanumberofthecomponentsshowninTable8.1.Taketheexample
0(s) =
16 (s + S)
s
2
(s + 1) (s + 7)
-
16 (] + S)
-
2
(] + 1) (] + 7)

Inthephaseplot,thephaseofthefunctionG(j)isthesumofthephaseanglesofthecomponents.
Thusatlow,allthetermsthataddtorealnumbersdropout.Therealnumberdominates,sofor
low,thesecomponentshaveaphaseangleof0.The
1
-o
2
= -
1
o
2
termhasaphaseof180.Sothe
phaseplotsstartsoutat180.Themagnitude,however,arenotaddedlikethephaseanglesofthe
componentsare.Theyformproductsinsteadofsums.So
|0(])| =
16
2
+ 9

2

2
+ 1
2
+ 49
= 16
2
+ 9
1

2

1

2
+1

1

2
+49

Butifwetakethelogofbothsidesandmultiplybothsidesby20togetdecibels
2u log(0(])) = 2u log _16
2
+ 9
1

2

1

2
+1

1

2
+49
]
2u log(0(])) = 2u log(16) +2u log [
2
+ 9 + 2u log _
1

2
] +
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.
Chaptei 8 Fiequency Response

89

Solution:
BycomparingtheplotwiththeentriesofTable8.1,onecanseealmostimmediatelythatthisisan
integrator.Themagnitudeplotdropssteadilyeachdecadeby20dB,thebeginningslopeofthe
magnitudeplotisnot0(soitisnotafirstorderlag),andthephaseangleisaconstant90.Butisthere
againinvolved?ApureintegratorsBodeplotcrossestheaxis(0dB)at=1rad/sec.At=1
rad/sec(10
0
),themagnitudeisabout25dBinthisexample.Sothemagnitudeplothasbeenpushedup
about25dB.Notethatagainhas=0forall,soagainhasnoinfluenceonthephasecurve.Thus
thissystemisanintegratorwithagain.Againsmagnitudecurveisastraightlineat20log(K),sothe
effectofagainistodisplacethemagnitudecurveupward(ifK>1)ordownward(ifK<1).Sincethe
magnitudecurvehasbeenpushedupby25dBat=1rad/sec,
2u JB log(K) = 2S JB
log(K) =
2S
2u
= 1.2S
K = 1u
1.25
= 18
Sothesuggestedtransferfunctionis
0(s) =
18
s

OneshouldalwaysthenconfirmthisconjecturebycheckingitwiththeMatlabbode()functionhere
bode([18],[1,0]).
Chaptei 8 Fiequency Response

810

Theroleplayedbythegainisveryimportant,sinceitisnormalinacontrollooptoadjustthe
controllersgain.Addingagainsimplydeflectsthemagnitudecurveupordownandhasnoeffecton
thephasecurve.Theabilityofthegaincurvetochangemagnitudebuthavenoeffectonphasewillbe
exploitedindesigningcontrollersusingBodeplots.
Example8.2
AnalyzetheBodeplotofFigure8.3andconjecturewhattransferfunctionproducedthisplot.

Figure8.3Bodeplotmadefromfrequencyresponsetests
Solution:
Thefigureisreproducedhereforconvenience.Featurestonoticeare:
Themagnitudeplotstartsoffwithanupwardslope.Theslopeseemstobe20dB/dcd,sothis
indicativeofadifferentiator.
Adifferentiatorwithnogainpassesthrough10
0
rad/secat0dB.Intheaboveplottheupward
slopingpartofthecurvepassesthrough10
0
atabout14dB.Sothereisagainherealso.
Thephasecurvestartsat90andendsat180,soatotalphaseshiftof270.Eachsinthe
denominator(integrator,1
st
orderlag)dropstheeventualphaseangleby90(a2
nd
orderlag
dropsitby180).
Chaptei 8 Fiequency Response

811

Soitlooksliketheremaybeadifferentiatorandthenthreessinthedenominatorofthetransfer
function.Thiscanbeconfirmedalsobyinspectingthefinalslopeofthemagnitudecurve.Itis40
dB/dcd.Thisindicatesanexcessoftwossinthedenominator.
Nowitissomewhatdifficulttoascertainwherethesetermswithssinthedenominatorhavetheirbreak
frequencies(1
st
orderlags)ornaturalfrequency(2
nd
orderlags).Alotseemstobehappeningbetween
1< <10.Thereisnoevidentbumpinthemagnitudecurve,however,whichwouldindicatethe
presenceofanunderdampedsecondorderinthedenominator(a2
nd
orderlag).Soperhapsforafirst
guessitisusefultospeculatethattherearethree1
st
orderlagsinthistransferfunctionbetween1and
10.Theirproximitywithinthisnarrowrangewillmakeithardtoidentifythemindividually.
Thephaseplotofa1
st
orderlagshowsthatatthebreakfrequency(
B
)thephasehasdroppedby45.
Ifonelooksforthefrequencywherethephaseis45belowthestartingfrequency,onecanspeculate
thatthatisthebreakfrequencyforthefirst1
st
orderlag.Intheabovephaseplot,thiswouldbeat
abouthalfwaybetween10
0
andthenextverticalline.10
0
=1,and10
1
=10.Sothenextverticalline
after10
0
is2.Thehalfwaypointisnot,however,1.5,sincethelogarithmicscaleisuneven.Sothe
halfwaypointwouldbemorelike1.3.Wecanspeculatethenthatthefirst1
st
orderlagisat=1.3.
Each1
st
orderlagbringsintotala90phaseshifttothephasecurve.Ifthethreesupposed1
st
order
lagswereallwidelyseparatedontheaxis,onecouldjustlookonthephasecurvewhere was45,
45,and135tofindthethreebreakfrequencies.Butapparentlythethree1
st
orderlagsarejammed
togetherwithinanarrowrangeof,sothesecondonebecomesactivebeforetheeffectofthefirst
onehassubsided.So
B2
willoccurbefore =45,and
B3
occurbefore=135.Thusweareleft
withonlythechoiceofguessingatthesebreakfrequencies,thenmakingaBodeplotoftheresulting
transferfunction,comparingitwiththegivenplot,andthenadjustingitthroughtrialanderroruntil
thereisamatch.Try
B1
=1.3,
B2
=6,and
B3
=12.Thesegive1
st
orderlagsof
1
1
1.3
s+1
,
1
1
6
s+1
,and
1
1
12
s+1

Forthegain,weneed
2u Jb log(K) = -14 JB
K = 1u
-14
20
= u.2
Sothefirststabatatransferfunctionis
0(s) = u.2 s
1
1
1.S
s + 1

1
1
6
s + 1

1
1
12
s + 1
=
u.2 s 1.S 6 12
(s + 1.S)(s + 6)(s +12)
=
19 s
(s +1.S)(s + 6)(s + 12)

TheMatlabcommandsequence
>>s=tf(s)
>>g=19*s/((s+1.3)*(s+6)*(s+12))
Chaptei 8 Fiequency Response

812

>>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) )
>> nyqui st ( g0l )
Chaptei 8 Fiequency Response

813

YoucanalsogetaNyquistdiagraminsideMatlab'sltiviewer:
>> s = zpk( ' s' )
>> gol = 1/ ( ( s+2) *( s+5) )
>> l t i vi ew( 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.
20log =0dB M
= 0
=180

GM
=phasecrossoverfrequency
12.06dB

Figure8.5Gainmargin
Figure8.5showsaportionofatypicalBodePlotforanopenlooptransferfunction.Itillustrateswhat
thegainmargin(G
M
)is.AswasstatedinthediscussionofNyquiststability,when =180,Mshouldbe
<1.TofindG
M
,firstfindthephasecrossoverfrequency,
GM
.Thisisthefrequencywherethephase
curvepassesthrough180.Getthemagnitudeatthatfrequency.Intheaboveplot,G
M
=12.06dB.
Whatthismeansisthatat
GM
theactualmagnitudeis
M=10
12.06/20
=0.2495
Chaptei 8 Fiequency Response

814

RememberthatnegativemagnitudesontheBodemagnitudeplotmeanactualvaluesofmagnitudethat
arebetween0and1.
Alsorecallthataddingagaintoatransferfunctiononlyshiftsthemagnitudecurveup(K>1)ordown(K
<1).Theaddedgaindoesnotaffectthe curvebecauseK's for all > 0. Sotheaboveshowsthata
gainofK=12.06dBcouldbeaddedtothesystembeforemakingitunstable.
K=12.06dB=10
12.06/20
=4.01
Notethat4.01*0.2495=1.0.
ThephasemarginreflectsthesecondNyquiststabilitycriterion:whenM=1, shouldbe>
180.
20log =0dB M
= 0
= 180
=143.6

M
=gain crossoverfrequency

Figure8.6Phasemargin
Figure8.6showsaportionofatypicalBodeplotforanopenlooptransferfunction.Itillustrateswhat
thephasemargin(
M
)is.Tofind
M
,firstfindthegaincrossoverfrequency,
M
. Thisisthefrequency
whereM=1.RecallatM=1,20dBlogM=20log1=0.So
M
iswherethemagnitudecurvecrosses
theaxis.Getthephaseatthatfrequency.Intheaboveplot, at
M
is143.6.Thephasemarginis
theamountthephaseangleisabove = -180atthegaincrossoverfrequency.

M
=143.6(180)=36.4
AruleofthumbforgoodresponseisG
M
>6dB,30<
M
<60.
Example8.3
ForthesystemwhoseBodePlotisgivenbelow,find
1)
GM

2)
M

Chaptei 8 Fiequency Response

815

3) G
M

4)
M


Figure8.7Bodeplotofunknownfunction


Chaptei 8 Fiequency Response

816

Solution:

Figure8.8Solutiontoaboveexample
Forpracticeyoumightwanttotrytodeterminethetransferfunctionforthesystemabove.
Analternatewayandanongraphicalwaytosolvetheaboveproblemisfirsttodeterminethetransfer
function.Forthisexampleitis
0
0L
=
S
s(s +1)(s +S)

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

M
=0.8rad/sec

GM
=2.2rad/sec
G
M
=20dB

M
=180138
=42deg
Chaptei 8 Fiequency Response

817

M
= (180)
Performanceandgainandphasemargin
Thereisadirectconnectionbetweenphasemarginand.Wehavealreadyseenthatthereisadirect
connectionbetweenandpercentovershoot.Sothereisadirectconnectionbetween
M
and%OS.
Therelationshipbetween
M
andis

M
= 9u - aictan
_
-2
2
+ 1 + 4
4
2

Butonecanoftenuseasimplificationofthisunwieldyrelationship.For < 0.6,
M
100. = 0.6
correspondswith%OS=9.5%,soforallbutsmallovershootspecifications,thissimplerelationshipcan
beused.
AndaswesawinChapter4,therelationshipbetween%OSand is
%0S = c
-_
{n
_1-{
2
_
1uu%or =
-In (%0S 100% )
n
2
+In
2
(%0S 100% )

Thespeedofasystemdependsonand
n
.FromChapter4weknow
I
P
=
n
o
n
1-
2
andI
S
=
4
o
n

n
isafunctionofandthegaincrossoverfrequency,
M
:

n
=

4M
_
-2
2
+ 1 + 4
4

or

4M
=
_
-2
2
+ 1 +4
4

n

Inpracticeitisoftendifficulttoseparatethetwosystemperformanceindices%OSandspeed.One
cannotadjustthephasemarginwithouthavinganeffectonthegaincrossoverfrequencyandthusthe
speedofthesystem.TakethesystemshowninFigure8.7forexample.Toincreasethephasemargin
usingasimplegainadjustment,onelowersthemagnitudecurve.Thismakesthefrequencywherethe
magnitudecrosses0dBshifttotheleft,i.e.toalowerfrequency.Butloweringthegaincrossover
frequencymakesthesystemslower.
SeeingsteadystateerroronBodeplots
Chaptei 8 Fiequency Response

818

Unliketherootlocus,wherethesteadystateerrorinasystemisveryhardtodeduce,itcanbereadily
seenonaBodediagram.RecallfromChapter6thattheopenlooptransferfunctionisusedtoanalyze
steadystateerror(e
ss
)andthatthestaticerrorconstantsK
p
,K
v
,andK
a
areusedtocalculatethe
actualsteadystateerror.Recallalsothatthereisapatternforsteadystateerror.Atype0system
subjectedtoastepinputwillhaveafinitesteadystateerror.Atype1systemsubjectedtoastepinput
willhavee
ss
=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.9showstheBodediagramforaPonlycontrollerwithK
P
astheproportionalgain.Sinceonlya
gainisaddedandsinceagainhas=0forall,aPonlycontrolleronlyelevatesordepressesthe
magnitudeplotfortheexistingsystem.Thegainmargin,G
M
,ofthesystemisdefinedastheamountof
Chaptei 8 Fiequency Response

819

gain,indecibels,thatcouldbeaddedtothesystembeforedrivingittomarginalstability.Thuswhen
designingaproportionalcontroller,oneneedstobeawarethatforthesystemtoremainstable,
K
P
< 1u
u
M
20

Figure8.9BodecontributionofaPonlycontroller
Aswehaveseen,acommonobjectiveindesigningacontrolleristoletthesystemhaveaspecified
percentovershoot(%OS).AndaswesawinChapter4,%OSisintimatelytiedtothedampingratio,:
%0S = c
-_
{n
_1-{
2
_
1uu%or =
-In (%0S 100% )
n
2
+In
2
(%0S 100% )

Thereisalsoacloserelationshipbetweenphasemargin,
M
,and. For <0.6,
M
100.=0.6
correspondswith%OS=9.5%,soforallbutsmallovershootspecifications,thissimplerelationship
applies.ThusthedesignprocedureforaPonlycontrollerforaspecified%OSwouldbeasfollows:
1. Fromthe%OSspecified,onedetermines
2. Fromthisonedeterminestherequired
M

3. Onelooksattheexistingsystemandfindsthefrequencywhere=180+
M

4. OnefindsthevalueofMatthisfrequency
5. OnesetsK
P
sothat20dBlog(K
P
)raisesorlowersthemagnitudesothatitis1atthisfrequency
Withtheadjustmentinstep5,oneismakingthisthegaincrossoverfrequency,wherethephase
marginismeasured.
PIcontroller
Aswehaveseen,aPIcontrollerhasthetransferfunction
2
0

l
o
g

K
K
P
P
Chaptei 8 Fiequency Response

820

0
PI
(s) = K
P
+
K
I
s
=
K
P
s +K
I
s
= K
P
_s +
K
I
K
P
]
1
s
= K
I
_
K
P
K
I
s +1]
1
s

ThuswithaPIcontrolleroneisaddingagain(KI),afirstorderlead(soazero),andanintegrator(apole
attheorigin).The
1
s
increasesthesystemtypeandthuseliminatessteadystateerror.Thatisnormally
whyoneusesaPIcontroller.

Figure8.10BodecontributionofaPIcontroller
Figure8.10showstheBodeplotofaPIcontroller.Thereareseveralfeaturestonotice.Theeffectof
theintegratorcanbeseenbytheinitial20dB/dcdslopeatthelowfrequencies,onthelefthandsideof
thediagram.Onealsonotesonthephaseplotthatbeginsat90,alsoanartifactoftheintegrator.
Thusthecontrollerwillbringe
ss
=0toatype0systemwithastepinput,themostwidespreaduseofa
PIcontroller.Alsonoteworthyisthefactthatazeroisadded,soafirstorderlead.ThefrequencyK
I
/K
P

isimportant.ItplacestheactionoftheleadhorizontallyontheBodeplot.Itis,indeed,thebreak
frequencyofthefirstorderlead.
SoifthedesireistoaddIcontroltoasystemtoeliminateitssteadystateerrorwhilenotchangingthe
dynamicsofthesystemitsgain,phasemargin,orphasecrossoverfrequency(relatedtosystem
speed)onecoulddothefollowing:
1. SetK
P
suchthatK
I
/K
P
isonedecadebelowtheexistinggaincrossoverfrequency.Theeffecton
phaseofafirstorderleadorlaggenerallyoccursovertwodecades.Soonedecadeafterthe
breakfrequencythe90phaseadjustmentoftheintegratorhasbeenremoved.
2
0

l
o
g

K
K
I
I
1
s
1
s
90
K
K
K
K
K
K
s+1
s+1
P
P
P
I
I
I
1 100 10 0.1
Composite
Chaptei 8 Fiequency Response

821

2. SetK
I
sothattheflat,highfrequencypartofthePImagnitudecurverunsalongtheaxis.This
willmakethegainathigherfrequenciesthesameasitisintheuncompensatedsystem.
Amoregenerictuningmethod,onethatdoesnotnecessarilypreserveexistingsystemdynamics,would
be:
1. Installthepoleattheorigintolimitoreliminatesteadystateerror.
2. LookattheBodediagramoftheresultingopenlooptransferfunctiontoseewhatelseneedsto
bedone.Stilltobedeterminedisthelocationofthecontrollerpoleandtheoverallcontroller
gain.Particularlylookatthephaseplotandseewhatneedstobedonetousetheaddedphase
ofthezerotogettherequired
M
,whichisrelatedtoandthe%OSofastepinput.Fromthis
analysis,setthelocationofthebreakfrequencyofthe1
st
orderlead(thelocationofthezero).
Thisbreakfrequencyisthen1/T(=
B
).
3. AddthezeroandthenchecktheresultingBode,i.e.checkthephaseplotandseewhere
GC

needstobetogetthe
M
needed.
4. Atthefrequencydeterminedin3,note20dBlog(M).Thisisthegainthatneedstobeaddedto
makethefrequency
GC
.Addthisfrequency.ChecktheresultingBodediagramtoseeifthe
phasemarginiswhatwasspecified.Checkthestepresponsetoseeifthe%OSiswithin
specifications.
Ofcourseasalwaystheproblemofactuatorsaturationmustbetakenintoaccount.MovingK
I
/K
P
tothe
leftmeansincreasingK
P
,andsincethescaleonaBodeplotislogarithmic,movingK
I
/K
P
onedecadeto
theleftmeansincreasingK
P
byafactorof10.Soduetoactuatorlimitations,itmaybeimpossibletoset
K
I
sohighormoveK
I
/K
P
sofartotheleft.Onemayhavetocompromisewithareductioninsystemgain
andafasterK
I
/K
P
.Thereductioninsystemgainwilldepresstheexistingsystemsmagnitudeplotand
pushthegaincrossoverfrequencytotheleft,whichrepresentsanincreaseinsystemresponsetime.
IncreasingK
I
/K
P
meansthatthephasecorrectionto0maynotoccursoonenough,sotheexistingphase
marginofthesystemmaybelowered.Thuswillbelowered,andthe%OSwillcorrespondingly
increase.Asisalwaysthecaseincontrols,youcannotgetsomethingfornothing.Eliminatingsteady
stateerroroftenbringswithittheconsequencesthatthesystemspeedanditsstabilitysuffers.
PDcontroller
ThetransferfunctionofaPDcontrolleris
0
P
(s) = K
P
+K

s = K

_s +
K
P
K

] = K
P
_
K

K
P
s +1]
Sothisisasinglezeroorfirstorderleadwithagaincontributionalso.Thefirstorderleadsbreak
frequencyisatK
P
/K
D
.TheBodeplotforthiscontrollerisshowninFigure8.11.NotethatthePD
controllerwillraisetherighthandendofboththemagnitudeandphaseplotsoftheexistingopenloop
system.Byraisingthephaseplot,oneincreasesthephasemargin
M
.Thisincreasesandthuslowers
%OS.Sothesystembecomesmorestable.Thiseffectisnotsoeasytodesign,becausetherighthand
endofthemagnitudeplotisalsoraised.Thisshiftsthegaincrossoverfrequency
M
totheright.
Chaptei 8 Fiequency Response

822

Shiftingthisfrequencytotherightisbeneficial.Becauseoftherelationshipgivenabovebetween
n

and
M
,thiswillmakethesystemfaster.But,initself,moving
M
totherightbringsoneintoaregion
oflower,sothephasemarginislower.Summingthisup,addingaPDcontrolleraddsphasetothe
highfrequencyendoftheexistingopenloopsystem.Thistendstoraisethephasemargin,stabilizing
thesystem.ButthePDcontrolleralsoliftstherighthandendofthemagnitudeplot.Thismovesthe
gaincrossoverfrequencytotheright,whichspeedsthesystemup.Butsincethephasecurvegenerally
hasanegativeslope,thebenefittothephasecurvecontributedbythephasecontributionofthePD
controllerisnotfullyrealized.Theexamplebelowillustratesthis.

Figure8.11BodecontributionofaPDcontroller
AsfarassettingK
P
andK
D
goes,asimplifyingstrategywouldbetosetK
P
=1.ThensetK
D
sothatK
P
/K
D
is
intheproperlocationtoliftthephasecurveaswanted.
Example8.4
Asystemhastheopenlooptransferfunction
0
0L
(s) =
1Suu
(s + 1)(s +S)(s + 1S)

ThestabilityofthissystemcanbegaugedusingthesequenceofMatlabcommands:
>> s = t f ( s )
>> gol = 1500/ ( ( s+1) *( s+5) *( s+15) )
>> mar gi n( gol )
2
0

l
o
g

K
K
P
P
90
K
K
K
K
K
K
s+1
s+1
D
D
D
P
P
P
1 100 10 0.1
Composite
Chaptei 8 Fiequency Response

823

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
controllerwillhaveK
P
=1tokeepthelowfrequencygainasitwasintheoriginalsystem.Thenweset
K
D
=1/3,sothatK
P
/K
D
=3.Thus0
P
=
1
3
(s + S).Wetrythisusing,again,theMatlabmar gi n( gol )
function:
>> gpd = ( 1/ 3) *( s+3)
>> gol pd = gpd * gol
>> mar gi n( gol pd)

Thisproduces

Chaptei 8 Fiequency Response

824

Figure8.13PDcompensatedsystemofExample8.4

Thusaimingforaphaseelevationof53togivea
M
of60,wehavecomeupshort.Becauseofthe
simultaneouselevationofthemagnitudecurve,thegaincrossoverfrequencyhasshiftedtotheright,so
thatitisnowabout20rad/secinsteadoftheoriginal9rad/sec.Thishasmadethesystemfaster,but
thephasemarginisstilltoolow.Thesolutionistosetthegaincrossoverfrequencylower,thusaimfor
morephasecontribution,tocompensatefortherightwardshiftofthegaincrossoverfrequency.The
problemwiththisisthatthismakestheelevationofthemagnitudecurveevenlargertoo.Infactas
M
isshiftedeverfurtherleftwardbyloweringK
D
,theincreaseinthecontributionofphasedeclineswhile
theincreaseinthecontributionofmagnitudestaysthesame.Furthertrialshifting
M
leftwardshows
thatusingthismethod,achievinga
M
of60isimpossible.

AnalternativemethodologywouldbetoallowK
P
tofloattoo.Asshown,shifting
M
rightwardactually
spedupthesystem.Ifthemaingoalistoachievea
M
of60,onecouldemploynowagainreduction
toachievethisgoal.ByacloserinspectionoftheBodeplotofthisfunction,oneseesthatataround10
or11rad/sec,thephaseangleisabout120.Atthisfrequencythemagnitudeisabout22dB.Thusby
applyingagainreductionof22dB,onewillachievea
M
ofabout60.

2u JB log(K
P-uddtonuI
) = -4 JB
K
P-uddtonuI
= 1u
-
4
20
= u.6S1
Thisyields
Chaptei 8 Fiequency Response

825

Figure8.14AlternativemethodofPDcontrolforExample8.4
Thuswithalittlereductioninlowfrequencygain(K
P
setto0.631insteadof1),wehaveachievedthe
desiredresult.
PIDcontroller
ThePIDcontrollerhasthetransferfunction
0
PI
(s) = K
P
+
K
I
s
+ K

s =
K

s
2
+K
P
s +K
I
s

Sothecontrollercontributestwozerosandadditionallyonepoleattheorigin.Thecontrollerisactually
acombinationofaPIandaPD.Thepoleattheoriginisinstalledtoincreasethesystemtypeandthus
tolimitoreliminatesteadystateerror.Thezeroisaddedtostabilizethesystem,toaddphaseangleto
reduceovershoot.
Ifthenumeratoroftheabovetransferfunctionisanalyzed,onecanseethatthezeroswillbeat
s =
-K
P
_ K
P
2
- 4K

K
I
2K


Thusthezerosaddedwillbecomplexif4K

K
I
> K
P
2
.Otherwisethezeroswillberealasshownin
Figure8.15.
Chaptei 8 Fiequency Response

826

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,so
M
islower.Thisscenarioistheproblemwith
PDcontrolasseenonaBodediagram.TheproblemsnotedaboveforPDcontrolgenerally
applytotheDpartofPIDcontroltoo.
Im
Re
KK4KK
K+K4KK
P
P
P
P
2
2
D
D
D
D
I
I
2K
2K
Chaptei 8 Fiequency Response

827

Figure8.16BodecontributionofaPIDcontroller
SymmetricalOptimumafrequencyresponsebasedPIDtuningmethod
Problems
2
0

l
o
g

K
K
90
T
T
T
T
1
s
1
s
s+1
s+1
s+1
s+1
2
2
1
1
1 100 10 0.1
Composite

You might also like