2024-09-01 05:40 AM
I am using stm32h750vbt6 for pmsm foc. I want to know if there is a way to use hrtim in center aligned mode as it would be needed for svpwm.
Right now I'm updating the duty cycle with the following settings.
Set comparator value: counter value/2 - duty/2
Reset comparator value: counter value/2 + duty/2
And I'm updating on timer update event.
Is there any suggestions or I'm doing it right?
2024-09-03 06:40 AM
Hello,
The HRTIMER counters can operate in Up‐Down counting. This mode presents advantages for fixed switching frequency power converters. The HRTIM is natively designed with up-counters. It offers however an operating mode with up-down counters, also called center-aligned mode.
You can configure it by STM32CubeMx: "Up Down Mode",
Best regards.
2024-09-03 10:15 PM
I am using stm32h750vbt6, does this mcu has center aligned mode in hrtim because i dont see any option in stm32cubemx for it.
2024-09-03 11:43 PM
Hello,
Yes indeed, this feature is available for STM32G4 chip which contains an Hrtim version different from the one in h7.
Best regards.
2024-09-04 12:06 AM
I am talking about stm32h7 here, So kindly tell me if the solution i provided for center align in stm32h7 will work for me?
2024-09-04 01:22 AM
Hello,
Yes, this sounds correct, if the computation of SET/RESET events could be done fast enough regarding the PWM period.
Please, notice that enabling the preload of registers is a good practice, allowing the update to be taken in next update event and to ensure a coherency in registers values.
Best regards.