完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
void svgendq_calc(SVGENDQ *v)
[ _iq Va,Vb,Vc,t1,t2,t7; unsigned long 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->Ualpha); // 0.8660254 = sqrt(3)/2 Vc = _IQmpy(_IQ(-0.5),v->Ubeta) - _IQmpy(_IQ(0.8660254),v->Ualpha); // 0.8660254 = sqrt(3)/2 //Vb=(float)((double)(_IQ(-0.5)) *(double)(v->Ubeta) + (double)(_IQ(0.8660254)) *(double)(v->Ualpha)); // Vb = 1/2*(sqrt(3)*Ud - Uq) sqrt(3)/2=0.866 //Vc=(float)((double)(_IQ(-0.5)) *(double)(v->Ubeta) - (double)(_IQ(0.8660254)) *(double)(v->Ualpha)); // Vc = -1/2*(sqrt(3)Ud + Uq) // 60 degree Sector determination //if (Va>_IQ(0)) if (Va>0.0000001) Sector = 1; //if (Vb>_IQ(0)) if (Vb>0.0000001) Sector = Sector + 2; //if (Vc>_IQ(0)) if (Vc>0.0000001) 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->Ualpha); // Y = Vb //Vc = _IQmpy(_IQ(0.5),v->Ubeta) - _IQmpy(_IQ(0.8660254),v->Ualpha); // Z = Vc //Vb=_IQ(-0.5) * v->Ubeta + _IQ(0.8660254) * v->Ualpha; // Vb = 1/2*(sqrt(3)*Ud - Uq) sqrt(3)/2=0.866 //Vc=_IQ(-0.5) * v->Ubeta - _IQ(0.8660254) * v->Ualpha; if (Sector==0) // Sector 0: this is special case for (Ualpha,Ubeta) = (0,0) [ v->Ta = _IQ(0.5); v->Tb = _IQ(0.5); v->Tc = _IQ(0.5); ] if (Sector==1) // Sector 1: t1=Z and t2=Y (abc ---> Tb,Ta,Tc) 1 [ //t1 = Vc; //t2 = Vb; t1 = Vb; t2 = Vc; t7 = _IQ(1)-t1-t2; //v->Tc = 0; // tbon = (1-t1-t2)/2 //v->Ta = t1; // taon = tbon+t1 //v->Tb = t1+t2; // tcon = taon+t2 v->Tc = t7; // tbon = (1-t1-t2)/2 v->Ta = t1+t7; // taon = tbon+t1 v->Tb = t1+t2+t7; // tcon = taon+t2 ] else if (Sector==2) // Sector 2: t1=Y and t2=-X (abc ---> Ta,Tc,Tb) 5 [ //t1 = Vb; //t2 = -Va; t1 = -Va; t2 = Vb; t7 = _IQ(1)-t1-t2; //v->Tb = 0; // taon = (1-t1-t2)/2 //v->Tc = t1; // tcon = taon+t1 //v->Ta = t1+t2; // tbon = tcon+t2 v->Tb = t7; // taon = (1-t1-t2)/2 v->Tc = t1+t7; // tcon = taon+t1 v->Ta = t1+t2+t7; // tbon = tcon+t2 ] else if (Sector==3) // Sector 3: t1=-Z and t2=X (abc ---> Ta,Tb,Tc) 0 [ t1 = -Vc; t2 = Va; t7 = _IQ(1)-t1-t2; //v->Tc = 0; // taon = (1-t1-t2)/2 //v->Tb = t1; // tbon = taon+t1 //v->Ta = t1+t2; // tcon = tbon+t2 v->Tc = t7; // taon = (1-t1-t2)/2 v->Tb = t1+t7; // tbon = taon+t1 v->Ta = t1+t2+t7; ] else if (Sector==4) // Sector 4: t1=-X and t2=Z (abc ---> Tc,Tb,Ta) 3 [ //t1 = -Va; //t2 = Vc; t1 = Vc; t2 = -Va; t7 = _IQ(1)-t1-t2; //v->Ta = 0; // tcon = (1-t1-t2)/2 //v->Tb = t1; // tbon = tcon+t1 //v->Tc = t1+t2; // taon = tbon+t2 v->Ta = t7; // tcon = (1-t1-t2)/2 v->Tb = t1+t7; // tbon = tcon+t1 v->Tc = t1+t2+t7; // taon = tbon+t2 ] else if (Sector==5) // Sector 5: t1=X and t2=-Y (abc ---> Tb,Tc,Ta) 2 [ t1 = Va; t2 = -Vb; t7 = _IQ(1)-t1-t2; //v->Ta = 0; // tbon = (1-t1-t2)/2 //v->Tc = t1; // tcon = tbon+t1 //v->Tb = t1+t2; // taon = tcon+t2 v->Ta = t7; // tbon = (1-t1-t2)/2 v->Tc = t1+t7; // tcon = tbon+t1 v->Tb = t1+t2+t7; // taon = tcon+t2 ] else if (Sector==6) // Sector 6: t1=-Y and t2=-Z (abc ---> Tc,Ta,Tb) 4 [ t1 = -Vb; t2 = -Vc; t7 = _IQ(1)-t1-t2; //v->Tb = 0; // tcon = (1-t1-t2)/2 //v->Ta = t1; // taon = tcon+t1 //v->Tc = t1+t2; // tbon = taon+t2 v->Tb = t7; // tcon = (1-t1-t2)/2 v->Ta = t1+t7; // taon = tcon+t1 v->Tc = t1+t2+t7; // tbon = taon+t2 ] // Convert the unsigned GLOBAL_Q format (ranged (0,1)) -> signed GLOBAL_Q format (ranged (-1,1)) // v->Ta = _IQmpy(_IQ(2.0),(v->Ta-_IQ(0.5))); // v->Tb = _IQmpy(_IQ(2.0),(v->Tb-_IQ(0.5))); // v->Tc = _IQmpy(_IQ(2.0),(v->Tc-_IQ(0.5))); ] 我搞五段式SVPWM,一相电压恒低的情况下电机可以转了,但是一相电压恒高时不转。 大侠看看有什么问题。谢谢! |
|
相关推荐
8 个讨论
|
|
只有小组成员才能发言,加入小组>>
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
697 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
607 浏览 1 评论
对于多级放大电路板,在PCB布局中,电源摆放的位置应该注意什么?
1069 浏览 1 评论
763 浏览 0 评论
普中科技F28335开发板每次上电复位后数码管都会显示,如何熄灭它?
531 浏览 1 评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
175浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
136浏览 14评论
在使用3254进行录音的时候出现一个奇怪的现象,右声道有吱吱声,请教一下,是否是什么寄存器设置存在问题?
130浏览 13评论
TLV320芯片内部自带数字滤波功能,请问linein进来的模拟信号是否是先经过ADC的超采样?
126浏览 12评论
GD32F303RCT6配置PA4 ADC引脚,将PA2代替key功能,PA2连接时无法实现预期功能,为什么?
72浏览 10评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-30 23:10 , Processed in 0.875843 second(s), Total 56, Slave 49 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号