MPC5777C/ETPU A/PWM Period Change during runtime

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5777C/ETPU A/PWM Period Change during runtime

484 Views
jin_hyeon_ji
Contributor I

Hello

I’m implementing Variable PWM Switching Frequency Technic using

MPC5777C/ETPU A Engine/PWMM API, and currently trying to debug

Some weird ETPU Engine behavior during frequency change while PWM running

Here’s the waveform that shows what happens during frequency change :

jin_hyeon_ji_5-1711444560061.png

1. When PWM frequency(period) is changed and updated

(PWM frequency change is done in DMA Interrupt which is triggered when 

 AD Conversion from EQADC module is finished, 

 and configured by updating data directly to the address of etpu pwmm & ASAC module

ex *(cpbaPWM + ((0x31 - 1)<<2)) = fsw) 

2. PWM Top on it's full duty, and Bottom on it's zero duty

(Doesn't happen in reverse condition(=Bot full duty, Top zero duty))

3. PWM Top & Bot both turns on, which causes Arm Short

4. And the strangest part is that the turn on duty of PWM Bot is the same as that of ASAC Trigger on duty(deadtime discarded)

5. Also this top&bot both turn on situation only happens when

: Double Update(Frame and Center Update) / Falling Edge of ASAC Trigger 

 

The etpu_pwmm API and etpu_gct.c files I'm using is the same one as the pwmm API

shown in AN5374 : eTPU library used in an application

The basic pwm configurations in etpu_gct.c file that I've done are listed below as pictures :

jin_hyeon_ji_0-1711444012818.png

jin_hyeon_ji_1-1711444076331.png

jin_hyeon_ji_2-1711444116034.png

jin_hyeon_ji_3-1711444143952.pngjin_hyeon_ji_4-1711444156644.png

To abstract the basic pwm setup I've done :

1.Double Sampling : A/D Conversion Triggered on both rising and falling edge of ASAC Trigger

2.Double Update(Half Cycle Reload) : Frame and Center Update

3. Center-Aligned

4. Complementary Mode

5. Using DMA Interrupt to get the ADC result and pwm duty updated 

 

This Top&Bot both turning-on at the same time(=arm short) issue 

is really critical when controlling IPMSM with IGBT,

so could you please help me with this problem?

Thank you very much for your help

0 Kudos
Reply
2 Replies

331 Views
MilanBrejl
NXP Employee
NXP Employee

Hello Hyeon,

I think the issue is writing the PERIOD directly to eTPU PWMM parameters:
ex *(cpbaPWM + ((0x31 - 1)<<2)) = fsw) 

The correct way is to use API function fs_etpu_pwmm_config(...). Note, the API function not only writes the new PERIOD value to eTPU memory but also writes HSRR. Consequently, the eTPU FW executes a thread which takes over the new PERIOD and other parameters, applies them coherently, checks timing.

0 Kudos
Reply

440 Views
jin_hyeon_ji
Contributor I

I found out some more issues related to my question above, about PWM frequency change during runtime

PWM Top Ch Output == PWM Bot Ch Output identical issue when Top Ch Full Duty, PWM period changing : 

1) PWM Update is set to FRAME & CENTER update

2) Triggered to sample on falling edge of ADC Trigger(ASAC)

3) PWM Top Ch on it's full duty, Bot Ch full turn off(0 duty)

4) PWM period changing   

When all of those conditions above are set,

PWM top channel and bottom channel output is completely same

Here’s the waveform that describes such situation :

jin_hyeon_ji_0-1711519253143.png

From the waveform posted above, you can see that

the pink pwm(pwm top ch) and the navy pwm(pwm bot ch) output is completely same...!

 

I really want to know how to solve this problem, 

when ampling on both rising and falling edge of ASAC Trigger when set to sync with PWM master of ETPU

and PWM update set on both frame and center, and change PWM during runtime,

top(base) and bottom(complementary) channel both turning on.

 

Could you please give me some advice about this?

Thank you

 

 

0 Kudos
Reply