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.

Generating symmetric pwm signal for three phase motor using ePWM on TMP570LC4357

Other Parts Discussed in Thread: HALCOGEN, MOTORWARE

Hi,

Could you give me a clue about finding detailed information on ePWM[1:7] blocks, integrated in TMP570LC4357?

I'd like to generate symmetric pwm signals for driving 3 phase H-bridge.


Best Regards: Szilárd

  • Hello Szilard,

    I've forwarded your question to one of our NHET experts. They should get back with you shortly.
  • Dear Chuck, thank you for the prompt answer!
    My question rather related to ePWM modules (not NHET).

    Best Regards: Szilárd Lovas
  • Hello Szilard,

      The userguide for the ePWM can be found in the LC4357 TRM chapter 35. You can also use the HalcoGen to configure the ePWM module which will save you a lot of time. HalcoGen also provides some epwm examples (example_epwm_adc.c and example_dtpwm_ecap.c) . Go to HalcoGen->Help->Help Topics->Examples you will find many examples to start with. Click on the example, it will show you step by step on how to configure ePWM module.

     

  • Hi Szilard,

    You need to only set up three of the ePWM modules, say ePWM[1:3] for driving a 3-ph H-bridge. As shown in the datasheet (SPNS195) the ePWM modules are all "chained" together by the synchronization signal (SYNCO --> SYNCI). That is, ePWM1 generates an output synch signal that is input to ePWM2. ePWM2 outputs a synch signal that is input to ePWM3, and so on.

    You can configure the individual ePWM modules to reload the counter when it receives the synch signal. You can change the preload value of the counter by configuring the phase value (TBPHS) for that ePWM module. This allows you to create a phase difference between the three ePWM outputs.

    You can refer the example code project available as part of the Hercules MotorWare. You can download the code projects here: processors.wiki.ti.com/.../RM46_CNCD

    Scroll down to the "Demo Software" section and then install the Hercules Motorware released first in August 2012, followed by the update that was released in Dec 2012.

    The examples implemented for the TMS570LS12x MCUs also use the ePWMx modules to drive the gate-driver IC. You can use this example as a reference to configure the ePWM modules on the LC4357.

    Regards,
    Sunil
  • Dear Sunil,

    I had to use ePWM[1, 3, 4] for generating Ua, Ub and Uc, because of pin M1 (GIOA[7]/N2HET2[6]/ePWM2A) is used by S1 push button on HDK board. As I expect, get the sync pulse trought ePWM[2] block would work without actually using it.

    I could generate symmetric pwm pulse with the following code (HALCoGen is used for configuring times, delays etc..):

    void main(void)
    {
    /* USER CODE BEGIN (3) */
        etpwmActionQualConfig_t xActionQualConfigA, xActionQualConfigB;

        gioInit();
        gioSetDirection(hetPORT1, 0xAA07C821);
        
        xActionQualConfigA.CtrEqCmpADown_Action = ActionQual_Set;
        xActionQualConfigA.CtrEqCmpAUp_Action = ActionQual_Clear;
        xActionQualConfigA.CtrEqCmpBDown_Action = ActionQual_Disabled;
        xActionQualConfigA.CtrEqCmpBUp_Action = ActionQual_Disabled;
        xActionQualConfigA.CtrEqPeriod_Action = ActionQual_Disabled;
        xActionQualConfigA.CtrEqZero_Action = ActionQual_Disabled;

        xActionQualConfigB.CtrEqCmpADown_Action = ActionQual_Clear;
        xActionQualConfigB.CtrEqCmpAUp_Action = ActionQual_Set;
        xActionQualConfigB.CtrEqCmpBDown_Action = ActionQual_Disabled;
        xActionQualConfigB.CtrEqCmpBUp_Action = ActionQual_Disabled;
        xActionQualConfigB.CtrEqPeriod_Action = ActionQual_Disabled;
        xActionQualConfigB.CtrEqZero_Action = ActionQual_Disabled;

        etpwmInit();

        etpwmSetCounterMode(etpwmREG1, CounterMode_UpDown);
        etpwmSetCounterMode(etpwmREG3, CounterMode_UpDown);
        etpwmSetCounterMode(etpwmREG4, CounterMode_UpDown);

        etpwmSetActionQualPwmA(etpwmREG1, xActionQualConfigA);
        etpwmSetActionQualPwmA(etpwmREG3, xActionQualConfigA);
        etpwmSetActionQualPwmA(etpwmREG4, xActionQualConfigA);

        etpwmSetActionQualPwmB(etpwmREG1, xActionQualConfigB);
        etpwmSetActionQualPwmB(etpwmREG3, xActionQualConfigB);
        etpwmSetActionQualPwmB(etpwmREG4, xActionQualConfigB);

        etpwmStartTBCLK();

    // ...

    }

    Can you recommend a method to check if the sync link works?

    Thank You for the detailed help very much!

    Best Regards: Szilárd

  • HI Charles!
    Thank You, the TRM chapter 35 helped me lot!
    Best Regards: Szilárd