Missing complementary signals PWM1/3 when PWM module driven by A0/A2 timers outputs (MC56F8035 target)

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

Missing complementary signals PWM1/3 when PWM module driven by A0/A2 timers outputs (MC56F8035 target)

Jump to solution
2,690 Views
petercernan
Contributor I

Hello, I'm developing solar microinverter with MC56F8035. It includes two active clamp flyback converters. I need to drive both active clamp flyback converters using PWM0/1 and PWM2/3 signals which need to be 180 degres shifted. I found out that PWM module can not support 180 degrees shift between PWM0/1 and PWM2/3 signals directly. Therefore I applied software control to PWM module (to allow external signal to drive PWM module) and selected timer A0/A2 outputs as input signal for PWM module (in system integration module). This solution works for PWM0 and PWM2 outputs but I'm missing complementary PWM1/3 signals (even I applied complementary mode to PWM module). Any idea what's wrong? I'm using CW 5.9.0 and Quickstart 2.5.3 for configuration of PWM module and timers A0/A2 (and SIM module too). Any other ideas how to handle 180 degrees shift between PWM0/1 and PWM2/3 signals? PWM module setting attached too. Thanks for help in advance.

PWM_mudule_setting.bmp

0 Kudos
Reply
1 Solution
2,486 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Dear Peter,

I hope you can draw the required timing for the PWM0/1 and PWM2/3 pair so that we can design the timing based on the requirement. For your "two active clamp flyback converters", do you need the complementary signal or you just need PWM0 and PWM2 signal which should have 180 degree shift in order to distribute the energy on balance? Because in some case, it is possible that the PWM signal is high in dead time, we should avoid such case.

If you need complementary signal, it is a bit complicated, but it is feasible. In the case, you can use the Asymmetric PWM Output, set the ICC0/ICC1 bits as 11, while set the SWP23 in PWM_CCTRL as 1, which will swap the PWM2 and PWM3 signals. For example, if the duty cycle of both PWM0/PWM2 are less than 50, you can set in the follwoing:

PWMCNFG=0x00; //complementary mode

PWMICCTRL=0x03; //phase shift mode

PWMCCTRL|=0x02; //set the SWAP23 so that PWM0 and PWM2 phase shift 180 degree

//set the duty cycle of PWM0 and PWM2 less than 50%

PWMCMOD=1000;

PWMVAL0=(duty cycle *1000);

PWMCAL1=0;

PWMVAL2=1000;

PWMVAL3=(50%-duty cycle)*1000;

If the duty cycle is greater than 50% as you expected, you can set as following:

PWMCNFG=0x00; //complementary mode

PWMICCTRL=0x03; //phase shift mode

PWMCCTRL|=0x02; //set the SWAP23 so that PWM0 and PWM2 phase shift 180 degree

//set the duty cycle of PWM0 and PWM2 less than 50%

PWMCMOD=1000;

PWMVAL0=1000;

PWMCAL1=1000*(duty cycle -50%);

PWMVAL2=1000*(duty cycle-50%);

PWMVAL3=0;

Pls have a try.

If you do not need the complementary signal for example PWM1/PWM3, it is easy, clear the SWAP23,  but set the CINV2 bit, then compute the VAL0/VAL1/VAL2/VAL3 value, the theory is the same.

Hope it can help you

BR

Xiangjun Rong

View solution in original post

0 Kudos
Reply
7 Replies
2,486 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Dear Peter,

The PWM module of MC56F803x is not flexable to generate the complex timing of PWM signal for swich mode power supply. I do not know whether you have determined the processor, If your application is switch mode power supply application which need complicated timing, I suggest you use the eFlexPWM module which the MC56F84xxx(MC56F84789...), MC56F82xx(MC56F82748 or MC56F8257...), Kinetis KV family have integrated, the eFlexPWM is powerful to generate complex PWM timing.

This is the website of DSC:

Digital Signal Controllers|Freescale

This is the KV family with Cortex M4 core:

ARM Cortex-M0+/M4/M7 Cores|Kinetis V MCUs|Freescale

for the PWM module of MC56F8035, pls set the nBX bit in PWM_CCTRL register if the PWM signal timing is unexpected.

BR

XiangJun Rong

0 Kudos
Reply
2,486 Views
petercernan
Contributor I

Dear XiangJun Rong,

thank you very much for additional comments. The solar microinverter is cost sensitive application. The digital signal controller MC56F8035 I chose for this application mainly from the cost reason. So far MC56F8035 runs well so I do not assume to replace it actually. Thanks for note concerning nBX bit, I set it in graphic configuration tool for PWM module.

Have a nice day

Best regards

Peter

0 Kudos
Reply
2,486 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Dear Peter,

I have to say that the PWM module of MC56F8035 supports phase shift PWM signals(it is called Asymmetric PWM Output in the RM), of course, you can adjust the phase shift angle, in other words, the PWM module of MC56F8035 can output 180 degrees shift signals between PWM0/1 and PWM2/3 signals directly. For detailed information, pls refer to section 8.6.3 Asymmetric PWM Output in the MC56F80xxRM.pdf.

If you use the phase shift function of PWM module, you have to set the PWM module in complementary mode to both PWM0/1 and PWM2/3 pair by clearing the INDEP01 and INDEP23 in the PWMCNFG register, while you have to clear the IPOL0 and IPOL1 bits in PWMCTRL register. In order to generate the phase shift signals, you have to set the ICC0 and ICC1 bits in PWMICCTRL register, which means that PWM  Uses VAL0 register when the PWM counter is counting up. Use VAL1 register when counting down.

use the following PWM register setting:

PWMCNFG=0x00; //complementary mode

PWMICCTRL=0x03; //phase shift mode

PWMCMOD=1000;

PWMVAL0=1000;

PWMCAL1=0;

PWMVAL2=0;

PWMVAL3=1000;

The above setting can generate 180 degree shift signal with 50 duty cycle. It is unnecessary to use quadTimer to generate PWM signals and use PWM pins to output Timer signals as you have done.

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply
2,486 Views
petercernan
Contributor I

Dear Xiangjun.rong,

first of all, thank you very much for above mentioned PWM module setting (it helpes me to continue with my microinverter development). I tested mentioned PWM module setting with following findings:

- 180 degrees phase shift between PWM0/1 and PWM2/3 signals is present for 50% duty cycle only

- if I reduce duty cycle to 0% then phase shift between PMW0/1 and PWM2/3 reduces also to 0 degrees (consider that all PWMVALx registers for 0% duty cycle will have 0 value)

- my active clamp flyback coverters need to run with 0...75% duty cycle. The phase shift with mentioned solution will be not 180 degrees above 50% duty cycle again.

Still your solution reduces the switching noise in my control circuitry and output voltage rippel noise too. Any other idea how to reach constant 180 degrees shift between PWM0/1  and PWM2/3 signals for whole duty cycle range 0...75%?

Have a nice day

Best regards

Peter

0 Kudos
Reply
2,487 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Dear Peter,

I hope you can draw the required timing for the PWM0/1 and PWM2/3 pair so that we can design the timing based on the requirement. For your "two active clamp flyback converters", do you need the complementary signal or you just need PWM0 and PWM2 signal which should have 180 degree shift in order to distribute the energy on balance? Because in some case, it is possible that the PWM signal is high in dead time, we should avoid such case.

If you need complementary signal, it is a bit complicated, but it is feasible. In the case, you can use the Asymmetric PWM Output, set the ICC0/ICC1 bits as 11, while set the SWP23 in PWM_CCTRL as 1, which will swap the PWM2 and PWM3 signals. For example, if the duty cycle of both PWM0/PWM2 are less than 50, you can set in the follwoing:

PWMCNFG=0x00; //complementary mode

PWMICCTRL=0x03; //phase shift mode

PWMCCTRL|=0x02; //set the SWAP23 so that PWM0 and PWM2 phase shift 180 degree

//set the duty cycle of PWM0 and PWM2 less than 50%

PWMCMOD=1000;

PWMVAL0=(duty cycle *1000);

PWMCAL1=0;

PWMVAL2=1000;

PWMVAL3=(50%-duty cycle)*1000;

If the duty cycle is greater than 50% as you expected, you can set as following:

PWMCNFG=0x00; //complementary mode

PWMICCTRL=0x03; //phase shift mode

PWMCCTRL|=0x02; //set the SWAP23 so that PWM0 and PWM2 phase shift 180 degree

//set the duty cycle of PWM0 and PWM2 less than 50%

PWMCMOD=1000;

PWMVAL0=1000;

PWMCAL1=1000*(duty cycle -50%);

PWMVAL2=1000*(duty cycle-50%);

PWMVAL3=0;

Pls have a try.

If you do not need the complementary signal for example PWM1/PWM3, it is easy, clear the SWAP23,  but set the CINV2 bit, then compute the VAL0/VAL1/VAL2/VAL3 value, the theory is the same.

Hope it can help you

BR

Xiangjun Rong

0 Kudos
Reply
2,486 Views
petercernan
Contributor I

Dear Xiangjung Rong,

you last proposal inspired me to introduce final solution which works 100% according to my expectation (possibility to generate 0...75% duty for both PWM0/1 and PWM2/3 signals with constant phase shift of 180 degrees el. in whole duty range). If PWM2/3 signals are swapped and if inverted duty cycle logic is used for PWM2/3 then there is no necessity to set ICC0, ICC1 bits in PWMICCTRL register (so I use ICC0 = 0, ICC1 = 0). Still I'm running in asynchronous (center aligned) mode with loading of PWMVAL0 / PWMVAL2 registers only as follows (with swapped PWM2/3 signals):

- PWMVAL0 = CMOD*required_duty               (example: if CMOD = 480 and required duty = 10% then PWMVAL0=48)

- PWMVAL2 =CMOD-CMOD*required_duty    (example: if CMOD = 480 and required duty = 10% then PWMVAL2=480-480*0.1=432)

Item closed, thank you very much to you and whole support team from your side. I'm attaching PWM module configuration details and part of code with duty definition for your reference.

PWM module:

pastedImage_0.png

Duty cycle definition (PWM_A_load, PWM_B_load is requested duty for stage A/B):

pastedImage_1.png

0 Kudos
Reply
2,486 Views
petercernan
Contributor I

Dear Xiangjung Rong,

for my solar microinverter with active clamp flybacks I need complementary PWM0/1 and PWM2/3 signals. For easy understanding I ran Simetrix simulation to show to you how PWM signal should look at 10% and 70% duty cycle:

pastedImage_0.png

As you see on the picture the constant phase shift of 180 degrees el. is present between PWM0 and PWM2 signals at both 10% and 70% duty cycle.

PWM0/1 signals are complementary and PWM2/3 are complementary also. I'm using 100kHz switching frequency (10us period) with deadtime of 600ns.

I quickly tested your new proposal. The new setting for duty range 0...50% seems to work properly (constant shift of 180 Degrees in this duty range).

The setting for duty >75% seems not to work ( I have different duty for PWM0/1 and PWM2/3 what is not correct). Please double check.

You guys are great, it looks we are getting closer to final solution!

Have a nice day

Best regards

Peter

0 Kudos
Reply