%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % rdrotmmf.m - Program plots the resulting normalized B-field % wave over two pole pitches for a round % rotor synchronous machine and gives the Fourier % spectrum for assessment of harmonic content. % Effect of rotor slot width is included. Total % harmonic distortion (THD)is calculated and % displayed to screen. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear; clf; p=2; % No. poles S2=20; % No. rotor slots bf=2; % Rotor slot width (in.) Dr=41; % Rotor diameter (in.) taur=pi*Dr/p; Wf=0.25*taur; nr=S2/2/p; gam2=(pi*Dr-p*Wf)/2/Dr/nr; lamr=Dr/p*gam2; nlamr=fix(gam2/2/pi*1024);nrmp=fix(bf/pi/Dr*1024); if nrmp/2~=fix(nrmp/2); nrmp=nrmp-1; end; % Even integer mag=0; k=1; for i=1:256 % Build first quarter of B-field wave if (i==(2*k-1)/2*nlamr)&(k