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.

Regarding HRPWM in piccolo

Other Parts Discussed in Thread: TMS320F28069, CONTROLSUITE

Hi,

I am using TMS320F28069 DSP in product development. I want to use high resolution on both edge of PWM. So I used HRPWM. But I getting some problem.

When I applied fraction part of duty to CMPAHR, then pulse width of channel B is also change (reduced). And pulse width of channel A is reduced instead of increasing.

Find attachment for more detail.

Regards,

HimanshuHRPWM in piccolo.pdf

  • Hello,


    After looking at the code, my suggestion would be to disable TBCLKSYNC before configuring the ePWM/HRPWM modules and then to enable TBCLKSYNC after enabling HRPE. These steps are needed for using high resolution period. You can refer to Section 4.2.3.4.1 High-Resolution Period Configuration of the TRM for the full list of steps.

    Modify your code as shown below:

    SysCtrlRegs.PCLKCR0.bit.HRPWMENCLK = 1; // HRPWM
    SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 0; // Add this line of code here to disable TBCLK within the EPWM

    // Omitting code here

    (*ePWM[j]).HRPCTL.bit.HRPE = 1;
    SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1; // Add this line of code here to enable TBCLK within the EPWM



    Elizabeth
  • Thanks for your kind attention.
    I done the same things that your suggested.
    But still problem is not solved. I get the PWM as same as mention in report.

    Regards,
    Himanshu
  • Hi,
    Changing CMPAHR value should not have any impact on the PWMB output.
    Regarding PWMA - I believe, you are seeing the correct behavior.
    From your configuration, it seems like you are set for symmetric mode of operation (Up-down mode). Changing CMPA or CMPAHR should result in a change of duty cycle in the same direction.
    Did you get a chance to evaluate any of the examples provided in controlSuite?
  • Hi,

    Yes, I am using Up-down mode. Let first discuss on ISSUSE-1 as mention in attachment.
    In which if I set
    Epwm1Regs.CMPA.half.CMPAHR = 0
    Epwm1Regs.CMPA.half.CMPA = 5

    (*ePWM[j]).HRCNFG.bit.EDGMODE = 2;
    (*ePWM[j]).HRPCTL.bit.TBPHSHRLOADE = 0;
    (*ePWM[j]).HRPCTL.bit.HRPE = 0;

    then PWM duty cycle is 0.111uSec. But if I change the setting as below then I got PWM duty cycle 0.123uSec instead of 0.111uSec.
    (*ePWM[j]).HRCNFG.bit.EDGMODE = 3; // control on both edge
    (*ePWM[j]).HRPCTL.bit.TBPHSHRLOADE = 1;
    (*ePWM[j]).HRPCTL.bit.HRPE = 1;

    Regards,
    Himanshu
  • Hi Himanshu,

    Can you try the following?
    - Start operation in certain mode of your choice
    - Enable AUTOCONV
    - Perform calibration using SFO
    - Change the values of CMPA, CMPAHR and observe the duty cycle changes.
    Let me know your observation.
    You could also refer to the controlSuite examples.


  • Hi,

    I am following same procedure to observe the duty cycle as you suggested. And I am also using SFO library and calling in background at every 1 sec. It gave 81 as Mep_scalefactor.

    Regards,
    Himanshu
  • Himanshu,

    MEP scale factor seems appropriate.
    My earlier question, when you set in one mode of operation - and change values of CMPA/HR what is your observation of the changes?
    Are they in expected line?
  • Hi,

    I already done that you said me. And I already shown the result in my attachment in ISSUE-2 and ISSUE-3. PWM width of channel A is changing as per the fraction part.

    Regards,
    Himanshu
  • Hi Himanshu,

    Thank you for the checks done.
    I'm unclear on why changing CMPAHR is having any effect on PWMB output.
    Is this occurring under particular condition ex:when you change from CMPAHR from Zero to Non-Zero value or so?
    Or does PWMB output change every time you change CMPAHR value?
    This is unexpected behavior. If so, i would like to debug this further.
    What is the hardware platform you are using?
    Is it possible to share the project - so that i can replicate the issue?
  • Hi,
    thanks for your kind attention.
    We developed our control board using TMS320F28069 and I am checking HRPWM with that board.
    Sorry to say but I can't share the project with you. But I already shared my initialization, settings of PWM with you in attachment.
    When I change CMPAHR from Zero to Non-Zero value, the PWMB output change. Then after it is remain constant for that CMPA value and any non-zero value of CMPAHR.

    Regards,
    Himanshu
  • Hi,
    Is there any update?

    Regards,
    Himanshu
  • Hi Himanshu,

    Tried replicating the issue with the configuration you provided - and did not observe any issue.
    There is no effect of CMPAHR on PWMB duty cycle.
    Are you able to consistently observe this or once in a while? Did you check on different parts and observe similar behavior?
    One more thing I suggest is can you check for this by disabling deadband? 

    -Bharathi.

  • hrpwm_mult_ch_prdupdown_sfo_v6.rarHi,

    As you suggested me to check with the example code. I checked with the “hrpwm_mult_ch_prdupdown_sfo_v6” of control suite. I attached the project for your reference. I made some changed as per my requirement. In this project also I observed the change in PWMB output. Please verified the attached project.

    Regards,

    Himanshu

  • Hi,
    Is there any update?

    Regards,
    Himanshu
  • Hi Himanshu,

    I got a chance to experiment with the code you sent. I did not observe any issues with PWMB duty cycle.
    Did you see this behavior on all EPWMs? Also, how is this affecting your application - i just wanted to understand if there is any other source causing this behavior on your board/application.

    -Bharathi.
  • Hi,
    Thanks for verifying my code.
    Can you share the waveform of EPWM1A and EPWM1B with
    Epwm1Regs.CMPA.half.CMPA = 5
    and different value of CMPAHR.

    Regards,
    Himanshu
  • Hi,

    Waiting for your response.

    Regards,
    Himanshu
  • Hi,

    Waiting for the waveform of EPWM1A and EPWM1B with
    Epwm1Regs.CMPA.half.CMPA = 5
    and different value of CMPAHR.

    Regards,
    Himanshu
  • Hi,

    Waiting for your response.

    Regards,
    Himanshu
  • Hi,

    As mentioned earlier - I did not observe any issues with PWMB duty cycle.
    To debug your issue further, it would be good if we can trace the source of the problem - and hence the question earlier.
    "Did you see this behavior on all EPWMs? Also, how is this affecting your application - i just wanted to understand if there is any other source causing this behavior on your board/application."

    -Bharathi.