2024-08-04 03:36 AM
Hi all,
I am trying to implement a dual active bridge in three phase system. You need one three phase PWM system on the primary and second three phase PWM system on the secondary. Phase shift of PWMs within primary are fixed 120 deg. Same on the secondary. You are controlling the power flow by changing the phase shift between the primary and the secondary system.
I started with the simple nucleo STM32F446RE and first tried to implement a single three phase PWM. I did it using 3 timers where TIM1 channel 1 is used for PWM generation and channel 2 as Output compare No Output. TIM2 is in a slave mode Trigger Mode and trigger source is ITR0 from TIM1. Similarly, TIM2 has channel 1 configured as PWM output and channel 2 as Output Compare No Output which triggers TIM3, the last PWM output.
I am wondering now how to implement the phase shift between the primary and secondary. I think i have run out of ITRxs if I would like to continue in this way for the second three phase system. Should I look for the MCU which has more of these ITRxs linked within the timers or do you suggest some better approach?
Thank you in advance for your help.
2024-08-04 04:35 AM
Hi,
so you need/want :
- 6 pwm outputs , driver has deadtime hi/lo
- 12 pwm outputs , out + /out with deadtime from timer for hi/lo
?
Using TIM1 + 8 you could generate 3 (or 6 hi/lo ) pwm outputs on each timer, then shifting just with the signals from second timer (rel. to the first).
Show a timing diagram, with the 3 signals and the shifted 3 . (would help to know, what you expect...)
2024-08-05 02:34 AM
Hi AScha.3,
thank you for your answer. See the attached signals diagram from LTspice simulation (deadtime is missing but should be clear, the top plane is primary, the plane below is the secondary).
There will be 3 PWM signals on primary + 3 complementary and the same on secondary. Total 12 output signals. If possible, add deadtime to signals. The deadtime can be also handled afterwards by HW.
So you suggest to use one single timer to generate the three phase PWM system. I am not sure now how to implement this shift of 3 phases using only a timer but I will take a look. Should I use the timer output channels as "PWM_MODE"?
2024-08-05 03:17 AM - edited 2024-08-05 03:25 AM
Hi,
> this shift of 3 phases using only a timer
yes, thats why i want to see the timing, you expect - so i see no way, to do it with one tim.
Just thinking :
using TIM1, you could make ch1/2 and ch3/4 in combined mode, to get 2 free (start + end) settable pulses; h1 + h2.
another timer (TIM3 ?) gets started/triggered by TIM1/ch5 , to make the h3 pulse .
Then using TIM8, sync to TIM1, you could here also make ch1/2 and ch3/4 in combined mode, to get 2 free (start + end) settable pulses; same or shifted position, th1 + th2.
+ also another timer (TIM4 ?) gets started/triggered by TIM8/ch5 , to make the th3 pulse .
If the internal connections allow this, to choose as needed here - i didnt check (look, whats possible..).
If not , or not all , still can put a wire to connect a signal on a pin to another (for ETR , external trigger).
But this way you could get 3 pulses (with overlap) and 3 with free position, no shift or variable shift.
ED.: forget it. Your F446 has no combined mode...simple timer here.
I never used this, just F303 - with more complex timer on TIM1+8 .
2024-08-05 06:31 AM
Hello Adamp,
If you're at liberty to change processors, maybe consider the STM32G474 HRTIME1. This timer has amazing flexibility plus you would be on a newer generation series.
Regards,
Dave
2024-08-11 12:20 PM
Hello
I would like to suggest using STM32G47xxx/48xxx with HRTIMv2. There you can set Master timer to provide 3 trigger start events to make the 120* phase-shifts and use the 6 subtimers to generate the complementary PWMs for each half-bridge leg with secondary ones adding delay for the DAB phase-shift.
Best regards,
Vankata
2024-08-11 11:55 PM
Thank you all for recommendation, I have already ordered STM32G474RE.
Replying to @Vankata513 , I have seen in the reference manual, that the HRTIM has a function of Interleaved Mode for genarting 3ph PWM (with complementary signals), seems like the thing I would like to use. Still, I am not sure how to implement the phase shifted signals for the secondary. I will need to take a closer inspection, but from what you recommend, I don't see, how to implement the phase shift between primary and secondary. Could you be little bit more specific?
Thanks in advance.