Part Number:TMS320F280049Other Parts Discussed in Thread:TIDM-DC-DC-BUCK
这是我的CMPSS
void CMPSS_Init(Uint16 base1,Uint16 u16DacHigh,Uint16 u16DacLow) {// Enable CMPSS1CMPSS_enableModule(base1);// Use VDDA as the reference for comparator DACsCMPSS_configDAC(base1,CMPSS_DACVAL_SYSCLK |CMPSS_DACREF_VDDA |CMPSS_DACSRC_SHDW);// Set DAC to H and L valuesCMPSS_setDACValueHigh(base1, u16DacHigh);// Make sure the asynchronous path compare high and low event// does not go to the OR gate with latched digital filter output// hence no additional parameter CMPSS_OR_ASYNC_OUT_W_FILT is passed// comparator oputput is "not" inverted for high compare eventCMPSS_configHighComparator(base1, CMPSS_INSRC_DAC);// Comparator output is inverted for for low compare eventCMPSS_configFilterHigh(base1, 2, 10, 7);// Reset filter logic & start filteringCMPSS_initFilterHigh(base1);// Configure CTRIPOUT pathCMPSS_configOutputsHigh(base1, CMPSS_TRIP_FILTER | CMPSS_TRIPOUT_FILTER);// Comparator hysteresis control , set to 2x typical valueCMPSS_setHysteresis(base1, 0);// Clear the latched comparator eventsCMPSS_clearFilterLatchHigh(base1); }
这是CBC模式配置代码
HWREG(EPWMXBAR_BASE + XBAR_O_TRIP4MUX0TO15CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP4MUX16TO31CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP4MUXENABLE) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP5MUX0TO15CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP5MUX16TO31CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP5MUXENABLE) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP7MUX0TO15CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP7MUX16TO31CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP7MUXENABLE) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP8MUX0TO15CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP8MUX16TO31CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP8MUXENABLE) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP9MUX0TO15CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP9MUX16TO31CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP9MUXENABLE) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP10MUX0TO15CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP10MUX16TO31CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP10MUXENABLE) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP11MUX0TO15CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP11MUX16TO31CFG) = 0x0000;HWREG(EPWMXBAR_BASE + XBAR_O_TRIP11MUXENABLE) = 0x0000;// CMPSS2//XBAR_EPWM_MUX00_CMPSS1_CTRIPHXBAR_setEPWMMuxConfig(XBAR_TRIP4, XBAR_EPWM_MUX00_CMPSS1_CTRIPH);// Enable Mux 0 to generate TRIP4XBAR_enableEPWMMux(XBAR_TRIP4, XBAR_MUX00);// CMPSS5//XBAR_EPWM_MUX08_CMPSS5_CTRIPHXBAR_setEPWMMuxConfig(XBAR_TRIP5, XBAR_EPWM_MUX08_CMPSS5_CTRIPH);// Enable Mux 0 to generate TRIP5XBAR_enableEPWMMux(XBAR_TRIP5, XBAR_MUX08);// Trip 4 is the input to the DCAHCOMPSELEPWM_selectDigitalCompareTripInput(EPWM1_BASE,EPWM_DC_TRIP_TRIPIN4,EPWM_DC_TYPE_DCAH);// Trigger event when DCBH is highEPWM_setTripZoneDigitalCompareEventCondition(EPWM1_BASE,EPWM_TZ_DC_OUTPUT_A2,EPWM_TZ_EVENT_DCXH_HIGH);// 设置DCB的路径为异步非滤波EPWM_setDigitalCompareEventSource(EPWM1_BASE,EPWM_DC_MODULE_A,EPWM_DC_EVENT_2,EPWM_DC_EVENT_SOURCE_ORIG_SIGNAL);//! 设置数字比较输入同步模式。EPWM_setDigitalCompareEventSyncMode(EPWM1_BASE,EPWM_DC_MODULE_A,EPWM_DC_EVENT_2,EPWM_DC_EVENT_INPUT_SYNCED);EPWM_selectDigitalCompareTripInput(EPWM6_BASE,EPWM_DC_TRIP_TRIPIN5,EPWM_DC_TYPE_DCAH);// Trigger event when DCBH is highEPWM_setTripZoneDigitalCompareEventCondition(EPWM6_BASE,EPWM_TZ_DC_OUTPUT_A2,EPWM_TZ_EVENT_DCXH_HIGH);// 设置DCB的路径为异步非滤波EPWM_setDigitalCompareEventSource(EPWM6_BASE,EPWM_DC_MODULE_A,EPWM_DC_EVENT_2,EPWM_DC_EVENT_SOURCE_ORIG_SIGNAL);//! 设置数字比较输入同步模式。EPWM_setDigitalCompareEventSyncMode(EPWM6_BASE,EPWM_DC_MODULE_A,EPWM_DC_EVENT_2,EPWM_DC_EVENT_INPUT_SYNCED);EPWM_enableTripZoneSignals(EPWM1_BASE,EPWM_TZ_SIGNAL_DCAEVT2);EPWM_enableTripZoneSignals(EPWM6_BASE,EPWM_TZ_SIGNAL_DCAEVT2);EPWM_setTripZoneAction(EPWM1_BASE, EPWM_TZ_ACTION_EVENT_TZA, EPWM_TZ_ACTION_LOW);EPWM_setTripZoneAction(EPWM6_BASE, EPWM_TZ_ACTION_EVENT_TZA, EPWM_TZ_ACTION_LOW);// 设置DCB CBCEPWM_clearTripZoneFlag(EPWM1_BASE, EPWM_TZ_FLAG_DCAEVT2);EPWM_clearTripZoneFlag(EPWM6_BASE, EPWM_TZ_FLAG_DCAEVT2);EPWM_clearTripZoneFlag(EPWM1_BASE, EPWM_TZ_FLAG_CBC);EPWM_clearTripZoneFlag(EPWM6_BASE, EPWM_TZ_FLAG_CBC);
这是加入CBC配置后开关频率由50K 180°交错 改变为25K 90°交错。波形图如下
Cherry Zhou:
您好我们已收到您的问题并升级到英文论坛寻求帮助,如有答复将尽快回复您。谢谢!
,
Cherry Zhou:
您好,为了更好地解决您的问题,您能否提供下您想要实现的 XBAR 和 CMPSS 配置的方框图? 此外,请问您期望看到的波形是什么?
,
SHENG YI:
XBAR的配置在CBC配置的代码中L31-41行中
下面这个是模拟端的配置
void ASysCtl_Init(void) {//CMPSS Number configure ---- CMPHP2 and CMPLP2ASysCtl_selectCMPHPMux(ASYSCTL_CMPHPMUX_SELECT_1,2);ASysCtl_selectCMPLPMux(ASYSCTL_CMPLPMUX_SELECT_1,2);ASysCtl_selectCMPHPMux(ASYSCTL_CMPHPMUX_SELECT_2,2);ASysCtl_selectCMPLPMux(ASYSCTL_CMPLPMUX_SELECT_2,2);ASysCtl_selectCMPHPMux(ASYSCTL_CMPHPMUX_SELECT_3,2);ASysCtl_selectCMPLPMux(ASYSCTL_CMPLPMUX_SELECT_3,2);ASysCtl_selectCMPHPMux(ASYSCTL_CMPHPMUX_SELECT_4,2);ASysCtl_selectCMPLPMux(ASYSCTL_CMPLPMUX_SELECT_4,2);ASysCtl_selectCMPHPMux(ASYSCTL_CMPHPMUX_SELECT_5,2);ASysCtl_selectCMPLPMux(ASYSCTL_CMPLPMUX_SELECT_5,2);ASysCtl_selectCMPHPMux(ASYSCTL_CMPHPMUX_SELECT_6,2);ASysCtl_selectCMPLPMux(ASYSCTL_CMPLPMUX_SELECT_6,2);ASysCtl_selectCMPHPMux(ASYSCTL_CMPHPMUX_SELECT_7,2);ASysCtl_selectCMPLPMux(ASYSCTL_CMPLPMUX_SELECT_7,2); }我想用280049的CBC功能来进行逐波限流,目前遇到的问题是进行CBC配置后,超过设定的比较值之后 开关频率由50K 降到了25K ,并且由原来的两路180°交错导通变成了90°交错。不知道是什么原因导致中间丢失了一个PWM波。
我希望使用CBC功能后开关频率是还是50K 两路180°交错的波形。
我不知道我的代码这样配置有没有问题,请帮忙看一看,谢谢!
,
Cherry Zhou:
您好,请问下您为什么希望 CBC 跳闸在每个周期对 PWM 波形进行操作? 您是在尝试实施某种峰值电流模式控制 (PCMC) 方案吗? 如果是的话,能否分享下拓扑和控制方案?
您可以参考 TIDM-DC-DC-BUCK参考设计,了解如何使用 C2000 CMPSS 、 XBAR 和 ePWM 模块实施 PCMC。 可从Digital Power SDK访问参考设计的软件。
,
SHENG YI:
你好,这个功能目前想用于180°交错BUCK拓扑中,开关频率50K;想用CBC功能做逐波限流;想用CBC实现:当当前周期电感电流大于设定阈值时,关闭PWM,下一个周期重新打开PWM。
TIDM-DC-DC-BUCK的PCMC的代码我也看过,我想请教一下我上传的关于CMPSS、XBAR和CBC配置代码有没有问题
,
Cherry Zhou:
好的感谢您提供的信息,因清明节假期,预计答复您的时间将会稍晚,敬请谅解!
,
Cherry Zhou:
您好,您看下以下参考设计:
https://www.ti.com/tool/TIDM-DC-DC-BUCK
以下示例软件您也可以参考下,都可以帮助您更好地了解这个套件:
https://www.ti.com/tool/C2000WARE-DIGITALPOWER-SDK
您可以看到我们是如何实现上述内容的,并相应地调整您的代码。