HRTIM inserting 100% duty cycle pulse into PWM
- October 14, 2020
- 4 replies
- 3691 views
Hello,
I am working on BLDC driver based on STM32. I am using HRTIM to generate 3 complimentary PWMs at 20Khz in up-down counting mode. Every now and then, a single pulse of the PWM is wrong, like it would have 100% duty cycle. The issue is non periodic (seems to happen in random time intervals, ranging from ~0.1 Hz to ~10Hz), and happens on all channales of the HRTIM. It results in a loud audible noise from the motor.
On the image below you can see an oscilloscope screen of the event. Top curve is current on the one of the motor phases, the lower two are complimentary PWMs (on the STM side, before the mosfet driver). I am using 20 kHz control loop for updating the PWMs duty cycle with normalisation in place to make sure i never accidentally write illegal value to the register. I have tried both with Reload Enabled and Disabled. I have also tied to lower the control loop frequency to 12 kHz and 5 kHz but the issue persisted.