Part Number:TMS320F280049C
目前我们在做电机类的相关底层配置。是否能配置如下所示的波形?
我目前大概了解了一下,也许不全面,希望得到TI比较好的方法。目前我们使用hrpwm4,hrpwm5,hrpwm6。谢谢!
如图所示,图一位示例,图二为示波器实测波形,2B和3B因探头没有多余通道就没有测。
Yale Li:
从第一张示例来看是通过ePWM模块的PC斩波得到的。
目前的方案是什么?
,
xianmow wang:
(1)目前我们的方案是有感BLDC电动工具,但是没有找到类似280049的有感BLDC电机驱动的工程。如果采用无感BLDC的280049工程再从2803x的有感BLDC移植过来这样可行?
(2)我已从《HVBLDC_Sensored》的2803x的设计文件<f2803xbldcpwm.h>看到类似这样的配置,移植过来用示波器测试还没有发出波形。只有A是高电平,B是低电平,不配成互补波形的话,需要配哪些寄存器?这个地方对我来说还是比较难,能否有280049有感bldc六步换相跑得起来的寄存器配置?
(3)我要做BLDC有感电动工具,建立比较好的工程,您有什么建议的?
(4)以下是移植过来的配置寄存器代码
EPwm4Regs.TBCTL.bit.SYNCOSEL = 0; EPwm5Regs.TBCTL.bit.SYNCOSEL = 0; EPwm6Regs.TBCTL.bit.SYNCOSEL = 0;
/* Allow each timer to be sync'ed*/
EPwm4Regs.TBCTL.bit.PHSEN = 1; EPwm5Regs.TBCTL.bit.PHSEN = 1; EPwm6Regs.TBCTL.bit.PHSEN = 1;
/* Init Timer-Base Period Register for EPWM4-EPWM6*/ EPwm4Regs.TBPRD = period;//v.PeriodMax; EPwm5Regs.TBPRD = period;//v.PeriodMax; EPwm6Regs.TBPRD = period;//v.PeriodMax;
/* Init Timer-Base Phase Register for EPWM4-EPWM6*/ EPwm4Regs.TBPHS.bit.TBPHS=0;//half.TBPHS = 0; EPwm5Regs.TBPHS.bit.TBPHS=0;//half.TBPHS = 0; EPwm6Regs.TBPHS.bit.TBPHS=0;//half.TBPHS = 0;
/* Init Timer-Base Control Register for EPWM4-EPWM6*/ EPwm4Regs.TBCTL.all = BLDCPWM_INIT_STATE; EPwm5Regs.TBCTL.all = BLDCPWM_INIT_STATE; EPwm6Regs.TBCTL.all = BLDCPWM_INIT_STATE;
/* Init Compare Control Register for EPWM4-EPWM6 */ EPwm4Regs.CMPCTL.all = BLDCPWM_CMPCTL_INIT_STATE; EPwm5Regs.CMPCTL.all = BLDCPWM_CMPCTL_INIT_STATE; EPwm6Regs.CMPCTL.all = BLDCPWM_CMPCTL_INIT_STATE;
/* Init Action Qualifier Output A Register for EPWM4-EPWM6*/ EPwm4Regs.AQCTLA.all = BLDCPWM_AQCTLA_INIT_STATE; EPwm5Regs.AQCTLA.all = BLDCPWM_AQCTLA_INIT_STATE; EPwm6Regs.AQCTLA.all = BLDCPWM_AQCTLA_INIT_STATE;
/* Init Dead-Band Generator Control Register for EPWM4-EPWM6*/ EPwm4Regs.DBCTL.all = BLDCPWM_DBCTL_INIT_STATE; EPwm5Regs.DBCTL.all = BLDCPWM_DBCTL_INIT_STATE; EPwm6Regs.DBCTL.all = BLDCPWM_DBCTL_INIT_STATE;
/* Init PWM Chopper Control Register for EPWM4-EPWM6*/ EPwm4Regs.PCCTL.all = BLDCPWM_PCCTL_INIT_STATE; EPwm5Regs.PCCTL.all = BLDCPWM_PCCTL_INIT_STATE; EPwm6Regs.PCCTL.all = BLDCPWM_PCCTL_INIT_STATE;
EALLOW; /* Enable EALLOW */
/* Setting six EPWM as primary output pins*/ GpioCtrlRegs.GPAMUX1.bit.GPIO6 = 1; /* EPWM4A pin*/ GpioCtrlRegs.GPAMUX1.bit.GPIO7 = 1; /* EPWM4B pin*/ GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 1; /* EPWM5A pin*/ GpioCtrlRegs.GPAMUX1.bit.GPIO9 = 1; /* EPWM5B pin*/ GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 1; /* EPWM6A pin*/ GpioCtrlRegs.GPAMUX1.bit.GPIO11 = 1; /* EPWM6B pin*/
EDIS; /* Disable EALLOW*/
这是A+B-,其他换相类似。
(*ePWM[ch4]).AQCSFRC.bit.CSFA = 0; /* Forcing disabledd on output A of EPWM4 */\ (*ePWM[ch4]).AQCTLA.bit.CAU = 2; /* Set high when CTR = CMPA on UP-count */\ (*ePWM[ch4]).AQCTLA.bit.ZRO = 1; /* Set low when CTR = Zero */\ (*ePWM[ch4]).CMPA.half.CMPA = (int16)(Tmp>>15); /* PWM signal on output A of EPWM4 (Q15 -> Q0) */\ (*ePWM[ch4).AQCSFRC.bit.CSFB = 1; /* Forcing a continuous Low on output B of EPWM4 */\ /* */\ (*ePWM[ch5]).AQCSFRC.bit.CSFA = 1; /* Forcing a continuous Low on output A of EPWM5 */\ (*ePWM[ch5]).AQCSFRC.bit.CSFB = 2; /* Forcing a continuous High on output B of EPWM5 */\ /* */\ (*ePWM[ch6]).AQCSFRC.bit.CSFA = 1; /* Forcing a continuous Low on output A of EPWM6 */\ (*ePWM[ch6]).AQCSFRC.bit.CSFB = 1; /* Forcing a continuous Low on output B of EPWM6
,
Yale Li:
1. 可以;
2.
xianmow wang 说:不配成互补波形的话,需要配哪些寄存器
这个实现的方法有很多,简单来说配置比较点(COMP)并配合相应的动作(AQ)即可;
xianmow wang 说:能否有280049有感bldc六步换相跑得起来的寄存器配置?
C2000实现的BLDC基本都是FOC;
3. 如果是用六步换相做电动工具,有更低成本的MSPM0G系列可以选择,还有集成了控制器的BLDC驱动器;
4.
xianmow wang 说:/* Init PWM Chopper Control Register for EPWM4-EPWM6*/ EPwm4Regs.PCCTL.all = BLDCPWM_PCCTL_INIT_STATE; EPwm5Regs.PCCTL.all = BLDCPWM_PCCTL_INIT_STATE; EPwm6Regs.PCCTL.all = BLDCPWM_PCCTL_INIT_STATE;
结合代码来看,目前的波形应该是通过PC斩波得到的。
,
xianmow wang:
(1)上管是PWM,下管普通GPIO,我配出波形,电机转动有刺耳声。
(2)MSPM0G这个方案TI有官方软硬件demo吗