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.
Tool/software:
Hello,
I'm using HRPWM for phase shift on two out of three EPWM modules, and the MEP steps work fine till about a value of 8, then step 9 is smaller than the previous, and from step 9 and up the phase shift doesn't change. I'm using the HRPWM_setHiResPhaseShiftOnly() function to set MEP values and confirming that the TBPHS and TBPHSHR registers are set correctly. The config registers are set to: TBPHSHRLOADE is 1, EDGMODE is 11, EDGMODEDB is 11, CTLMODE is 1, and CTLMODEB is 1.
What reasons might cause this behavior?
Cheers, Bryon
Hi Bryon,
Please refer to below threads :
Please check if the configurations are as described in threads above
Thanks
Hello,
These two threads are not relevant as I'm not using SFO (lab conditions), and using a down-count (not up-down).
I have changed the EPWM clock from 200 MHz to 100 MHz, and the "saturation limit" of the MEP steps is about 40 (instead of 8-9 when working at 200 MHz).
Does this help identify the problem? Is there an example using HR phase shift?
Cheers, Bryon
There is no example specifically for HR phase shift. With or without SFO doesn't matter as long as you don't care about accuracy
These two threads are not relevant as I'm not using SFO (lab conditions), and using a down-count (not up-down).
Only High-resolution period is not compatible with down-count mode.
I have tried changing the phase shifted ePWMs to up down count mode, and that cleared up the phase shift saturation, but I'm dealing with multiple other issues now related to timing since I need to manually align the ePWMs to overcome the lead pulse in down mode, and the following pulses in up-down mode.
Can you suggest other solutions that might deal with the issue?
When I increase the rising deadband to greater than 4 T_TBCLK/2 steps the phase shift works OK for one ePWM but not for the other.
Hi Bryon,
Is deadband also in HR mode or just phase shift in HR ?
When I increase the rising deadband to greater than 4 T_TBCLK/2 steps the phase shift works OK for one ePWM but not for the other.
When you say other pwm doesnot work what is the configuration of that pwm how is that related to the configuration of the other pwm ?
Can you share a simplified project file which I can use to reproduce the issue at my end
Thanks
Another interesting observation: while the phase shift of the rising edge is saturated at MEP ~ 8-9, the phase shift of the falling edge is at HR resolution without MEP steps limiting - all MEP steps look good.
Clarification to previous observation: the falling edge isn't HR.
So to clarify, ePWM1 is phase shifted from ePWM2, and ePWM1 is HR for phase shift and deadband.
What I see when ePWM1 DTrise >= 10 nsecs is that ePWM1-A works normally, but ePWM1-B's falling has MEP step saturation. Other edges are fine.
When ePWM1 DTrise = 0 nsecs, ePWM1-A's rising and ePWM1-B's falling edges have MEP step saturation.
When ePWM1 DTrise = 5 nsecs, ePWM1-A's rising and ePWM1-B's falling edges have MEP step saturation, but ePWM1-B saturates at about double the MEP steps.
Hope this helps.
Hey Prarthan,
I've sent you the project file internally, LMK if you got it and its ok.
BR,
Nathan
Hi Bryon, Nathan,
Sorry for the delay.
Please allow me till early next week to get to debug the code.
Thanks
Hi Bryon,
I wasnt able to debug the code that you provided, still to complex to debug I was just looking for a simple epwm cutdown code
Although I have attached here the HRPWM phase shift and Deadband rising edge HR example by modifying one of the existing example in the code.
For phase shift see how when I change the TBPHSHR the phase shift changes between PWM1A and PWM2A.
For HR rising edge delay, see how changing DBREDHR the rising edge is delayed between PWM2A and PWM2B. Here RED is applied on PWM2A
hrpwm_ex_phaseshift_slider_f28p65x.zip
Hi Prarthan,
I'll look at your example, and modify the code of my example for better debugging.
Cheers, Bryon
HI Prarthan,
I have sent Nathan your phaseshift_slider project modified for down-count (HR not working at all), and my project reduced with automated MEP cycling.
Please not that your down-count modified PS example doesn't use the HR register values at all, but when you turn autoconvert OFF (ie not using SFO?) the HR edges appear within the PWMA pulse.
Hope this helps.
Cheers, Bryon
Hi Bryon,
I received your modified file but haven't got to run them yet.
Let me get to it tomorrow.
Although question on below, would you be open to work with up-down count mode or down count is must for you ? There maybe some HRPWM limitation wrt to down count mode which I can check and let you know.
phaseshift_slider project modified for down-count
My example is in up-down count mode and changing the TBPHSHR for epwm2a, not sure what you meant by below ?
down-count modified PS example doesn't use the HR register values at all, but when you turn autoconvert OFF (ie not using SFO?) the HR edges appear within the PWMA pulse.
Thanks.
Hi Parathan,
I tried up-down count mode but had other (more complicated) issues with timings between ePWMs. The PWM sequence is easiest in down count since ePWM1 and ePWM3 timings follow from the leading edge of ePWM2A.
Regarding your example, when I changed the example to down-count, HR phase shift stopped working even though all registers appear to be set up correctly. I tried to debug the issue by turning off SFO (autoconvert = OFF), and this produced strange results which can be seen on a connected scope (HR "edges" appear within pulse on figure below):
Hi Bryon,
Yes I see similar issue with down count mode. With auto conversion On, no HR movement.
With autoconversion off, yes if the action qualiiers are either zero or period with auto conversion off, there are bumps. But when I use CMPA and CMPB with AUTOCONV off then it works fine. If you want to use down count then this can be an option, where you set the CMPA to be very small value and set action on CMPA and CMPB instead of PRD or Zero.
Other option which is what I would recommend is to use UP count mode, I have tested the up- count mode with various action qualifiers and AUTOCONV ON it seems to work fine. This is similar to downcount with an exception that it counts up from zero instead of counting down, but I see no fundamental difference in its working wrt to pwm.
Let me know if you need any help in making it work in up count mode. You can suppress the message " If counter mode is up count mode and if HR mode is enabled then action qualifier settings need to be set on PRD and clear on CMPXU" in up count mode in sysconfig. I didnt see any issue with this wrt TBPHSHR.
Thanks
Hi Prarthan,
We have been avoiding up-count since according to the reference manual it does not work with deadband control:
Can you confirm that HR deadband control and HR phase shift will work together in up count mode?
Cheers, Bryon
Yes I have tried using DBHR and PHSHR in up-count works fine. The note above needs to be revised in upcoming revisions
Please try and let me know if you have any issues.