资源简介
双广义二阶积分及双dq锁相仿真模型(包含s函数及纯模型搭建两种方式)
代码片段和文件信息
function [sysx0strts] = oct_11(txuflag)
% x(1): phase angle between d axis and alfa axis
% x(2): phase angle between vector and alfa axis(0~2pi)
% x(3): time count (0~100)
% x(4): 计算作用时间的中间变量x
% x(5): 计算作用时间的中间变量y
% x(6): 计算作用时间的中间变量z
% x(7): IGBT switch time
% x(8): IGBT switch time
% x(9): 扇区
% x(10): 0 vector time IGBT(000 111)
% x(11): updown time count (0~5050~0)
% x(12): 速度 P controler
% x(13): 速度 I controler
% x(14): 零矢量作用时间,x(10) at x(4)=75 and at x(4)=0 send to x(10)
% x(15): Talfa
% x(16): Tbeta
% x(17): d axis current
% x(18): q axis current
% x(19): IGBT switch time T1
% x(20): IGBT switch time T2
% x(21): for first time control
% x(23): 扇区
% x(24): 速度软给定
% x(25): Id PI输出
% x(26): Iq PI输出
% x(27): Iq给定
% x(28):
% x(29):
% x(30):
% x(31):
% x(32):
% x(33):
% u(1~3): ia ib ic
% u(4): idc
% u(5~7): ua ub uc
% u(7):
% u(8):
% u(9):
switch flag
case 0
[sysx0strts]=mdlInitializeSizes;
case 2
sys=mdlUpdate(txu);
case 3
sys=mdlOutputs(txu);
case {1 4 9}
sys=[]; %mdlTerminate(txu);
otherwise
error([‘Unhandled flag = ‘num2str(flag)]);
end
function [sysx0strts]=mdlInitializeSizes
sizes = simsizes;
sizes.NumContStates = 0;
sizes.NumDiscStates = 122;
sizes.NumOutputs = 16;
sizes.NumInputs = 6;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1; % at least one sample time is needed
sys = simsizes(sizes);
x0 = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
str = [];
ts = [-1 0];
function sys=mdlUpdate(txu)
if t>0.00004
%x(121)=x(121)+1;
%if x(121)==200
Kiref=0.00010;%0.00015;%0.00015;%0.00005 0.00006
kpdc=0.8;%1;%10;%2.2;%2.2;%1.8;%1.6;%3;%2.3;%1.5;%2.5;%1.8;%1.5 1.2; 0.8; 0.6
kidc=0.000003;%0.00001;%0.00003;%0.0001;%0.00004;%0.01%0.0007;%0.0007;%0.0002;%0.002;%0.0021;%0.0008;%0.0003; 0.0001; 0.00005; 0.00005
kpdp=0.04;%0.3;
kidp=120;%1;
kpqp=0.04;%0.3;
kiqp=80;%1;
kpdn=0.1;
kidn=1;
kpqn=0.1;
kiqn=1;
dcmax3=40;
dcmax4=-40;
%kpiq=0.5;%1.0;0.5;0.8
%kiiq=0.0003;%0.003;0.0003;0.001
t1=100*pi*t+pi/2;%------------------------------------------%
delt=0.000001;
kdc1=1/(1+delt*2*pi*30);%低通滤波
kdc2=1/(1+delt*2*pi*300);
pimax1=365;
pimin1=-365;
kp=1.3;%1.5;
ki=1.3;%150;
kp1=1.5;
ki1=10;
w0=100*pi; %基频角频率
kcc=1.414*100;
d1=4+delt*2*kcc*w0+w0*w0*delt*delt;
a1=(2*kcc*w0*delt)/(d1);
a2=0;
a3=(-2*kcc*w0*delt)/(d1);
b1=(2*w0*w0*delt*delt-8)/(d1);
b2=(4-delt*2*kcc*w0+w0*w0*delt*delt)/(d1);
% a1=0.00315*0.3*10;
% a2=0;
% a3=-0.00315*0.3*10;
% b1=-1.93788;
% b2=1;
% a11=0.00711;
% a22=0.01422;
% a33=0.00711;
% b11=-1.82293;
% b22=0.83737;
kcc1=1.414*1;
d11=4+delt*2*kcc1*w0+w0*w0*delt*delt;
a11=(kcc
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 165420 2016-11-10 16:54 bupingheng.mdl
文件 6539 2016-11-10 13:00 suoxiang1.m
----------- --------- ---------- ----- ----
171959 2
评论
共有 条评论