cancel
Showing results for 
Search instead for 
Did you mean: 

Using HRTIM with brushless motor with BEMF zero crossing

Singh.Harjit
Senior II

As I understand it, when using BEMF feedback, the BEMF from a phase is compared to the "center tap" voltage and the output is used to capture a timer's count. This count is used to determine when to commutate the motor.

The comparator output is noisy, so, windowing is used to detect the transition. Essentially, the comparator signal is sensed during a portion of the PWM cycle - away from the switching edge.

Has anyone implemented this on an ST part using the HRTIM? If so, can you share details around what you did and how you configured the HRTIM?

If you haven't done this using the HRTIM, what about the other ST timers? If so, can you share details on how you did this?

Thanks.

2 REPLIES 2
Laurent Ca...
Lead II

Dear @Singh.Harjit​ 

Could you give more details to the STM32 Community about the material you use (HW and SW, CPU(s), tools and versions, board(s), motor(s) and so on)?

And more especially did you use MC tools (such as MC_suite, MC-Motor Profile, MC-SDK, MC-workbench, and so on)?

Best regards

Laurent Ca...

====

Dear @Laurent Ca...​ ,

Thank you for the reply.

HW: STM32G474

SW: Bare metal

Compiler: GCC

Motors: PMSM quadcopter type of BLDC motor: https://betafpv.com/products/08028-12000kv-brushless-motors

I have characterized the motor and it has a very low time constant: 10.3us (L = 3uS; R = 0.28Ohms).

I'm planning to run the PWM between 100kHz and 200kHz and use 6-step with BEMF using comparator for zero crossing detection.

Due to other constraints I cannot use the STM MC tools. I will write the BLDC controller myself.

I have two questions:

1) How to generate the PWM - I want to minimize the number of interrupts. I don't want to take an interrupt at the PWM period (5us to 10us). Is there a way to configure the HRTIM to generate a certain number of PWM periods and then generate an interrupt? I was thinking maybe the repetition counter can do this but it doesn't it can.

2) How to configure the BEMF window. I was thinking of using up down counter but I don't know if that makes sense with 6 step.

Thanks,

Harijt