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.
1.在EPWM设置函数的闭环部分中,首先对于EPWM2模块的AQ动作进行了设置,将DCEVTFILT连接到T1,并设置了T1U和T1D动作事件。但随后又在TZ模块中将DCEVTFILT事件进行了设置,也同样设置了在事件到来时分别处于上升沿以及下降沿两种情况下EPWM的动作,为什么要这样做?
2.关于280049的TZ子模块,我找到的资料里并没有说明TZA或TZB可以结合TBCTR处于上升沿还是下降沿对EPWM的输出进行修正,为什么程序中结合了上升或下降沿?
3.最后又设置了TZA与TZB不动作,那之前设置的Advanced Trip Zone Action指的是其他什么吗,这个Advanced怎么理解。
// CTR = PRD , set to 1 // EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_A , EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD); // // CTR = ZERO , set to 0 // EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_A , EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO); // // CTR = T1U , set to 1 // EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_A , EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_T1_COUNT_UP); // // CTR = T1D , set to 0 // EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_A , EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_T1_COUNT_DOWN); //设置EPWMB // CTR = PRD , set to 1 // EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_B , EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD); // // CTR = ZERO , set to 0 // EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_B , EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO); // // CTR = T1U , set to 1 // EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_B , EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_T1_COUNT_UP); // // CTR = T1D , set to 0 // EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_B , EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_T1_COUNT_DOWN); // // Set DCEVTFILT as the trigger source for Channel A设置DCEVT经过滤波后的事件作为触发源 // EPWM_setActionQualifierT1TriggerSource(base2, EPWM_AQ_TRIGGER_EVENT_TRIG_DC_EVTFILT); // // Digital Compare and Comparator-X-Bar Configuration // Disable all the muxes first首先禁用trip5连接到MUX0上 // XBAR_enableEPWMMux(XBAR_TRIP5, 0x00);// // // Setup PWM TRIP 5 as the destination for CMPSS1H output (PCMC) // Trip5 will be active if CMPSSH is active // XBAR_setEPWMMuxConfig(XBAR_TRIP5, XBAR_EPWM_MUX00_CMPSS1_CTRIPH);//设置复用器输入为CMPSS1H XBAR_enableEPWMMux(XBAR_TRIP5, XBAR_MUX00);//启用复用器 // // DCAH = TRIP5 = Comparator 1H output // EPWM_selectDigitalCompareTripInput(base2, EPWM_DC_TRIP_TRIPIN5, EPWM_DC_TYPE_DCAH);//将trip5连接到DCAH上 // // DCAH = high // EPWM_setTripZoneDigitalCompareEventCondition(base2, EPWM_TZ_DC_OUTPUT_A2, EPWM_TZ_EVENT_DCXH_HIGH);//当输入为高时DCAH有效 // // Set the source for digital compare filter as DCAEVT2设置DCAH连接到DCAECT2并经过滤波输出 // EPWM_setDigitalCompareEventSource(base2, EPWM_DC_MODULE_A, EPWM_DC_EVENT_2, EPWM_DC_EVENT_SOURCE_FILT_SIGNAL); // // Allow ASYNC DCAEVT2 for trip zone actions设置DCAEVT2是否为同步信号 // EPWM_setDigitalCompareEventSyncMode(base2, EPWM_DC_MODULE_A, EPWM_DC_EVENT_2, EPWM_DC_EVENT_INPUT_NOT_SYNCED);//设置为不同步 // // Select DCAEVT2 cycle by cycle trip设置DCAEVT2为周期脱开信号 // EPWM_enableTripZoneSignals(base2, EPWM_TZ_SIGNAL_DCAEVT2); // // Event Filtering Configuration (inside digital compare)事件滤波设置 // Enable DC filter blanking window // EPWM_enableDigitalCompareBlankingWindow(base2);//使能消隐窗口 // // Set the signal source that will be filtered. // EPWM_setDigitalCompareFilterInput(base2, EPWM_DC_WINDOW_SOURCE_DCAEVT2);//使能滤波 // // Set the Digital Compare filter blanking pulse. // EPWM_setDigitalCompareBlankingEvent(base2, EPWM_DC_WINDOW_START_TBCTR_ZERO_PERIOD);//当计数为0或者PRD时进行消隐 // // Set the blanking window offset in TBCLK counts // EPWM_setDigitalCompareWindowOffset(base2, pwm_period_ticks - 5);//设置消隐窗口延时 // // Set the blanking window length in TBCLK counts // EPWM_setDigitalCompareWindowLength(base2, 10);//设置消隐窗口长度 // // Trip-zone event actions // What do we want the CBC events to do? // TZAx events can force EPWMxA // TZBx events can force EPWMxB // EPWM_setTripZoneAdvAction(base2, EPWM_TZ_ADV_ACTION_EVENT_TZA_D, EPWM_TZ_ADV_ACTION_LOW); EPWM_setTripZoneAdvAction(base2, EPWM_TZ_ADV_ACTION_EVENT_TZA_U, EPWM_TZ_ADV_ACTION_DISABLE); EPWM_setTripZoneAdvAction(base2, EPWM_TZ_ADV_ACTION_EVENT_TZB_U, EPWM_TZ_ADV_ACTION_LOW); EPWM_setTripZoneAdvAction(base2, EPWM_TZ_ADV_ACTION_EVENT_TZB_D, EPWM_TZ_ADV_ACTION_DISABLE); EPWM_setTripZoneAction(base2, EPWM_TZ_ACTION_EVENT_TZA, EPWM_TZ_ACTION_DISABLE); EPWM_setTripZoneAction(base2, EPWM_TZ_ACTION_EVENT_TZB, EPWM_TZ_ACTION_DISABLE); // // Select CBC clear event设置周期脱开事件标志位清除 // EPWM_selectCycleByCycleTripZoneClearEvent(base2, EPWM_TZ_CBC_PULSE_CLR_CNTR_ZERO_PERIOD);//计数为0以及PRD时清除 // // Clear any spurious trip清除脱开标志位 // EPWM_clearTripZoneFlag(base1, (EPWM_TZ_INTERRUPT_OST | EPWM_TZ_INTERRUPT_DCAEVT2 | EPWM_TZ_SIGNAL_DCBEVT1)); EPWM_clearTripZoneFlag(base2, (EPWM_TZ_INTERRUPT_OST | EPWM_TZ_INTERRUPT_DCAEVT2 | EPWM_TZ_SIGNAL_DCBEVT1));
主要是这一段代码
你好,你使用的例程具体是哪一个?能否说明一下文件路径?
.在EPWM设置函数的闭环部分中,首先对于EPWM2模块的AQ动作进行了设置,将DCEVTFILT连接到T1,并设置了T1U和T1D动作事件。但随后又在TZ模块中将DCEVTFILT事件进行了设置,也同样设置了在事件到来时分别处于上升沿以及下降沿两种情况下EPWM的动作,为什么要这样做?
参考下TRM第18.11.4.2章节: