📄 imcmenu.m
字号:
errordlg('MSF simulation does not support transfer function having 2 terms');
return
end
if degree_freedom==1
global time TimeScale st_size plot_setpoint plot_disturb plot_effort setpoint_Enable
global disturb_Enable effort_Enable plot_IMC plot_IMC_sat plot_MSF clflag clmap
global gh1 gh2 old_handle keep numPs denPs Pdelay numMs denMs Mdelay Md Setpoint
global Disturb denFs numFs numPd denPd Ksp K Mnt
if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1})
open_system('msf1df');
errordlg('Not enought data entered! Cannot simulate.');
else
if isempty(numMs)
msf1df_sim(0,Xpnummt{1,1},Xpdenmt{1,1},Xpdeadmt{1,1},Xmnummt{1,1},Xmdenmt{1,1},...
Xmdeadmt{1,1},Xpdnummt{1,1},Xpddenmt{1,1},qnummt{1,1},qdenmt{1,1},...
order{1,1},x,y,Epsilon{1,1}(1),satubs,satlbs,d_through_p,qnums{1,1},qdens{1,1});
end
open_system('msf1df');
temp='The system data for the simulation has been';
temp=strvcat(temp,'tempolary generated in the main work space.');
temp=strvcat(temp,'They will be removed if you later simulate by IMCTUNE.');
msgbox(temp);
end
else
global time TimeScale st_size plot_setpoint plot_disturb plot_effort setpoint_Enable
global disturb_Enable effort_Enable plot_IMC plot_IMC_sat plot_MSF clflag clmap
global gh1 gh2 old_handle keep numPs denPs Pdelay numMs denMs Mdelay Md Setpoint
global Disturb denFs numFs numPd denPd Ksp K Mnt Qdnum Qdden DrN NrD
if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1})
open_system('msf2df');
errordlg('Not enought data entered! Cannot simulate.');
else
if isempty(numMs)
[d_through_p]=msf2df_sim(1,Xpnummt{1,1},Xpdenmt{1,1},Xpdeadmt{1,1},Xmnummt{1,1},Xmdenmt{1,1},...
Xmdeadmt{1,1},Xpdnummt{1,1},Xpddenmt{1,1},qnummt{1,1},qdenmt{1,1},qfnummt{1,1},...
qfdenmt{1,1},order{1,1},F_order{1,1},x,y,Epsilon{1,1},satubs,satlbs,m{1,1},...
qf{1,1},qd{1,1},Tcanc,d_through_p,qnums{1,1},qdens{1,1});
end
open_system('msf2df');
temp='The system data for the simulation has been';
temp=strvcat(temp,'tempolary generated in the main work space.');
temp=strvcat(temp,'They will be removed if you later simulate by IMCTUNE.');
msgbox(temp);
end
end
%Initialize the MSF giagram
%--------------------------------------------------------------
case 7300
% !copy msf*.bak msf*.mdl
% PID SIMULINK diagram
%-------------------------------------------------------------
case 7400
if maxrow > 1
return
end
global K TauI TauD keps a1 a2 b1 b2 Alpha c1 c2 Kalf PID1lagden PID2lagden PIDrealden
global time st_size plot_setpoint plot_disturb plot_effort setpoint_Enable disturb_Enable
global effort_Enable plot_IMC plot_real_PID plot_1_lag_PID plot_2_lag_PID IMC_Enable
global real_PID_Enable lag1_PID_Enable lag2_PID_Enable old_handle keep
global XnumMs XdenMs mdeadx XnumPs XdenPs pdeadx numPd denPd Pdelay Mdelay numCs denCs
global numCs2 denCs2 Csnum Csden numMs denMs numPs denPs Setpoint Disturb Qdnum Qdden
if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1})
if n_of_TF > 1
if p_unstable
open_system('imc1dfu2');
else
open_system('imc1df2');
end
else
if p_unstable
open_system('imc1dfu');
else
open_system('imc1df');
end
end
errordlg('Not enought data entered! Cannot simulate.');
else
if isempty(numCs)
pid1df_sim(0,Xpnummt,Xpdenmt,Xpdeadmt,Xmnummt,Xmdenmt,Xmdeadmt,Xpdnummt,Xpddenmt,...
qnummt{1,1},qdenmt{1,1},order{1,1},x,y,Epsilon{1,1}(1),satubs,satlbs,d_through_p,n_of_TF);
end
if n_of_TF > 1
if p_unstable
open_system('imc1dfu2');
else
open_system('imc1df2');
end
else
if p_unstable
open_system('imc1dfu');
else
open_system('imc1df');
end
end
temp='The system data for the simulation has been';
temp=strvcat(temp,'tempolary generated in the main work space.');
temp=strvcat(temp,'They will be removed if you later simulate by IMCTUNE.');
msgbox(temp);
end
case 7410
if maxrow > 1
return
end
global K TauI TauD keps a1 a2 b1 b2 Alpha c1 c2 Kalf PID1lagden PID2lagden PIDrealden
global time st_size plot_setpoint plot_disturb plot_effort setpoint_Enable disturb_Enable
global effort_Enable plot_IMC plot_real_PID plot_1_lag_PID plot_2_lag_PID IMC_Enable
global real_PID_Enable lag1_PID_Enable lag2_PID_Enable old_handle keep
global XnumMs XdenMs mdeadx XnumPs XdenPs pdeadx numPd denPd Pdelay Mdelay numCs denCs
global numCs2 denCs2 Csnum Csden numMs denMs numPs denPs Setpoint Disturb Qdnum Qdden
if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1})
if n_of_TF > 1
open_system('realpid1df2');
else
open_system('realpid1df');
end
errordlg('Not enought data entered! Cannot simulate.');
else
if isempty(numCs)
pid1df_sim(0,Xpnummt,Xpdenmt,Xpdeadmt,Xmnummt,Xmdenmt,Xmdeadmt,Xpdnummt,Xpddenmt,...
qnummt{1,1},qdenmt{1,1},order{1,1},x,y,Epsilon{1,1}(1),satubs,satlbs,d_through_p,n_of_TF);
end
if n_of_TF > 1
open_system('realpid1df2');
else
open_system('realpid1df');
end
temp='The system data for the simulation has been';
temp=strvcat(temp,'tempolary generated in the main work space.');
temp=strvcat(temp,'They will be removed if you later simulate by IMCTUNE.');
msgbox(temp);
end
case 7420
if maxrow > 1
return
end
global K TauI TauD keps a1 a2 b1 b2 Alpha c1 c2 Kalf PID1lagden PID2lagden PIDrealden
global time st_size plot_setpoint plot_disturb plot_effort setpoint_Enable disturb_Enable
global effort_Enable plot_IMC plot_real_PID plot_1_lag_PID plot_2_lag_PID IMC_Enable
global real_PID_Enable lag1_PID_Enable lag2_PID_Enable old_handle keep
global XnumMs XdenMs mdeadx XnumPs XdenPs pdeadx numPd denPd Pdelay Mdelay numCs denCs
global numCs2 denCs2 Csnum Csden numMs denMs numPs denPs Setpoint Disturb Qdnum Qdden
if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1})
if n_of_TF > 1
open_system('pid1lag2');
else
open_system('pid1lag');
end
errordlg('Not enought data entered! Cannot simulate.');
else
if isempty(numCs)
pid1df_sim(0,Xpnummt,Xpdenmt,Xpdeadmt,Xmnummt,Xmdenmt,Xmdeadmt,Xpdnummt,Xpddenmt,...
qnummt{1,1},qdenmt{1,1},order{1,1},x,y,Epsilon{1,1}(1),satubs,satlbs,d_through_p,n_of_TF);
end
if n_of_TF > 1
open_system('pid1lag2');
else
open_system('pid1lag');
end
temp='The system data for the simulation has been';
temp=strvcat(temp,'tempolary generated in the main work space.');
temp=strvcat(temp,'They will be removed if you later simulate by IMCTUNE.');
msgbox(temp);
end
case 7430
if maxrow > 1
return
end
global K TauI TauD keps a1 a2 b1 b2 Alpha c1 c2 Kalf PID1lagden PID2lagden PIDrealden
global time st_size plot_setpoint plot_disturb plot_effort setpoint_Enable disturb_Enable
global effort_Enable plot_IMC plot_real_PID plot_1_lag_PID plot_2_lag_PID IMC_Enable
global real_PID_Enable lag1_PID_Enable lag2_PID_Enable old_handle keep
global XnumMs XdenMs mdeadx XnumPs XdenPs pdeadx numPd denPd Pdelay Mdelay numCs denCs
global numCs2 denCs2 Csnum Csden numMs denMs numPs denPs Setpoint Disturb Qdnum Qdden
if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1})
if n_of_TF > 1
open_system('pid2lag2');
else
open_system('pid2lag');
end
errordlg('Not enought data entered! Cannot simulate.');
else
if isempty(numCs)
pid1df_sim(0,Xpnummt,Xpdenmt,Xpdeadmt,Xmnummt,Xmdenmt,Xmdeadmt,Xpdnummt,Xpddenmt,...
qnummt{1,1},qdenmt{1,1},order{1,1},x,y,Epsilon{1,1}(1),satubs,satlbs,d_through_p,n_of_TF);
end
if n_of_TF > 1
open_system('pid2lag2');
else
open_system('pid2lag');
end
temp='The system data for the simulation has been';
temp=strvcat(temp,'tempolary generated in the main work space.');
temp=strvcat(temp,'They will be removed if you later simulate by IMCTUNE.');
msgbox(temp);
end
case 7440
if maxrow > 1
return
end
global K TauI TauD PID2lagden PID_FIden keps a2 a1 b2 b1 PID_APXden keep gh1 gh2
global PI_lagden PI_deng PID_realden KI time st_size plot_setpoint plot_disturb TauX
global plot_effort setpoint_Enable disturb_Enable effort_Enable plot_IMC PI_Enable
global plot_real_PID plot_lag_PID plot_FI plot_PID_APX plot_PI_lag plot_PI PI_lag_Enable
global IMC_Enable real_PID_Enable lag_PID_Enable FI_Enable PID_APX_Enable old_handle
global XnumMs XdenMs mdeadx XnumPs XdenPs pdeadx numPd denPd Pdelay Mdelay numCs denCs
global numCs2 denCs2 Csnum Csden numMs denMs numPs denPs Setpoint Disturb Qdnum Qdden
global Pre_fil_den Pre_fil_num Xmdeadx Xpdeadx
if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1})
if cascade
open_system('imccascade');
else
if n_of_TF > 1
if p_unstable
open_system('imc2dfu2');
else
open_system('imc2df2');
end
else
if p_unstable
open_system('imc2dfu');
else
open_system('imc2df');
end
end
end
errordlg('Not enought data entered! Cannot simulate.');
else
if isempty(numCs)
if cascade
pid_cascade(0,Xpnummt,Xpdenmt,Xpdeadmt,Xmnummt,Xmdenmt,Xmdeadmt,...
Xpdnummt{1,1},Xpddenmt{1,1},qnummt{1,1},qdenmt{1,1},qfnummt{1,1},...
qfdenmt{1,1},order{1,1},F_order{1,1},x,y,Epsilon{1,1},satubs,satlbs,m,...
qf{1,1},qd{1,1},Tcanc,d_through_p,n_of_TF);
else
[d_through_p]=pid2df_sim(0,Xpnummt,Xpdenmt,Xpdeadmt,Xmnummt,Xmdenmt,Xmdeadmt,...
Xpdnummt{1,1},Xpddenmt{1,1},qnummt{1,1},qdenmt{1,1},qfnummt{1,1},...
qfdenmt{1,1},order{1,1},F_order{1,1},x,y,Epsilon{1,1},satubs,satlbs,m{1,1},...
qf{1,1},qd{1,1},Tcanc,d_through_p,n_of_TF);
end
end
if cascade
open_system('imccascade');
else
if n_of_TF > 1
if p_unstable
open_system('imc2dfu2');
else
open_system('imc2df2');
end
else
if p_unstable
open_system('imc2dfu');
else
open_system('imc2df');
end
end
end
temp='The system data for the simulation has been';
temp=strvcat(temp,'tempolary generated in the main work space.');
temp=strvcat(temp,'They will be removed if you later simulate by IMCTUNE.');
msgbox(temp);
end
case 7450
if maxrow > 1
return
end
global K TauI TauD PID2lagden PID_FIden keps a2 a1 b2 b1 PID_APXden keep gh1 gh2
global PI_lagden PI_deng PID_realden KI time st_size plot_setpoint plot_disturb TauX
global plot_effort setpoint_Enable disturb_Enable effort_Enable plot_IMC PI_Enable TauY
global plot_real_PID plot_lag_PID plot_FI plot_PID_APX plot_PI_lag plot_PI PI_lag_Enable
global IMC_Enable real_PID_Enable lag_PID_Enable FI_Enable PID_APX_Enable old_handle
global XnumMs XdenMs mdeadx XnumPs XdenPs pdeadx numPd denPd Pdelay Mdelay numCs denCs
global numCs2 denCs2 Csnum Csden numMs denMs numPs denPs Setpoint Disturb Qdnum Qdden
global Pre_fil_den Pre_fil_num Xmdeadx Xpdeadx
if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1})
if cascade
open_system('realpidcas');
else
if n_of_TF > 1
open_system('realpid2df2');
else
open_system('realpid2df');
end
end
errordlg('Not enought data entered! Cannot simulate.');
else
if isempty(numCs)
if cascade
pid_cascade(0,Xpnummt,Xpdenmt,Xpdeadmt,Xmnummt,Xmdenmt,Xmdeadmt,...
Xpdnummt{1,1},Xpddenmt{1,1},qnummt{1,1},qdenmt{1,1},qfnummt{1,1},...
qfdenmt{1,1},order{1,1},F_order{1,1},x,y,Epsilon{1,1},satubs,satlbs,m,...
qf{1,1},qd{1,1},Tcanc,d_through_p,n_of_TF);
else
[d_through_p]=pid2df_sim(0,Xpnummt,Xpdenmt,Xpdeadmt,Xmnummt,Xmdenmt,Xmdeadmt,...
Xpdnummt{1,1},Xpddenmt{1,1},qnummt{1,1},qdenmt{1,1},qfnummt{1,1},...
qfdenmt{1,1},order{1,1},F_order{1,1},x,y,Epsilon{1,1},satubs,satlbs,m{1,1},...
qf{1,1},qd{1,1},Tcanc,d_through_p,n_of_TF);
end
end
if cascade
open_system('realpidcas');
else
if n_of_TF > 1
open_system('realpid2df2');
else
open_system('realpid2df');
end
end
temp='The system data for the simulation has been';
temp=strvcat(temp,'tempolary generated in the main work space.');
temp=strvcat(temp,'They will be removed if you later simulate by IMCTUNE.');
msgbox(temp);
end
case 7460
if maxrow > 1
return
end
global K TauI TauD PID2lagden PID_FIden keps a2 a1 b2 b1 PID_APXden keep gh1 gh2
global PI_lagden PI_deng PID_realden KI time st_size plot_setpoint plot_disturb TauX
global plot_effort setpoint_Enable disturb_Enable effort_Enable plot_IMC PI_Enable TauY
global plot_real_PID plot_lag_PID plot_FI plot_PID_APX plot_PI_lag plot_PI PI_lag_Enable
global IMC_Enable real_PID_Enable lag_PID_Enable FI_Enable PID_APX_Enable old_handle
global XnumMs XdenMs mdeadx XnumPs XdenPs pdeadx numPd denPd Pdelay Mdelay numCs denCs
global numCs2 denCs2 Csnum Csden numMs denMs numPs denPs Setpoint Disturb Qdnum Qdden
global Pre_fil_den Pre_fil_num Xmdeadx Xpdeadx
if isempty(Xpnummt{1,1}) | isempty(Xpdenmt{1,1})
if cascade
open_system('pid_apxcas2');
else
if n_of_TF > 1
open_system('pid_apx2');
else
open_system('pid_apx');
end
end
errordlg('Not enought data entered! Cannot simulate.');
else
if isempty(numCs)
if cascade
pid_cascade(0,Xpnummt,Xpdenmt,Xpdeadmt,Xmnummt,Xmdenmt,Xmdeadmt,...
Xpdnummt{1,1},Xpddenmt{1,1},qnummt{1,1},qdenmt{1,1},qfnummt{1,1},...
qfdenmt{1,1},order{1,1},F_order{1,1},x,y,Epsilon{1,1},satubs,satlbs,m,...
qf{1,1},qd{1,1},Tcanc,d_through_p,n_of_TF);
else
[d_through_p]=pid2df_sim(0,Xpnummt,Xpdenmt,Xpdeadmt,Xmnummt,Xmdenmt,Xmdeadmt,...
Xpdnummt{1,1},Xpddenmt{1,1},qnummt{1,1},qdenmt{1,1},qfnummt{1,1},...
qfdenmt{1,1},order{1,1},F_order{1,1},x,y,Epsilon{1,1},satubs,satlbs,m{1,1},...
qf{1,1},qd{1,1},Tcanc,d_through_p,n_of_TF);
end
end
if cascade
open_system('pid_apxcas2');
else
if n_of_TF > 1
open_system('pid_apx2');
else
open_system('pid_apx');
end
end
temp='The system data for the simulation has been';
temp=strvcat(temp,'tempolary generated in the main work space.');
temp=strvcat(temp,'They will be removed if you later simulate by IMCTUNE.');
msgbox(temp);
end
case 7470
if maxrow > 1
return
end
global K TauI TauD PID2lagden PID_FIden keps a2 a1 b2 b1 PID_APXden keep gh1 gh2
global PI_lagden PI_deng PID_realden KI time st_size plot_setpoint plot_disturb TauX
global plot_effort setpoint_Enable disturb_E
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -