2020-04-21 04:46 AM
I know that it is possible with HRTIM, but I need to know if it is also possible just with one TIMx timer
2020-04-21 05:20 AM
Yes, if all PWMs have the same clock period. Its a typical application for motor control. Details depend on the chip famiiy and pin availability.
2020-04-21 05:34 AM
Hi and thanks for the response!
I already implemented a 3x3 PWM (9 complementary outputs in total) to control a 3 phase system with 120 degrees in the PWM. I used HRTIM as master, TIM1 as master/slave and TIM8 as slave only.
There are 3 different duty cycles, each one for every phase.
What I did is to make 3 groups:
1) Group 1 - duty cycle 1
- HRTIM output 1 -- (phase 0)
- TIM1 output 1 -- (phase 120)
- TIM8 output 1 -- (phase 240)
2) Group 2- duty cycle 2
- HRTIM output 2 -- (phase 0)
- TIM1 output 2 -- (phase 120)
- TIM8 output 2 -- (phase 240)
3) Group 3 - duty cycle 3
- HRTIM output 3 -- (phase 0)
- TIM1 output 3 -- (phase 120)
- TIM8 output 3 -- (phase 240)
It works very good but if I want to add a break input (input in case of overcurrent) then my topology is not ideal at all, because the break input is per Timer.
That is the reason I asked if I can change my topology and to make all the 9 complementary outputs with the same 3 timers but, one timer per group (with 120 degrees between outputs).
So the ideal topology will be:
1) Group 1 - duty cycle 1
- HRTIM output 1 -- (phase 0)
- HRTIM output 2 -- (phase 120)
- HRTIM output 3 -- (phase 240)
2) Group 2- duty cycle 2
- TIM1 output 1 -- (phase 0)
- TIM1 output 2 -- (phase 120)
- TIM1 output 3 -- (phase 240)
3) Group 3 - duty cycle 3
- TIM8 output 1 -- (phase 0)
- TIM8 output 2 -- (phase 120)
- TIM8 output 3 -- (phase 240)
Is that possible?
Thanks!!
2020-04-21 05:34 AM
I am using STM32G474
2020-04-21 05:58 AM
Hello,
Fortunately, you are using the most appropriate STM32 for the job - that being the 'G4 which has the newest incarnation of the advanced timers. All three (1, 8, 20) have added the complementary output for the 4th channel, so you can drive 4 half-bridges, both high and low sides with desired dead-time. Channels 5 and 6 can be used to trigger the ADC, etc...
Additionally, the STM32G474 has the latest HTIMER, which now supports center-aligned mode. Hard to believe this feature was missed on the H7...
Regards,
Dave