controller3.m

来自「Matlab实现无刷直流电机控制系统建模仿真.zip」· M 代码 · 共 170 行

M
170
字号
function b=controller2(varargin)

save controllerb
fprintf('Welcome From Worldhitter')
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    fprintf('\nProvide The Following Data')
    V1=input('\nEnter The Value of First Secondary Voltage Volts) :')
    V2=input('\nEnter The Value of Second Secondary Voltage Volts) :')
    a=input('Enter The Value Of Delay Angle(Degrees):')
    R=input('Enter The Value Of Resistance :')
    fprintf('Wait For 2 Seconds')
    pause(2)
     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    o=menu('Click On What You want' ,'Rms Load Voltage For Range(0<Vo<V1)','Rms Load Voltage For Range(0<Vo<(V1+V2))','Rms Load Voltage For Range(V1<Vo<(V1+V2))','Rms Current Of Thyristor T1 And T2(Ir1) ','Rms Current Of Thyristor T3 And T4(Ir3) ','Rms Current Of Top Secondary Winding(I2)','Rms Current Of Bottom Secondary Winding Or Total Current Through T1,T2,T3,T4 (I1)','Volt Ampere Rating Of Primary Or Secondary (VA)','Load Power(Po)','Power Factor');
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     if(o == 1)
     fprintf('\nThe Magnitude Of  Voltge Is As Under')
     c=a*pi/180;
     b=pi-c+sin(2*c)/2;
     w=V1*sqrt(1/pi*b);
     Vo=abs(w)
     graphics3; %Function call for the graphics
     repeat %Function call for going back in the programme
     repeat(1)
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  elseif(o == 2)
     fprintf('\nThe Magnitude Of  Voltge Is As Under')
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     w=(V1+V2)*sqrt(1/pi*b)
     V=abs(w)
     graphics3(1);
     repeat %Function call for going back in the programme
     repeat(1)
    %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  elseif(o == 3)
     fprintf('\nThe Magnitude Of  Voltge Is As Under')
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     d=c-sin(2*c)/2;
     w=sqrt(V1^2/pi*d+(V1+V2)^2/pi*b)
     Vo=abs(w)
     graphics3(1,2);
     repeat %Function call for going back in the programme
     repeat(1)
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  elseif(o == 4)
     fprintf('\nThe Rms Output Current  Of Thyristor T1 And T2 Is As Under :')
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     w=(V1+V2)*sqrt(1/pi*b)*(1/(R*1.414));
     Ir1=abs(w)
     graphics3(1,2,3);
     repeat %Function call for going back in the programme
     repeat(1)
      %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   elseif(o == 5)
     fprintf('\nThe Rms Output Current  Of Thyristor T3 And T4 Is As Under :')
     c=a*3.14/180;  
     b=c-sin(2*c)/2;
     w=V1*sqrt(1/pi*b)*(1/(R*1.414));
     Ir3=abs(w)
     graphics3(1,2,3,4);
     repeat %Function call for going back in the programme
     repeat(1)   
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  elseif(o == 6)
     fprintf('\nThe Rms Current Of Bottom Winding Is As Under :')
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     e=(V1+V2)*sqrt(1/pi*b)*(1/(R*1.414));
     Ir1=abs(e);
     I2=sqrt(2)*Ir1
     graphics3(1,2,3,4,5)
     repeat %Function call for going back in the programme
     repeat(1)   
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  elseif(o == 7)
     fprintf('\nThe Rms Current Of Top Winding Is As Under :')
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     e=(V1+V2)*sqrt(1/pi*b)*(1/(R*1.414));
     Ir1=abs(e)
     
     c=a*3.14/180;  
     b=c-sin(2*c)/2;
     w=V1*sqrt(1/pi*b)*(1/(R*1.414));
     Ir3=abs(w)
     
     I1=sqrt((1.414*Ir1)^2+(1.414*Ir3)^2)
     graphics3(1,2,3,4,5,6)
     repeat %Function call for going back in the programme
     repeat(1)     
     
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^     
  elseif(o == 8)
     fprintf('\nThe Volt Ampere Rating Is As Under :')
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     e=(V1+V2)*sqrt(1/pi*b)*(1/(R*1.414));
     Ir1=abs(e);
     I2=sqrt(2)*Ir1;
     
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     e=(V1+V2)*sqrt(1/pi*b)*(1/(R*1.414));
     Ir1=abs(e);
     
     c=a*3.14/180;  
     b=c-sin(2*c)/2;
     w=V1*sqrt(1/pi*b)*(1/(R*1.414));
     Ir3=abs(w);
     
     I1=sqrt((1.414*Ir1)^2+(1.414*Ir3)^2);
     
     VA=V1*I1-V2*I2
     graphics3(1,2,3,4,5,6,7)
     repeat %Function call for going back in the programme
     repeat(1)
      %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^      
  elseif(o == 9)
     fprintf('\nThe Value Of Load Power Is As Under :')
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     d=c-sin(2*c)/2;
     w=sqrt(V1^2/pi*d+(V1+V2)^2/pi*b);
     Vo=abs(w);
     Po=V0^2/R
     graphics3(1,2,3,4,5,6,7,8)
     repeat %Function call for going back in the programme
     repeat(1)         
           %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^      
  elseif(o == 10)
     fprintf('\nThe Value Of Power Factor Is As Under :')
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     d=c-sin(2*c)/2;
     w=sqrt(V1^2/pi*d+(V1+V2)^2/pi*b);
     Vo=abs(w);
     Po=Vo^2/R;
     
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     e=(V1+V2)*sqrt(1/pi*b)*(1/(R*1.414));
     Ir1=abs(e);
     I2=sqrt(2)*Ir1;
     
     c=a*3.14/180;  
     b=pi-c+sin(2*c)/2;
     e=(V1+V2)*sqrt(1/pi*b)*(1/(R*1.414));
     Ir1=abs(e);
     
     c=a*3.14/180;  
     b=c-sin(2*c)/2;
     w=V1*sqrt(1/pi*b)*(1/(R*1.414));
     Ir3=abs(w);
     
     I1=sqrt((1.414*Ir1)^2+(1.414*Ir3)^2);
     
     VA=V1*I1-V2*I2;
     
     PF=Po/VA
     
     graphics3(1,2,3,4,5,6,7,8)
     repeat %Function call for going back in the programme
     repeat(1)       
     
     
  end
		

⌨️ 快捷键说明

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