home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS2.DI$ / HIMAT_X2.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  4.9 KB  |  139 lines

  1.  echo on
  2. %
  3. %    HIMAT_X2
  4. %
  5. % It is assumed that you have just run 'himat_x1'
  6. %
  7. % This MATLAB script file is the second iteration of mu-synthesis 
  8. %   control design for the HIMAT pitch axis control problem.
  9.  
  10. % Second iteration of the mu-synthesis procedure. Design a 
  11. %   H-infinity control law for the new interconnection structure
  12. %   which includes the frequency varying d-scales.
  13.  
  14. [k2,g2,gf2]=hinfsyn(himat_ic2,2,2,.9,1.3,.05,2);
  15.  
  16. % k2 should have the same number of states as HIMAT_IC2
  17.  
  18. minfo(k2)
  19.  
  20. % A H-infinity control law has been designed which achieves an
  21. %  infinity norm of 1.10 for the new interconnection structure. 
  22. %  The new system includes the frequency varying d-scales 
  23. %  from the first iteration. To verify the gamma value, a frequency 
  24. %  response of the closed loop is done and the maximum singular value 
  25. %  of the closed-loop response across frequency is plotted. We will 
  26. %  also check that the closed-loop poles are stable. 
  27.  
  28.  pause;   % strike any key to continue
  29.  format short e
  30.  g2 =starp(himat_ic2,k2,2,2);
  31.  omega = logspace(0,4,16);
  32.  g2g = frsp(g2,omega);
  33.  rifd(spoles(g2))
  34.  pause;   % strike any key to continue
  35.  g2pk=pkvnorm(g2g);
  36.  echo off
  37.  fprintf( '\n Final gamma %g, \n max singular value %g \n \n',gf2,g2pk)
  38.  echo on
  39.  
  40. %  Plot the maximum singular value across frequency
  41.  
  42.  g2gs=vsvd(g2g);
  43.  vplot('liv,m',g2gs)
  44.  echo off
  45.  title('Singular values plot of Second Iteration in mu-synthesis');
  46.  xlabel('Frequency (rad/s)');
  47.  ylabel('Magnitude');
  48.  grid;
  49.  pause;   % strike any key to continue
  50.  echo on
  51.  
  52. %  The control law can be analyzed using mu-analysis. The 
  53. %  closed-loop system, G2, has 4 inputs and 4 outputs. Again,
  54. %  the first two inputs and outputs correspond to the 
  55. %  uncertainty block, and the second two  correspond to the
  56. %  performance block. Therefore, we can define the uncertainty 
  57. %  block as a full 2x2 uncertainty block and the disturbance
  58. %  rejection block as a full 2x2 performance block. 
  59.  
  60.  pause;   % strike any key to continue
  61.  
  62. %  The mu-analysis program, MU, requires a frequency response
  63. %  or constant matrix and a block structure. In this example, 
  64. %  the frequency response is G2G and the block structure is 
  65. %  two, 2x2 full blocks, blk = [2 2; 2 2].
  66. %  MU returns the upper and lower bounds for mu in BNDS2,
  67. %  the frequency varying d-scales (DV2), the rational
  68. %  perturbation which destabilizes the closed-loop plant (RP2)
  69. %  and the sensitivity of mu to the d-scales (SENS2).
  70.  
  71.  [bnds2,dv2,sens2,rp2]=mu(g2g,blk);
  72.  
  73. %  plot the maximum singular value and mu on the same plot
  74. %    solid line - maximum singular value
  75. %    dashed line - mu
  76.  
  77.  both=sbs(sel(g2gs,1,1),bnds2);
  78.  vplot('liv,m',both)
  79.  echo off
  80.  title('Max. singular value and mu for the closed-loop system, g2');
  81.  xlabel('Frequency (rad/s)');
  82.  ylabel('Magnitude');
  83.  grid;
  84.  pause;   % strike any key to continue
  85.  echo on
  86.  
  87. % clear variables not used and pack the memory space due to
  88. %  the limitations on the Mac and PC's.
  89.  
  90. % clear rp2 g2g g2gs both 
  91.  pack
  92.  
  93. % The next step is the fit the d-scales which are output from
  94. %  the MU program. The MUSYNFIT function is used to fit 
  95. %  the d-scales for each individual block. Next we fit a new
  96. %  set of d-scales based on the new  H-infinity control law.
  97. %
  98. % MUSYNFIT requires the left d-scale from the previous 
  99. %  mu-synthesis iteration (DSYSL) to avoid increasing the states
  100. %  with each iteration. The d-scales from the mu-analysis 
  101. %  problem, DV2, and the sensitivity of the d-scales, SENS2,
  102. %  along with the block structure, number of controller 
  103. %  inputs and outputs. For the second iteration, DSYSL is used 
  104. %  for the left d-scale. Output from MUSYNFIT is the new left 
  105. %  d-scale and right d-scale to be multiplied into the 
  106. %  interconnection structure.
  107.  
  108.  pause;   % strike any key to continue
  109.  
  110. %  A 3rd order transfer function fit is recommended. This increases
  111. %   the number of states in the interconnection structure to
  112. %   3*(size of full block)*2. If one selects a different order
  113. %   for the d-scale weight, the gamma iteration will converge
  114. %   to a different value.
  115.  
  116.  [dsysl,dsysr]=musynfit(dsysl,dv2,sens2,blk,2,2);
  117.  
  118. % Now, wrap the new d-scales around the original 
  119. %   interconnection structure.
  120. %
  121. %          himat_ic3 = dsysl*himat_ic*(dsysr)^-1
  122.  
  123.  pause;   % strike any key to continue
  124.  himat_ic3=mmult(dsysl,himat_ic,minv(dsysr));
  125.  minfo(himat_ic3)
  126.  
  127. % Thus ends the second iteration of mu-synthesis. Notice that
  128. %  the new interconnection structure, HIMAT_IC3, has 20 states, 
  129. %  only 12 more states than the original interconnection 
  130. %  structure. The 12 states that were in the system from the 
  131. %  previous iteration have already been scaled into the
  132. %  d-scale fitting routine (Note, this is of course if you
  133. %  fit the d-scales using a 3rd order system.)
  134.  
  135. %  Type in 'himat_x3' to continue with the third iteration of
  136. %   mu-synthesis control design.
  137. %
  138. % Copyright MUSYN INC 1991,  All Rights Reserved
  139.