This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280039: EPWM的CBC保护配置,为什么保护触发后,还会有零散的一个驱动打出。恢复的时候也是,不连续恢复

Part Number: TMS320F280039


您好!这是一个H桥变换器拓扑,目前做电池到母线的降压放电。二通道是BUCK的主控驱动。电压采样连接到比较器的输入上。目前保护触发阈值是50V

如图所示,增加电压输出到52V之后,驱动脉宽先变窄,然后过了几十us后,又打出一个不完整的驱动,请问这是为什么?

将电压下降到49V后,恢复波形如图:

驱动的恢复也不是连贯的,请问这是为什么呢?

配置代码:

/* configure DigitalCompare SubModule. */
void InitEPWMDigitalCompare(uint16_t Index)
{
    // select which trip sourse as the input of DC submodule.     TRIP4 -> DCAH  &  TRIP4 -> DCBH
    EPWM_enableDigitalCompareTripCombinationInput(EpwmBspCfg[Index].Base, EpwmBspCfg[Index].DCInputSig, EPWM_DC_TYPE_DCAH);
    EPWM_enableDigitalCompareTripCombinationInput(EpwmBspCfg[Index].Base, EpwmBspCfg[Index].DCInputSig, EPWM_DC_TYPE_DCBH);
    // Configure the DCA/DCB path to be unfiltered and asynchronous
    EPWM_setDigitalCompareEventSource(EpwmBspCfg[Index].Base, EPWM_DC_MODULE_A, EPWM_DC_EVENT_2, EPWM_DC_EVENT_SOURCE_ORIG_SIGNAL);
    EPWM_setDigitalCompareEventSource(EpwmBspCfg[Index].Base, EPWM_DC_MODULE_B, EPWM_DC_EVENT_2, EPWM_DC_EVENT_SOURCE_ORIG_SIGNAL);

}

/* configure TripZone SubModule */
void InitEPWMTripZone(uint16_t Index)
{
    EPWM_enableTripZoneSignals(EpwmBspCfg[Index].Base, (EPWM_TZ_SIGNAL_DCAEVT2 | EPWM_TZ_SIGNAL_DCBEVT2));// // 启用 ePWMx 的 Cycle-by-Cycle 保护
    // Trigger event when DCAH/DCBH is high
    EPWM_setTripZoneDigitalCompareEventCondition(EpwmBspCfg[Index].Base, EPWM_TZ_DC_OUTPUT_A2, EPWM_TZ_EVENT_DCXH_HIGH);    //留意是否为A2 10.17修改为A2
    EPWM_setTripZoneDigitalCompareEventCondition(EpwmBspCfg[Index].Base, EPWM_TZ_DC_OUTPUT_B2, EPWM_TZ_EVENT_DCXH_HIGH);    //同上

    EPWM_setTripZoneAction(EpwmBspCfg[Index].Base, EPWM_TZ_ACTION_EVENT_DCAEVT2, EPWM_TZ_ACTION_LOW);// Configure ePWM1A to output LOW on TZA TRIP
    EPWM_setTripZoneAction(EpwmBspCfg[Index].Base, EPWM_TZ_ACTION_EVENT_DCBEVT2, EPWM_TZ_ACTION_LOW);// Configure ePWM1B to output LOW on TZB TRIP

    EPWM_clearTripZoneFlag(EpwmBspCfg[Index].Base, (EPWM_TZ_INTERRUPT | EPWM_TZ_FLAG_CBC | EPWM_TZ_FLAG_DCAEVT2 | EPWM_TZ_FLAG_DCBEVT2));// Clear trip flags

    EPWM_enableTripZoneInterrupt(EpwmBspCfg[Index].Base, EPWM_TZ_INTERRUPT_CBC);// Enable TZ interrupt  不确定是否是EPWM_TZ_INTERRUPT_CBC
}

/* enable EPWM1 ~ EPWM4 TripZone Sub-Module */
void EnableEPWMTipZoneInterrupt(void)
{
    for(uint8_t Index = EPWM_BASE1; Index < EPWM_MOD_MAX; Index++)
    {
        EPWM_clearTripZoneFlag(EpwmBspCfg[Index].Base, (EPWM_TZ_INTERRUPT | EPWM_TZ_FLAG_CBC | EPWM_TZ_FLAG_DCAEVT2 | EPWM_TZ_FLAG_DCBEVT2));// Clear trip flags
        EPWM_enableTripZoneInterrupt(EpwmBspCfg[Index].Base, EPWM_TZ_INTERRUPT_CBC );// Enable TZ interrupt
    }
    Interrupt_enable(INT_EPWM4_TZ);
    Interrupt_enable(INT_EPWM2_TZ);
    Interrupt_enable(INT_EPWM7_TZ);
    Interrupt_enable(INT_EPWM1_TZ);
}

/* epwm7TZISR - ePWM7 TZ ISR */
__interrupt void epwm7TZISR(void)
{
 //   DisableEPWMTipZoneInterrupt();
    EPWM_clearTripZoneFlag(EPWM7_BASE, EPWM_TZ_INTERRUPT_CBC);// To re-enable the Interrupts
    Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP2);// Acknowledge this interrupt to receive more interrupts from group 2

}

/* InitCMPSSHigh - Function to configure the high comparator of CMPSSx */
void InitCMPSSHigh(uint16_t Idx)
{
    CMPSS_configHighComparator(CMPSScfg[Idx].Base, CMPSS_INSRC_DAC);// Configure the negative input signal to come from the DAC

    CMPSS_setDACValueHigh(CMPSScfg[Idx].Base, CMPSScfg[Idx].DACVal_H);// Set DAC value to specified point.

    // Configure digital filter.
    // clock prescale = SYSCLK/(7+1), sample window size = 6+1 samples, threshold value = 6+1.
    CMPSS_configFilterHigh(CMPSScfg[Idx].Base, CMPSScfg[Idx].ClkPrescale, CMPSScfg[Idx].SampWindow, CMPSScfg[Idx].SampWindow);
    CMPSS_initFilterHigh(CMPSScfg[Idx].Base);// Initialize the filter logic and start filtering

    // Configure the output signals.
    CMPSS_configOutputsHigh(CMPSScfg[Idx].Base, CMPSS_TRIP_ASYNC_COMP);// CTRIPH will be fed by the asynchronous comparator output.
    CMPSS_configOutputsHigh(CMPSScfg[Idx].Base, CMPSS_TRIP_FILTER);// CTRIPH will be fed by the filter output.
}