SPRACY3 June 2021 F29H850TU , F29H859TU-Q1 , TMS320F280023C , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280040C-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280048C-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F28076 , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
Since grid-tied inverter needs to take care of the control during both positive and negative cycle, the EPWM signals should be swapped, together with related protection logic, at the zero cross point, which is handled in the PWM1_ISR as below. “negative_flag” and “positive_flag” can make sure the EPWM reconfiguration is implemented one time during the switching.
if(positive_cycle)
{
EPWM_setCounterCompareValue(EPWM1_BASE,EPWM_COUNTER_COMPARE_A,EPwm1_Cmpa);
if(negative_flag)
{
EPWM_setCounterCompareValue(EPWM2_BASE,EPWM_COUNTER_COMPARE_A,EPWM1_TBPRD);
EPWM_enableTripZoneSignals(EPWM1_BASE,EPWM_TZ_SIGNAL_DCAEVT2);
EPWM_disableTripZoneSignals(EPWM2_BASE,EPWM_TZ_SIGNAL_DCAEVT2);
negative_flag=0;
positive_flag=1;
}
}
else
{
EPWM_setCounterCompareValue(EPWM2_BASE,EPWM_COUNTER_COMPARE_A,EPwm1_Cmpa);
if(positive_flag)
{
EPWM_setCounterCompareValue(EPWM1_BASE,EPWM_COUNTER_COMPARE_A,EPWM1_TBPRD);
EPWM_disableTripZoneSignals(EPWM1_BASE,EPWM_TZ_SIGNAL_DCAEVT2);
EPWM_enableTripZoneSignals(EPWM2_BASE,EPWM_TZ_SIGNAL_DCAEVT2);
positive_flag =0;
negative_flag = 1;
}
}
Table 4-1 has summarized the different EPWM settings for positive and negative cycles. During the zero cross point, the switching for EPwm1_Cmpa ↔ TBPRD for CMPA should be taken care, where CMPA is directly related to the duty cycle provided by the control loop, that is CMPA=(1- duty cycle)* TBPRD. Besides, during positive cycle, the CBC protection should be disabled for EPWM2 and enabled for EPWM1, and vice versa for negative cycle operation.
PWM Signals | Basic Setting | Positive Cycle | Negative Cycle |
---|---|---|---|
EPWM1A-S1 | ↑ CAU ↓ ZRO, CAD |
1_CMPA=EPwm1_Cmpa Enable CBC |
1_CMPA= EPWM1_TBPRD Disable CBC |
EPWM2B-S2 | Active High Complementary to EPWM2A, with dead time=t1 | Disable CBC | Enable CBC |
EPWM1B-S3 | Active High Complementary to EPWM1A, with dead time=t1 | Enable CBC | Disable CBC |
EPWM2A-S4 | ↑ CAU ↓ ZRO, CAD |
2_CMPA=EPWM1_TBPRD Disable CBC |
2_CMPA=EPwm1_Cmpa Enable CBC |