aircraft control lecture 9

Upload: arief-hadiyanto

Post on 04-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 aircraft control Lecture 9

    1/33

    16.333Lecture# 9BasicLongitudinalControl

    Basicaircraftcontrolconcepts Basiccontrolapproaches

  • 7/29/2019 aircraft control Lecture 9

    2/33

    Fall2004 16.33381BasicLongitudinalControl

    Goal: analyzeaircraft longitudinaldynamicstodetermine ifthebe-haviorisacceptable,andifnot,thenmodifyitusingfeedbackcontrol.

    Note that we could (and will) work with the full dynamics model,butfornow,letsfocusontheshortperiodapproximatemodelfromlecture75.

    xsp =Aspxsp+Bspewheree istheelevatorinput,and

    w Zw/m U0xsp = q , Asp = I1(Mw +MwZw/m) I1(Mq +MwU0)yy yyZe/mBsp = I1(Me +MwZe/m)yy

    Addthat =q,sos=q

    Taketheoutputas,inputise,thenformthetransferfunction(s) 1q(s)

    = = 0 1 (sIAsp)1Bspe(s) s e(s)

    Asshowninthecode,forthe747(40Kft,M=0.8)thisreducesto:(s) 1.1569s+0.3435

    =e(s) s(s2+0.7410s+0.9272)Ge(s)

    so that the dominant roots have a frequency of approximately 1rad/secanddampingofabout0.4

  • 7/29/2019 aircraft control Lecture 9

    3/33

    Fall2004 16.33382

    1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0.11

    0.8

    0.6

    0.4

    0.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    0.09

    0.95

    0.090.20.30.420.540.68

    0.84

    0.95

    0.20.30.420.540.68

    0.84

    0.2

    0.4

    0.6

    0.8

    0.8

    0.2

    0.4

    0.6

    PoleZero Map

    Real Axis

    ImaginaryAxis

    Figure1: Pole-zeromapforGqe Basic problem is that there are vast quantities of empirical data to

    showthatpilotsdonotliketheflyingqualitiesofanaircraftwiththiscombinationoffrequencyanddampingWhatdotheyprefer?

    Acceptable

    0.1

    1

    0

    2

    3

    4

    5

    6

    7

    0.2 0.4 2 4

    s

    s

    Unacceptable

    Poor

    Satisfactory

    0.6 0.8 1

    Unda

    mpednaturalfrequency

    rad/sec

    Damping ratio

    Figure2: ThumbPrintcriterion Thiscriterionhasbeenaroundsincethe1950s,butitisstillvalid.

    Goodtarget:

    frequency

    3rad/sec

    and

    damping

    of

    about

    0.6

    Problem is that the short period dynamics are no where near these

    numbers,sowemustmodifythem.

  • 7/29/2019 aircraft control Lecture 9

    4/33

    Fall2004 16.33383Coulddoitbyredesigningtheaircraft,butitisabitlateforthat...

    3.5 3 2.5 2 1.5 1 0.5 03

    2

    1

    0

    1

    2

    3

    0.84

    0.7 0.56 0.10.20.320.44

    0.7 0.44 0.32

    0.95

    0.10.2

    2.5

    0.84

    0.56

    3

    0.95

    0.511.52

    PoleZero Map

    Real Axis

    ImaginaryAxis

    Figure3: Pole-zeromapandtargetpole locations

    Ofcoursethereareplentyofotherthingsthatwewillconsiderwhenwe

    design

    the

    controllers

    Smallsteadystateerrortocommandse withinlimitsNooscillationsSpeedcontrol

  • 7/29/2019 aircraft control Lecture 9

    5/33

    Fall2004 16.33384FirstShortPeriodAutopilot

    Firstattempttocontrolthevehicleresponse: measureandfeed itbacktotheelevatorcommande.Unfortunatelytheactuator isslow,sothere isanapparent lag in

    theresponsethatwemustmodelce

    //4

    s+ 4

    ae

    // Ge(s) //

    ook

    OO

    coo

    Dynamics: a is the actual elevator deflection, ec is the actuatorecommandcreatedbyourcontroller

    4= Ge(s)ea; a = H(s)ec; H(s) =e s+ 4Thecontrolisjustbasicproportionalfeedback

    c = k(c)eWhichgivesthat

    = Ge(s)H(s)k(c)orthat

    (s) Ge(s)H(s)k=c(s) 1 + Ge(s)H(s)k

    Looksgood,buthowdoweanalyzewhatisgoingon?

    Need

    to

    be

    able

    to

    predict

    where

    the

    poles

    are

    going

    as

    afunction

    ofk RootLocus

  • 7/29/2019 aircraft control Lecture 9

    6/33

    Fall2004 16.33385RootLocusBasics

    r e u y//OO //

    Gc(s) // Gp(s) //

    AssumethattheplanttransferfunctionisoftheformGp = Kp

    Np

    = Kpi(szpi)Dp i(sppi)

    andthecontrollertransferfunctionisNc

    Gc(s) = Kc = Kci(szci)Dc i(spci)

    Signalsare:u controlcommandsy output/measurementsr referenceinpute responseerror

    This istheunity feedback form. WecouldaddthecontrollerGc inthefeedbackpathwithoutchangingthepolelocations.

    Willadd

    disturbances

    later.

  • 7/29/2019 aircraft control Lecture 9

    7/33

    Fall2004 16.33386 Basicquestions:

    Analysis: GivenNc andDc,wheredotheclosed looppolesgoasafunctionofKc?

    Synthesis: GivenKp,NpandDp,howshouldwechoseKc,Nc,Dctoputtheclosedlooppolesinthedesiredlocations?

    Block diagram analysis: Sincey = GpGceande= ry,theneasytoshowthat

    y GcGp=

    r 1 + GcGpGcl(s)

    whereKcKpNcNp

    Gcl(s) =DcDp+ KcKpNcNp

    istheclosed looptransfer function

    Thedenominator iscalledthecharacteristic equationc(s) andtherootsofc(s) = 0 arecalledtheclosed-looppoles(CLP).

    TheCLPareclearly functionsofKc foragivenKp,Np,Dp,Nc,Dcalocusofroots[Evans,1948]

  • 7/29/2019 aircraft control Lecture 9

    8/33

    Fall2004 16.33387RootLocusAnalysis

    GeneralrootlocusishardtodeterminebyhandandrequiresMatlabtoolssuchasrlocus(num,den)toobtainfullresult,butwecangetsomeimportantinsightsbydevelopingashortsetofplottingrules.FullrulesinFPE,page260.

    Basicquestions:1.Whatpointsareontherootlocus?2.Wheredoestherootlocusstart?3.Wheredoestherootlocusend?4.When/whereisthelocusontherealline?5.Giventhats0 is foundtobeonthe locus,whatgain isneed for

    thattobecometheclosed-looppolelocation?

    Question#1: ispoints0 ontherootlocus? AssumethatNc andDcareknown,let

    Ld =NcDc

    NpDp

    andK= KcKp thenc(s) = 1 + KLd(s) = 0

    orequivalentlyforvaluesofsforwhichLd(s) = 1/K,withKreal.ForK positive,s0 isontherootlocusif

    Ld(s0) = 180 l 360, l= 0,1,...

    IfK negative,s0 isontherootlocusif [0 locus]Ld(s0) = 0

    l 360, l= 0,1,...Theseareknownasthephaseconditions.

  • 7/29/2019 aircraft control Lecture 9

    9/33

    Fall2004 16.33388 Question#2: Wheredoestherootlocusstart?

    NcNpc = 1 + K = 0DcDp

    DcDp+ KNcNp = 0So ifK 0,then locusstartsatsolutionsofDcDp = 0 whicharethepolesoftheplantandcompensator.

    Question#3: Wheredoestherootlocusend?Alreadyshownthatfors0 tobeonthelocus,musthave

    1Ld(s0) =

    KSoifK ,thepolesmustsatisfy:

    NcNpLd = = 0DcDp

    Thereareseveralpossibilities:

    1.Polesare locatedatvaluesofs forwhichNcNp = 0, whicharethezerosoftheplantandthecompensator

    2.IfLoopLd(s) hasmorepolesthanzerosAs s , Ld(s)| 0,butwemustensurethatthephase| | |

    conditionis

    still

    satisfied.

  • 7/29/2019 aircraft control Lecture 9

    10/33

    Fall2004 16.33389 MoredetailsasK :

    AssumetherearenzerosandppolesofLd(s)Thenforlarge|s|,

    1Ld(s)

    (s )pnSotherootlocusdegeneratesto:

    11+ =0

    n

    (s )

    p

    SonpolesheadtothezerosofLd(s)Remainingp n poles head to s = along asymptotes| |

    definedbytheradiallines180+360 (l 1)

    l = l=1,2,...p n

    sothatthenumberofasymptotes isgovernedbythenumberofpolescomparedtothenumberofzeros(relativedegree).Ifzi arethezeros ifLd andpj arethepoles,thenthecentroid

    oftheasymptotesisgivenby:p n

    zipj =

    p n

    Example: L(s)=s4

    0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.80.8

    0.6

    0.4

    0.2

    0

    0.2

    0.4

    0.6

    0.8

    Root Locus

    Real Axis

    ImaginaryAxis

  • 7/29/2019 aircraft control Lecture 9

    11/33

    Fall2004 16.333810 Question#4: When/whereisthelocusontherealline?

    Locuspointsonthereal linearetothe leftofanodd numberofrealaxispolesandzeros[K positive].

    Explanationabittoodetailedandnotthatrelevant

    Question#5: Giventhats0 is foundtobeonthe locus,whatgainisneededforthattobecometheclosed-looppolelocation?

    Need

    1 =K

    Ld(s0)

    Dp(s0)Dc(s0)Np(s0)Nc(s0)| |

    SinceK=KpKc,signofKc dependsonsignofKp3

    e.g.,assume

    that

    Ld(s0)

    =

    180

    ,then

    need

    Kc and Kp tobesamesignsothatK>0

  • 7/29/2019 aircraft control Lecture 9

    12/33

    Fall2004 16.333811RootLocusExamples

    Figure4: Basic Figure5: Twopoles

    Figure6: Addzero Figure7: Threepoles

    Figure8: Addzero

    Examplessimilar

    to

    control

    design

    process:

    add

    compensator

    dynamics

    to

    mod-

    ifyrootlocusandthenchosegaintoplaceCLPatdesiredlocationonthelocus.

  • 7/29/2019 aircraft control Lecture 9

    13/33

    Fall2004 16.333812

    Figure9: Complexcase

    5 4 3 2 1 0 1 2 3 41

    0.8

    0.6

    0.4

    0.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    Root Locus

    Real Axis

    ImaginaryAxis

    2.5 2 1.5 1 0.5 0 0.5 1 1.5 2 2.55

    4

    3

    2

    1

    0

    1

    2

    3

    4

    5

    Root Locus

    Real Axis

    ImaginaryAxis

    Figure10: Verycomplexcase

  • 7/29/2019 aircraft control Lecture 9

    14/33

    Fall2004 16.333813DynamicCompensation

    For a given plant, can draw a root locus versus K. But if desiredpole locations are not on that locus, then need to modify it usingdynamiccompensation.Basicrootlocusplotsgiveusanindicationoftheeffectofadding

    compensatordynamics. Butneedtoknowwhattoaddtoplacethepoleswherewewantthem.

    Newquestions:Whattypeofcompensationisrequired?Howdowedeterminewheretoputtheadditionaldynamics?

    Therearethreeclassictypesofcontrollersu= Gc(s)e

    1.Proportionalfeedback: Gc Kg again,sothatNc = Dc = 1Samecasewehavebeenlookingat.

    2.Integralfeedbackt Ki

    u(t) = Ki e()d Gc(s) =0 s

    Usedtoreduce/eliminatesteady-stateerrorIfe() isapproximatelyconstant,thenu(t) willgrowtobevery

    largeandthushopefullycorrecttheerror.

  • 7/29/2019 aircraft control Lecture 9

    15/33

    Fall2004 16.333814Considererrorresponseof

    Gp

    (s) = 1/(s+ a)(s+ b)(a>0,b>0)toastep,

    r(t) = 1(t) r(s) = 1/swhere

    er =

    11 + GcGp e(s) =

    r(s)(1 + GcGp)

    Toanalyzeerror,useFVTlime(t) = lim se(s)

    s 0t sothatwithproportionalcontrol,

    s 1 1limess =lim =

    t s0 s 1 + KgGp(s) 1 +Kgabsocanmakeess small,butonlywithaverylargeKg

    Withintegralcontrol,lims 0Gc(s) = ,soess 0

    Integral control improves the steady state, but this is attheexpenseofthetransientresponse(typicallygetsworsebecausethesystemislesswelldamped)

  • 7/29/2019 aircraft control Lecture 9

    16/33

    Fall2004 16.3338151

    Example#1: G(s)= ,addintegralfeedbackto(s+a)(s+b)

    improvethesteadystateresponse.

    6 5 4 3 2 1 0 1 24

    3

    2

    1

    0

    1

    2

    3

    4

    Root Locus

    Real Axis

    ImaginaryAxis

    Figure11: RLafteradding integralFBIncreasingKitoincreasespeedoftheresponsepushesthepoles

    towardstheimaginaryaxismoreoscillatoryresponse.

    Combineproportionaland integral(PI)feedback:Gc =K1+K2 =K1s+K2

    s swhichintroducesapoleattheoriginandzeroats=K2/K1PIsolvesmanyoftheproblemswithjustintegralcontrol(I).

    3 2.5 2 1.5 1 0.5 05

    4

    3

    2

    1

    0

    1

    2

    3

    4

    5

    Root Locus

    Real Axis

    ImaginaryAxis

    Figure12: RLwithproportionaland integralFB

  • 7/29/2019 aircraft control Lecture 9

    17/33

    Fall2004 16.3338163.DerivativeFeedbacku= Kde sothatGc(s) = Kds

    DoesnothelpwiththesteadystateProvides feedback on the rate of change of e(t) so that the

    controlcananticipatefutureerrors.

    1Example#2G(s) = ,(a>0,b>0)

    (sa)(sb)withGc(s) = Kds

    2 1.5 1 0.5 0 0.5 1 1.5 21.5

    1

    0.5

    0

    0.5

    1

    1.5

    Root Locus

    Real Axis

    ImaginaryAxis

    Figure13: RLwithderivativeFB

    DerivativefeedbackisveryusefulforpullingtherootlocusintotheLHP- increasesdampingandmorestableresponse.

    Typicallyusedincombinationwithproportionalfeedbacktoformproportional-derivativefeedbackPD

    Gc(s) = K1+ K2swhichmovesthezerofromtheorigin.

  • 7/29/2019 aircraft control Lecture 9

    18/33

    Fall2004 16.333817ControllerSynthesis

    Firstdeterminewherethepolesshouldbelocated Willproportionalfeedbackdothejob? Whattypesofdynamicsneedtobeadded? Typicallyusemainbuild-

    ingblock(s+ z)

    GB(s) = Kc(s+ p)

    Canbemadeto look likevariouscontrollers,dependingonhowwepickKc,p,andzIfwepickz>p,withpsmall,then

    (s+ z)GB(s) Kc

    s

    whichisessentiallyaPIcompensator,calledalag.Ifwepickpz,thenatlowfrequency,theimpactofp/(s+ p)

    issmall,soGB(s) Kc(s+ z)

    whichisessentiallyPDcompensator,calledalead. Various algorithms exist to design the components of the lead and

    lagcompensators(see16.31coursenotesonline)

  • 7/29/2019 aircraft control Lecture 9

    19/33

    Fall2004 16.333818PolePlacement

    Oneoptionforsimplesystemsiscalledpoleplacement. Consider a simple system Gp = s2 for which we want the closed

    looppolestobeat1 2i Proportionalcontrolclearlynotsufficient,souseacompensatorwith

    1pole.(s+ z)

    Gc = K(s+ p)

    Sothereare3CLP. Knowthatthedesiredcharacteristicequationis

    d(s) = (s2+ 2s+ 5)(s+ ) = 0 Theactualclosedlooppolessolve:

    c(s) = 1 + GpGc = 02s (s+ p) + K(s+ z) = 03 2s + s p+ Ks+ Kz = 0

    Clearlyneedtopullthepolesattheorigin intotheLHP,soneedalead compensator Good rule of thumb is to takep = 10z as astartingpoint.

    Comparethecharacteristicequations:2c(s) = s2+ 10zs + Ks+ Kz= 0

    d(s) = (s2+ 2s+ 5)(s+ )3 2= s + s (+ 2) + s(2+ 5) + 5= 0

    gives2s + 2=10z

    s 2+ 5=K0s 5=zK

  • 7/29/2019 aircraft control Lecture 9

    20/33

    Fall2004 16.333819solvefor,z,K

    25 5zK

    =

    52z; =52z

    z=2.23,=20.25,K=45.5

    25 20 15 10 5 020

    15

    10

    5

    0

    5

    10

    15

    20

    Root Locus

    Real Axis

    ImaginaryAxis

    Figure14: CLPwithpoleplacement

  • 7/29/2019 aircraft control Lecture 9

    21/33

    Fall2004 16.333820Autopilot

    Backtotheproblemon94: feedbacktoe tocontrolshortperiodmodel

    c(s)=1+Ge(s)H(s)k =0with

    1.1569s+0.3435 4Ge(s)=s3+0.7410s2+0.9272s, H(s)=s+4

    Pole/zeromap:

    Figure15: Pole/zeromapoftheshortperiodautopilotwith feedback Note: Kp 0,thenwewouldhavetodrawa0 locus

    Poleatoriginwouldmovetorightalongrealaxisunstable.

    4 3 2 1 0 1 2 3 4

    4

    3

    2

    1

    0

    1

    2

    3

    4

    SP Autopilot with FB: k

    > 0

    Real Axis

    Imagina

    ryAxis

    Figure16: Withk >0

  • 7/29/2019 aircraft control Lecture 9

    22/33

    Fall2004 16.333821 Somustusek

  • 7/29/2019 aircraft control Lecture 9

    23/33

    Fall2004 16.333822 Couldusearategyroasthesensorinsteadandfeedbackq

    1.1569s+0.3435 4Gqe(s)=s2+0.7410s+0.9272, H(s)=s+4

    Figure18: PZmapwithqFB Again,pickthegainkq

  • 7/29/2019 aircraft control Lecture 9

    24/33

    Fall2004 16.333823 Cangetanevenbetterresult ifwecombinetheqand feedback

    likePDonthemeasurement.ce

    //4

    s+ 4ae

    // Gqeq

    //

    oo

    1s

    //

    oo

    kq

    OO

    k

    OO

    coo

    ce = kqqk(c) ae = H(s)ceq = s

    =1sGqeae = Geae

    = GeH[(k + kqs)kc] GeHk=c 1 + GeH(k + kqs)

    Nowpickkq = k,anddoRLversuskc(s) = 1 + GeH(1 + s)k = 0

    Placesazeroats= 1/

    Stepresponse

    is

    reasonable,

    but

    now

    need

    to

    pick

    the

    k

    and

    kq

    to

    getthedesiredsp andsp

  • 7/29/2019 aircraft control Lecture 9

    25/33

    Fall2004 16.333824

    4.5 4 3.5 3 2.5 2 1.5 1 0.5 0

    4

    3

    2

    1

    0

    1

    2

    3

    4

    SP PD Autopilot with =1 FB: k

    < 0

    Real Axis

    ImaginaryAxis

    Figure20: PDfeedbackwith= 1.aretheclosed looppoles.

    0 5 10 15 20 25 30 35

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    step response to c

    Time (sec)

    (t)

    r

    ads

    Figure21: PDfeedbackwith= 1 - step

  • 7/29/2019 aircraft control Lecture 9

    26/33

  • 7/29/2019 aircraft control Lecture 9

    27/33

    Fall2004 16.333826Summary

    Presentedonlybasicsofcontroldesignandanalysis,butthisisenoughforustogetstarted

    Workingwithsmallermodelsisgoodfordesign,butneedtoconfirmthatthefullmodelstillstable

    Could work with the full model, but that is much easier with statespacetools

  • 7/29/2019 aircraft control Lecture 9

    28/33

    Fall2004 16.333827

    SPcontrolcodes(lect9a.m)1 %2 % Fall 20043 % 16.3334 % Codes to investigate control for the SP5 %6 close all7 figure(1);clf8 set(gcf,DefaultLineLineWidth,2)9 set(gcf,DefaultlineMarkerSize,10)10 rlocus([1],conv([1 0],[1 3 2]))11 print -depsc rl_pi11213 load b747 Asp Bsp14 figure(10);pzmap(ss(Asp,Bsp,[0 1],0));grid on;15 hh=get(10,children);hhh=get(hh(1),children)16 set(hhh(1),MarkerSize,24);set(hhh(1),LineWidth,2)17 set(hhh(2),MarkerSize,24);set(hhh(2),LineWidth,2)18 axis([-1 0.1 -1 1])19 print -depsc pz_sp20 jpdf(pz_sp)2122 figure(10);clf23 test=[% thumbnail data from Nelson 16724 .5 .4;25 .8 .4;26 1 .55;27 .7 .6]28 test(:,2)=test(:,2)*2*pi;29 stest=[-test(:,1).*test(:,2) test(:,2).*sqrt(1-test(:,1).^2)]30 fill(stest(:,1),stest(:,2),blue,stest(:,1),-stest(:,2),blue)31 hold on32 pzmap(ss(Asp,Bsp,[0 1],0));grid on;33 hh=get(10,children);hhh=get(hh(1),children)34 set(hhh(1),MarkerSize,24);set(hhh(1),LineWidth,2)35 set(hhh(2),MarkerSize,24);set(hhh(2),LineWidth,2)36 hold off37 print -depsc pz_sp238 jpdf(pz_sp2)3940 figure(1);clf41 set(gcf,DefaultLineLineWidth,2)42 set(gcf,DefaultlineMarkerSize,10)43 rlocus([1],conv([1 0],[1 3 2]))44 print -depsc rl_pi14546

    figure(2);

    47 set(gcf,DefaultLineLineWidth,2)48 set(gcf,DefaultlineMarkerSize,12)49 rlocus([1 3],conv([1 0],[1 3 2]))50 print -depsc rl_pi25152 figure(2);53 set(gcf,DefaultLineLineWidth,2)54 set(gcf,DefaultlineMarkerSize,12)55 rlocus([1 0],conv([1 -2],[1 -1]))56 print -depsc rl_d15758 %Example: G(s)=1/2^259 %Design Gc(s) to put the clp poles at -1 + 2j60 z=roots([-20 49 -10]);z=max(z),k=25/(5-2*z),alpha=5*z/(5-2*z),61 num=1;den=[1 0 0];62 knum=k*[1 z];kden=[1 10*z];63 rlocus(conv(num,knum),conv(den,kden));64 hold;plot(-alpha+eps*j,d);plot([-1+2*j,-1-2*j],d);hold off65 r=rlocus(conv(num,knum),conv(den,kden),1)66 print -depsc rl_pp

  • 7/29/2019 aircraft control Lecture 9

    29/33

    Fall2004 16.3338286768 jpdf(rl_pi1)69 jpdf(rl_pi2)70 jpdf(rl_d1)71

    jpdf(rl_pp)

    7273 load b747 Asp Bsp74 G=tf(ss(Asp,Bsp,[0 1],0))*tf(1,[1 0]);75 H=tf(4,[1 4]);76 rlocus(G*H)77 axis([-3 3 -3 3]*1.5)78 title(SP Autopilot with \theta FB: k_\theta79 print -depsc sp_ap180 jpdf(sp_ap1)8182 rlocus(-G*H)83 axis([-3 3 -3 3]*1.5)84 title(SP Autopilot with \theta FB: k_\theta85 print -depsc sp_ap286 jpdf(sp_ap2)8788 load b747 Asp Bsp89 G=tf(ss(Asp,Bsp,[0 1],0));90 H=tf(4,[1 4]);91 rlocus(-G*H)92 rr=rlocus(-G*H,1)93 hold on

    > 0,FontSize,16)

  • 7/29/2019 aircraft control Lecture 9

    30/33

    Fall2004 16.333829

    SPcontrolcodes: Part2(lect9b.m)1 % 16.333 Fall 20042 % SP design meeting the performance goals a3 %4 load b747 Asp Bsp5 G=tf(ss(Asp,Bsp,[0 1],0))*tf(1,[1 0]);6 H=tf(4,[1 4]);78 zeta=1.95;9 k_th=1;10 PD=tf([zeta 1],1);1112 rlocus(-G*H*PD)13 rr=rlocus(-G*H*PD,k_th)14 hold on

    bit better

    15 plot(rr+sqrt(-1)*eps,d,MarkerFaceColor,b)16 plot(-1.8+2.4*sqrt(-1),s,MarkerFaceColor,r)17 plot(-1.8-2.4*sqrt(-1),s,MarkerFaceColor,r)18 hold off19 axis([-3 0 -3 3]*1.5)20 title([SP PD Autopilot with \zeta=,num2str(zeta),21 print -depsc sp_pd222 jpdf(sp_pd2)2324 figure(2);25 set(gcf,DefaultLineLineWidth,2)26 set(gcf,DefaultlineMarkerSize,12)27 G_cl=G*H*(-k_th)/(1+G*H*PD*(-k_th));28 step(G_cl,35)

    FB: k_\theta

  • 7/29/2019 aircraft control Lecture 9

    31/33

    Fall2004 16.333830

    SPcontrol: BasicDynamics(lect9.m)1 clear all2 prt=1;3 %4 % B747 longitudinal dynamics5 % 16.333 Fall 20046 %7 % B747 at Mach 0.8, 40,000ft, level-flight8 % From Etkin and Reid9 %10 % metric11 Xu=-1.982e3;Xw=4.025e3;12 Zu=-2.595e4;Zw=-9.030e4;Zq=-4.524e5;Zwd=1.909e3;13 Mu=1.593e4;Mw=-1.563e5;Mq=-1.521e7;Mwd=-1.702e4;1415 g=9.81;theta0=0;S=511;cbar=8.324;16 U0=235.9;Iyy=.449e8;m=2.83176e6/g;cbar=8.324;rho=0.3045;17 Xdp=.3*m*g;Zdp=0;Mdp=0;18 Xde=-3.818e-6*(1/2*rho*U0^2*S);Zde=-0.3648*(1/2*rho*U0^2*S);19 Mde=-1.444*(1/2*rho*U0^2*S*cbar);;2021 A=[Xu/m Xw/m 0 -g*cos(theta0);[Zu Zw Zq+m*U0 -m*g*sin(theta0)]/(m-Zwd);22 [Mu+Zu*Mwd/(m-Zwd) Mw+Zw*Mwd/(m-Zwd) Mq+(Zq+m*U0)*Mwd/(m-Zwd) ...23 -m*g*sin(theta0)*Mwd/(m-Zwd)]/Iyy;24 [ 0 0 1 0]];25 B=[Xde/m Xdp/m;Zde/(m-Zwd) Zdp/(m-Zwd);(Mde+Zde*Mwd/(m-Zwd))/Iyy ...26 (Mdp+Zdp*Mwd/(m-Zwd))/Iyy;0 0];2728 % Short-period Approx29 Asp=[Zw/m U0;30 [Mw+Zw*Mwd/m Mq+U0*Mwd]/Iyy];31 Bsp=[Zde/m;(Mde+Zde/m*Mwd)/Iyy];32 [nsp,dsp]=ss2tf(Asp,Bsp,eye(2),zeros(2,1));33 [Vsp,evsp]=eig(Asp);evsp=diag(evsp);34 %rifd(evsp)3536 %37 % CONTROL38 %39 % actuator dynamics are a lag at 440 actn=4;actd=[1 4]; % H(s) in notes41 %42 % use the short period model since that is all we are trying to control43 %44 [nsp,dsp]=ss2tf(Asp,Bsp,eye(2),zeros(2,1));45 [nfull,dfull]=ss2tf(A,B(:,1),eye(4),zeros(4,1));46

    %

    47 % form num and den for the "plant" = act_dyn*G == N/D48 %49 % short period model50 N=conv(actn,nsp(2,:));% q is second state51 D=conv(actd,dsp);52 % full model53 Nqfull=conv(actn,nfull(3,:));% q is third state54 Ntfull=conv(actn,nfull(4,:));% theta is fourth state55 Dfull=conv(actd,dfull);56 %57 % add an extra pole to get the integrator for the \dot theta = q58 %59 Ntheta=conv(N,1);Dtheta=conv(D,[1 0]);6061 figure(1);clf;62 K_th0=-1;63 rlocus(sign(K_th0)*Ntheta,Dtheta);64 r_th0=rlocus(Ntheta,Dtheta,K_th0);hold on;plot(r_th0+eps*sqrt(-1),v);65 hold off66 sgrid(.6,3); % gives target damping and freqs

  • 7/29/2019 aircraft control Lecture 9

    32/33

    Fall2004 16.33383167 axis([-5 .5 -4 4]);grid68 title(Closed-loop poles using only theta FB)69 if prt70 print -depsc ac_th071

    end

    7273 figure(2);clf;74 K_q=-1;75 rlocus(sign(K_q)*N,D);76 r_q=rlocus(N,D,K_q);hold on;plot(r_q+eps*sqrt(-1),v);77 hold off78 sgrid(.6,3);79 axis([-5 .5 -4 4]);grid80 title(Closed-loop poles using q FB)81 if prt82 print -depsc ac_q83 end84 %85 %closed-loop dynamics with q FB in place (inner loop)86 % GH/(1+k_q GH) = (N/D) / (1+k_q N/D) = N/(D+k_q N)87 %88 Nq=N;Dq=K_q*[0 N]+D;89 %90 % add integrator for q ==> theta91 %92 K_th=-1;93 %94 figure(3);clf;95 rlocus(sign(K_q)*Nq,conv(Dq,[1 0]));grid96 r_th=rlocus(Nq,conv(Dq,[1 0]),K_th);hold on;97 plot(r_q+eps*sqrt(-1),v);plot(r_th+eps*sqrt(-1),^);98 hold off99 sgrid(.6,3);100 axis([-5 .5 -4 4]);grid101 title(Closed-loop poles also using theta FB)102 if prt103 print -depsc ac_th104 end105 %106 % as a final check, form the closed-loop dynamics107 % using the original short period model108 Ncl=Ntheta*K_th;109 Dcl=Dtheta+conv([0 N],[K_q K_th]);110 roots(Dcl)111 %112 SPcl=tf(Ncl,Dcl);113 [y,t]=step(SPcl);114 figure(4)115 plot(t,y);xlabel(time);ylabel(\theta rad,FontSize,12)116 if prt117 print -depsc ac_th_step118 end119120 %121 % as a final check, form the closed-loop dynamics122 % using the full dynamics from del_e to theta123 Nfcl=Ntfull*K_th;124 Dfcl=Dfull+conv(Ntfull,[K_q K_th]);125 roots(Dfcl)126 figure(3)127 hold on;plot(roots(Dfcl)+eps*sqrt(-1),r*);hold off128 axis([-3 .5 -2 2]);grid129 title(Closed-loop poles with q and th FB on FULL model)130 if prt131 print -depsc ac_full132 end133134

    %return

    135136 %137 % add theta state to the short period approx model138 %

  • 7/29/2019 aircraft control Lecture 9

    33/33

    1

    2

    3

    4

    5

    6

    7

    8

    9

    Fall2004 16.333832139 Ksp=place(Asp,Bsp,[roots([1 2*.6*3 3^2])])140 Asp2=[Asp [0 0];0 1 0];Bsp2=[Bsp;0];141 Ksp2=place(Asp2,Bsp2,[roots([1 2*.6*3 3^2]),-.25])142 %143

    %

    add

    actuatormodel

    to

    SP

    with

    theta

    144 %145 Plist=[roots([1 2*.6*3 3^2]),-.25,-3];146 At2=[Asp2 Bsp2(:,1);zeros(1,3) -4];Bt2=[zeros(3,1);4];147 Kt2=place(At2,Bt2,[Plist])148 step(ss(At2-Bt2*Kt2,Bt2,[0 0 1 0],0),35)149 hh=get(gcf,children);hhh=get(hh(1),children)150 set(hhh(1),MarkerSize,24);set(hhh(1),LineWidth,2)151 ylabel(\theta rads,FontSize,12)152 print -depsc fsfb_step.eps153 jpdf(fsfb_step)154 %155 ev=eig(A);156 % dampe short period, but leave the phugoid where it is157 Plist=[roots([1 2*.6*3 3^2]) ev([3 4],1)];158 K1=place(A,B(:,1),Plist)159 %160 % add actuator model16 %16 At=[A B(:,1);zeros(1,4) -4];Bt=[zeros(4,1);4];16 Kt=place(At,Bt,[Plist -3])1616 save b747 A B Asp Bsp1616 %!eps2pdf /f="ac7_fig1.eps"16 %!mv c:\ac7_fig1.pdf ./ac7_fig1.pdf16170