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.

TMS28035 ePWM Trip Zone issue

I am using a Piccolo TMS28035 for a standard 3-phase brushless DC drive.  To achieve current limit, I have configured the comparators to open both the upper and the lower whenever current limit is exceeded.  I have my trip zone configured as such (with the other two phases essentially in redundant configuration.

//trip-zone conditions
//make comparator 1 triggers for ePWM1 A & B events
EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = 8; //DCAH input select -> (COMP1OUT)
EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL = 8; //DCBH input select -> (COMP1OUT)

//trigger digital compare event 2 for ePWM1 A and B when COMP1OUT goes HIGH
EPwm1Regs.TZDCSEL.bit.DCAEVT2 = 2; //DCAEVT2 -> (DCAH = high, DCAL = don't care)
EPwm1Regs.TZDCSEL.bit.DCBEVT2 = 2; //DCBEVT2 -> (DCBH = high, DCBL = don't care)
EPwm1Regs.DCACTL.bit.EVT2FRCSYNCSEL = 1; //event A source is asynchronous
EPwm1Regs.DCBCTL.bit.EVT2FRCSYNCSEL = 1; //event B source is asynchronous

//make events A and B cycle by cycle (DCxEVT1 - one shot/DCxEVT2 - CBC)
EPwm1Regs.TZSEL.bit.DCAEVT2 = 1; //enable DCAEVT2 as a CBC trip source
EPwm1Regs.TZSEL.bit.DCBEVT2 = 1; //enable DCBEVT2 as a CBC trip source

//force ePWM outputs A and B to the desired state on event trigger
EPwm1Regs.TZCTL.bit.DCAEVT2 = 2; //force ePWM1A to a LOW state
EPwm1Regs.TZCTL.bit.DCBEVT2 = 1; //force ePWM1B to a HIGH state

Based on the register settings, the ePWM1A should go LOW and ePWM1B should go HIGH whenever the output of comparator 1 goes HIGH.  However, it appears that the ePWM1 outputs simply go to high impedance when the comparator is activated.  Regardless of what I set DCAEVT2 and DCBEVT2 to, the result was always the same.  After debugging for some time I tried setting some of the other bits in the TZCTL register and found that changing the last two lines of code to 

EPwm1Regs.TZCTL.bit.TZA = 2; 
EPwm1Regs.TZCTL.bit.TZB = 1; 

gave me the results I wanted (i.e.  ePWM1A = LOW and ePWM1B = HIGH).  Am I missing something here or are TZA and TZB in the TZCTL register actually controlling DCAEVT2 and DCBEVT2?  I also verified all the register values in debug mode so I know they weren't being changed somewhere else in my code.

 

  • Hello,

    When using CBC or OST actions of the trip-zone sub-module, you must select the output actions using TZCTL[TZA] and TZCTL[TZB].

    The TZCTL[DCxEVTy] bits allow you to effect the output only while the trip input (i.e. comparator output) is active. 

    I hope this helps.

    Hrishi

  • thanks for the reply, but the comparator was active when I was testing the chip with the TZCTL[DCxEVTy] bits configured and the outputs only went to HIGH Z.  

  • I encouter the same problem, TZA+TZB seem to be exchanged with DCAEVT2 and DCBEVT2.

    Comparator 2 is active and is coupled to DCAEVT2 and DCBEVT2 (action is TZ_FORCE_LOW), but no reaction, however when TZA and TZB are made TZ_FORCE_LO instead of TZ_NO_CHANGE the output is forced low.

    Is this problem already sorted out?

     

    Regards

    Hans Fix

  • Hi Hans Fix,

    The naming of the TZCTL bits is a bit tricky.

    Using the TZCTL[DCxEVTx] bits will generate a sysclk by sysclk force of the PWM modules when an event occurs.

    TZCTL[TZA]/TZCTL[TZB] will enable the CBC or OSHT paths.  I believe this is what you want and is also doing what you want.

    The attached diagram may help to clarify things.
    (it is just a modified version of the diagram found in Piccolo '02x, '03x and '06x ePWM User's Guides/TRMs).

    Hopefully this helps.


    Thank you,
    Brett

  • Thanks, I assumed already something like this. But it is good to get a confirmation.

    Will spruge9e be updated soon?

     

    regards

    Hans Fix

  • Hi,

    How is the Dead Band activated while configuring the Trip Zone output actions initiated by the Comparator ?

    The system works fine i.e. both RED and FED operate properly on EPWMxA and EPWMxB outputs in the AHC mode.

    The moment Trip Zone forces the EPWMxA and EPWMxB output, the FED no longer operates. How is the dead band introduced in such a case ?

    Thanks

    raman

  • Raman,

    On many of our devices (like the F2802x, F2803x, F2806x, F2833x) deadband will not be generated by trip events directly.  Workarounds, often utilizing spare PWM modules (with synchronization) and/or extra software, may be necessary if deadband is required on a trip.

    The way that the ePWM works is highlighted in the TRM.  In several places (ePWM UG or TRM - named differently depending on your device) there is a diagram can see the different ePWM submodules and how they connect.  For the device families I mention above, you will notice that the AQ submodule feeds the DB submodule which .... feeds the TZ submodule.  There is no connection from the TZ module back to the DB submodule.


    Thank you,
    Brett