⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imcmenu.m

📁 Software for design and tuninig of SISO and MIMO contol systems
💻 M
📖 第 1 页 / 共 5 页
字号:
   [f]=crfig(100,100,340,200,'MSF GAIN Ksp & K ','w','none','off');
   
uicontrol(f,...
 'Style','text',...
 'Position',[20 160 100 25],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Left',...
 'String','MSF GAIN Ksp   = ');
uicontrol(f,...
 'Style','text',...
 'Position',[120 160 350 25],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Left',...
 'String',num2str(Ksp));
uicontrol(f,...
 'Style','text',...
 'Position',[20 135 300 25],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Left',...
 'String','MSF feedback gain matrix K  = ');
temp=num2str(K);
uicontrol(f,...
 'Style','edit',...
 'Position',[20 80 300 60],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Left',...
 'String',temp);
uicontrol(f,...
 'Style','text',...
 'Position',[20 50 150 25],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Left',...
 'String','Orignal filter time constant  =');
if degree_freedom==1
   temp=num2str(Epsilon{1,1}(1));
else
   temp=num2str(Epsilon{1,1}(2));
end
uicontrol(f,...
 'Style','text',...
 'Position',[170 50 350 25],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Left',...
 'String',temp);
uicontrol(f,...
 'Style','push',...
 'Position',[125 20 80 25],...
 'String','OK',...
 'Callback','close');
end
case 4400
% Find uncertainty bounds - 1 degree of freedom
%-------------------------------------------------------------
if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1}) | ...
   isempty(Xmnummt{1,1}) | isempty(Xmdenmt{1,1})
   errordlg('Not enough data entered.')
   return
end
[f]=crfig(50,50,350,150,'Find uncertainty bounds','w','none','off');
fun='imc1com';
uicontrol(f,...
 'Style','text',...
 'Position',[20 120 80 18],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Left',...
 'String','Norminal plant :');
uicontrol(f,...
 'Style','frame',...
 'Position',[100 117 240 24],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k');
uicontrol(f,...
 'Style','edit',...
 'Position',[105 120 230 18],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Center',...
 'String',xns,...
 'Callback','xns=get(gcbo,''String'');');
uicontrol(f,...
 'Style','text',...
 'Position',[20 90 150 18],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Left',...
 'String','Filter time constant :');
uicontrol(f,...
 'Style','text',...
 'Position',[20 45 300 36],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Center',...
 'String','( Calculate the uncertainty limits with the same % variations of uncertainty parameters. )');
uicontrol(f,...
 'Style','frame',...
 'Position',[130 87 190 24],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k');
uicontrol(f,...
 'Style','edit',...
 'Position',[135 90 180 18],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Center',...
 'String',num2str(Epsilon{1,1}(1)),...
 'Callback','Epsilon{1,1}(1)=str2num(get(gcbo,''String''));');
uicontrol(f,...
  'Style','push',...
  'Position',[85 20 80 25],...
  'String','OK',...
  'Callback',['JMENU=(4400);','cback']);
uicontrol(f,...
  'Style','push',...
  'Position',[185 20 80 25],...
  'String','Cancel',...
  'Callback','close');

case 4500
   % Tuning for lower bound &saturation 
   % ---------------------------------
   if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1}) | ...
         isempty(Xmnummt{1,1}) | isempty(Xmdenmt{1,1})
      errordlg('Not enough data entered.')
      return
   end
   
f=crfig(5,200,300,211,'Change parameters of process for tuning','w','none','off');
uicontrol(f,... 
'Style','text',...
'Position',[20 170 150 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Uncertain parameters:');
uicontrol(f,... 
'Style','text',...
'Position',[20 145 260 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Enter the values of x(1), x(2), ...');
uicontrol(f,...
'Style','frame',...
'Position',[20 117 260 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
temp='';
for i=1:length(x);
 temp=[temp num2str(x(i)) ' '];
end
uicontrol(f,...
'Style','edit',...
'Position',[25 120 250 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',temp,...
'Callback',['temp=str2num(get(gcbo,''String''));',...
'if length(temp) < length(vlb);',...
 'warndlg(''Not enough parameters entered.'');',...
'else;',...
  'if any(temp < vlb) | any(temp > vub)',...
  'warndlg(''Parameters not within bounds.'');',...
 'else x=temp; end;',...
'end']);
uicontrol(f,... 
'Style','text',...
'Position',[20 90 260 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Enter step-size of increasing e:');
uicontrol(f,...
'Style','frame',...
'Position',[20 57 60 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
uicontrol(f,...
'Style','edit',...
'Position',[25 60 50 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',0.1,...
'Callback','e_step=str2num(get(gcbo,''String''));');
uicontrol(f,...
'Style','push',...
'Position',[110 20 80 25],...
'String','OK',...
'Callback',['JMENU=4500;cback']);

case {4600,4650,5100,5200,5300}
   if maxrow > 1 |  maxcol > 1
      switch IMENU
      case 5100
         mimoMSFsimGUI;
      case 5200
      end
      return
    end
   % clear global
    switch get(MAIN_MENU(15),'Value')
	case 1 % 1Df
      if length(Epsilon{1,1}) > 1 
         Epsilon=Epsilon{1,1}(1);
      end
      if isempty(x) | length(x)~=length(vub)
         x=(vub+vlb)/2; % Midrange Process
      end
      if isempty(qnummt{1,1}) | (isempty(Xmnummt{1,1}) & isempty(Xmdenmt{1,1})) |...
            isempty(qdenmt{1,1}) | Epsilon{1,1} <= 0 
         errordlg('Wrong data');
      else
         [f]=crfig(250,300,280,100,'Filter time constant','w','none','off');
         uicontrol(f,...
            'Style','text',...
            'Position',[20 60 200 18],...
            'Backgroundcolor','w',...
            'Foregroundcolor','k',...
            'HorizontalAlignment','Left',...
            'String','Filter time constant:');
         uicontrol(f,...
            'Style','edit',...
            'Position',[170 60 100 18],...
            'Backgroundcolor','w',...
            'Foregroundcolor','k',...
            'String',num2str(Epsilon{1,1}(1)),...
            'Callback','Epsilon{1,1}(1)=str2num(get(gcbo,''String''));');
         uicontrol(f,...
            'Style','push',...
            'Position',[20 10 50 20],...
            'String','OK',...
            'Callback',['close;','JMENU=(IMENU);','cback']);
         uicontrol(f,...
            'Style','push',...
            'Position',[120 10 50 20],...
            'String',' Cancel',...
            'Callback','close');
         uicontrol(f,...
            'Style','push',...
            'Position',[210 10 50 20],...
            'String','Help',...
            'Callback','sayhelp(4260)'); 
      end
   case {2,3} % 2Df
      x=(vub+vlb)/2;
      if isempty(qnummt{1,1}) | isempty(Xmnummt{1,1}) | isempty(qdenmt{1,1}) |...
            isempty(Xmdenmt{1,1})  | any(Epsilon{1,1}<= 0) | length(Epsilon{1,1}) < 2
         warndlg('Wrong data for a PID controller.');
      else
         [f]=crfig(250,300,280,100,'Filter time constant','w','none','off');
         
         uicontrol(f,...
            'Style','text',...
            'Position',[20 60 200 18],...
            'Backgroundcolor','w',...
            'Foregroundcolor','k',...
            'HorizontalAlignment','Left',...
            'String','Filter time constant:');
         temp='';
         for i=1:length(Epsilon{1,1});
            temp=[temp num2str(Epsilon{1,1}(i)) ' '];
         end
         uicontrol(f,...
            'Style','edit',...
            'Position',[170 60 100 18],...
            'Backgroundcolor','w',...
            'Foregroundcolor','k',...
            'String',temp,...
            'Callback',['temp=str2num(get(gcbo,''String''));',...
               'if length(temp)~=2; errordlg(''Size does not match'');',...
               'else Epsilon{1,1}=temp; end;']);
         NMENU(20)=uicontrol(f,...
            'Style','push',...
            'Position',[20 10 50 20],...
            'String','OK',...
            'Callback',['close;','JMENU=(IMENU);','cback']);
         NMENU(21)=uicontrol(f,...
            'Style','push',...
            'Position',[120 10 50 20],...
            'String',' Cancel',...
            'Callback','close');
         NMENU(22)=uicontrol(f,...
            'Style','push',...
            'Position',[210 10 50 20],...
            'String','Help',...
            'Callback','sayhelp(4270)');
      end
   end
   
case {4700,4710,4720,4800,4810,4820,4830,4840,4850,4900,4910,4920,...
      4930,4940,4950}
   if isempty(vlb) | isempty(vub) | length(vlb)~=length(vub)
      errordlg('Not enough data entered');
      return
   end
   if maxrow > 1 | maxcol > 1
      mimo_freq;
      temp=round(64/maxrow/maxcol)-1;
      set(M1_handle(1),'Backgroundcolor',COLOR_MAP(temp,:));
      return
   end
   [f]=crfig(250,300,280,100,'Filter time constant','w','none','off');
uicontrol(f,...
 'Style','text',...
 'Position',[20 60 200 18],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'HorizontalAlignment','Left',...
 'String','Filter time constant:');
if (IMENU >= 4800 & degree_freedom==2)
   temp=num2str(Epsilon{1,1}(2));
else
   temp=num2str(Epsilon{1,1}(1));
end
uicontrol(f,...
 'Style','edit',...
 'Position',[170 60 100 18],...
 'Backgroundcolor','w',...
 'Foregroundcolor','k',...
 'String',temp,...
 'Callback',['if (degree_freedom==2 & IMENU>=4800),',...
 ' Epsilon{1,1}(2)=str2num(get(gcbo,''String''));',...
 'else Epsilon{1,1}(1)=str2num(get(gcbo,''String'')); end;']);
uicontrol(f,...
  'Style','push',...
  'Position',[20 10 50 20],...
  'String','OK',...
  'Callback',['close;','JMENU=(IMENU);','cback']);
uicontrol(f,...
  'Style','push',...
  'Position',[120 10 50 20],...
  'String',' Cancel',...
  'Callback','close');
uicontrol(f,...
 'Style','push',...
 'Position',[210 10 50 20],...
 'String','Help',...
 'Callback','sayhelp(IMENU)'); 

%IMC diagram
%-----------------------------------------------------------
case 7100
   if maxrow > 1
      open_system(['mimoMSF1df' num2str(maxrow)]);
      return
   end
if degree_freedom==1
   IMENU=7400; imcmenu;
else
   IMENU=7440; imcmenu;
end




%reget IMC diagram
%-----------------------------------------------------------
case 7150
%if degree_freedom==1
%!copy imcsp.m imcspst.m|
%else
%!copy imcsp2.m imcsp2st.m|
%end



%MSF diagram
%-----------------------------------------------------------
case 7200
   if maxrow > 1
      open_system(['mimoMSF1df' num2str(maxrow)]);
      return
   end
 if n_of_TF > 1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -