Dear champs,
I am asking this for our customer.
The user is trying to set a CBC protection for PWM1/2/3/4 for AC drop testing.
The user is modifying the codes in
void setupBoardProtection(uint32_t base1, uint32_t base2, uint32_t base3,
uint32_t base4, float current_limit,
float current_max_sense)
like below:
EPWM_enableTripZoneSignals(base1, EPWM_TZ_SIGNAL_DCAEVT2);
EPWM_enableTripZoneSignals(base2, EPWM_TZ_SIGNAL_DCAEVT2);
EPWM_enableTripZoneSignals(base3, EPWM_TZ_SIGNAL_DCAEVT2);
EPWM_enableTripZoneSignals(base4, EPWM_TZ_SIGNAL_DCAEVT2);
EPWM_setTripZoneAction(base1, EPWM_TZ_ACTION_EVENT_TZA,EPWM_TZ_ACTION_LOW);
EPWM_setTripZoneAction(base1, EPWM_TZ_ACTION_EVENT_TZB,EPWM_TZ_ACTION_LOW);
EPWM_setTripZoneAction(base2, EPWM_TZ_ACTION_EVENT_TZA,EPWM_TZ_ACTION_LOW);
EPWM_setTripZoneAction(base2, EPWM_TZ_ACTION_EVENT_TZB,EPWM_TZ_ACTION_LOW);
EPWM_setTripZoneAction(base3, EPWM_TZ_ACTION_EVENT_TZA,EPWM_TZ_ACTION_LOW);
EPWM_setTripZoneAction(base3, EPWM_TZ_ACTION_EVENT_TZB,EPWM_TZ_ACTION_LOW);
EPWM_setTripZoneAction(base4, EPWM_TZ_ACTION_EVENT_TZA,EPWM_TZ_ACTION_LOW);
EPWM_setTripZoneAction(base4, EPWM_TZ_ACTION_EVENT_TZB,EPWM_TZ_ACTION_LOW);
// Clear any spurious trip
EPWM_clearTripZoneFlag(base1,
(EPWM_TZ_INTERRUPT_OST|EPWM_TZ_INTERRUPT_DCAEVT2));
EPWM_clearTripZoneFlag(base2,
(EPWM_TZ_INTERRUPT_OST|EPWM_TZ_INTERRUPT_DCAEVT2));
EPWM_clearTripZoneFlag(base3,
(EPWM_TZ_INTERRUPT_OST|EPWM_TZ_INTERRUPT_DCAEVT2));
EPWM_clearTripZoneFlag(base4,
(EPWM_TZ_INTERRUPT_OST|EPWM_TZ_INTERRUPT_DCAEVT2));
But the result seems weird like below.
CH Red Iin (current to be triggered)
CH Yellow Slow PWM
CH Blue Fast PWM upper-side
CH Green Fast PWM lower-side
You can see when the input current goes much higher than the trigger point, the Fast PWM lower-side (Green) and Slow PWM (Yellow) are turned off PWM more slowly than expected, and Fast PWM updder-side (Green) is not turned off, which is not expected.
On the other hand, if the user changes to one-shot trip by EPWM_TZ_SIGNAL_DCAEVT1, then all the three PWM showed below are turned off immediately as expected.
So, our questions:
1. Is there anything wrong about the user's setting with CBC by EPWM_TZ_SIGNAL_DCAEVT2?
2. If (1) is correct, why the PWM could not be turned off immediately or even not be turned off?
Wayne Huang