梦想在望 发表于 2011-4-21 17:50

请教:对磁链进行FFT分析问题

请教: 在分析电机瞬态场中,对绕组磁链进行谐波分析,用V12自带的FFT功能,其中Function 应选为:mag/ normalize/....还是什么都不选呢?见下图示:

forlink 发表于 2011-4-21 18:34

当然是mag和 normalize

梦想在望 发表于 2011-4-21 18:44

本帖最后由 梦想在望 于 2011-4-21 18:47 编辑

回复 2# forlink
但取mag或normalize 函数时,A,B,C的谐波分量完全一样,而A, B,C的磁链波形并不相同。见下图谐波分量数据:

hangang0214 发表于 2011-4-22 10:26

我一般都是用MATLAB进行谐波分析的。程序如下.....

hangang0214 发表于 2011-4-22 10:27

附件添加没成功
直接把程序粘贴如下:

clc
clear all;
format long;

Ns=936;
order=11;

%**********************read the position and flux density************************
fid=fopen('456.dat','r'); %open the original file
                              %'r'open file for reading
fidnew = fopen('b1.dat','w'); %creating and write the new file ,
                              %'w'open file for writing; discard existing contents
while feof(fid)==0 %feof=1 indecate the end of the file
tline = fgetl(fid); %read a line from the file

if ~ischar(tline),% "ischar" to see if tline is a character or not,is 1,no 0
    break,
end

temp=abs(tline); %absolute value of tline,put tline value into temps
Nlength=length(tline); % tline's length
isemptyline=0; %new variable "isemptyline"and it is 0

if Nlength==0 %check if the line is empty
isemptyline=1; %is an empty line,then isempty=1
end

allspace=0; %two new variables
isspace=0;%
%%%%%% a loop to check if the line is all spaces %%%%%%%%%%%%%%
for i=1:Nlength % a loop to check if the line is all spaces
T=temp(i);
if T==32 %
isspace=isspace+1;
end
if isspace==Nlength
allspace=1;
break
end
end
%%%%%-------------------------------------------%%%%%%%%
findalpha=0; %new variable,find english characters in the line
for j=1:Nlength
T=temp(j);
if ((T>=65)&(T>=90))|((T>=97)&(T>=122))
    findalpha=1;
    break;
end
end
%%%------if the line with true char,not all space,not empty line----%%%%%
if (~findalpha)&(~allspace)&(isemptyline==0) % three condition all true
fprintf(fidnew,tline);% write the tline to the new file B.dat
fprintf(fidnew,'\n'); % after write the line finish it with a "\n"
end

end
%%-------after read the file ,close the file-----%%
fclose(fid);
fclose(fidnew);
%%%--------------------------------------%%%
fid1=fopen('b1.dat','r');% new virable fid1,which store the data.
flux_position =fscanf(fid1,'%f',);% read at most M * N elements filling at least an
                                        % M-by-N matrix, in column order. N
                                        % can be inf, but not M.
                                        % %f means output/input a float
                                        % data
                                 
fclose(fid1); %close fid1
%********************************read file finish*****************************************
flux_position=flux_position';%turn the flux_position into a column matrix

pos=flux_position(:,1);% pos equals to the first line of tline

flux=flux_position(:,2);% flux equals to the secend line of tline

figure;% plot new figure
plot(pos,flux,'r');%plot origional waveform
hold on;
grid on;
fft1=fft(flux,Ns);% do the fft convert to the flux with the number of flux
j=0;% new variable
amp_har=zeros(1,(order+1)/2);% ZEROS(M,N) or ZEROS()
                           % is an M-by-N matrix of zeros.order=11
                           % build new zero matrix
for m=1:2:order    % m=1,3,5,7,9,11.....
    j=j+1;         
   fft1=fft(flux,Ns);   % details refers to 'help fft'
   
   fund_ele_front=fft1(m+1);    %if Ns=900,m=1 here is the 2th number
   fund_ele_back=fft1(Ns+1-m);   % here is the 899th number
   
   amp_har(j)=(abs(fund_ele_front))/Ns*2;%amplitude of the Harmonicm,(here is the point)
   fft1=0*fft1;      %turn the fft1 into 0
   fft1(m+1)=fund_ele_front;   
   fft1(Ns+1-m)=fund_ele_back;
   fft1=ifft(fft1,Ns);   % IFFT(X,N) is the N-point inverse discrete Fourier transform
   fft1=real(fft1);      % REAL   Complex real part
   
   if m==1            
       plot(pos,fft1,'b');
       X1=pos;
       Y1=fft1;
       %figure;
       %plot(X,Y,'m');
       %grid on;
   else
       plot(pos,fft1,'b');
   end
   hold on;
end

k=(1:2:order);
figure;
bar(k,amp_har,0.5);
grid on;
%peak_b=max(fft1)
%rms_b=0.707*peak_b

20061964 发表于 2011-5-3 16:15

回复 5# hangang0214


    谢谢楼上朋友,正是我想要的。今天找fft找了一天,找到各种方法,太感谢西莫论坛了

daigengzhi 发表于 2011-5-19 14:55

感谢分享 hangang0214 {:1_490:}

雅典娜的惊叹 发表于 2011-5-31 19:54

个人认为把数据倒出来用软件分析更方便。

bear19840625 发表于 2012-5-23 14:59

本帖最后由 bear19840625 于 2012-5-23 16:52 编辑

请教: 在分析电机瞬态场中,对绕组磁链进行谐波分析,用V12自带的FFT功能,其中Function 应选为:mag/ nor ...
梦想在望 发表于 2011-4-21 17:50 http://bbs.simol.cn/images/common/back.gif
刚开始我的V14.0在设置面板里面也找不到"domian"和"FFT Options“这两个功能的。
我后来发现了,原来我打开的那个工程文件正好没有这两个选项,要么就是灰色的点不动,但是后来打开其他工程文件都有这两个选项的,不知道maxwell v14.0为什么会有这种bug? 还有,后来我又发现只有在WIN7 64位机上才有这种Bug,我把工程文件拷贝到win xp系统的机子上又没有这个问题了(这样一个个地拷数据太慢了),相信很多哥们将横坐标整不成频率的原因也许就是这样吧,但是不知道maxwell v14.0为什么会有这种bug????
页: [1]
查看完整版本: 请教:对磁链进行FFT分析问题