bode plot design.pdf

Upload: smileuplease8498

Post on 14-Apr-2018

239 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Bode Plot Design.pdf

    1/15

    1

    Bode Design Example #6

    A. Introduction

    The plant model represents a linearization of the heading dynamics of a 250,000 ton tanker ship under

    empty load conditions. The reference input signal R(s) is the desired heading angle for the ship ref(s),and the output signal Y(s) is the actual heading angle (s). In this example, angles will be expressed indegrees. The input to the plant, U(s), is the commanded rudder angle rcom(s) that is used to controlthe heading of the ship. The open-loop transfer function for the plant is

    Gp(s) =Y(s)

    U(s)=

    3.2587 104 (s + 2.551 102)

    s (s + 0.3333)(s + 5.3288 102) (s + 6.8624 103)=

    (s)

    rcom(s)(1)

    The gain 3.2587 104, the poles at s = 5.3288 102 and s = 6.8624 103, and the zero ats = 2.551 102 describe the dynamics of the system between the actual rudder angle and the rate ofchange in heading angle. The pole at s = 0 provides the integration from the rate of change in headingangle to the heading angle itself. The pole at s =

    0.3333 models the hydraulic actuator dynamics

    between the commanded rudder angle rcom(s) and the actual rudder angle r(s).The only difference between the model given in (1) and the true linearized model is the sign of the

    gain 3.2587 104. Because of the sign conventions used in ship steering, the sign of the gain should benegative. However, because of the same sign convention, the sign of the compensators gain would alsobe negative. To simplify this example, both gains will be assumed to be positive. There are no changesin the overall open-loop or closed-loop transfer functions due to this simplification.

    The performance specifications that are imposed on the system are:

    Phase margin must be at least 50; The loop must be able to withstand a pure time delay of at least 15 seconds; Steady-state error in the closed-loop ramp response must not exceed 2 degrees.

    B. Evaluating Gp(s) Relative to the Specifications

    The open-loop systemis Type 1, so the plant has the correct SystemType N to satisfy the steady-stateerror specification. The steady-state error of the plant for a ramp input is 1/Kxplant, where

    Kxplant = lims0

    s

    3.2587 104 (s + 2.551 102)

    s (s + 0.3333) (s + 5.3288 102) (s + 6.8624 103)

    = 0.0682 (2)

    so the steady-state error is essplant = 1/0.0682 = 14.7. Therefore, in order to satisfy the steady-stateerror specification, the compensator must have a gain

    Kc =

    essplantessspec =

    14.6618

    2 = 7.3309 (3)

    The value in (3) will be the total compensator gain regardless of whether the compensator is phase lead,phase lag, or lag-lead and regardless of the number of stages in thefinal compensator design.

    The maximum pure time delay that can be tolerated in the loop is related to both the phase margin(expressed in radians) and the gain crossover frequency x. Since both time delay and phase marginhave specified minimumvalues, a specification on gain crossover frequency is also implied. The relationbetween the variables is

    Tdmax =P M

    x x =

    P M

    Tdmax=

    50 /180

    15= 0.0582 rad/sec (4)

  • 7/30/2019 Bode Plot Design.pdf

    2/15

    2

    104

    103

    102

    101

    100

    101

    300

    250

    200

    150

    100

    50

    0

    50

    100

    Frequency (r/s)

    Magnitude(db)&Phase(deg)

    Uncompensated Bode Plots for Gp(s) = 3.2587E04(s+2.551E02)/[s(s+0.3333)(s+5.328E02)(s+6.8624E03)]

    essspec

    = 2, ess

    = 14.7

    PMspec

    = 50, PM = 31.0

    Tdelayspec

    = 15, Tdelay

    = 22.9

    xspec

    = 0.058, x

    = 0.024

    Fig. 1. Bode plots for the uncompensated systemGp(s).

    Smaller values for x than given in (4) can also be used; they will provide longer allowed time delays inthe loop for a given phase margin, but the response time of the system will be correspondingly slower.

    Fig. 1 shows the Bode plots for the plant transfer function given in (1), and Fig. 2 shows the Bodeplots when the compensator gain Kc = 7.3309 is placed in series with the plant.

    When the compensator gain Kc = 7.3309 is included in the system to satisfy the steady-state errorspecification, the phase margin drops from 31 to 8.2 and the maximum allowed time delay drops from22.9 seconds to 1.84 seconds. It is clear that additional compensation is needed.

    C. Compensator Designs

    1) Overview: Two approaches to compensator design using the Bode plot techniques discussed inclass could be tried. The first approach uses only phase lag compensators to drop the magnitude curve|KcGp (j)| down to 0 db at the frequency where the phase curve is 180 + 50 + 10 = 120.This frequency is approximately = 0.0048 rad/sec. The magnitude |KcGp (j)| at this frequency isapproximately 38.8 db, which corresponds to an absolutevalueofg = 86.8. This is generally consideredtoo large for a single stage of lag compensationdue to the large numerical values for the resistors andcapacitors to implement the compensatorso two stages would be used, each having =

    86.8 = 9.32.

    The resulting design has a phase margin of 54.6, which satisfies that specification, and a maximumtime delay of 199 seconds, far exceeding the specification. The overshoot in the step response is 18%,which might be acceptable, but the settling time is over 3, 700 seconds, which is much too long. The

  • 7/30/2019 Bode Plot Design.pdf

    3/15

    3

    104

    103

    102

    101

    100

    101

    300

    250

    200

    150

    100

    50

    0

    50

    100

    Frequency (r/s)

    Magnitude(db)&Phase(deg)

    Bode Plots for System with Kc

    = 7.331

    essspec

    = 2, ess

    = 2.0

    PMspec

    = 50, PM = 8.2

    Tdelayspec

    = 15, Tdelay

    = 1.8

    xspec

    = 0.058, x

    = 0.078

    Fig. 2. Bode plots for the system to satisfy the steady-state error specification, Kc = 7.3309.

    design is also conditionally stable, so gain reductions as well as gain increases could produce an unstableclosed-loop system. Therefore, this design will not be shown.

    The second design approach will use a lag-lead compensator. The lead part of the compensator will bedesignedfirst, with the goal of raising the phase curve up at the specified gain crossover frequency givenin (4). After that, the lag part of the compensator will bedesigned to drop the combined magnitude of theplant, compensator gain, and lead compensator down to 0 db at that same frequency. Thus, the frequencyspecified in (4) will be used in both parts of the compensator design.

    2) Design of the Lead Compensator: The first step in the design of the lead compensator is todetermine the amount of positive phase shift that must be added at a specified frequency in order to

    satisfy the phase margin specification. Since we know that a lag-lead will be designedrather than justa lead compensatorthe frequency where the phase shift will be measured is the specified value for thecompensated gain crossover frequency given in (4) instead of the original value of x.

    At the compensated gain crossover frequency xc = 0.0582 rad/sec, the plant has a phase shift of164.4, as obtained fromthe data array in MATLAB using the bode function. It could also be computeddirectly fromthe transfer function KcGp(j) or it could be determined from the Bode phase plot. If thevalue is obtained graphically from the plot, the accuracy and resolution obviously will not be as good asif the value is determined analytically from the transfer function or from the MATLAB data array. Withthis value for KcGp(jxc), the effective phase margin of the uncompensated system KcGp (j) is

  • 7/30/2019 Bode Plot Design.pdf

    4/15

    4

    P Muncomp = 180 +Gp(jxc) = 180

    164.4 = 15.6 (5)It should be noted that this valuefor P Muncomp will not be obtained using the MATLAB margin functionwith the transfer function KcGp(s). Phase margin is only defined at the actual gain crossover frequency.In the design of a lag-lead compensator, the effective phase margin of the uncompensated system iscomputed at thefinal value for the gain crossover frequency, not the current value. Therefore, the value

    shown in (5) is not truly a phase margin, but it is used in the computation of max as if it were a truephase margin.

    Using the value for P Muncomp given in (5), the amount of positive phase shift that must be added atxc = 0.0582 rad/sec is

    max = P Mspec + 10 P Muncomp = 50 + 10 15.6 = 44.4 (6)

    The corresponding value for the parameter d is

    d =1 sin(max)1 + sin (max)

    =1 sin (44.4 /180)1 + sin (44.4 /180)

    = 0.1770 (7)

    The zero and pole of the lead compensator can now be computed. They are given by

    zcd = xc

    d = 0.0582

    0.1770 = 0.02448 (8)

    pcd =zcdd

    =0.02448

    0.1770= 0.13827 (9)

    The complete transfer function for the lead part of the compensator is

    Gclead(s) =

    Kc

    s

    zcd+ 1

    spcd

    + 1 =

    7.3309 s

    0.02448+ 1

    s0.13827 + 1

    (10)

    Kcd

    (s + zcd)

    (s +pcd)=

    41.411(s + 0.02448)

    (s + 0.13827)(11)

    The Bode plots for the series combination of the plant given in (1) and the lead compensator givenin (10) are shown in Fig. 3. At the frequency = 0.0582 rad/sec, the phase curve has been moved upby 44.4, the value of max. The actual phase margin at this stage of the design is not the correct valuebecause gain crossover has not yet been established at that frequency. That will be the task of the lag partof the lag-lead compensator. The lead compensator has taken care of the positive phaseshift that neededto be added to the system.

    3) Design of the Lag Compensator: Now that the phase curve has been adjusted to have the correctvalue at the frequency that has been chosen to be the compensated gain crossover frequency, the onlyremaining task is to drop the magnitude curve down to 0 db at that same frequency. This establishesthat frequency as the actual gain crossover frequency, and since the phase curve has the correct value atthe frequency, the phase margin specification will be satisfied. Also, since xc was chosen based on therelationship between the phase margin and time delay specifications, the time delay specification will besatisfied as well.

    The amount that the magnitude curve must be moved down in order to establish gain crossover atthe specified xc is the magnitude of the series combination of plant and lead compensator, evaluatedat that frequency. This can be done analytically from the product of the magnitudes of the transferfunctions in (1) and (10), evaluated at s = j0.0582. It can also be done from the data arrays in

  • 7/30/2019 Bode Plot Design.pdf

    5/15

    5

    104

    103

    102

    101

    100

    101

    300

    250

    200

    150

    100

    50

    0

    50

    100

    Frequency (r/s)

    Magnitude(db)&Phase(deg)

    Bode Plots for Intermediate System with 1Stage Lead Compensator

    essspec

    = 2, ess

    = 2.0

    PMspec

    = 50, PM = 16.9

    Tdelayspec

    = 15, Tdelay

    = 1.8

    xspec

    = 0.058, x

    = 0.164

    max

    = 44.4, d

    = 0.1770

    Kc

    = 7.331

    zcd

    = 0.02448, pcd

    = 0.13827

    Fig. 3. Bode plots showing the effects of the lead compensator in raising the phase curve at xc = 0.0582 rad/sec.

    MATLAB or graphically from the Bode plots. The values for |Gp (j0.0582)| , |KcGp (j0.0582)| , and|Gclead (j0.0582) Gp (j0.0582)| in both absolute values and decibels are shown in the table below. Theabsolute values were obtained fromthe corresponding MATLAB data arrays; the values in decibels werecomputed from ||db = 20 log10 ||abs val.

    Transfer Function Absolute Value Decibels|Gp (j0.0582)| 0.22755 12.858|KcGp (j0.0582)| 1.6681 4.4447|Gclead (j0.0582) Gp (j0.0582)| 3.9647 11.964

    The total attenuation required at = 0.0582 rad/sec is given by the values in the last row of the table.If the magnitude value is obtained graphically from the Bode plots, the magnitude will be expressed indecibels, and the conversion to absolute value is

    |Gclead (j0.0582) Gp (j0.0582)|abs val = 10(|Gclead(j0.0582)Gp(j0.0582)|db/20) = 10(11.964/20) = 3.9647 (12)

    The value of the parameter g is

    g = |Gclead (j0.0582) Gp (j0.0582)|abs val = 3.9647 (13)

  • 7/30/2019 Bode Plot Design.pdf

    6/15

    6

    The zero of the lag compensator can be placed rather arbitrarily. If it is placed one decade below thecompensated gain crossover frequency,or lower, then the phase margin specification will be satisfied dueto the 10 safety factor included in the calculation of max. For this example, the zero will be placed onedecade below xc.

    zcg =xc

    10

    =0.0582

    10

    = 0.00582 (14)

    pcg =zcgg

    =0.00582

    3.9647= 1.4674 103 (15)

    The lag compensators transfer function is

    Gclag(s) =

    s

    zcg+ 1

    s

    pcg+ 1

    = s

    0.00582+ 1

    s

    1.4674 103+ 1

    (16)

    1

    g

    (s + zcg)

    (s +pcg) =

    0.25222 (s + 0.00582)

    (s + 1.4674 103) (17)

    Note that the gain Kc = 7.3309 was included with the lead portion of the compensator. It could havebeen included with the lag portion instead, or the gain could be split between the two stages in anymanner desired, as long as the product of the gains (in the time-constant form of the transfer function)is 7.3309. The total compensator for the system is the product of the lead and lag parts. In the Bode ortime-constant form, the compensators transfer function is

    Gc(s) = Gclead(s) Gclag(s) =7.3309

    s0.02448

    + 1

    s0.13827

    + 1

    s0.00582

    + 1

    s1.4674 103

    + 1 (18)

    and in the pole-zero format, the transfer function is

    Gc(s) =41.411(s + 0.02448)

    (s + 0.13827)

    0.25222 (s + 0.00582)

    (s + 1.4674 103)=

    10.445(s + 0.02448) (s + 0.00582)

    (s + 0.13827) (s + 1.4674 103)(19)

    Either formof the transfer function, (18) or (19), may be used. Note that the two transfer functions havedifferent gains. In the time-constant form, the gain in the transfer function is Kc, computed in (3). In thepole-zero form, the gain in the transfer function is Kc/ (dg) .

    The Bode plots for the complete lag-lead compensated system are shown in Fig. 4. The actual phasemargin is 55.6, larger than the specified minimum value, so the phase margin specification is satisfied.The gain crossover frequency is equal to the value specified in (4).. Since the phase margin is larger than

    the required minimum value and the gain crossover frequency is equal to its specified value, the puretime delay that can be tolerated in the loop is larger than its specified minimum value. The actual valueof the allowed time delay is 16.6 seconds.

  • 7/30/2019 Bode Plot Design.pdf

    7/15

    7

    104

    103

    102

    101

    100

    101

    300

    250

    200

    150

    100

    50

    0

    50

    100

    Frequency (r/s)

    Magnitude(db)&Phase(deg)

    Bode Plots for System with Final LagLead Compensator

    essspec

    = 2, ess

    = 2.0

    PMspec

    = 50, PM = 55.6

    Tdelayspec

    = 15, Tdelay

    = 16.6

    xspec

    = 0.058, x

    = 0.058

    g

    = 3.9647

    zcg

    = 0.00582, pcg

    = 0.00147

    Fig. 4. Bode plots for thecomplete lag-lead compensated system.

    D. Evaluation of the Design

    The table below summarizes the stages in the design process in terms of satisfying the specifications.The following four closed-loop systems will be compared:

    TCL1(s) =Gp(s)

    1 + Gp(s), TCL2(s) =

    KcGp(s)

    1 + KcGp(s)(20)

    TCL3(s) =Gclead(s)Gp(s)

    1 + Gclead(s)Gp(s), TCL4(s) =

    Gc(s)Gp(s)

    1 + Gc(s)Gp(s)

    where Gp(s), Kc, Gclead(s), and Gc(s) are given in equations (1), (3), (10), and (18), respectively.

    Specification Requirement TCL1(s) TCL2(s) TCL3(s) TCL4(s)Steady-State Error ess 2 14.662 2 2 2

    Phase Margin P M 50 31 8.2 16.9 55.6Time Delay Td 15 sec 22.9 sec 1.84 sec 1.80 sec 16.6 sec

    Gain Crossover Frequency xc = 0.058 r/s 0.024 r/s 0.078 r/s 0.164 r/s 0.058 r/s

    Clearly, only thefinal design satisfies all the specifications, and it is the only design to provide enoughphase margin in the system.

  • 7/30/2019 Bode Plot Design.pdf

    8/15

    8

    Now that the specifications presented in the Introduction havebeen satisfied by thefinal design, severaladditional (performance) characteristics will be compared for the various stages of the design. Thesecharacteristics will be

    closed-loop frequency response magnitude |TCL (j)|; closed-loop step response of the output signal (t); closed-loop step response of the control signal r(t); and closed-loop ramp response of the output signal (t).

    Each of these characteristics will be discussed in turn.1) Closed-Loop Frequency Response Magnitude: The Bode plots shown thus far have been for the

    open-loop system at a particular stage in the design. Closed-loop stability and performance have beeninferred fromthese plots through the phasemargin and gain crossover frequency. The frequency responsemagnitude of the closed-loop system provides additional information fromthe bandwidth, resonant peak,and resonant frequency. The bandwidth is the frequency where the magnitude has dropped to 1/

    2 of

    its value at = 0. Since the plant has System Type N = 1, the magnitude of the closed-loop transferfunction has unity magnitude at = 0, so the bandwidth corresponds to the frequency where the Bodeplot magnitude is 3 db. The closed-loop bandwidth is a measure of the range of frequencies that canpass through the system without signi

    ficant attenuation.The resonant peak is the maximum value of the closed-loop frequency response magnitude. It is the

    largest gain of the closed-loop system for any sinusoidal input. L arge values of the resonant peak Mpwcorrespond to small amounts of damping in the system, so large overshoot and oscillations are expectedin the step response. For example, the standard second-order system with damping ratio has a resonantpeak given by

    Mpw =1

    2p

    1 2, 1

    2(21)

    so the value of the resonant peak increases rapidly for decreasing , becoming infinitely large for theundamped = 0 case. Overshoot in the step response also increases with decreasing , with overshoot

    being 100% for = 0. Thus, large overshoot in the time domain corresponds to a large magnitude peakin the frequency domain.

    The resonant frequency is the frequency at which the resonant peak occurs. The resonant frequency ofthe standard second-order system is

    r = n

    q1 22, 1

    2(22)

    For > 1/

    2, the resonant frequency and resonant peak are r = 0 rad/sec and Mpw = 1. For = 0,r = n, indicating that the systems step response oscillates at the undamped natural frequency whenthere is no damping.

    The closed-loop magnitude plots for the four systems are shown in Fig. 5. The bandwidths, resonant

    peaks, and resonant frequencies are shown in the table below.

    System Bandwidth Resonant Peak Resonant FrequencyTCL1(s) 0.039 rad/sec 1.89 (5.53 db) 0.022 rad/secTCL2(s) 0.123 rad/sec 7.08 (17.0 db) 0.079 rad/secTCL3(s) 0.259 rad/sec 3.65 (11.2 db) 0.174 rad/secTCL4(s) 0.110 rad/sec 1.19 (1.50 db) 0.023 rad/sec

    Looking at the closed-loop bandwidth, the following pattern is evident. Starting with the uncompensatedsystem TCL1(s), increasing the gain by Kc = 7.3309 to form system TCL2(s) increases the open-loop

  • 7/30/2019 Bode Plot Design.pdf

    9/15

    9

    104

    103

    102

    101

    100

    101

    140

    120

    100

    80

    60

    40

    20

    0

    20

    Frequency (r/s)

    Magnitude(db)

    ClosedLoop Magnitudes

    Uncompensated bandwidth = 0.039 r/s

    Bandwidth with Kc

    = 0.123 r/s

    Bandwidth with intermediate compensator = 0.259 r/s

    Bandwidth with final compensator = 0.110 r/s

    1

    23

    4

    Fig. 5. Closed-loop frequency response magnitudes for the four stages of the design.

    gain crossover frequency and the closed-loop bandwidth. When a lead compensator is then designed toformsystem TCL3(s), the bandwidth is increased further. Lastly, when the lag compensator is added tothe system, the bandwidth drops, in this case nearly to its original value.

    2) Closed-Loop Step Responseof the Output Signal: Thetimedomain is thefinal andtrue testingplacefor any design. The step responses of the output signals of the four designs defined in (20) are shownin Fig. 6. Even though there was no specification on overshoot or settling time, common sense wouldsay that there are still limits on what acceptable values would be. The output signal in this example isthe actual ship heading angle (t). Each of thefirst three designs have excessive overshoot, and systemTCL2(s) also has an excessive settling time. Only system TCL4(s), thefinal design, has overshoot thatis close to being reasonable. Its settling time is also acceptable, and there are no oscillations in theresponse. If the overshoot of 18% is still considered to be too large, the design would need to be iteratedto provide additional phase margin, or perhaps the Derivative-on-Output-Only (DOO) implementation ofthe compensator could be used. For purposes of this example, we will assume that the overshoot andsettling time are both acceptable.

    3) Closed-Loop Step Response of the Control Signal: In any design, the response of the control signalu(t) should also be evaluated. The control signal is the output of the compensator. In this example, thecontrol signal is the commanded rudder angle rcom(t), expressed in degrees. The shapes of the controlsignals are similar to those of the output signal except for being inverted. The maximum absolute values(magnitudes) of the control signals should be checked. In any real system, the control signals will belimited in their peak values and in their rates of change. For a surface ship such as the one used in

  • 7/30/2019 Bode Plot Design.pdf

    10/15

    10

    0 200 400 600 800 10000

    0.5

    1

    1.5

    Time (s)

    YawAngle(deg)

    Uncompensated ClosedLoop Step Response

    PO = 43.8%, Ts

    = 451 sec

    0 200 400 600 800 10000

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    2

    Time (s)

    YawAngle(deg)

    Step Response with Kc

    = 7.331

    PO = 85.1%, Ts = 650 sec

    0 200 400 600 800 10000

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    Time (s)

    YawAngle(deg)

    Step Response With Lead Compensator

    PO = 61.6%, Ts

    = 169 sec

    0 200 400 600 800 10000

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    Time (s)

    YawAngle(deg)

    Step Response With Final LagLead Compensator

    PO = 18.9%, Ts

    = 183 sec

    Fig. 6. Closed-loop step responses of the output signal (t) for the four systems.

  • 7/30/2019 Bode Plot Design.pdf

    11/15

    11

    this example, the rudder angle would be limited to 20 or 25. The maximum rate of change wouldprobably be in the range 35 deg/sec.

    The plots of the control signals when a unit step is applied at the reference input are shown in Fig. 7.The peak magnitude of the control signal for the lead compensator TCL3(s) is larger than could actuallybe achieved. From the data array for the signal, the maximum rate of change of the rudder angle isapproximately 5.1 deg/sec. Theother designs havepeak control signal magnitudes that are within bounds,but it should be remembered that for a linear system model, if the magnitude of the input signal is scaledby some factor, then the magnitude of all other signals in the system will be scaled by the same factor.

    The most interesting thing to note about the peak values of the various controls signals is that they areequal in each case to the compensator gain when the compensator is expressed in pole-zero format. Thiswill always betrue if the number of poles and zerosin the compensator are equal. For the uncompensatedcase, Gc(s) = 1, so that gain equals 1. For system TCL2(s), the compensator is Gc(s) = Kc. For thelead compensated design and the final lag-lead compensated design, the compensator transfer functionsin pole-zero format are given in (11) and (19), respectively. For each of these designs it can be seen that|u(t)|max equals the controller gain value.

    4) Closed-Loop Ramp Response of the Output Signal: The fact that the steady-stateerror specificationon the ramp response has been satisfied by all the designs except for the uncompensated system isknown because of the calculation of the gain

    Kc.Its value was determined specifically to reduce the

    uncompensated systems steady-state error down to the correct value. The ramp responses of the foursystems are shown in Fig. 8 to verify that we achieved what was desired. One point to note in checkingthe ramp response of a system in MATLAB. In many cases, the settling time of the ramp response ismuch longer than that of the step response. This is particularly true if the compensator has a lagor speciallag termin the design. Fromthe MATLAB data arrays at t = 1000 seconds, the steady-stateerrors for thefour systems are 14.6492(TCL1), 1.9939 (TCL2) , 2.0000 (TCL3) , and 2.0035 (TCL4) . This indicatesthat 1000 seconds is essentially steady-state for the ramp responses since the exact (infinite time) valuesof the errors are14.6618, 2, 2, and 2. Thelower right-hand graph in thefigure shows that all the designsexcept for the uncompensated system have identical responses in steady-state.

  • 7/30/2019 Bode Plot Design.pdf

    12/15

    12

    0 200 400 600 800 10000.5

    0

    0.5

    1

    Time (s)

    RudderAngle(deg)

    Uncompensated ClosedLoop Control Signal

    |u(t)|max

    = 1.000 deg

    0 200 400 600 800 10008

    6

    4

    2

    0

    2

    4

    6

    8

    Time (s)

    RudderAngle(deg)

    Control Signal with Kc

    = 7.331

    |u(t)|max

    = 7.331 deg

    0 200 400 600 800 100030

    20

    10

    0

    10

    20

    30

    40

    50

    Time (s)

    RudderAngle(deg)

    Control Signal With Lead Compensator

    |u(t)|max

    = 41.411 deg

    0 200 400 600 800 10002

    0

    2

    4

    6

    8

    10

    12

    Time (s)

    RudderAngle(deg)

    Control Signal With Final LagLead Compensator

    |u(t)|max

    = 10.445 deg

    Fig. 7. Closed-loop step responses of the control signal r(t) for the four systems.

  • 7/30/2019 Bode Plot Design.pdf

    13/15

    13

    0 100 200 300 400 500 600 700 800 900 10000

    100

    200

    300

    400

    500

    600

    700

    800

    900

    1000

    Time (s)

    YawA

    ngle(deg)

    ClosedLoop Ramp Responses

    0 50 100 150 2000

    20

    40

    60

    80

    100

    120

    140

    160

    180

    200

    Time (s)

    YawA

    ngle(deg)

    Ramp Responses, Zoomed View

    Uncompensated

    950 960 970 980 990 1000950

    955

    960

    965

    970

    975

    980

    985

    990

    995

    1000

    Time (s)

    YawA

    ngle(deg)

    Ramp Responses, Zoomed View

    Uncompensated

    Fig. 8. Closed-loop ramp responses of the output signal (t) for thefour systems.

  • 7/30/2019 Bode Plot Design.pdf

    14/15

    14

    E. Simulation of the SystemUsing Simulink

    To start Simulink, type simulink in MATLAB workspace In Simulink Library Browser, click on icon for New (or menu File/New/Model) to open a window

    for your model. Save your model with afilename of your choice. Extension for Simulink models is .mdl Drag and drop blocks from the Library Browser to your model window.

    Draw lines between blocks to establish connections (or click on first block, press and hold CTRLand click on second block). Double click on a block to enter data, change parameters, etc. In Simulink window, under Simulation/Configuration Parameters:

    Solver

    Stop time: set to the desired value Type: choose Fixed Step or Variable Step Solver: choose ODE3, ODE4, or ODE5 for Fixed Step; choose ODE45 for Variable Step FixedStep Size(fundamental samplesize): choosethetimebetweenconsecutivesamplepoints

    Data Import/Export

    Check boxes for Time and Output under Save to Workspace

    Uncheck box for Limit data points to last: under Save Options Select Array for Format under Save Options

    Locations of blocks in the Libraries

    Transfer functions: Continuous Summing Junctions: Math Operations Step, ramp, constant inputs: Sources Save to workspace: Sinks Multiport switches, multiplexers: Signal Routing

    Save to Workspace block

    Select Array under Save Format

    Limit data points to last: should be set to inf Step block

    Set step time (time that step is applied) to desired value Set final value (size of step) to desired value

    Ramp block

    Set start time to desired value Set slope to desired value

    Transfer Function blocks

    Numerator and denominator arrays can be entered directly into the block by double-clicking onthe block

    Names for numerator and denominator arrays can be entered instead; the arrays must be presentin the MATLAB workspace when the simulation is run.

    Summing Junctions: make sure you have the correct signs at the input terminals Running the simulation

    In MATLAB workspace, type sim(model filename) In Simulink

    Simulation/Start Press black triangle (like Play button on a CD player)

    Simulation data is stored in the MATLAB workspace in the array name that you used for the Saveto Workspace block (default name is simout).

  • 7/30/2019 Bode Plot Design.pdf

    15/15

    15

    uy_ou

    To Works

    Step

    Ramp

    num_p(s)

    den_p(s)

    Plant

    signal1

    signal2

    MultiportSwitch

    2

    Flag

    num_c(s)

    den_c(s)

    CompensatorAdd

    Fig. 9. Simulink diagram for thefinal design.

    Time values are stored in the MATL AB workspace in the array tout Simulations generally run faster if you store the data in the MATLAB workspace and then plot it

    rather than using a Scope in Simulink to display the data as the simulation runs.

    Fig. 9 is the Simulink diagram for this example. Either a step or a ramp input can be applied. Thevalue of the constant in the block labeled Flag is set to 1 for a ramp input or 2 for a step input. Thecontrol signal and the output signal arestored in the array uy_out; time is stored in the array tout (whichdoes not appear as a block in the diagram). Data in the arrays are overwritten each time you run thesimulation, so you have to rename the arrays in MATLAB after a simulation or change the name of thearray in the Save to Workspace block in Simulink.