- 积分
- 49
- 回帖
- 0
- 西莫币
-
- 贡献
-
- 威望
-
- 存款
-
- 阅读权限
- 5
- 最后登录
- 1970-1-1
该用户从未签到
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
void svgendq_calc(SVGENDQ *v)
{
_iq Va,Vb,Vc,t1,t2;
_iq sector = 0; /* sector is treated as Q0 - independently with global Q */
/* Inverse clarke transformation */
Va = v->Ubeta;
Vb = _IQmpy(_IQ(-0.5),v->Ubeta) + _IQmpy(_IQ(0.8660254),v->Ualfa); /* 0.8660254 = sqrt(3)/2 */
Vc = _IQmpy(_IQ(-0.5),v->Ubeta) - _IQmpy(_IQ(0.8660254),v->Ualfa); /* 0.8660254 = sqrt(3)/2 */
/* 60 degree sector determination */
if (Va>_IQ(0))
sector = 1;
if (Vb>_IQ(0))
sector = sector + 2;
if (Vc>_IQ(0))
sector = sector + 4;
/* X,Y,Z (Va,Vb,Vc) calculations */
Va = v->Ubeta; /* X = Va */
Vb = _IQmpy(_IQ(0.5),v->Ubeta) + _IQmpy(_IQ(0.8660254),v->Ualfa); /* Y = Vb */
Vc = _IQmpy(_IQ(0.5),v->Ubeta) - _IQmpy(_IQ(0.8660254),v->Ualfa); /* Z = Vc */
if (sector==1) /* sector 1: t1=Z and t2=Y (abc ---> Tb,Ta,Tc) */
{
t1 = Vc;
t2 = Vb;
v->Tb = _IQmpy(_IQ(0.5),(_IQ(1)-t1-t2)); /* tbon = (1-t1-t2)/2 */
v->Ta = v->Tb+t1; /* taon = tbon+t1 */
v->Tc = v->Ta+t2; /* tcon = taon+t2 */
}
else if (sector==2) /* sector 2: t1=Y and t2=-X (abc ---> Ta,Tc,Tb) */
{
t1 = Vb;
t2 = -Va;
v->Ta = _IQmpy(_IQ(0.5),(_IQ(1)-t1-t2)); /* taon = (1-t1-t2)/2 */
v->Tc = v->Ta+t1; /* tcon = taon+t1 */
v->Tb = v->Tc+t2; /* tbon = tcon+t2 */
}
else if (sector==3) /* sector 3: t1=-Z and t2=X (abc ---> Ta,Tb,Tc) */
{
t1 = -Vc;
t2 = Va;
v->Ta = _IQmpy(_IQ(0.5),(_IQ(1)-t1-t2)); /* taon = (1-t1-t2)/2 */
v->Tb = v->Ta+t1; /* tbon = taon+t1 */
v->Tc = v->Tb+t2; /* tcon = tbon+t2 */
}
else if (sector==4) /* sector 4: t1=-X and t2=Z (abc ---> Tc,Tb,Ta) */
{
t1 = -Va;
t2 = Vc;
v->Tc = _IQmpy(_IQ(0.5),(_IQ(1)-t1-t2)); /* tcon = (1-t1-t2)/2 */
v->Tb = v->Tc+t1; /* tbon = tcon+t1 */
v->Ta = v->Tb+t2; /* taon = tbon+t2 */
}
else if (sector==5) /* sector 5: t1=X and t2=-Y (abc ---> Tb,Tc,Ta) */
{
t1 = Va;
t2 = -Vb;
v->Tb = _IQmpy(_IQ(0.5),(_IQ(1)-t1-t2)); /* tbon = (1-t1-t2)/2 */
v->Tc = v->Tb+t1; /* tcon = tbon+t1 */
v->Ta = v->Tc+t2; /* taon = tcon+t2 */
}
else if (sector==6) /* sector 6: t1=-Y and t2=-Z (abc ---> Tc,Ta,Tb) */
{
t1 = -Vb;
t2 = -Vc;
v->Tc = _IQmpy(_IQ(0.5),(_IQ(1)-t1-t2)); /* tcon = (1-t1-t2)/2 */
v->Ta = v->Tc+t1; /* taon = tcon+t1 */
v->Tb = v->Ta+t2; /* tbon = taon+t2 */
}
v->Ta = _IQmpy(_IQ(2),(v->Ta- _IQ(0.5)));//_IQ(0.5)
v->Tb = _IQmpy(_IQ(2),(v->Tb- _IQ(0.5)));//_IQ(0.5)
v->Tc = _IQmpy(_IQ(2),(v->Tc- _IQ(0.5))); //_IQ(0.5)
}
程序判断区间克拉克逆变换时使用_IQ(-0.5),但是后来计算导通时间时使用_IQ(0.5),为什么?
我认为这个程序首先进行了两相坐标到三相坐标的变化后,根据三相坐标中Va、Vb、Vc的值来判断电压矢量在哪个区间。但是区间判断的过程及IGBT的导通时间确定没有看懂,请各位老师指教。谢谢! |
|