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.

TMS320F280025C: EPWM Dead-band doesn't accurate

Part Number: TMS320F280025C
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I'm trying to set specific dead band 

working on HRPWM mode so dead band clock *2 rate system clock = 10 ns (100 MHz)
I want to set FED = 90nSec, so calculated the following
DBFED = FED/(2*TBCLK) = 90nSec/5nSec = 18 DBCYC
So I insert it to DBFED 

But with scope I measure ~80nSec DB:


And when I change DBFED to 20 it fit to relevant DB (Every DBCYC increase in 5nSec):



Why there is 2 DBCYC offset? how can I fix that?
I was working according https://www.ti.com/content/dam/videos/external-videos/9/3816841626001/6304743885001.mp4/subassets/epwm_dead-band_submodule_slides.pdf


Thanks!
Michael

  • I figured that it related to D.C., When start running code on D.C. = 0.1 I got the right dead band:

    When changing only CMPA that set new D.C. (without touching DB registers) so I got the DB down to 80nSec:

  • Also figure that CMPHR register is shifting DB for some reason:
    When CMPHR = 0X0100:



    When CMPHR = 0XFF00:



    And again, DBFED doesn't change at all.

  • Another thing that I figured, that in variable frequencies of PWM (variable TBPRD) I got the same problem:
    Working on freq. of 200KHz, TBPRD = 250, and DBRED DBFED like the following - 


    I got the following dead band 

    When changing freq to 300KHz TBPRD = 167  and DBRED DBFED remain the same -

    I got the following dead band 


    Help please :) 

  • Hi Michael,

    Thanks for all the information - could you also help to briefly summarize what the issue is currently? It seems the original post/question you already figured out; is the issue that the CMPAHR is not working as you'd expected? Or is it the deadband that is not as expected?

    Are you using other HR configurations (TBPRDHR, DeadBand HR, etc)? Or just CMPxHR to control duty cycle with high resolution?

    It would in general help if you could give some more context as to what waveform you are trying to achieve (or a diagram could be helpful). 

    Best Regards,

    Allison

  • Hi Allison,

    So the main issue is dead band that doesn't accurate all of the time, I set DBRED and FED according calculation on this article:
    https://www.ti.com/lit/an/sprad12a/sprad12a.pdf?ts=1713270874468 Chapter 5.
    And using active high complementary mode, and the measured DB isn't like the desired DB.
    I'm using all HRPWM capabilities TBPRDHR, DeadBand HR, duty. 
    I'm trying to achieve  HRPWM A,B signals when B is complementary to A with 90nSec deadband.
    I do get the required DB, but when start changing CMPAHR value for some reason DB shrink
    For example, when I set default value of CMPAHR to 0x0100 and CMPA I got DB of 90nSec:


    When I change CMPAHR to 0x8000 for example I got DB of 85nSec (see that DBRED DBFED doesn't change) :



    And even when I change CMPAHR  to 0X0A00 it got even worse (see that DBRED DBFED doesn't change):



    Why ? 

    Thanks!
    Michael

  • Could you help me understand this? When utilizing HRDB, the dead-band or dead-time is a result of EPWMA (CMPA). Therefore, modifying HRPWM (CMPAHR) alters the duty but doesn't adjust DB/HRDB again, which I discerned from this HRPWM System Interface.

    https://www.ti.com/lit/ug/spru924f/spru924f.pdf?ts=1713423306162&ref_url=https%253A%252F%252Fwww.google.com%252F page 11

    In essence, I can adjust HRDB in relation to EPWMA, but when I change HRPWM through the CMPAHR register, HRDB still corresponds to EPWMA and not HRPWM. This makes it appear "blind" to the full scale of CMPAHR, which is why I observed a 10nSec delta on dead time in my prior response.

  • Hi Michael,

    Could you share your PWM configurations/initialization? I'd like to know what other settings are here for context.

    Do you have half cycle clocking enabled? Are you also writing to CMPBHR? 

    Best Regards,

    Allison

  • Hi Allison,

    Sure, here is more details:
    Counter Mode - Up-down count mode

    AQ : 


    DB : 
    HRPWM:

    Any further info?

    Are you also writing to CMPBHR

    No, I'm updating only CMPA:CMPAHR

  • Hi Michael,

    Can you please share your full EPWM initialization and your sysconfig file so I can utilize the same EPWM/HRPWM configurations as well?

    Can you also please enable half cycle clocking, be sure to use autoconversion, and implement the same values for CMPBHR as CMPAHR? 

    Please also note that the DBRED and DBFED values must be greater than 3 to use high-resolution deadband.

    Best Regards,

    Allison

  • Hi Allison,

    Sorry for my late response.
    I'm adding configuration from board.c (C code instead of a lot screen shots)

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    HRPWM_setEmulationMode(PWM_BASE, EPWM_EMULATION_FREE_RUN);
    HRPWM_setClockPrescaler(PWM_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
    EPWM_setTimeBasePeriod(PWM_BASE, 250);
    HRPWM_setupEPWMLinks(PWM_BASE, EPWM_LINK_WITH_EPWM_1, EPWM_LINK_TBPRD);
    HRPWM_setTimeBaseCounter(PWM_BASE, 0);
    HRPWM_setTimeBaseCounterMode(PWM_BASE, EPWM_COUNTER_MODE_UP_DOWN);
    HRPWM_setCountModeAfterSync(PWM_BASE, EPWM_COUNT_MODE_UP_AFTER_SYNC);
    HRPWM_disablePhaseShiftLoad(PWM_BASE);
    HRPWM_setPhaseShift(PWM_BASE, 0);
    EPWM_setCounterCompareValue(PWM_BASE, EPWM_COUNTER_COMPARE_A, 250);
    HRPWM_setCounterCompareShadowLoadMode(PWM_BASE, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO_PERIOD);
    HRPWM_setupEPWMLinks(PWM_BASE, EPWM_LINK_WITH_EPWM_1, EPWM_LINK_COMP_A);
    EPWM_setCounterCompareValue(PWM_BASE, EPWM_COUNTER_COMPARE_B, 1);
    HRPWM_setCounterCompareShadowLoadMode(PWM_BASE, EPWM_COUNTER_COMPARE_B, EPWM_COMP_LOAD_ON_CNTR_ZERO_PERIOD);
    EPWM_setupEPWMLinks(PWM_BASE, EPWM_LINK_WITH_EPWM_1, EPWM_LINK_COMP_B);
    HRPWM_setActionQualifierShadowLoadMode(PWM_BASE, EPWM_ACTION_QUALIFIER_A, EPWM_AQ_LOAD_ON_CNTR_ZERO_PERIOD);
    HRPWM_setActionQualifierAction(PWM_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
    HRPWM_setActionQualifierAction(PWM_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);
    HRPWM_setActionQualifierAction(PWM_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
    HRPWM_setActionQualifierAction(PWM_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
    HRPWM_setActionQualifierAction(PWM_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_NO_CHANGE, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Michael,

    Thanks so much for sending this. Please allow for another 2-3 days to look into this. Feel free to update with any progress/finding/questions in the meantime.

    Best Regards,

    Allison

  • Hi Michael,

    Apologies for the delay over the weekend. I'm still trying to replicate this behavior on my setup but will keep you updated on the progress.

    Best Regards,

    Allison

  • Hi Michael,

    Sorry for the long delay - I've been trying to implement your sysconfig .c settings, but I have still been unable to replicate the signal you showed on the scope captures from earlier in the thread. Would you mind sending your full project (with just PWM and HRPWM implementations) so I can view the correct signal?

    Also wanted to check if you had a chance the chance to verify what I suggested prior (below)? I didn't see CMPBHR implemented in the Sysconfig .c. How are you updating these HR values?

    Can you also please enable half cycle clocking, be sure to use autoconversion, and implement the same values for CMPBHR as CMPAHR? 

     Have you made any further developments?

    Best Regards,

    Allison