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.

CCS/TIEVM-HV-1PH-DCAC: Inverter PWM switching control

Part Number: TIEVM-HV-1PH-DCAC

Tool/software: Code Composer Studio

I will try to code control using the TIEVM-HV-1PH-DCAC demo board.
In the figure below, Q1/Q2 is PWM switched at 20 kHz and Q3/Q4 is PWM switched at 60 Hz.
How do I synchronize Q3/Q4 to a PWM switching pulse on Q1/Q2?

Can I reverse Q3/Q4 when the ADC-sensored voltage is zero-crossed?

Thank you.

  • Theryare already programmed to be in-sync, see 

    setupInverterPWM(INV_PWM1_BASE,INV_PWM2_BASE,
    INV_PWM_PERIOD,INV_DEADBAND_PWM_COUNT,
    INV_DEADBAND_PWM_COUNT);


    ....


    // configure PWM 1 as master and Phase 2 as slaves and let it pass the sync in pulse from PWM1
    EPWM_disablePhaseShiftLoad(base1);
    EPWM_setSyncOutPulseMode(base1,EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);
    EPWM_enablePhaseShiftLoad(base2);
    EPWM_setSyncOutPulseMode(base2,EPWM_SYNC_OUT_PULSE_ON_SOFTWARE);
    EPWM_setPhaseShift(base2,2);
    EPWM_setCountModeAfterSync(base2, EPWM_COUNT_MODE_UP_AFTER_SYNC);

  • Thank you for your reply.

    My question is, the PWM frequency of Q3 and Q4 is 60 Hz.

    The image below is part of the source code provided by the demo board.

    In the highlight section, the PWM frequency for PWM2 is set to 20 kHz.

    Therefore, is Q3/Q4 inverted using software when the AC output voltage is zero-cross?

    Thank you.

  • Yes, please see

    updateInverterPWM(INV_PWM1_BASE,INV_PWM2_BASE, invDutyPU);


    if(duty>=0)
    {
    // CTR = CMPA@UP , set to 1
    EPWM_setActionQualifierAction(base1, EPWM_AQ_OUTPUT_A ,
    EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
    // CTR = CMPA@Down , toggle
    EPWM_setActionQualifierAction(base1, EPWM_AQ_OUTPUT_A ,
    EPWM_AQ_OUTPUT_TOGGLE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
    // CTR=0, clear to 0
    EPWM_setActionQualifierAction(base1, EPWM_AQ_OUTPUT_A ,
    EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
    // CTR = CMPA@Down , clear
    EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_A ,
    EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
    }
    else
    {
    // CTR = CMPA@UP , clear to 0
    EPWM_setActionQualifierAction(base1, EPWM_AQ_OUTPUT_A ,
    EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
    // CTR = CMPA@Down , toggle
    EPWM_setActionQualifierAction(base1, EPWM_AQ_OUTPUT_A ,
    EPWM_AQ_OUTPUT_TOGGLE, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
    // CTR=0, set to 1
    EPWM_setActionQualifierAction(base1, EPWM_AQ_OUTPUT_A ,
    EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
    // CTR = CMPA@Down , set
    EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_A ,
    EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
    }

    We use the duty command to change the modulation not directly the AC voltage.
  • I'll check.
    Thank you.