Other Parts Discussed in Thread:TMS320F280049C如题,请求实现28035高精度移相例程或者配置,谢谢
Susan Yang:
抱歉,我们没有高精度移相的例程。在用户指南3.3.7 Practical Applications Using Phase Control Between PWM Modules中提到相关内容,您可以看一下
www.ti.com/…/sprui10.pdf
另外在该帖中有提到:
当将HRPWM与变频驱动器一起使用时,每次调整频率时都需要提供一个同步信号。不幸的是,这将在同步脉冲发生时引入抖动。F2803x设备上无法解决此问题。
在诸如TMS320F280049C这样的较新设备上,我们实现了新功能,可以使此操作不会发生抖动。
e2e.ti.com/…/ccs-tms320f28035-how-to-set-up-hrpwm-for-high-resolution-period-control-in-phase-shifted-system-jitter-issues
,
user6532300:
谢谢您的回复,我们可以定频运行,想1A和2A实现高精度移相,但是现在操作不了,我能吧我的程序发给您,帮忙看一下哪里有问题吗
,
Susan Yang:
user6532300 说:想1A和2A实现高精度移相,但是现在操作不了
能具体描述一下吗?
,
user6532300:
麻烦您帮忙看一下:我1A和2A的频率都是110k,0-180的移相范围就是0-236,这个调节对控制来说太粗了,想用高精度细分移相调节,
比如我算出来移相角是90.5,如果不用高精度,就只能移相90,另外的0.5就会被忽略导致控制精度丢失,为了这0.5能调节,我是这样配置的高精度移相:
PWM初始化部分:
void InitEPwm2Example()//滞后臂
{//// Setup TBCLK//EALLOW;EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW;EPwm2Regs.TBPRD = period1;// Set timer period
//EPwm2Regs.TBPHS.all = 0;EPwm2Regs.TBPHS.half.TBPHS = PHS;// Phase is 0EPwm2Regs.TBPHS.half.TBPHSHR =0;// Phase is 0EPwm2Regs.CMPA.half.CMPA=272;
//EPwm2Regs.CMPB = 100;EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP; // Count upEPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE;
EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN;
EPwm2Regs.TBCTR = 0x0000;// Clear counterEPwm2Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1;// Clock ratio to SYSCLKOUTEPwm2Regs.TBCTL.bit.CLKDIV = TB_DIV1;
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;//EPwm2Regs.AQCTLB.bit.CAU = AQ_CLEAR;
//EPwm2Regs.AQCTLB.bit.PRD = AQ_SET;EPwm2Regs.AQCTLB.bit.CAU = AQ_NO_ACTION;EPwm2Regs.AQCTLB.bit.PRD = AQ_NO_ACTION;
EPwm2Regs.DBCTL.bit.IN_MODE = 3;EPwm2Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE;
//EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC;EPwm2Regs.DBFED = db;//死区300nsEPwm2Regs.DBRED = db;EDIS;EALLOW;EPwm2Regs.HRCNFG.all = 0x0;EPwm2Regs.HRCNFG.bit.EDGMODE = HR_BEP;// MEP control on falling edgeEPwm2Regs.HRCNFG.bit.CTLMODE = HR_PHS;EPwm2Regs.HRCNFG.bit.HRLOAD= HR_CTR_ZERO;
EPwm2Regs.HRCNFG.bit.SWAPAB=0;EPwm2Regs.HRCNFG.bit.SELOUTB=0;EPwm2Regs.HRCNFG.bit.AUTOCONV = 0;EPwm2Regs.HRPCTL.bit.HRPE = 1;EPwm2Regs.HRPCTL.bit.TBPHSHRLOADE = 1;EDIS;
EALLOW;EPwm2Regs.TZCTL.bit.TZA = 2;EPwm2Regs.TZCTL.bit.TZB = 2;EDIS;
}应用部分:PID_Value.pidvalue = 100.5;EPwm2Regs.TBPHS.half.TBPHS =(Uint16) PID_Value.pidvalue;EPwm2Regs.TBPHS.half.TBPHSHR =( (Uint16) (( (PID_Value.pidvalue – EPwm2Regs.TBPHS.half.TBPHS)*93+0.5))) <<8;
,
Susan Yang:
已经回复您的私信,请看一下