Homework 2 Solution - AME335, Spring 23 Problem :[2 pt] The Aerotech AGS 5 i a linear motor driven XY poitioning ytem (ee attached product heet). A friend of mine, through careful experimentation, identified the following plant model for the X axi: ( 2 + 8.24 +.6 4) ( 2 + 25.6 +.24 5) P () = 738.42 ( +.57) ( 2 +.7 +.45 4 ) ( 2 + 42.5 +.46 5 ). (a)ue the Matlab GUI rltool or iotool and hand-calculation to deign a controller uch that the overhoot i < 2% and rie time i le than. ec for a tep reference ignal, e for a unit ramp reference i le than., the gain margin i greater than 6dB, and the cloed-loop bandwidth i greater than 3 rad/ec. Some pecification may already be met by the uncompenated ytem. General Procedure to do o: Ue the open-loop bode plot to determine the uncompenated phae margin Deign a controller K() that ha a low-frequency gain and phae margin uch that you can achieve the deign pecification. Etimate the ytem cloed-loop ytem bandwidth from the complementary enitivity function. Iterate on deign if neceary Diplay any plot and ueful inight ued in your controller deign. For time-domain plot, plot your reference ignal on the ame plot a the output. (b) A moothed tep input ignal i attached to the homework problem; 5mm move in econd, hold at 5mm for econd. With the moothed tep a a reference ignal, evaluate the controller performance. Doe your e calculation compare well with the ramped portion of the moothed tep imulation? Doe the error increae during the parabolic region of the moothed tep? Plot your reference ignal on the ame plot a the output. (c)change your reference ignal to a ine wave. Tet two different ine wave reference. One with a frequency 2 rad/ lower than your cloed loop bandwidth, one with a frequency 2 rad/ higher than your cloed loop bandwidth. Dicu your oberved relationhip between the frequency of a reference ignal, cloed-loop bandwidth, and the tracking error. Plot your reference ignal on the ame plot a the output. Solution: Plotting the ytem on io tool reveal that the ytem i untable. The ytem ha a gain margin of -5.58 db and a phae margin of -.866 degree. We will be tabilizing the ytem with a lead controller. For now we will look at the e for a ramp. From cloed loop repone Steady tate repone error i Y () R() = K()P () + K()P () E() = R() + K()P () e = lim + K()P () R() Want e <. for ramp input R() = 2 e = lim + K()P () 2 = lim + K()P ()
LetP () = ˆP () 2 Recap: If K() = K z + +, zα e = e = lim + K() ˆP ()) 2 = lim + K() ˆP ()) = lim + K() ˆP () = lim + K() ˆP () = lim K()(258.28) = 258.28 lim K() e = 258.28 lim K() <. 258.28 lim K + + Our final deign mut have a K>.49.[3 pt] = 258.28 K <. Next we deign uch that the rie time i about.5 econd and overhoot i le than 2. See Fig. Start with the uncompenated ytem K=. Aume a K() of the form K() = K z + +. zα A K=, the phae margin i φ m =.866. To achieve < 2%,ζ >.45 from our v. ζ map. Alo we know that ζ = φm, o we want φ m 45 o. We want to deign a lead controller with φ max to boot our phae margin. Allowing o extra, we want φ max = 55 o. From fig..3, α hould be. ω max hould be choen at the frequency where K()P () db = db. ω max = 34 rad/ec. ω max = z α, z=.75, αz = 7.5. Thi give a controller deign of.75 K() = + 7.5 + Fig.2 demontrate the t deign iteration. A you can ee, we did not quite reach the deired φ m = 45. We can make α larger to achieve thi. By moving the pole to higher frequencie, we achieve the deired φ m (ee Fig.3 ).75 K() = + 77 + Fig.4 demontrate that we now achieve the deired pecification.[5 pt] Tet with moothed tep input. Our deign appear to do quite well ince the deigned teady tate error i almot.. The error doe increae during the parabolic region.[ pt]. Smoothed tep performance Fig.5. Zoomed in region demontrate that the performance i wore in parabolic region, Fig.6. [5 pt] CL bandwidth i approximately 85 rad/ec. Tet a ine wave at 65 rad/ec Fig.7 and at 5 rad/ec Fig.8. [5 pt] If the frequency i le than the bandwidth, there i an increae in amplitude, however not that much. The
3 phae differ only by a little bit.if the frequency i greater than the bandwidth, the amplitude of the repone i decreaed and the phae differ quite a bit. [ pt] Overall the tracking error maller for frequencie inide the bandwidth compared to frequencie outide the bandwidth. Figure : Controller plot
Figure 2: Controller plot 4
Figure 3: Controller plot 5
6 Figure 4: tep repone Figure 5: moothed tep ignal
7 Figure 6: Zoomed in region of moothed tep ignal Figure 7: Sine wave of 65 rad/ec
Figure 8: Sine wave of 5 rad/ec 8
9 Bonu Problem 2: pt added to HW2 homework grade. For the ytem hown in Fig. 9, uppoe that: P () = 5 ( + ) (/5 + ). Deign a lead compenator K() o that the φ m > 4 uing Bode plot ketche. You mut how all your calculation to receive full credit. Once deigned by hand, verify and refine your deign uing Matlab. R() + - K() P() Y() Figure 9: Feedback Loop for Bonu Problem 2. Solution: Plot uncompenated ytem uing the tandard bode plotting procedure(fig. ) G(iω) db = at approximated 2 rad/ec. Here, our hand drawn bode plot tell u that we are untable, φ m o. Therefore, we need to increae φ m by 5 o to achieve a φ m of 4 o. Chooe φ max = 5 o + o = 6 o. From Fig..3, thi mean α = 2. Chooe ω max to be frequency where G(iω) db = db. ω max = z α for a lead controller [2t]. z = ω max α.5rad/ec p = α z = rad/ec Here we replot the change in phae and magnitude on the ame plot a Fig.. Notice that we did not achieve the φ m we deired. Plot in Matlab confirm thi(ee Fig.). The hand drawn plot give u a bai for further improvement. By moving the zero to -.8 and the pole to -36 we get the phae margin we deire (ee Fig. 2).
Figure : Bode plot [3pt uncompenated, 3pt compenated]
2 5 5 5 Root Locu Editor for Open Loop (OL) Open Loop Bode Editor for Open Loop (OL) 5 5 5 2 3 2 Bode Editor for Cloed Loop (CL) 5 45 G.M.: 4.8 db Freq: 7.58 rad/ Stable loop 2 9 35 8 8 225 P.M.: 6.7 deg Freq: 5.68 rad/ 36 27 2 3 2 2 4 Frequency (rad/) Frequency (rad/) Figure : Controller plot
2 5 5 Root Locu Editor for Open Loop (OL) Open Loop Bode Editor for Open Loop (OL) 4 2 2 4 6 8 5 5 Bode Editor for Cloed Loop (CL) 2 9 G.M.: 7.3 db Freq: 3.6 rad/ Stable loop 35 2 8 8 225 P.M.: 44. deg Freq: 4.32 rad/ 36 27 2 3 2 3 Frequency (rad/) Frequency (rad/) Figure 2: Controller plot [2pt]
3 Bonu Problem 3: pt added to HW2 homework grade, kernel of knowledge added to your brain. Thi problem i imilar to Problem. of Goodwine (with ome extra and without the typo). The tandard lead or lag compenator ha the general form: K() = z + p +. Find the frequency, ω max, at which K() ha a maximum phae lead or lag, φ max. Then calculate φ max. Your olution hould verify the equation jut prior to Eqn. (.3) and the phae lead calculation in Eqn. (.4). Solution: K(iω) i a function of frequency. We wih to find the frequency at which K(iω) i maximized and the value of that maximum point. To find the frequency of maximum phae (ω max ), we differentiate K(iω) with repect to ω and et equal to. d dω K(iω) = z Set d dω K(iω) = ω 2 K() = z + p + K(iω) = iω z + iω p + K(iω) = tan ω z ω tan p u = ω z, du dω = z dy y = a tan u, du = u 2 + dy dω = z ( ω z )2 + ( ω z )2 + p ( ω p )2 + = p(( ω p )2 + ) z(( ω z )2 + ) zp(( ω z )2 + )(( ω p )2 + ) [2pt] p + p ω2 z z = ω 2 ( p z ) = z p ω 2 = z p p = z p z p = pz z pz ω max = zp[3pt]
We next ubtitute ω max into K(iω) to olve for the maximum phae angle, φ max : 4 φ max = tan p z tan z p = tan p z p z + p z z p = tan 2 ( p z z p ) = tan p z 2 zp zp + 4 (p2 2pz + z 2 ) = 4 p2 + 2 pz + 4 z2 = 2 p2 + 2pz + z 2 = (p + z) 2 Therefore, φ max = θ = in 2 (p z) 2 (p + z) = in p z p + z [5pt]