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.

PMP23126: Software protections and ePWM TripZone Configuration at software

Part Number: PMP23126
Other Parts Discussed in Thread: C2000WARE

Hi,

I investigated PMP23126 software code.

At PSFB_HAL_setupBoardProtection function, I don't see base2 tripzone configuration.

    // What do we want the OST/CBC events to do?
    // TZA events can force EPWMxA
    // TZB events can force EPWMxB
    //
    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(base3, EPWM_TZ_ACTION_EVENT_TZA, EPWM_TZ_ACTION_LOW);
    EPWM_setTripZoneAction(base3, EPWM_TZ_ACTION_EVENT_TZB, EPWM_TZ_ACTION_LOW);

and when I check the PCMC==1 case, for ePWM base 2, I see following lines.

    //
    // 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);

1) Why didn't TI use following lines for protections? Please, explain in details.

    EPWM_setTripZoneAction(base2, EPWM_TZ_ACTION_EVENT_TZA, EPWM_TZ_ACTION_LOW);
    EPWM_setTripZoneAction(base2, EPWM_TZ_ACTION_EVENT_TZB, EPWM_TZ_ACTION_LOW);

2) When I set my own software and my own board in order to test protections, I observed that one of the ePWM2 (Output A or B) cannot have oneshot trip feature and continues to generate PWM signal at its output.

3) I don't think that I understood Figure 18-42 Trip-Zone Submodule Mode Control Logic. I cannot match driverlib functions and diagram to each other. Do you have suggestions?

Best regards.

  • Hi again,

    It is a general question for F28004x. Can I program any PWM channel e.g. ePWM2, to take both OST and CBC Trip for PCMC operation and force its outputs for both OST and CBC Trip?

    Best regards,

  • Hello Gokhan,

    1) Why didn't TI use following lines for protections? Please, explain in details.

    In the trip zone module, TZA/TZB can be generated from the CBC logic OR the OST logic. In PMP23126, PCMC is implemented using the CBC logic.

    TZA_D => PWMA output low

    TZA_U => do nothing

    TZB_U => PWMB output high

    TZB_U => do nothing

    If you were to also add these trip zone lines to implement OCP, then you would break things since the CBC path will generate TZA/TZB during normal PCMC operation.

    TZA (count direction UP or DOWN) ==> PWMA output low

    TZB (count direction UP or DOWN) ==> PWMA output low

    Does this make sense? I edited the diagram below to see if it help clarify this.

    2) When I set my own software and my own board in order to test protections, I observed that one of the ePWM2 (Output A or B) cannot have oneshot trip feature and continues to generate PWM signal at its output.

    See explanation above. You likely have confliction actions programmed in the trip zone module.

    3) I don't think that I understood Figure 18-42 Trip-Zone Submodule Mode Control Logic. I cannot match driverlib functions and diagram to each other. Do you have suggestions?

    See if this helps. This is trip-zone config for PCMC in PMP23126.

    This is the trip zone config for OCP.

  • Hello Gus,

    Thank you for your effort. I generally understood the points. I have more questions. Figure 18-42  is really confusing.

    1)  Then, for my below question, I cannot use OST and CBC Trip at the same time, right? I can route only one of CBC or OST trip right at below figure?

    Can I program any PWM channel e.g. ePWM2, to take both OST and CBC Trip for PCMC operation and force its outputs for both OST and CBC Trip?

    If you were to also add these trip zone lines to implement OCP, then you would break things since the CBC path will generate TZA/TZB during normal PCMC operation

    Can you please clarify more?

    2) Can I ALWAYS consider TZA and TZB as shown below? 

    3) In the software of PMP23126, TRIPIN4 is used as CBC trip. When I check the figure 18-42, I showed the alternative routes to trip PWM. As your explanation, I think path 2 is used to trip CBC, because you should assign TRIPIN4 as CBC Trip. But what about the path 1, which software lines are needed to use path 1? What are they related to?

    4) In which case or condition, I can use red box in below figure? There are so much feature that can be used. 

           4.a) Should I think of that I can use the features in red box whenever use trip zone logic in every trip case? Can they both be used for OSH and CBC Trips?

                   e.g. Can I use DCBEVT1U when I configure TRIPIN4 as OSH T?

                   e.g. Can I use DCBEVT1U when I configure TRIPIN4 as CBC T?

     

                4.b) I think following lines are related to redbox above, but when and how I can use it. Which routes are driven at figure 12-48 diagram if I need to write below lines? 

                       

        EPWM_setTripZoneAdvDigitalCompareActionA(EPWM3_BASE, EPWM_TZ_ADV_ACTION_EVENT_DCxEVT2_D,
                                                 EPWM_TZ_ADV_ACTION_DISABLE);
        EPWM_setTripZoneAdvDigitalCompareActionA(EPWM3_BASE, EPWM_TZ_ADV_ACTION_EVENT_DCxEVT2_U,
                                                 EPWM_TZ_ADV_ACTION_DISABLE);
        EPWM_setTripZoneAdvDigitalCompareActionA(EPWM3_BASE, EPWM_TZ_ADV_ACTION_EVENT_DCxEVT1_D,
                                                 EPWM_TZ_ADV_ACTION_DISABLE);
        EPWM_setTripZoneAdvDigitalCompareActionA(EPWM3_BASE, EPWM_TZ_ADV_ACTION_EVENT_DCxEVT1_U,
                                                 EPWM_TZ_ADV_ACTION_DISABLE);
        EPWM_setTripZoneAdvDigitalCompareActionB(EPWM3_BASE, EPWM_TZ_ADV_ACTION_EVENT_DCxEVT2_D,
                                                 EPWM_TZ_ADV_ACTION_DISABLE);
        EPWM_setTripZoneAdvDigitalCompareActionB(EPWM3_BASE, EPWM_TZ_ADV_ACTION_EVENT_DCxEVT2_U,
                                                 EPWM_TZ_ADV_ACTION_DISABLE);
        EPWM_setTripZoneAdvDigitalCompareActionB(EPWM3_BASE, EPWM_TZ_ADV_ACTION_EVENT_DCxEVT1_D,
                                                 EPWM_TZ_ADV_ACTION_DISABLE);
        EPWM_setTripZoneAdvDigitalCompareActionB(EPWM3_BASE, EPWM_TZ_ADV_ACTION_EVENT_DCxEVT1_U,
                                                 EPWM_TZ_ADV_ACTION_DISABLE);

                4.c) What is the difference between DCAEVT1/2U and TZAU? How can I distinguish?

    Thank you in advance.

  • 1)  Then, for my below question, I cannot use OST and CBC Trip at the same time, right? I can route only one of CBC or OST trip right at below figure?
    2) Can I ALWAYS consider TZA and TZB as shown below? 

    There is one important point here which maybe is not yet clear to you. Both the CBC logic and the OST logic generate TZ events. Think of these TZ events are the final output of that OR gate at the end of the CBC and OST paths. These TZ events are ORed together into a single TZ event which then goes to the trip logic. The trip logic is then configured to take an action on the PWMA and PWMB pins based on that TZ combined event. You cannot use OST and CBC trip at the same since you need conflicting PWMA/B actions on the same TZ event to implement PCMC and OCP

    Here is one conflict example:

    PCMC: TZB_U => PWMB output high (translation when TZ event is generated during count up, set PWMB output high)

    OST: TZB (count direction UP or DOWN) ==> PWMB output low (translation: when TZ event is generated, count direction don't care, set PWMB output low)

    Remember that during normal operation, the CBC logic will be constantly generating TZ events due to the PCMC implementation (i.e. CMPSS1 generates TRIPIN5, digital compare module generates DCAEVT2, CBC logic generates TZ event). The trip logic cannot distinguish between TZ events from OST or CBC, so which of the two conflicting actions should it carry out?

    3) In the software of PMP23126, TRIPIN4 is used as CBC trip. When I check the figure 18-42, I showed the alternative routes to trip PWM. As your explanation, I think path 2 is used to trip CBC, because you should assign TRIPIN4 as CBC Trip. But what about the path 1, which software lines are needed to use path 1? What are they related to?

    Ok, so let's think about that. CMPSS1 generates TRIPIN4, digital compare module then generates DCBEVT1. If you use path 1, you only have the option to take an action on PWMB pin since that DCBEVT1 signal doesn't go to the PWMA trip logic (do you see that in the figure?). The software designer for PMP23126 was smart because he used path 2 instead. Path 2 is actually the OST path not the CBC path (error in your markup). Here the DCBEVT1 event is used to generate the TZ event, which goes to both A and B trip logic and can then be used to affect the status of both PWMA and PWMB!

    4.b) I think following lines are related to redbox above, but when and how I can use it. Which routes are driven at figure 12-48 diagram if I need to write below lines? 
      4.c) What is the difference between DCAEVT1/2U and TZAU? How can I distinguish?

    The code configure the trip actions for PWMA and PWMB based on any of the inputs to the trip logic. The source for this code is available for your inspection. I would point you to the TRM to get the full details on all the trip actions.

    DCAVET1/2U: Digital compare A event 1 on counter up

    TZAU: CBC OR OST event on counter up, PWMA action

    I really hope the explanation above clarifies things a bit more for you!

  • Hi Gus,

    Thank you for answer. I understood nearly almost all of it. Thank you for your effort and time.

    Could you please just show me some code snippet that uses only DCAEVT1.force signal in path 1 above (not CBC T or not OSH T) to trip ePWMxA? I just cannot imagine that side. 

    Thank you in advance.

  • Gokhan,

    Are you familiar with our SYSCFG tool? If not, I'd highly recommend you give it a try. It can help you quickly generate C2000ware code for your peripheral configuration. 

    https://www.ti.com/video/series/C2000-SysConfig.html

    Here I used it to generate the trip action for different DCAEVT1 events.

    And here it generates this code in a file it creates called board.c

    If you want "advanced" trips (i.e. trips that act depending on the direction of the counter), you can do that too.

  • Sorry, last screen grab got cut off.

  • Hi Gus,

    I got the points. Thank you for your effort.